@thibezer/ui-components-kit 2.24.1 → 2.24.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.
Files changed (151) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/dist/botao.cjs +12 -1
  3. package/dist/botao.js +162 -3
  4. package/dist/camadas.cjs +311 -1
  5. package/dist/camadas.js +3244 -148
  6. package/dist/campo-texto.cjs +16 -1
  7. package/dist/campo-texto.js +308 -7
  8. package/dist/canvas.cjs +22 -22
  9. package/dist/canvas.js +230 -233
  10. package/dist/card.cjs +20 -1
  11. package/dist/card.js +145 -2
  12. package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
  13. package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +18 -0
  14. package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +4 -0
  15. package/dist/components/ui-editor-prancha/editor-modos.d.ts +10 -0
  16. package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
  17. package/dist/components/ui-editor-prancha/index.d.ts +1 -0
  18. package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +39 -6
  19. package/dist/core.cjs +1 -1
  20. package/dist/core.js +44 -55
  21. package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
  22. package/dist/cores.cjs +32 -1
  23. package/dist/cores.js +300 -13
  24. package/dist/custom-elements.json +1712 -1205
  25. package/dist/data.cjs +28 -1
  26. package/dist/data.js +286 -99
  27. package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
  28. package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
  29. package/dist/feedback.cjs +52 -1
  30. package/dist/feedback.js +655 -25
  31. package/dist/forms.cjs +66 -1
  32. package/dist/forms.js +1216 -39
  33. package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
  34. package/dist/index.cjs +67 -1
  35. package/dist/index.js +1476 -274
  36. package/dist/kit-base-CGqj9aiD.cjs +2 -0
  37. package/dist/kit-base-_THn4w3u.js +1079 -0
  38. package/dist/mapa.cjs +5 -5
  39. package/dist/mapa.js +16 -17
  40. package/dist/modal.cjs +18 -1
  41. package/dist/modal.js +235 -29
  42. package/dist/motor.js +49 -49
  43. package/dist/prancha-nucleo.cjs +3 -1
  44. package/dist/prancha-nucleo.js +3120 -277
  45. package/dist/prancha.cjs +38 -1
  46. package/dist/prancha.js +3233 -228
  47. package/dist/register.cjs +1 -1
  48. package/dist/register.js +3 -20
  49. package/dist/seletor-mapa-base.cjs +13 -13
  50. package/dist/seletor-mapa-base.js +3 -5
  51. package/dist/tabela.cjs +142 -1
  52. package/dist/tabela.js +3773 -92
  53. package/dist/tipos-elementos.d.ts +5 -1
  54. package/dist/tipos-vue.d.ts +4 -1
  55. package/dist/tools.cjs +16 -1
  56. package/dist/tools.js +1564 -26
  57. package/dist/ui-seletor-cor-BGw8SBPm.cjs +83 -0
  58. package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-B_twSm-V.js} +8 -9
  59. package/dist/utils-ClVgqVyJ.cjs +1 -0
  60. package/dist/utils-DrHoxxmf.js +83 -0
  61. package/package.json +43 -2
  62. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  63. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  64. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  65. package/dist/altura-controle-vxQiXG4q.js +0 -62
  66. package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
  67. package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
  68. package/dist/degrade-CIxvOTUv.cjs +0 -1
  69. package/dist/degrade-gDa5sW__.js +0 -119
  70. package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
  71. package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
  72. package/dist/feature_historico-BAIYk1Me.cjs +0 -3
  73. package/dist/feature_historico-C4h9y5fu.js +0 -3039
  74. package/dist/form-atalhos-7JTYvumA.cjs +0 -1
  75. package/dist/form-atalhos-DDTlpgaB.js +0 -203
  76. package/dist/form-erros-CwPz7Jr4.cjs +0 -1
  77. package/dist/form-erros-DT5HklfD.js +0 -184
  78. package/dist/form-submissao-C-SPRKgT.js +0 -61
  79. package/dist/form-submissao-DxKO5MHI.cjs +0 -1
  80. package/dist/form-validacao-BlQFxUVj.js +0 -104
  81. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  82. package/dist/geometria-px-DKrWq_XY.js +0 -639
  83. package/dist/leaflet-CEPcxGWV.cjs +0 -1
  84. package/dist/leaflet-DOq10gfg.js +0 -84
  85. package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
  86. package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
  87. package/dist/listener-bag-D5omxZ9h.cjs +0 -1
  88. package/dist/listener-bag-DQgv7OON.js +0 -34
  89. package/dist/motor-By2te6PZ.js +0 -1400
  90. package/dist/motor-CkMxd378.cjs +0 -1
  91. package/dist/opcoes-CupvWVIm.js +0 -24
  92. package/dist/opcoes-vdAUY5OI.cjs +0 -1
  93. package/dist/parts-CaoQiCfI.js +0 -7
  94. package/dist/parts-vQa2873h.cjs +0 -1
  95. package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
  96. package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
  97. package/dist/ssr-safe-5cWfJP-s.js +0 -10
  98. package/dist/ssr-safe-CiHD1adl.cjs +0 -1
  99. package/dist/svg-seguro-ChVJ2L2z.js +0 -74
  100. package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
  101. package/dist/ui-badge-DE58YSBY.cjs +0 -28
  102. package/dist/ui-badge-KgmI3jOD.js +0 -201
  103. package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
  104. package/dist/ui-botao-zLkcMMyP.js +0 -168
  105. package/dist/ui-bus-CUd99VJi.js +0 -177
  106. package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
  107. package/dist/ui-camadas-DoHPnbQm.js +0 -3133
  108. package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
  109. package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
  110. package/dist/ui-campo-texto-btevggO3.js +0 -379
  111. package/dist/ui-card-7IEYbCN0.js +0 -150
  112. package/dist/ui-card-Bx8EyzYY.cjs +0 -20
  113. package/dist/ui-card-C-EJoKnm.js +0 -150
  114. package/dist/ui-card-DFnRp9bl.js +0 -146
  115. package/dist/ui-card-DrWVJQKw.cjs +0 -20
  116. package/dist/ui-card-DsIjHMmG.cjs +0 -20
  117. package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
  118. package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
  119. package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
  120. package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
  121. package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
  122. package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
  123. package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
  124. package/dist/ui-linha-B4mBRm1x.cjs +0 -61
  125. package/dist/ui-linha-DTEIIww4.js +0 -1167
  126. package/dist/ui-linha-KFF86FW5.js +0 -752
  127. package/dist/ui-modal-BrXzVZ65.js +0 -216
  128. package/dist/ui-modal-lARKzEVZ.cjs +0 -18
  129. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
  130. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
  131. package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
  132. package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
  133. package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
  134. package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
  135. package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
  136. package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
  137. package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
  138. package/dist/ui-skeleton-BLEV6h3k.js +0 -653
  139. package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
  140. package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
  141. package/dist/ui-switch-Ctxk-jKS.js +0 -1212
  142. package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
  143. package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
  144. package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
  145. package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
  146. package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
  147. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
  148. package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
  149. package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
  150. package/dist/zero-js-triggers-CJT988bR.js +0 -83
  151. package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
@@ -1,302 +1,3145 @@
1
- import { E as k } from "./feature_caixa-2Sxv3tGa.js";
2
- import { a5 as g, c3 as D, aZ as v, c5 as N, z as y, aY as L, e as M, T as R, y as C, ag as F, d as z } from "./feature_historico-C4h9y5fu.js";
3
- import { A as J, C as W, D as Y, E as Z, a as j, b as aa, c as oa, F as ra, f as ea, g as sa, h as na, H as ta, I as ia, i as ca, j as la, k as ma, K as ua, L as pa, M as Aa, l as da, m as fa, n as ba, o as ha, O as Ea, P as Pa, p as Da, R as Sa, S as Ca, q as Oa, r as Ta, s as _a, t as Na, u as Ma, v as Ra, w as xa, x as Ia, B as ga, G as va, J as ya, N as La, Q as Fa, U as za, V as Ha, W as Ga, X as Ua, Y as Ba, Z as Xa, _ as Va, $ as qa, a0 as Qa, a1 as Ka, a2 as $a, a3 as ka, a4 as wa, a6 as Ja, a7 as Wa, a8 as Ya, a9 as Za, aa as ja, ab as ao, ac as oo, ad as ro, ae as eo, af as so, ah as no, ai as to, aj as io, ak as co, al as lo, am as mo, an as uo, ao as po, ap as Ao, aq as fo, ar as bo, as as ho, at as Eo, au as Po, av as Do, aw as So, ax as Co, ay as Oo, az as To, aA as _o, aB as No, aC as Mo, aD as Ro, aE as xo, aF as Io, aG as go, aH as vo, aI as yo, aJ as Lo, aK as Fo, aL as zo, aM as Ho, aN as Go, aO as Uo, aP as Bo, aQ as Xo, aR as Vo, aS as qo, aT as Qo, aU as Ko, aV as $o, aW as ko, aX as wo, a_ as Jo, a$ as Wo, b0 as Yo, b1 as Zo, b2 as jo, b3 as ar, b4 as or, b5 as rr, b6 as er, b7 as sr, b8 as nr, b9 as tr, ba as ir, bb as cr, bc as lr, bd as mr, be as ur, bf as pr, bg as Ar, bh as dr, bi as fr, bj as br, bk as hr, bl as Er, bm as Pr, bn as Dr, bo as Sr, bp as Cr, bq as Or, br as Tr, bs as _r, bt as Nr, bu as Mr, bv as Rr, bw as xr, bx as Ir, by as gr, bz as vr, bA as yr, bB as Lr, bC as Fr, bD as zr, bE as Hr, bF as Gr, bG as Ur, bH as Br, bI as Xr, bJ as Vr, bK as qr, bL as Qr, bM as Kr, bN as $r, bO as kr, bP as wr, bQ as Jr, bR as Wr, bS as Yr, bT as Zr, bU as jr, bV as ae, bW as oe, bX as re, bY as ee, bZ as se, b_ as ne, b$ as te, c0 as ie, c1 as ce, c2 as le, c4 as me, c6 as ue, c7 as pe, c8 as Ae, c9 as de } from "./feature_historico-C4h9y5fu.js";
4
- const E = (o) => typeof o == "number" && Number.isFinite(o), S = (o) => !!o && [o.x, o.y, o.largura, o.altura].every(E) && o.largura > 0 && o.altura > 0;
5
- function B(o, a, r, m = {}) {
6
- const t = Array.isArray(o) ? o.filter((e) => e && typeof e == "object") : [];
7
- if (!S(a) || !S(r)) return [...t];
8
- let s = r.largura / a.largura, i = r.altura / a.altura, p = r.x, A = r.y;
9
- if (m.manterProporcao) {
10
- const e = Math.min(s, i);
11
- p += (r.largura - a.largura * e) / 2, A += (r.altura - a.altura * e) / 2, s = e, i = e;
12
- }
13
- if (!(s > 0 && i > 0) || !E(s) || !E(i)) return [...t];
14
- const b = (e) => [(e[0] - a.x) * s + p, (e[1] - a.y) * i + A], c = { a: s, b: 0, c: 0, d: i, e: p - a.x * s, f: A - a.y * i }, d = m.escalarTexto ?? "distorcer", n = Math.sqrt(s * i);
15
- return t.map((e) => {
16
- var l;
17
- if (e.bloqueado && m.incluirBloqueados === !1) return e;
18
- if (((l = e.geometria) == null ? void 0 : l.tipo) === "texto" && d !== "distorcer") {
19
- const f = g([e]);
20
- if (!f) return e;
21
- const h = b(f), u = d === "tamanho" ? D(e, v(n, n, f)) : e;
22
- return D(u, N(h[0] - f[0], h[1] - f[1]));
23
- }
24
- return D(e, c);
1
+ var lo = Object.defineProperty;
2
+ var fo = (t, a, n) => a in t ? lo(t, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[a] = n;
3
+ var P = (t, a, n) => fo(t, typeof a != "symbol" ? a + "" : a, n);
4
+ import { a as At, K as Nn, g as Wa, U as ho, N as mo, O as zn, L as po, _ as go, n as N, E as Za, I as yo, V as pa, o as bo, q as Mo, a4 as xo, a5 as vo, k as Ao, l as Po } from "./geometria-px-DHMPUsxC.js";
5
+ import { b as Io, a as $o, V as So, H as Eo, G as jo, p as Lo, T as No, F as oa, q as lt, A as zo, n as Na, o as Co, C as To, B as qo, t as Oo, r as Cn, f as Pt, d as Do, x as wo, j as ko, i as Ro } from "./feature_caixa-BVc5LenS.js";
6
+ import { E as Is } from "./feature_caixa-BVc5LenS.js";
7
+ import { e as za } from "./cores-utils-DMyqWvZh.js";
8
+ function Dt(t) {
9
+ const a = t.length;
10
+ if (a < 3) return 0;
11
+ let n = 0;
12
+ for (let o = 0; o < a; o++) {
13
+ const e = t[o], r = t[(o + 1) % a];
14
+ n += e[0] * r[1] - r[0] * e[1];
15
+ }
16
+ return n / 2;
17
+ }
18
+ function Fo(t) {
19
+ const [a, ...n] = t;
20
+ if (!a) return 0;
21
+ const o = Math.abs(Dt(a)) - n.reduce((e, r) => e + Math.abs(Dt(r)), 0);
22
+ return Number.isFinite(o) ? Math.max(0, o) : 0;
23
+ }
24
+ function _o(t, a = !1) {
25
+ let n = 0;
26
+ for (let o = 1; o < t.length; o++) n += Math.hypot(t[o][0] - t[o - 1][0], t[o][1] - t[o - 1][1]);
27
+ return a && t.length > 2 && (n += Math.hypot(t[0][0] - t[t.length - 1][0], t[0][1] - t[t.length - 1][1])), n;
28
+ }
29
+ function Go(t) {
30
+ const a = t[0], n = t[1];
31
+ return {
32
+ paraXY: (o) => [o[0] - a, o[1] - n],
33
+ deXY: (o) => [a + o[0], n + o[1]]
34
+ };
35
+ }
36
+ const A = Object.freeze({
37
+ tipo: "plano",
38
+ unidade: "mm",
39
+ distancia: (t, a) => Math.hypot(a[0] - t[0], a[1] - t[1]),
40
+ comprimento: _o,
41
+ area: Fo,
42
+ planoLocal: Go,
43
+ deslocar: (t, a, n) => [t[0] + a, t[1] + n],
44
+ pontoDaBorda: (t, a) => [t[0] + a, t[1]],
45
+ pontoDeMedidaDoRaio: (t, a) => [t[0] + a, t[1]],
46
+ extremosDoCirculo(t, a) {
47
+ const n = Math.abs(a);
48
+ return [[t[0] - n, t[1] - n], [t[0] + n, t[1] + n]];
49
+ },
50
+ fatorEixo: () => 1
51
+ }), Ca = Object.freeze({
52
+ mm: 1,
53
+ cm: 10,
54
+ pt: 25.4 / 72,
55
+ pol: 25.4,
56
+ px: 25.4 / 96
57
+ });
58
+ function Tn(t) {
59
+ return typeof t == "string" && Object.prototype.hasOwnProperty.call(Ca, t);
60
+ }
61
+ function Yr(t, a) {
62
+ return !Number.isFinite(t) || !Tn(a) ? NaN : t * Ca[a];
63
+ }
64
+ function Wr(t, a) {
65
+ return !Number.isFinite(t) || !Tn(a) ? NaN : t / Ca[a];
66
+ }
67
+ const qn = 1e-12, pt = (t) => typeof t == "number" && Number.isFinite(t), nt = Object.freeze({ a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 });
68
+ function Zr(t, a, n, o, e, r) {
69
+ return { a: t, b: a, c: n, d: o, e, f: r };
70
+ }
71
+ function wt(t) {
72
+ if (!t || typeof t != "object") return !1;
73
+ const a = t;
74
+ return pt(a.a) && pt(a.b) && pt(a.c) && pt(a.d) && pt(a.e) && pt(a.f);
75
+ }
76
+ function It(t) {
77
+ return wt(t) ? { a: t.a, b: t.b, c: t.c, d: t.d, e: t.e, f: t.f } : nt;
78
+ }
79
+ const Jt = (t) => t.a * t.d - t.b * t.c, Xo = (t) => !(Math.abs(Jt(t)) > qn), Jr = (t, a = 0) => Math.abs(t.a - 1) <= a && Math.abs(t.b) <= a && Math.abs(t.c) <= a && Math.abs(t.d - 1) <= a && Math.abs(t.e) <= a && Math.abs(t.f) <= a;
80
+ function Qr(t, a, n = 1e-9) {
81
+ return Math.abs(t.a - a.a) <= n && Math.abs(t.b - a.b) <= n && Math.abs(t.c - a.c) <= n && Math.abs(t.d - a.d) <= n && Math.abs(t.e - a.e) <= n && Math.abs(t.f - a.f) <= n;
82
+ }
83
+ function ft(t, a) {
84
+ return {
85
+ a: t.a * a.a + t.c * a.b,
86
+ b: t.b * a.a + t.d * a.b,
87
+ c: t.a * a.c + t.c * a.d,
88
+ d: t.b * a.c + t.d * a.d,
89
+ e: t.a * a.e + t.c * a.f + t.e,
90
+ f: t.b * a.e + t.d * a.f + t.f
91
+ };
92
+ }
93
+ function Ta(...t) {
94
+ let a = nt;
95
+ for (const n of t) a = ft(n, a);
96
+ return a;
97
+ }
98
+ function dt(t) {
99
+ if (!wt(t)) return null;
100
+ const a = Jt(t);
101
+ if (!(Math.abs(a) > qn)) return null;
102
+ const n = {
103
+ a: t.d / a,
104
+ b: -t.b / a,
105
+ c: -t.c / a,
106
+ d: t.a / a,
107
+ e: (t.c * t.f - t.d * t.e) / a,
108
+ f: (t.b * t.e - t.a * t.f) / a
109
+ };
110
+ return wt(n) ? n : null;
111
+ }
112
+ function I(t, a) {
113
+ return [t.a * a[0] + t.c * a[1] + t.e, t.b * a[0] + t.d * a[1] + t.f];
114
+ }
115
+ function Kr(t, a) {
116
+ return [t.a * a[0] + t.c * a[1], t.b * a[0] + t.d * a[1]];
117
+ }
118
+ function ti(t, a) {
119
+ return a.map((n) => I(t, n));
120
+ }
121
+ const j = (t, a) => ({ a: 1, b: 0, c: 0, d: 1, e: t, f: a });
122
+ function qa(t, a) {
123
+ return a ? Ta(j(-a[0], -a[1]), t, j(a[0], a[1])) : t;
124
+ }
125
+ const Qt = (t, a = t, n) => qa({ a: t, b: 0, c: 0, d: a, e: 0, f: 0 }, n);
126
+ function On(t, a) {
127
+ const n = Math.cos(t), o = Math.sin(t);
128
+ return qa({ a: n, b: o, c: -o, d: n, e: 0, f: 0 }, a);
129
+ }
130
+ const Ja = (t, a = 0, n) => qa({ a: 1, b: a, c: t, d: 1, e: 0, f: 0 }, n);
131
+ function Bo(t, a) {
132
+ return Qt(t === "horizontal" ? -1 : 1, t === "vertical" ? -1 : 1, a);
133
+ }
134
+ function ai(t) {
135
+ const a = It(t), n = Math.hypot(a.a, a.b);
136
+ if (n === 0)
137
+ return { translacaoX: a.e, translacaoY: a.f, rotacao: 0, escalaX: 0, escalaY: Math.hypot(a.c, a.d), cisalhamento: 0 };
138
+ const o = Math.atan2(a.b, a.a), e = Jt(a) / n, r = Math.cos(o), i = Math.sin(o), s = e === 0 ? 0 : (a.c * r + a.d * i) / e;
139
+ return { translacaoX: a.e, translacaoY: a.f, rotacao: o, escalaX: n, escalaY: e, cisalhamento: s };
140
+ }
141
+ function ni(t) {
142
+ const a = Math.cos(t.rotacao), n = Math.sin(t.rotacao), o = a * t.escalaX, e = n * t.escalaX, r = (a * t.cisalhamento - n) * t.escalaY, i = (n * t.cisalhamento + a) * t.escalaY;
143
+ return It({ a: o, b: e, c: r, d: i, e: t.translacaoX, f: t.translacaoY });
144
+ }
145
+ const bt = 0.5522847498307936, Uo = 0.8, Ho = 1.2, Vo = 0.55, S = (t) => typeof t == "number" && Number.isFinite(t), Yo = "sans-serif", Wo = /^[\p{L}\p{N}\s,'"_-]{1,120}$/u;
146
+ function Dn(t) {
147
+ return typeof t == "string" && Wo.test(t.trim()) ? t.trim() : Yo;
148
+ }
149
+ let Vt = null, ga = 0;
150
+ function oi(t) {
151
+ Vt = typeof t == "function" ? t : null, ga++;
152
+ }
153
+ const ei = () => Vt !== null;
154
+ function Zo(t, a, n) {
155
+ const o = Math.max([...t].length, 1) * n * Vo;
156
+ if (!Vt) return o;
157
+ try {
158
+ const e = Vt(t, a, n);
159
+ return S(e) && e >= 0 ? Math.max(e, n * 0.1) : o;
160
+ } catch {
161
+ return o;
162
+ }
163
+ }
164
+ class Kt {
165
+ constructor() {
166
+ P(this, "mapa", /* @__PURE__ */ new WeakMap());
167
+ }
168
+ tem(a) {
169
+ var n;
170
+ return ((n = this.mapa.get(a)) == null ? void 0 : n.v) === ga;
171
+ }
172
+ obter(a) {
173
+ return this.mapa.get(a).valor;
174
+ }
175
+ gravar(a, n) {
176
+ this.mapa.set(a, { v: ga, valor: n });
177
+ }
178
+ }
179
+ const Qa = (t, a) => t[0] === a[0] && t[1] === a[1];
180
+ function wn(t, a, n) {
181
+ const o = (n ?? [0, 0, 0, 0]).map((r) => S(r) && r > 0 ? r : 0), e = Math.min(
182
+ 1,
183
+ o[0] + o[1] > 0 ? t / (o[0] + o[1]) : 1,
184
+ o[3] + o[2] > 0 ? t / (o[3] + o[2]) : 1,
185
+ o[0] + o[3] > 0 ? a / (o[0] + o[3]) : 1,
186
+ o[1] + o[2] > 0 ? a / (o[1] + o[2]) : 1
187
+ );
188
+ return e < 1 ? o.map((r) => r * e) : o;
189
+ }
190
+ function Jo(t, a) {
191
+ const n = [];
192
+ for (const o of t) {
193
+ const e = n[n.length - 1];
194
+ if (e && Qa(e.ponto, o.ponto)) {
195
+ const r = { ponto: e.ponto };
196
+ e.entrada && (r.entrada = e.entrada), o.saida && (r.saida = o.saida), n[n.length - 1] = r;
197
+ } else
198
+ n.push({ ...o });
199
+ }
200
+ if (n.length > 1 && Qa(n[0].ponto, n[n.length - 1].ponto)) {
201
+ const o = n.pop(), e = n[0], r = { ponto: e.ponto };
202
+ o.entrada && (r.entrada = o.entrada), e.saida && (r.saida = e.saida), n[0] = r;
203
+ }
204
+ return n;
205
+ }
206
+ function Qo(t, a, n) {
207
+ if (!(S(t) && S(a) && t > 0 && a > 0)) return null;
208
+ const o = -t / 2, e = t / 2, r = -a / 2, i = a / 2, [s, c, u, f] = wn(t, a, n);
209
+ if (s === 0 && c === 0 && u === 0 && f === 0)
210
+ return { tipo: "Polygon", aneis: [[[o, r], [e, r], [e, i], [o, i]]] };
211
+ const d = s * bt, l = c * bt, h = u * bt, m = f * bt, g = [];
212
+ s > 0 ? g.push({ ponto: [o + s, r], entrada: [o + s - d, r] }) : g.push({ ponto: [o, r] }), c > 0 ? g.push({ ponto: [e - c, r], saida: [e - c + l, r] }, { ponto: [e, r + c], entrada: [e, r + c - l] }) : g.push({ ponto: [e, r] }), u > 0 ? g.push({ ponto: [e, i - u], saida: [e, i - u + h] }, { ponto: [e - u, i], entrada: [e - u + h, i] }) : g.push({ ponto: [e, i] }), f > 0 ? g.push({ ponto: [o + f, i], saida: [o + f - m, i] }, { ponto: [o, i - f], entrada: [o, i - f + m] }) : g.push({ ponto: [o, i] }), s > 0 && g.push({ ponto: [o, r + s], saida: [o, r + s - d] });
213
+ const y = Jo(g);
214
+ return y.length < 3 ? null : { tipo: "Polygon", aneis: [At(y, !0)], curva: y };
215
+ }
216
+ const Ko = (t, a, n) => [t * Math.cos(n), a * Math.sin(n)], te = (t, a, n) => [-t * Math.sin(n), a * Math.cos(n)];
217
+ function ae(t, a, n, o, e) {
218
+ const r = o / e, i = 4 / 3 * Math.tan(r / 4), s = [];
219
+ for (let c = 0; c <= e; c++) {
220
+ const u = n + c * r, f = Ko(t, a, u), d = te(t, a, u), l = { ponto: f };
221
+ c > 0 && (l.entrada = [f[0] - i * d[0], f[1] - i * d[1]]), c < e && (l.saida = [f[0] + i * d[0], f[1] + i * d[1]]), s.push(l);
222
+ }
223
+ return s;
224
+ }
225
+ function ne(t) {
226
+ if (!S(t.inicio) || !S(t.fim)) return null;
227
+ const a = 2 * Math.PI;
228
+ let n = (t.fim - t.inicio) % a;
229
+ return n <= 0 && (n += a), n;
230
+ }
231
+ function oe(t, a, n) {
232
+ if (!(S(t) && S(a) && t > 0 && a > 0)) return null;
233
+ const o = n ? ne(n) : 2 * Math.PI;
234
+ if (o === null) return null;
235
+ if (!n || o >= 2 * Math.PI - 1e-12) {
236
+ const c = t * bt, u = a * bt, f = [
237
+ { ponto: [t, 0], entrada: [t, -u], saida: [t, u] },
238
+ { ponto: [0, a], entrada: [c, a], saida: [-c, a] },
239
+ { ponto: [-t, 0], entrada: [-t, u], saida: [-t, -u] },
240
+ { ponto: [0, -a], entrada: [-c, -a], saida: [c, -a] }
241
+ ];
242
+ return { tipo: "Polygon", aneis: [At(f, !0)], curva: f };
243
+ }
244
+ const e = n.fechamento ?? "aberto", r = Math.max(e === "corda" ? 2 : 1, Math.ceil(o / (Math.PI / 2) - 1e-9)), i = ae(t, a, n.inicio, o, r);
245
+ if (e === "aberto") return { tipo: "LineString", coordenadas: At(i, !1), curva: i };
246
+ const s = e === "fatia" ? [...i, { ponto: [0, 0] }] : i;
247
+ return { tipo: "Polygon", aneis: [At(s, !0)], curva: s };
248
+ }
249
+ function ee(t, a) {
250
+ if (!(S(t) && t > 0 && S(a))) return null;
251
+ const n = $o([0, 0], [0, -t], Math.round(a), A);
252
+ return n ? { tipo: "Polygon", aneis: [n] } : null;
253
+ }
254
+ function re(t, a, n) {
255
+ if (!(S(t) && S(a) && t > 0 && a > 0 && S(n))) return null;
256
+ const o = Io([0, 0], [0, -t], Math.round(n), A, Math.min(1, a / t));
257
+ return o ? { tipo: "Polygon", aneis: [o] } : null;
258
+ }
259
+ function ie(t) {
260
+ if (!(S(t.tamanho) && t.tamanho > 0)) return null;
261
+ const a = String(t.texto ?? "").split(`
262
+ `), n = Dn(t.fonte), o = S(t.largura) && t.largura > 0 ? t.largura : a.reduce((i, s) => Math.max(i, Zo(s, n, t.tamanho)), 0), e = a.length * t.tamanho * Ho;
263
+ return { x: t.alinhamento === "centro" ? -o / 2 : t.alinhamento === "direita" ? -o : 0, y: -t.tamanho * Uo, largura: o, altura: e };
264
+ }
265
+ function Ft(t) {
266
+ var a, n, o, e;
267
+ switch (t.tipo) {
268
+ case "retangulo":
269
+ return Qo(t.largura, t.altura, t.raios);
270
+ case "elipse":
271
+ return oe(t.rx, t.ry, t.arco);
272
+ case "poligono-regular":
273
+ return ee(t.raio, t.lados);
274
+ case "estrela":
275
+ return re(t.raioExterno, t.raioInterno, t.pontas);
276
+ case "linha":
277
+ return S((a = t.de) == null ? void 0 : a[0]) && S((n = t.de) == null ? void 0 : n[1]) && S((o = t.ate) == null ? void 0 : o[0]) && S((e = t.ate) == null ? void 0 : e[1]) ? { tipo: "LineString", coordenadas: [[t.de[0], t.de[1]], [t.ate[0], t.ate[1]]] } : null;
278
+ case "caminho":
279
+ return t.geometria && (t.geometria.tipo === "LineString" || t.geometria.tipo === "Polygon") ? t.geometria : null;
280
+ case "texto": {
281
+ const r = ie(t);
282
+ if (!r) return null;
283
+ const i = r.x + r.largura, s = r.y + r.altura;
284
+ return { tipo: "Polygon", aneis: [[[r.x, r.y], [i, r.y], [i, s], [r.x, s]]] };
285
+ }
286
+ default:
287
+ return null;
288
+ }
289
+ }
290
+ function L(t) {
291
+ return t.transformacao && wt(t.transformacao) ? t.transformacao : nt;
292
+ }
293
+ function se(t, a) {
294
+ const n = (e) => I(a, e);
295
+ if (t.tipo === "Polygon") {
296
+ const e = { tipo: "Polygon", aneis: t.aneis.map((r) => r.map(n)) };
297
+ return t.curva ? { ...e, curva: Wa(t.curva, n) } : e;
298
+ }
299
+ const o = t.partes && t.partes.length > 1 ? { tipo: "LineString", coordenadas: t.coordenadas.map(n), partes: t.partes.map((e) => e.map(n)) } : { tipo: "LineString", coordenadas: t.coordenadas.map(n) };
300
+ return t.curva ? { ...o, curva: Wa(t.curva, n) } : o;
301
+ }
302
+ const ea = new Kt(), ra = new Kt(), ia = new Kt(), sa = new Kt();
303
+ function ta(t) {
304
+ if (!t || typeof t != "object") return null;
305
+ if (ia.tem(t)) return ia.obter(t);
306
+ let a = null;
307
+ try {
308
+ a = Ft(t);
309
+ } catch {
310
+ a = null;
311
+ }
312
+ return ia.gravar(t, a), a;
313
+ }
314
+ function D(t) {
315
+ if (!t || typeof t != "object") return null;
316
+ if (ea.tem(t)) return ea.obter(t);
317
+ let a = null;
318
+ try {
319
+ const n = ta(t.geometria);
320
+ a = n ? se(n, L(t)) : null;
321
+ } catch {
322
+ a = null;
323
+ }
324
+ return ea.gravar(t, a), a;
325
+ }
326
+ const Oa = ([[t, a], [n, o]]) => [t, a, n, o].every(S) ? { x: t, y: a, largura: n - t, altura: o - a } : null;
327
+ function Da(t) {
328
+ const a = t == null ? void 0 : t.geometria;
329
+ if (!a || typeof a != "object") return null;
330
+ if (sa.tem(a)) return sa.obter(a);
331
+ const n = ta(a), o = n ? Oa(Nn(n, A)) : null;
332
+ return sa.gravar(a, o), o;
333
+ }
334
+ function ce(t) {
335
+ const a = Da(t);
336
+ if (!a) return null;
337
+ const n = L(t), o = [[a.x, a.y], [a.x + a.largura, a.y], [a.x + a.largura, a.y + a.altura], [a.x, a.y + a.altura]].map((c) => I(n, c));
338
+ let e = 1 / 0, r = 1 / 0, i = -1 / 0, s = -1 / 0;
339
+ for (const [c, u] of o)
340
+ c < e && (e = c), c > i && (i = c), u < r && (r = u), u > s && (s = u);
341
+ return Oa([[e, r], [i, s]]);
342
+ }
343
+ function St(t) {
344
+ if (ra.tem(t)) return ra.obter(t);
345
+ const a = D(t), n = a ? Oa(Nn(a, A)) : null;
346
+ return t && typeof t == "object" && ra.gravar(t, n), n;
347
+ }
348
+ const ri = (t) => !!t && t.tipo === "Polygon", qt = "#000000", wa = 0.25, ue = 4, Ka = 25.4 / 96, T = (t) => typeof t == "number" && Number.isFinite(t), Mt = (t, a) => T(t) ? Math.min(1, Math.max(0, t)) : a;
349
+ function le(t, a, n = 1, o = "butt") {
350
+ const e = T(a) && a > 0 ? a / Ka : 1;
351
+ return So(ho(t, e, n, o)).map((r) => Math.round(r * Ka * 1e4) / 1e4);
352
+ }
353
+ const ya = {
354
+ normal: "source-over",
355
+ multiplicar: "multiply",
356
+ tela: "screen",
357
+ sobrepor: "overlay",
358
+ escurecer: "darken",
359
+ clarear: "lighten",
360
+ "subexposicao-cor": "color-dodge",
361
+ "superexposicao-cor": "color-burn",
362
+ "luz-dura": "hard-light",
363
+ "luz-suave": "soft-light",
364
+ diferenca: "difference",
365
+ exclusao: "exclusion",
366
+ matiz: "hue",
367
+ saturacao: "saturation",
368
+ cor: "color",
369
+ luminosidade: "luminosity"
370
+ }, kn = Object.keys(ya), ca = { deslocamento: [1.5, 1.5], desfoque: 1, opacidade: 0.5 };
371
+ function ka(t) {
372
+ if (!t || typeof t != "object") return null;
373
+ const a = Array.isArray(t.deslocamento) && T(t.deslocamento[0]) && T(t.deslocamento[1]) ? t.deslocamento : ca.deslocamento, n = (e) => Math.max(-1e3, Math.min(1e3, e)), o = {
374
+ dx: n(a[0]),
375
+ dy: n(a[1]),
376
+ desfoque: T(t.desfoque) && t.desfoque >= 0 ? Math.min(100, t.desfoque) : ca.desfoque,
377
+ cor: N(t.cor, qt),
378
+ opacidade: Mt(t.opacidade, ca.opacidade)
379
+ };
380
+ return o.opacidade > 0 ? o : null;
381
+ }
382
+ function fe(t) {
383
+ return t.filter((a) => a && T(a.posicao)).map((a) => ({ posicao: Math.min(1, Math.max(0, a.posicao)), cor: N(a.cor, qt), opacidade: Mt(a.opacidade, 1) })).sort((a, n) => a.posicao - n.posicao);
384
+ }
385
+ function de(t, a) {
386
+ if (!t || !Array.isArray(t.paradas)) return;
387
+ const n = fe(t.paradas);
388
+ if (n.length === 0) return;
389
+ const o = n.reduce((r, i) => Math.abs(i.posicao - 0.5) < Math.abs(r.posicao - 0.5) ? i : r, n[0]);
390
+ return {
391
+ def: t.tipo === "radial" ? { ...t, paradas: n } : { tipo: "linear", de: t.de, ate: t.ate, paradas: n },
392
+ corDegradacao: a ? N(a, o.cor) : o.cor,
393
+ opacidadeDegradacao: o.opacidade ?? 1
394
+ };
395
+ }
396
+ const he = (t) => {
397
+ const a = t.transformacao;
398
+ return a && T(a.a) && T(a.b) ? Math.atan2(a.b, a.a) : 0;
399
+ }, tn = /* @__PURE__ */ new WeakMap();
400
+ function rt(t) {
401
+ if (!t || typeof t != "object") return ba(t);
402
+ let a = tn.get(t);
403
+ return a || (a = ba(t), tn.set(t, a)), a;
404
+ }
405
+ function ba(t) {
406
+ var d, l, h;
407
+ const a = (t == null ? void 0 : t.aparencia) ?? {}, n = ((d = t == null ? void 0 : t.geometria) == null ? void 0 : d.tipo) === "texto", o = !n && ((l = ta(t == null ? void 0 : t.geometria)) == null ? void 0 : l.tipo) === "Polygon";
408
+ let e = null;
409
+ const r = a.traco;
410
+ if (r !== null && !(n && r === void 0)) {
411
+ const m = r ?? {}, g = T(m.espessura) && m.espessura > 0 ? m.espessura : m.espessura === 0 ? 0 : wa;
412
+ if (g > 0) {
413
+ const y = mo(m.terminacao) ?? "butt", p = zn(m.tipoLinha);
414
+ e = {
415
+ cor: N(m.cor, qt),
416
+ largura: g,
417
+ opacidade: Mt(m.opacidade, 1),
418
+ tracejado: p && p !== "continua" ? le(p, g, go(m.escalaTipoLinha), y) : [],
419
+ terminacao: y,
420
+ juncao: po(m.juncao) ?? "miter",
421
+ limitePonta: T(m.limitePonta) && m.limitePonta >= 1 ? m.limitePonta : ue,
422
+ alinhamento: o && (m.alinhamento === "dentro" || m.alinhamento === "fora") ? m.alinhamento : "centro"
423
+ }, !o && m.pontaInicio && (e.pontaInicio = m.pontaInicio), !o && m.pontaFim && (e.pontaFim = m.pontaFim);
424
+ }
425
+ }
426
+ let i = null;
427
+ const s = a.preenchimento === void 0 && n ? {} : a.preenchimento;
428
+ if (s && (o || n)) {
429
+ const m = (s.cor ?? "").trim().toLowerCase(), g = m === "none" || m === "transparent", y = n ? void 0 : de(s.gradiente, s.cor);
430
+ if (!g || y) {
431
+ const p = t.geometria.tipo === "caminho" && ((h = t.geometria.geometria) == null ? void 0 : h.tipo) === "Polygon" && t.geometria.geometria.aneis.length > 1;
432
+ i = {
433
+ cor: N(s.cor, (y == null ? void 0 : y.corDegradacao) ?? qt),
434
+ opacidade: Mt(s.opacidade, 1),
435
+ regra: s.regra ?? (p ? "evenodd" : "nonzero")
436
+ }, y && (i.gradiente = y);
437
+ }
438
+ }
439
+ let c = null;
440
+ const u = a.hachura;
441
+ u && o && !n && (c = {
442
+ angulo: (T(u.angulo) ? u.angulo : 45) * Math.PI / 180 + he(t),
443
+ espacamento: T(u.espacamento) && u.espacamento > 0 ? Math.max(0.1, u.espacamento) : 2,
444
+ cor: N(u.cor, (e == null ? void 0 : e.cor) ?? qt),
445
+ largura: T(u.espessura) && u.espessura > 0 ? u.espessura : 0.18,
446
+ opacidade: Mt(u.opacidade, 1),
447
+ cruzada: u.cruzada === !0
448
+ });
449
+ const f = typeof a.mesclagem == "string" && Object.prototype.hasOwnProperty.call(ya, a.mesclagem) ? a.mesclagem : "normal";
450
+ return {
451
+ traco: e,
452
+ preenchimento: i,
453
+ hachura: c,
454
+ opacidade: Mt(a.opacidade, 1),
455
+ mesclagem: f === "normal" ? null : ya[f],
456
+ sombra: ka(a.sombra)
457
+ };
458
+ }
459
+ function me(t, a) {
460
+ const n = T(a) ? Math.min(1, Math.max(0, a)) : 1;
461
+ if (n >= 1) return t;
462
+ const o = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(t.trim());
463
+ if (!o) return t;
464
+ let e = o[1];
465
+ e.length === 3 && (e = e.split("").map((u) => u + u).join(""));
466
+ const r = parseInt(e.slice(0, 2), 16), i = parseInt(e.slice(2, 4), 16), s = parseInt(e.slice(4, 6), 16), c = e.length === 8 ? parseInt(e.slice(6, 8), 16) / 255 : 1;
467
+ return `rgba(${r},${i},${s},${Math.round(c * n * 1e3) / 1e3})`;
468
+ }
469
+ const C = (t) => typeof t == "number" && Number.isFinite(t), O = (t) => C(t) && t > 0, U = (t) => Array.isArray(t) && t.length >= 2 && C(t[0]) && C(t[1]), K = (t) => [t[0], t[1]], pe = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), ge = ["triangulo", "triangulo-aberto", "aberta", "circulo", "quadrado", "losango", "barra"], an = 360, ye = 1e5, xt = (t) => C(t) ? Math.min(1, Math.max(0, t)) : void 0, nn = (t, a, n) => C(t) ? Math.min(n, Math.max(a, Math.round(t))) : null;
470
+ function ua(t, a) {
471
+ if (!Array.isArray(t) || t.length === 0) return null;
472
+ const n = [];
473
+ for (const o of t) {
474
+ if (!Array.isArray(o) || o.length < a || o.length > ye || !o.every(U)) return null;
475
+ n.push(o.map(K));
476
+ }
477
+ return n;
478
+ }
479
+ function be(t) {
480
+ var n;
481
+ if (!t || typeof t != "object") return null;
482
+ const a = t;
483
+ if (a.tipo === "Polygon") {
484
+ const o = ua(a.aneis, 3);
485
+ if (!o) return null;
486
+ const e = o.length === 1 ? Za(a.curva, 3) : null;
487
+ return e ? { tipo: "Polygon", aneis: o, curva: e } : { tipo: "Polygon", aneis: o };
488
+ }
489
+ if (a.tipo === "LineString") {
490
+ const o = (n = ua([a.coordenadas], 2)) == null ? void 0 : n[0];
491
+ if (!o) return null;
492
+ const e = Array.isArray(a.partes) && a.partes.length > 1 ? ua(a.partes, 2) : null, r = e ? null : Za(a.curva, 2);
493
+ return e ? { tipo: "LineString", coordenadas: e[0], partes: e } : r ? { tipo: "LineString", coordenadas: o, curva: r } : { tipo: "LineString", coordenadas: o };
494
+ }
495
+ return null;
496
+ }
497
+ function Me(t) {
498
+ if (!t || typeof t != "object") return null;
499
+ const a = t;
500
+ switch (a.tipo) {
501
+ case "retangulo": {
502
+ if (!O(a.largura) || !O(a.altura)) return null;
503
+ const n = Array.isArray(a.raios) && a.raios.length === 4 ? a.raios.map((o) => C(o) && o > 0 ? o : 0) : void 0;
504
+ return n && n.some((o) => o > 0) ? { tipo: "retangulo", largura: a.largura, altura: a.altura, raios: n } : { tipo: "retangulo", largura: a.largura, altura: a.altura };
505
+ }
506
+ case "elipse": {
507
+ if (!O(a.rx) || !O(a.ry)) return null;
508
+ const n = a.arco;
509
+ if (n && typeof n == "object") {
510
+ if (!C(n.inicio) || !C(n.fim) || n.inicio === n.fim) return null;
511
+ const o = n.fechamento === "corda" || n.fechamento === "fatia" ? n.fechamento : "aberto";
512
+ return { tipo: "elipse", rx: a.rx, ry: a.ry, arco: { inicio: n.inicio, fim: n.fim, fechamento: o } };
513
+ }
514
+ return { tipo: "elipse", rx: a.rx, ry: a.ry };
515
+ }
516
+ case "poligono-regular": {
517
+ const n = nn(a.lados, 3, an);
518
+ return O(a.raio) && n !== null ? { tipo: "poligono-regular", raio: a.raio, lados: n } : null;
519
+ }
520
+ case "estrela": {
521
+ const n = nn(a.pontas, 3, an);
522
+ return !O(a.raioExterno) || !O(a.raioInterno) || n === null ? null : { tipo: "estrela", raioExterno: a.raioExterno, raioInterno: Math.min(a.raioInterno, a.raioExterno), pontas: n };
523
+ }
524
+ case "linha":
525
+ return U(a.de) && U(a.ate) ? { tipo: "linha", de: K(a.de), ate: K(a.ate) } : null;
526
+ case "caminho": {
527
+ const n = be(a.geometria);
528
+ return n ? { tipo: "caminho", geometria: n } : null;
529
+ }
530
+ case "texto": {
531
+ if (!O(a.tamanho)) return null;
532
+ const o = { tipo: "texto", texto: typeof a.texto == "string" ? a.texto : a.texto === void 0 || a.texto === null ? "" : String(a.texto), tamanho: a.tamanho };
533
+ return typeof a.fonte == "string" && a.fonte.trim() && (o.fonte = a.fonte), O(a.largura) && (o.largura = a.largura), (a.alinhamento === "centro" || a.alinhamento === "direita" || a.alinhamento === "esquerda") && (o.alinhamento = a.alinhamento), o;
534
+ }
535
+ default:
536
+ return null;
537
+ }
538
+ }
539
+ function on(t) {
540
+ if (!t || typeof t != "object") return;
541
+ const a = t;
542
+ if (ge.includes(a.estilo))
543
+ return O(a.escala) ? { estilo: a.estilo, escala: Math.min(a.escala, 100) } : { estilo: a.estilo };
544
+ }
545
+ const Ot = (t) => typeof t == "string" && t.trim() && t.length <= 64 ? t.trim() : void 0, xe = 64;
546
+ function ve(t) {
547
+ if (!Array.isArray(t)) return null;
548
+ const a = [];
549
+ for (const n of t.slice(0, xe)) {
550
+ if (!n || typeof n != "object") continue;
551
+ const o = n, e = Ot(o.cor);
552
+ if (!e || !C(o.posicao)) continue;
553
+ const r = { posicao: Math.min(1, Math.max(0, o.posicao)), cor: e }, i = xt(o.opacidade);
554
+ i !== void 0 && (r.opacidade = i), a.push(r);
555
+ }
556
+ return a.sort((n, o) => n.posicao - o.posicao), a.length >= 1 ? a : null;
557
+ }
558
+ function Ae(t) {
559
+ if (!t || typeof t != "object") return;
560
+ const a = t, n = ve(a.paradas);
561
+ if (n) {
562
+ if (a.tipo === "linear" && U(a.de) && U(a.ate)) return { tipo: "linear", de: K(a.de), ate: K(a.ate), paradas: n };
563
+ if (a.tipo === "radial" && U(a.centro) && O(a.raio)) {
564
+ const o = { tipo: "radial", centro: K(a.centro), raio: Math.min(a.raio, 100), paradas: n };
565
+ return U(a.foco) && (o.foco = K(a.foco)), o;
566
+ }
567
+ }
568
+ }
569
+ function Pe(t) {
570
+ if (!t || typeof t != "object") return;
571
+ const a = t;
572
+ return Ht({
573
+ angulo: C(a.angulo) ? a.angulo : void 0,
574
+ espacamento: O(a.espacamento) ? Math.max(0.1, Math.min(a.espacamento, 1e3)) : void 0,
575
+ cor: Ot(a.cor),
576
+ espessura: C(a.espessura) && a.espessura >= 0 ? Math.min(a.espessura, 100) : void 0,
577
+ opacidade: xt(a.opacidade),
578
+ cruzada: a.cruzada === !0 ? !0 : void 0
579
+ });
580
+ }
581
+ function Ht(t) {
582
+ for (const a of Object.keys(t)) t[a] === void 0 && delete t[a];
583
+ return t;
584
+ }
585
+ function Ie(t) {
586
+ if (!t || typeof t != "object") return;
587
+ const a = t, n = {};
588
+ if (a.traco === null) n.traco = null;
589
+ else if (a.traco && typeof a.traco == "object") {
590
+ const e = a.traco, r = Ht({
591
+ cor: Ot(e.cor),
592
+ espessura: C(e.espessura) && e.espessura >= 0 ? Math.min(e.espessura, 1e3) : void 0,
593
+ opacidade: xt(e.opacidade),
594
+ tipoLinha: zn(e.tipoLinha),
595
+ escalaTipoLinha: O(e.escalaTipoLinha) ? e.escalaTipoLinha : void 0,
596
+ terminacao: e.terminacao === "arredondada" || e.terminacao === "reta" || e.terminacao === "quadrada" ? e.terminacao : void 0,
597
+ juncao: e.juncao === "arredondada" || e.juncao === "chanfrada" || e.juncao === "angular" ? e.juncao : void 0,
598
+ limitePonta: C(e.limitePonta) && e.limitePonta >= 1 ? Math.min(e.limitePonta, 100) : void 0,
599
+ alinhamento: e.alinhamento === "dentro" || e.alinhamento === "fora" || e.alinhamento === "centro" ? e.alinhamento : void 0,
600
+ pontaInicio: on(e.pontaInicio),
601
+ pontaFim: on(e.pontaFim)
602
+ });
603
+ n.traco = r;
604
+ }
605
+ if (a.preenchimento === null) n.preenchimento = null;
606
+ else if (a.preenchimento && typeof a.preenchimento == "object") {
607
+ const e = a.preenchimento, r = Ht({
608
+ cor: Ot(e.cor),
609
+ opacidade: xt(e.opacidade),
610
+ regra: e.regra === "evenodd" || e.regra === "nonzero" ? e.regra : void 0,
611
+ gradiente: Ae(e.gradiente)
612
+ });
613
+ n.preenchimento = r;
614
+ }
615
+ if (a.hachura === null) n.hachura = null;
616
+ else {
617
+ const e = Pe(a.hachura);
618
+ e && (n.hachura = e);
619
+ }
620
+ const o = xt(a.opacidade);
621
+ if (o !== void 0 && (n.opacidade = o), typeof a.mesclagem == "string" && kn.includes(a.mesclagem) && (n.mesclagem = a.mesclagem), a.sombra === null) n.sombra = null;
622
+ else if (a.sombra && typeof a.sombra == "object") {
623
+ const e = a.sombra;
624
+ n.sombra = Ht({
625
+ deslocamento: U(e.deslocamento) ? [Math.max(-1e3, Math.min(1e3, e.deslocamento[0])), Math.max(-1e3, Math.min(1e3, e.deslocamento[1]))] : void 0,
626
+ desfoque: C(e.desfoque) && e.desfoque >= 0 ? Math.min(e.desfoque, 100) : void 0,
627
+ cor: Ot(e.cor),
628
+ opacidade: xt(e.opacidade)
629
+ });
630
+ }
631
+ return n;
632
+ }
633
+ function $e(t) {
634
+ if (!t || typeof t != "object" || Array.isArray(t)) return;
635
+ const a = {};
636
+ for (const n of Object.keys(t)) pe.has(n) || (a[n] = t[n]);
637
+ return a;
638
+ }
639
+ function Rn(t) {
640
+ if (!t || typeof t != "object" || Array.isArray(t)) return "nao-objeto";
641
+ const a = t, n = typeof a.id == "string" ? a.id.trim() : typeof a.id == "number" && Number.isFinite(a.id) ? String(a.id) : "";
642
+ if (!n) return "id-invalido";
643
+ const o = Me(a.geometria);
644
+ if (!o) return "geometria-invalida";
645
+ const e = { id: n, geometria: o };
646
+ typeof a.nome == "string" && (e.nome = a.nome), a.transformacao !== void 0 && a.transformacao !== null && (e.transformacao = wt(a.transformacao) ? It(a.transformacao) : It(null)), U(a.pivo) && (e.pivo = K(a.pivo));
647
+ const r = Ie(a.aparencia);
648
+ r && (e.aparencia = r), a.bloqueado === !0 && (e.bloqueado = !0), a.oculto === !0 && (e.oculto = !0), typeof a.camadaId == "string" && a.camadaId && (e.camadaId = a.camadaId), typeof a.grupoId == "string" && a.grupoId && (e.grupoId = a.grupoId), C(a.ordem) && (e.ordem = a.ordem), a.mascara === !0 && (e.mascara = !0), typeof a.recorteId == "string" && a.recorteId && (e.recorteId = a.recorteId);
649
+ const i = $e(a.propriedades);
650
+ return i && (e.propriedades = i), e;
651
+ }
652
+ function Se(t) {
653
+ const a = Rn(t);
654
+ return typeof a == "string" ? null : a;
655
+ }
656
+ function ii(t) {
657
+ const a = { elementos: [], recusados: [] };
658
+ if (!Array.isArray(t)) return a;
659
+ const n = /* @__PURE__ */ new Set();
660
+ return t.forEach((o, e) => {
661
+ const r = Rn(o);
662
+ if (typeof r == "string") {
663
+ const i = o && typeof o == "object" && typeof o.id == "string" ? o.id : void 0;
664
+ a.recusados.push({ indice: e, id: i, motivo: r });
665
+ return;
666
+ }
667
+ if (n.has(r.id)) {
668
+ a.recusados.push({ indice: e, id: r.id, motivo: "id-duplicado" });
669
+ return;
670
+ }
671
+ n.add(r.id), a.elementos.push(r);
672
+ }), a;
673
+ }
674
+ const E = (t) => typeof t == "number" && Number.isFinite(t);
675
+ function ht(t, a) {
676
+ const n = { ...a, id: t.id };
677
+ return t.nome !== void 0 && (n.nome = t.nome), t.aparencia !== void 0 && (n.aparencia = t.aparencia), t.camadaId !== void 0 && (n.camadaId = t.camadaId), t.grupoId !== void 0 && (n.grupoId = t.grupoId), t.propriedades !== void 0 && (n.propriedades = t.propriedades), n;
678
+ }
679
+ function Ra(t) {
680
+ if (!t || ![t.x, t.y, t.largura, t.altura].every(E)) return null;
681
+ const a = t.largura < 0 ? t.x + t.largura : t.x, n = t.altura < 0 ? t.y + t.altura : t.y;
682
+ return { x: a, y: n, largura: Math.abs(t.largura), altura: Math.abs(t.altura) };
683
+ }
684
+ const si = (t, a) => ({
685
+ x: Math.min(t[0], a[0]),
686
+ y: Math.min(t[1], a[1]),
687
+ largura: Math.abs(a[0] - t[0]),
688
+ altura: Math.abs(a[1] - t[1])
689
+ }), Fn = (t) => [t.x + t.largura / 2, t.y + t.altura / 2];
690
+ function Bt(t, a, n) {
691
+ const o = Ra(a);
692
+ if (!o || o.largura <= 0 || o.altura <= 0) return null;
693
+ const e = typeof n == "number" ? [n, n, n, n] : n, r = e && e.some((c) => E(c) && c > 0) ? { tipo: "retangulo", largura: o.largura, altura: o.altura, raios: e.map((c) => E(c) && c > 0 ? c : 0) } : { tipo: "retangulo", largura: o.largura, altura: o.altura }, [i, s] = Fn(o);
694
+ return ht(t, { geometria: r, transformacao: j(i, s) });
695
+ }
696
+ function en(t, a) {
697
+ const n = Ra(a);
698
+ if (!n || n.largura <= 0 || n.altura <= 0) return null;
699
+ const [o, e] = Fn(n);
700
+ return ht(t, { geometria: { tipo: "elipse", rx: n.largura / 2, ry: n.altura / 2 }, transformacao: j(o, e) });
701
+ }
702
+ function ci(t, a, n, o = 6) {
703
+ return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(n) || n <= 0 || !E(o) || o < 3 ? null : ht(t, { geometria: { tipo: "poligono-regular", raio: n, lados: Math.min(360, Math.round(o)) }, transformacao: j(a[0], a[1]) });
704
+ }
705
+ function ui(t, a, n, o, e = 5) {
706
+ return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(n) || !E(o) || n <= 0 || o <= 0 || !E(e) || e < 3 ? null : ht(t, {
707
+ geometria: { tipo: "estrela", raioExterno: n, raioInterno: Math.min(o, n), pontas: Math.min(360, Math.round(e)) },
708
+ transformacao: j(a[0], a[1])
25
709
  });
26
710
  }
27
- function X(o, a = {}) {
28
- const r = Array.isArray(o) ? o.filter((c) => c && typeof c == "object") : [], m = E(a.minimo) && a.minimo > 0 ? a.minimo : 0, t = L(r);
29
- if (!t) return { elementos: [...r], caixa: { x: 0, y: 0, largura: m, altura: m } };
30
- const s = Math.max(t.largura, m), i = Math.max(t.altura, m), p = (s - t.largura) / 2 - t.x, A = (i - t.altura) / 2 - t.y, b = N(p, A);
31
- return { elementos: r.map((c) => D(c, b)), caixa: { x: 0, y: 0, largura: s, altura: i } };
711
+ function Lt(t, a, n) {
712
+ if (![a == null ? void 0 : a[0], a == null ? void 0 : a[1], n == null ? void 0 : n[0], n == null ? void 0 : n[1]].every(E)) return null;
713
+ const o = (a[0] + n[0]) / 2, e = (a[1] + n[1]) / 2;
714
+ return ht(t, {
715
+ geometria: { tipo: "linha", de: [a[0] - o, a[1] - e], ate: [n[0] - o, n[1] - e] },
716
+ transformacao: j(o, e)
717
+ });
32
718
  }
33
- function V(o, a, r) {
34
- return !S(a) || !S(r) || !E(o == null ? void 0 : o[0]) || !E(o == null ? void 0 : o[1]) ? null : y({ a: r.largura / a.largura, b: 0, c: 0, d: r.altura / a.altura, e: r.x - a.x * r.largura / a.largura, f: r.y - a.y * r.altura / a.altura }, o);
719
+ function li(t, a) {
720
+ return !a || a.tipo !== "LineString" && a.tipo !== "Polygon" ? null : ht(t, { geometria: { tipo: "caminho", geometria: a } });
35
721
  }
36
- const H = Object.freeze(
37
- Object.fromEntries(M.map((o) => [R[o], o]))
38
- ), x = (o) => typeof o == "number" && Number.isFinite(o), T = (o) => x(o) ? Math.min(1, Math.max(0, o)) : null, P = (o) => {
722
+ function fi(t, a, n, o) {
723
+ return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(o) || o <= 0 ? null : ht(t, { geometria: { tipo: "texto", texto: typeof n == "string" ? n : String(n ?? ""), tamanho: o }, transformacao: j(a[0], a[1]) });
724
+ }
725
+ const Ee = ["no", "n", "ne", "e", "se", "s", "so", "o"], la = 1e-4, z = (t) => typeof t == "number" && Number.isFinite(t);
726
+ function Fa(t) {
727
+ const a = Da(t);
728
+ return a ? { quadro: L(t), min: [a.x, a.y], max: [a.x + a.largura, a.y + a.altura] } : null;
729
+ }
730
+ function je(t) {
731
+ if (t.length === 1) return Fa(t[0]);
732
+ let a = 1 / 0, n = 1 / 0, o = -1 / 0, e = -1 / 0;
733
+ for (const r of t) {
734
+ const i = St(r);
735
+ i && (a = Math.min(a, i.x), n = Math.min(n, i.y), o = Math.max(o, i.x + i.largura), e = Math.max(e, i.y + i.altura));
736
+ }
737
+ return a <= o && n <= e ? { quadro: nt, min: [a, n], max: [o, e] } : null;
738
+ }
739
+ function F(t, a) {
740
+ const n = (t.min[0] + t.max[0]) / 2, o = (t.min[1] + t.max[1]) / 2;
741
+ switch (a) {
742
+ case "no":
743
+ return [t.min[0], t.min[1]];
744
+ case "n":
745
+ return [n, t.min[1]];
746
+ case "ne":
747
+ return [t.max[0], t.min[1]];
748
+ case "e":
749
+ return [t.max[0], o];
750
+ case "se":
751
+ return [t.max[0], t.max[1]];
752
+ case "s":
753
+ return [n, t.max[1]];
754
+ case "so":
755
+ return [t.min[0], t.max[1]];
756
+ case "o":
757
+ return [t.min[0], o];
758
+ default:
759
+ return [n, o];
760
+ }
761
+ }
762
+ const Ma = { no: "se", n: "s", ne: "so", e: "o", se: "no", s: "n", so: "ne", o: "e" };
763
+ function di(t, a = 6) {
764
+ const n = (f) => I(t.quadro, f), o = Object.fromEntries(Ee.map((f) => [f, n(F(t, f))])), e = n(F(t, "centro")), r = o.n;
765
+ let i = r[0] - e[0], s = r[1] - e[1];
766
+ const c = Math.hypot(i, s);
767
+ c > 1e-9 ? (i /= c, s /= c) : (i = 0, s = -1);
768
+ const u = z(a) ? a : 6;
769
+ return { cantos: [o.no, o.ne, o.se, o.so], alcas: o, centro: e, rotacao: [r[0] + i * u, r[1] + s * u] };
770
+ }
771
+ function xa(t, a) {
772
+ const n = dt(t.quadro);
773
+ return n ? Ta(n, a, t.quadro) : null;
774
+ }
775
+ const rn = (t) => Math.abs(t) < la ? t < 0 ? -la : la : t;
776
+ function hi(t, a, n, o = {}) {
777
+ if (!t || !Ma[a] || !z(n == null ? void 0 : n[0]) || !z(n == null ? void 0 : n[1])) return null;
778
+ const e = dt(t.quadro);
779
+ if (!e) return null;
780
+ const r = I(e, n), i = F(t, a), s = F(t, o.doCentro ? "centro" : Ma[a]), c = a !== "n" && a !== "s", u = a !== "e" && a !== "o", f = i[0] - s[0], d = i[1] - s[1];
781
+ let l = c && Math.abs(f) > 1e-12 ? (r[0] - s[0]) / f : 1, h = u && Math.abs(d) > 1e-12 ? (r[1] - s[1]) / d : 1;
782
+ if (o.proporcional) {
783
+ const m = u ? c && Math.abs(l) >= Math.abs(h) ? l : h : l;
784
+ l = m, h = m;
785
+ }
786
+ return !z(l) || !z(h) ? null : xa(t, Qt(rn(l), rn(h), s));
787
+ }
788
+ function mi(t, a, n, o) {
789
+ if (![t == null ? void 0 : t[0], t == null ? void 0 : t[1], a == null ? void 0 : a[0], a == null ? void 0 : a[1], n == null ? void 0 : n[0], n == null ? void 0 : n[1]].every(z)) return { matriz: nt, angulo: 0 };
790
+ const r = a[0] - t[0], i = a[1] - t[1], s = n[0] - t[0], c = n[1] - t[1];
791
+ if (Math.hypot(r, i) < 1e-9 || Math.hypot(s, c) < 1e-9) return { matriz: nt, angulo: 0 };
792
+ let u = Math.atan2(r * c - i * s, r * s + i * c);
793
+ return z(o) && o > 0 && (u = Math.round(u / o) * o), { matriz: On(u, t), angulo: u };
794
+ }
795
+ function pi(t, a, n) {
796
+ if (!t || !["n", "s", "e", "o"].includes(a) || !z(n == null ? void 0 : n[0]) || !z(n == null ? void 0 : n[1])) return null;
797
+ const o = dt(t.quadro);
798
+ if (!o) return null;
799
+ const e = I(o, n), r = F(t, a), i = F(t, Ma[a]);
800
+ if (a === "n" || a === "s") {
801
+ const c = r[1] - i[1];
802
+ return Math.abs(c) < 1e-12 ? null : xa(t, Ja((e[0] - r[0]) / c, 0, i));
803
+ }
804
+ const s = r[0] - i[0];
805
+ return Math.abs(s) < 1e-12 ? null : xa(t, Ja(0, (e[1] - r[1]) / s, i));
806
+ }
807
+ function at(t, a) {
808
+ const n = L(t), o = ft(a, n);
809
+ return [o.a, o.b, o.c, o.d, o.e, o.f].every(z) ? { ...t, transformacao: o } : t;
810
+ }
811
+ const gi = (t, a, n) => z(a) && z(n) ? at(t, j(a, n)) : t;
812
+ function _a(t) {
813
+ const a = je(t);
814
+ return a ? I(a.quadro, F(a, "centro")) : null;
815
+ }
816
+ function yi(t) {
817
+ if (t.pivo && z(t.pivo[0]) && z(t.pivo[1])) return I(L(t), t.pivo);
818
+ const a = Fa(t);
819
+ return a ? I(a.quadro, F(a, "centro")) : null;
820
+ }
821
+ function _n(t, a) {
822
+ return t.map((n) => n.bloqueado ? n : at(n, a));
823
+ }
824
+ function bi(t, a, n) {
825
+ const o = n ?? _a(t);
826
+ return o ? _n(t, Bo(a, o)) : [...t];
827
+ }
828
+ function Mi(t, a, n) {
829
+ const o = n ?? _a(t);
830
+ return o && z(a) ? _n(t, On(a, o)) : [...t];
831
+ }
832
+ const Gn = (t) => typeof t == "number" && Number.isFinite(t);
833
+ function Et(t) {
834
+ const a = Array.isArray(t) ? t : [], n = /* @__PURE__ */ new Map();
835
+ a.forEach((e, r) => {
836
+ e && typeof e.id == "string" && !n.has(e.id) && n.set(e.id, { i: r, c: e });
837
+ });
838
+ const o = (e) => e && typeof e.camadaId == "string" ? n.get(e.camadaId) : void 0;
839
+ return {
840
+ indice: (e) => {
841
+ var r;
842
+ return ((r = o(e)) == null ? void 0 : r.i) ?? a.length;
843
+ },
844
+ visivel: (e) => {
845
+ var r;
846
+ return !!e && !e.oculto && ((r = o(e)) == null ? void 0 : r.c.visivel) !== !1;
847
+ },
848
+ travado: (e) => {
849
+ var r;
850
+ return !!e && (!!e.bloqueado || ((r = o(e)) == null ? void 0 : r.c.bloqueada) === !0);
851
+ },
852
+ opacidade: (e) => {
853
+ var i;
854
+ const r = (i = o(e)) == null ? void 0 : i.c.opacidade;
855
+ return Gn(r) ? Math.min(1, Math.max(0, r)) : 1;
856
+ }
857
+ };
858
+ }
859
+ function xi(t) {
860
+ if (!Array.isArray(t)) return [];
861
+ const a = /* @__PURE__ */ new Set(), n = [];
862
+ for (const o of t) {
863
+ if (!o || typeof o != "object") continue;
864
+ const e = o, r = typeof e.id == "string" ? e.id.trim() : "";
865
+ if (!r || a.has(r)) continue;
866
+ a.add(r);
867
+ const i = { id: r };
868
+ typeof e.nome == "string" && (i.nome = e.nome), e.visivel === !1 && (i.visivel = !1), e.bloqueada === !0 && (i.bloqueada = !0), Gn(e.opacidade) && (i.opacidade = Math.min(1, Math.max(0, e.opacidade))), n.push(i);
869
+ }
870
+ return n;
871
+ }
872
+ const vi = wa, V = (t) => typeof t == "number" && Number.isFinite(t);
873
+ function Le(t) {
874
+ const a = rt(t).preenchimento;
875
+ return !!a && (a.opacidade > 0 || !!a.gradiente);
876
+ }
877
+ function Ne(t) {
878
+ const a = rt(t).traco;
879
+ return a ? a.largura / 2 : 0;
880
+ }
881
+ function _t(t, a) {
882
+ const n = a && !Array.isArray(a) && typeof a.indice == "function" ? a : Et(a);
883
+ return t.map((o, e) => ({ el: o, c: o ? n.indice(o) : 0, chave: V(o == null ? void 0 : o.ordem) ? o.ordem : e, i: e })).sort((o, e) => o.c - e.c || o.chave - e.chave || o.i - e.i).map((o) => o.el);
884
+ }
885
+ function ze(t, a) {
886
+ let n = 1 / 0;
887
+ const o = a.tipo === "Polygon" ? a.aneis.map((e) => ({ pts: e, fechado: !0 })) : (a.partes && a.partes.length > 1 ? a.partes : [a.coordenadas]).map((e) => ({ pts: e, fechado: !1 }));
888
+ for (const { pts: e, fechado: r } of o) {
889
+ const i = e.length;
890
+ i === 1 && (n = Math.min(n, Math.hypot(t[0] - e[0][0], t[1] - e[0][1])));
891
+ for (let s = 1; s < i; s++) n = Math.min(n, pa(t[0], t[1], e[s - 1][0], e[s - 1][1], e[s][0], e[s][1]));
892
+ r && i > 2 && (n = Math.min(n, pa(t[0], t[1], e[i - 1][0], e[i - 1][1], e[0][0], e[0][1])));
893
+ }
894
+ return n;
895
+ }
896
+ const Ga = (t, a, n) => !!t && !t.mascara && n.visivel(t) && (a || !n.travado(t));
897
+ function Ce(t, a, n = 1) {
898
+ const o = St(t), e = D(t);
899
+ if (!o || !e) return null;
900
+ const r = (V(n) && n >= 0 ? n : 1) + Ne(t);
901
+ if (a[0] < o.x - r || a[0] > o.x + o.largura + r || a[1] < o.y - r || a[1] > o.y + o.altura + r) return null;
902
+ if (e.tipo === "Polygon" && (Le(t) || t.geometria.tipo === "texto") && Lo(a, e.aneis)) return 0;
903
+ const s = ze(a, e);
904
+ return s <= r ? s : null;
905
+ }
906
+ function Te(t, a, n = {}) {
907
+ if (!V(t == null ? void 0 : t[0]) || !V(t == null ? void 0 : t[1])) return [];
908
+ const o = n.incluirBloqueados === !0, e = Et(n.camadas), r = [], i = _t(a, e);
909
+ for (let s = i.length - 1; s >= 0; s--) {
910
+ const c = i[s];
911
+ if (!Ga(c, o, e)) continue;
912
+ const u = Ce(c, t, n.tolerancia);
913
+ u !== null && r.push({ elemento: c, distancia: u });
914
+ }
915
+ return r;
916
+ }
917
+ function Ai(t, a, n = {}) {
918
+ var o;
919
+ return ((o = Te(t, a, n)[0]) == null ? void 0 : o.elemento) ?? null;
920
+ }
921
+ function Xa(t) {
922
+ const a = D(t);
923
+ if (!a) return null;
924
+ const n = { id: t.id, camadaId: t.camadaId ?? "", geometria: a, propriedades: {} };
925
+ return t.oculto && (n.oculta = !0), t.bloqueado && (n.bloqueada = !0), n;
926
+ }
927
+ const qe = (t) => ({ x: t[0], y: t[1] });
928
+ function Pi(t, a, n, o = {}) {
929
+ if (!t || ![t.x, t.y, t.largura, t.altura].every(V)) return [];
930
+ const e = {
931
+ x1: Math.min(t.x, t.x + t.largura),
932
+ y1: Math.min(t.y, t.y + t.altura),
933
+ x2: Math.max(t.x, t.x + t.largura),
934
+ y2: Math.max(t.y, t.y + t.altura)
935
+ }, r = o.incluirBloqueados === !0, i = Et(o.camadas);
936
+ return a.filter((s) => {
937
+ if (!Ga(s, r, i)) return !1;
938
+ const c = Xa(s);
939
+ return !!c && Eo(c, e, qe, n, A);
940
+ });
941
+ }
942
+ function Ii(t, a, n = {}) {
943
+ if (!Array.isArray(t) || t.length < 3) return [];
944
+ const o = n.incluirBloqueados === !0, e = Et(n.camadas), r = t.filter((i) => V(i == null ? void 0 : i[0]) && V(i == null ? void 0 : i[1])).map((i) => [i[0], i[1]]);
945
+ return a.filter((i) => {
946
+ if (!Ga(i, o, e)) return !1;
947
+ const s = Xa(i);
948
+ return !!s && jo(s, r);
949
+ });
950
+ }
951
+ function sn(t) {
952
+ const a = ce(t);
953
+ if (!a) return null;
954
+ const n = a.x + a.largura, o = a.y + a.altura;
955
+ return { id: t.id, camadaId: t.camadaId ?? "", geometria: { tipo: "Polygon", aneis: [[[a.x, a.y], [n, a.y], [n, o], [a.x, o]]] }, propriedades: {} };
956
+ }
957
+ class $i {
958
+ constructor() {
959
+ P(this, "indice", new yo(A));
960
+ P(this, "elementos", /* @__PURE__ */ new Map());
961
+ }
962
+ get tamanho() {
963
+ return this.elementos.size;
964
+ }
965
+ definir(a) {
966
+ this.elementos.clear();
967
+ const n = [];
968
+ for (const o of a) {
969
+ const e = o ? sn(o) : null;
970
+ e && (this.elementos.set(o.id, o), n.push(e));
971
+ }
972
+ this.indice.construir(n);
973
+ }
974
+ atualizar(a) {
975
+ const n = a ? sn(a) : null;
976
+ if (!n) {
977
+ a != null && a.id && this.remover(a.id);
978
+ return;
979
+ }
980
+ this.elementos.set(a.id, a), this.indice.atualizar(n);
981
+ }
982
+ /**
983
+ * Atualiza um lote (ex.: soltar uma seleção arrastada). Acima de 10% do índice remonta tudo de uma vez, que sai mais
984
+ * barato que milhares de atualizações incrementais (cada compactação remontaria a árvore).
985
+ */
986
+ atualizarVarios(a) {
987
+ if (a.length > Math.max(32, this.elementos.size * 0.1)) {
988
+ const n = new Map(this.elementos);
989
+ for (const o of a) o != null && o.id && n.set(o.id, o);
990
+ this.definir([...n.values()]);
991
+ return;
992
+ }
993
+ for (const n of a) this.atualizar(n);
994
+ }
995
+ remover(a) {
996
+ this.elementos.delete(a), this.indice.remover(a);
997
+ }
998
+ obter(a) {
999
+ return this.elementos.get(a);
1000
+ }
1001
+ /** Elementos cujo envelope (conservador) toca a caixa (mm): candidatos para o teste fino. */
1002
+ consultarCaixa(a, n = 0) {
1003
+ if (!a || ![a.x, a.y, a.largura, a.altura, n].every(V)) return [];
1004
+ const o = this.indice.consultar({
1005
+ minLat: Math.min(a.x, a.x + a.largura) - n,
1006
+ maxLat: Math.max(a.x, a.x + a.largura) + n,
1007
+ minLon: Math.min(a.y, a.y + a.altura) - n,
1008
+ maxLon: Math.max(a.y, a.y + a.altura) + n
1009
+ }), e = [];
1010
+ for (const r of new Set(o)) {
1011
+ const i = this.elementos.get(r);
1012
+ i && e.push(i);
1013
+ }
1014
+ return e;
1015
+ }
1016
+ /** Candidatos perto do ponto (mm), para o hit-test e o snap não percorrerem todos. */
1017
+ consultarPonto(a, n) {
1018
+ return this.consultarCaixa({ x: a[0], y: a[1], largura: 0, altura: 0 }, V(n) && n > 0 ? n : 0);
1019
+ }
1020
+ }
1021
+ const Oe = ["vertice", "canto", "centro", "meio", "guia", "aresta", "grade"], W = (t) => typeof t == "number" && Number.isFinite(t);
1022
+ function Si(t, a, n, o = {}, e = []) {
1023
+ if (!W(t == null ? void 0 : t[0]) || !W(t == null ? void 0 : t[1]) || !W(n) || n <= 0) return null;
1024
+ const r = W(o.toleranciaPx) && o.toleranciaPx >= 0 ? o.toleranciaPx : No, i = new Set(e), s = n, c = (p) => ({ x: p[0] * s, y: p[1] * s }), u = { x: t[0] * s, y: t[1] * s }, f = (p) => Math.hypot(p[0] * s - u.x, p[1] * s - u.y), d = a.filter((p) => p && !p.oculto && !i.has(p.id)), l = [];
1025
+ for (const p of d) {
1026
+ const M = Xa(p);
1027
+ M && l.push({ ...M, bloqueada: !1 });
1028
+ }
1029
+ const h = /* @__PURE__ */ new Map(), m = (p) => {
1030
+ const M = h.get(p.tipo);
1031
+ p.distanciaPx <= r && (!M || p.distanciaPx < M.distanciaPx) && h.set(p.tipo, p);
1032
+ }, g = (p) => {
1033
+ p && m({ tipo: p.tipo, coordenada: [p.coordenada[0], p.coordenada[1]], distanciaPx: p.distanciaPx, elementoId: p.feicaoId });
1034
+ };
1035
+ if (o.vertice !== !1 && g(oa(u, l, c, { toleranciaPx: r, vertice: !0, meio: !1, aresta: !1 })), o.meio !== !1 && g(oa(u, l, c, { toleranciaPx: r, vertice: !1, meio: !0, aresta: !1 })), o.aresta !== !1 && g(oa(u, l, c, { toleranciaPx: r, vertice: !1, meio: !1, aresta: !0 })), o.canto !== !1 || o.centro !== !1)
1036
+ for (const p of d) {
1037
+ const M = Fa(p);
1038
+ if (M) {
1039
+ if (o.canto !== !1)
1040
+ for (const b of ["no", "ne", "se", "so"]) {
1041
+ const x = I(M.quadro, F(M, b));
1042
+ m({ tipo: "canto", coordenada: x, distanciaPx: f(x), elementoId: p.id });
1043
+ }
1044
+ if (o.centro !== !1) {
1045
+ const b = I(M.quadro, F(M, "centro"));
1046
+ m({ tipo: "centro", coordenada: b, distanciaPx: f(b), elementoId: p.id });
1047
+ }
1048
+ }
1049
+ }
1050
+ for (const p of o.guias ?? []) {
1051
+ if (!p || !W(p.posicao)) continue;
1052
+ const M = p.orientacao === "horizontal" ? [t[0], p.posicao] : [p.posicao, t[1]];
1053
+ m({ tipo: "guia", coordenada: M, distanciaPx: f(M), guia: p });
1054
+ }
1055
+ const y = o.grade;
1056
+ if (y && W(y.espacamento) && y.espacamento > 0) {
1057
+ const p = y.origem && W(y.origem[0]) && W(y.origem[1]) ? y.origem : [0, 0], M = y.espacamento, b = [p[0] + Math.round((t[0] - p[0]) / M) * M, p[1] + Math.round((t[1] - p[1]) / M) * M];
1058
+ m({ tipo: "grade", coordenada: b, distanciaPx: f(b) });
1059
+ }
1060
+ for (const p of Oe) {
1061
+ const M = h.get(p);
1062
+ if (M) return M;
1063
+ }
1064
+ return null;
1065
+ }
1066
+ const Yt = (t) => typeof t == "number" && Number.isFinite(t), De = (t) => Array.isArray(t) && Yt(t[0]) && Yt(t[1]);
1067
+ function it(t) {
1068
+ return !t || t.bloqueado || !t.geometria || t.geometria.tipo === "texto" ? null : Ft(t.geometria);
1069
+ }
1070
+ function Ei(t) {
1071
+ if (!(t != null && t.geometria) || t.geometria.tipo === "texto") return null;
1072
+ if (t.geometria.tipo === "caminho") return t;
1073
+ const a = Ft(t.geometria);
1074
+ return a ? { ...t, geometria: { tipo: "caminho", geometria: a } } : null;
1075
+ }
1076
+ const jt = (t, a) => ({ ...t, geometria: { tipo: "caminho", geometria: a } });
1077
+ function Ba(t, a) {
1078
+ if (!De(a)) return null;
1079
+ const n = dt(L(t));
1080
+ return n ? I(n, a) : null;
1081
+ }
1082
+ function ji(t) {
1083
+ const a = it(t);
1084
+ if (!a) return [];
1085
+ const n = L(t);
1086
+ return lt(a, A).map((o) => I(n, o));
1087
+ }
1088
+ function Li(t) {
1089
+ const a = it(t);
1090
+ if (!a) return [];
1091
+ const n = L(t);
1092
+ return (Na(a) ?? []).map((o) => ({
1093
+ ...o.entrada ? { entrada: I(n, o.entrada) } : {},
1094
+ ...o.saida ? { saida: I(n, o.saida) } : {}
1095
+ }));
1096
+ }
1097
+ function Ni(t, a, n) {
1098
+ const o = it(t), e = o ? Ba(t, n) : null;
1099
+ if (!o || !e) return null;
1100
+ const r = lt(o, A).slice();
1101
+ return !Number.isInteger(a) || a < 0 || a >= r.length ? null : (r[a] = e, jt(t, Cn(o, r, A)));
1102
+ }
1103
+ function zi(t, a, n, o) {
1104
+ const e = it(t), r = L(t), i = dt(r);
1105
+ if (!e || !i || !Yt(n) || !Yt(o)) return null;
1106
+ const s = lt(e, A).slice(), c = a.filter((u) => Number.isInteger(u) && u >= 0 && u < s.length);
1107
+ if (c.length === 0) return null;
1108
+ for (const u of new Set(c)) {
1109
+ const f = I(r, s[u]);
1110
+ s[u] = I(i, [f[0] + n, f[1] + o]);
1111
+ }
1112
+ return jt(t, Cn(e, s, A));
1113
+ }
1114
+ function Ci(t, a, n) {
1115
+ const o = it(t), e = o ? Ba(t, n) : null;
1116
+ if (!o || !e) return null;
1117
+ const r = lt(o, A).length;
1118
+ return !Number.isInteger(a) || a < 0 || a >= r || o.tipo === "LineString" && a >= r - 1 ? null : jt(t, zo(o, a, e));
1119
+ }
1120
+ function Ti(t, a) {
1121
+ const n = it(t);
1122
+ if (!n || !Number.isInteger(a) || lt(n, A).length <= To(n)) return null;
1123
+ const o = qo(n, a);
1124
+ return o ? jt(t, o) : null;
1125
+ }
1126
+ function qi(t, a) {
1127
+ const n = it(t), o = n ? lt(n, A).length : 0;
1128
+ if (!n || !Number.isInteger(a) || a < 0 || a >= o) return null;
1129
+ const e = Co(n, a);
1130
+ return e === n ? null : jt(t, e);
1131
+ }
1132
+ function Oi(t, a, n, o, e = !0) {
1133
+ const r = it(t), i = r ? Ba(t, o) : null, s = r ? lt(r, A).length : 0;
1134
+ return !r || !i || n !== "entrada" && n !== "saida" || !Number.isInteger(a) || a < 0 || a >= s ? null : jt(t, Oo(r, a, n, i, e));
1135
+ }
1136
+ const we = [
1137
+ "retangulo",
1138
+ "retangulo-arredondado",
1139
+ "moldura-dupla",
1140
+ "elipse",
1141
+ "circulo",
1142
+ "triangulo",
1143
+ "losango",
1144
+ "linha-horizontal",
1145
+ "linha-vertical",
1146
+ "linha-diagonal",
1147
+ "seta",
1148
+ "seta-dupla"
1149
+ ], Xn = ["continuo", "tracejado", "pontilhado", "traco-ponto"], Ua = Object.freeze({
1150
+ continuo: "continua",
1151
+ tracejado: "tracejada",
1152
+ pontilhado: "pontilhada",
1153
+ "traco-ponto": "traco-ponto"
1154
+ });
1155
+ function ke(t) {
1156
+ return typeof t == "string" && we.includes(t);
1157
+ }
1158
+ const Re = Object.freeze({
1159
+ retangulo: "Retângulo",
1160
+ "retangulo-arredondado": "Retângulo arredondado",
1161
+ "moldura-dupla": "Moldura dupla (ABNT)",
1162
+ elipse: "Elipse",
1163
+ circulo: "Círculo",
1164
+ triangulo: "Triângulo",
1165
+ losango: "Losango",
1166
+ "linha-horizontal": "Linha horizontal",
1167
+ "linha-vertical": "Linha vertical",
1168
+ "linha-diagonal": "Linha diagonal",
1169
+ seta: "Seta",
1170
+ "seta-dupla": "Seta dupla"
1171
+ }), Fe = {
1172
+ retangulo: "molduras",
1173
+ "moldura-dupla": "molduras",
1174
+ "retangulo-arredondado": "formas",
1175
+ elipse: "formas",
1176
+ circulo: "formas",
1177
+ triangulo: "formas",
1178
+ losango: "formas",
1179
+ "linha-horizontal": "linhas",
1180
+ "linha-vertical": "linhas",
1181
+ "linha-diagonal": "linhas",
1182
+ seta: "setas",
1183
+ "seta-dupla": "setas"
1184
+ }, Di = Object.freeze(
1185
+ ["retangulo", "moldura-dupla", "retangulo-arredondado", "elipse", "circulo", "triangulo", "losango", "linha-horizontal", "linha-vertical", "linha-diagonal", "seta", "seta-dupla"].map((t) => Object.freeze({ valor: t, rotulo: Re[t], grupo: Fe[t], usaQuadro: t === "retangulo" || t === "moldura-dupla" }))
1186
+ ), Gt = (t) => typeof t == "number" && Number.isFinite(t), zt = (t, a) => Gt(t) && t > 0 ? t : a, cn = (t) => Gt(t) ? Math.min(1, Math.max(0, t)) : void 0;
1187
+ function q(t, a, n = {}) {
1188
+ const o = cn(t.opacidadeTraco), e = cn(t.opacidadePreenchimento);
1189
+ return { traco: t.semTraco === !0 ? null : {
1190
+ cor: t.corTraco ?? "#000000",
1191
+ espessura: zt(t.espessura, 0.35),
1192
+ tipoLinha: Ua[t.estiloTraco ?? "continuo"] ?? "continua",
1193
+ ...o !== void 0 ? { opacidade: o } : {},
1194
+ ...a && (t.alinhamentoTraco === "dentro" || t.alinhamentoTraco === "fora") ? { alinhamento: t.alinhamentoTraco } : {},
1195
+ ...n
1196
+ }, preenchimento: a && t.corPreenchimento ? { cor: t.corPreenchimento, ...e !== void 0 ? { opacidade: e } : {} } : null };
1197
+ }
1198
+ function Nt(t, a, n) {
1199
+ const o = Gt(n) && n > 0 ? n : 0, e = Math.hypot(a[0] - t[0], a[1] - t[1]);
1200
+ if (o === 0 || !(e > 2 * o)) return [t, a];
1201
+ const r = (a[0] - t[0]) / e, i = (a[1] - t[1]) / e;
1202
+ return [[t[0] + r * o, t[1] + i * o], [a[0] - r * o, a[1] - i * o]];
1203
+ }
1204
+ function un(t, a, n, o, e) {
1205
+ const r = a.x + a.largura / 2, i = a.y + a.altura / 2, s = {
1206
+ id: t,
1207
+ geometria: { tipo: "caminho", geometria: { tipo: "Polygon", aneis: [n] } },
1208
+ transformacao: j(r, i),
1209
+ aparencia: o
1210
+ };
1211
+ return e && (s.camadaId = e), s;
1212
+ }
1213
+ function wi(t, a, n = {}) {
1214
+ const o = Ra(a);
1215
+ if (!o || !ke(t)) return [];
1216
+ const e = typeof n.id == "string" && n.id ? n.id : "predefinicao", r = { id: e, camadaId: n.camadaId }, i = o.largura, s = o.altura, c = (d) => d ? [d] : [], u = n.ponta ?? { estilo: "triangulo" }, f = i > 0 && s > 0;
1217
+ switch (t) {
1218
+ case "retangulo":
1219
+ return f ? c(Bt({ ...r, aparencia: q(n, !0) }, o)) : [];
1220
+ case "retangulo-arredondado":
1221
+ return f ? c(Bt({ ...r, aparencia: q(n, !0) }, o, zt(n.raio, Math.min(i, s) * 0.1))) : [];
1222
+ case "moldura-dupla": {
1223
+ if (!f) return [];
1224
+ const d = zt(n.espacamento, 1.5);
1225
+ if (2 * d >= Math.min(i, s)) return [];
1226
+ const l = `${e}-grupo`, h = n.preenchimentoNa === "externa", m = Bt({ ...r, grupoId: l, aparencia: q(n, h) }, o), g = Bt(
1227
+ { id: `${e}-2`, camadaId: n.camadaId, grupoId: l, aparencia: q({ ...n, espessura: zt(n.espessuraInterna, zt(n.espessura, 0.35) * 2) }, !h) },
1228
+ { x: o.x + d, y: o.y + d, largura: i - 2 * d, altura: s - 2 * d }
1229
+ );
1230
+ return m && g ? [m, g] : [];
1231
+ }
1232
+ case "elipse":
1233
+ return f ? c(en({ ...r, aparencia: q(n, !0) }, o)) : [];
1234
+ case "circulo": {
1235
+ if (!f) return [];
1236
+ const d = Math.min(i, s);
1237
+ return c(en({ ...r, aparencia: q(n, !0) }, { x: o.x + (i - d) / 2, y: o.y + (s - d) / 2, largura: d, altura: d }));
1238
+ }
1239
+ case "triangulo":
1240
+ return f ? [un(e, o, [[0, -s / 2], [i / 2, s / 2], [-i / 2, s / 2]], q(n, !0), n.camadaId)] : [];
1241
+ case "losango":
1242
+ return f ? [un(e, o, [[0, -s / 2], [i / 2, 0], [0, s / 2], [-i / 2, 0]], q(n, !0), n.camadaId)] : [];
1243
+ case "linha-horizontal": {
1244
+ const [d, l] = Nt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
1245
+ return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
1246
+ }
1247
+ case "linha-vertical": {
1248
+ const [d, l] = Nt([o.x + i / 2, o.y], [o.x + i / 2, o.y + s], n.recuo);
1249
+ return s > 0 ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
1250
+ }
1251
+ case "linha-diagonal": {
1252
+ const [d, l] = Nt([o.x, o.y], [o.x + i, o.y + s], n.recuo);
1253
+ return f ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
1254
+ }
1255
+ case "seta": {
1256
+ const [d, l] = Nt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
1257
+ return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1, { pontaFim: u }) }, d, l)) : [];
1258
+ }
1259
+ case "seta-dupla": {
1260
+ const [d, l] = Nt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
1261
+ return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1, { pontaInicio: u, pontaFim: u }) }, d, l)) : [];
1262
+ }
1263
+ }
1264
+ }
1265
+ const ki = ["A0", "A1", "A2", "A3", "A4"], _e = Object.freeze({
1266
+ A0: [841, 1189],
1267
+ A1: [594, 841],
1268
+ A2: [420, 594],
1269
+ A3: [297, 420],
1270
+ A4: [210, 297]
1271
+ });
1272
+ function Ge(t) {
1273
+ const a = t === "A0" || t === "A1" ? 10 : 7;
1274
+ return { esquerda: 25, direita: a, superior: a, inferior: a };
1275
+ }
1276
+ function Xe(t, a, n) {
1277
+ if (!n || ![t, a, n.esquerda, n.direita, n.superior, n.inferior].every(Gt) || [n.esquerda, n.direita, n.superior, n.inferior].some((r) => r < 0)) return null;
1278
+ const o = t - n.esquerda - n.direita, e = a - n.superior - n.inferior;
1279
+ return o > 0 && e > 0 ? { x: n.esquerda, y: n.superior, largura: o, altura: e } : null;
1280
+ }
1281
+ function Ri(t, a = "retrato", n = {}) {
1282
+ const o = _e[t];
1283
+ if (!o) return null;
1284
+ const [e, r] = a === "paisagem" ? [o[1], o[0]] : o, i = { ...Ge(t) };
1285
+ for (const s of ["esquerda", "direita", "superior", "inferior"]) Gt(n[s]) && n[s] >= 0 && (i[s] = n[s]);
1286
+ return Xe(e, r, i);
1287
+ }
1288
+ const ct = (t) => typeof t == "number" && Number.isFinite(t);
1289
+ function Be(t, a) {
1290
+ const n = ct(t) && t > 0 ? t : 0.25, o = ct(a) && a > 0 ? Math.min(100, Math.max(0.1, a)) : 1;
1291
+ return Math.max(2, 5 * n) * o;
1292
+ }
1293
+ const ln = 24;
1294
+ function Ue(t, a, n, o) {
1295
+ if (!t || !ct(a == null ? void 0 : a[0]) || !ct(a == null ? void 0 : a[1]) || !ct(n == null ? void 0 : n[0]) || !ct(n == null ? void 0 : n[1])) return null;
1296
+ const e = Math.hypot(n[0], n[1]);
1297
+ if (!(e > 1e-12)) return null;
1298
+ const r = [n[0] / e, n[1] / e], i = -r[1], s = r[0], c = Be(o, t.escala), u = 0.4 * c, f = (l, h) => [a[0] + r[0] * l + i * h, a[1] + r[1] * l + s * h];
1299
+ switch (t.estilo) {
1300
+ case "triangulo":
1301
+ return { pontos: [a, f(-c, u), f(-c, -u)], fechada: !0, preenchida: !0, recuo: c / 2 };
1302
+ case "triangulo-aberto":
1303
+ return { pontos: [a, f(-c, u), f(-c, -u)], fechada: !0, preenchida: !1, recuo: c };
1304
+ case "aberta":
1305
+ return { pontos: [f(-c, u), a, f(-c, -u)], fechada: !1, preenchida: !1, recuo: 0 };
1306
+ case "barra":
1307
+ return { pontos: [f(0, u), f(0, -u)], fechada: !1, preenchida: !1, recuo: 0 };
1308
+ case "quadrado": {
1309
+ const l = c / 3;
1310
+ return { pontos: [f(l, l), f(l, -l), f(-l, -l), f(-l, l)], fechada: !0, preenchida: !0, recuo: l };
1311
+ }
1312
+ case "losango":
1313
+ return { pontos: [f(c / 2, 0), f(0, u), f(-c / 2, 0), f(0, -u)], fechada: !0, preenchida: !0, recuo: c / 4 };
1314
+ case "circulo": {
1315
+ const l = c / 3, h = [];
1316
+ for (let m = 0; m < ln; m++) {
1317
+ const g = 2 * Math.PI * m / ln;
1318
+ h.push([a[0] + l * Math.cos(g), a[1] + l * Math.sin(g)]);
1319
+ }
1320
+ return { pontos: h, fechada: !0, preenchida: !0, recuo: l };
1321
+ }
1322
+ default:
1323
+ return null;
1324
+ }
1325
+ }
1326
+ function He(t, a) {
1327
+ const n = t.length;
1328
+ if (n < 2) return null;
1329
+ const o = a ? t[n - 1] : t[0];
1330
+ for (let e = 1; e < n; e++) {
1331
+ const r = a ? t[n - 1 - e] : t[e], i = o[0] - r[0], s = o[1] - r[1];
1332
+ if (Math.hypot(i, s) > 1e-9) return [i, s];
1333
+ }
1334
+ return null;
1335
+ }
1336
+ const fn = 4e3;
1337
+ function dn(t, a, n, o, e, r) {
1338
+ if (![t, a, n, o, e, r].every(ct) || r <= 0 || n < t || o < a) return [];
1339
+ const i = Math.cos(e), s = Math.sin(e), c = -s, u = i, f = [[t, a], [n, a], [n, o], [t, o]], d = f.map(([b, x]) => b * c + x * u), l = Math.min(...d), h = Math.max(...d);
1340
+ let m = r;
1341
+ (h - l) / m > fn && (m = (h - l) / fn);
1342
+ const g = f.map(([b, x]) => b * i + x * s), y = Math.min(...g) - m, p = Math.max(...g) + m, M = [];
1343
+ for (let b = Math.ceil(l / m); b * m <= h; b++) {
1344
+ const x = b * m;
1345
+ M.push([[c * x + i * y, u * x + s * y], [c * x + i * p, u * x + s * p]]);
1346
+ }
1347
+ return M;
1348
+ }
1349
+ const gt = (t) => typeof t == "number" && Number.isFinite(t);
1350
+ function Bn(t) {
1351
+ const a = bo(t), n = t.tipo === "Polygon";
1352
+ if (a) {
1353
+ const r = Mo(a, n).map((i) => i.cmd === "C" ? { c: "C", c1: i.pts[0], c2: i.pts[1], p: i.pts[2] } : { c: i.cmd, p: i.pts[0] });
1354
+ return n && r.push({ c: "Z" }), r;
1355
+ }
1356
+ const o = t.tipo === "Polygon" ? t.aneis : t.partes && t.partes.length > 1 ? t.partes : [t.coordenadas], e = [];
1357
+ for (const r of o)
1358
+ if (r.length !== 0) {
1359
+ e.push({ c: "M", p: r[0] });
1360
+ for (let i = 1; i < r.length; i++) e.push({ c: "L", p: r[i] });
1361
+ n && e.push({ c: "Z" });
1362
+ }
1363
+ return e;
1364
+ }
1365
+ const Un = (t) => t.length < 3 ? [] : [{ c: "M", p: t[0] }, ...t.slice(1).map((a) => ({ c: "L", p: a })), { c: "Z" }];
1366
+ function Ve(t, a) {
1367
+ if (a.alinhamento === "centro" || t.tipo !== "Polygon") return null;
1368
+ const n = a.alinhamento === "fora" ? a.largura / 2 : -a.largura / 2, o = Pt({ tipo: "Polygon", aneis: [t.aneis[0]] }, n, A);
1369
+ return o ? Un(o) : null;
1370
+ }
1371
+ function Ye(t, a, n) {
1372
+ if (!(n > 0) || t.length < 2) return;
1373
+ const o = a ? t.length - 1 : 0, e = a ? t[t.length - 2] : t[1], r = t[o];
1374
+ if (r.c === "Z" || e.c === "Z" || (a ? r.c !== "L" : e.c !== "L")) return;
1375
+ const i = r.p, s = e.p, c = Math.hypot(i[0] - s[0], i[1] - s[1]);
1376
+ if (c <= n * 1.01) return;
1377
+ const u = n / c;
1378
+ t[o] = { ...r, p: [i[0] + (s[0] - i[0]) * u, i[1] + (s[1] - i[1]) * u] };
1379
+ }
1380
+ function We(t) {
1381
+ const a = Da(t);
1382
+ if (!a || !(a.largura > 0) || !(a.altura > 0)) return null;
1383
+ const n = Ta(Qt(a.largura, a.altura), j(a.x, a.y), L(t));
1384
+ return Xo(n) ? null : n;
1385
+ }
1386
+ function Ze(t) {
1387
+ var s;
1388
+ if (!t || typeof t != "object" || t.oculto) return null;
1389
+ const a = D(t);
1390
+ if (!a) return null;
1391
+ const n = rt(t), o = { id: String(t.id), opacidade: n.opacidade, preenchimento: null, hachura: null, traco: null, pontas: [], texto: null }, e = t.geometria.tipo === "texto" ? t.geometria : null;
1392
+ if (e)
1393
+ return n.preenchimento && (o.texto = {
1394
+ linhas: String(e.texto ?? "").split(`
1395
+ `),
1396
+ tamanho: e.tamanho,
1397
+ fonte: Dn(e.fonte),
1398
+ alinhamento: e.alinhamento === "centro" ? "center" : e.alinhamento === "direita" ? "right" : "left",
1399
+ cor: n.preenchimento.cor,
1400
+ opacidade: n.preenchimento.opacidade,
1401
+ matriz: L(t),
1402
+ entrelinha: 1.2
1403
+ }), hn(o, n, a), o;
1404
+ const r = Bn(a);
1405
+ if (n.preenchimento && a.tipo === "Polygon") {
1406
+ const c = n.preenchimento;
1407
+ o.preenchimento = { caminho: r, regra: c.regra, cor: c.cor, opacidade: c.opacidade };
1408
+ const u = c.gradiente ? We(t) : null;
1409
+ c.gradiente && u && (o.preenchimento.gradiente = { def: c.gradiente.def, quadro: u, opacidadeDegradacao: c.gradiente.opacidadeDegradacao });
1410
+ }
1411
+ if (n.hachura && a.tipo === "Polygon") {
1412
+ const c = n.hachura, u = St(t);
1413
+ if (u) {
1414
+ const f = u.x + u.largura, d = u.y + u.altura, l = dn(u.x, u.y, f, d, c.angulo, c.espacamento);
1415
+ c.cruzada && l.push(...dn(u.x, u.y, f, d, c.angulo + Math.PI / 2, c.espacamento)), l.length > 0 && (o.hachura = { recorte: r, regra: ((s = n.preenchimento) == null ? void 0 : s.regra) ?? "nonzero", linhas: l, cor: c.cor, largura: c.largura, opacidade: c.opacidade });
1416
+ }
1417
+ }
1418
+ const i = n.traco;
1419
+ if (i) {
1420
+ const c = Ve(a, i) ?? r.slice();
1421
+ if (a.tipo === "LineString") {
1422
+ const u = a.partes && a.partes.length > 1 ? a.partes : [a.coordenadas], f = [[!1, i.pontaInicio], [!0, i.pontaFim]];
1423
+ for (const [d, l] of f) {
1424
+ if (!l) continue;
1425
+ const h = d ? u[u.length - 1] : u[0], m = He(h, d), g = m ? Ue(l, d ? h[h.length - 1] : h[0], m, i.largura) : null;
1426
+ if (!g) continue;
1427
+ u.length === 1 && Ye(c, d, g.recuo);
1428
+ const y = [{ c: "M", p: g.pontos[0] }, ...g.pontos.slice(1).map((p) => ({ c: "L", p }))];
1429
+ g.fechada && y.push({ c: "Z" }), o.pontas.push({ caminho: y, preenchida: g.preenchida, cor: i.cor, largura: i.largura, opacidade: i.opacidade });
1430
+ }
1431
+ }
1432
+ o.traco = {
1433
+ caminho: c,
1434
+ cor: i.cor,
1435
+ largura: i.largura,
1436
+ opacidade: i.opacidade,
1437
+ tracejado: i.tracejado,
1438
+ terminacao: i.terminacao,
1439
+ juncao: i.juncao,
1440
+ limitePonta: i.limitePonta
1441
+ };
1442
+ }
1443
+ return hn(o, n, a), o;
1444
+ }
1445
+ function Je(t, a, n) {
1446
+ const o = (s, c) => ({ caminho: s, modo: "encher", regra: c, largura: 0, tracejado: [], terminacao: "butt", juncao: "miter" }), e = [], r = t.preenchimento ?? (t.hachura ? { caminho: t.hachura.recorte, regra: t.hachura.regra } : null), i = t.traco;
1447
+ if (r && i && a && n.tipo === "Polygon" && n.aneis.length === 1 && a.alinhamento !== "dentro" && i.tracejado.length === 0) {
1448
+ const s = Pt({ tipo: "Polygon", aneis: [n.aneis[0]] }, a.alinhamento === "fora" ? a.largura : a.largura / 2, A);
1449
+ if (s) return [o(Un(s), "nonzero")];
1450
+ }
1451
+ r && e.push(o(r.caminho, r.regra)), i && e.push({ caminho: i.caminho, modo: "tracar", regra: "nonzero", largura: i.largura, tracejado: i.tracejado, terminacao: i.terminacao, juncao: i.juncao });
1452
+ for (const s of t.pontas)
1453
+ e.push(s.preenchida ? o(s.caminho, "nonzero") : { caminho: s.caminho, modo: "tracar", regra: "nonzero", largura: s.largura, tracejado: [], terminacao: "butt", juncao: "miter" });
1454
+ return e;
1455
+ }
1456
+ function hn(t, a, n) {
1457
+ a.mesclagem && (t.mesclagem = a.mesclagem);
1458
+ const o = a.sombra;
1459
+ if (!o) return;
1460
+ const e = t.texto ? [] : Je(t, a.traco, n);
1461
+ e.length === 0 && !t.texto || (t.sombra = { dx: o.dx, dy: o.dy, desfoque: o.desfoque, cor: o.cor, opacidade: o.opacidade, partes: e, texto: t.texto });
1462
+ }
1463
+ const fa = /* @__PURE__ */ new WeakMap();
1464
+ function Hn(t) {
1465
+ if (!t || typeof t != "object") return null;
1466
+ if (fa.has(t)) return fa.get(t);
1467
+ let a = null;
1468
+ try {
1469
+ a = Ze(t);
1470
+ } catch {
1471
+ a = null;
1472
+ }
1473
+ return fa.set(t, a), a;
1474
+ }
1475
+ function Vn(t, a) {
1476
+ if (!Array.isArray(t)) return [];
1477
+ const n = t.filter((i) => i && typeof i == "object"), o = Et(a), e = new Map(n.map((i) => [i.id, i])), r = [];
1478
+ for (const i of _t(n, o)) {
1479
+ if (i.mascara || !o.visivel(i)) continue;
1480
+ const s = Hn(i);
1481
+ if (!s) continue;
1482
+ let c = s;
1483
+ const u = o.opacidade(i);
1484
+ u < 1 && (c = { ...c, opacidade: c.opacidade * u });
1485
+ const f = i.recorteId ? e.get(i.recorteId) : void 0, d = f && f.mascara ? D(f) : null;
1486
+ d && d.tipo === "Polygon" && (c = { ...c, recorte: { caminho: Bn(d), regra: d.aneis.length > 1 ? "evenodd" : "nonzero" } }), r.push(c);
1487
+ }
1488
+ return r;
1489
+ }
1490
+ const w = (t) => t.every((a) => a.c === "Z" || gt(a.p[0]) && gt(a.p[1]) && (a.c !== "C" || gt(a.c1[0]) && gt(a.c1[1]) && gt(a.c2[0]) && gt(a.c2[1]))), Yn = 3, va = (t) => typeof t == "number" && Number.isFinite(t);
1491
+ function H(t, a, n, o = 0, e = 0, r = 0) {
1492
+ !va(a) || !va(n) || (t.x0 = Math.min(t.x0, a + e - o), t.y0 = Math.min(t.y0, n + r - o), t.x1 = Math.max(t.x1, a + e + o), t.y1 = Math.max(t.y1, n + r + o));
1493
+ }
1494
+ function Ct(t, a, n = 0, o = 0, e = 0) {
1495
+ for (const r of a)
1496
+ r.c !== "Z" && (H(t, r.p[0], r.p[1], n, o, e), r.c === "C" && (H(t, r.c1[0], r.c1[1], n, o, e), H(t, r.c2[0], r.c2[1], n, o, e)));
1497
+ }
1498
+ const Z = (t, a) => {
1499
+ const n = a[0] - t[0], o = a[1] - t[1], e = Math.hypot(n, o);
1500
+ return e > 1e-12 ? [n / e, o / e] : null;
1501
+ };
1502
+ function Qe(t) {
1503
+ const a = [], n = [];
1504
+ let o = [], e = [0, 0], r = [0, 0], i = !1;
1505
+ const s = (c) => {
1506
+ for (let u = 0; u + 1 < o.length; u++) a.push({ p: o[u].para, entrada: o[u].fim, saida: o[u + 1].ini });
1507
+ c && o.length > 1 ? a.push({ p: o[0].de, entrada: o[o.length - 1].fim, saida: o[0].ini }) : !c && o.length > 0 && n.push(o[0].de, o[o.length - 1].para), o = [];
1508
+ };
1509
+ for (const c of t) {
1510
+ if (c.c === "M") {
1511
+ i && s(!1), i = !0, e = c.p, r = c.p;
1512
+ continue;
1513
+ }
1514
+ if (i)
1515
+ if (c.c === "L") {
1516
+ const u = Z(e, c.p);
1517
+ o.push({ de: e, para: c.p, ini: u, fim: u }), e = c.p;
1518
+ } else if (c.c === "C")
1519
+ o.push({ de: e, para: c.p, ini: Z(e, c.c1) ?? Z(e, c.c2) ?? Z(e, c.p), fim: Z(c.c2, c.p) ?? Z(c.c1, c.p) ?? Z(e, c.p) }), e = c.p;
1520
+ else {
1521
+ const u = Z(e, r);
1522
+ u && o.push({ de: e, para: r, ini: u, fim: u }), s(!0), i = !1;
1523
+ }
1524
+ }
1525
+ return i && s(!1), { vertices: a, extremos: n };
1526
+ }
1527
+ function da(t, a, n, o, e, r, i = 0, s = 0, c = 0) {
1528
+ const u = n / 2;
1529
+ if (Ct(t, a, u + c, i, s), !(u > 0)) return;
1530
+ const { vertices: f, extremos: d } = Qe(a);
1531
+ if (o === "miter") {
1532
+ const l = e >= 1 ? e : 4;
1533
+ for (const h of f) {
1534
+ if (!h.entrada || !h.saida) continue;
1535
+ const m = Math.max(-1, Math.min(1, h.entrada[0] * h.saida[0] + h.entrada[1] * h.saida[1])), g = Math.sqrt((1 + m) / 2);
1536
+ if (!(g > 1e-9)) continue;
1537
+ const y = 1 / g;
1538
+ if (y > l) continue;
1539
+ const p = h.entrada[0] - h.saida[0], M = h.entrada[1] - h.saida[1], b = Math.hypot(p, M);
1540
+ b > 1e-12 && H(t, h.p[0] + p / b * u * y, h.p[1] + M / b * u * y, c, i, s);
1541
+ }
1542
+ }
1543
+ if (r === "square") for (const l of d) H(t, l[0], l[1], u * Math.SQRT2 + c, i, s);
1544
+ }
1545
+ function Ke(t, a, n) {
1546
+ a.preenchimento && Ct(t, a.preenchimento.caminho), a.hachura && Ct(t, a.hachura.recorte);
1547
+ const o = a.traco;
1548
+ o && da(t, o.caminho, o.largura, o.juncao, o.limitePonta, o.terminacao);
1549
+ for (const r of a.pontas)
1550
+ r.preenchida ? Ct(t, r.caminho) : da(t, r.caminho, r.largura, "miter", (o == null ? void 0 : o.limitePonta) ?? 4, "butt");
1551
+ const e = a.sombra;
1552
+ if (n && e) {
1553
+ const r = e.desfoque > 0 ? e.desfoque * Yn : 0;
1554
+ for (const i of e.partes)
1555
+ i.modo === "tracar" ? da(t, i.caminho, i.largura, i.juncao, 4, i.terminacao, e.dx, e.dy, r) : Ct(t, i.caminho, r, e.dx, e.dy);
1556
+ }
1557
+ }
1558
+ function tr(t, a = {}) {
1559
+ var i;
1560
+ const n = Array.isArray(t) ? t : t ? [t] : [], o = a.sombra !== !1, e = new Set((a.camadas ?? []).filter((s) => s && s.visivel === !1).map((s) => s.id)), r = { x0: 1 / 0, y0: 1 / 0, x1: -1 / 0, y1: -1 / 0 };
1561
+ for (const s of n) {
1562
+ const c = s;
1563
+ if (!(!c || typeof c != "object" || c.oculto || c.mascara) && !(c.camadaId !== void 0 && e.has(c.camadaId)))
1564
+ try {
1565
+ const u = Hn(c);
1566
+ if (!u) continue;
1567
+ if (Ke(r, u, o), ((i = c.geometria) == null ? void 0 : i.tipo) === "texto") {
1568
+ const f = St(c);
1569
+ if (f) {
1570
+ H(r, f.x, f.y), H(r, f.x + f.largura, f.y + f.altura);
1571
+ const d = u.sombra;
1572
+ if (o && d) {
1573
+ const l = d.desfoque > 0 ? d.desfoque * Yn : 0;
1574
+ H(r, f.x, f.y, l, d.dx, d.dy), H(r, f.x + f.largura, f.y + f.altura, l, d.dx, d.dy);
1575
+ }
1576
+ }
1577
+ }
1578
+ } catch {
1579
+ }
1580
+ }
1581
+ return !(r.x0 <= r.x1 && r.y0 <= r.y1) || ![r.x0, r.y0, r.x1, r.y1].every(va) ? null : { x: r.x0, y: r.y0, largura: r.x1 - r.x0, altura: r.y1 - r.y0 };
1582
+ }
1583
+ const $t = (t) => typeof t == "number" && Number.isFinite(t), Wt = (t) => !!t && [t.x, t.y, t.largura, t.altura].every($t) && t.largura > 0 && t.altura > 0;
1584
+ function Fi(t, a, n, o = {}) {
1585
+ const e = Array.isArray(t) ? t.filter((h) => h && typeof h == "object") : [];
1586
+ if (!Wt(a) || !Wt(n)) return [...e];
1587
+ let r = n.largura / a.largura, i = n.altura / a.altura, s = n.x, c = n.y;
1588
+ if (o.manterProporcao) {
1589
+ const h = Math.min(r, i);
1590
+ s += (n.largura - a.largura * h) / 2, c += (n.altura - a.altura * h) / 2, r = h, i = h;
1591
+ }
1592
+ if (!(r > 0 && i > 0) || !$t(r) || !$t(i)) return [...e];
1593
+ const u = (h) => [(h[0] - a.x) * r + s, (h[1] - a.y) * i + c], f = { a: r, b: 0, c: 0, d: i, e: s - a.x * r, f: c - a.y * i }, d = o.escalarTexto ?? "distorcer", l = Math.sqrt(r * i);
1594
+ return e.map((h) => {
1595
+ var m;
1596
+ if (h.bloqueado && o.incluirBloqueados === !1) return h;
1597
+ if (((m = h.geometria) == null ? void 0 : m.tipo) === "texto" && d !== "distorcer") {
1598
+ const g = _a([h]);
1599
+ if (!g) return h;
1600
+ const y = u(g), p = d === "tamanho" ? at(h, Qt(l, l, g)) : h;
1601
+ return at(p, j(y[0] - g[0], y[1] - g[1]));
1602
+ }
1603
+ return at(h, f);
1604
+ });
1605
+ }
1606
+ function _i(t, a = {}) {
1607
+ const n = Array.isArray(t) ? t.filter((f) => f && typeof f == "object") : [], o = $t(a.minimo) && a.minimo > 0 ? a.minimo : 0, e = tr(n);
1608
+ if (!e) return { elementos: [...n], caixa: { x: 0, y: 0, largura: o, altura: o } };
1609
+ const r = Math.max(e.largura, o), i = Math.max(e.altura, o), s = (r - e.largura) / 2 - e.x, c = (i - e.altura) / 2 - e.y, u = j(s, c);
1610
+ return { elementos: n.map((f) => at(f, u)), caixa: { x: 0, y: 0, largura: r, altura: i } };
1611
+ }
1612
+ function Gi(t, a, n) {
1613
+ return !Wt(a) || !Wt(n) || !$t(t == null ? void 0 : t[0]) || !$t(t == null ? void 0 : t[1]) ? null : I({ a: n.largura / a.largura, b: 0, c: 0, d: n.altura / a.altura, e: n.x - a.x * n.largura / a.largura, f: n.y - a.y * n.altura / a.altura }, t);
1614
+ }
1615
+ const ar = Object.freeze(
1616
+ Object.fromEntries(Xn.map((t) => [Ua[t], t]))
1617
+ ), Wn = (t) => typeof t == "number" && Number.isFinite(t), mn = (t) => Wn(t) ? Math.min(1, Math.max(0, t)) : null, kt = (t) => {
39
1618
  var a;
40
- return ((a = o.geometria) == null ? void 0 : a.tipo) === "texto";
41
- }, I = (o) => {
1619
+ return ((a = t.geometria) == null ? void 0 : a.tipo) === "texto";
1620
+ }, Zn = (t) => {
42
1621
  var a;
43
- return !P(o) && ((a = F(o.geometria)) == null ? void 0 : a.tipo) === "Polygon";
1622
+ return !kt(t) && ((a = ta(t.geometria)) == null ? void 0 : a.tipo) === "Polygon";
44
1623
  };
45
- function G(o) {
46
- for (const a of o) {
47
- if (a.mascara || P(a)) continue;
48
- const r = C(a).traco;
49
- if (r) return r.largura;
1624
+ function nr(t) {
1625
+ for (const a of t) {
1626
+ if (a.mascara || kt(a)) continue;
1627
+ const n = rt(a).traco;
1628
+ if (n) return n.largura;
50
1629
  }
51
1630
  return null;
52
1631
  }
53
- function q(o, a, r = {}) {
54
- const m = Array.isArray(o) ? o.filter((n) => n && typeof n == "object") : [];
55
- if (!a || typeof a != "object") return [...m];
56
- const t = x(a.espessura) && a.espessura > 0 ? a.espessura : null, s = r.espessura === "proporcional" && t !== null ? G(m) : null, i = s !== null && s > 0 && t !== null ? t / s : null, p = a.estiloTraco && M.includes(a.estiloTraco) ? a.estiloTraco : null, A = T(a.opacidadeTraco), b = T(a.opacidadePreenchimento), c = !!(a.corTraco || t !== null || p || A !== null), d = !!(a.corPreenchimento || b !== null);
57
- return m.map((n) => {
58
- if (n.mascara) return n;
59
- const e = P(n), l = { ...n.aparencia ?? {} };
60
- let f = !1;
61
- if (!e) {
1632
+ function Xi(t, a, n = {}) {
1633
+ const o = Array.isArray(t) ? t.filter((l) => l && typeof l == "object") : [];
1634
+ if (!a || typeof a != "object") return [...o];
1635
+ const e = Wn(a.espessura) && a.espessura > 0 ? a.espessura : null, r = n.espessura === "proporcional" && e !== null ? nr(o) : null, i = r !== null && r > 0 && e !== null ? e / r : null, s = a.estiloTraco && Xn.includes(a.estiloTraco) ? a.estiloTraco : null, c = mn(a.opacidadeTraco), u = mn(a.opacidadePreenchimento), f = !!(a.corTraco || e !== null || s || c !== null), d = !!(a.corPreenchimento || u !== null);
1636
+ return o.map((l) => {
1637
+ if (l.mascara) return l;
1638
+ const h = kt(l), m = { ...l.aparencia ?? {} };
1639
+ let g = !1;
1640
+ if (!h) {
62
1641
  if (a.semTraco)
63
- l.traco !== null && (l.traco = null, f = !0);
64
- else if (c) {
65
- const h = l.traco === null ? null : C(n).traco, u = l.traco ? { ...l.traco } : {};
66
- if (a.corTraco && (u.cor = a.corTraco), t !== null) {
67
- const O = h ? h.largura : null;
68
- u.espessura = i !== null && O !== null ? O * i : t;
69
- } else h || (u.espessura = z);
70
- p && (u.tipoLinha = R[p]), A !== null && (u.opacidade = A), l.traco = u, f = !0;
1642
+ m.traco !== null && (m.traco = null, g = !0);
1643
+ else if (f) {
1644
+ const y = m.traco === null ? null : rt(l).traco, p = m.traco ? { ...m.traco } : {};
1645
+ if (a.corTraco && (p.cor = a.corTraco), e !== null) {
1646
+ const M = y ? y.largura : null;
1647
+ p.espessura = i !== null && M !== null ? M * i : e;
1648
+ } else y || (p.espessura = wa);
1649
+ s && (p.tipoLinha = Ua[s]), c !== null && (p.opacidade = c), m.traco = p, g = !0;
71
1650
  }
72
1651
  }
73
1652
  if (a.semPreenchimento)
74
- !e && l.preenchimento !== null && (l.preenchimento = null, f = !0);
75
- else if (d && ((l.preenchimento !== null && l.preenchimento !== void 0 ? !0 : e && l.preenchimento === void 0) || !e && I(n) && a.corPreenchimento)) {
76
- const u = { ...l.preenchimento ?? {} };
77
- a.corPreenchimento && (u.cor = a.corPreenchimento, e || delete u.gradiente), b !== null && (u.opacidade = b), l.preenchimento = u, f = !0;
1653
+ !h && m.preenchimento !== null && (m.preenchimento = null, g = !0);
1654
+ else if (d && ((m.preenchimento !== null && m.preenchimento !== void 0 ? !0 : h && m.preenchimento === void 0) || !h && Zn(l) && a.corPreenchimento)) {
1655
+ const p = { ...m.preenchimento ?? {} };
1656
+ a.corPreenchimento && (p.cor = a.corPreenchimento, h || delete p.gradiente), u !== null && (p.opacidade = u), m.preenchimento = p, g = !0;
78
1657
  }
79
- return f ? { ...n, aparencia: l } : n;
1658
+ return g ? { ...l, aparencia: m } : l;
80
1659
  });
81
1660
  }
82
- const _ = (o, a) => Math.abs(o - a) < 1e-6;
83
- function Q(o) {
84
- var A, b;
85
- const a = (Array.isArray(o) ? o : []).filter((c) => c && typeof c == "object" && !c.mascara);
86
- let r = null, m = 0, t = 0, s = null, i = 0, p = 0;
87
- for (const c of a) {
88
- const d = C(c);
89
- if (!P(c) && (t++, d.traco)) {
90
- m++;
91
- const n = { cor: d.traco.cor, espessura: d.traco.largura, estilo: H[((b = (A = c.aparencia) == null ? void 0 : A.traco) == null ? void 0 : b.tipoLinha) ?? "continua"] ?? "continuo" };
92
- r === null ? r = n : r !== "misto" && (r.cor !== n.cor || !_(r.espessura, n.espessura) || r.estilo !== n.estilo) && (r = "misto");
93
- }
94
- if ((P(c) || I(c)) && (p++, d.preenchimento)) {
1661
+ const pn = (t, a) => Math.abs(t - a) < 1e-6;
1662
+ function Bi(t) {
1663
+ var c, u;
1664
+ const a = (Array.isArray(t) ? t : []).filter((f) => f && typeof f == "object" && !f.mascara);
1665
+ let n = null, o = 0, e = 0, r = null, i = 0, s = 0;
1666
+ for (const f of a) {
1667
+ const d = rt(f);
1668
+ if (!kt(f) && (e++, d.traco)) {
1669
+ o++;
1670
+ const l = { cor: d.traco.cor, espessura: d.traco.largura, estilo: ar[((u = (c = f.aparencia) == null ? void 0 : c.traco) == null ? void 0 : u.tipoLinha) ?? "continua"] ?? "continuo" };
1671
+ n === null ? n = l : n !== "misto" && (n.cor !== l.cor || !pn(n.espessura, l.espessura) || n.estilo !== l.estilo) && (n = "misto");
1672
+ }
1673
+ if ((kt(f) || Zn(f)) && (s++, d.preenchimento)) {
95
1674
  i++;
96
- const n = { cor: d.preenchimento.cor, opacidade: d.preenchimento.opacidade };
97
- s === null ? s = n : s !== "misto" && (s.cor !== n.cor || !_(s.opacidade, n.opacidade)) && (s = "misto");
1675
+ const l = { cor: d.preenchimento.cor, opacidade: d.preenchimento.opacidade };
1676
+ r === null ? r = l : r !== "misto" && (r.cor !== l.cor || !pn(r.opacidade, l.opacidade)) && (r = "misto");
1677
+ }
1678
+ }
1679
+ return o > 0 && o < e && (n = "misto"), i > 0 && i < s && (r = "misto"), { traco: n, preenchimento: r };
1680
+ }
1681
+ const gn = ["save", "restore", "beginPath", "moveTo", "lineTo", "bezierCurveTo", "closePath", "fill", "stroke", "clip", "setLineDash", "fillRect"], yn = ["fillStyle", "strokeStyle", "lineWidth", "lineCap", "lineJoin", "globalAlpha"], vt = (t, a) => {
1682
+ try {
1683
+ return typeof t[a] == "function";
1684
+ } catch {
1685
+ return !1;
1686
+ }
1687
+ };
1688
+ function Jn(t) {
1689
+ return !t || typeof t != "object" && typeof t != "function" ? "nenhuma" : vt(t, "setTransform") ? "absoluta" : vt(t, "transform") ? "relativa" : "nenhuma";
1690
+ }
1691
+ function Ui(t) {
1692
+ const a = !!t && (typeof t == "object" || typeof t == "function"), n = Jn(t), o = [], e = [], r = (i) => {
1693
+ try {
1694
+ return t[i] !== void 0;
1695
+ } catch {
1696
+ return !1;
1697
+ }
1698
+ };
1699
+ if (!a) return { obrigatorios: [...gn, ...yn, "setTransform"], opcionais: ["gradiente", "texto", "mesclagem", "filtro", "miterLimit"], transformacao: n };
1700
+ for (const i of gn) vt(t, i) || o.push(i);
1701
+ for (const i of yn) r(i) || o.push(i);
1702
+ return n === "nenhuma" && o.push("setTransform"), (!vt(t, "createLinearGradient") || !vt(t, "createRadialGradient")) && e.push("gradiente"), (!vt(t, "fillText") || !r("font") || !r("textAlign") || !r("textBaseline")) && e.push("texto"), r("globalCompositeOperation") || e.push("mesclagem"), r("filter") || e.push("filtro"), r("miterLimit") || e.push("miterLimit"), { obrigatorios: o, opcionais: e, transformacao: n };
1703
+ }
1704
+ function or(t) {
1705
+ let a = nt;
1706
+ const n = [], o = {
1707
+ save: () => {
1708
+ n.push(a), t.save();
1709
+ },
1710
+ restore: () => {
1711
+ a = n.pop() ?? a, t.restore();
1712
+ },
1713
+ setTransform: (e, r, i, s, c, u) => {
1714
+ const f = It({ a: e, b: r, c: i, d: s, e: c, f: u }), d = dt(a);
1715
+ if (!d) throw new Error("transform corrente singular: não dá para posicionar a matriz de forma relativa");
1716
+ const l = ft(d, f);
1717
+ t.transform(l.a, l.b, l.c, l.d, l.e, l.f), a = f;
1718
+ }
1719
+ };
1720
+ return new Proxy(t, {
1721
+ get(e, r) {
1722
+ if (typeof r == "string" && r in o) return o[r];
1723
+ const i = Reflect.get(e, r, e);
1724
+ return typeof i == "function" ? i.bind(e) : i;
1725
+ },
1726
+ set(e, r, i) {
1727
+ return Reflect.set(e, r, i, e);
1728
+ }
1729
+ });
1730
+ }
1731
+ let Aa = !1;
1732
+ function bn(t) {
1733
+ if (!Aa) {
1734
+ Aa = !0;
1735
+ try {
1736
+ typeof console < "u" && typeof console.warn == "function" && console.warn(`[ui-canvas-prancha] ${t}`);
1737
+ } catch {
1738
+ }
1739
+ }
1740
+ }
1741
+ function Hi() {
1742
+ Aa = !1;
1743
+ }
1744
+ const Pa = 24, er = 256, Zt = (t) => typeof t == "number" && Number.isFinite(t);
1745
+ function Mn(t) {
1746
+ const a = t.trim(), n = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(a);
1747
+ if (n) {
1748
+ let e = n[1];
1749
+ return e.length === 3 && (e = e.split("").map((r) => r + r).join("")), [parseInt(e.slice(0, 2), 16), parseInt(e.slice(2, 4), 16), parseInt(e.slice(4, 6), 16)];
1750
+ }
1751
+ const o = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(a);
1752
+ return o ? [Number(o[1]), Number(o[2]), Number(o[3])] : null;
1753
+ }
1754
+ function rr(t, a) {
1755
+ const n = t.filter((r) => r && Zt(r.posicao)).map((r) => ({ ...r, posicao: Math.min(1, Math.max(0, r.posicao)) })).sort((r, i) => r.posicao - i.posicao);
1756
+ if (n.length === 0) return { cor: "#000000", opacidade: 1 };
1757
+ const o = (r) => Zt(r.opacidade) ? Math.min(1, Math.max(0, r.opacidade)) : 1;
1758
+ if (a <= n[0].posicao) return { cor: n[0].cor, opacidade: o(n[0]) };
1759
+ const e = n[n.length - 1];
1760
+ if (a >= e.posicao) return { cor: e.cor, opacidade: o(e) };
1761
+ for (let r = 0; r + 1 < n.length; r++) {
1762
+ const i = n[r], s = n[r + 1];
1763
+ if (a < i.posicao || a > s.posicao) continue;
1764
+ const c = s.posicao > i.posicao ? (a - i.posicao) / (s.posicao - i.posicao) : 0, u = Mn(i.cor), f = Mn(s.cor), d = o(i) + (o(s) - o(i)) * c;
1765
+ if (!u || !f) return { cor: c < 0.5 ? i.cor : s.cor, opacidade: d };
1766
+ const l = (h) => Math.round(u[h] + (f[h] - u[h]) * c);
1767
+ return { cor: `rgb(${l(0)},${l(1)},${l(2)})`, opacidade: d };
1768
+ }
1769
+ return { cor: e.cor, opacidade: o(e) };
1770
+ }
1771
+ function ir(t, a = Pa) {
1772
+ if (!t || t.tipo !== "linear" || !Array.isArray(t.paradas) || t.paradas.length === 0) return null;
1773
+ const [n, o] = t.de ?? [NaN, NaN], [e, r] = t.ate ?? [NaN, NaN];
1774
+ if (![n, o, e, r].every(Zt)) return null;
1775
+ const i = e - n, s = r - o, c = Math.hypot(i, s);
1776
+ if (!(c > 1e-12)) return null;
1777
+ const u = Zt(a) ? Math.min(er, Math.max(2, Math.round(a))) : Pa, f = -s / c, d = i / c, l = 1e3, h = [];
1778
+ for (let m = 0; m < u; m++) {
1779
+ const g = m === 0 ? -l : m / u, y = m === u - 1 ? l : (m + 1) / u, { cor: p, opacidade: M } = rr(t.paradas, (m + 0.5) / u), b = [n + i * g, o + s * g], x = [n + i * y, o + s * y];
1780
+ h.push({
1781
+ pontos: [[b[0] + f * l, b[1] + d * l], [x[0] + f * l, x[1] + d * l], [x[0] - f * l, x[1] - d * l], [b[0] - f * l, b[1] - d * l]],
1782
+ cor: p,
1783
+ opacidade: M
1784
+ });
1785
+ }
1786
+ return h;
1787
+ }
1788
+ const tt = (t, a) => t.setTransform(a.a, a.b, a.c, a.d, a.e, a.f);
1789
+ function yt(t, a) {
1790
+ for (const n of a)
1791
+ n.c === "M" ? t.moveTo(n.p[0], n.p[1]) : n.c === "L" ? t.lineTo(n.p[0], n.p[1]) : n.c === "C" ? t.bezierCurveTo(n.c1[0], n.c1[1], n.c2[0], n.c2[1], n.p[0], n.p[1]) : t.closePath();
1792
+ }
1793
+ const Ia = (t, a) => a === "evenodd" ? t.fill("evenodd") : t.fill(), $a = (t, a) => a === "evenodd" ? t.clip("evenodd") : t.clip();
1794
+ function sr(t, a) {
1795
+ const n = a.gradiente;
1796
+ if (!n) return null;
1797
+ const o = n.def;
1798
+ let e = null;
1799
+ if (o.tipo === "linear" && typeof t.createLinearGradient == "function")
1800
+ e = t.createLinearGradient(o.de[0], o.de[1], o.ate[0], o.ate[1]);
1801
+ else if (o.tipo === "radial" && typeof t.createRadialGradient == "function") {
1802
+ const r = o.foco ?? o.centro;
1803
+ e = t.createRadialGradient(r[0], r[1], 0, o.centro[0], o.centro[1], o.raio);
1804
+ }
1805
+ if (!e) return null;
1806
+ for (const r of o.paradas) e.addColorStop(r.posicao, me(r.cor, r.opacidade ?? 1));
1807
+ return e;
1808
+ }
1809
+ const cr = (t) => Math.sqrt(Math.abs(t.a * t.d - t.b * t.c)) || 1;
1810
+ function Qn(t, a, n, o, e) {
1811
+ tt(t, ft(n, a.matriz)), t.font = `${a.tamanho}px ${a.fonte}`, t.textAlign = a.alinhamento, t.textBaseline = "alphabetic", t.fillStyle = o, t.globalAlpha = e, a.linhas.forEach((r, i) => t.fillText(r, 0, i * a.tamanho * a.entrelinha));
1812
+ }
1813
+ function ur(t, a, n, o, e) {
1814
+ const r = ft(n, j(a.dx, a.dy)), i = a.desfoque > 0 && typeof t.filter == "string";
1815
+ a.desfoque > 0 && !i && (e.degradacoes.desfoque = (e.degradacoes.desfoque ?? 0) + 1), t.save(), i && (t.filter = `blur(${a.desfoque * cr(n)}px)`), tt(t, r);
1816
+ for (const s of a.partes)
1817
+ w(s.caminho) && (t.beginPath(), yt(t, s.caminho), t.globalAlpha = a.opacidade * o, s.modo === "encher" ? (t.fillStyle = a.cor, Ia(t, s.regra)) : (t.strokeStyle = a.cor, t.lineWidth = s.largura, t.lineCap = s.terminacao, t.lineJoin = s.juncao, t.setLineDash(s.tracejado), t.stroke()));
1818
+ a.texto && typeof t.fillText == "function" && Qn(t, a.texto, r, a.cor, a.opacidade * o), i && (t.filter = "none"), t.restore(), e.sombras++;
1819
+ }
1820
+ function lr(t, a, n, o, e) {
1821
+ const r = a.gradiente, i = r ? ir(r.def, e) : null;
1822
+ if (!r || !i) return !1;
1823
+ t.save(), $a(t, a.regra), tt(t, ft(n, r.quadro));
1824
+ for (const s of i) {
1825
+ t.beginPath(), t.moveTo(s.pontos[0][0], s.pontos[0][1]);
1826
+ for (let c = 1; c < 4; c++) t.lineTo(s.pontos[c][0], s.pontos[c][1]);
1827
+ t.closePath(), t.fillStyle = s.cor, t.globalAlpha = a.opacidade * o * s.opacidade, t.fill();
1828
+ }
1829
+ return t.restore(), !0;
1830
+ }
1831
+ function fr(t, a, n, o, e = 0) {
1832
+ const r = a.opacidade;
1833
+ t.save(), tt(t, n), a.recorte && w(a.recorte.caminho) && (t.beginPath(), yt(t, a.recorte.caminho), $a(t, a.recorte.regra)), a.mesclagem && (typeof t.globalCompositeOperation == "string" ? t.globalCompositeOperation = a.mesclagem : o.degradacoes.mesclagem = (o.degradacoes.mesclagem ?? 0) + 1), a.sombra && (ur(t, a.sombra, n, r, o), tt(t, n));
1834
+ const i = a.preenchimento;
1835
+ if (i && w(i.caminho)) {
1836
+ t.beginPath(), yt(t, i.caminho);
1837
+ const f = i.gradiente ? sr(t, i) : null;
1838
+ f && i.gradiente ? (tt(t, ft(n, i.gradiente.quadro)), t.fillStyle = f, t.globalAlpha = i.opacidade * r, Ia(t, i.regra), tt(t, n), o.gradientes++) : i.gradiente && e > 0 && lr(t, i, n, a.opacidade, e) ? o.gradientesEmFaixas = (o.gradientesEmFaixas ?? 0) + 1 : (i.gradiente && o.degradacoes.gradiente++, t.fillStyle = i.cor, t.globalAlpha = i.opacidade * r * (i.gradiente ? i.gradiente.opacidadeDegradacao : 1), Ia(t, i.regra)), o.preenchimentos++;
1839
+ }
1840
+ const s = a.hachura;
1841
+ if (s && w(s.recorte)) {
1842
+ t.save(), t.beginPath(), yt(t, s.recorte), $a(t, s.regra), t.beginPath();
1843
+ for (const [f, d] of s.linhas)
1844
+ t.moveTo(f[0], f[1]), t.lineTo(d[0], d[1]);
1845
+ t.strokeStyle = s.cor, t.lineWidth = s.largura, t.lineCap = "butt", t.setLineDash([]), t.globalAlpha = s.opacidade * r, t.stroke(), t.restore(), o.hachuras++;
1846
+ }
1847
+ const c = a.traco;
1848
+ c && w(c.caminho) && (t.beginPath(), yt(t, c.caminho), t.strokeStyle = c.cor, t.lineWidth = c.largura, t.lineCap = c.terminacao, t.lineJoin = c.juncao, t.miterLimit = c.limitePonta, t.setLineDash(c.tracejado), t.globalAlpha = c.opacidade * r, t.stroke(), o.tracos++);
1849
+ for (const f of a.pontas)
1850
+ w(f.caminho) && (t.beginPath(), yt(t, f.caminho), t.globalAlpha = f.opacidade * r, f.preenchida ? (t.fillStyle = f.cor, t.fill()) : (t.strokeStyle = f.cor, t.lineWidth = f.largura, t.lineJoin = "miter", t.setLineDash([]), t.stroke()), o.pontas++);
1851
+ const u = a.texto;
1852
+ u && (typeof t.fillText == "function" ? (Qn(t, u, n, u.cor, u.opacidade * r), o.textos++) : o.degradacoes.texto++), t.restore();
1853
+ }
1854
+ const xn = /* @__PURE__ */ new WeakMap();
1855
+ function dr(t, a = {}) {
1856
+ if (!Array.isArray(t)) return Object.freeze([]);
1857
+ if (a.cache) {
1858
+ const o = xn.get(t);
1859
+ if (o && o.camadas === a.camadas) return o.plano;
1860
+ }
1861
+ let n;
1862
+ try {
1863
+ n = Object.freeze(Vn(t, a.camadas));
1864
+ } catch {
1865
+ n = Object.freeze([]);
1866
+ }
1867
+ return a.cache && xn.set(t, { camadas: a.camadas, plano: n }), n;
1868
+ }
1869
+ function vn(t, a) {
1870
+ t.falhas++, t.primeiraFalha === void 0 && (t.primeiraFalha = a);
1871
+ }
1872
+ function hr(t, a, n = {}) {
1873
+ const o = {
1874
+ itens: 0,
1875
+ preenchimentos: 0,
1876
+ gradientes: 0,
1877
+ hachuras: 0,
1878
+ tracos: 0,
1879
+ pontas: 0,
1880
+ textos: 0,
1881
+ sombras: 0,
1882
+ degradacoes: { gradiente: 0, texto: 0 },
1883
+ falhas: 0,
1884
+ transformacao: "nenhuma"
1885
+ };
1886
+ if (!t) return o;
1887
+ const e = Jn(t), r = n.transformacao === "relativa" && typeof t.transform == "function" ? "relativa" : n.transformacao === "absoluta" ? e === "absoluta" ? "absoluta" : "nenhuma" : e;
1888
+ o.transformacao = r;
1889
+ const i = Array.isArray(a) ? a : [], s = n.gradienteEmFaixas, c = s === !0 ? Pa : typeof s == "number" && Number.isFinite(s) && s >= 2 ? Math.min(256, Math.round(s)) : 0;
1890
+ if (r === "nenhuma")
1891
+ return o.falhas = Math.max(1, i.length), o.primeiraFalha = "o contexto não tem setTransform nem transform: nada foi pintado", bn(`${o.primeiraFalha}. Implemente setTransform (absoluto) ou transform; veja diagnosticarContexto().`), o;
1892
+ const u = r === "relativa" ? or(t) : t, f = n.matriz ? It(n.matriz) : nt, d = n.fundo;
1893
+ if (d && [d.largura, d.altura].every((l) => Number.isFinite(l) && l > 0))
1894
+ try {
1895
+ u.save(), tt(u, f), u.globalAlpha = 1, u.fillStyle = N(d.cor, "#ffffff"), u.fillRect(0, 0, d.largura, d.altura), u.restore();
1896
+ } catch (l) {
1897
+ vn(o, l instanceof Error ? l.message : String(l));
1898
+ try {
1899
+ u.restore();
1900
+ } catch {
1901
+ }
1902
+ }
1903
+ for (const l of i)
1904
+ try {
1905
+ fr(u, l, f, o, c), o.itens++;
1906
+ } catch (h) {
1907
+ vn(o, h instanceof Error ? h.message : String(h));
1908
+ try {
1909
+ u.restore();
1910
+ } catch {
1911
+ }
1912
+ }
1913
+ return o.falhas > 0 && bn(`${o.falhas} falha(s) ao pintar; primeira: ${o.primeiraFalha}`), o;
1914
+ }
1915
+ function Vi(t, a, n = {}) {
1916
+ return hr(t, dr(a, { camadas: n.camadas }), n);
1917
+ }
1918
+ const ha = (t) => typeof t == "number" && Number.isFinite(t);
1919
+ function mr(t) {
1920
+ const a = 10 ** t;
1921
+ return (n) => {
1922
+ const o = Math.round(n * a) / a;
1923
+ return Object.is(o, -0) || o === 0 ? "0" : String(o);
1924
+ };
1925
+ }
1926
+ const R = (t) => za(t);
1927
+ function Q(t, a) {
1928
+ let n = "";
1929
+ for (const o of t)
1930
+ o.c === "Z" ? n += "Z" : o.c === "C" ? n += `C${a(o.c1[0])} ${a(o.c1[1])} ${a(o.c2[0])} ${a(o.c2[1])} ${a(o.p[0])} ${a(o.p[1])}` : n += `${o.c}${a(o.p[0])} ${a(o.p[1])}`;
1931
+ return n;
1932
+ }
1933
+ const Kn = (t, a) => `matrix(${[t.a, t.b, t.c, t.d, t.e, t.f].map(a).join(" ")})`, B = (t, a, n) => a < 1 ? ` ${t}="${n(Math.max(0, a))}"` : "";
1934
+ function to(t, a, n, o) {
1935
+ const e = t.alinhamento === "center" ? "middle" : t.alinhamento === "right" ? "end" : "start", r = t.linhas.map((i, s) => `<tspan x="0" y="${o(s * t.tamanho * t.entrelinha)}">${za(i)}</tspan>`).join("");
1936
+ return `<text transform="${Kn(t.matriz, o)}" font-size="${o(t.tamanho)}" font-family="${R(t.fonte)}" text-anchor="${e}" fill="${R(N(a, "#000000"))}" xml:space="preserve"${B("fill-opacity", n, o)}>${r}</text>`;
1937
+ }
1938
+ function pr(t) {
1939
+ let a = 1 / 0, n = 1 / 0, o = -1 / 0, e = -1 / 0;
1940
+ for (const r of t) for (const i of r) {
1941
+ if (i.c === "Z") continue;
1942
+ const s = i.c === "C" ? [i.c1, i.c2, i.p] : [i.p];
1943
+ for (const [c, u] of s)
1944
+ c < a && (a = c), c > o && (o = c), u < n && (n = u), u > e && (e = u);
1945
+ }
1946
+ return Number.isFinite(a) ? [a, n, o, e] : null;
1947
+ }
1948
+ function gr(t, a, n, o) {
1949
+ const e = R(N(t.cor, "#000000")), r = t.partes.filter((c) => w(c.caminho)).map((c) => c.modo === "encher" ? `<path d="${Q(c.caminho, a)}" fill="${e}" fill-rule="${c.regra}" stroke="none"/>` : `<path d="${Q(c.caminho, a)}" fill="none" stroke="${e}" stroke-width="${a(c.largura)}" stroke-linecap="${c.terminacao}" stroke-linejoin="${c.juncao}"${c.tracejado.length > 0 ? ` stroke-dasharray="${c.tracejado.map(a).join(" ")}"` : ""}/>`);
1950
+ if (t.texto && r.push(to(t.texto, t.cor, 1, a)), r.length === 0) return "";
1951
+ let i = "";
1952
+ const s = pr(t.partes.map((c) => c.caminho));
1953
+ if (t.desfoque > 0) {
1954
+ const c = `pr-s${o.n++}`, u = t.desfoque * 3 + Math.max(0, ...t.partes.map((d) => d.largura)), f = s ? ` filterUnits="userSpaceOnUse" x="${a(s[0] - u)}" y="${a(s[1] - u)}" width="${a(s[2] - s[0] + 2 * u)}" height="${a(s[3] - s[1] + 2 * u)}"` : ' x="-50%" y="-50%" width="200%" height="200%"';
1955
+ n.push(`<filter id="${c}"${f}><feGaussianBlur stdDeviation="${a(t.desfoque)}"/></filter>`), i = ` filter="url(#${c})"`;
1956
+ }
1957
+ return `<g transform="translate(${a(t.dx)} ${a(t.dy)})"${B("opacity", t.opacidade, a)}><g${i}>${r.join("")}</g></g>`;
1958
+ }
1959
+ function yr(t, a, n, o) {
1960
+ const e = [];
1961
+ t.sombra && e.push(gr(t.sombra, a, n, o));
1962
+ const r = t.preenchimento;
1963
+ if (r && w(r.caminho)) {
1964
+ let d = R(N(r.cor, "#000000"));
1965
+ if (r.gradiente) {
1966
+ const l = `pr-g${o.n++}`, h = r.gradiente.def, m = h.paradas.map((y) => `<stop offset="${a(y.posicao)}" stop-color="${R(N(y.cor, "#000000"))}"${B("stop-opacity", y.opacidade ?? 1, a)}/>`).join(""), g = `id="${l}" gradientUnits="userSpaceOnUse" gradientTransform="${Kn(r.gradiente.quadro, a)}"`;
1967
+ n.push(h.tipo === "linear" ? `<linearGradient ${g} x1="${a(h.de[0])}" y1="${a(h.de[1])}" x2="${a(h.ate[0])}" y2="${a(h.ate[1])}">${m}</linearGradient>` : `<radialGradient ${g} cx="${a(h.centro[0])}" cy="${a(h.centro[1])}" r="${a(h.raio)}" fx="${a((h.foco ?? h.centro)[0])}" fy="${a((h.foco ?? h.centro)[1])}">${m}</radialGradient>`), d = `url(#${l})`;
1968
+ }
1969
+ e.push(`<path d="${Q(r.caminho, a)}" fill="${d}" fill-rule="${r.regra}" stroke="none"${B("fill-opacity", r.opacidade, a)}/>`);
1970
+ }
1971
+ const i = t.hachura;
1972
+ if (i && w(i.recorte)) {
1973
+ const d = `pr-c${o.n++}`;
1974
+ n.push(`<clipPath id="${d}"><path d="${Q(i.recorte, a)}" clip-rule="${i.regra}"/></clipPath>`);
1975
+ const l = i.linhas.map(([h, m]) => `M${a(h[0])} ${a(h[1])}L${a(m[0])} ${a(m[1])}`).join("");
1976
+ e.push(`<path d="${l}" clip-path="url(#${d})" fill="none" stroke="${R(N(i.cor, "#000000"))}" stroke-width="${a(i.largura)}" stroke-linecap="butt"${B("stroke-opacity", i.opacidade, a)}/>`);
1977
+ }
1978
+ const s = t.traco;
1979
+ if (s && w(s.caminho)) {
1980
+ const d = s.tracejado.length > 0 ? ` stroke-dasharray="${s.tracejado.map(a).join(" ")}"` : "";
1981
+ e.push(`<path d="${Q(s.caminho, a)}" fill="none" stroke="${R(N(s.cor, "#000000"))}" stroke-width="${a(s.largura)}" stroke-linecap="${s.terminacao}" stroke-linejoin="${s.juncao}" stroke-miterlimit="${a(s.limitePonta)}"${d}${B("stroke-opacity", s.opacidade, a)}/>`);
1982
+ }
1983
+ for (const d of t.pontas) {
1984
+ if (!w(d.caminho)) continue;
1985
+ const l = R(N(d.cor, "#000000"));
1986
+ e.push(d.preenchida ? `<path d="${Q(d.caminho, a)}" fill="${l}" stroke="none"${B("fill-opacity", d.opacidade, a)}/>` : `<path d="${Q(d.caminho, a)}" fill="none" stroke="${l}" stroke-width="${a(d.largura)}" stroke-linejoin="miter"${B("stroke-opacity", d.opacidade, a)}/>`);
1987
+ }
1988
+ const c = t.texto;
1989
+ if (c && e.push(to(c, c.cor, c.opacidade, a)), e.every((d) => d === "")) return "";
1990
+ let u = "";
1991
+ if (t.recorte && w(t.recorte.caminho)) {
1992
+ const d = `pr-m${o.n++}`;
1993
+ n.push(`<clipPath id="${d}"><path d="${Q(t.recorte.caminho, a)}" clip-rule="${t.recorte.regra}"/></clipPath>`), u = ` clip-path="url(#${d})"`;
1994
+ }
1995
+ const f = t.mesclagem && /^[a-z-]+$/.test(t.mesclagem) ? ` style="mix-blend-mode:${t.mesclagem}"` : "";
1996
+ return `<g data-id="${R(t.id)}"${B("opacity", t.opacidade, a)}${u}${f}>${e.join("")}</g>`;
1997
+ }
1998
+ function Yi(t, a) {
1999
+ const n = ha(a == null ? void 0 : a.casas) ? Math.min(8, Math.max(0, Math.round(a.casas))) : 4, o = mr(n), e = ha(a == null ? void 0 : a.largura) && a.largura > 0 ? a.largura : 1, r = ha(a == null ? void 0 : a.altura) && a.altura > 0 ? a.altura : 1, i = [], s = { n: 0 }, c = [];
2000
+ for (const l of Vn(t, a == null ? void 0 : a.camadas))
2001
+ try {
2002
+ c.push(yr(l, o, i, s));
2003
+ } catch {
2004
+ }
2005
+ const u = a != null && a.titulo ? `<title>${za(a.titulo)}</title>` : "", f = a != null && a.fundo ? `<rect x="0" y="0" width="${o(e)}" height="${o(r)}" fill="${R(N(a.fundo, "#ffffff"))}"/>` : "", d = i.length > 0 ? `<defs>${i.join("")}</defs>` : "";
2006
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${o(e)}mm" height="${o(r)}mm" viewBox="0 0 ${o(e)} ${o(r)}">${u}${d}${f}${c.join("")}</svg>`;
2007
+ }
2008
+ const Tt = (t) => typeof t == "number" && Number.isFinite(t), An = (t) => !!t && Tt(t.x) && Tt(t.y) && Tt(t.largura) && Tt(t.altura) && t.largura >= 0 && t.altura >= 0, Pn = (t) => [t.x, t.x + t.largura / 2, t.x + t.largura], In = (t) => [t.y, t.y + t.altura / 2, t.y + t.altura];
2009
+ function $n(t, a, n, o) {
2010
+ let e = null;
2011
+ for (const r of a)
2012
+ for (const i of n(r))
2013
+ for (const s of t) {
2014
+ const c = i - s;
2015
+ Math.abs(c) <= o && (!e || Math.abs(c) < Math.abs(e.delta)) && (e = { delta: c, posicao: i, alvo: r });
2016
+ }
2017
+ return e;
2018
+ }
2019
+ function Sn(t, a, n, o) {
2020
+ const [e, r, i, s] = t === "vertical" ? [n.y, n.y + n.altura, o.y, o.y + o.altura] : [n.x, n.x + n.largura, o.x, o.x + o.largura], c = { orientacao: t, posicao: a, de: Math.min(e, i), ate: Math.max(r, s) };
2021
+ return r < i ? c.distancia = i - r : s < e && (c.distancia = e - s), c;
2022
+ }
2023
+ function Wi(t, a, n) {
2024
+ const o = { correcao: [0, 0], linhas: [] };
2025
+ if (!An(t) || !Tt(n) || n < 0 || !Array.isArray(a)) return o;
2026
+ const e = a.filter(An), r = $n(Pn(t), e, Pn, n), i = $n(In(t), e, In, n), s = (r == null ? void 0 : r.delta) ?? 0, c = (i == null ? void 0 : i.delta) ?? 0, u = { ...t, x: t.x + s, y: t.y + c }, f = [];
2027
+ return r && f.push(Sn("vertical", r.posicao, u, r.alvo)), i && f.push(Sn("horizontal", i.posicao, u, i.alvo)), { correcao: [s, c], linhas: f };
2028
+ }
2029
+ const ot = (t) => typeof t == "number" && Number.isFinite(t);
2030
+ function ao(t, a) {
2031
+ const n = t.largura / 2, o = t.altura / 2;
2032
+ return [
2033
+ { c: [-n, -o], d: [1, 1] },
2034
+ { c: [n, -o], d: [-1, 1] },
2035
+ { c: [n, o], d: [-1, -1] },
2036
+ { c: [-n, o], d: [1, -1] }
2037
+ ][a];
2038
+ }
2039
+ const aa = (t) => {
2040
+ var a;
2041
+ return !!t && ((a = t.geometria) == null ? void 0 : a.tipo) === "retangulo" && ot(t.geometria.largura) && ot(t.geometria.altura) && t.geometria.largura > 0 && t.geometria.altura > 0;
2042
+ };
2043
+ function br(t) {
2044
+ const a = Math.sqrt(Math.abs(Jt(L(t))));
2045
+ return ot(a) && a > 1e-9 ? a : 1;
2046
+ }
2047
+ function no(t) {
2048
+ return aa(t) ? wn(t.geometria.largura, t.geometria.altura, t.geometria.raios) : null;
2049
+ }
2050
+ function Zi(t, a) {
2051
+ if (!aa(t) || t.bloqueado) return null;
2052
+ const n = no(t), o = t.geometria, e = ot(a) && a > 0 ? Math.min(a / br(t), Math.min(o.largura, o.altura) / 2) : 0, r = L(t);
2053
+ return [0, 1, 2, 3].map((i) => {
2054
+ const { c: s, d: c } = ao(o, i), u = Math.max(n[i], e);
2055
+ return I(r, [s[0] + c[0] * u, s[1] + c[1] * u]);
2056
+ });
2057
+ }
2058
+ function Ji(t, a, n) {
2059
+ if (!aa(t) || !Number.isInteger(a) || a < 0 || a > 3 || !ot(n == null ? void 0 : n[0]) || !ot(n == null ? void 0 : n[1])) return null;
2060
+ const o = dt(L(t));
2061
+ if (!o) return null;
2062
+ const e = I(o, n), { c: r, d: i } = ao(t.geometria, a);
2063
+ return ((e[0] - r[0]) * i[0] + (e[1] - r[1]) * i[1]) / 2;
2064
+ }
2065
+ function En(t, a, n) {
2066
+ if (!aa(t) || t.bloqueado || !ot(n)) return null;
2067
+ const o = t.geometria, e = Math.min(Math.max(0, n), Math.min(o.largura, o.altura) / 2), r = no(t), i = a === null ? [e, e, e, e] : r.map((c, u) => u === a ? e : c), s = i.some((c) => c > 0) ? { tipo: "retangulo", largura: o.largura, altura: o.altura, raios: i } : { tipo: "retangulo", largura: o.largura, altura: o.altura };
2068
+ return { ...t, geometria: s };
2069
+ }
2070
+ function Qi(t, a) {
2071
+ if (typeof a == "number") return En(t, null, a);
2072
+ if (!Array.isArray(a) || a.length !== 4 || !a.every(ot)) return null;
2073
+ let n = t;
2074
+ for (let o = 0; o < 4 && n; o++) n = En(n, o, a[o]);
2075
+ return n;
2076
+ }
2077
+ const Rt = (t) => typeof t == "number" && Number.isFinite(t);
2078
+ function Ki(t, a) {
2079
+ const n = new Set(a), o = new Set(t.filter((e) => n.has(e.id) && e.grupoId).map((e) => e.grupoId));
2080
+ return t.filter((e) => n.has(e.id) || e.grupoId !== void 0 && o.has(e.grupoId)).map((e) => e.id);
2081
+ }
2082
+ const oo = (t) => {
2083
+ if (t.ordem === void 0) return t;
2084
+ const { ordem: a, ...n } = t;
2085
+ return n;
2086
+ };
2087
+ function ts(t, a, n, o) {
2088
+ const e = new Set(a), r = Et(o), i = _t(t, r).map(oo);
2089
+ if (n === "frente" || n === "tras") {
2090
+ const c = /* @__PURE__ */ new Map();
2091
+ for (const f of i) {
2092
+ const d = r.indice(f);
2093
+ c.has(d) || c.set(d, []), c.get(d).push(f);
2094
+ }
2095
+ const u = [];
2096
+ for (const f of [...c.keys()].sort((d, l) => d - l)) {
2097
+ const d = c.get(f), l = d.filter((m) => e.has(m.id)), h = d.filter((m) => !e.has(m.id));
2098
+ u.push(...n === "frente" ? [...h, ...l] : [...l, ...h]);
2099
+ }
2100
+ return u;
2101
+ }
2102
+ const s = [...i];
2103
+ if (n === "avancar")
2104
+ for (let c = s.length - 2; c >= 0; c--) {
2105
+ if (!e.has(s[c].id)) continue;
2106
+ const u = s.findIndex((d, l) => l > c && !e.has(d.id) && r.indice(d) === r.indice(s[c]));
2107
+ if (u < 0) continue;
2108
+ const [f] = s.splice(c, 1);
2109
+ s.splice(u, 0, f);
2110
+ }
2111
+ else
2112
+ for (let c = 1; c < s.length; c++) {
2113
+ if (!e.has(s[c].id)) continue;
2114
+ let u = -1;
2115
+ for (let d = c - 1; d >= 0; d--) if (!e.has(s[d].id) && r.indice(s[d]) === r.indice(s[c])) {
2116
+ u = d;
2117
+ break;
2118
+ }
2119
+ if (u < 0) continue;
2120
+ const [f] = s.splice(c, 1);
2121
+ s.splice(u, 0, f);
2122
+ }
2123
+ return s;
2124
+ }
2125
+ function as(t, a, n, o) {
2126
+ const e = new Set(a);
2127
+ if (e.size < 2 || typeof n != "string" || !n) return [...t];
2128
+ const r = _t(t, o).map(oo), i = r.filter((u) => e.has(u.id)).map((u) => ({ ...u, grupoId: n })), s = r.map((u) => e.has(u.id)).lastIndexOf(!0), c = [];
2129
+ return r.forEach((u, f) => {
2130
+ e.has(u.id) || c.push(u), f === s && c.push(...i);
2131
+ }), c;
2132
+ }
2133
+ function ns(t, a) {
2134
+ const n = new Set(a), o = new Set(t.filter((e) => n.has(e.id) && e.grupoId).map((e) => e.grupoId));
2135
+ return t.map((e) => {
2136
+ if (!e.grupoId || !o.has(e.grupoId)) return e;
2137
+ const { grupoId: r, ...i } = e;
2138
+ return i;
2139
+ });
2140
+ }
2141
+ function eo(t) {
2142
+ if (t.length === 0) return null;
2143
+ const a = Math.min(...t.map((r) => r.x)), n = Math.min(...t.map((r) => r.y)), o = Math.max(...t.map((r) => r.x + r.largura)), e = Math.max(...t.map((r) => r.y + r.altura));
2144
+ return [a, n, o, e].every(Rt) ? { x: a, y: n, largura: o - a, altura: e - n } : null;
2145
+ }
2146
+ function ro(t) {
2147
+ const a = /* @__PURE__ */ new Map();
2148
+ for (const o of t) {
2149
+ const e = o.grupoId ? `g\0${o.grupoId}` : `e\0${o.id}`;
2150
+ a.has(e) || a.set(e, []), a.get(e).push(o);
2151
+ }
2152
+ const n = [];
2153
+ for (const o of a.values()) {
2154
+ const e = eo(o.map(St).filter((r) => !!r));
2155
+ e && n.push({ membros: o, caixa: e });
2156
+ }
2157
+ return n;
2158
+ }
2159
+ const Sa = (t, a, n) => a === 0 && n === 0 ? [] : t.membros.filter((o) => !o.bloqueado).map((o) => at(o, j(a, n)));
2160
+ function os(t, a, n = { tipo: "selecao" }) {
2161
+ let o = ro(t), e = null;
2162
+ if ((n == null ? void 0 : n.tipo) === "caixa") {
2163
+ const i = n.caixa;
2164
+ e = i && [i.x, i.y, i.largura, i.altura].every(Rt) ? i : null;
2165
+ } else if ((n == null ? void 0 : n.tipo) === "chave") {
2166
+ const i = o.find((s) => s.membros.some((c) => c.id === n.id));
2167
+ e = (i == null ? void 0 : i.caixa) ?? null, o = o.filter((s) => s !== i);
2168
+ } else {
2169
+ if (o.length < 2) return [];
2170
+ e = eo(o.map((i) => i.caixa));
2171
+ }
2172
+ if (!e) return [];
2173
+ const r = [];
2174
+ for (const i of o) {
2175
+ const s = i.caixa;
2176
+ let c = 0, u = 0;
2177
+ switch (a) {
2178
+ case "esquerda":
2179
+ c = e.x - s.x;
2180
+ break;
2181
+ case "direita":
2182
+ c = e.x + e.largura - (s.x + s.largura);
2183
+ break;
2184
+ case "centro-horizontal":
2185
+ c = e.x + e.largura / 2 - (s.x + s.largura / 2);
2186
+ break;
2187
+ case "topo":
2188
+ u = e.y - s.y;
2189
+ break;
2190
+ case "base":
2191
+ u = e.y + e.altura - (s.y + s.altura);
2192
+ break;
2193
+ case "centro-vertical":
2194
+ u = e.y + e.altura / 2 - (s.y + s.altura / 2);
2195
+ break;
2196
+ default:
2197
+ return [];
2198
+ }
2199
+ r.push(...Sa(i, c, u));
2200
+ }
2201
+ return r;
2202
+ }
2203
+ function es(t, a, n = "espacos", o) {
2204
+ const e = a === "horizontal", r = ro(t), i = Rt(o) && n === "espacos";
2205
+ if (r.length < (i ? 2 : 3)) return [];
2206
+ const s = (g) => e ? g.x : g.y, c = (g) => e ? g.largura : g.altura;
2207
+ r.sort((g, y) => s(g.caixa) + c(g.caixa) / 2 - (s(y.caixa) + c(y.caixa) / 2));
2208
+ const u = r[0].caixa, f = r[r.length - 1].caixa, d = [];
2209
+ if (n === "centros") {
2210
+ const g = s(u) + c(u) / 2, y = (s(f) + c(f) / 2 - g) / (r.length - 1);
2211
+ return r.forEach((p, M) => {
2212
+ const b = g + y * M - (s(p.caixa) + c(p.caixa) / 2);
2213
+ d.push(...Sa(p, e ? b : 0, e ? 0 : b));
2214
+ }), d;
2215
+ }
2216
+ const l = r.reduce((g, y) => g + c(y.caixa), 0), h = i ? o : (s(f) + c(f) - s(u) - l) / (r.length - 1);
2217
+ let m = s(u);
2218
+ for (const g of r) {
2219
+ const y = m - s(g.caixa);
2220
+ d.push(...Sa(g, e ? y : 0, e ? 0 : y)), m += c(g.caixa) + h;
2221
+ }
2222
+ return d;
2223
+ }
2224
+ function rs(t, a, n = [0, 0]) {
2225
+ var s;
2226
+ const o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
2227
+ for (const c of t) o.set(c.id, a(((s = c.geometria) == null ? void 0 : s.tipo) ?? "elemento"));
2228
+ const [r, i] = Rt(n == null ? void 0 : n[0]) && Rt(n == null ? void 0 : n[1]) ? n : [0, 0];
2229
+ return t.map((c) => {
2230
+ const u = JSON.parse(JSON.stringify(c));
2231
+ return u.id = o.get(c.id), c.grupoId && (e.has(c.grupoId) || e.set(c.grupoId, a("grupo")), u.grupoId = e.get(c.grupoId)), c.recorteId && (o.has(c.recorteId) ? u.recorteId = o.get(c.recorteId) : delete u.recorteId), delete u.ordem, r === 0 && i === 0 ? u : at(u, j(r, i));
2232
+ });
2233
+ }
2234
+ function is(t, a) {
2235
+ return t.map((n) => {
2236
+ if (!a) {
2237
+ const { aparencia: o, ...e } = n;
2238
+ return e;
2239
+ }
2240
+ return { ...n, aparencia: JSON.parse(JSON.stringify(a)) };
2241
+ });
2242
+ }
2243
+ const ut = (t) => typeof t == "number" && Number.isFinite(t);
2244
+ function et(t, a, n = t.id) {
2245
+ const { transformacao: o, pivo: e, ...r } = t;
2246
+ return { ...r, id: n, geometria: { tipo: "caminho", geometria: a } };
2247
+ }
2248
+ function ss(t, a = 0.01) {
2249
+ const n = t.map((e) => ({ e, c: D(e) })).filter((e) => e.c && e.e.geometria.tipo !== "texto");
2250
+ if (n.length < 2) return { motivo: "selecao-insuficiente" };
2251
+ const o = ut(a) && a >= 0 ? a : 0.01;
2252
+ if (n.every((e) => e.c.tipo === "LineString")) {
2253
+ const e = n.flatMap((i) => {
2254
+ const s = i.c;
2255
+ return s.partes && s.partes.length > 1 ? s.partes : [s.coordenadas];
2256
+ }), r = ko(e, o, A);
2257
+ return r ? { ok: et(n[0].e, { tipo: "LineString", coordenadas: r }) } : { motivo: "sem-ligacao" };
2258
+ }
2259
+ if (n.length === 2 && n.every((e) => e.c.tipo === "Polygon")) {
2260
+ const [e, r] = n.map((s) => s.c.aneis[0]), i = Ro(e, r, o, A);
2261
+ return i ? { ok: et(n[0].e, { tipo: "Polygon", aneis: [i] }) } : { motivo: "sem-ligacao" };
2262
+ }
2263
+ return { motivo: "tipos-incompativeis" };
2264
+ }
2265
+ function cs(t, a, n) {
2266
+ const o = D(t), e = D(a);
2267
+ if (!o || !e) return { motivo: "degenerado" };
2268
+ if (o.tipo !== "Polygon" || t.geometria.tipo === "texto") return { motivo: "sem-forma-fechada" };
2269
+ if (e.tipo !== "LineString") return { motivo: "tipos-incompativeis" };
2270
+ const r = Do(o.aneis[0], e.coordenadas, A);
2271
+ return r ? { ok: r.map((i) => et(t, { tipo: "Polygon", aneis: [i] }, n("caminho"))) } : { motivo: "sem-intersecao" };
2272
+ }
2273
+ function us(t, a, n) {
2274
+ var r;
2275
+ const o = D(t);
2276
+ if (!o || t.geometria.tipo === "texto") return { motivo: ((r = t.geometria) == null ? void 0 : r.tipo) === "texto" ? "texto" : "degenerado" };
2277
+ if (!ut(a) || a === 0) return { motivo: "degenerado" };
2278
+ const e = Pt(o.tipo === "Polygon" ? { tipo: "Polygon", aneis: [o.aneis[0]] } : { tipo: "LineString", coordenadas: o.coordenadas }, a, A);
2279
+ return e ? { ok: et(t, { tipo: "Polygon", aneis: [e] }, n) } : { motivo: "degenerado" };
2280
+ }
2281
+ function ls(t, a) {
2282
+ var r;
2283
+ const n = D(t);
2284
+ if (!n || t.geometria.tipo === "texto") return { motivo: ((r = t.geometria) == null ? void 0 : r.tipo) === "texto" ? "texto" : "degenerado" };
2285
+ const o = ut(a) && a > 0 ? a : 0.1;
2286
+ if (n.tipo === "Polygon") return { ok: et(t, { tipo: "Polygon", aneis: n.aneis.map((i) => xo(i, o, 1)) }) };
2287
+ const e = (n.partes && n.partes.length > 1 ? n.partes : [n.coordenadas]).map((i) => vo(i, o, 1));
2288
+ return { ok: et(t, e.length > 1 ? { tipo: "LineString", coordenadas: e[0], partes: e } : { tipo: "LineString", coordenadas: e[0] }) };
2289
+ }
2290
+ function fs(t) {
2291
+ var i;
2292
+ const a = D(t), n = rt(t).traco;
2293
+ if (!a || t.geometria.tipo === "texto") return { motivo: ((i = t.geometria) == null ? void 0 : i.tipo) === "texto" ? "texto" : "degenerado" };
2294
+ if (!n) return { motivo: "degenerado" };
2295
+ const o = n.largura / 2;
2296
+ let e = null;
2297
+ if (a.tipo === "LineString") {
2298
+ const s = Pt({ tipo: "LineString", coordenadas: a.coordenadas }, o, A);
2299
+ e = s ? { tipo: "Polygon", aneis: [s] } : null;
2300
+ } else {
2301
+ const s = Pt({ tipo: "Polygon", aneis: [a.aneis[0]] }, o, A), c = Pt({ tipo: "Polygon", aneis: [a.aneis[0]] }, -o, A);
2302
+ e = s ? { tipo: "Polygon", aneis: c ? [s, c] : [s] } : null;
2303
+ }
2304
+ if (!e) return { motivo: "degenerado" };
2305
+ const r = et(t, e);
2306
+ return r.aparencia = { ...t.aparencia ?? {}, traco: null, preenchimento: { cor: n.cor, opacidade: n.opacidade, regra: "evenodd" }, hachura: null }, { ok: r };
2307
+ }
2308
+ function ds(t, a, n, o) {
2309
+ const e = new Set(a), r = _t(t.filter((s) => e.has(s.id)), o);
2310
+ if (r.length < 2) return { motivo: "selecao-insuficiente" };
2311
+ const i = [...r].reverse().find((s) => {
2312
+ var c;
2313
+ return s.geometria.tipo !== "texto" && ((c = D(s)) == null ? void 0 : c.tipo) === "Polygon";
2314
+ });
2315
+ return i ? {
2316
+ ok: t.map((s) => s.id === i.id ? { ...s, mascara: !0, grupoId: n } : e.has(s.id) ? { ...s, recorteId: i.id, grupoId: n } : s)
2317
+ } : { motivo: "sem-forma-fechada" };
2318
+ }
2319
+ function hs(t, a) {
2320
+ const n = new Set(a), o = new Set(t.filter((r) => n.has(r.id) && r.grupoId).map((r) => r.grupoId)), e = new Set(t.filter((r) => r.mascara && (n.has(r.id) || r.grupoId && o.has(r.grupoId))).map((r) => r.id));
2321
+ return e.size === 0 ? [...t] : t.map((r) => {
2322
+ if (e.has(r.id)) {
2323
+ const { mascara: i, ...s } = r;
2324
+ return s;
2325
+ }
2326
+ if (r.recorteId && e.has(r.recorteId)) {
2327
+ const { recorteId: i, ...s } = r;
2328
+ return s;
2329
+ }
2330
+ return r;
2331
+ });
2332
+ }
2333
+ function ms(t, a, n) {
2334
+ const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ? Na(o) : null;
2335
+ if (!e || !ut(a == null ? void 0 : a[0]) || !ut(a == null ? void 0 : a[1])) return null;
2336
+ const r = L(t);
2337
+ let i = null;
2338
+ return e.forEach((s, c) => {
2339
+ const u = I(r, s.ponto), f = Math.hypot(u[0] - a[0], u[1] - a[1]);
2340
+ f <= n && (!i || f < i.d) && (i = { i: c, d: f });
2341
+ }), i ? i.i : null;
2342
+ }
2343
+ function ps(t, a, n) {
2344
+ const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ? Na(o) : null;
2345
+ if (!o || !e || !ut(a == null ? void 0 : a[0]) || !ut(a == null ? void 0 : a[1])) return null;
2346
+ const r = L(t);
2347
+ let i = null;
2348
+ for (const [s, c] of wo(o)) {
2349
+ const [u, f] = Ao(e[s], e[c]);
2350
+ let d = I(r, e[s].ponto);
2351
+ for (let l = 1; l <= 16; l++) {
2352
+ const h = I(r, Po(e[s].ponto, u, f, e[c].ponto, l / 16)), m = pa(a[0], a[1], d[0], d[1], h[0], h[1]);
2353
+ m <= n && (!i || m < i.d) && (i = { i: s, d: m }), d = h;
2354
+ }
2355
+ }
2356
+ return i ? i.i : null;
2357
+ }
2358
+ class Mr {
2359
+ constructor(a, n, o) {
2360
+ P(this, "celulas", /* @__PURE__ */ new Map());
2361
+ P(this, "seq", 0);
2362
+ this.q = a, this.x0 = n, this.y0 = o;
2363
+ }
2364
+ /** Hash da célula (colisões são inofensivas: a distância é conferida vértice a vértice). */
2365
+ celula(a, n) {
2366
+ return (Math.imul(a | 0, 73856093) ^ Math.imul(n | 0, 19349663)) >>> 0;
2367
+ }
2368
+ /** O vértice de `p`: um já registrado a até `q`, ou um novo. */
2369
+ registrar(a, n) {
2370
+ const o = Math.floor((a - this.x0) / this.q), e = Math.floor((n - this.y0) / this.q);
2371
+ let r = null, i = this.q * this.q;
2372
+ for (let f = -1; f <= 1; f++)
2373
+ for (let d = -1; d <= 1; d++) {
2374
+ const l = this.celulas.get(this.celula(o + f, e + d));
2375
+ if (l)
2376
+ for (const h of l) {
2377
+ const m = (h.p[0] - a) ** 2 + (h.p[1] - n) ** 2;
2378
+ m <= i && (i = m, r = h);
2379
+ }
2380
+ }
2381
+ if (r) return r;
2382
+ const s = { p: [a, n], id: this.seq++ }, c = this.celula(o, e), u = this.celulas.get(c);
2383
+ return u ? u.push(s) : this.celulas.set(c, [s]), s;
2384
+ }
2385
+ }
2386
+ const xr = (t) => Math.min(t.a.p[0], t.b.p[0]), vr = (t) => Math.max(t.a.p[0], t.b.p[0]), Ar = (t) => Math.min(t.a.p[1], t.b.p[1]), Pr = (t) => Math.max(t.a.p[1], t.b.p[1]);
2387
+ function Ut(t, a, n) {
2388
+ if (a.id === t.a.id || a.id === t.b.id) return 0;
2389
+ const [o, e] = t.a.p, r = t.b.p[0] - o, i = t.b.p[1] - e, s = r * r + i * i;
2390
+ if (!(s > 0)) return 0;
2391
+ const c = ((a.p[0] - o) * r + (a.p[1] - e) * i) / s, u = n / Math.sqrt(s);
2392
+ return c <= u || c >= 1 - u || Math.abs((a.p[0] - o) * i - (a.p[1] - e) * r) / Math.sqrt(s) > n ? 0 : (t.cortes.push(a), 1);
2393
+ }
2394
+ function Ir(t, a, n, o) {
2395
+ let e = Ut(t, a.a, o) + Ut(t, a.b, o) + Ut(a, t.a, o) + Ut(a, t.b, o);
2396
+ const [r, i] = t.a.p, [s, c] = a.a.p, u = t.b.p[0] - r, f = t.b.p[1] - i, d = a.b.p[0] - s, l = a.b.p[1] - c, h = u * l - f * d, m = Math.hypot(u, f), g = Math.hypot(d, l);
2397
+ if (!(Math.abs(h) > 1e-12 * m * g)) return e;
2398
+ const y = ((s - r) * l - (c - i) * d) / h, p = ((s - r) * f - (c - i) * u) / h, M = o / m, b = o / g;
2399
+ if (y <= M || y >= 1 - M || p <= b || p >= 1 - b) return e;
2400
+ const x = n.registrar(r + y * u, i + y * f);
2401
+ return x.id !== t.a.id && x.id !== t.b.id && (t.cortes.push(x), e++), x.id !== a.a.id && x.id !== a.b.id && (a.cortes.push(x), e++), e;
2402
+ }
2403
+ function $r(t, a, n) {
2404
+ const o = t.length, e = new Float64Array(o), r = new Float64Array(o), i = new Float64Array(o), s = new Float64Array(o);
2405
+ for (let l = 0; l < o; l++) {
2406
+ const h = t[l];
2407
+ e[l] = xr(h), r[l] = vr(h), i[l] = Ar(h), s[l] = Pr(h);
2408
+ }
2409
+ const c = Array.from({ length: o }, (l, h) => h).sort((l, h) => e[l] - e[h]), u = new Int32Array(o);
2410
+ let f = 0, d = 0;
2411
+ for (const l of c) {
2412
+ const h = e[l] - n, m = i[l] - n, g = s[l] + n;
2413
+ let y = 0;
2414
+ for (let p = 0; p < f; p++) {
2415
+ const M = u[p];
2416
+ r[M] < h || (u[y++] = M, !(s[M] < m || i[M] > g) && (d += Ir(t[l], t[M], a, n)));
2417
+ }
2418
+ f = y, u[f++] = l;
2419
+ }
2420
+ return d;
2421
+ }
2422
+ function Sr(t) {
2423
+ const a = /* @__PURE__ */ new Set(), n = [];
2424
+ for (const o of t) {
2425
+ const [e, r] = o.a.p, i = o.b.p[0] - e, s = o.b.p[1] - r, c = (f) => (f.p[0] - e) * i + (f.p[1] - r) * s, u = [o.a, ...[...o.cortes].sort((f, d) => c(f) - c(d)), o.b];
2426
+ for (let f = 1; f < u.length; f++) {
2427
+ const d = u[f - 1], l = u[f];
2428
+ if (d.id === l.id) continue;
2429
+ const h = d.id < l.id ? d.id * 67108864 + l.id : l.id * 67108864 + d.id;
2430
+ a.has(h) || (a.add(h), n.push({ a: d, b: l }));
2431
+ }
2432
+ }
2433
+ return n;
2434
+ }
2435
+ class io {
2436
+ constructor(a, n, o) {
2437
+ P(this, "coords");
2438
+ P(this, "operandos");
2439
+ P(this, "faixas");
2440
+ P(this, "y0");
2441
+ P(this, "altura");
2442
+ P(this, "nf");
2443
+ P(this, "maxX");
2444
+ const e = a.length;
2445
+ this.coords = new Float64Array(e * 4), this.operandos = new Int32Array(e), this.maxX = new Float64Array(e);
2446
+ const r = Math.max(1, Math.min(4096, Math.ceil(e / 6)));
2447
+ this.nf = r;
2448
+ const i = Array.from({ length: r }, () => []);
2449
+ this.y0 = n, this.altura = o > n ? (o - n) / r : 1, a.forEach((c, u) => {
2450
+ this.maxX[u] = Math.max(c.a.p[0], c.b.p[0]), this.coords[u * 4] = c.a.p[0], this.coords[u * 4 + 1] = c.a.p[1], this.coords[u * 4 + 2] = c.b.p[0], this.coords[u * 4 + 3] = c.b.p[1], this.operandos[u] = c.operando;
2451
+ const f = this.faixa(Math.min(c.a.p[1], c.b.p[1])), d = this.faixa(Math.max(c.a.p[1], c.b.p[1]));
2452
+ for (let l = f; l <= d; l++) i[l].push(u);
2453
+ });
2454
+ const s = this.maxX;
2455
+ this.faixas = i.map((c) => Int32Array.from(c.sort((u, f) => s[f] - s[u])));
2456
+ }
2457
+ faixa(a) {
2458
+ const n = Math.floor((a - this.y0) / this.altura);
2459
+ return n < 0 ? 0 : n >= this.nf ? this.nf - 1 : n;
2460
+ }
2461
+ /**
2462
+ * Número de voltas de (x, y) em cada operando, em `v.voltas`; só os operandos com aresta cruzada pelo raio entram em
2463
+ * `v.tocados` (os demais têm 0 voltas). A consulta zera só o que a anterior tocou.
2464
+ */
2465
+ voltas(a, n, o) {
2466
+ const e = o.voltas;
2467
+ for (let c = 0; c < o.n; c++) e[o.tocados[c]] = 0;
2468
+ o.n = 0;
2469
+ const r = this.coords, i = this.maxX, s = this.faixas[this.faixa(n)];
2470
+ for (let c = 0; c < s.length; c++) {
2471
+ const u = s[c];
2472
+ if (i[u] < a) break;
2473
+ const f = r[u * 4], d = r[u * 4 + 1], l = r[u * 4 + 2], h = r[u * 4 + 3];
2474
+ let m = 0;
2475
+ if (d <= n ? h > n && (l - f) * (n - d) - (a - f) * (h - d) > 0 && (m = 1) : h <= n && (l - f) * (n - d) - (a - f) * (h - d) < 0 && (m = -1), m === 0) continue;
2476
+ const g = this.operandos[u];
2477
+ o.marcado[g] || (o.marcado[g] = 1, o.tocados[o.n++] = g), e[g] += m;
98
2478
  }
2479
+ for (let c = 0; c < o.n; c++) o.marcado[o.tocados[c]] = 0;
2480
+ }
2481
+ }
2482
+ class Ea {
2483
+ constructor(a) {
2484
+ P(this, "voltas");
2485
+ P(this, "tocados");
2486
+ P(this, "marcado");
2487
+ P(this, "n", 0);
2488
+ this.voltas = new Int32Array(a), this.tocados = new Int32Array(a), this.marcado = new Uint8Array(a);
2489
+ }
2490
+ }
2491
+ const Er = (t, a) => a === "evenodd" ? (t & 1) !== 0 : t !== 0;
2492
+ function jn(t, a, n) {
2493
+ let o = 0, e = !1;
2494
+ for (let r = 0; r < a.n; r++) {
2495
+ const i = a.tocados[r];
2496
+ if (Er(a.voltas[i], n[i])) {
2497
+ if (o++, i === 0 && (e = !0), t === "uniao") return !0;
2498
+ if (t === "subtracao" && i !== 0) return !1;
2499
+ }
2500
+ }
2501
+ return t === "uniao" ? !1 : t === "intersecao" ? n.length > 0 && o === n.length : t === "subtracao" ? e : (o & 1) === 1;
2502
+ }
2503
+ function gs(t, a, n) {
2504
+ let o = !1;
2505
+ for (let e = 0, r = n.length - 1; e < n.length; r = e++) {
2506
+ const [i, s] = n[e], [c, u] = n[r];
2507
+ s > a != u > a && t < (c - i) * (a - s) / (u - s) + i && (o = !o);
2508
+ }
2509
+ return o;
2510
+ }
2511
+ function jr(t) {
2512
+ let a = t;
2513
+ for (let n = 0; n < 4; n++) {
2514
+ const o = a.length;
2515
+ if (o < 3) return a;
2516
+ const e = [];
2517
+ for (let r = 0; r < o; r++) {
2518
+ const i = e.length > 0 ? e[e.length - 1] : a[(r - 1 + o) % o], s = a[r], c = a[(r + 1) % o], u = s[0] - i[0], f = s[1] - i[1], d = c[0] - s[0], l = c[1] - s[1], h = u * l - f * d;
2519
+ Math.abs(h) <= 1e-12 * Math.hypot(u, f) * Math.hypot(d, l) || e.push(s);
2520
+ }
2521
+ if (e.length === o) return e;
2522
+ a = e;
2523
+ }
2524
+ return a;
2525
+ }
2526
+ function Lr(t) {
2527
+ const a = /* @__PURE__ */ new Map();
2528
+ t.forEach((r, i) => {
2529
+ const s = a.get(r.a.id);
2530
+ s ? s.push(i) : a.set(r.a.id, [i]);
2531
+ });
2532
+ const n = new Uint8Array(t.length), o = [];
2533
+ let e = 0;
2534
+ for (let r = 0; r < t.length; r++) {
2535
+ if (n[r]) continue;
2536
+ const i = t[r].a.id, s = [t[r].a.p];
2537
+ let c = r, u = !1;
2538
+ for (let f = 0; f <= t.length; f++) {
2539
+ n[c] = 1;
2540
+ const d = t[c];
2541
+ if (d.b.id === i) {
2542
+ u = !0;
2543
+ break;
2544
+ }
2545
+ s.push(d.b.p);
2546
+ const l = (a.get(d.b.id) ?? []).filter((h) => !n[h]);
2547
+ if (l.length === 0) break;
2548
+ c = l.length === 1 ? l[0] : Nr(d, l, t);
2549
+ }
2550
+ u && s.length >= 3 ? o.push(s) : e++;
2551
+ }
2552
+ return { aneis: o, descartadas: e };
2553
+ }
2554
+ function Nr(t, a, n) {
2555
+ const o = t.b.p[0] - t.a.p[0], e = t.b.p[1] - t.a.p[1];
2556
+ let r = a[0], i = -1 / 0;
2557
+ for (const s of a) {
2558
+ const c = n[s], u = c.b.p[0] - c.a.p[0], f = c.b.p[1] - c.a.p[1], d = Math.atan2(o * f - e * u, o * u + e * f);
2559
+ d > i && (i = d, r = s);
2560
+ }
2561
+ return r;
2562
+ }
2563
+ function zr(t, a, n) {
2564
+ const o = [], e = [];
2565
+ for (const i of t) {
2566
+ const s = jr(i);
2567
+ if (s.length < 3) continue;
2568
+ const c = Dt(s);
2569
+ Math.abs(c) <= a || (c > 0 ? o.push({ anel: s, area: c, poligono: { exterior: s, furos: [] } }) : e.push({ anel: s, area: -c }));
2570
+ }
2571
+ o.sort((i, s) => i.area - s.area);
2572
+ let r = 0;
2573
+ if (e.length > 0) {
2574
+ let i = 1 / 0, s = -1 / 0;
2575
+ const c = [];
2576
+ o.forEach((d, l) => d.anel.forEach((h, m) => {
2577
+ h[1] < i && (i = h[1]), h[1] > s && (s = h[1]), c.push({ a: { p: h }, b: { p: d.anel[(m + 1) % d.anel.length] }, operando: l });
2578
+ }));
2579
+ const u = new io(c, i, s), f = new Ea(o.length);
2580
+ for (const d of e) {
2581
+ const [l, h] = [d.anel[0], d.anel[1]], m = Math.hypot(h[0] - l[0], h[1] - l[1]) || 1, g = Math.min(n, m * 0.1);
2582
+ u.voltas((l[0] + h[0]) / 2 + (h[1] - l[1]) / m * g, (l[1] + h[1]) / 2 - (h[0] - l[0]) / m * g, f);
2583
+ let y = -1;
2584
+ for (let p = 0; p < f.n; p++) {
2585
+ const M = f.tocados[p];
2586
+ f.voltas[M] !== 0 && o[M].area > d.area && (y < 0 || M < y) && (y = M);
2587
+ }
2588
+ y >= 0 ? o[y].poligono.furos.push(d.anel) : r++;
2589
+ }
2590
+ }
2591
+ return { poligonos: o.map((i) => i.poligono), descartados: r };
2592
+ }
2593
+ const Cr = ["uniao", "subtracao", "intersecao", "exclusao"], ja = (t) => typeof t == "number" && Number.isFinite(t), Ln = () => ({
2594
+ poligonos: [],
2595
+ estatisticas: { segmentos: 0, cortes: 0, pecas: 0, bordas: 0, aneis: 0, descartados: 0 }
2596
+ });
2597
+ function Tr(t) {
2598
+ if (!Array.isArray(t)) return [];
2599
+ const a = t.filter((n) => Array.isArray(n) && ja(n[0]) && ja(n[1]));
2600
+ return a.length > 1 && a[0][0] === a[a.length - 1][0] && a[0][1] === a[a.length - 1][1] && a.pop(), a;
2601
+ }
2602
+ function qr(t, a, n = {}) {
2603
+ if (!Array.isArray(t) || !Cr.includes(a)) return Ln();
2604
+ const o = t.map((v) => ({
2605
+ aneis: (Array.isArray(v == null ? void 0 : v.aneis) ? v.aneis : []).map(Tr).filter((Y) => Y.length >= 3),
2606
+ regra: (v == null ? void 0 : v.regra) === "evenodd" ? "evenodd" : "nonzero"
2607
+ }));
2608
+ let e = 1 / 0, r = 1 / 0, i = -1 / 0, s = -1 / 0;
2609
+ for (const v of o) for (const Y of v.aneis) for (const [G, $] of Y)
2610
+ G < e && (e = G), G > i && (i = G), $ < r && (r = $), $ > s && (s = $);
2611
+ const c = Math.max(i - e, s - r);
2612
+ if (!(c > 0) || !Number.isFinite(c)) return Ln();
2613
+ const u = ja(n.tolerancia) ? Math.min(1e-3, Math.max(1e-12, n.tolerancia)) : 1e-9, f = c * u, d = f * 2, l = new Mr(f, e, r), h = [];
2614
+ o.forEach((v, Y) => {
2615
+ for (const G of v.aneis) {
2616
+ const $ = G.map(([k, st]) => l.registrar(k, st)).filter((k, st, Xt) => st === 0 || k.id !== Xt[st - 1].id);
2617
+ if ($.length > 1 && $[0].id === $[$.length - 1].id && $.pop(), !($.length < 3))
2618
+ for (let k = 0; k < $.length; k++) h.push({ a: $[k], b: $[(k + 1) % $.length], operando: Y, cortes: [] });
2619
+ }
2620
+ });
2621
+ const m = { segmentos: h.length, cortes: 0, pecas: 0, bordas: 0, aneis: 0, descartados: 0 };
2622
+ if (h.length === 0) return { poligonos: [], estatisticas: m };
2623
+ m.cortes = $r(h, l, d);
2624
+ const g = Sr(h);
2625
+ m.pecas = g.length;
2626
+ const y = new io(h, r, s), p = o.map((v) => v.regra), M = new Ea(o.length), b = new Ea(o.length), x = c * 1e-6, _ = [];
2627
+ for (const v of g) {
2628
+ const Y = v.b.p[0] - v.a.p[0], G = v.b.p[1] - v.a.p[1], $ = Math.hypot(Y, G);
2629
+ if (!($ > 0)) continue;
2630
+ const k = Math.min(x, $ * 0.1), st = (v.a.p[0] + v.b.p[0]) / 2, Xt = (v.a.p[1] + v.b.p[1]) / 2, Ha = -G / $ * k, Va = Y / $ * k;
2631
+ y.voltas(st + Ha, Xt + Va, M), y.voltas(st - Ha, Xt - Va, b);
2632
+ const Ya = jn(a, M, p), uo = jn(a, b, p);
2633
+ Ya !== uo && _.push(Ya ? { a: v.a, b: v.b } : { a: v.b, b: v.a });
2634
+ }
2635
+ m.bordas = _.length;
2636
+ const { aneis: mt, descartadas: na } = Lr(_);
2637
+ m.aneis = mt.length;
2638
+ const { poligonos: so, descartados: co } = zr(mt, f * f, x);
2639
+ return m.descartados = na + co, { poligonos: so.map(Or), estatisticas: m };
2640
+ }
2641
+ const Or = (t) => ({
2642
+ exterior: t.exterior.map(([a, n]) => [a, n]),
2643
+ furos: t.furos.map((a) => a.map(([n, o]) => [n, o]))
2644
+ });
2645
+ function ys(t) {
2646
+ let a = 0;
2647
+ for (const n of t ?? []) {
2648
+ a += Math.abs(Dt(n.exterior));
2649
+ for (const o of n.furos) a -= Math.abs(Dt(o));
2650
+ }
2651
+ return a;
2652
+ }
2653
+ function Dr(t) {
2654
+ var e, r, i;
2655
+ if (!t || typeof t != "object" || t.mascara || ((e = t.geometria) == null ? void 0 : e.tipo) === "texto" || ((r = t.geometria) == null ? void 0 : r.tipo) === "linha") return null;
2656
+ const a = D(t);
2657
+ if (!a) return null;
2658
+ if (a.tipo === "Polygon") {
2659
+ const s = a.curva && a.aneis.length === 1 ? [At(a.curva, !0)] : a.aneis, c = ((i = rt(t).preenchimento) == null ? void 0 : i.regra) ?? (s.length > 1 ? "evenodd" : "nonzero");
2660
+ return { aneis: s, regra: c };
2661
+ }
2662
+ const o = (a.partes && a.partes.length > 1 ? a.partes : [a.curva ? At(a.curva, !1) : a.coordenadas]).filter((s) => s.length >= 3);
2663
+ return o.length > 0 ? { aneis: o, regra: "nonzero" } : null;
2664
+ }
2665
+ function bs(t, a) {
2666
+ const n = (Array.isArray(t) ? t : []).map((c) => ({ e: c, r: Dr(c) })).filter((c) => c.r !== null);
2667
+ if (n.length < 2) return { motivo: "selecao-insuficiente" };
2668
+ const o = a === "subtracao" ? n[0].e : n[n.length - 1].e, { poligonos: e } = qr(n.map((c) => c.r), a);
2669
+ if (e.length === 0) return { motivo: a === "intersecao" ? "sem-intersecao" : "resultado-vazio" };
2670
+ const r = e.flatMap((c) => [c.exterior, ...c.furos]), i = et(o, { tipo: "Polygon", aneis: r }), s = o.aparencia ?? {};
2671
+ return s.preenchimento && r.length > 1 && (i.aparencia = { ...s, preenchimento: { ...s.preenchimento, regra: "evenodd" } }), { ok: { resultado: i, usados: n.map((c) => c.e.id) } };
2672
+ }
2673
+ const wr = [
2674
+ "elemento.nome",
2675
+ "elemento.bloqueado",
2676
+ "elemento.oculto",
2677
+ "geometria.x",
2678
+ "geometria.y",
2679
+ "geometria.largura",
2680
+ "geometria.altura",
2681
+ "geometria.rotacao",
2682
+ "geometria.raio",
2683
+ "traco.ativo",
2684
+ "traco.cor",
2685
+ "traco.espessura",
2686
+ "traco.opacidade",
2687
+ "traco.tipoLinha",
2688
+ "traco.escalaTipoLinha",
2689
+ "traco.terminacao",
2690
+ "traco.juncao",
2691
+ "traco.alinhamento",
2692
+ "traco.pontaInicio",
2693
+ "traco.pontaFim",
2694
+ "preenchimento.ativo",
2695
+ "preenchimento.cor",
2696
+ "preenchimento.opacidade",
2697
+ "preenchimento.regra",
2698
+ "hachura.ativa",
2699
+ "hachura.angulo",
2700
+ "hachura.espacamento",
2701
+ "hachura.cor",
2702
+ "hachura.cruzada",
2703
+ "efeitos.opacidade",
2704
+ "efeitos.mesclagem",
2705
+ "sombra.ativa",
2706
+ "sombra.dx",
2707
+ "sombra.dy",
2708
+ "sombra.desfoque",
2709
+ "sombra.cor",
2710
+ "sombra.opacidade"
2711
+ ], kr = (t) => typeof t == "string" && wr.includes(t), Rr = (t) => t.startsWith("geometria."), La = (t) => typeof t == "number" && Number.isFinite(t), X = (t) => Math.round(t * 1e6) / 1e6;
2712
+ function Fr(t) {
2713
+ const a = t.transformacao;
2714
+ return a && La(a.a) && La(a.b) ? X(Math.atan2(a.b, a.a) * 180 / Math.PI) : 0;
2715
+ }
2716
+ function Ms(t, a) {
2717
+ var n, o, e, r, i, s, c, u, f, d, l, h, m, g, y;
2718
+ if (!(!t || typeof t != "object" || !t.geometria))
2719
+ try {
2720
+ const p = t.aparencia ?? {}, M = ba(t), b = p.traco ?? void 0, x = a.startsWith("geometria.") ? St(t) : null;
2721
+ switch (a) {
2722
+ case "elemento.nome":
2723
+ return t.nome ?? "";
2724
+ case "elemento.bloqueado":
2725
+ return t.bloqueado === !0;
2726
+ case "elemento.oculto":
2727
+ return t.oculto === !0;
2728
+ case "geometria.x":
2729
+ return x ? X(x.x) : void 0;
2730
+ case "geometria.y":
2731
+ return x ? X(x.y) : void 0;
2732
+ case "geometria.largura":
2733
+ return x ? X(x.largura) : void 0;
2734
+ case "geometria.altura":
2735
+ return x ? X(x.altura) : void 0;
2736
+ case "geometria.rotacao":
2737
+ return Fr(t);
2738
+ case "geometria.raio": {
2739
+ if (t.geometria.tipo !== "retangulo") return;
2740
+ const mt = t.geometria.raios ?? [0, 0, 0, 0];
2741
+ return mt.every((na) => na === mt[0]) ? mt[0] : null;
2742
+ }
2743
+ case "traco.ativo":
2744
+ return M.traco !== null;
2745
+ case "traco.cor":
2746
+ return ((n = M.traco) == null ? void 0 : n.cor) ?? (b == null ? void 0 : b.cor) ?? "#000000";
2747
+ case "traco.espessura":
2748
+ return ((o = M.traco) == null ? void 0 : o.largura) ?? (b == null ? void 0 : b.espessura) ?? 0.25;
2749
+ case "traco.opacidade":
2750
+ return X((((e = M.traco) == null ? void 0 : e.opacidade) ?? (b == null ? void 0 : b.opacidade) ?? 1) * 100);
2751
+ case "traco.tipoLinha":
2752
+ return (b == null ? void 0 : b.tipoLinha) ?? "continua";
2753
+ case "traco.escalaTipoLinha":
2754
+ return (b == null ? void 0 : b.escalaTipoLinha) ?? 1;
2755
+ case "traco.terminacao":
2756
+ return (b == null ? void 0 : b.terminacao) ?? "reta";
2757
+ case "traco.juncao":
2758
+ return (b == null ? void 0 : b.juncao) ?? "angular";
2759
+ case "traco.alinhamento":
2760
+ return (b == null ? void 0 : b.alinhamento) ?? "centro";
2761
+ case "traco.pontaInicio":
2762
+ return ((r = b == null ? void 0 : b.pontaInicio) == null ? void 0 : r.estilo) ?? "nenhuma";
2763
+ case "traco.pontaFim":
2764
+ return ((i = b == null ? void 0 : b.pontaFim) == null ? void 0 : i.estilo) ?? "nenhuma";
2765
+ case "preenchimento.ativo":
2766
+ return M.preenchimento !== null;
2767
+ case "preenchimento.cor":
2768
+ return ((s = M.preenchimento) == null ? void 0 : s.cor) ?? ((c = p.preenchimento) == null ? void 0 : c.cor) ?? "#ffffff";
2769
+ case "preenchimento.opacidade":
2770
+ return X((((u = M.preenchimento) == null ? void 0 : u.opacidade) ?? 1) * 100);
2771
+ case "preenchimento.regra":
2772
+ return ((f = M.preenchimento) == null ? void 0 : f.regra) ?? ((d = p.preenchimento) == null ? void 0 : d.regra) ?? "nonzero";
2773
+ case "hachura.ativa":
2774
+ return !!p.hachura;
2775
+ case "hachura.angulo":
2776
+ return ((l = p.hachura) == null ? void 0 : l.angulo) ?? 45;
2777
+ case "hachura.espacamento":
2778
+ return ((h = p.hachura) == null ? void 0 : h.espacamento) ?? 2;
2779
+ case "hachura.cor":
2780
+ return ((m = M.hachura) == null ? void 0 : m.cor) ?? ((g = p.hachura) == null ? void 0 : g.cor) ?? "#000000";
2781
+ case "hachura.cruzada":
2782
+ return ((y = p.hachura) == null ? void 0 : y.cruzada) === !0;
2783
+ case "efeitos.opacidade":
2784
+ return X(M.opacidade * 100);
2785
+ case "efeitos.mesclagem":
2786
+ return p.mesclagem ?? "normal";
2787
+ case "sombra.ativa":
2788
+ return !!p.sombra;
2789
+ }
2790
+ const _ = ka(p.sombra ?? {}) ?? { dx: 1.5, dy: 1.5, desfoque: 1, cor: "#000000", opacidade: 0 };
2791
+ switch (a) {
2792
+ case "sombra.dx":
2793
+ return _.dx;
2794
+ case "sombra.dy":
2795
+ return _.dy;
2796
+ case "sombra.desfoque":
2797
+ return _.desfoque;
2798
+ case "sombra.cor":
2799
+ return _.cor;
2800
+ case "sombra.opacidade":
2801
+ return X(_.opacidade * 100);
2802
+ }
2803
+ } catch {
2804
+ return;
2805
+ }
2806
+ }
2807
+ const _r = (t) => {
2808
+ const a = typeof t == "string" && t.trim() !== "" ? Number(t.replace(",", ".")) : t;
2809
+ return La(a) ? a : null;
2810
+ }, Gr = (t) => typeof t == "string" ? t : null, Xr = (t) => typeof t == "boolean" ? t : t === "true" ? !0 : t === "false" ? !1 : null;
2811
+ function J(t) {
2812
+ return t && typeof t == "object" ? { ...t } : {};
2813
+ }
2814
+ function xs(t, a, n) {
2815
+ if (!t || typeof t != "object" || !kr(a) || Rr(a)) return null;
2816
+ const o = { ...t.aparencia ?? {} }, e = { ...t }, [r, i] = a.split("."), s = _r(n), c = Xr(n), u = Gr(n), f = s === null ? null : Math.min(1, Math.max(0, s / 100));
2817
+ if (r === "elemento")
2818
+ if (i === "nome") {
2819
+ if (u === null) return null;
2820
+ u.trim() === "" ? delete e.nome : e.nome = u;
2821
+ } else {
2822
+ if (c === null) return null;
2823
+ c ? e[i] = !0 : delete e[i];
2824
+ }
2825
+ else if (r === "traco")
2826
+ if (i === "ativo") {
2827
+ if (c === null) return null;
2828
+ o.traco = c ? J(o.traco) : null;
2829
+ } else {
2830
+ const l = J(o.traco);
2831
+ if (i === "cor" && u !== null) l.cor = u;
2832
+ else if (i === "espessura" && s !== null && s >= 0) l.espessura = s;
2833
+ else if (i === "opacidade" && f !== null) l.opacidade = f;
2834
+ else if (i === "escalaTipoLinha" && s !== null && s > 0) l.escalaTipoLinha = s;
2835
+ else if (i === "tipoLinha" && u !== null) l.tipoLinha = u;
2836
+ else if (i === "terminacao" && u !== null && ["reta", "arredondada", "quadrada"].includes(u)) l.terminacao = u;
2837
+ else if (i === "juncao" && u !== null && ["angular", "arredondada", "chanfrada"].includes(u)) l.juncao = u;
2838
+ else if (i === "alinhamento" && u !== null && ["centro", "dentro", "fora"].includes(u)) l.alinhamento = u;
2839
+ else if ((i === "pontaInicio" || i === "pontaFim") && u !== null)
2840
+ u === "nenhuma" ? delete l[i] : l[i] = { ...l[i] ?? {}, estilo: u };
2841
+ else return null;
2842
+ o.traco = l;
2843
+ }
2844
+ else if (r === "preenchimento")
2845
+ if (i === "ativo") {
2846
+ if (c === null) return null;
2847
+ o.preenchimento = c ? { cor: "#ffffff", ...J(o.preenchimento) } : null;
2848
+ } else {
2849
+ const l = J(o.preenchimento);
2850
+ if (i === "cor" && u !== null)
2851
+ l.cor = u, delete l.gradiente;
2852
+ else if (i === "opacidade" && f !== null) l.opacidade = f;
2853
+ else if (i === "regra" && (u === "nonzero" || u === "evenodd")) l.regra = u;
2854
+ else return null;
2855
+ o.preenchimento = l;
2856
+ }
2857
+ else if (r === "hachura")
2858
+ if (i === "ativa") {
2859
+ if (c === null) return null;
2860
+ o.hachura = c ? J(o.hachura) : null;
2861
+ } else {
2862
+ const l = J(o.hachura);
2863
+ if (i === "angulo" && s !== null) l.angulo = s;
2864
+ else if (i === "espacamento" && s !== null && s > 0) l.espacamento = s;
2865
+ else if (i === "cor" && u !== null) l.cor = u;
2866
+ else if (i === "cruzada" && c !== null) l.cruzada = c;
2867
+ else return null;
2868
+ o.hachura = l;
2869
+ }
2870
+ else if (r === "efeitos")
2871
+ if (i === "opacidade" && f !== null) o.opacidade = f;
2872
+ else if (i === "mesclagem" && u !== null && kn.includes(u))
2873
+ u === "normal" ? delete o.mesclagem : o.mesclagem = u;
2874
+ else return null;
2875
+ else if (r === "sombra")
2876
+ if (i === "ativa") {
2877
+ if (c === null) return null;
2878
+ o.sombra = c ? J(o.sombra) : null;
2879
+ } else {
2880
+ const l = J(o.sombra), h = ka({ ...l, opacidade: 1 });
2881
+ if (i === "dx" && s !== null) l.deslocamento = [s, h.dy];
2882
+ else if (i === "dy" && s !== null) l.deslocamento = [h.dx, s];
2883
+ else if (i === "desfoque" && s !== null && s >= 0) l.desfoque = s;
2884
+ else if (i === "cor" && u !== null) l.cor = u;
2885
+ else if (i === "opacidade" && f !== null) l.opacidade = f;
2886
+ else return null;
2887
+ o.sombra = l;
2888
+ }
2889
+ else return null;
2890
+ return r !== "elemento" && (e.aparencia = o), Se(e) ?? null;
2891
+ }
2892
+ const ma = (t) => typeof t == "number" && Number.isFinite(t);
2893
+ class vs {
2894
+ constructor(a = {}) {
2895
+ P(this, "desfazeres", []);
2896
+ P(this, "refazeres", []);
2897
+ P(this, "limite");
2898
+ P(this, "janela");
2899
+ P(this, "ultimaChave", null);
2900
+ P(this, "ultimoInstante", -1 / 0);
2901
+ this.limite = ma(a.limite) && a.limite >= 1 ? Math.floor(a.limite) : 100, this.janela = ma(a.janelaRajadaMs) && a.janelaRajadaMs >= 0 ? a.janelaRajadaMs : 1e3;
2902
+ }
2903
+ get podeDesfazer() {
2904
+ return this.desfazeres.length > 0;
2905
+ }
2906
+ get podeRefazer() {
2907
+ return this.refazeres.length > 0;
2908
+ }
2909
+ get passos() {
2910
+ return this.desfazeres.length;
2911
+ }
2912
+ /**
2913
+ * Registra uma mudança: `antes` é o estado anterior a ela. Devolve `true` se abriu um passo novo e `false` se a mudança
2914
+ * entrou na rajada do passo anterior. Qualquer registro apaga o que havia para refazer.
2915
+ */
2916
+ registrar(a, n = {}) {
2917
+ const o = ma(n.agora) ? n.agora : Date.now(), e = typeof n.chave == "string" && n.chave ? n.chave : null, r = e !== null && e === this.ultimaChave && o - this.ultimoInstante <= this.janela && o >= this.ultimoInstante && this.desfazeres.length > 0;
2918
+ return this.refazeres = [], this.ultimaChave = e, this.ultimoInstante = o, r ? !1 : (this.desfazeres.push(a), this.desfazeres.length > this.limite && this.desfazeres.splice(0, this.desfazeres.length - this.limite), !0);
2919
+ }
2920
+ /** Volta um passo: recebe o estado atual (que vai para o refazer) e devolve o anterior, ou `null` se não há. */
2921
+ desfazer(a) {
2922
+ const n = this.desfazeres.pop();
2923
+ return n === void 0 ? null : (this.refazeres.push(a), this.encerrarRajada(), n);
2924
+ }
2925
+ /** Refaz um passo: recebe o estado atual (que volta para o desfazer) e devolve o seguinte, ou `null` se não há. */
2926
+ refazer(a) {
2927
+ const n = this.refazeres.pop();
2928
+ return n === void 0 ? null : (this.desfazeres.push(a), this.encerrarRajada(), n);
2929
+ }
2930
+ /** Fecha a rajada em andamento: a próxima mudança, mesmo com a mesma chave, abre um passo novo. */
2931
+ encerrarRajada() {
2932
+ this.ultimaChave = null, this.ultimoInstante = -1 / 0;
2933
+ }
2934
+ /**
2935
+ * Reescreve todos os estados guardados (desfazer e refazer) com `fn`. Serve para trocar uma referência estável em todo o
2936
+ * histórico (ex.: o app troca o id provisório de um elemento) sem perder os passos.
2937
+ */
2938
+ transformar(a) {
2939
+ this.desfazeres = this.desfazeres.map(a), this.refazeres = this.refazeres.map(a);
2940
+ }
2941
+ limpar() {
2942
+ this.desfazeres = [], this.refazeres = [], this.encerrarRajada();
99
2943
  }
100
- return m > 0 && m < t && (r = "misto"), i > 0 && i < p && (s = "misto"), { traco: r, preenchimento: s };
101
2944
  }
102
2945
  export {
103
- J as ALCAS_ESCALA,
104
- W as COR_PADRAO_PRANCHA,
105
- Y as DIMENSOES_FOLHA,
106
- Z as EPSILON_DETERMINANTE,
107
- j as ESCALA_MINIMA,
108
- k as ESPACO_GEOGRAFICO,
109
- aa as ESPACO_PLANO,
110
- oa as ESPESSURA_PADRAO_MM,
111
- z as ESPESSURA_TRACO_PADRAO_MM,
112
- M as ESTILOS_TRACO,
113
- H as ESTILO_DO_TIPO_LINHA,
114
- ra as FAIXAS_MAXIMO,
115
- ea as FAIXAS_PADRAO,
116
- sa as FONTE_PADRAO,
117
- na as FORMATOS_ABNT,
118
- ta as Historico,
119
- ia as IDENTIDADE,
120
- ca as IDS_PROPRIEDADES_PRANCHA,
121
- la as ITENS_PREDEFINICOES,
122
- ma as IndicePrancha,
123
- ua as KAPPA,
124
- pa as LIMITE_PONTA_PADRAO,
125
- Aa as MAX_LINHAS_HACHURA,
126
- da as MESCLAGEM_CSS,
127
- fa as MM_POR_PX,
128
- ba as MM_POR_UNIDADE,
129
- ha as MODOS_MESCLAGEM,
130
- Ea as OPERACOES_BOOLEANAS,
131
- Pa as PREDEFINICOES,
132
- Da as PRIORIDADE_SNAP_PRANCHA,
133
- Sa as ROTULOS_PREDEFINICOES,
134
- Ca as SOMBRA_PADRAO,
135
- R as TIPO_LINHA_DO_ESTILO,
136
- Oa as adaptarContextoRelativo,
137
- Ta as adicionarAncora,
138
- _a as agrupar,
139
- q as ajustarAparenciaEmLote,
140
- B as ajustarElementosACaixa,
141
- Na as alcasDoElemento,
142
- Ma as alinhar,
143
- Ra as analisarElemento,
144
- xa as ancoraMaisProxima,
145
- Ia as ancorasDoElemento,
146
- C as aparenciaDe,
147
- y as aplicar,
148
- ga as aplicarAparencia,
149
- va as aplicarPathfinder,
150
- ya as aplicarTodos,
151
- La as aplicarVetor,
152
- Fa as areaComSinal,
153
- za as areaDosPoligonos,
154
- Ha as avisarUmaVez,
155
- Ga as buscarSnapPrancha,
156
- Ua as caixaDaSelecao,
157
- Ba as caixaDeCantos,
158
- Xa as caixaDoQuadro,
159
- Va as caixaDoQuadroAbnt,
160
- qa as caixaDoTexto,
161
- Qa as caixaNormalizada,
162
- Ka as caixaOrientada,
163
- $a as caminhoDoContorno,
164
- ka as caminhoFinito,
165
- wa as caminhoParaSvg,
166
- g as centroDaSelecao,
2946
+ Ee as ALCAS_ESCALA,
2947
+ qt as COR_PADRAO_PRANCHA,
2948
+ _e as DIMENSOES_FOLHA,
2949
+ qn as EPSILON_DETERMINANTE,
2950
+ la as ESCALA_MINIMA,
2951
+ Is as ESPACO_GEOGRAFICO,
2952
+ A as ESPACO_PLANO,
2953
+ vi as ESPESSURA_PADRAO_MM,
2954
+ wa as ESPESSURA_TRACO_PADRAO_MM,
2955
+ Xn as ESTILOS_TRACO,
2956
+ ar as ESTILO_DO_TIPO_LINHA,
2957
+ er as FAIXAS_MAXIMO,
2958
+ Pa as FAIXAS_PADRAO,
2959
+ Yo as FONTE_PADRAO,
2960
+ ki as FORMATOS_ABNT,
2961
+ vs as Historico,
2962
+ nt as IDENTIDADE,
2963
+ wr as IDS_PROPRIEDADES_PRANCHA,
2964
+ Di as ITENS_PREDEFINICOES,
2965
+ $i as IndicePrancha,
2966
+ bt as KAPPA,
2967
+ ue as LIMITE_PONTA_PADRAO,
2968
+ fn as MAX_LINHAS_HACHURA,
2969
+ ya as MESCLAGEM_CSS,
2970
+ Ka as MM_POR_PX,
2971
+ Ca as MM_POR_UNIDADE,
2972
+ kn as MODOS_MESCLAGEM,
2973
+ Cr as OPERACOES_BOOLEANAS,
2974
+ we as PREDEFINICOES,
2975
+ Oe as PRIORIDADE_SNAP_PRANCHA,
2976
+ Re as ROTULOS_PREDEFINICOES,
2977
+ ca as SOMBRA_PADRAO,
2978
+ Ua as TIPO_LINHA_DO_ESTILO,
2979
+ or as adaptarContextoRelativo,
2980
+ Ci as adicionarAncora,
2981
+ as as agrupar,
2982
+ Xi as ajustarAparenciaEmLote,
2983
+ Fi as ajustarElementosACaixa,
2984
+ Li as alcasDoElemento,
2985
+ os as alinhar,
2986
+ Rn as analisarElemento,
2987
+ ms as ancoraMaisProxima,
2988
+ ji as ancorasDoElemento,
2989
+ rt as aparenciaDe,
2990
+ I as aplicar,
2991
+ is as aplicarAparencia,
2992
+ bs as aplicarPathfinder,
2993
+ ti as aplicarTodos,
2994
+ Kr as aplicarVetor,
2995
+ Dt as areaComSinal,
2996
+ ys as areaDosPoligonos,
2997
+ bn as avisarUmaVez,
2998
+ Si as buscarSnapPrancha,
2999
+ je as caixaDaSelecao,
3000
+ si as caixaDeCantos,
3001
+ Xe as caixaDoQuadro,
3002
+ Ri as caixaDoQuadroAbnt,
3003
+ ie as caixaDoTexto,
3004
+ Ra as caixaNormalizada,
3005
+ Fa as caixaOrientada,
3006
+ Bn as caminhoDoContorno,
3007
+ w as caminhoFinito,
3008
+ Q as caminhoParaSvg,
3009
+ _a as centroDaSelecao,
167
3010
  Ja as cisalhamento,
168
- Wa as comPropriedade,
169
- Ya as comRaioDeCanto,
170
- Za as comoCaminhoNaFolha,
171
- ja as compor,
172
- ao as comprimentoDaPonta,
173
- oo as contornoDoTraco,
174
- ro as contornoElipse,
175
- eo as contornoEstrela,
176
- so as contornoLocal,
177
- F as contornoLocalEmCache,
178
- no as contornoNaFolha,
179
- to as contornoPoligonoRegular,
180
- io as contornoRetangulo,
181
- co as converterAncora,
182
- lo as converterEmCaminho,
183
- mo as corComOpacidade,
184
- uo as corNaPosicao,
185
- po as criarCaminho,
186
- Ao as criarElipse,
187
- fo as criarEstrela,
188
- bo as criarLinha,
189
- ho as criarMascara,
190
- Eo as criarPoligonoRegular,
191
- Po as criarRetangulo,
192
- Do as criarTexto,
193
- So as deMm,
194
- Co as decompor,
195
- Oo as definirMedidorTexto,
196
- To as definirRaiosDoRetangulo,
197
- _o as desagrupar,
198
- No as desenharElementos,
199
- Mo as desenharPlano,
200
- Ro as deslocarCaminho,
201
- xo as determinante,
202
- Io as diagnosticarContexto,
203
- go as direcaoNaPonta,
204
- vo as distribuir,
205
- yo as dividirComLinha,
206
- Lo as duplicarElementos,
207
- Fo as ehFechado,
208
- zo as ehIdentidade,
209
- Ho as ehMatrizFinita,
210
- Go as ehPredefinicao,
211
- Uo as ehPropriedadeDeGeometria,
212
- Bo as ehPropriedadePrancha,
3011
+ xs as comPropriedade,
3012
+ En as comRaioDeCanto,
3013
+ et as comoCaminhoNaFolha,
3014
+ Ta as compor,
3015
+ Be as comprimentoDaPonta,
3016
+ fs as contornoDoTraco,
3017
+ oe as contornoElipse,
3018
+ re as contornoEstrela,
3019
+ Ft as contornoLocal,
3020
+ ta as contornoLocalEmCache,
3021
+ D as contornoNaFolha,
3022
+ ee as contornoPoligonoRegular,
3023
+ Qo as contornoRetangulo,
3024
+ qi as converterAncora,
3025
+ Ei as converterEmCaminho,
3026
+ me as corComOpacidade,
3027
+ rr as corNaPosicao,
3028
+ li as criarCaminho,
3029
+ en as criarElipse,
3030
+ ui as criarEstrela,
3031
+ Lt as criarLinha,
3032
+ ds as criarMascara,
3033
+ ci as criarPoligonoRegular,
3034
+ Bt as criarRetangulo,
3035
+ fi as criarTexto,
3036
+ Wr as deMm,
3037
+ ai as decompor,
3038
+ oi as definirMedidorTexto,
3039
+ Qi as definirRaiosDoRetangulo,
3040
+ ns as desagrupar,
3041
+ Vi as desenharElementos,
3042
+ hr as desenharPlano,
3043
+ us as deslocarCaminho,
3044
+ Jt as determinante,
3045
+ Ui as diagnosticarContexto,
3046
+ He as direcaoNaPonta,
3047
+ es as distribuir,
3048
+ cs as dividirComLinha,
3049
+ rs as duplicarElementos,
3050
+ ri as ehFechado,
3051
+ Jr as ehIdentidade,
3052
+ wt as ehMatrizFinita,
3053
+ ke as ehPredefinicao,
3054
+ Rr as ehPropriedadeDeGeometria,
3055
+ kr as ehPropriedadePrancha,
213
3056
  Xo as ehSingular,
214
- Vo as ehUnidadePrancha,
215
- qo as elementoNoTopo,
216
- Qo as elementosNaCaixa,
217
- Ko as elementosNoLaco,
218
- $o as elementosNoPonto,
219
- ko as emTornoDe,
220
- wo as envelopeNaFolha,
221
- L as envelopeVisual,
222
- v as escala,
223
- Jo as espelhamento,
224
- Wo as espelharElementos,
225
- Yo as excluirAncora,
226
- Zo as expandirGrupos,
227
- jo as exportarSvg,
228
- ar as faixasDoGradienteLinear,
229
- or as feicaoDoElemento,
230
- rr as fonteSegura,
231
- er as geometriaDaPonta,
232
- sr as gerarPredefinicao,
233
- nr as girarElementos,
234
- tr as guiasInteligentes,
235
- ir as iguais,
236
- cr as inverter,
237
- lr as liberarMascara,
238
- mr as limitesLocais,
239
- ur as limitesNaFolha,
240
- pr as linhasDeHachura,
241
- Ar as mapaDeCamadas,
242
- V as mapearPontoNaCaixa,
243
- dr as marcasDosCantos,
244
- fr as margensAbnt,
245
- br as matriz,
246
- hr as matrizDeCisalhamentoPorAlca,
247
- Er as matrizDeEscalaPorAlca,
248
- Pr as matrizDoElemento,
249
- Dr as meiaEspessura,
250
- Sr as modoDeTransformacao,
251
- Cr as moverAlcaDaAncora,
252
- Or as moverAncora,
253
- Tr as moverAncoras,
254
- _r as moverElemento,
255
- Nr as multiplicar,
256
- Mr as normalizarAparencia,
257
- Rr as normalizarCamadas,
258
- xr as normalizarElemento,
259
- Ir as normalizarElementos,
260
- gr as normalizarGeometriaElemento,
261
- vr as normalizarGradiente,
262
- yr as normalizarHachura,
263
- X as normalizarParaOrigem,
264
- Lr as operacaoBooleana,
265
- Fr as ordenarPorEmpilhamento,
266
- zr as padraoTipoLinhaMm,
267
- Hr as paraMm,
268
- Gr as pivoNaFolha,
269
- Ur as planejar,
270
- Br as planejarElemento,
271
- Xr as planejarElementos,
272
- Vr as planoDe,
273
- qr as pontoNoAnel,
274
- Qr as posicaoLocalDaAlca,
275
- Kr as posicoesDasAlcas,
276
- $r as profundidadeNoCanto,
277
- kr as raiosCabiveis,
278
- wr as raiosEfetivos,
279
- Jr as recompor,
280
- Wr as redefinirAvisoContexto,
281
- Yr as regiaoDoElemento,
282
- Zr as reordenar,
283
- jr as resolverAparencia,
284
- ae as resolverSombra,
285
- Q as resumirAparencia,
286
- oe as rotacao,
287
- re as rotacaoEmGraus,
288
- ee as rotacaoPorArrasto,
289
- se as saneada,
290
- ne as simplificarCaminho,
291
- te as temMedidorTexto,
292
- ie as temPreenchimento,
293
- ce as testarElemento,
294
- le as transformarContorno,
295
- D as transformarElemento,
296
- me as transformarElementos,
297
- N as translacao,
298
- ue as trechoMaisProximo,
299
- pe as unirCaminhos,
300
- Ae as valorDaPropriedade,
301
- de as varreduraDoArco
3057
+ Tn as ehUnidadePrancha,
3058
+ Ai as elementoNoTopo,
3059
+ Pi as elementosNaCaixa,
3060
+ Ii as elementosNoLaco,
3061
+ Te as elementosNoPonto,
3062
+ qa as emTornoDe,
3063
+ ce as envelopeNaFolha,
3064
+ tr as envelopeVisual,
3065
+ Qt as escala,
3066
+ Bo as espelhamento,
3067
+ bi as espelharElementos,
3068
+ Ti as excluirAncora,
3069
+ Ki as expandirGrupos,
3070
+ Yi as exportarSvg,
3071
+ ir as faixasDoGradienteLinear,
3072
+ Xa as feicaoDoElemento,
3073
+ Dn as fonteSegura,
3074
+ Ue as geometriaDaPonta,
3075
+ wi as gerarPredefinicao,
3076
+ Mi as girarElementos,
3077
+ Wi as guiasInteligentes,
3078
+ Qr as iguais,
3079
+ dt as inverter,
3080
+ hs as liberarMascara,
3081
+ Da as limitesLocais,
3082
+ St as limitesNaFolha,
3083
+ dn as linhasDeHachura,
3084
+ Et as mapaDeCamadas,
3085
+ Gi as mapearPontoNaCaixa,
3086
+ Zi as marcasDosCantos,
3087
+ Ge as margensAbnt,
3088
+ Zr as matriz,
3089
+ pi as matrizDeCisalhamentoPorAlca,
3090
+ hi as matrizDeEscalaPorAlca,
3091
+ L as matrizDoElemento,
3092
+ Ne as meiaEspessura,
3093
+ Jn as modoDeTransformacao,
3094
+ Oi as moverAlcaDaAncora,
3095
+ Ni as moverAncora,
3096
+ zi as moverAncoras,
3097
+ gi as moverElemento,
3098
+ ft as multiplicar,
3099
+ Ie as normalizarAparencia,
3100
+ xi as normalizarCamadas,
3101
+ Se as normalizarElemento,
3102
+ ii as normalizarElementos,
3103
+ Me as normalizarGeometriaElemento,
3104
+ Ae as normalizarGradiente,
3105
+ Pe as normalizarHachura,
3106
+ _i as normalizarParaOrigem,
3107
+ qr as operacaoBooleana,
3108
+ _t as ordenarPorEmpilhamento,
3109
+ le as padraoTipoLinhaMm,
3110
+ Yr as paraMm,
3111
+ yi as pivoNaFolha,
3112
+ dr as planejar,
3113
+ Ze as planejarElemento,
3114
+ Vn as planejarElementos,
3115
+ Hn as planoDe,
3116
+ gs as pontoNoAnel,
3117
+ F as posicaoLocalDaAlca,
3118
+ di as posicoesDasAlcas,
3119
+ Ji as profundidadeNoCanto,
3120
+ wn as raiosCabiveis,
3121
+ no as raiosEfetivos,
3122
+ ni as recompor,
3123
+ Hi as redefinirAvisoContexto,
3124
+ Dr as regiaoDoElemento,
3125
+ ts as reordenar,
3126
+ ba as resolverAparencia,
3127
+ ka as resolverSombra,
3128
+ Bi as resumirAparencia,
3129
+ On as rotacao,
3130
+ Fr as rotacaoEmGraus,
3131
+ mi as rotacaoPorArrasto,
3132
+ It as saneada,
3133
+ ls as simplificarCaminho,
3134
+ ei as temMedidorTexto,
3135
+ Le as temPreenchimento,
3136
+ Ce as testarElemento,
3137
+ se as transformarContorno,
3138
+ at as transformarElemento,
3139
+ _n as transformarElementos,
3140
+ j as translacao,
3141
+ ps as trechoMaisProximo,
3142
+ ss as unirCaminhos,
3143
+ Ms as valorDaPropriedade,
3144
+ ne as varreduraDoArco
302
3145
  };