@carandesign/drawui 0.1.2 → 0.2.2

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.
package/dist/drawui.es.js CHANGED
@@ -1,28 +1,28 @@
1
- import st, { createContext as nt, useContext as rt, useRef as E, useState as U, useEffect as C } from "react";
2
- var ce = { exports: {} }, Y = {};
1
+ import st, { createContext as nt, useContext as rt, useRef as O, useState as Y, useEffect as R } from "react";
2
+ var ce = { exports: {} }, Z = {};
3
3
  var je;
4
4
  function ot() {
5
- if (je) return Y;
5
+ if (je) return Z;
6
6
  je = 1;
7
7
  var o = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function n(s, t, r) {
8
+ function s(t, n, r) {
9
9
  var i = null;
10
- if (r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), "key" in t) {
10
+ if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) {
11
11
  r = {};
12
- for (var a in t)
13
- a !== "key" && (r[a] = t[a]);
14
- } else r = t;
15
- return t = r.ref, {
12
+ for (var a in n)
13
+ a !== "key" && (r[a] = n[a]);
14
+ } else r = n;
15
+ return n = r.ref, {
16
16
  $$typeof: o,
17
- type: s,
17
+ type: t,
18
18
  key: i,
19
- ref: t !== void 0 ? t : null,
19
+ ref: n !== void 0 ? n : null,
20
20
  props: r
21
21
  };
22
22
  }
23
- return Y.Fragment = e, Y.jsx = n, Y.jsxs = n, Y;
23
+ return Z.Fragment = e, Z.jsx = s, Z.jsxs = s, Z;
24
24
  }
25
- var B = {};
25
+ var X = {};
26
26
  var $e;
27
27
  function at() {
28
28
  return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
@@ -51,19 +51,19 @@ function at() {
51
51
  ), p.$$typeof) {
52
52
  case m:
53
53
  return "Portal";
54
- case G:
55
- return p.displayName || "Context";
56
54
  case z:
55
+ return p.displayName || "Context";
56
+ case C:
57
57
  return (p._context.displayName || "Context") + ".Consumer";
58
- case K:
59
- var M = p.render;
60
- return p = p.displayName, p || (p = M.displayName || M.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
58
+ case N:
59
+ var w = p.render;
60
+ return p = p.displayName, p || (p = w.displayName || w.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
61
61
  case se:
62
- return M = p.displayName || null, M !== null ? M : o(p.type) || "Memo";
63
- case $:
64
- M = p._payload, p = p._init;
62
+ return w = p.displayName || null, w !== null ? w : o(p.type) || "Memo";
63
+ case D:
64
+ w = p._payload, p = p._init;
65
65
  try {
66
- return o(p(M));
66
+ return o(p(w));
67
67
  } catch {
68
68
  }
69
69
  }
@@ -72,35 +72,35 @@ function at() {
72
72
  function e(p) {
73
73
  return "" + p;
74
74
  }
75
- function n(p) {
75
+ function s(p) {
76
76
  try {
77
77
  e(p);
78
- var M = !1;
78
+ var w = !1;
79
79
  } catch {
80
- M = !0;
80
+ w = !0;
81
81
  }
82
- if (M) {
83
- M = console;
84
- var _ = M.error, P = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object";
82
+ if (w) {
83
+ w = console;
84
+ var _ = w.error, P = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object";
85
85
  return _.call(
86
- M,
86
+ w,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
88
  P
89
89
  ), e(p);
90
90
  }
91
91
  }
92
- function s(p) {
92
+ function t(p) {
93
93
  if (p === b) return "<>";
94
- if (typeof p == "object" && p !== null && p.$$typeof === $)
94
+ if (typeof p == "object" && p !== null && p.$$typeof === D)
95
95
  return "<...>";
96
96
  try {
97
- var M = o(p);
98
- return M ? "<" + M + ">" : "<...>";
97
+ var w = o(p);
98
+ return w ? "<" + w + ">" : "<...>";
99
99
  } catch {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
- function t() {
103
+ function n() {
104
104
  var p = x.A;
105
105
  return p === null ? null : p.getOwner();
106
106
  }
@@ -109,16 +109,16 @@ function at() {
109
109
  }
110
110
  function i(p) {
111
111
  if (S.call(p, "key")) {
112
- var M = Object.getOwnPropertyDescriptor(p, "key").get;
113
- if (M && M.isReactWarning) return !1;
112
+ var w = Object.getOwnPropertyDescriptor(p, "key").get;
113
+ if (w && w.isReactWarning) return !1;
114
114
  }
115
115
  return p.key !== void 0;
116
116
  }
117
- function a(p, M) {
117
+ function a(p, w) {
118
118
  function _() {
119
- D || (D = !0, console.error(
119
+ I || (I = !0, console.error(
120
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
- M
121
+ w
122
122
  ));
123
123
  }
124
124
  _.isReactWarning = !0, Object.defineProperty(p, "key", {
@@ -126,23 +126,23 @@ function at() {
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function l() {
129
+ function c() {
130
130
  var p = o(this.type);
131
- return F[p] || (F[p] = !0, console.error(
131
+ return q[p] || (q[p] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
133
  )), p = this.props.ref, p !== void 0 ? p : null;
134
134
  }
135
- function u(p, M, _, P, ie, we) {
135
+ function u(p, w, _, P, ie, Me) {
136
136
  var T = _.ref;
137
137
  return p = {
138
138
  $$typeof: g,
139
139
  type: p,
140
- key: M,
140
+ key: w,
141
141
  props: _,
142
142
  _owner: P
143
143
  }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(p, "ref", {
144
144
  enumerable: !1,
145
- get: l
145
+ get: c
146
146
  }) : Object.defineProperty(p, "ref", { enumerable: !1, value: null }), p._store = {}, Object.defineProperty(p._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
@@ -162,14 +162,14 @@ function at() {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: we
165
+ value: Me
166
166
  }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
167
167
  }
168
- function c(p, M, _, P, ie, we) {
169
- var T = M.children;
168
+ function l(p, w, _, P, ie, Me) {
169
+ var T = w.children;
170
170
  if (T !== void 0)
171
171
  if (P)
172
- if (j(T)) {
172
+ if ($(T)) {
173
173
  for (P = 0; P < T.length; P++)
174
174
  h(T[P]);
175
175
  Object.freeze && Object.freeze(T);
@@ -178,12 +178,12 @@ function at() {
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
180
  else h(T);
181
- if (S.call(M, "key")) {
181
+ if (S.call(w, "key")) {
182
182
  T = o(p);
183
- var H = Object.keys(M).filter(function(tt) {
183
+ var G = Object.keys(w).filter(function(tt) {
184
184
  return tt !== "key";
185
185
  });
186
- P = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", V[T + P] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ P = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", B[T + P] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
@@ -192,15 +192,15 @@ React keys must be passed directly to JSX without using spread:
192
192
  <%s key={someKey} {...props} />`,
193
193
  P,
194
194
  T,
195
- H,
195
+ G,
196
196
  T
197
- ), V[T + P] = !0);
197
+ ), B[T + P] = !0);
198
198
  }
199
- if (T = null, _ !== void 0 && (n(_), T = "" + _), i(M) && (n(M.key), T = "" + M.key), "key" in M) {
199
+ if (T = null, _ !== void 0 && (s(_), T = "" + _), i(w) && (s(w.key), T = "" + w.key), "key" in w) {
200
200
  _ = {};
201
- for (var ye in M)
202
- ye !== "key" && (_[ye] = M[ye]);
203
- } else _ = M;
201
+ for (var ye in w)
202
+ ye !== "key" && (_[ye] = w[ye]);
203
+ } else _ = w;
204
204
  return T && a(
205
205
  _,
206
206
  typeof p == "function" ? p.displayName || p.name || "Unknown" : p
@@ -208,18 +208,18 @@ React keys must be passed directly to JSX without using spread:
208
208
  p,
209
209
  T,
210
210
  _,
211
- t(),
211
+ n(),
212
212
  ie,
213
- we
213
+ Me
214
214
  );
215
215
  }
216
216
  function h(p) {
217
- f(p) ? p._store && (p._store.validated = 1) : typeof p == "object" && p !== null && p.$$typeof === $ && (p._payload.status === "fulfilled" ? f(p._payload.value) && p._payload.value._store && (p._payload.value._store.validated = 1) : p._store && (p._store.validated = 1));
217
+ f(p) ? p._store && (p._store.validated = 1) : typeof p == "object" && p !== null && p.$$typeof === D && (p._payload.status === "fulfilled" ? f(p._payload.value) && p._payload.value._store && (p._payload.value._store.validated = 1) : p._store && (p._store.validated = 1));
218
218
  }
219
219
  function f(p) {
220
220
  return typeof p == "object" && p !== null && p.$$typeof === g;
221
221
  }
222
- var d = st, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), y = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), G = /* @__PURE__ */ Symbol.for("react.context"), K = /* @__PURE__ */ Symbol.for("react.forward_ref"), ee = /* @__PURE__ */ Symbol.for("react.suspense"), te = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), $ = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), x = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, j = Array.isArray, I = console.createTask ? console.createTask : function() {
222
+ var d = st, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), y = /* @__PURE__ */ Symbol.for("react.profiler"), C = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), ee = /* @__PURE__ */ Symbol.for("react.suspense"), te = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), x = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, $ = Array.isArray, W = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
225
  d = {
@@ -227,79 +227,79 @@ React keys must be passed directly to JSX without using spread:
227
227
  return p();
228
228
  }
229
229
  };
230
- var D, F = {}, oe = d.react_stack_bottom_frame.bind(
230
+ var I, q = {}, oe = d.react_stack_bottom_frame.bind(
231
231
  d,
232
232
  r
233
- )(), ae = I(s(r)), V = {};
234
- B.Fragment = b, B.jsx = function(p, M, _) {
233
+ )(), ae = W(t(r)), B = {};
234
+ X.Fragment = b, X.jsx = function(p, w, _) {
235
235
  var P = 1e4 > x.recentlyCreatedOwnerStacks++;
236
- return c(
236
+ return l(
237
237
  p,
238
- M,
238
+ w,
239
239
  _,
240
240
  !1,
241
241
  P ? Error("react-stack-top-frame") : oe,
242
- P ? I(s(p)) : ae
242
+ P ? W(t(p)) : ae
243
243
  );
244
- }, B.jsxs = function(p, M, _) {
244
+ }, X.jsxs = function(p, w, _) {
245
245
  var P = 1e4 > x.recentlyCreatedOwnerStacks++;
246
- return c(
246
+ return l(
247
247
  p,
248
- M,
248
+ w,
249
249
  _,
250
250
  !0,
251
251
  P ? Error("react-stack-top-frame") : oe,
252
- P ? I(s(p)) : ae
252
+ P ? W(t(p)) : ae
253
253
  );
254
254
  };
255
- })()), B;
255
+ })()), X;
256
256
  }
257
- var De;
257
+ var ze;
258
258
  function it() {
259
- return De || (De = 1, process.env.NODE_ENV === "production" ? ce.exports = ot() : ce.exports = at()), ce.exports;
259
+ return ze || (ze = 1, process.env.NODE_ENV === "production" ? ce.exports = ot() : ce.exports = at()), ce.exports;
260
260
  }
261
- var w = it();
262
- function Te(o, e, n) {
261
+ var M = it();
262
+ function Te(o, e, s) {
263
263
  if (o && o.length) {
264
- const [s, t] = e, r = Math.PI / 180 * n, i = Math.cos(r), a = Math.sin(r);
265
- for (const l of o) {
266
- const [u, c] = l;
267
- l[0] = (u - s) * i - (c - t) * a + s, l[1] = (u - s) * a + (c - t) * i + t;
264
+ const [t, n] = e, r = Math.PI / 180 * s, i = Math.cos(r), a = Math.sin(r);
265
+ for (const c of o) {
266
+ const [u, l] = c;
267
+ c[0] = (u - t) * i - (l - n) * a + t, c[1] = (u - t) * a + (l - n) * i + n;
268
268
  }
269
269
  }
270
270
  }
271
- function ct(o, e, n) {
272
- const s = [];
273
- o.forEach((t) => s.push(...t)), Te(s, e, n);
271
+ function ct(o, e, s) {
272
+ const t = [];
273
+ o.forEach((n) => t.push(...n)), Te(t, e, s);
274
274
  }
275
275
  function lt(o, e) {
276
276
  return o[0] === e[0] && o[1] === e[1];
277
277
  }
278
- function ut(o, e, n, s = 1) {
279
- const t = n, r = Math.max(e, 0.1), i = o[0] && o[0][0] && typeof o[0][0] == "number" ? [o] : o, a = [0, 0];
280
- if (t)
278
+ function ut(o, e, s, t = 1) {
279
+ const n = s, r = Math.max(e, 0.1), i = o[0] && o[0][0] && typeof o[0][0] == "number" ? [o] : o, a = [0, 0];
280
+ if (n)
281
281
  for (const u of i)
282
- Te(u, a, t);
283
- const l = ht(i, r, s);
284
- if (t) {
282
+ Te(u, a, n);
283
+ const c = ht(i, r, t);
284
+ if (n) {
285
285
  for (const u of i)
286
- Te(u, a, -t);
287
- ct(l, a, -t);
286
+ Te(u, a, -n);
287
+ ct(c, a, -n);
288
288
  }
289
- return l;
289
+ return c;
290
290
  }
291
- function ht(o, e, n) {
292
- const s = [];
291
+ function ht(o, e, s) {
292
+ const t = [];
293
293
  for (const u of o) {
294
- const c = [...u];
295
- lt(c[0], c[c.length - 1]) || c.push([c[0][0], c[0][1]]), c.length > 2 && s.push(c);
294
+ const l = [...u];
295
+ lt(l[0], l[l.length - 1]) || l.push([l[0][0], l[0][1]]), l.length > 2 && t.push(l);
296
296
  }
297
- const t = [];
297
+ const n = [];
298
298
  e = Math.max(e, 0.1);
299
299
  const r = [];
300
- for (const u of s)
301
- for (let c = 0; c < u.length - 1; c++) {
302
- const h = u[c], f = u[c + 1];
300
+ for (const u of t)
301
+ for (let l = 0; l < u.length - 1; l++) {
302
+ const h = u[l], f = u[l + 1];
303
303
  if (h[1] !== f[1]) {
304
304
  const d = Math.min(h[1], f[1]);
305
305
  r.push({
@@ -310,9 +310,9 @@ function ht(o, e, n) {
310
310
  });
311
311
  }
312
312
  }
313
- if (r.sort((u, c) => u.ymin < c.ymin ? -1 : u.ymin > c.ymin ? 1 : u.x < c.x ? -1 : u.x > c.x ? 1 : u.ymax === c.ymax ? 0 : (u.ymax - c.ymax) / Math.abs(u.ymax - c.ymax)), !r.length)
314
- return t;
315
- let i = [], a = r[0].ymin, l = 0;
313
+ if (r.sort((u, l) => u.ymin < l.ymin ? -1 : u.ymin > l.ymin ? 1 : u.x < l.x ? -1 : u.x > l.x ? 1 : u.ymax === l.ymax ? 0 : (u.ymax - l.ymax) / Math.abs(u.ymax - l.ymax)), !r.length)
314
+ return n;
315
+ let i = [], a = r[0].ymin, c = 0;
316
316
  for (; i.length || r.length; ) {
317
317
  if (r.length) {
318
318
  let u = -1;
@@ -322,119 +322,119 @@ function ht(o, e, n) {
322
322
  i.push({ s: a, edge: h });
323
323
  });
324
324
  }
325
- if (i = i.filter((u) => !(u.edge.ymax <= a)), i.sort((u, c) => u.edge.x === c.edge.x ? 0 : (u.edge.x - c.edge.x) / Math.abs(u.edge.x - c.edge.x)), (n !== 1 || l % e === 0) && i.length > 1)
325
+ if (i = i.filter((u) => !(u.edge.ymax <= a)), i.sort((u, l) => u.edge.x === l.edge.x ? 0 : (u.edge.x - l.edge.x) / Math.abs(u.edge.x - l.edge.x)), (s !== 1 || c % e === 0) && i.length > 1)
326
326
  for (let u = 0; u < i.length; u = u + 2) {
327
- const c = u + 1;
328
- if (c >= i.length)
327
+ const l = u + 1;
328
+ if (l >= i.length)
329
329
  break;
330
- const h = i[u].edge, f = i[c].edge;
331
- t.push([
330
+ const h = i[u].edge, f = i[l].edge;
331
+ n.push([
332
332
  [Math.round(h.x), a],
333
333
  [Math.round(f.x), a]
334
334
  ]);
335
335
  }
336
- a += n, i.forEach((u) => {
337
- u.edge.x = u.edge.x + n * u.edge.islope;
338
- }), l++;
336
+ a += s, i.forEach((u) => {
337
+ u.edge.x = u.edge.x + s * u.edge.islope;
338
+ }), c++;
339
339
  }
340
- return t;
340
+ return n;
341
341
  }
342
- function Q(o, e) {
343
- var n;
344
- const s = e.hachureAngle + 90;
345
- let t = e.hachureGap;
346
- t < 0 && (t = e.strokeWidth * 4), t = Math.round(Math.max(t, 0.1));
342
+ function J(o, e) {
343
+ var s;
344
+ const t = e.hachureAngle + 90;
345
+ let n = e.hachureGap;
346
+ n < 0 && (n = e.strokeWidth * 4), n = Math.round(Math.max(n, 0.1));
347
347
  let r = 1;
348
- return e.roughness >= 1 && (((n = e.randomizer) === null || n === void 0 ? void 0 : n.next()) || Math.random()) > 0.7 && (r = t), ut(o, t, s, r || 1);
348
+ return e.roughness >= 1 && (((s = e.randomizer) === null || s === void 0 ? void 0 : s.next()) || Math.random()) > 0.7 && (r = n), ut(o, n, t, r || 1);
349
349
  }
350
350
  class Le {
351
351
  constructor(e) {
352
352
  this.helper = e;
353
353
  }
354
- fillPolygons(e, n) {
355
- return this._fillPolygons(e, n);
354
+ fillPolygons(e, s) {
355
+ return this._fillPolygons(e, s);
356
356
  }
357
- _fillPolygons(e, n) {
358
- const s = Q(e, n);
359
- return { type: "fillSketch", ops: this.renderLines(s, n) };
357
+ _fillPolygons(e, s) {
358
+ const t = J(e, s);
359
+ return { type: "fillSketch", ops: this.renderLines(t, s) };
360
360
  }
361
- renderLines(e, n) {
362
- const s = [];
363
- for (const t of e)
364
- s.push(...this.helper.doubleLineOps(t[0][0], t[0][1], t[1][0], t[1][1], n));
365
- return s;
361
+ renderLines(e, s) {
362
+ const t = [];
363
+ for (const n of e)
364
+ t.push(...this.helper.doubleLineOps(n[0][0], n[0][1], n[1][0], n[1][1], s));
365
+ return t;
366
366
  }
367
367
  }
368
- function Me(o) {
369
- const e = o[0], n = o[1];
370
- return Math.sqrt(Math.pow(e[0] - n[0], 2) + Math.pow(e[1] - n[1], 2));
368
+ function we(o) {
369
+ const e = o[0], s = o[1];
370
+ return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
371
371
  }
372
372
  class ft extends Le {
373
- fillPolygons(e, n) {
374
- let s = n.hachureGap;
375
- s < 0 && (s = n.strokeWidth * 4), s = Math.max(s, 0.1);
376
- const t = Object.assign({}, n, { hachureGap: s }), r = Q(e, t), i = Math.PI / 180 * n.hachureAngle, a = [], l = s * 0.5 * Math.cos(i), u = s * 0.5 * Math.sin(i);
373
+ fillPolygons(e, s) {
374
+ let t = s.hachureGap;
375
+ t < 0 && (t = s.strokeWidth * 4), t = Math.max(t, 0.1);
376
+ const n = Object.assign({}, s, { hachureGap: t }), r = J(e, n), i = Math.PI / 180 * s.hachureAngle, a = [], c = t * 0.5 * Math.cos(i), u = t * 0.5 * Math.sin(i);
377
377
  for (const [h, f] of r)
378
- Me([h, f]) && a.push([
379
- [h[0] - l, h[1] + u],
378
+ we([h, f]) && a.push([
379
+ [h[0] - c, h[1] + u],
380
380
  [...f]
381
381
  ], [
382
- [h[0] + l, h[1] - u],
382
+ [h[0] + c, h[1] - u],
383
383
  [...f]
384
384
  ]);
385
- return { type: "fillSketch", ops: this.renderLines(a, n) };
385
+ return { type: "fillSketch", ops: this.renderLines(a, s) };
386
386
  }
387
387
  }
388
388
  class dt extends Le {
389
- fillPolygons(e, n) {
390
- const s = this._fillPolygons(e, n), t = Object.assign({}, n, { hachureAngle: n.hachureAngle + 90 }), r = this._fillPolygons(e, t);
391
- return s.ops = s.ops.concat(r.ops), s;
389
+ fillPolygons(e, s) {
390
+ const t = this._fillPolygons(e, s), n = Object.assign({}, s, { hachureAngle: s.hachureAngle + 90 }), r = this._fillPolygons(e, n);
391
+ return t.ops = t.ops.concat(r.ops), t;
392
392
  }
393
393
  }
394
394
  class pt {
395
395
  constructor(e) {
396
396
  this.helper = e;
397
397
  }
398
- fillPolygons(e, n) {
399
- n = Object.assign({}, n, { hachureAngle: 0 });
400
- const s = Q(e, n);
401
- return this.dotsOnLines(s, n);
402
- }
403
- dotsOnLines(e, n) {
404
- const s = [];
405
- let t = n.hachureGap;
406
- t < 0 && (t = n.strokeWidth * 4), t = Math.max(t, 0.1);
407
- let r = n.fillWeight;
408
- r < 0 && (r = n.strokeWidth / 2);
409
- const i = t / 4;
398
+ fillPolygons(e, s) {
399
+ s = Object.assign({}, s, { hachureAngle: 0 });
400
+ const t = J(e, s);
401
+ return this.dotsOnLines(t, s);
402
+ }
403
+ dotsOnLines(e, s) {
404
+ const t = [];
405
+ let n = s.hachureGap;
406
+ n < 0 && (n = s.strokeWidth * 4), n = Math.max(n, 0.1);
407
+ let r = s.fillWeight;
408
+ r < 0 && (r = s.strokeWidth / 2);
409
+ const i = n / 4;
410
410
  for (const a of e) {
411
- const l = Me(a), u = l / t, c = Math.ceil(u) - 1, h = l - c * t, f = (a[0][0] + a[1][0]) / 2 - t / 4, d = Math.min(a[0][1], a[1][1]);
412
- for (let g = 0; g < c; g++) {
413
- const m = d + h + g * t, b = f - i + Math.random() * 2 * i, v = m - i + Math.random() * 2 * i, y = this.helper.ellipse(b, v, r, r, n);
414
- s.push(...y.ops);
411
+ const c = we(a), u = c / n, l = Math.ceil(u) - 1, h = c - l * n, f = (a[0][0] + a[1][0]) / 2 - n / 4, d = Math.min(a[0][1], a[1][1]);
412
+ for (let g = 0; g < l; g++) {
413
+ const m = d + h + g * n, b = f - i + Math.random() * 2 * i, v = m - i + Math.random() * 2 * i, y = this.helper.ellipse(b, v, r, r, s);
414
+ t.push(...y.ops);
415
415
  }
416
416
  }
417
- return { type: "fillSketch", ops: s };
417
+ return { type: "fillSketch", ops: t };
418
418
  }
419
419
  }
420
420
  class gt {
421
421
  constructor(e) {
422
422
  this.helper = e;
423
423
  }
424
- fillPolygons(e, n) {
425
- const s = Q(e, n);
426
- return { type: "fillSketch", ops: this.dashedLine(s, n) };
424
+ fillPolygons(e, s) {
425
+ const t = J(e, s);
426
+ return { type: "fillSketch", ops: this.dashedLine(t, s) };
427
427
  }
428
- dashedLine(e, n) {
429
- const s = n.dashOffset < 0 ? n.hachureGap < 0 ? n.strokeWidth * 4 : n.hachureGap : n.dashOffset, t = n.dashGap < 0 ? n.hachureGap < 0 ? n.strokeWidth * 4 : n.hachureGap : n.dashGap, r = [];
428
+ dashedLine(e, s) {
429
+ const t = s.dashOffset < 0 ? s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap : s.dashOffset, n = s.dashGap < 0 ? s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap : s.dashGap, r = [];
430
430
  return e.forEach((i) => {
431
- const a = Me(i), l = Math.floor(a / (s + t)), u = (a + t - l * (s + t)) / 2;
432
- let c = i[0], h = i[1];
433
- c[0] > h[0] && (c = i[1], h = i[0]);
434
- const f = Math.atan((h[1] - c[1]) / (h[0] - c[0]));
435
- for (let d = 0; d < l; d++) {
436
- const g = d * (s + t), m = g + s, b = [c[0] + g * Math.cos(f) + u * Math.cos(f), c[1] + g * Math.sin(f) + u * Math.sin(f)], v = [c[0] + m * Math.cos(f) + u * Math.cos(f), c[1] + m * Math.sin(f) + u * Math.sin(f)];
437
- r.push(...this.helper.doubleLineOps(b[0], b[1], v[0], v[1], n));
431
+ const a = we(i), c = Math.floor(a / (t + n)), u = (a + n - c * (t + n)) / 2;
432
+ let l = i[0], h = i[1];
433
+ l[0] > h[0] && (l = i[1], h = i[0]);
434
+ const f = Math.atan((h[1] - l[1]) / (h[0] - l[0]));
435
+ for (let d = 0; d < c; d++) {
436
+ const g = d * (t + n), m = g + t, b = [l[0] + g * Math.cos(f) + u * Math.cos(f), l[1] + g * Math.sin(f) + u * Math.sin(f)], v = [l[0] + m * Math.cos(f) + u * Math.cos(f), l[1] + m * Math.sin(f) + u * Math.sin(f)];
437
+ r.push(...this.helper.doubleLineOps(b[0], b[1], v[0], v[1], s));
438
438
  }
439
439
  }), r;
440
440
  }
@@ -443,51 +443,51 @@ class mt {
443
443
  constructor(e) {
444
444
  this.helper = e;
445
445
  }
446
- fillPolygons(e, n) {
447
- const s = n.hachureGap < 0 ? n.strokeWidth * 4 : n.hachureGap, t = n.zigzagOffset < 0 ? s : n.zigzagOffset;
448
- n = Object.assign({}, n, { hachureGap: s + t });
449
- const r = Q(e, n);
450
- return { type: "fillSketch", ops: this.zigzagLines(r, t, n) };
446
+ fillPolygons(e, s) {
447
+ const t = s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap, n = s.zigzagOffset < 0 ? t : s.zigzagOffset;
448
+ s = Object.assign({}, s, { hachureGap: t + n });
449
+ const r = J(e, s);
450
+ return { type: "fillSketch", ops: this.zigzagLines(r, n, s) };
451
451
  }
452
- zigzagLines(e, n, s) {
453
- const t = [];
452
+ zigzagLines(e, s, t) {
453
+ const n = [];
454
454
  return e.forEach((r) => {
455
- const i = Me(r), a = Math.round(i / (2 * n));
456
- let l = r[0], u = r[1];
457
- l[0] > u[0] && (l = r[1], u = r[0]);
458
- const c = Math.atan((u[1] - l[1]) / (u[0] - l[0]));
455
+ const i = we(r), a = Math.round(i / (2 * s));
456
+ let c = r[0], u = r[1];
457
+ c[0] > u[0] && (c = r[1], u = r[0]);
458
+ const l = Math.atan((u[1] - c[1]) / (u[0] - c[0]));
459
459
  for (let h = 0; h < a; h++) {
460
- const f = h * 2 * n, d = (h + 1) * 2 * n, g = Math.sqrt(2 * Math.pow(n, 2)), m = [l[0] + f * Math.cos(c), l[1] + f * Math.sin(c)], b = [l[0] + d * Math.cos(c), l[1] + d * Math.sin(c)], v = [m[0] + g * Math.cos(c + Math.PI / 4), m[1] + g * Math.sin(c + Math.PI / 4)];
461
- t.push(...this.helper.doubleLineOps(m[0], m[1], v[0], v[1], s), ...this.helper.doubleLineOps(v[0], v[1], b[0], b[1], s));
460
+ const f = h * 2 * s, d = (h + 1) * 2 * s, g = Math.sqrt(2 * Math.pow(s, 2)), m = [c[0] + f * Math.cos(l), c[1] + f * Math.sin(l)], b = [c[0] + d * Math.cos(l), c[1] + d * Math.sin(l)], v = [m[0] + g * Math.cos(l + Math.PI / 4), m[1] + g * Math.sin(l + Math.PI / 4)];
461
+ n.push(...this.helper.doubleLineOps(m[0], m[1], v[0], v[1], t), ...this.helper.doubleLineOps(v[0], v[1], b[0], b[1], t));
462
462
  }
463
- }), t;
463
+ }), n;
464
464
  }
465
465
  }
466
- const O = {};
466
+ const E = {};
467
467
  function kt(o, e) {
468
- let n = o.fillStyle || "hachure";
469
- if (!O[n])
470
- switch (n) {
468
+ let s = o.fillStyle || "hachure";
469
+ if (!E[s])
470
+ switch (s) {
471
471
  case "zigzag":
472
- O[n] || (O[n] = new ft(e));
472
+ E[s] || (E[s] = new ft(e));
473
473
  break;
474
474
  case "cross-hatch":
475
- O[n] || (O[n] = new dt(e));
475
+ E[s] || (E[s] = new dt(e));
476
476
  break;
477
477
  case "dots":
478
- O[n] || (O[n] = new pt(e));
478
+ E[s] || (E[s] = new pt(e));
479
479
  break;
480
480
  case "dashed":
481
- O[n] || (O[n] = new gt(e));
481
+ E[s] || (E[s] = new gt(e));
482
482
  break;
483
483
  case "zigzag-line":
484
- O[n] || (O[n] = new mt(e));
484
+ E[s] || (E[s] = new mt(e));
485
485
  break;
486
486
  default:
487
- n = "hachure", O[n] || (O[n] = new Le(e));
487
+ s = "hachure", E[s] || (E[s] = new Le(e));
488
488
  break;
489
489
  }
490
- return O[n];
490
+ return E[s];
491
491
  }
492
492
  function bt() {
493
493
  return Math.floor(Math.random() * 2 ** 31);
@@ -500,14 +500,14 @@ class vt {
500
500
  return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
501
501
  }
502
502
  }
503
- const Mt = 0, xe = 1, Be = 2, le = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
504
- function wt(o) {
503
+ const wt = 0, xe = 1, Be = 2, le = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
504
+ function Mt(o) {
505
505
  const e = new Array();
506
506
  for (; o !== ""; )
507
507
  if (o.match(/^([ \t\r\n,]+)/))
508
508
  o = o.substr(RegExp.$1.length);
509
509
  else if (o.match(/^([aAcChHlLmMqQsStTvVzZ])/))
510
- e[e.length] = { type: Mt, text: RegExp.$1 }, o = o.substr(RegExp.$1.length);
510
+ e[e.length] = { type: wt, text: RegExp.$1 }, o = o.substr(RegExp.$1.length);
511
511
  else if (o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))
512
512
  e[e.length] = { type: xe, text: `${parseFloat(RegExp.$1)}` }, o = o.substr(RegExp.$1.length);
513
513
  else
@@ -518,73 +518,73 @@ function _e(o, e) {
518
518
  return o.type === e;
519
519
  }
520
520
  function Ae(o) {
521
- const e = [], n = wt(o);
522
- let s = "BOD", t = 0, r = n[t];
521
+ const e = [], s = Mt(o);
522
+ let t = "BOD", n = 0, r = s[n];
523
523
  for (; !_e(r, Be); ) {
524
524
  let i = 0;
525
525
  const a = [];
526
- if (s === "BOD")
526
+ if (t === "BOD")
527
527
  if (r.text === "M" || r.text === "m")
528
- t++, i = le[r.text], s = r.text;
528
+ n++, i = le[r.text], t = r.text;
529
529
  else
530
530
  return Ae("M0,0" + o);
531
- else _e(r, xe) ? i = le[s] : (t++, i = le[r.text], s = r.text);
532
- if (t + i < n.length) {
533
- for (let l = t; l < t + i; l++) {
534
- const u = n[l];
531
+ else _e(r, xe) ? i = le[t] : (n++, i = le[r.text], t = r.text);
532
+ if (n + i < s.length) {
533
+ for (let c = n; c < n + i; c++) {
534
+ const u = s[c];
535
535
  if (_e(u, xe))
536
536
  a[a.length] = +u.text;
537
537
  else
538
- throw new Error("Param not a number: " + s + "," + u.text);
538
+ throw new Error("Param not a number: " + t + "," + u.text);
539
539
  }
540
- if (typeof le[s] == "number") {
541
- const l = { key: s, data: a };
542
- e.push(l), t += i, r = n[t], s === "M" && (s = "L"), s === "m" && (s = "l");
540
+ if (typeof le[t] == "number") {
541
+ const c = { key: t, data: a };
542
+ e.push(c), n += i, r = s[n], t === "M" && (t = "L"), t === "m" && (t = "l");
543
543
  } else
544
- throw new Error("Bad segment: " + s);
544
+ throw new Error("Bad segment: " + t);
545
545
  } else
546
546
  throw new Error("Path data ended short");
547
547
  }
548
548
  return e;
549
549
  }
550
550
  function Ze(o) {
551
- let e = 0, n = 0, s = 0, t = 0;
551
+ let e = 0, s = 0, t = 0, n = 0;
552
552
  const r = [];
553
553
  for (const { key: i, data: a } of o)
554
554
  switch (i) {
555
555
  case "M":
556
- r.push({ key: "M", data: [...a] }), [e, n] = a, [s, t] = a;
556
+ r.push({ key: "M", data: [...a] }), [e, s] = a, [t, n] = a;
557
557
  break;
558
558
  case "m":
559
- e += a[0], n += a[1], r.push({ key: "M", data: [e, n] }), s = e, t = n;
559
+ e += a[0], s += a[1], r.push({ key: "M", data: [e, s] }), t = e, n = s;
560
560
  break;
561
561
  case "L":
562
- r.push({ key: "L", data: [...a] }), [e, n] = a;
562
+ r.push({ key: "L", data: [...a] }), [e, s] = a;
563
563
  break;
564
564
  case "l":
565
- e += a[0], n += a[1], r.push({ key: "L", data: [e, n] });
565
+ e += a[0], s += a[1], r.push({ key: "L", data: [e, s] });
566
566
  break;
567
567
  case "C":
568
- r.push({ key: "C", data: [...a] }), e = a[4], n = a[5];
568
+ r.push({ key: "C", data: [...a] }), e = a[4], s = a[5];
569
569
  break;
570
570
  case "c": {
571
- const l = a.map((u, c) => c % 2 ? u + n : u + e);
572
- r.push({ key: "C", data: l }), e = l[4], n = l[5];
571
+ const c = a.map((u, l) => l % 2 ? u + s : u + e);
572
+ r.push({ key: "C", data: c }), e = c[4], s = c[5];
573
573
  break;
574
574
  }
575
575
  case "Q":
576
- r.push({ key: "Q", data: [...a] }), e = a[2], n = a[3];
576
+ r.push({ key: "Q", data: [...a] }), e = a[2], s = a[3];
577
577
  break;
578
578
  case "q": {
579
- const l = a.map((u, c) => c % 2 ? u + n : u + e);
580
- r.push({ key: "Q", data: l }), e = l[2], n = l[3];
579
+ const c = a.map((u, l) => l % 2 ? u + s : u + e);
580
+ r.push({ key: "Q", data: c }), e = c[2], s = c[3];
581
581
  break;
582
582
  }
583
583
  case "A":
584
- r.push({ key: "A", data: [...a] }), e = a[5], n = a[6];
584
+ r.push({ key: "A", data: [...a] }), e = a[5], s = a[6];
585
585
  break;
586
586
  case "a":
587
- e += a[5], n += a[6], r.push({ key: "A", data: [a[0], a[1], a[2], a[3], a[4], e, n] });
587
+ e += a[5], s += a[6], r.push({ key: "A", data: [a[0], a[1], a[2], a[3], a[4], e, s] });
588
588
  break;
589
589
  case "H":
590
590
  r.push({ key: "H", data: [...a] }), e = a[0];
@@ -593,120 +593,120 @@ function Ze(o) {
593
593
  e += a[0], r.push({ key: "H", data: [e] });
594
594
  break;
595
595
  case "V":
596
- r.push({ key: "V", data: [...a] }), n = a[0];
596
+ r.push({ key: "V", data: [...a] }), s = a[0];
597
597
  break;
598
598
  case "v":
599
- n += a[0], r.push({ key: "V", data: [n] });
599
+ s += a[0], r.push({ key: "V", data: [s] });
600
600
  break;
601
601
  case "S":
602
- r.push({ key: "S", data: [...a] }), e = a[2], n = a[3];
602
+ r.push({ key: "S", data: [...a] }), e = a[2], s = a[3];
603
603
  break;
604
604
  case "s": {
605
- const l = a.map((u, c) => c % 2 ? u + n : u + e);
606
- r.push({ key: "S", data: l }), e = l[2], n = l[3];
605
+ const c = a.map((u, l) => l % 2 ? u + s : u + e);
606
+ r.push({ key: "S", data: c }), e = c[2], s = c[3];
607
607
  break;
608
608
  }
609
609
  case "T":
610
- r.push({ key: "T", data: [...a] }), e = a[0], n = a[1];
610
+ r.push({ key: "T", data: [...a] }), e = a[0], s = a[1];
611
611
  break;
612
612
  case "t":
613
- e += a[0], n += a[1], r.push({ key: "T", data: [e, n] });
613
+ e += a[0], s += a[1], r.push({ key: "T", data: [e, s] });
614
614
  break;
615
615
  case "Z":
616
616
  case "z":
617
- r.push({ key: "Z", data: [] }), e = s, n = t;
617
+ r.push({ key: "Z", data: [] }), e = t, s = n;
618
618
  break;
619
619
  }
620
620
  return r;
621
621
  }
622
622
  function Xe(o) {
623
623
  const e = [];
624
- let n = "", s = 0, t = 0, r = 0, i = 0, a = 0, l = 0;
625
- for (const { key: u, data: c } of o) {
624
+ let s = "", t = 0, n = 0, r = 0, i = 0, a = 0, c = 0;
625
+ for (const { key: u, data: l } of o) {
626
626
  switch (u) {
627
627
  case "M":
628
- e.push({ key: "M", data: [...c] }), [s, t] = c, [r, i] = c;
628
+ e.push({ key: "M", data: [...l] }), [t, n] = l, [r, i] = l;
629
629
  break;
630
630
  case "C":
631
- e.push({ key: "C", data: [...c] }), s = c[4], t = c[5], a = c[2], l = c[3];
631
+ e.push({ key: "C", data: [...l] }), t = l[4], n = l[5], a = l[2], c = l[3];
632
632
  break;
633
633
  case "L":
634
- e.push({ key: "L", data: [...c] }), [s, t] = c;
634
+ e.push({ key: "L", data: [...l] }), [t, n] = l;
635
635
  break;
636
636
  case "H":
637
- s = c[0], e.push({ key: "L", data: [s, t] });
637
+ t = l[0], e.push({ key: "L", data: [t, n] });
638
638
  break;
639
639
  case "V":
640
- t = c[0], e.push({ key: "L", data: [s, t] });
640
+ n = l[0], e.push({ key: "L", data: [t, n] });
641
641
  break;
642
642
  case "S": {
643
643
  let h = 0, f = 0;
644
- n === "C" || n === "S" ? (h = s + (s - a), f = t + (t - l)) : (h = s, f = t), e.push({ key: "C", data: [h, f, ...c] }), a = c[0], l = c[1], s = c[2], t = c[3];
644
+ s === "C" || s === "S" ? (h = t + (t - a), f = n + (n - c)) : (h = t, f = n), e.push({ key: "C", data: [h, f, ...l] }), a = l[0], c = l[1], t = l[2], n = l[3];
645
645
  break;
646
646
  }
647
647
  case "T": {
648
- const [h, f] = c;
648
+ const [h, f] = l;
649
649
  let d = 0, g = 0;
650
- n === "Q" || n === "T" ? (d = s + (s - a), g = t + (t - l)) : (d = s, g = t);
651
- const m = s + 2 * (d - s) / 3, b = t + 2 * (g - t) / 3, v = h + 2 * (d - h) / 3, y = f + 2 * (g - f) / 3;
652
- e.push({ key: "C", data: [m, b, v, y, h, f] }), a = d, l = g, s = h, t = f;
650
+ s === "Q" || s === "T" ? (d = t + (t - a), g = n + (n - c)) : (d = t, g = n);
651
+ const m = t + 2 * (d - t) / 3, b = n + 2 * (g - n) / 3, v = h + 2 * (d - h) / 3, y = f + 2 * (g - f) / 3;
652
+ e.push({ key: "C", data: [m, b, v, y, h, f] }), a = d, c = g, t = h, n = f;
653
653
  break;
654
654
  }
655
655
  case "Q": {
656
- const [h, f, d, g] = c, m = s + 2 * (h - s) / 3, b = t + 2 * (f - t) / 3, v = d + 2 * (h - d) / 3, y = g + 2 * (f - g) / 3;
657
- e.push({ key: "C", data: [m, b, v, y, d, g] }), a = h, l = f, s = d, t = g;
656
+ const [h, f, d, g] = l, m = t + 2 * (h - t) / 3, b = n + 2 * (f - n) / 3, v = d + 2 * (h - d) / 3, y = g + 2 * (f - g) / 3;
657
+ e.push({ key: "C", data: [m, b, v, y, d, g] }), a = h, c = f, t = d, n = g;
658
658
  break;
659
659
  }
660
660
  case "A": {
661
- const h = Math.abs(c[0]), f = Math.abs(c[1]), d = c[2], g = c[3], m = c[4], b = c[5], v = c[6];
662
- h === 0 || f === 0 ? (e.push({ key: "C", data: [s, t, b, v, b, v] }), s = b, t = v) : (s !== b || t !== v) && (Ue(s, t, b, v, h, f, d, g, m).forEach(function(z) {
663
- e.push({ key: "C", data: z });
664
- }), s = b, t = v);
661
+ const h = Math.abs(l[0]), f = Math.abs(l[1]), d = l[2], g = l[3], m = l[4], b = l[5], v = l[6];
662
+ h === 0 || f === 0 ? (e.push({ key: "C", data: [t, n, b, v, b, v] }), t = b, n = v) : (t !== b || n !== v) && (Ue(t, n, b, v, h, f, d, g, m).forEach(function(C) {
663
+ e.push({ key: "C", data: C });
664
+ }), t = b, n = v);
665
665
  break;
666
666
  }
667
667
  case "Z":
668
- e.push({ key: "Z", data: [] }), s = r, t = i;
668
+ e.push({ key: "Z", data: [] }), t = r, n = i;
669
669
  break;
670
670
  }
671
- n = u;
671
+ s = u;
672
672
  }
673
673
  return e;
674
674
  }
675
675
  function yt(o) {
676
676
  return Math.PI * o / 180;
677
677
  }
678
- function Z(o, e, n) {
679
- const s = o * Math.cos(n) - e * Math.sin(n), t = o * Math.sin(n) + e * Math.cos(n);
680
- return [s, t];
678
+ function U(o, e, s) {
679
+ const t = o * Math.cos(s) - e * Math.sin(s), n = o * Math.sin(s) + e * Math.cos(s);
680
+ return [t, n];
681
681
  }
682
- function Ue(o, e, n, s, t, r, i, a, l, u) {
683
- const c = yt(i);
682
+ function Ue(o, e, s, t, n, r, i, a, c, u) {
683
+ const l = yt(i);
684
684
  let h = [], f = 0, d = 0, g = 0, m = 0;
685
685
  if (u)
686
686
  [f, d, g, m] = u;
687
687
  else {
688
- [o, e] = Z(o, e, -c), [n, s] = Z(n, s, -c);
689
- const x = (o - n) / 2, S = (e - s) / 2;
690
- let j = x * x / (t * t) + S * S / (r * r);
691
- j > 1 && (j = Math.sqrt(j), t = j * t, r = j * r);
692
- const I = a === l ? -1 : 1, D = t * t, F = r * r, oe = D * F - D * S * S - F * x * x, ae = D * S * S + F * x * x, V = I * Math.sqrt(Math.abs(oe / ae));
693
- g = V * t * S / r + (o + n) / 2, m = V * -r * x / t + (e + s) / 2, f = Math.asin(parseFloat(((e - m) / r).toFixed(9))), d = Math.asin(parseFloat(((s - m) / r).toFixed(9))), o < g && (f = Math.PI - f), n < g && (d = Math.PI - d), f < 0 && (f = Math.PI * 2 + f), d < 0 && (d = Math.PI * 2 + d), l && f > d && (f = f - Math.PI * 2), !l && d > f && (d = d - Math.PI * 2);
688
+ [o, e] = U(o, e, -l), [s, t] = U(s, t, -l);
689
+ const x = (o - s) / 2, S = (e - t) / 2;
690
+ let $ = x * x / (n * n) + S * S / (r * r);
691
+ $ > 1 && ($ = Math.sqrt($), n = $ * n, r = $ * r);
692
+ const W = a === c ? -1 : 1, I = n * n, q = r * r, oe = I * q - I * S * S - q * x * x, ae = I * S * S + q * x * x, B = W * Math.sqrt(Math.abs(oe / ae));
693
+ g = B * n * S / r + (o + s) / 2, m = B * -r * x / n + (e + t) / 2, f = Math.asin(parseFloat(((e - m) / r).toFixed(9))), d = Math.asin(parseFloat(((t - m) / r).toFixed(9))), o < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = Math.PI * 2 + f), d < 0 && (d = Math.PI * 2 + d), c && f > d && (f = f - Math.PI * 2), !c && d > f && (d = d - Math.PI * 2);
694
694
  }
695
695
  let b = d - f;
696
696
  if (Math.abs(b) > Math.PI * 120 / 180) {
697
- const x = d, S = n, j = s;
698
- l && d > f ? d = f + Math.PI * 120 / 180 * 1 : d = f + Math.PI * 120 / 180 * -1, n = g + t * Math.cos(d), s = m + r * Math.sin(d), h = Ue(n, s, S, j, t, r, i, 0, l, [d, x, g, m]);
697
+ const x = d, S = s, $ = t;
698
+ c && d > f ? d = f + Math.PI * 120 / 180 * 1 : d = f + Math.PI * 120 / 180 * -1, s = g + n * Math.cos(d), t = m + r * Math.sin(d), h = Ue(s, t, S, $, n, r, i, 0, c, [d, x, g, m]);
699
699
  }
700
700
  b = d - f;
701
- const v = Math.cos(f), y = Math.sin(f), z = Math.cos(d), G = Math.sin(d), K = Math.tan(b / 4), ee = 4 / 3 * t * K, te = 4 / 3 * r * K, se = [o, e], $ = [o + ee * y, e - te * v], ne = [n + ee * G, s - te * z], re = [n, s];
702
- if ($[0] = 2 * se[0] - $[0], $[1] = 2 * se[1] - $[1], u)
703
- return [$, ne, re].concat(h);
701
+ const v = Math.cos(f), y = Math.sin(f), C = Math.cos(d), z = Math.sin(d), N = Math.tan(b / 4), ee = 4 / 3 * n * N, te = 4 / 3 * r * N, se = [o, e], D = [o + ee * y, e - te * v], ne = [s + ee * z, t - te * C], re = [s, t];
702
+ if (D[0] = 2 * se[0] - D[0], D[1] = 2 * se[1] - D[1], u)
703
+ return [D, ne, re].concat(h);
704
704
  {
705
- h = [$, ne, re].concat(h);
705
+ h = [D, ne, re].concat(h);
706
706
  const x = [];
707
707
  for (let S = 0; S < h.length; S += 3) {
708
- const j = Z(h[S][0], h[S][1], c), I = Z(h[S + 1][0], h[S + 1][1], c), D = Z(h[S + 2][0], h[S + 2][1], c);
709
- x.push([j[0], j[1], I[0], I[1], D[0], D[1]]);
708
+ const $ = U(h[S][0], h[S][1], l), W = U(h[S + 1][0], h[S + 1][1], l), I = U(h[S + 2][0], h[S + 2][1], l);
709
+ x.push([$[0], $[1], W[0], W[1], I[0], I[1]]);
710
710
  }
711
711
  return x;
712
712
  }
@@ -717,146 +717,146 @@ const _t = {
717
717
  ellipse: Tt,
718
718
  doubleLineOps: Rt
719
719
  };
720
- function Qe(o, e, n, s, t) {
721
- return { type: "path", ops: N(o, e, n, s, t) };
722
- }
723
- function de(o, e, n) {
724
- const s = (o || []).length;
725
- if (s > 2) {
726
- const t = [];
727
- for (let r = 0; r < s - 1; r++)
728
- t.push(...N(o[r][0], o[r][1], o[r + 1][0], o[r + 1][1], n));
729
- return e && t.push(...N(o[s - 1][0], o[s - 1][1], o[0][0], o[0][1], n)), { type: "path", ops: t };
730
- } else if (s === 2)
731
- return Qe(o[0][0], o[0][1], o[1][0], o[1][1], n);
720
+ function Qe(o, e, s, t, n) {
721
+ return { type: "path", ops: H(o, e, s, t, n) };
722
+ }
723
+ function de(o, e, s) {
724
+ const t = (o || []).length;
725
+ if (t > 2) {
726
+ const n = [];
727
+ for (let r = 0; r < t - 1; r++)
728
+ n.push(...H(o[r][0], o[r][1], o[r + 1][0], o[r + 1][1], s));
729
+ return e && n.push(...H(o[t - 1][0], o[t - 1][1], o[0][0], o[0][1], s)), { type: "path", ops: n };
730
+ } else if (t === 2)
731
+ return Qe(o[0][0], o[0][1], o[1][0], o[1][1], s);
732
732
  return { type: "path", ops: [] };
733
733
  }
734
734
  function St(o, e) {
735
735
  return de(o, !0, e);
736
736
  }
737
- function Pt(o, e, n, s, t) {
737
+ function Pt(o, e, s, t, n) {
738
738
  const r = [
739
739
  [o, e],
740
- [o + n, e],
741
- [o + n, e + s],
742
- [o, e + s]
740
+ [o + s, e],
741
+ [o + s, e + t],
742
+ [o, e + t]
743
743
  ];
744
- return St(r, t);
744
+ return St(r, n);
745
745
  }
746
- function ze(o, e) {
746
+ function De(o, e) {
747
747
  if (o.length) {
748
- const s = typeof o[0][0] == "number" ? [o] : o, t = ue(s[0], 1 * (1 + e.roughness * 0.2), e), r = e.disableMultiStroke ? [] : ue(s[0], 1.5 * (1 + e.roughness * 0.22), We(e));
749
- for (let i = 1; i < s.length; i++) {
750
- const a = s[i];
748
+ const t = typeof o[0][0] == "number" ? [o] : o, n = ue(t[0], 1 * (1 + e.roughness * 0.2), e), r = e.disableMultiStroke ? [] : ue(t[0], 1.5 * (1 + e.roughness * 0.22), We(e));
749
+ for (let i = 1; i < t.length; i++) {
750
+ const a = t[i];
751
751
  if (a.length) {
752
- const l = ue(a, 1 * (1 + e.roughness * 0.2), e), u = e.disableMultiStroke ? [] : ue(a, 1.5 * (1 + e.roughness * 0.22), We(e));
753
- for (const c of l)
754
- c.op !== "move" && t.push(c);
755
- for (const c of u)
756
- c.op !== "move" && r.push(c);
752
+ const c = ue(a, 1 * (1 + e.roughness * 0.2), e), u = e.disableMultiStroke ? [] : ue(a, 1.5 * (1 + e.roughness * 0.22), We(e));
753
+ for (const l of c)
754
+ l.op !== "move" && n.push(l);
755
+ for (const l of u)
756
+ l.op !== "move" && r.push(l);
757
757
  }
758
758
  }
759
- return { type: "path", ops: t.concat(r) };
759
+ return { type: "path", ops: n.concat(r) };
760
760
  }
761
761
  return { type: "path", ops: [] };
762
762
  }
763
- function Tt(o, e, n, s, t) {
764
- const r = Je(n, s, t);
765
- return Oe(o, e, t, r).opset;
763
+ function Tt(o, e, s, t, n) {
764
+ const r = Je(s, t, n);
765
+ return Oe(o, e, n, r).opset;
766
766
  }
767
- function Je(o, e, n) {
768
- const s = Math.sqrt(Math.PI * 2 * Math.sqrt((Math.pow(o / 2, 2) + Math.pow(e / 2, 2)) / 2)), t = Math.ceil(Math.max(n.curveStepCount, n.curveStepCount / Math.sqrt(200) * s)), r = Math.PI * 2 / t;
767
+ function Je(o, e, s) {
768
+ const t = Math.sqrt(Math.PI * 2 * Math.sqrt((Math.pow(o / 2, 2) + Math.pow(e / 2, 2)) / 2)), n = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * t)), r = Math.PI * 2 / n;
769
769
  let i = Math.abs(o / 2), a = Math.abs(e / 2);
770
- const l = 1 - n.curveFitting;
771
- return i += k(i * l, n), a += k(a * l, n), { increment: r, rx: i, ry: a };
770
+ const c = 1 - s.curveFitting;
771
+ return i += k(i * c, s), a += k(a * c, s), { increment: r, rx: i, ry: a };
772
772
  }
773
- function Oe(o, e, n, s) {
774
- const [t, r] = Fe(s.increment, o, e, s.rx, s.ry, 1, s.increment * me(0.1, me(0.4, 1, n), n), n);
775
- let i = ke(t, null, n);
776
- if (!n.disableMultiStroke && n.roughness !== 0) {
777
- const [a] = Fe(s.increment, o, e, s.rx, s.ry, 1.5, 0, n), l = ke(a, null, n);
778
- i = i.concat(l);
773
+ function Oe(o, e, s, t) {
774
+ const [n, r] = He(t.increment, o, e, t.rx, t.ry, 1, t.increment * me(0.1, me(0.4, 1, s), s), s);
775
+ let i = ke(n, null, s);
776
+ if (!s.disableMultiStroke && s.roughness !== 0) {
777
+ const [a] = He(t.increment, o, e, t.rx, t.ry, 1.5, 0, s), c = ke(a, null, s);
778
+ i = i.concat(c);
779
779
  }
780
780
  return {
781
781
  estimatedPoints: r,
782
782
  opset: { type: "path", ops: i }
783
783
  };
784
784
  }
785
- function Ie(o, e, n, s, t, r, i, a, l) {
786
- const u = o, c = e;
787
- let h = Math.abs(n / 2), f = Math.abs(s / 2);
788
- h += k(h * 0.01, l), f += k(f * 0.01, l);
789
- let d = t, g = r;
785
+ function Ie(o, e, s, t, n, r, i, a, c) {
786
+ const u = o, l = e;
787
+ let h = Math.abs(s / 2), f = Math.abs(t / 2);
788
+ h += k(h * 0.01, c), f += k(f * 0.01, c);
789
+ let d = n, g = r;
790
790
  for (; d < 0; )
791
791
  d += Math.PI * 2, g += Math.PI * 2;
792
792
  g - d > Math.PI * 2 && (d = 0, g = Math.PI * 2);
793
- const m = Math.PI * 2 / l.curveStepCount, b = Math.min(m / 2, (g - d) / 2), v = He(b, u, c, h, f, d, g, 1, l);
794
- if (!l.disableMultiStroke) {
795
- const y = He(b, u, c, h, f, d, g, 1.5, l);
793
+ const m = Math.PI * 2 / c.curveStepCount, b = Math.min(m / 2, (g - d) / 2), v = Fe(b, u, l, h, f, d, g, 1, c);
794
+ if (!c.disableMultiStroke) {
795
+ const y = Fe(b, u, l, h, f, d, g, 1.5, c);
796
796
  v.push(...y);
797
797
  }
798
- return i && (a ? v.push(...N(u, c, u + h * Math.cos(d), c + f * Math.sin(d), l), ...N(u, c, u + h * Math.cos(g), c + f * Math.sin(g), l)) : v.push({ op: "lineTo", data: [u, c] }, { op: "lineTo", data: [u + h * Math.cos(d), c + f * Math.sin(d)] })), { type: "path", ops: v };
798
+ return i && (a ? v.push(...H(u, l, u + h * Math.cos(d), l + f * Math.sin(d), c), ...H(u, l, u + h * Math.cos(g), l + f * Math.sin(g), c)) : v.push({ op: "lineTo", data: [u, l] }, { op: "lineTo", data: [u + h * Math.cos(d), l + f * Math.sin(d)] })), { type: "path", ops: v };
799
799
  }
800
800
  function Ne(o, e) {
801
- const n = Xe(Ze(Ae(o))), s = [];
802
- let t = [0, 0], r = [0, 0];
803
- for (const { key: i, data: a } of n)
801
+ const s = Xe(Ze(Ae(o))), t = [];
802
+ let n = [0, 0], r = [0, 0];
803
+ for (const { key: i, data: a } of s)
804
804
  switch (i) {
805
805
  case "M": {
806
- r = [a[0], a[1]], t = [a[0], a[1]];
806
+ r = [a[0], a[1]], n = [a[0], a[1]];
807
807
  break;
808
808
  }
809
809
  case "L":
810
- s.push(...N(r[0], r[1], a[0], a[1], e)), r = [a[0], a[1]];
810
+ t.push(...H(r[0], r[1], a[0], a[1], e)), r = [a[0], a[1]];
811
811
  break;
812
812
  case "C": {
813
- const [l, u, c, h, f, d] = a;
814
- s.push(...Ct(l, u, c, h, f, d, r, e)), r = [f, d];
813
+ const [c, u, l, h, f, d] = a;
814
+ t.push(...Ct(c, u, l, h, f, d, r, e)), r = [f, d];
815
815
  break;
816
816
  }
817
817
  case "Z":
818
- s.push(...N(r[0], r[1], t[0], t[1], e)), r = [t[0], t[1]];
818
+ t.push(...H(r[0], r[1], n[0], n[1], e)), r = [n[0], n[1]];
819
819
  break;
820
820
  }
821
- return { type: "path", ops: s };
821
+ return { type: "path", ops: t };
822
822
  }
823
823
  function Se(o, e) {
824
- const n = [];
825
- for (const s of o)
826
- if (s.length) {
827
- const t = e.maxRandomnessOffset || 0, r = s.length;
824
+ const s = [];
825
+ for (const t of o)
826
+ if (t.length) {
827
+ const n = e.maxRandomnessOffset || 0, r = t.length;
828
828
  if (r > 2) {
829
- n.push({ op: "move", data: [s[0][0] + k(t, e), s[0][1] + k(t, e)] });
829
+ s.push({ op: "move", data: [t[0][0] + k(n, e), t[0][1] + k(n, e)] });
830
830
  for (let i = 1; i < r; i++)
831
- n.push({ op: "lineTo", data: [s[i][0] + k(t, e), s[i][1] + k(t, e)] });
831
+ s.push({ op: "lineTo", data: [t[i][0] + k(n, e), t[i][1] + k(n, e)] });
832
832
  }
833
833
  }
834
- return { type: "fillPath", ops: n };
834
+ return { type: "fillPath", ops: s };
835
835
  }
836
- function q(o, e) {
836
+ function V(o, e) {
837
837
  return kt(e, _t).fillPolygons(o, e);
838
838
  }
839
- function xt(o, e, n, s, t, r, i) {
840
- const a = o, l = e;
841
- let u = Math.abs(n / 2), c = Math.abs(s / 2);
842
- u += k(u * 0.01, i), c += k(c * 0.01, i);
843
- let h = t, f = r;
839
+ function xt(o, e, s, t, n, r, i) {
840
+ const a = o, c = e;
841
+ let u = Math.abs(s / 2), l = Math.abs(t / 2);
842
+ u += k(u * 0.01, i), l += k(l * 0.01, i);
843
+ let h = n, f = r;
844
844
  for (; h < 0; )
845
845
  h += Math.PI * 2, f += Math.PI * 2;
846
846
  f - h > Math.PI * 2 && (h = 0, f = Math.PI * 2);
847
847
  const d = (f - h) / i.curveStepCount, g = [];
848
848
  for (let m = h; m <= f; m = m + d)
849
- g.push([a + u * Math.cos(m), l + c * Math.sin(m)]);
850
- return g.push([a + u * Math.cos(f), l + c * Math.sin(f)]), g.push([a, l]), q([g], i);
849
+ g.push([a + u * Math.cos(m), c + l * Math.sin(m)]);
850
+ return g.push([a + u * Math.cos(f), c + l * Math.sin(f)]), g.push([a, c]), V([g], i);
851
851
  }
852
852
  function Ot(o, e) {
853
853
  return k(o, e);
854
854
  }
855
- function Et(o, e, n) {
856
- return me(o, e, n);
855
+ function Et(o, e, s) {
856
+ return me(o, e, s);
857
857
  }
858
- function Rt(o, e, n, s, t) {
859
- return N(o, e, n, s, t, !0);
858
+ function Rt(o, e, s, t, n) {
859
+ return H(o, e, s, t, n, !0);
860
860
  }
861
861
  function We(o) {
862
862
  const e = Object.assign({}, o);
@@ -865,29 +865,29 @@ function We(o) {
865
865
  function Ke(o) {
866
866
  return o.randomizer || (o.randomizer = new vt(o.seed || 0)), o.randomizer.next();
867
867
  }
868
- function me(o, e, n, s = 1) {
869
- return n.roughness * s * (Ke(n) * (e - o) + o);
868
+ function me(o, e, s, t = 1) {
869
+ return s.roughness * t * (Ke(s) * (e - o) + o);
870
870
  }
871
- function k(o, e, n = 1) {
872
- return me(-o, o, e, n);
871
+ function k(o, e, s = 1) {
872
+ return me(-o, o, e, s);
873
873
  }
874
- function N(o, e, n, s, t, r = !1) {
875
- const i = r ? t.disableMultiStrokeFill : t.disableMultiStroke, a = Ee(o, e, n, s, t, !0, !1);
874
+ function H(o, e, s, t, n, r = !1) {
875
+ const i = r ? n.disableMultiStrokeFill : n.disableMultiStroke, a = Ee(o, e, s, t, n, !0, !1);
876
876
  if (i)
877
877
  return a;
878
- const l = Ee(o, e, n, s, t, !0, !0);
879
- return a.concat(l);
878
+ const c = Ee(o, e, s, t, n, !0, !0);
879
+ return a.concat(c);
880
880
  }
881
- function Ee(o, e, n, s, t, r, i) {
882
- const a = Math.pow(o - n, 2) + Math.pow(e - s, 2), l = Math.sqrt(a);
881
+ function Ee(o, e, s, t, n, r, i) {
882
+ const a = Math.pow(o - s, 2) + Math.pow(e - t, 2), c = Math.sqrt(a);
883
883
  let u = 1;
884
- l < 200 ? u = 1 : l > 500 ? u = 0.4 : u = -16668e-7 * l + 1.233334;
885
- let c = t.maxRandomnessOffset || 0;
886
- c * c * 100 > a && (c = l / 10);
887
- const h = c / 2, f = 0.2 + Ke(t) * 0.2;
888
- let d = t.bowing * t.maxRandomnessOffset * (s - e) / 200, g = t.bowing * t.maxRandomnessOffset * (o - n) / 200;
889
- d = k(d, t, u), g = k(g, t, u);
890
- const m = [], b = () => k(h, t, u), v = () => k(c, t, u), y = t.preserveVertices;
884
+ c < 200 ? u = 1 : c > 500 ? u = 0.4 : u = -16668e-7 * c + 1.233334;
885
+ let l = n.maxRandomnessOffset || 0;
886
+ l * l * 100 > a && (l = c / 10);
887
+ const h = l / 2, f = 0.2 + Ke(n) * 0.2;
888
+ let d = n.bowing * n.maxRandomnessOffset * (t - e) / 200, g = n.bowing * n.maxRandomnessOffset * (o - s) / 200;
889
+ d = k(d, n, u), g = k(g, n, u);
890
+ const m = [], b = () => k(h, n, u), v = () => k(l, n, u), y = n.preserveVertices;
891
891
  return i ? m.push({
892
892
  op: "move",
893
893
  data: [
@@ -897,62 +897,62 @@ function Ee(o, e, n, s, t, r, i) {
897
897
  }) : m.push({
898
898
  op: "move",
899
899
  data: [
900
- o + (y ? 0 : k(c, t, u)),
901
- e + (y ? 0 : k(c, t, u))
900
+ o + (y ? 0 : k(l, n, u)),
901
+ e + (y ? 0 : k(l, n, u))
902
902
  ]
903
903
  }), i ? m.push({
904
904
  op: "bcurveTo",
905
905
  data: [
906
- d + o + (n - o) * f + b(),
907
- g + e + (s - e) * f + b(),
908
- d + o + 2 * (n - o) * f + b(),
909
- g + e + 2 * (s - e) * f + b(),
910
- n + (y ? 0 : b()),
911
- s + (y ? 0 : b())
906
+ d + o + (s - o) * f + b(),
907
+ g + e + (t - e) * f + b(),
908
+ d + o + 2 * (s - o) * f + b(),
909
+ g + e + 2 * (t - e) * f + b(),
910
+ s + (y ? 0 : b()),
911
+ t + (y ? 0 : b())
912
912
  ]
913
913
  }) : m.push({
914
914
  op: "bcurveTo",
915
915
  data: [
916
- d + o + (n - o) * f + v(),
917
- g + e + (s - e) * f + v(),
918
- d + o + 2 * (n - o) * f + v(),
919
- g + e + 2 * (s - e) * f + v(),
920
- n + (y ? 0 : v()),
921
- s + (y ? 0 : v())
916
+ d + o + (s - o) * f + v(),
917
+ g + e + (t - e) * f + v(),
918
+ d + o + 2 * (s - o) * f + v(),
919
+ g + e + 2 * (t - e) * f + v(),
920
+ s + (y ? 0 : v()),
921
+ t + (y ? 0 : v())
922
922
  ]
923
923
  }), m;
924
924
  }
925
- function ue(o, e, n) {
925
+ function ue(o, e, s) {
926
926
  if (!o.length)
927
927
  return [];
928
- const s = [];
929
- s.push([
930
- o[0][0] + k(e, n),
931
- o[0][1] + k(e, n)
932
- ]), s.push([
933
- o[0][0] + k(e, n),
934
- o[0][1] + k(e, n)
928
+ const t = [];
929
+ t.push([
930
+ o[0][0] + k(e, s),
931
+ o[0][1] + k(e, s)
932
+ ]), t.push([
933
+ o[0][0] + k(e, s),
934
+ o[0][1] + k(e, s)
935
935
  ]);
936
- for (let t = 1; t < o.length; t++)
937
- s.push([
938
- o[t][0] + k(e, n),
939
- o[t][1] + k(e, n)
940
- ]), t === o.length - 1 && s.push([
941
- o[t][0] + k(e, n),
942
- o[t][1] + k(e, n)
936
+ for (let n = 1; n < o.length; n++)
937
+ t.push([
938
+ o[n][0] + k(e, s),
939
+ o[n][1] + k(e, s)
940
+ ]), n === o.length - 1 && t.push([
941
+ o[n][0] + k(e, s),
942
+ o[n][1] + k(e, s)
943
943
  ]);
944
- return ke(s, null, n);
945
- }
946
- function ke(o, e, n) {
947
- const s = o.length, t = [];
948
- if (s > 3) {
949
- const r = [], i = 1 - n.curveTightness;
950
- t.push({ op: "move", data: [o[1][0], o[1][1]] });
951
- for (let a = 1; a + 2 < s; a++) {
952
- const l = o[a];
953
- r[0] = [l[0], l[1]], r[1] = [l[0] + (i * o[a + 1][0] - i * o[a - 1][0]) / 6, l[1] + (i * o[a + 1][1] - i * o[a - 1][1]) / 6], r[2] = [o[a + 1][0] + (i * o[a][0] - i * o[a + 2][0]) / 6, o[a + 1][1] + (i * o[a][1] - i * o[a + 2][1]) / 6], r[3] = [o[a + 1][0], o[a + 1][1]], t.push({ op: "bcurveTo", data: [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]] });
944
+ return ke(t, null, s);
945
+ }
946
+ function ke(o, e, s) {
947
+ const t = o.length, n = [];
948
+ if (t > 3) {
949
+ const r = [], i = 1 - s.curveTightness;
950
+ n.push({ op: "move", data: [o[1][0], o[1][1]] });
951
+ for (let a = 1; a + 2 < t; a++) {
952
+ const c = o[a];
953
+ r[0] = [c[0], c[1]], r[1] = [c[0] + (i * o[a + 1][0] - i * o[a - 1][0]) / 6, c[1] + (i * o[a + 1][1] - i * o[a - 1][1]) / 6], r[2] = [o[a + 1][0] + (i * o[a][0] - i * o[a + 2][0]) / 6, o[a + 1][1] + (i * o[a][1] - i * o[a + 2][1]) / 6], r[3] = [o[a + 1][0], o[a + 1][1]], n.push({ op: "bcurveTo", data: [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]] });
954
954
  }
955
- } else s === 3 ? (t.push({ op: "move", data: [o[1][0], o[1][1]] }), t.push({
955
+ } else t === 3 ? (n.push({ op: "move", data: [o[1][0], o[1][1]] }), n.push({
956
956
  op: "bcurveTo",
957
957
  data: [
958
958
  o[1][0],
@@ -962,117 +962,117 @@ function ke(o, e, n) {
962
962
  o[2][0],
963
963
  o[2][1]
964
964
  ]
965
- })) : s === 2 && t.push(...Ee(o[0][0], o[0][1], o[1][0], o[1][1], n, !0, !0));
966
- return t;
967
- }
968
- function Fe(o, e, n, s, t, r, i, a) {
969
- const l = a.roughness === 0, u = [], c = [];
970
- if (l) {
971
- o = o / 4, c.push([
972
- e + s * Math.cos(-o),
973
- n + t * Math.sin(-o)
965
+ })) : t === 2 && n.push(...Ee(o[0][0], o[0][1], o[1][0], o[1][1], s, !0, !0));
966
+ return n;
967
+ }
968
+ function He(o, e, s, t, n, r, i, a) {
969
+ const c = a.roughness === 0, u = [], l = [];
970
+ if (c) {
971
+ o = o / 4, l.push([
972
+ e + t * Math.cos(-o),
973
+ s + n * Math.sin(-o)
974
974
  ]);
975
975
  for (let h = 0; h <= Math.PI * 2; h = h + o) {
976
976
  const f = [
977
- e + s * Math.cos(h),
978
- n + t * Math.sin(h)
977
+ e + t * Math.cos(h),
978
+ s + n * Math.sin(h)
979
979
  ];
980
- u.push(f), c.push(f);
980
+ u.push(f), l.push(f);
981
981
  }
982
- c.push([
983
- e + s * Math.cos(0),
984
- n + t * Math.sin(0)
985
- ]), c.push([
986
- e + s * Math.cos(o),
987
- n + t * Math.sin(o)
982
+ l.push([
983
+ e + t * Math.cos(0),
984
+ s + n * Math.sin(0)
985
+ ]), l.push([
986
+ e + t * Math.cos(o),
987
+ s + n * Math.sin(o)
988
988
  ]);
989
989
  } else {
990
990
  const h = k(0.5, a) - Math.PI / 2;
991
- c.push([
992
- k(r, a) + e + 0.9 * s * Math.cos(h - o),
993
- k(r, a) + n + 0.9 * t * Math.sin(h - o)
991
+ l.push([
992
+ k(r, a) + e + 0.9 * t * Math.cos(h - o),
993
+ k(r, a) + s + 0.9 * n * Math.sin(h - o)
994
994
  ]);
995
995
  const f = Math.PI * 2 + h - 0.01;
996
996
  for (let d = h; d < f; d = d + o) {
997
997
  const g = [
998
- k(r, a) + e + s * Math.cos(d),
999
- k(r, a) + n + t * Math.sin(d)
998
+ k(r, a) + e + t * Math.cos(d),
999
+ k(r, a) + s + n * Math.sin(d)
1000
1000
  ];
1001
- u.push(g), c.push(g);
1001
+ u.push(g), l.push(g);
1002
1002
  }
1003
- c.push([
1004
- k(r, a) + e + s * Math.cos(h + Math.PI * 2 + i * 0.5),
1005
- k(r, a) + n + t * Math.sin(h + Math.PI * 2 + i * 0.5)
1006
- ]), c.push([
1007
- k(r, a) + e + 0.98 * s * Math.cos(h + i),
1008
- k(r, a) + n + 0.98 * t * Math.sin(h + i)
1009
- ]), c.push([
1010
- k(r, a) + e + 0.9 * s * Math.cos(h + i * 0.5),
1011
- k(r, a) + n + 0.9 * t * Math.sin(h + i * 0.5)
1003
+ l.push([
1004
+ k(r, a) + e + t * Math.cos(h + Math.PI * 2 + i * 0.5),
1005
+ k(r, a) + s + n * Math.sin(h + Math.PI * 2 + i * 0.5)
1006
+ ]), l.push([
1007
+ k(r, a) + e + 0.98 * t * Math.cos(h + i),
1008
+ k(r, a) + s + 0.98 * n * Math.sin(h + i)
1009
+ ]), l.push([
1010
+ k(r, a) + e + 0.9 * t * Math.cos(h + i * 0.5),
1011
+ k(r, a) + s + 0.9 * n * Math.sin(h + i * 0.5)
1012
1012
  ]);
1013
1013
  }
1014
- return [c, u];
1014
+ return [l, u];
1015
1015
  }
1016
- function He(o, e, n, s, t, r, i, a, l) {
1017
- const u = r + k(0.1, l), c = [];
1018
- c.push([
1019
- k(a, l) + e + 0.9 * s * Math.cos(u - o),
1020
- k(a, l) + n + 0.9 * t * Math.sin(u - o)
1016
+ function Fe(o, e, s, t, n, r, i, a, c) {
1017
+ const u = r + k(0.1, c), l = [];
1018
+ l.push([
1019
+ k(a, c) + e + 0.9 * t * Math.cos(u - o),
1020
+ k(a, c) + s + 0.9 * n * Math.sin(u - o)
1021
1021
  ]);
1022
1022
  for (let h = u; h <= i; h = h + o)
1023
- c.push([
1024
- k(a, l) + e + s * Math.cos(h),
1025
- k(a, l) + n + t * Math.sin(h)
1023
+ l.push([
1024
+ k(a, c) + e + t * Math.cos(h),
1025
+ k(a, c) + s + n * Math.sin(h)
1026
1026
  ]);
1027
- return c.push([
1028
- e + s * Math.cos(i),
1029
- n + t * Math.sin(i)
1030
- ]), c.push([
1031
- e + s * Math.cos(i),
1032
- n + t * Math.sin(i)
1033
- ]), ke(c, null, l);
1034
- }
1035
- function Ct(o, e, n, s, t, r, i, a) {
1036
- const l = [], u = [a.maxRandomnessOffset || 1, (a.maxRandomnessOffset || 1) + 0.3];
1037
- let c = [0, 0];
1027
+ return l.push([
1028
+ e + t * Math.cos(i),
1029
+ s + n * Math.sin(i)
1030
+ ]), l.push([
1031
+ e + t * Math.cos(i),
1032
+ s + n * Math.sin(i)
1033
+ ]), ke(l, null, c);
1034
+ }
1035
+ function Ct(o, e, s, t, n, r, i, a) {
1036
+ const c = [], u = [a.maxRandomnessOffset || 1, (a.maxRandomnessOffset || 1) + 0.3];
1037
+ let l = [0, 0];
1038
1038
  const h = a.disableMultiStroke ? 1 : 2, f = a.preserveVertices;
1039
1039
  for (let d = 0; d < h; d++)
1040
- d === 0 ? l.push({ op: "move", data: [i[0], i[1]] }) : l.push({ op: "move", data: [i[0] + (f ? 0 : k(u[0], a)), i[1] + (f ? 0 : k(u[0], a))] }), c = f ? [t, r] : [t + k(u[d], a), r + k(u[d], a)], l.push({
1040
+ d === 0 ? c.push({ op: "move", data: [i[0], i[1]] }) : c.push({ op: "move", data: [i[0] + (f ? 0 : k(u[0], a)), i[1] + (f ? 0 : k(u[0], a))] }), l = f ? [n, r] : [n + k(u[d], a), r + k(u[d], a)], c.push({
1041
1041
  op: "bcurveTo",
1042
1042
  data: [
1043
1043
  o + k(u[d], a),
1044
1044
  e + k(u[d], a),
1045
- n + k(u[d], a),
1046
1045
  s + k(u[d], a),
1047
- c[0],
1048
- c[1]
1046
+ t + k(u[d], a),
1047
+ l[0],
1048
+ l[1]
1049
1049
  ]
1050
1050
  });
1051
- return l;
1051
+ return c;
1052
1052
  }
1053
- function X(o) {
1053
+ function Q(o) {
1054
1054
  return [...o];
1055
1055
  }
1056
1056
  function qe(o, e = 0) {
1057
- const n = o.length;
1058
- if (n < 3)
1057
+ const s = o.length;
1058
+ if (s < 3)
1059
1059
  throw new Error("A curve must have at least three points.");
1060
- const s = [];
1061
- if (n === 3)
1062
- s.push(X(o[0]), X(o[1]), X(o[2]), X(o[2]));
1060
+ const t = [];
1061
+ if (s === 3)
1062
+ t.push(Q(o[0]), Q(o[1]), Q(o[2]), Q(o[2]));
1063
1063
  else {
1064
- const t = [];
1065
- t.push(o[0], o[0]);
1064
+ const n = [];
1065
+ n.push(o[0], o[0]);
1066
1066
  for (let a = 1; a < o.length; a++)
1067
- t.push(o[a]), a === o.length - 1 && t.push(o[a]);
1067
+ n.push(o[a]), a === o.length - 1 && n.push(o[a]);
1068
1068
  const r = [], i = 1 - e;
1069
- s.push(X(t[0]));
1070
- for (let a = 1; a + 2 < t.length; a++) {
1071
- const l = t[a];
1072
- r[0] = [l[0], l[1]], r[1] = [l[0] + (i * t[a + 1][0] - i * t[a - 1][0]) / 6, l[1] + (i * t[a + 1][1] - i * t[a - 1][1]) / 6], r[2] = [t[a + 1][0] + (i * t[a][0] - i * t[a + 2][0]) / 6, t[a + 1][1] + (i * t[a][1] - i * t[a + 2][1]) / 6], r[3] = [t[a + 1][0], t[a + 1][1]], s.push(r[1], r[2], r[3]);
1069
+ t.push(Q(n[0]));
1070
+ for (let a = 1; a + 2 < n.length; a++) {
1071
+ const c = n[a];
1072
+ r[0] = [c[0], c[1]], r[1] = [c[0] + (i * n[a + 1][0] - i * n[a - 1][0]) / 6, c[1] + (i * n[a + 1][1] - i * n[a - 1][1]) / 6], r[2] = [n[a + 1][0] + (i * n[a][0] - i * n[a + 2][0]) / 6, n[a + 1][1] + (i * n[a][1] - i * n[a + 2][1]) / 6], r[3] = [n[a + 1][0], n[a + 1][1]], t.push(r[1], r[2], r[3]);
1073
1073
  }
1074
1074
  }
1075
- return s;
1075
+ return t;
1076
1076
  }
1077
1077
  function Lt(o, e) {
1078
1078
  return Math.sqrt(pe(o, e));
@@ -1080,98 +1080,98 @@ function Lt(o, e) {
1080
1080
  function pe(o, e) {
1081
1081
  return Math.pow(o[0] - e[0], 2) + Math.pow(o[1] - e[1], 2);
1082
1082
  }
1083
- function At(o, e, n) {
1084
- const s = pe(e, n);
1085
- if (s === 0)
1083
+ function At(o, e, s) {
1084
+ const t = pe(e, s);
1085
+ if (t === 0)
1086
1086
  return pe(o, e);
1087
- let t = ((o[0] - e[0]) * (n[0] - e[0]) + (o[1] - e[1]) * (n[1] - e[1])) / s;
1088
- return t = Math.max(0, Math.min(1, t)), pe(o, W(e, n, t));
1087
+ let n = ((o[0] - e[0]) * (s[0] - e[0]) + (o[1] - e[1]) * (s[1] - e[1])) / t;
1088
+ return n = Math.max(0, Math.min(1, n)), pe(o, F(e, s, n));
1089
1089
  }
1090
- function W(o, e, n) {
1090
+ function F(o, e, s) {
1091
1091
  return [
1092
- o[0] + (e[0] - o[0]) * n,
1093
- o[1] + (e[1] - o[1]) * n
1092
+ o[0] + (e[0] - o[0]) * s,
1093
+ o[1] + (e[1] - o[1]) * s
1094
1094
  ];
1095
1095
  }
1096
1096
  function jt(o, e) {
1097
- const n = o[e + 0], s = o[e + 1], t = o[e + 2], r = o[e + 3];
1098
- let i = 3 * s[0] - 2 * n[0] - r[0];
1097
+ const s = o[e + 0], t = o[e + 1], n = o[e + 2], r = o[e + 3];
1098
+ let i = 3 * t[0] - 2 * s[0] - r[0];
1099
1099
  i *= i;
1100
- let a = 3 * s[1] - 2 * n[1] - r[1];
1100
+ let a = 3 * t[1] - 2 * s[1] - r[1];
1101
1101
  a *= a;
1102
- let l = 3 * t[0] - 2 * r[0] - n[0];
1103
- l *= l;
1104
- let u = 3 * t[1] - 2 * r[1] - n[1];
1105
- return u *= u, i < l && (i = l), a < u && (a = u), i + a;
1106
- }
1107
- function Re(o, e, n, s) {
1108
- const t = s || [];
1109
- if (jt(o, e) < n) {
1102
+ let c = 3 * n[0] - 2 * r[0] - s[0];
1103
+ c *= c;
1104
+ let u = 3 * n[1] - 2 * r[1] - s[1];
1105
+ return u *= u, i < c && (i = c), a < u && (a = u), i + a;
1106
+ }
1107
+ function Re(o, e, s, t) {
1108
+ const n = t || [];
1109
+ if (jt(o, e) < s) {
1110
1110
  const r = o[e + 0];
1111
- t.length ? Lt(t[t.length - 1], r) > 1 && t.push(r) : t.push(r), t.push(o[e + 3]);
1111
+ n.length ? Lt(n[n.length - 1], r) > 1 && n.push(r) : n.push(r), n.push(o[e + 3]);
1112
1112
  } else {
1113
- const i = o[e + 0], a = o[e + 1], l = o[e + 2], u = o[e + 3], c = W(i, a, 0.5), h = W(a, l, 0.5), f = W(l, u, 0.5), d = W(c, h, 0.5), g = W(h, f, 0.5), m = W(d, g, 0.5);
1114
- Re([i, c, d, m], 0, n, t), Re([m, g, f, u], 0, n, t);
1113
+ const i = o[e + 0], a = o[e + 1], c = o[e + 2], u = o[e + 3], l = F(i, a, 0.5), h = F(a, c, 0.5), f = F(c, u, 0.5), d = F(l, h, 0.5), g = F(h, f, 0.5), m = F(d, g, 0.5);
1114
+ Re([i, l, d, m], 0, s, n), Re([m, g, f, u], 0, s, n);
1115
1115
  }
1116
- return t;
1116
+ return n;
1117
1117
  }
1118
1118
  function $t(o, e) {
1119
1119
  return be(o, 0, o.length, e);
1120
1120
  }
1121
- function be(o, e, n, s, t) {
1122
- const r = t || [], i = o[e], a = o[n - 1];
1123
- let l = 0, u = 1;
1124
- for (let c = e + 1; c < n - 1; ++c) {
1125
- const h = At(o[c], i, a);
1126
- h > l && (l = h, u = c);
1121
+ function be(o, e, s, t, n) {
1122
+ const r = n || [], i = o[e], a = o[s - 1];
1123
+ let c = 0, u = 1;
1124
+ for (let l = e + 1; l < s - 1; ++l) {
1125
+ const h = At(o[l], i, a);
1126
+ h > c && (c = h, u = l);
1127
1127
  }
1128
- return Math.sqrt(l) > s ? (be(o, e, u + 1, s, r), be(o, u, n, s, r)) : (r.length || r.push(i), r.push(a)), r;
1128
+ return Math.sqrt(c) > t ? (be(o, e, u + 1, t, r), be(o, u, s, t, r)) : (r.length || r.push(i), r.push(a)), r;
1129
1129
  }
1130
- function Ce(o, e = 0.15, n) {
1131
- const s = [], t = (o.length - 1) / 3;
1132
- for (let r = 0; r < t; r++) {
1130
+ function Ce(o, e = 0.15, s) {
1131
+ const t = [], n = (o.length - 1) / 3;
1132
+ for (let r = 0; r < n; r++) {
1133
1133
  const i = r * 3;
1134
- Re(o, i, e, s);
1134
+ Re(o, i, e, t);
1135
1135
  }
1136
- return n && n > 0 ? be(s, 0, s.length, n) : s;
1136
+ return s && s > 0 ? be(t, 0, t.length, s) : t;
1137
1137
  }
1138
- function Dt(o, e, n) {
1139
- const s = Ae(o), t = Xe(Ze(s)), r = [];
1140
- let i = [], a = [0, 0], l = [];
1138
+ function zt(o, e, s) {
1139
+ const t = Ae(o), n = Xe(Ze(t)), r = [];
1140
+ let i = [], a = [0, 0], c = [];
1141
1141
  const u = () => {
1142
- l.length >= 4 && i.push(...Ce(l, e)), l = [];
1143
- }, c = () => {
1142
+ c.length >= 4 && i.push(...Ce(c, e)), c = [];
1143
+ }, l = () => {
1144
1144
  u(), i.length && (r.push(i), i = []);
1145
1145
  };
1146
- for (const { key: f, data: d } of t)
1146
+ for (const { key: f, data: d } of n)
1147
1147
  switch (f) {
1148
1148
  case "M":
1149
- c(), a = [d[0], d[1]], i.push(a);
1149
+ l(), a = [d[0], d[1]], i.push(a);
1150
1150
  break;
1151
1151
  case "L":
1152
1152
  u(), i.push([d[0], d[1]]);
1153
1153
  break;
1154
1154
  case "C":
1155
- if (!l.length) {
1155
+ if (!c.length) {
1156
1156
  const g = i.length ? i[i.length - 1] : a;
1157
- l.push([g[0], g[1]]);
1157
+ c.push([g[0], g[1]]);
1158
1158
  }
1159
- l.push([d[0], d[1]]), l.push([d[2], d[3]]), l.push([d[4], d[5]]);
1159
+ c.push([d[0], d[1]]), c.push([d[2], d[3]]), c.push([d[4], d[5]]);
1160
1160
  break;
1161
1161
  case "Z":
1162
1162
  u(), i.push([a[0], a[1]]);
1163
1163
  break;
1164
1164
  }
1165
- if (c(), !n)
1165
+ if (l(), !s)
1166
1166
  return r;
1167
1167
  const h = [];
1168
1168
  for (const f of r) {
1169
- const d = $t(f, n);
1169
+ const d = $t(f, s);
1170
1170
  d.length && h.push(d);
1171
1171
  }
1172
1172
  return h;
1173
1173
  }
1174
- const R = "none";
1174
+ const L = "none";
1175
1175
  class ve {
1176
1176
  constructor(e) {
1177
1177
  this.defaultOptions = {
@@ -1203,57 +1203,57 @@ class ve {
1203
1203
  _o(e) {
1204
1204
  return e ? Object.assign({}, this.defaultOptions, e) : this.defaultOptions;
1205
1205
  }
1206
- _d(e, n, s) {
1207
- return { shape: e, sets: n || [], options: s || this.defaultOptions };
1206
+ _d(e, s, t) {
1207
+ return { shape: e, sets: s || [], options: t || this.defaultOptions };
1208
1208
  }
1209
- line(e, n, s, t, r) {
1209
+ line(e, s, t, n, r) {
1210
1210
  const i = this._o(r);
1211
- return this._d("line", [Qe(e, n, s, t, i)], i);
1211
+ return this._d("line", [Qe(e, s, t, n, i)], i);
1212
1212
  }
1213
- rectangle(e, n, s, t, r) {
1214
- const i = this._o(r), a = [], l = Pt(e, n, s, t, i);
1213
+ rectangle(e, s, t, n, r) {
1214
+ const i = this._o(r), a = [], c = Pt(e, s, t, n, i);
1215
1215
  if (i.fill) {
1216
- const u = [[e, n], [e + s, n], [e + s, n + t], [e, n + t]];
1217
- i.fillStyle === "solid" ? a.push(Se([u], i)) : a.push(q([u], i));
1216
+ const u = [[e, s], [e + t, s], [e + t, s + n], [e, s + n]];
1217
+ i.fillStyle === "solid" ? a.push(Se([u], i)) : a.push(V([u], i));
1218
1218
  }
1219
- return i.stroke !== R && a.push(l), this._d("rectangle", a, i);
1219
+ return i.stroke !== L && a.push(c), this._d("rectangle", a, i);
1220
1220
  }
1221
- ellipse(e, n, s, t, r) {
1222
- const i = this._o(r), a = [], l = Je(s, t, i), u = Oe(e, n, i, l);
1221
+ ellipse(e, s, t, n, r) {
1222
+ const i = this._o(r), a = [], c = Je(t, n, i), u = Oe(e, s, i, c);
1223
1223
  if (i.fill)
1224
1224
  if (i.fillStyle === "solid") {
1225
- const c = Oe(e, n, i, l).opset;
1226
- c.type = "fillPath", a.push(c);
1225
+ const l = Oe(e, s, i, c).opset;
1226
+ l.type = "fillPath", a.push(l);
1227
1227
  } else
1228
- a.push(q([u.estimatedPoints], i));
1229
- return i.stroke !== R && a.push(u.opset), this._d("ellipse", a, i);
1228
+ a.push(V([u.estimatedPoints], i));
1229
+ return i.stroke !== L && a.push(u.opset), this._d("ellipse", a, i);
1230
1230
  }
1231
- circle(e, n, s, t) {
1232
- const r = this.ellipse(e, n, s, s, t);
1231
+ circle(e, s, t, n) {
1232
+ const r = this.ellipse(e, s, t, t, n);
1233
1233
  return r.shape = "circle", r;
1234
1234
  }
1235
- linearPath(e, n) {
1236
- const s = this._o(n);
1237
- return this._d("linearPath", [de(e, !1, s)], s);
1235
+ linearPath(e, s) {
1236
+ const t = this._o(s);
1237
+ return this._d("linearPath", [de(e, !1, t)], t);
1238
1238
  }
1239
- arc(e, n, s, t, r, i, a = !1, l) {
1240
- const u = this._o(l), c = [], h = Ie(e, n, s, t, r, i, a, !0, u);
1239
+ arc(e, s, t, n, r, i, a = !1, c) {
1240
+ const u = this._o(c), l = [], h = Ie(e, s, t, n, r, i, a, !0, u);
1241
1241
  if (a && u.fill)
1242
1242
  if (u.fillStyle === "solid") {
1243
1243
  const f = Object.assign({}, u);
1244
1244
  f.disableMultiStroke = !0;
1245
- const d = Ie(e, n, s, t, r, i, !0, !1, f);
1246
- d.type = "fillPath", c.push(d);
1245
+ const d = Ie(e, s, t, n, r, i, !0, !1, f);
1246
+ d.type = "fillPath", l.push(d);
1247
1247
  } else
1248
- c.push(xt(e, n, s, t, r, i, u));
1249
- return u.stroke !== R && c.push(h), this._d("arc", c, u);
1250
- }
1251
- curve(e, n) {
1252
- const s = this._o(n), t = [], r = ze(e, s);
1253
- if (s.fill && s.fill !== R)
1254
- if (s.fillStyle === "solid") {
1255
- const i = ze(e, Object.assign(Object.assign({}, s), { disableMultiStroke: !0, roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0 }));
1256
- t.push({
1248
+ l.push(xt(e, s, t, n, r, i, u));
1249
+ return u.stroke !== L && l.push(h), this._d("arc", l, u);
1250
+ }
1251
+ curve(e, s) {
1252
+ const t = this._o(s), n = [], r = De(e, t);
1253
+ if (t.fill && t.fill !== L)
1254
+ if (t.fillStyle === "solid") {
1255
+ const i = De(e, Object.assign(Object.assign({}, t), { disableMultiStroke: !0, roughness: t.roughness ? t.roughness + t.fillShapeRoughnessGain : 0 }));
1256
+ n.push({
1257
1257
  type: "fillPath",
1258
1258
  ops: this._mergedShape(i.ops)
1259
1259
  });
@@ -1261,134 +1261,134 @@ class ve {
1261
1261
  const i = [], a = e;
1262
1262
  if (a.length) {
1263
1263
  const u = typeof a[0][0] == "number" ? [a] : a;
1264
- for (const c of u)
1265
- c.length < 3 ? i.push(...c) : c.length === 3 ? i.push(...Ce(qe([
1266
- c[0],
1267
- c[0],
1268
- c[1],
1269
- c[2]
1270
- ]), 10, (1 + s.roughness) / 2)) : i.push(...Ce(qe(c), 10, (1 + s.roughness) / 2));
1264
+ for (const l of u)
1265
+ l.length < 3 ? i.push(...l) : l.length === 3 ? i.push(...Ce(qe([
1266
+ l[0],
1267
+ l[0],
1268
+ l[1],
1269
+ l[2]
1270
+ ]), 10, (1 + t.roughness) / 2)) : i.push(...Ce(qe(l), 10, (1 + t.roughness) / 2));
1271
1271
  }
1272
- i.length && t.push(q([i], s));
1272
+ i.length && n.push(V([i], t));
1273
1273
  }
1274
- return s.stroke !== R && t.push(r), this._d("curve", t, s);
1274
+ return t.stroke !== L && n.push(r), this._d("curve", n, t);
1275
1275
  }
1276
- polygon(e, n) {
1277
- const s = this._o(n), t = [], r = de(e, !0, s);
1278
- return s.fill && (s.fillStyle === "solid" ? t.push(Se([e], s)) : t.push(q([e], s))), s.stroke !== R && t.push(r), this._d("polygon", t, s);
1276
+ polygon(e, s) {
1277
+ const t = this._o(s), n = [], r = de(e, !0, t);
1278
+ return t.fill && (t.fillStyle === "solid" ? n.push(Se([e], t)) : n.push(V([e], t))), t.stroke !== L && n.push(r), this._d("polygon", n, t);
1279
1279
  }
1280
- path(e, n) {
1281
- const s = this._o(n), t = [];
1280
+ path(e, s) {
1281
+ const t = this._o(s), n = [];
1282
1282
  if (!e)
1283
- return this._d("path", t, s);
1283
+ return this._d("path", n, t);
1284
1284
  e = (e || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
1285
- const r = s.fill && s.fill !== "transparent" && s.fill !== R, i = s.stroke !== R, a = !!(s.simplification && s.simplification < 1), l = a ? 4 - 4 * (s.simplification || 1) : (1 + s.roughness) / 2, u = Dt(e, 1, l), c = Ne(e, s);
1285
+ const r = t.fill && t.fill !== "transparent" && t.fill !== L, i = t.stroke !== L, a = !!(t.simplification && t.simplification < 1), c = a ? 4 - 4 * (t.simplification || 1) : (1 + t.roughness) / 2, u = zt(e, 1, c), l = Ne(e, t);
1286
1286
  if (r)
1287
- if (s.fillStyle === "solid")
1287
+ if (t.fillStyle === "solid")
1288
1288
  if (u.length === 1) {
1289
- const h = Ne(e, Object.assign(Object.assign({}, s), { disableMultiStroke: !0, roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0 }));
1290
- t.push({
1289
+ const h = Ne(e, Object.assign(Object.assign({}, t), { disableMultiStroke: !0, roughness: t.roughness ? t.roughness + t.fillShapeRoughnessGain : 0 }));
1290
+ n.push({
1291
1291
  type: "fillPath",
1292
1292
  ops: this._mergedShape(h.ops)
1293
1293
  });
1294
1294
  } else
1295
- t.push(Se(u, s));
1295
+ n.push(Se(u, t));
1296
1296
  else
1297
- t.push(q(u, s));
1297
+ n.push(V(u, t));
1298
1298
  return i && (a ? u.forEach((h) => {
1299
- t.push(de(h, !1, s));
1300
- }) : t.push(c)), this._d("path", t, s);
1301
- }
1302
- opsToPath(e, n) {
1303
- let s = "";
1304
- for (const t of e.ops) {
1305
- const r = typeof n == "number" && n >= 0 ? t.data.map((i) => +i.toFixed(n)) : t.data;
1306
- switch (t.op) {
1299
+ n.push(de(h, !1, t));
1300
+ }) : n.push(l)), this._d("path", n, t);
1301
+ }
1302
+ opsToPath(e, s) {
1303
+ let t = "";
1304
+ for (const n of e.ops) {
1305
+ const r = typeof s == "number" && s >= 0 ? n.data.map((i) => +i.toFixed(s)) : n.data;
1306
+ switch (n.op) {
1307
1307
  case "move":
1308
- s += `M${r[0]} ${r[1]} `;
1308
+ t += `M${r[0]} ${r[1]} `;
1309
1309
  break;
1310
1310
  case "bcurveTo":
1311
- s += `C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;
1311
+ t += `C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;
1312
1312
  break;
1313
1313
  case "lineTo":
1314
- s += `L${r[0]} ${r[1]} `;
1314
+ t += `L${r[0]} ${r[1]} `;
1315
1315
  break;
1316
1316
  }
1317
1317
  }
1318
- return s.trim();
1318
+ return t.trim();
1319
1319
  }
1320
1320
  toPaths(e) {
1321
- const n = e.sets || [], s = e.options || this.defaultOptions, t = [];
1322
- for (const r of n) {
1321
+ const s = e.sets || [], t = e.options || this.defaultOptions, n = [];
1322
+ for (const r of s) {
1323
1323
  let i = null;
1324
1324
  switch (r.type) {
1325
1325
  case "path":
1326
1326
  i = {
1327
1327
  d: this.opsToPath(r),
1328
- stroke: s.stroke,
1329
- strokeWidth: s.strokeWidth,
1330
- fill: R
1328
+ stroke: t.stroke,
1329
+ strokeWidth: t.strokeWidth,
1330
+ fill: L
1331
1331
  };
1332
1332
  break;
1333
1333
  case "fillPath":
1334
1334
  i = {
1335
1335
  d: this.opsToPath(r),
1336
- stroke: R,
1336
+ stroke: L,
1337
1337
  strokeWidth: 0,
1338
- fill: s.fill || R
1338
+ fill: t.fill || L
1339
1339
  };
1340
1340
  break;
1341
1341
  case "fillSketch":
1342
- i = this.fillSketch(r, s);
1342
+ i = this.fillSketch(r, t);
1343
1343
  break;
1344
1344
  }
1345
- i && t.push(i);
1345
+ i && n.push(i);
1346
1346
  }
1347
- return t;
1347
+ return n;
1348
1348
  }
1349
- fillSketch(e, n) {
1350
- let s = n.fillWeight;
1351
- return s < 0 && (s = n.strokeWidth / 2), {
1349
+ fillSketch(e, s) {
1350
+ let t = s.fillWeight;
1351
+ return t < 0 && (t = s.strokeWidth / 2), {
1352
1352
  d: this.opsToPath(e),
1353
- stroke: n.fill || R,
1354
- strokeWidth: s,
1355
- fill: R
1353
+ stroke: s.fill || L,
1354
+ strokeWidth: t,
1355
+ fill: L
1356
1356
  };
1357
1357
  }
1358
1358
  _mergedShape(e) {
1359
- return e.filter((n, s) => s === 0 ? !0 : n.op !== "move");
1359
+ return e.filter((s, t) => t === 0 ? !0 : s.op !== "move");
1360
1360
  }
1361
1361
  }
1362
- class zt {
1363
- constructor(e, n) {
1364
- this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new ve(n);
1362
+ class Dt {
1363
+ constructor(e, s) {
1364
+ this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new ve(s);
1365
1365
  }
1366
1366
  draw(e) {
1367
- const n = e.sets || [], s = e.options || this.getDefaultOptions(), t = this.ctx, r = e.options.fixedDecimalPlaceDigits;
1368
- for (const i of n)
1367
+ const s = e.sets || [], t = e.options || this.getDefaultOptions(), n = this.ctx, r = e.options.fixedDecimalPlaceDigits;
1368
+ for (const i of s)
1369
1369
  switch (i.type) {
1370
1370
  case "path":
1371
- t.save(), t.strokeStyle = s.stroke === "none" ? "transparent" : s.stroke, t.lineWidth = s.strokeWidth, s.strokeLineDash && t.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (t.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(t, i, r), t.restore();
1371
+ n.save(), n.strokeStyle = t.stroke === "none" ? "transparent" : t.stroke, n.lineWidth = t.strokeWidth, t.strokeLineDash && n.setLineDash(t.strokeLineDash), t.strokeLineDashOffset && (n.lineDashOffset = t.strokeLineDashOffset), this._drawToContext(n, i, r), n.restore();
1372
1372
  break;
1373
1373
  case "fillPath": {
1374
- t.save(), t.fillStyle = s.fill || "";
1374
+ n.save(), n.fillStyle = t.fill || "";
1375
1375
  const a = e.shape === "curve" || e.shape === "polygon" || e.shape === "path" ? "evenodd" : "nonzero";
1376
- this._drawToContext(t, i, r, a), t.restore();
1376
+ this._drawToContext(n, i, r, a), n.restore();
1377
1377
  break;
1378
1378
  }
1379
1379
  case "fillSketch":
1380
- this.fillSketch(t, i, s);
1380
+ this.fillSketch(n, i, t);
1381
1381
  break;
1382
1382
  }
1383
1383
  }
1384
- fillSketch(e, n, s) {
1385
- let t = s.fillWeight;
1386
- t < 0 && (t = s.strokeWidth / 2), e.save(), s.fillLineDash && e.setLineDash(s.fillLineDash), s.fillLineDashOffset && (e.lineDashOffset = s.fillLineDashOffset), e.strokeStyle = s.fill || "", e.lineWidth = t, this._drawToContext(e, n, s.fixedDecimalPlaceDigits), e.restore();
1384
+ fillSketch(e, s, t) {
1385
+ let n = t.fillWeight;
1386
+ n < 0 && (n = t.strokeWidth / 2), e.save(), t.fillLineDash && e.setLineDash(t.fillLineDash), t.fillLineDashOffset && (e.lineDashOffset = t.fillLineDashOffset), e.strokeStyle = t.fill || "", e.lineWidth = n, this._drawToContext(e, s, t.fixedDecimalPlaceDigits), e.restore();
1387
1387
  }
1388
- _drawToContext(e, n, s, t = "nonzero") {
1388
+ _drawToContext(e, s, t, n = "nonzero") {
1389
1389
  e.beginPath();
1390
- for (const r of n.ops) {
1391
- const i = typeof s == "number" && s >= 0 ? r.data.map((a) => +a.toFixed(s)) : r.data;
1390
+ for (const r of s.ops) {
1391
+ const i = typeof t == "number" && t >= 0 ? r.data.map((a) => +a.toFixed(t)) : r.data;
1392
1392
  switch (r.op) {
1393
1393
  case "move":
1394
1394
  e.moveTo(i[0], i[1]);
@@ -1401,7 +1401,7 @@ class zt {
1401
1401
  break;
1402
1402
  }
1403
1403
  }
1404
- n.type === "fillPath" ? e.fill(t) : e.stroke();
1404
+ s.type === "fillPath" ? e.fill(n) : e.stroke();
1405
1405
  }
1406
1406
  get generator() {
1407
1407
  return this.gen;
@@ -1409,75 +1409,75 @@ class zt {
1409
1409
  getDefaultOptions() {
1410
1410
  return this.gen.defaultOptions;
1411
1411
  }
1412
- line(e, n, s, t, r) {
1413
- const i = this.gen.line(e, n, s, t, r);
1412
+ line(e, s, t, n, r) {
1413
+ const i = this.gen.line(e, s, t, n, r);
1414
1414
  return this.draw(i), i;
1415
1415
  }
1416
- rectangle(e, n, s, t, r) {
1417
- const i = this.gen.rectangle(e, n, s, t, r);
1416
+ rectangle(e, s, t, n, r) {
1417
+ const i = this.gen.rectangle(e, s, t, n, r);
1418
1418
  return this.draw(i), i;
1419
1419
  }
1420
- ellipse(e, n, s, t, r) {
1421
- const i = this.gen.ellipse(e, n, s, t, r);
1420
+ ellipse(e, s, t, n, r) {
1421
+ const i = this.gen.ellipse(e, s, t, n, r);
1422
1422
  return this.draw(i), i;
1423
1423
  }
1424
- circle(e, n, s, t) {
1425
- const r = this.gen.circle(e, n, s, t);
1424
+ circle(e, s, t, n) {
1425
+ const r = this.gen.circle(e, s, t, n);
1426
1426
  return this.draw(r), r;
1427
1427
  }
1428
- linearPath(e, n) {
1429
- const s = this.gen.linearPath(e, n);
1430
- return this.draw(s), s;
1428
+ linearPath(e, s) {
1429
+ const t = this.gen.linearPath(e, s);
1430
+ return this.draw(t), t;
1431
1431
  }
1432
- polygon(e, n) {
1433
- const s = this.gen.polygon(e, n);
1434
- return this.draw(s), s;
1432
+ polygon(e, s) {
1433
+ const t = this.gen.polygon(e, s);
1434
+ return this.draw(t), t;
1435
1435
  }
1436
- arc(e, n, s, t, r, i, a = !1, l) {
1437
- const u = this.gen.arc(e, n, s, t, r, i, a, l);
1436
+ arc(e, s, t, n, r, i, a = !1, c) {
1437
+ const u = this.gen.arc(e, s, t, n, r, i, a, c);
1438
1438
  return this.draw(u), u;
1439
1439
  }
1440
- curve(e, n) {
1441
- const s = this.gen.curve(e, n);
1442
- return this.draw(s), s;
1440
+ curve(e, s) {
1441
+ const t = this.gen.curve(e, s);
1442
+ return this.draw(t), t;
1443
1443
  }
1444
- path(e, n) {
1445
- const s = this.gen.path(e, n);
1446
- return this.draw(s), s;
1444
+ path(e, s) {
1445
+ const t = this.gen.path(e, s);
1446
+ return this.draw(t), t;
1447
1447
  }
1448
1448
  }
1449
1449
  const he = "http://www.w3.org/2000/svg";
1450
1450
  class It {
1451
- constructor(e, n) {
1452
- this.svg = e, this.gen = new ve(n);
1451
+ constructor(e, s) {
1452
+ this.svg = e, this.gen = new ve(s);
1453
1453
  }
1454
1454
  draw(e) {
1455
- const n = e.sets || [], s = e.options || this.getDefaultOptions(), t = this.svg.ownerDocument || window.document, r = t.createElementNS(he, "g"), i = e.options.fixedDecimalPlaceDigits;
1456
- for (const a of n) {
1457
- let l = null;
1455
+ const s = e.sets || [], t = e.options || this.getDefaultOptions(), n = this.svg.ownerDocument || window.document, r = n.createElementNS(he, "g"), i = e.options.fixedDecimalPlaceDigits;
1456
+ for (const a of s) {
1457
+ let c = null;
1458
1458
  switch (a.type) {
1459
1459
  case "path": {
1460
- l = t.createElementNS(he, "path"), l.setAttribute("d", this.opsToPath(a, i)), l.setAttribute("stroke", s.stroke), l.setAttribute("stroke-width", s.strokeWidth + ""), l.setAttribute("fill", "none"), s.strokeLineDash && l.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && l.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
1460
+ c = n.createElementNS(he, "path"), c.setAttribute("d", this.opsToPath(a, i)), c.setAttribute("stroke", t.stroke), c.setAttribute("stroke-width", t.strokeWidth + ""), c.setAttribute("fill", "none"), t.strokeLineDash && c.setAttribute("stroke-dasharray", t.strokeLineDash.join(" ").trim()), t.strokeLineDashOffset && c.setAttribute("stroke-dashoffset", `${t.strokeLineDashOffset}`);
1461
1461
  break;
1462
1462
  }
1463
1463
  case "fillPath": {
1464
- l = t.createElementNS(he, "path"), l.setAttribute("d", this.opsToPath(a, i)), l.setAttribute("stroke", "none"), l.setAttribute("stroke-width", "0"), l.setAttribute("fill", s.fill || ""), (e.shape === "curve" || e.shape === "polygon") && l.setAttribute("fill-rule", "evenodd");
1464
+ c = n.createElementNS(he, "path"), c.setAttribute("d", this.opsToPath(a, i)), c.setAttribute("stroke", "none"), c.setAttribute("stroke-width", "0"), c.setAttribute("fill", t.fill || ""), (e.shape === "curve" || e.shape === "polygon") && c.setAttribute("fill-rule", "evenodd");
1465
1465
  break;
1466
1466
  }
1467
1467
  case "fillSketch": {
1468
- l = this.fillSketch(t, a, s);
1468
+ c = this.fillSketch(n, a, t);
1469
1469
  break;
1470
1470
  }
1471
1471
  }
1472
- l && r.appendChild(l);
1472
+ c && r.appendChild(c);
1473
1473
  }
1474
1474
  return r;
1475
1475
  }
1476
- fillSketch(e, n, s) {
1477
- let t = s.fillWeight;
1478
- t < 0 && (t = s.strokeWidth / 2);
1476
+ fillSketch(e, s, t) {
1477
+ let n = t.fillWeight;
1478
+ n < 0 && (n = t.strokeWidth / 2);
1479
1479
  const r = e.createElementNS(he, "path");
1480
- return r.setAttribute("d", this.opsToPath(n, s.fixedDecimalPlaceDigits)), r.setAttribute("stroke", s.fill || ""), r.setAttribute("stroke-width", t + ""), r.setAttribute("fill", "none"), s.fillLineDash && r.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && r.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), r;
1480
+ return r.setAttribute("d", this.opsToPath(s, t.fixedDecimalPlaceDigits)), r.setAttribute("stroke", t.fill || ""), r.setAttribute("stroke-width", n + ""), r.setAttribute("fill", "none"), t.fillLineDash && r.setAttribute("stroke-dasharray", t.fillLineDash.join(" ").trim()), t.fillLineDashOffset && r.setAttribute("stroke-dashoffset", `${t.fillLineDashOffset}`), r;
1481
1481
  }
1482
1482
  get generator() {
1483
1483
  return this.gen;
@@ -1485,49 +1485,49 @@ class It {
1485
1485
  getDefaultOptions() {
1486
1486
  return this.gen.defaultOptions;
1487
1487
  }
1488
- opsToPath(e, n) {
1489
- return this.gen.opsToPath(e, n);
1488
+ opsToPath(e, s) {
1489
+ return this.gen.opsToPath(e, s);
1490
1490
  }
1491
- line(e, n, s, t, r) {
1492
- const i = this.gen.line(e, n, s, t, r);
1491
+ line(e, s, t, n, r) {
1492
+ const i = this.gen.line(e, s, t, n, r);
1493
1493
  return this.draw(i);
1494
1494
  }
1495
- rectangle(e, n, s, t, r) {
1496
- const i = this.gen.rectangle(e, n, s, t, r);
1495
+ rectangle(e, s, t, n, r) {
1496
+ const i = this.gen.rectangle(e, s, t, n, r);
1497
1497
  return this.draw(i);
1498
1498
  }
1499
- ellipse(e, n, s, t, r) {
1500
- const i = this.gen.ellipse(e, n, s, t, r);
1499
+ ellipse(e, s, t, n, r) {
1500
+ const i = this.gen.ellipse(e, s, t, n, r);
1501
1501
  return this.draw(i);
1502
1502
  }
1503
- circle(e, n, s, t) {
1504
- const r = this.gen.circle(e, n, s, t);
1503
+ circle(e, s, t, n) {
1504
+ const r = this.gen.circle(e, s, t, n);
1505
1505
  return this.draw(r);
1506
1506
  }
1507
- linearPath(e, n) {
1508
- const s = this.gen.linearPath(e, n);
1509
- return this.draw(s);
1507
+ linearPath(e, s) {
1508
+ const t = this.gen.linearPath(e, s);
1509
+ return this.draw(t);
1510
1510
  }
1511
- polygon(e, n) {
1512
- const s = this.gen.polygon(e, n);
1513
- return this.draw(s);
1511
+ polygon(e, s) {
1512
+ const t = this.gen.polygon(e, s);
1513
+ return this.draw(t);
1514
1514
  }
1515
- arc(e, n, s, t, r, i, a = !1, l) {
1516
- const u = this.gen.arc(e, n, s, t, r, i, a, l);
1515
+ arc(e, s, t, n, r, i, a = !1, c) {
1516
+ const u = this.gen.arc(e, s, t, n, r, i, a, c);
1517
1517
  return this.draw(u);
1518
1518
  }
1519
- curve(e, n) {
1520
- const s = this.gen.curve(e, n);
1521
- return this.draw(s);
1519
+ curve(e, s) {
1520
+ const t = this.gen.curve(e, s);
1521
+ return this.draw(t);
1522
1522
  }
1523
- path(e, n) {
1524
- const s = this.gen.path(e, n);
1525
- return this.draw(s);
1523
+ path(e, s) {
1524
+ const t = this.gen.path(e, s);
1525
+ return this.draw(t);
1526
1526
  }
1527
1527
  }
1528
- const L = {
1528
+ const A = {
1529
1529
  canvas(o, e) {
1530
- return new zt(o, e);
1530
+ return new Dt(o, e);
1531
1531
  },
1532
1532
  svg(o, e) {
1533
1533
  return new It(o, e);
@@ -1538,15 +1538,15 @@ const L = {
1538
1538
  newSeed() {
1539
1539
  return ve.newSeed();
1540
1540
  }
1541
- }, J = (o, e, n, s, t) => `M${o + t},${e}
1542
- H${o + n - t}
1543
- A${t},${t} 0 0 1 ${o + n},${e + t}
1544
- V${e + s - t}
1545
- A${t},${t} 0 0 1 ${o + n - t},${e + s}
1546
- H${o + t}
1547
- A${t},${t} 0 0 1 ${o},${e + s - t}
1548
- V${e + t}
1549
- A${t},${t} 0 0 1 ${o + t},${e}
1541
+ }, K = (o, e, s, t, n) => `M${o + n},${e}
1542
+ H${o + s - n}
1543
+ A${n},${n} 0 0 1 ${o + s},${e + n}
1544
+ V${e + t - n}
1545
+ A${n},${n} 0 0 1 ${o + s - n},${e + t}
1546
+ H${o + n}
1547
+ A${n},${n} 0 0 1 ${o},${e + t - n}
1548
+ V${e + n}
1549
+ A${n},${n} 0 0 1 ${o + n},${e}
1550
1550
  Z`, Nt = {
1551
1551
  "drawui-button": "_drawui-button_1nx7z_1"
1552
1552
  }, ge = {
@@ -1565,7 +1565,7 @@ const L = {
1565
1565
  }
1566
1566
  },
1567
1567
  roughness: {
1568
- roughness: 1.8,
1568
+ roughness: 3,
1569
1569
  bowing: 2
1570
1570
  },
1571
1571
  fill: {
@@ -1623,7 +1623,7 @@ const L = {
1623
1623
  }
1624
1624
  }
1625
1625
  }, et = nt(ge), Gt = ({ theme: o, children: e }) => {
1626
- const n = {
1626
+ const s = {
1627
1627
  ...ge,
1628
1628
  ...o,
1629
1629
  stroke: {
@@ -1635,65 +1635,67 @@ const L = {
1635
1635
  ...o?.radius
1636
1636
  }
1637
1637
  };
1638
- return /* @__PURE__ */ w.jsx(et.Provider, { value: n, children: e });
1639
- }, A = () => rt(et), Vt = ({
1638
+ return /* @__PURE__ */ M.jsx(et.Provider, { value: s, children: e });
1639
+ }, j = () => rt(et), Vt = ({
1640
1640
  strokeWeight: o = "medium",
1641
1641
  radius: e = "md",
1642
- size: n = "sm",
1643
- backgroundColor: s,
1644
- children: t,
1645
- ...r
1642
+ size: s = "sm",
1643
+ backgroundColor: t,
1644
+ children: n,
1645
+ fillStyle: r,
1646
+ ...i
1646
1647
  }) => {
1647
- const i = A(), a = E(null), [l, u] = U(!1), c = i.buttonSize[n].width, h = i.buttonSize[n].height, f = i.buttonSize[n].fontSize;
1648
- return C(() => {
1649
- if (!a.current) return;
1650
- const d = L.svg(a.current);
1651
- a.current.innerHTML = "";
1652
- const g = i.stroke[o], m = d.path(
1653
- J(0, 0, c, h, i.radius[e]),
1648
+ const a = j(), c = O(null), [u, l] = Y(!1), h = a.buttonSize[s].width, f = a.buttonSize[s].height, d = a.buttonSize[s].fontSize;
1649
+ return R(() => {
1650
+ if (!c.current) return;
1651
+ const g = A.svg(c.current);
1652
+ c.current.innerHTML = "";
1653
+ const m = a.stroke[o], b = g.path(
1654
+ K(0, 0, h, f, a.radius[e]),
1654
1655
  {
1655
- stroke: g.color,
1656
- strokeWidth: g.width,
1657
- fill: s ?? i.fill.background,
1658
- roughness: l ? i.roughness.roughness + 1 : i.roughness.roughness,
1659
- bowing: i.roughness.bowing
1656
+ stroke: m.color,
1657
+ strokeWidth: m.width,
1658
+ fill: t ?? a.fill.background,
1659
+ fillStyle: r,
1660
+ roughness: u ? a.roughness.roughness + 1 : a.roughness.roughness,
1661
+ bowing: a.roughness.bowing
1660
1662
  }
1661
1663
  );
1662
- a.current.appendChild(m);
1663
- }, [l, o, e, i]), /* @__PURE__ */ w.jsxs(
1664
+ c.current.appendChild(b);
1665
+ }, [u, o, e, a]), /* @__PURE__ */ M.jsxs(
1664
1666
  "button",
1665
1667
  {
1666
- ...r,
1667
- onMouseEnter: () => u(!0),
1668
- onMouseLeave: () => u(!1),
1669
- className: `${Nt["drawui-button"]} ${r.className ?? ""}`,
1668
+ ...i,
1669
+ onMouseEnter: () => l(!0),
1670
+ onMouseLeave: () => l(!1),
1671
+ className: `${Nt["drawui-button"]} ${i.className ?? ""}`,
1670
1672
  style: {
1671
1673
  position: "relative",
1672
- width: c,
1673
- height: h,
1674
+ width: h,
1675
+ height: f,
1674
1676
  border: "none",
1675
1677
  background: "transparent",
1676
1678
  cursor: "pointer"
1677
1679
  },
1678
1680
  children: [
1679
- /* @__PURE__ */ w.jsx(
1681
+ /* @__PURE__ */ M.jsx(
1680
1682
  "svg",
1681
1683
  {
1682
- ref: a,
1683
- width: c,
1684
- height: h,
1684
+ ref: c,
1685
+ width: h,
1686
+ height: f,
1685
1687
  style: { position: "absolute", inset: 0 }
1686
1688
  }
1687
1689
  ),
1688
- /* @__PURE__ */ w.jsx(
1690
+ /* @__PURE__ */ M.jsx(
1689
1691
  "span",
1690
1692
  {
1691
1693
  style: {
1692
1694
  position: "relative",
1693
- fontSize: f,
1695
+ fontSize: d,
1694
1696
  pointerEvents: "none"
1695
1697
  },
1696
- children: t
1698
+ children: n
1697
1699
  }
1698
1700
  )
1699
1701
  ]
@@ -1704,49 +1706,51 @@ const L = {
1704
1706
  "drawui-card-header": "_drawui-card-header_vhoat_7",
1705
1707
  "drawui-card-body": "_drawui-card-body_vhoat_12",
1706
1708
  "drawui-card-footer": "_drawui-card-footer_vhoat_17"
1707
- }, Wt = "_vertical_1tdom_6", Ft = "_horizontal_1tdom_11", Pe = {
1709
+ }, Wt = "_vertical_1tdom_6", Ht = "_horizontal_1tdom_11", Pe = {
1708
1710
  "drawui-divider": "_drawui-divider_1tdom_1",
1709
1711
  vertical: Wt,
1710
- horizontal: Ft
1712
+ horizontal: Ht
1711
1713
  }, Ge = ({
1712
1714
  strokeWeight: o = "medium",
1713
1715
  width: e = "100%",
1714
- vertical: n = !1,
1715
- className: s
1716
+ vertical: s = !1,
1717
+ className: t,
1718
+ fillStyle: n
1716
1719
  }) => {
1717
- const t = A(), r = E(null);
1718
- return C(() => {
1719
- if (!r.current) return;
1720
- r.current.innerHTML = "";
1721
- const i = L.svg(r.current), a = t.stroke[o];
1722
- if (n) {
1723
- const l = typeof e == "number" ? e : 100, u = i.line(0, 0, 0, l, {
1724
- stroke: a.color,
1725
- strokeWidth: a.width,
1726
- roughness: t.roughness.roughness,
1727
- bowing: t.roughness.bowing
1720
+ const r = j(), i = O(null);
1721
+ return R(() => {
1722
+ if (!i.current) return;
1723
+ i.current.innerHTML = "";
1724
+ const a = A.svg(i.current), c = r.stroke[o];
1725
+ if (s) {
1726
+ const u = typeof e == "number" ? e : 100, l = a.line(0, 0, 0, u, {
1727
+ stroke: c.color,
1728
+ strokeWidth: c.width,
1729
+ roughness: r.roughness.roughness,
1730
+ bowing: r.roughness.bowing
1728
1731
  });
1729
- r.current.appendChild(u);
1732
+ i.current.appendChild(l);
1730
1733
  } else {
1731
- const l = typeof e == "number" ? e : 300, u = i.line(0, 0, l, 0, {
1732
- stroke: a.color,
1733
- strokeWidth: a.width,
1734
- roughness: t.roughness.roughness,
1735
- bowing: t.roughness.bowing
1734
+ const u = typeof e == "number" ? e : 300, l = a.line(0, 0, u, 0, {
1735
+ stroke: c.color,
1736
+ strokeWidth: c.width,
1737
+ roughness: r.roughness.roughness,
1738
+ bowing: r.roughness.bowing,
1739
+ fillStyle: n
1736
1740
  });
1737
- r.current.appendChild(u);
1741
+ i.current.appendChild(l);
1738
1742
  }
1739
- }, [t, o, e, n]), /* @__PURE__ */ w.jsx(
1743
+ }, [r, o, e, s]), /* @__PURE__ */ M.jsx(
1740
1744
  "div",
1741
1745
  {
1742
- className: `${Pe["drawui-divider"]} ${n ? Pe.vertical : Pe.horizontal} ${s ?? ""}`,
1743
- style: { width: n ? void 0 : e },
1744
- children: /* @__PURE__ */ w.jsx(
1746
+ className: `${Pe["drawui-divider"]} ${s ? Pe.vertical : Pe.horizontal} ${t ?? ""}`,
1747
+ style: { width: s ? void 0 : e },
1748
+ children: /* @__PURE__ */ M.jsx(
1745
1749
  "svg",
1746
1750
  {
1747
- ref: r,
1748
- width: n ? 2 : e,
1749
- height: n ? e : 2,
1751
+ ref: i,
1752
+ width: s ? 2 : e,
1753
+ height: s ? e : 2,
1750
1754
  style: { display: "block" }
1751
1755
  }
1752
1756
  )
@@ -1755,58 +1759,86 @@ const L = {
1755
1759
  }, Yt = ({
1756
1760
  strokeWeight: o = "medium",
1757
1761
  radius: e = "md",
1758
- width: n = 300,
1759
- height: s = 200,
1760
- backgroundColor: t,
1762
+ width: s = 300,
1763
+ height: t,
1764
+ //optional, card adjust height itself by content
1765
+ backgroundColor: n,
1761
1766
  header: r,
1762
1767
  footer: i,
1763
- children: a,
1764
- ...l
1768
+ fillStyle: a,
1769
+ children: c,
1770
+ ...u
1765
1771
  }) => {
1766
- const u = A(), c = E(null), [h, f] = U(!1);
1767
- return C(() => {
1768
- if (!c.current) return;
1769
- const d = L.svg(c.current);
1770
- c.current.innerHTML = "";
1771
- const g = u.stroke[o], m = d.path(
1772
- J(0, 0, n, s, u.radius[e]),
1772
+ const l = j(), h = O(null), f = O(null), [d, g] = Y(!1), [m, b] = Y(t ?? 200);
1773
+ R(() => {
1774
+ if (!f.current || t) return;
1775
+ const y = () => {
1776
+ if (f.current) {
1777
+ const z = f.current.scrollHeight;
1778
+ b(z);
1779
+ }
1780
+ };
1781
+ y();
1782
+ const C = new ResizeObserver(y);
1783
+ return C.observe(f.current), () => C.disconnect();
1784
+ }, [c, r, i, t]), R(() => {
1785
+ if (!h.current) return;
1786
+ const y = A.svg(h.current);
1787
+ h.current.innerHTML = "";
1788
+ const C = l.stroke[o], z = t ?? m, N = y.path(
1789
+ K(0, 0, s, z, l.radius[e]),
1773
1790
  {
1774
- stroke: g.color,
1775
- strokeWidth: g.width,
1776
- fill: t ?? u.fill.background,
1777
- roughness: h ? u.roughness.roughness + 1 : u.roughness.roughness,
1778
- bowing: u.roughness.bowing
1791
+ stroke: C.color,
1792
+ strokeWidth: C.width,
1793
+ fill: n ?? l.fill.background,
1794
+ roughness: d ? l.roughness.roughness + 1 : l.roughness.roughness,
1795
+ bowing: l.roughness.bowing,
1796
+ fillStyle: a
1779
1797
  }
1780
1798
  );
1781
- c.current.appendChild(m);
1782
- }, [o, e, n, s, t, u]), /* @__PURE__ */ w.jsxs(
1799
+ h.current.appendChild(N);
1800
+ }, [
1801
+ o,
1802
+ e,
1803
+ s,
1804
+ m,
1805
+ t,
1806
+ n,
1807
+ l,
1808
+ d,
1809
+ a
1810
+ ]);
1811
+ const v = t ?? m;
1812
+ return /* @__PURE__ */ M.jsxs(
1783
1813
  "div",
1784
1814
  {
1785
- ...l,
1786
- className: `${fe["drawui-card"]} ${l.className ?? ""}`,
1787
- onMouseEnter: () => f(!0),
1788
- onMouseLeave: () => f(!1),
1815
+ ...u,
1816
+ ref: f,
1817
+ className: `${fe["drawui-card"]} ${u.className ?? ""}`,
1818
+ onMouseEnter: () => g(!0),
1819
+ onMouseLeave: () => g(!1),
1789
1820
  style: {
1790
1821
  position: "relative",
1791
- width: n,
1792
- height: s,
1822
+ width: s,
1823
+ minHeight: t || "auto",
1824
+ height: t || "auto",
1793
1825
  cursor: "default",
1794
1826
  display: "flex",
1795
1827
  flexDirection: "column",
1796
1828
  overflow: "hidden"
1797
1829
  },
1798
1830
  children: [
1799
- /* @__PURE__ */ w.jsx(
1831
+ /* @__PURE__ */ M.jsx(
1800
1832
  "svg",
1801
1833
  {
1802
- ref: c,
1803
- width: n,
1804
- height: s,
1834
+ ref: h,
1835
+ width: s,
1836
+ height: v,
1805
1837
  style: { position: "absolute", inset: 0, pointerEvents: "none" }
1806
1838
  }
1807
1839
  ),
1808
- r && /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
1809
- /* @__PURE__ */ w.jsx(
1840
+ r && /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
1841
+ /* @__PURE__ */ M.jsx(
1810
1842
  "div",
1811
1843
  {
1812
1844
  className: fe["drawui-card-header"],
@@ -1814,19 +1846,19 @@ const L = {
1814
1846
  children: r
1815
1847
  }
1816
1848
  ),
1817
- /* @__PURE__ */ w.jsx(Ge, { width: n, strokeWeight: "thick" })
1849
+ /* @__PURE__ */ M.jsx(Ge, { width: s, strokeWeight: "thick" })
1818
1850
  ] }),
1819
- /* @__PURE__ */ w.jsx(
1851
+ /* @__PURE__ */ M.jsx(
1820
1852
  "div",
1821
1853
  {
1822
1854
  className: fe["drawui-card-body"],
1823
1855
  style: { position: "relative", zIndex: 1, flex: 1 },
1824
- children: a
1856
+ children: c
1825
1857
  }
1826
1858
  ),
1827
- i && /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
1828
- /* @__PURE__ */ w.jsx(Ge, { width: n, strokeWeight: "thick" }),
1829
- /* @__PURE__ */ w.jsx(
1859
+ i && /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
1860
+ /* @__PURE__ */ M.jsx(Ge, { width: s, strokeWeight: "thick" }),
1861
+ /* @__PURE__ */ M.jsx(
1830
1862
  "div",
1831
1863
  {
1832
1864
  className: fe["drawui-card-footer"],
@@ -1844,77 +1876,81 @@ const L = {
1844
1876
  }, Bt = ({
1845
1877
  header: o,
1846
1878
  children: e,
1847
- strokeWeight: n = "medium",
1848
- radius: s = "md",
1849
- width: t = 300,
1850
- className: r
1879
+ strokeWeight: s = "medium",
1880
+ radius: t = "md",
1881
+ width: n = 300,
1882
+ fillStyle: r,
1883
+ className: i
1851
1884
  }) => {
1852
- const i = A(), a = E(null);
1853
- return C(() => {
1854
- if (!a.current) return;
1855
- const l = L.svg(a.current);
1856
- a.current.innerHTML = "";
1857
- const u = i.stroke[n], c = l.path(
1858
- J(0, 0, t, 40, i.radius[s]),
1885
+ const a = j(), c = O(null);
1886
+ return R(() => {
1887
+ if (!c.current) return;
1888
+ const u = A.svg(c.current);
1889
+ c.current.innerHTML = "";
1890
+ const l = a.stroke[s], h = u.path(
1891
+ K(0, 0, n, 40, a.radius[t]),
1859
1892
  {
1860
- stroke: u.color,
1861
- strokeWidth: u.width,
1893
+ stroke: l.color,
1894
+ strokeWidth: l.width,
1862
1895
  fill: "transparent",
1863
- roughness: i.roughness.roughness,
1864
- bowing: i.roughness.bowing
1896
+ roughness: a.roughness.roughness,
1897
+ bowing: a.roughness.bowing,
1898
+ fillStyle: r
1865
1899
  }
1866
1900
  );
1867
- a.current.appendChild(c);
1868
- }, [i, n, s, t]), /* @__PURE__ */ w.jsx("div", { className: `${Ve["drawui-collapse"]} ${r ?? ""}`, style: { width: t }, children: /* @__PURE__ */ w.jsxs("details", { children: [
1869
- /* @__PURE__ */ w.jsxs("summary", { style: { position: "relative" }, children: [
1870
- /* @__PURE__ */ w.jsx(
1901
+ c.current.appendChild(h);
1902
+ }, [a, s, t, n]), /* @__PURE__ */ M.jsx("div", { className: `${Ve["drawui-collapse"]} ${i ?? ""}`, style: { width: n }, children: /* @__PURE__ */ M.jsxs("details", { children: [
1903
+ /* @__PURE__ */ M.jsxs("summary", { style: { position: "relative" }, children: [
1904
+ /* @__PURE__ */ M.jsx(
1871
1905
  "svg",
1872
1906
  {
1873
- ref: a,
1874
- width: t,
1907
+ ref: c,
1908
+ width: n,
1875
1909
  height: 40,
1876
1910
  style: { position: "absolute", inset: 0, pointerEvents: "none" }
1877
1911
  }
1878
1912
  ),
1879
- /* @__PURE__ */ w.jsx("span", { style: { position: "relative", zIndex: 1 }, children: o })
1913
+ /* @__PURE__ */ M.jsx("span", { style: { position: "relative", zIndex: 1 }, children: o })
1880
1914
  ] }),
1881
- /* @__PURE__ */ w.jsx("div", { className: Ve["drawui-collapse-content"], children: e })
1915
+ /* @__PURE__ */ M.jsx("div", { className: Ve["drawui-collapse-content"], children: e })
1882
1916
  ] }) });
1883
- }, Ht = {}, Zt = ({
1917
+ }, Ft = {}, Zt = ({
1884
1918
  strokeWeight: o = "medium",
1885
1919
  radius: e = "md",
1886
- size: n = "sm",
1887
- icon: s,
1888
- backgroundColor: t,
1889
- ...r
1920
+ size: s = "sm",
1921
+ icon: t,
1922
+ fillStyle: n,
1923
+ backgroundColor: r,
1924
+ ...i
1890
1925
  }) => {
1891
- const i = A(), a = E(null), [l, u] = U(!1), c = i.buttonSize[n].height;
1892
- return C(() => {
1893
- if (!a.current) return;
1894
- const h = L.svg(a.current);
1895
- a.current.innerHTML = "";
1896
- const f = i.stroke[o], d = h.path(
1897
- J(0, 0, c, c, i.radius[e]),
1926
+ const a = j(), c = O(null), [u, l] = Y(!1), h = a.buttonSize[s].height;
1927
+ return R(() => {
1928
+ if (!c.current) return;
1929
+ const f = A.svg(c.current);
1930
+ c.current.innerHTML = "";
1931
+ const d = a.stroke[o], g = f.path(
1932
+ K(0, 0, h, h, a.radius[e]),
1898
1933
  {
1899
- stroke: f.color,
1900
- strokeWidth: f.width,
1901
- fill: t ?? i.fill.background,
1902
- roughness: l ? i.roughness.roughness + 1 : i.roughness.roughness,
1903
- bowing: i.roughness.bowing
1934
+ stroke: d.color,
1935
+ strokeWidth: d.width,
1936
+ fill: r ?? a.fill.background,
1937
+ roughness: u ? a.roughness.roughness + 1 : a.roughness.roughness,
1938
+ bowing: a.roughness.bowing,
1939
+ fillStyle: n
1904
1940
  }
1905
1941
  );
1906
- a.current.appendChild(d);
1907
- }, [l, o, e, i, c, t]), /* @__PURE__ */ w.jsxs(
1942
+ c.current.appendChild(g);
1943
+ }, [u, o, e, a, h, r]), /* @__PURE__ */ M.jsxs(
1908
1944
  "button",
1909
1945
  {
1910
- ...r,
1911
- onMouseEnter: () => u(!0),
1912
- onMouseLeave: () => u(!1),
1913
- className: `${Ht["drawui-button"]} ${r.className ?? ""}`,
1946
+ ...i,
1947
+ onMouseEnter: () => l(!0),
1948
+ onMouseLeave: () => l(!1),
1949
+ className: `${Ft["drawui-button"]} ${i.className ?? ""}`,
1914
1950
  style: {
1915
1951
  position: "relative",
1916
- width: c,
1917
- height: c,
1952
+ width: h,
1953
+ height: h,
1918
1954
  // height and width are equal
1919
1955
  border: "none",
1920
1956
  background: "transparent",
@@ -1925,12 +1961,12 @@ const L = {
1925
1961
  padding: 0
1926
1962
  },
1927
1963
  children: [
1928
- /* @__PURE__ */ w.jsx(
1964
+ /* @__PURE__ */ M.jsx(
1929
1965
  "svg",
1930
1966
  {
1931
- ref: a,
1932
- width: c,
1933
- height: c,
1967
+ ref: c,
1968
+ width: h,
1969
+ height: h,
1934
1970
  style: {
1935
1971
  position: "absolute",
1936
1972
  inset: 0,
@@ -1938,7 +1974,7 @@ const L = {
1938
1974
  }
1939
1975
  }
1940
1976
  ),
1941
- /* @__PURE__ */ w.jsx(
1977
+ /* @__PURE__ */ M.jsx(
1942
1978
  "span",
1943
1979
  {
1944
1980
  style: {
@@ -1948,7 +1984,7 @@ const L = {
1948
1984
  alignItems: "center",
1949
1985
  justifyContent: "center"
1950
1986
  },
1951
- children: s
1987
+ children: t
1952
1988
  }
1953
1989
  )
1954
1990
  ]
@@ -1960,62 +1996,64 @@ const L = {
1960
1996
  }, Xt = ({
1961
1997
  strokeWeight: o = "medium",
1962
1998
  backgroundColor: e,
1963
- radius: n = "md",
1964
- inputSize: s = "md",
1965
- className: t,
1966
- style: r,
1967
- ...i
1999
+ radius: s = "md",
2000
+ inputSize: t = "md",
2001
+ className: n,
2002
+ fillStyle: r,
2003
+ style: i,
2004
+ ...a
1968
2005
  }) => {
1969
- const a = A(), l = E(null), u = E(null), [c, h] = U(!1), [f, d] = U(!1), g = a.inputSize[s].height, m = a.inputSize[s].fontSize, b = a.inputSize[s].paddingX;
1970
- return C(() => {
1971
- if (!l.current || !u.current) return;
1972
- const v = u.current.offsetWidth, y = L.svg(l.current);
1973
- l.current.innerHTML = "";
1974
- const z = a.stroke[o], G = y.path(
1975
- J(0, 0, v, g, a.radius[n]),
2006
+ const c = j(), u = O(null), l = O(null), [h, f] = Y(!1), [d, g] = Y(!1), m = c.inputSize[t].height, b = c.inputSize[t].fontSize, v = c.inputSize[t].paddingX;
2007
+ return R(() => {
2008
+ if (!u.current || !l.current) return;
2009
+ const y = l.current.offsetWidth, C = A.svg(u.current);
2010
+ u.current.innerHTML = "";
2011
+ const z = c.stroke[o], N = C.path(
2012
+ K(0, 0, y, m, c.radius[s]),
1976
2013
  {
1977
2014
  stroke: z.color,
1978
2015
  strokeWidth: z.width,
1979
- fill: e ?? a.fill.background,
1980
- roughness: c ? a.roughness.roughness + 1 : a.roughness.roughness,
1981
- bowing: a.roughness.bowing
2016
+ fill: e ?? c.fill.background,
2017
+ roughness: h ? c.roughness.roughness + 1 : c.roughness.roughness,
2018
+ bowing: c.roughness.bowing,
2019
+ fillStyle: r
1982
2020
  }
1983
2021
  );
1984
- l.current.appendChild(G);
1985
- }, [c, f, o, n, s, a, e]), /* @__PURE__ */ w.jsxs(
2022
+ u.current.appendChild(N);
2023
+ }, [h, d, o, s, t, c, e]), /* @__PURE__ */ M.jsxs(
1986
2024
  "div",
1987
2025
  {
1988
- ref: u,
1989
- className: `${Ye["drawui-input"]} ${t ?? ""}`,
1990
- style: { height: g, ...r },
1991
- onMouseEnter: () => d(!0),
1992
- onMouseLeave: () => d(!1),
2026
+ ref: l,
2027
+ className: `${Ye["drawui-input"]} ${n ?? ""}`,
2028
+ style: { height: m, ...i },
2029
+ onMouseEnter: () => g(!0),
2030
+ onMouseLeave: () => g(!1),
1993
2031
  children: [
1994
- /* @__PURE__ */ w.jsx(
2032
+ /* @__PURE__ */ M.jsx(
1995
2033
  "svg",
1996
2034
  {
1997
- ref: l,
2035
+ ref: u,
1998
2036
  width: "100%",
1999
- height: g,
2037
+ height: m,
2000
2038
  style: { position: "absolute", inset: 0 }
2001
2039
  }
2002
2040
  ),
2003
- /* @__PURE__ */ w.jsx(
2041
+ /* @__PURE__ */ M.jsx(
2004
2042
  "input",
2005
2043
  {
2006
- ...i,
2044
+ ...a,
2007
2045
  className: Ye["drawui-input-field"],
2008
2046
  style: {
2009
- height: g,
2010
- fontSize: m,
2011
- paddingLeft: b,
2012
- paddingRight: b
2047
+ height: m,
2048
+ fontSize: b,
2049
+ paddingLeft: v,
2050
+ paddingRight: v
2013
2051
  },
2014
- onFocus: (v) => {
2015
- h(!0), i.onFocus?.(v);
2052
+ onFocus: (y) => {
2053
+ f(!0), a.onFocus?.(y);
2016
2054
  },
2017
- onBlur: (v) => {
2018
- h(!1), i.onBlur?.(v);
2055
+ onBlur: (y) => {
2056
+ f(!1), a.onBlur?.(y);
2019
2057
  }
2020
2058
  }
2021
2059
  )
@@ -2025,203 +2063,203 @@ const L = {
2025
2063
  }, Ut = ({
2026
2064
  size: o = 24,
2027
2065
  strokeWeight: e = "medium",
2028
- color: n,
2029
- className: s
2066
+ color: s,
2067
+ className: t
2030
2068
  }) => {
2031
- const t = A(), r = E(null);
2032
- return C(() => {
2069
+ const n = j(), r = O(null);
2070
+ return R(() => {
2033
2071
  if (!r.current) return;
2034
- const i = L.svg(r.current);
2072
+ const i = A.svg(r.current);
2035
2073
  r.current.innerHTML = "";
2036
- const a = t.stroke[e], l = n ?? a.color, u = i.path(
2074
+ const a = n.stroke[e], c = s ?? a.color, u = i.path(
2037
2075
  "M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",
2038
2076
  {
2039
- stroke: l,
2077
+ stroke: c,
2040
2078
  strokeWidth: a.width,
2041
- roughness: t.roughness.roughness,
2042
- bowing: t.roughness.bowing,
2079
+ roughness: n.roughness.roughness,
2080
+ bowing: n.roughness.bowing,
2043
2081
  fill: "transparent"
2044
2082
  }
2045
2083
  );
2046
2084
  r.current.appendChild(u);
2047
- const c = i.circle(12, 18, 2, {
2048
- stroke: l,
2085
+ const l = i.circle(12, 18, 2, {
2086
+ stroke: c,
2049
2087
  strokeWidth: a.width,
2050
- roughness: t.roughness.roughness,
2051
- bowing: t.roughness.bowing,
2088
+ roughness: n.roughness.roughness,
2089
+ bowing: n.roughness.bowing,
2052
2090
  fill: "transparent"
2053
2091
  });
2054
- r.current.appendChild(c);
2055
- }, [t, e, n]), /* @__PURE__ */ w.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: s });
2092
+ r.current.appendChild(l);
2093
+ }, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
2056
2094
  }, Qt = ({
2057
2095
  size: o = 24,
2058
2096
  strokeWeight: e = "medium",
2059
- color: n,
2060
- className: s
2097
+ color: s,
2098
+ className: t
2061
2099
  }) => {
2062
- const t = A(), r = E(null);
2063
- return C(() => {
2100
+ const n = j(), r = O(null);
2101
+ return R(() => {
2064
2102
  if (!r.current) return;
2065
- const i = L.svg(r.current);
2103
+ const i = A.svg(r.current);
2066
2104
  r.current.innerHTML = "";
2067
- const a = t.stroke[e], l = n ?? a.color, u = i.path(
2105
+ const a = n.stroke[e], c = s ?? a.color, u = i.path(
2068
2106
  "M2 12 L12 2 L22 12 V22 H2 Z",
2069
2107
  {
2070
- stroke: l,
2108
+ stroke: c,
2071
2109
  strokeWidth: a.width,
2072
- roughness: t.roughness.roughness,
2073
- bowing: t.roughness.bowing,
2110
+ roughness: n.roughness.roughness,
2111
+ bowing: n.roughness.bowing,
2074
2112
  fill: "transparent"
2075
2113
  }
2076
2114
  );
2077
2115
  r.current.appendChild(u);
2078
- }, [t, e, n]), /* @__PURE__ */ w.jsx(
2116
+ }, [n, e, s]), /* @__PURE__ */ M.jsx(
2079
2117
  "svg",
2080
2118
  {
2081
2119
  ref: r,
2082
2120
  width: o,
2083
2121
  height: o,
2084
2122
  viewBox: "0 0 24 24",
2085
- className: s
2123
+ className: t
2086
2124
  }
2087
2125
  );
2088
2126
  }, Jt = ({
2089
2127
  size: o = 24,
2090
2128
  strokeWeight: e = "medium",
2091
- color: n,
2092
- className: s
2129
+ color: s,
2130
+ className: t
2093
2131
  }) => {
2094
- const t = A(), r = E(null);
2095
- return C(() => {
2132
+ const n = j(), r = O(null);
2133
+ return R(() => {
2096
2134
  if (!r.current) return;
2097
- const i = L.svg(r.current);
2135
+ const i = A.svg(r.current);
2098
2136
  r.current.innerHTML = "";
2099
- const a = t.stroke[e], l = n ?? a.color, u = i.line(4, 12, 20, 12, {
2100
- stroke: l,
2137
+ const a = n.stroke[e], c = s ?? a.color, u = i.line(4, 12, 20, 12, {
2138
+ stroke: c,
2101
2139
  strokeWidth: a.width,
2102
- roughness: t.roughness.roughness,
2103
- bowing: t.roughness.bowing
2140
+ roughness: n.roughness.roughness,
2141
+ bowing: n.roughness.bowing
2104
2142
  });
2105
2143
  r.current.appendChild(u);
2106
- }, [t, e, n]), /* @__PURE__ */ w.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: s });
2144
+ }, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
2107
2145
  }, Kt = ({
2108
2146
  size: o = 24,
2109
2147
  strokeWeight: e = "medium",
2110
- color: n,
2111
- className: s
2148
+ color: s,
2149
+ className: t
2112
2150
  }) => {
2113
- const t = A(), r = E(null);
2114
- return C(() => {
2151
+ const n = j(), r = O(null);
2152
+ return R(() => {
2115
2153
  if (!r.current) return;
2116
- const i = L.svg(r.current);
2154
+ const i = A.svg(r.current);
2117
2155
  r.current.innerHTML = "";
2118
- const a = t.stroke[e], l = n ?? a.color, u = i.line(12, 4, 12, 20, {
2119
- stroke: l,
2156
+ const a = n.stroke[e], c = s ?? a.color, u = i.line(12, 4, 12, 20, {
2157
+ stroke: c,
2120
2158
  strokeWidth: a.width,
2121
- roughness: t.roughness.roughness,
2122
- bowing: t.roughness.bowing
2123
- }), c = i.line(4, 12, 20, 12, {
2124
- stroke: l,
2159
+ roughness: n.roughness.roughness,
2160
+ bowing: n.roughness.bowing
2161
+ }), l = i.line(4, 12, 20, 12, {
2162
+ stroke: c,
2125
2163
  strokeWidth: a.width,
2126
- roughness: t.roughness.roughness,
2127
- bowing: t.roughness.bowing
2164
+ roughness: n.roughness.roughness,
2165
+ bowing: n.roughness.bowing
2128
2166
  });
2129
- r.current.appendChild(u), r.current.appendChild(c);
2130
- }, [t, e, n]), /* @__PURE__ */ w.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: s });
2167
+ r.current.appendChild(u), r.current.appendChild(l);
2168
+ }, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
2131
2169
  }, es = ({
2132
2170
  size: o = 24,
2133
2171
  strokeWeight: e = "medium",
2134
- color: n,
2135
- className: s
2172
+ color: s,
2173
+ className: t
2136
2174
  }) => {
2137
- const t = A(), r = E(null);
2138
- return C(() => {
2175
+ const n = j(), r = O(null);
2176
+ return R(() => {
2139
2177
  if (!r.current) return;
2140
- const i = L.svg(r.current);
2178
+ const i = A.svg(r.current);
2141
2179
  r.current.innerHTML = "";
2142
- const a = t.stroke[e], l = n ?? a.color, u = i.circle(10, 10, 14, {
2143
- stroke: l,
2180
+ const a = n.stroke[e], c = s ?? a.color, u = i.circle(10, 10, 14, {
2181
+ stroke: c,
2144
2182
  strokeWidth: a.width,
2145
- roughness: t.roughness.roughness,
2146
- bowing: t.roughness.bowing,
2183
+ roughness: n.roughness.roughness,
2184
+ bowing: n.roughness.bowing,
2147
2185
  fill: "transparent"
2148
- }), c = i.line(16, 16, 22, 22, {
2149
- stroke: l,
2186
+ }), l = i.line(16, 16, 22, 22, {
2187
+ stroke: c,
2150
2188
  strokeWidth: a.width,
2151
- roughness: t.roughness.roughness,
2152
- bowing: t.roughness.bowing
2189
+ roughness: n.roughness.roughness,
2190
+ bowing: n.roughness.bowing
2153
2191
  });
2154
- r.current.appendChild(u), r.current.appendChild(c);
2155
- }, [t, e, n]), /* @__PURE__ */ w.jsx(
2192
+ r.current.appendChild(u), r.current.appendChild(l);
2193
+ }, [n, e, s]), /* @__PURE__ */ M.jsx(
2156
2194
  "svg",
2157
2195
  {
2158
2196
  ref: r,
2159
2197
  width: o,
2160
2198
  height: o,
2161
2199
  viewBox: "0 0 24 24",
2162
- className: s
2200
+ className: t
2163
2201
  }
2164
2202
  );
2165
2203
  }, ts = ({
2166
2204
  size: o = 24,
2167
2205
  strokeWeight: e = "medium",
2168
- color: n,
2169
- className: s
2206
+ color: s,
2207
+ className: t
2170
2208
  }) => {
2171
- const t = A(), r = E(null);
2172
- return C(() => {
2209
+ const n = j(), r = O(null);
2210
+ return R(() => {
2173
2211
  if (!r.current) return;
2174
- const i = L.svg(r.current);
2212
+ const i = A.svg(r.current);
2175
2213
  r.current.innerHTML = "";
2176
- const a = t.stroke[e], l = n ?? a.color, u = i.circle(12, 12, 14, {
2177
- stroke: l,
2214
+ const a = n.stroke[e], c = s ?? a.color, u = i.circle(12, 12, 14, {
2215
+ stroke: c,
2178
2216
  strokeWidth: a.width,
2179
- roughness: t.roughness.roughness,
2180
- bowing: t.roughness.bowing,
2217
+ roughness: n.roughness.roughness,
2218
+ bowing: n.roughness.bowing,
2181
2219
  fill: "transparent"
2182
2220
  });
2183
2221
  r.current.appendChild(u);
2184
- for (let c = 0; c < 8; c++) {
2185
- const h = c * Math.PI * 2 / 8, f = 12 + 7 * Math.cos(h), d = 12 + 7 * Math.sin(h), g = 12 + 10 * Math.cos(h), m = 12 + 10 * Math.sin(h), b = i.line(f, d, g, m, {
2186
- stroke: l,
2222
+ for (let l = 0; l < 8; l++) {
2223
+ const h = l * Math.PI * 2 / 8, f = 12 + 7 * Math.cos(h), d = 12 + 7 * Math.sin(h), g = 12 + 10 * Math.cos(h), m = 12 + 10 * Math.sin(h), b = i.line(f, d, g, m, {
2224
+ stroke: c,
2187
2225
  strokeWidth: a.width,
2188
- roughness: t.roughness.roughness,
2189
- bowing: t.roughness.bowing
2226
+ roughness: n.roughness.roughness,
2227
+ bowing: n.roughness.bowing
2190
2228
  });
2191
2229
  r.current.appendChild(b);
2192
2230
  }
2193
- }, [t, e, n]), /* @__PURE__ */ w.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: s });
2231
+ }, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
2194
2232
  }, ss = ({
2195
2233
  size: o = 24,
2196
2234
  strokeWeight: e = "medium",
2197
- color: n,
2198
- className: s
2235
+ color: s,
2236
+ className: t
2199
2237
  }) => {
2200
- const t = A(), r = E(null);
2201
- return C(() => {
2238
+ const n = j(), r = O(null);
2239
+ return R(() => {
2202
2240
  if (!r.current) return;
2203
- const i = L.svg(r.current);
2241
+ const i = A.svg(r.current);
2204
2242
  r.current.innerHTML = "";
2205
- const a = t.stroke[e], l = n ?? a.color, u = i.circle(12, 8, 6, {
2206
- stroke: l,
2243
+ const a = n.stroke[e], c = s ?? a.color, u = i.circle(12, 8, 6, {
2244
+ stroke: c,
2207
2245
  strokeWidth: a.width,
2208
- roughness: t.roughness.roughness,
2209
- bowing: t.roughness.bowing,
2246
+ roughness: n.roughness.roughness,
2247
+ bowing: n.roughness.bowing,
2210
2248
  fill: "transparent"
2211
2249
  });
2212
2250
  r.current.appendChild(u);
2213
- const c = i.path(
2251
+ const l = i.path(
2214
2252
  "M4 20 Q12 16 20 20",
2215
2253
  {
2216
- stroke: l,
2254
+ stroke: c,
2217
2255
  strokeWidth: a.width,
2218
- roughness: t.roughness.roughness,
2219
- bowing: t.roughness.bowing,
2256
+ roughness: n.roughness.roughness,
2257
+ bowing: n.roughness.bowing,
2220
2258
  fill: "transparent"
2221
2259
  }
2222
2260
  );
2223
- r.current.appendChild(c);
2224
- }, [t, e, n]), /* @__PURE__ */ w.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: s });
2261
+ r.current.appendChild(l);
2262
+ }, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
2225
2263
  };
2226
2264
  export {
2227
2265
  Vt as DrawuiButton,
@@ -2238,5 +2276,5 @@ export {
2238
2276
  es as IconSearch,
2239
2277
  ts as IconSettings,
2240
2278
  ss as IconUser,
2241
- A as useDrawuiTheme
2279
+ j as useDrawuiTheme
2242
2280
  };