@printine/designer 0.1.0

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 (199) hide show
  1. package/README.md +146 -0
  2. package/dist/DesignerRuntimeContext.d.ts +3 -0
  3. package/dist/PrintineDesigner.d.ts +9 -0
  4. package/dist/api/client.d.ts +8 -0
  5. package/dist/api/client.js +82 -0
  6. package/dist/api/common-endpoints.d.ts +12 -0
  7. package/dist/api/design-endpoints.d.ts +18 -0
  8. package/dist/api/endpoints.d.ts +33 -0
  9. package/dist/api/endpoints.js +46 -0
  10. package/dist/api/files-endpoints.d.ts +1 -0
  11. package/dist/assets/icons/aspect_ratio.d.ts +3 -0
  12. package/dist/assets/icons/delete.d.ts +3 -0
  13. package/dist/assets/icons/fit_screen.d.ts +3 -0
  14. package/dist/assets/icons/index.d.ts +11 -0
  15. package/dist/assets/icons/loading_1.d.ts +3 -0
  16. package/dist/assets/icons/loading_2.d.ts +3 -0
  17. package/dist/assets/icons/loading_3.d.ts +3 -0
  18. package/dist/assets/icons/pan.d.ts +3 -0
  19. package/dist/assets/icons/setting.d.ts +3 -0
  20. package/dist/assets/icons/text_color.d.ts +3 -0
  21. package/dist/assets/icons/text_h.d.ts +3 -0
  22. package/dist/assets/icons/text_v.d.ts +3 -0
  23. package/dist/bundled-assets.d.ts +4 -0
  24. package/dist/components/add-design.d.ts +8 -0
  25. package/dist/components/assets-dialog.d.ts +21 -0
  26. package/dist/components/canvas-context-menu.d.ts +6 -0
  27. package/dist/components/color-picker/index.d.ts +10 -0
  28. package/dist/components/context.d.ts +24 -0
  29. package/dist/components/design.d.ts +9 -0
  30. package/dist/components/fonts.d.ts +26 -0
  31. package/dist/components/image-crop.d.ts +4 -0
  32. package/dist/components/image-edit.d.ts +1 -0
  33. package/dist/components/layout/aside.d.ts +3 -0
  34. package/dist/components/layout/bottom-nav/element-menu-sheet.d.ts +11 -0
  35. package/dist/components/layout/bottom-nav/element-sheet.d.ts +11 -0
  36. package/dist/components/layout/bottom-nav/index.d.ts +1 -0
  37. package/dist/components/layout/header.d.ts +5 -0
  38. package/dist/components/loading.d.ts +3 -0
  39. package/dist/components/menus/ai.d.ts +5 -0
  40. package/dist/components/menus/background.d.ts +6 -0
  41. package/dist/components/menus/clipart.d.ts +6 -0
  42. package/dist/components/menus/files.d.ts +7 -0
  43. package/dist/components/menus/image.d.ts +8 -0
  44. package/dist/components/menus/index.d.ts +13 -0
  45. package/dist/components/menus/layer.d.ts +5 -0
  46. package/dist/components/menus/product.d.ts +3 -0
  47. package/dist/components/menus/sca.d.ts +5 -0
  48. package/dist/components/menus/shapes.d.ts +6 -0
  49. package/dist/components/menus/templates.d.ts +6 -0
  50. package/dist/components/menus/text-effects.d.ts +5 -0
  51. package/dist/components/menus/text.d.ts +6 -0
  52. package/dist/components/placement-tab.d.ts +7 -0
  53. package/dist/components/preview/3d.d.ts +7 -0
  54. package/dist/components/preview/graphic.d.ts +7 -0
  55. package/dist/components/preview/index.d.ts +18 -0
  56. package/dist/components/preview/open.d.ts +7 -0
  57. package/dist/components/preview/real-time/3d.d.ts +12 -0
  58. package/dist/components/preview/real-time/graphic.d.ts +18 -0
  59. package/dist/components/preview/real-time/index.d.ts +11 -0
  60. package/dist/components/scale-tools.d.ts +7 -0
  61. package/dist/components/semi-deisgn-config.d.ts +13 -0
  62. package/dist/components/semi-design-link.d.ts +9 -0
  63. package/dist/components/store.d.ts +1 -0
  64. package/dist/components/toolbar.d.ts +2 -0
  65. package/dist/config-D2qm60gf.js +16 -0
  66. package/dist/contracts/api-design.d.ts +176 -0
  67. package/dist/contracts/design.d.ts +86 -0
  68. package/dist/design-7zRpRtv9.js +20331 -0
  69. package/dist/engine/canvas-designer.d.ts +101 -0
  70. package/dist/engine/canvas-designer.js +313 -0
  71. package/dist/engine/constants.d.ts +27 -0
  72. package/dist/engine/constants.js +148 -0
  73. package/dist/engine/editor.d.ts +186 -0
  74. package/dist/engine/editor.js +734 -0
  75. package/dist/engine/events.d.ts +34 -0
  76. package/dist/engine/events.js +7 -0
  77. package/dist/engine/extensions/curved-text.d.ts +59 -0
  78. package/dist/engine/fabric.d.ts +4 -0
  79. package/dist/engine/fabric.js +187 -0
  80. package/dist/engine/history.d.ts +27 -0
  81. package/dist/engine/history.js +56 -0
  82. package/dist/engine/managers/event.d.ts +101 -0
  83. package/dist/engine/managers/event.js +410 -0
  84. package/dist/engine/managers/resize.d.ts +24 -0
  85. package/dist/engine/managers/resize.js +63 -0
  86. package/dist/engine/managers/snapline.d.ts +70 -0
  87. package/dist/engine/managers/snapline.js +124 -0
  88. package/dist/engine/managers/workspace.d.ts +26 -0
  89. package/dist/engine/managers/workspace.js +53 -0
  90. package/dist/engine/processors/image.d.ts +88 -0
  91. package/dist/engine/processors/image.js +473 -0
  92. package/dist/engine/processors/template.d.ts +45 -0
  93. package/dist/engine/processors/template.js +314 -0
  94. package/dist/engine/processors/text.d.ts +74 -0
  95. package/dist/engine/processors/text.js +215 -0
  96. package/dist/engine/semi-export-editor.d.ts +199 -0
  97. package/dist/engine/types.d.ts +28 -0
  98. package/dist/engine/utils/common.d.ts +25 -0
  99. package/dist/engine/utils/common.js +68 -0
  100. package/dist/engine/utils/dialog.d.ts +25 -0
  101. package/dist/engine/utils/font.d.ts +5 -0
  102. package/dist/engine/utils/font.js +39 -0
  103. package/dist/engine/utils/image.d.ts +8 -0
  104. package/dist/engine/utils/image.js +50 -0
  105. package/dist/engine/utils/loading.d.ts +17 -0
  106. package/dist/engine/utils/loading.js +71 -0
  107. package/dist/engine/utils/measure.d.ts +6 -0
  108. package/dist/engine/utils/measure.js +6 -0
  109. package/dist/engine/utils/mockup.d.ts +59 -0
  110. package/dist/engine/utils/setting.d.ts +4 -0
  111. package/dist/engine/utils/setting.js +73 -0
  112. package/dist/fabric-types.d.ts +59 -0
  113. package/dist/full-designer.js +14 -0
  114. package/dist/hooks/pagination.d.ts +19 -0
  115. package/dist/hooks/use-adobe-express.d.ts +50 -0
  116. package/dist/hooks/use-before-unload.d.ts +1 -0
  117. package/dist/hooks/use-image-drop.d.ts +18 -0
  118. package/dist/hooks/use-oss-upload.d.ts +34 -0
  119. package/dist/hooks/use-screen.d.ts +1 -0
  120. package/dist/i18n/index.d.ts +12 -0
  121. package/dist/images/design/asset_empty.png +0 -0
  122. package/dist/images/design/design/background.svg +3 -0
  123. package/dist/images/design/design/color-picker.svg +15 -0
  124. package/dist/images/design/design/computer.svg +1 -0
  125. package/dist/images/design/design/copy.svg +1 -0
  126. package/dist/images/design/design/image.svg +10 -0
  127. package/dist/images/design/design/line.svg +1 -0
  128. package/dist/images/design/design/text.svg +1 -0
  129. package/dist/images/design/design/title.svg +1 -0
  130. package/dist/images/design/empty.png +0 -0
  131. package/dist/images/design/layer_empty.png +0 -0
  132. package/dist/images/design/menu/ai.svg +1 -0
  133. package/dist/images/design/menu/back.svg +4 -0
  134. package/dist/images/design/menu/background.svg +6 -0
  135. package/dist/images/design/menu/clipart.svg +6 -0
  136. package/dist/images/design/menu/file.svg +4 -0
  137. package/dist/images/design/menu/fill.svg +1 -0
  138. package/dist/images/design/menu/image.svg +7 -0
  139. package/dist/images/design/menu/layer.svg +6 -0
  140. package/dist/images/design/menu/product.svg +3 -0
  141. package/dist/images/design/menu/sca.svg +5 -0
  142. package/dist/images/design/menu/shapes.svg +5 -0
  143. package/dist/images/design/menu/templates.svg +6 -0
  144. package/dist/images/design/menu/text.svg +6 -0
  145. package/dist/images/design/menu/uploads.svg +7 -0
  146. package/dist/images/design/spinner.svg +3 -0
  147. package/dist/images/design/spinners.svg +17 -0
  148. package/dist/images/design/transparent_pattern.svg +5 -0
  149. package/dist/index.d.ts +39 -0
  150. package/dist/index.js +127 -0
  151. package/dist/lib/analytics.d.ts +17 -0
  152. package/dist/lib/cn.d.ts +3 -0
  153. package/dist/lib/common.d.ts +16 -0
  154. package/dist/lib/config.d.ts +14 -0
  155. package/dist/lib/navigation.d.ts +2 -0
  156. package/dist/renderer/ThreeDPreview.d.ts +14 -0
  157. package/dist/renderer/sticker.js +1731 -0
  158. package/dist/renderer/three-d-preview.js +32 -0
  159. package/dist/state/designer-store.d.ts +43 -0
  160. package/dist/state/designer-store.js +85 -0
  161. package/dist/style.css +1 -0
  162. package/dist/types.d.ts +184 -0
  163. package/dist/ui/accordion.d.ts +7 -0
  164. package/dist/ui/button-group.d.ts +11 -0
  165. package/dist/ui/button.d.ts +10 -0
  166. package/dist/ui/checkbox.d.ts +4 -0
  167. package/dist/ui/command.d.ts +18 -0
  168. package/dist/ui/confirm-dialog.d.ts +15 -0
  169. package/dist/ui/context-menu.d.ts +25 -0
  170. package/dist/ui/dialog.d.ts +15 -0
  171. package/dist/ui/drawer.d.ts +15 -0
  172. package/dist/ui/editable-combobox.d.ts +10 -0
  173. package/dist/ui/hint.d.ts +8 -0
  174. package/dist/ui/image.d.ts +24 -0
  175. package/dist/ui/input-group.d.ts +16 -0
  176. package/dist/ui/input-with-addon.d.ts +17 -0
  177. package/dist/ui/input.d.ts +3 -0
  178. package/dist/ui/label.d.ts +4 -0
  179. package/dist/ui/loading-button.d.ts +15 -0
  180. package/dist/ui/popover.d.ts +9 -0
  181. package/dist/ui/scroll-area.d.ts +5 -0
  182. package/dist/ui/select.d.ts +22 -0
  183. package/dist/ui/separator.d.ts +4 -0
  184. package/dist/ui/shared-loading-button.d.ts +20 -0
  185. package/dist/ui/simple-dialog.d.ts +19 -0
  186. package/dist/ui/simple-popover.d.ts +13 -0
  187. package/dist/ui/simple-select.d.ts +20 -0
  188. package/dist/ui/skeleton.d.ts +2 -0
  189. package/dist/ui/slider.d.ts +4 -0
  190. package/dist/ui/spinner-box.d.ts +12 -0
  191. package/dist/ui/spinner.d.ts +2 -0
  192. package/dist/ui/switch.d.ts +6 -0
  193. package/dist/ui/tab/index.d.ts +15 -0
  194. package/dist/ui/textarea.d.ts +3 -0
  195. package/dist/ui/tooltip.d.ts +7 -0
  196. package/dist/workers/image-resize.worker.d.ts +1 -0
  197. package/dist/workers/mockup.worker.d.ts +5 -0
  198. package/dist/workers/render.worker.d.ts +1 -0
  199. package/package.json +201 -0
@@ -0,0 +1,1731 @@
1
+ import * as A from "pixi.js";
2
+ import * as k from "babylonjs";
3
+ import "babylonjs-loaders";
4
+ var Fe = Object.defineProperty, Be = (o, s, t) => s in o ? Fe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t, L = (o, s, t) => Be(o, typeof s != "symbol" ? s + "" : s, t), Ut, Yt, Ot, Vt, Ft, Bt, Ht, zt, Gt, Wt, jt, Kt, qt, Jt, Qt, Zt, $t, te, ee, se, ie, ne, re, oe, ae, he, ce, le, xe, ue, fe, de, _e, ye, pe, be, ve, me, ge, Ie;
5
+ const H = dt;
6
+ (function(o, s) {
7
+ const t = dt, e = o();
8
+ for (; ; )
9
+ try {
10
+ if (-parseInt(t(355)) / 1 * (-parseInt(t(367)) / 2) + -parseInt(t(380)) / 3 * (-parseInt(t(379)) / 4) + parseInt(t(352)) / 5 * (-parseInt(t(358)) / 6) + -parseInt(t(356)) / 7 + -parseInt(t(360)) / 8 * (-parseInt(t(376)) / 9) + parseInt(t(353)) / 10 + -parseInt(t(351)) / 11 === s) break;
11
+ e.push(e.shift());
12
+ } catch {
13
+ e.push(e.shift());
14
+ }
15
+ })(_t, 617774);
16
+ function dt(o, s) {
17
+ const t = _t();
18
+ return dt = function(e, i) {
19
+ return e = e - 349, t[e];
20
+ }, dt(o, s);
21
+ }
22
+ function _t() {
23
+ const o = ["40zCEvAW", "toggleHighlight", "app", "drawRect", "addChild", "width", "removeChildren", "8PPBchq", "highlight", "getChildByName", "Graphics", "set", "visible", "children", "position", "setHighlight", "1894239YXMkAY", "zIndex", "stage", "16wAudRg", "586626iAcrVw", "lineStyle", "height", "24788357mxlJgW", "172910Vxiugq", "7764320OVgCla", "Container", "216551jlKzxI", "3999212qWKLjJ", "Sprite", "6eOZEAj", "name"];
24
+ return _t = function() {
25
+ return o;
26
+ }, _t();
27
+ }
28
+ class He {
29
+ constructor(s) {
30
+ L(this, Yt), L(this, Ut);
31
+ const t = H;
32
+ this[t(362)] = s;
33
+ }
34
+ async [(Yt = H(362), Ut = H(368), H(375))](s, t) {
35
+ const e = H;
36
+ !this[e(368)] && (this[e(368)] = new A[e(354)](), this[e(368)][e(359)] = e(368)), this[e(368)][e(373)].length && this[e(368)][e(366)]();
37
+ const i = new A[e(357)](s);
38
+ this.highlight[e(374)][e(371)](t.x, t.y);
39
+ const n = new A[e(370)]();
40
+ n[e(349)](4, 16711680), n[e(363)](0, 0, s[e(365)], s[e(350)]), this[e(368)][e(364)](i), this[e(368)].addChild(n), this.highlight[e(372)] = !0;
41
+ const a = this.app.stage[e(369)](e(368)), r = Math.max(...this[e(362)][e(378)].children.map((h) => h[e(377)]));
42
+ this[e(368)][e(377)] = r + 1, !a && this.app.stage.addChild(this[e(368)]);
43
+ }
44
+ [H(361)](s) {
45
+ const t = H;
46
+ this[t(368)] && (this[t(368)][t(372)] = s);
47
+ }
48
+ }
49
+ (function(o, s) {
50
+ const t = Q, e = o();
51
+ for (; ; )
52
+ try {
53
+ if (-parseInt(t(474)) / 1 + parseInt(t(478)) / 2 * (-parseInt(t(475)) / 3) + -parseInt(t(477)) / 4 * (parseInt(t(468)) / 5) + parseInt(t(465)) / 6 + -parseInt(t(471)) / 7 * (-parseInt(t(476)) / 8) + parseInt(t(470)) / 9 + -parseInt(t(464)) / 10 * (parseInt(t(480)) / 11) === s) break;
54
+ e.push(e.shift());
55
+ } catch {
56
+ e.push(e.shift());
57
+ }
58
+ })(yt, 880871);
59
+ function O(o, s, t) {
60
+ const e = (s.x - o.x) / 3, i = (s.y - o.y) / 3;
61
+ return { dx: t.x - o.x - e, dy: t.y - o.y - i };
62
+ }
63
+ function V(o) {
64
+ return { dx: o.dx, dy: o.dy, baseDx: 0, baseDy: 0, moved: !0 };
65
+ }
66
+ function ze(o) {
67
+ const s = Q, { corners: t, curveCtrl: e } = o;
68
+ if (!t || t[s(469)] < 4) throw new Error(s(466));
69
+ if (!e || e[s(469)] < 8) throw new Error(s(473));
70
+ const i = t[0], n = t[1], a = t[2], r = t[3], h = e[0], x = e[1], c = e[2], l = e[3], u = e[4], f = e[5], b = e[6], m = e[7], I = V(O(i, n, h)), d = V(O(i, r, m)), p = V(O(n, i, x)), y = V(O(n, a, c)), M = V(O(r, a, f)), v = V(O(r, i, b)), g = V(O(a, r, u)), w = V(O(a, n, l)), C = [[{ x: i.x, y: i.y, pin: !0, r: I, d }, { x: n.x, y: n.y, pin: !0, l: p, d: y }], [{ x: r.x, y: r.y, pin: !0, r: M, u: v }, { x: a.x, y: a.y, pin: !0, l: g, u: w }]];
71
+ return { uLines: [0, 1], vLines: [0, 1], grid: C };
72
+ }
73
+ function Ge(o) {
74
+ const s = Q;
75
+ return !!(o && Array[s(481)](o[s(467)]) && Array[s(481)](o[s(463)]) && Array[s(481)](o[s(482)]));
76
+ }
77
+ function Q(o, s) {
78
+ const t = yt();
79
+ return Q = function(e, i) {
80
+ return e = e - 463, t[e];
81
+ }, Q(o, s);
82
+ }
83
+ function yt() {
84
+ const o = ["legacyToMeshData: corners 长度必须 >=4", "uLines", "443745ilhFfm", "length", "13415715CjJWBc", "55937QlePIe", "curveCtrl", "legacyToMeshData: curveCtrl 长度必须 >=8", "90262HTECdm", "12135CEpIOW", "752OnpYmz", "24IfkgcZ", "80nNZhQQ", "corners", "77GSTUUj", "isArray", "grid", "vLines", "1813930lnCXaF", "4160334tRNSuJ"];
85
+ return yt = function() {
86
+ return o;
87
+ }, yt();
88
+ }
89
+ function pt() {
90
+ const o = ["751386UcFxIA", "baseDx", "8xLtDqJ", "1384228WIGEPV", "81725qCUXFy", "10046487BClJnx", "9VbOJWV", "2cyjXSz", "660878qMireg", "moved", "1493527FIlKsj", "7297660vuODXM", "36ryQKZm", "180UEtOpv", "baseDy"];
91
+ return pt = function() {
92
+ return o;
93
+ }, pt();
94
+ }
95
+ (function(o, s) {
96
+ const t = bt, e = o();
97
+ for (; ; )
98
+ try {
99
+ if (parseInt(t(372)) / 1 * (-parseInt(t(373)) / 2) + -parseInt(t(380)) / 3 + -parseInt(t(383)) / 4 + -parseInt(t(384)) / 5 * (parseInt(t(378)) / 6) + parseInt(t(375)) / 7 * (parseInt(t(382)) / 8) + parseInt(t(371)) / 9 * (-parseInt(t(376)) / 10) + parseInt(t(370)) / 11 * (parseInt(t(377)) / 12) === s) break;
100
+ e.push(e.shift());
101
+ } catch {
102
+ e.push(e.shift());
103
+ }
104
+ })(pt, 475799);
105
+ function Y(o, s) {
106
+ const t = bt, e = o && o[s];
107
+ return !e || !e[t(374)] ? { dx: 0, dy: 0 } : { dx: (Number(e.dx) || 0) - (Number(e[t(381)]) || 0), dy: (Number(e.dy) || 0) - (Number(e[t(379)]) || 0) };
108
+ }
109
+ function nt(o, s, t, e, i) {
110
+ const n = 1 - i;
111
+ return { x: n * n * n * o.x + 3 * n * n * i * s.x + 3 * n * i * i * t.x + i * i * i * e.x, y: n * n * n * o.y + 3 * n * n * i * s.y + 3 * n * i * i * t.y + i * i * i * e.y };
112
+ }
113
+ function bt(o, s) {
114
+ const t = pt();
115
+ return bt = function(e, i) {
116
+ return e = e - 370, t[e];
117
+ }, bt(o, s);
118
+ }
119
+ function Ye(o, s, t, e, i, n) {
120
+ const a = (v, g) => ({ dx: (g.x - v.x) / 3, dy: (g.y - v.y) / 3 }), r = (() => {
121
+ const v = a(o, s), g = Y(o, "r");
122
+ return { x: o.x + v.dx + g.dx, y: o.y + v.dy + g.dy };
123
+ })(), h = (() => {
124
+ const v = a(s, o), g = Y(s, "l");
125
+ return { x: s.x + v.dx + g.dx, y: s.y + v.dy + g.dy };
126
+ })(), x = (() => {
127
+ const v = a(t, e), g = Y(t, "r");
128
+ return { x: t.x + v.dx + g.dx, y: t.y + v.dy + g.dy };
129
+ })(), c = (() => {
130
+ const v = a(e, t), g = Y(e, "l");
131
+ return { x: e.x + v.dx + g.dx, y: e.y + v.dy + g.dy };
132
+ })(), l = (() => {
133
+ const v = a(o, t), g = Y(o, "d");
134
+ return { x: o.x + v.dx + g.dx, y: o.y + v.dy + g.dy };
135
+ })(), u = (() => {
136
+ const v = a(t, o), g = Y(t, "u");
137
+ return { x: t.x + v.dx + g.dx, y: t.y + v.dy + g.dy };
138
+ })(), f = (() => {
139
+ const v = a(s, e), g = Y(s, "d");
140
+ return { x: s.x + v.dx + g.dx, y: s.y + v.dy + g.dy };
141
+ })(), b = (() => {
142
+ const v = a(e, s), g = Y(e, "u");
143
+ return { x: e.x + v.dx + g.dx, y: e.y + v.dy + g.dy };
144
+ })(), m = nt({ x: o.x, y: o.y }, r, h, { x: s.x, y: s.y }, i), I = nt({ x: t.x, y: t.y }, x, c, { x: e.x, y: e.y }, i), d = nt({ x: o.x, y: o.y }, l, u, { x: t.x, y: t.y }, n), p = nt({ x: s.x, y: s.y }, f, b, { x: e.x, y: e.y }, n), y = (1 - n) * (1 - i) * o.x + (1 - n) * i * s.x + n * (1 - i) * t.x + n * i * e.x, M = (1 - n) * (1 - i) * o.y + (1 - n) * i * s.y + n * (1 - i) * t.y + n * i * e.y;
145
+ return { x: (1 - n) * m.x + n * I.x + (1 - i) * d.x + i * p.x - y, y: (1 - n) * m.y + n * I.y + (1 - i) * d.y + i * p.y - M };
146
+ }
147
+ function Z(o, s) {
148
+ const t = mt();
149
+ return Z = function(e, i) {
150
+ return e = e - 398, t[e];
151
+ }, Z(o, s);
152
+ }
153
+ (function(o, s) {
154
+ const t = Z, e = o();
155
+ for (; ; )
156
+ try {
157
+ if (-parseInt(t(404)) / 1 + parseInt(t(407)) / 2 + -parseInt(t(410)) / 3 * (parseInt(t(409)) / 4) + parseInt(t(402)) / 5 + -parseInt(t(398)) / 6 * (-parseInt(t(399)) / 7) + parseInt(t(408)) / 8 + parseInt(t(401)) / 9 * (-parseInt(t(400)) / 10) === s) break;
158
+ e.push(e.shift());
159
+ } catch {
160
+ e.push(e.shift());
161
+ }
162
+ })(mt, 271889);
163
+ const We = 1e-9;
164
+ function je(o, s) {
165
+ const t = Z;
166
+ let e = 0, i = o[t(405)];
167
+ for (; e < i; ) {
168
+ const n = e + i >> 1;
169
+ o[n] < s ? e = n + 1 : i = n;
170
+ }
171
+ return e;
172
+ }
173
+ function vt(o, s, t = We) {
174
+ const e = Z, i = o[e(405)];
175
+ if (i <= 2) return 0;
176
+ const n = je(o, s - t);
177
+ return Math[e(403)](Math[e(406)](n - 1, 0), i - 2);
178
+ }
179
+ function mt() {
180
+ const o = ["60303xwGOXo", "264FgzqED", "35245rsMPvg", "326050kYIjPU", "171KNQUjF", "2205265GlCzoU", "min", "245827XCoAri", "length", "max", "827102gCiMfN", "1614192FbHlMi", "28RUehZS"];
181
+ return mt = function() {
182
+ return o;
183
+ }, mt();
184
+ }
185
+ function Ke(o, s, t, e, i, n, a) {
186
+ const r = vt(o, e), h = vt(s, i), x = o[r + 1] - o[r], c = s[h + 1] - s[h], l = x > 1e-9 ? (e - o[r]) / x : 0, u = c > 1e-9 ? (i - s[h]) / c : 0, f = t[h][r], b = t[h][r + 1], m = t[h + 1][r], I = t[h + 1][r + 1];
187
+ return n ? a(f, b, m, I, l, u) : { x: f.x * (1 - l) * (1 - u) + b.x * l * (1 - u) + m.x * (1 - l) * u + I.x * l * u, y: f.y * (1 - l) * (1 - u) + b.y * l * (1 - u) + m.y * (1 - l) * u + I.y * l * u };
188
+ }
189
+ function $(o, s) {
190
+ const t = gt();
191
+ return $ = function(e, i) {
192
+ return e = e - 327, t[e];
193
+ }, $(o, s);
194
+ }
195
+ (function(o, s) {
196
+ const t = $, e = o();
197
+ for (; ; )
198
+ try {
199
+ if (-parseInt(t(333)) / 1 * (-parseInt(t(334)) / 2) + -parseInt(t(331)) / 3 * (parseInt(t(342)) / 4) + parseInt(t(337)) / 5 * (-parseInt(t(340)) / 6) + parseInt(t(327)) / 7 + -parseInt(t(338)) / 8 + parseInt(t(329)) / 9 * (-parseInt(t(335)) / 10) + parseInt(t(339)) / 11 * (parseInt(t(332)) / 12) === s) break;
200
+ e.push(e.shift());
201
+ } catch {
202
+ e.push(e.shift());
203
+ }
204
+ })(gt, 276229);
205
+ function ft(o, s, t, e) {
206
+ const i = $, n = o === 0, a = o === t - 1, r = s === 0, h = s === e - 1, x = [];
207
+ return h || x.push("r"), r || x.push("l"), a || x.push("d"), n || x[i(330)]("u"), x;
208
+ }
209
+ function qe(o, s, t, e, i) {
210
+ const n = $, a = {}, r = ft(o, s, t, e);
211
+ for (const h of r)
212
+ if (i && i[h]) {
213
+ const x = i[h];
214
+ a[h] = { dx: Number(x.dx) || 0, dy: Number(x.dy) || 0, moved: !!x[n(328)], baseDx: x[n(336)] !== void 0 ? Number(x[n(336)]) || 0 : Number(x.dx) || 0, baseDy: x[n(341)] !== void 0 ? Number(x[n(341)]) || 0 : Number(x.dy) || 0 };
215
+ } else a[h] = { dx: 0, dy: 0, moved: !1, baseDx: 0, baseDy: 0 };
216
+ return a;
217
+ }
218
+ function z(o, s, t, e, i, n, a) {
219
+ const r = !!(a && a.pin);
220
+ return { x: o, y: s, pin: r, ...qe(e, t, n, i, a || null) };
221
+ }
222
+ function gt() {
223
+ const o = ["moved", "8010KKQLgJ", "push", "774tsSWYX", "24JzAHzn", "51324GPugyB", "18dwWaQi", "2760hUneFD", "baseDx", "240475VAwAcD", "1434368bMaKXn", "3936746wSZLWR", "42rRvjJJ", "baseDy", "5620NJXreR", "1558424IHtAet"];
224
+ return gt = function() {
225
+ return o;
226
+ }, gt();
227
+ }
228
+ function tt(o, s) {
229
+ const t = It();
230
+ return tt = function(e, i) {
231
+ return e = e - 308, t[e];
232
+ }, tt(o, s);
233
+ }
234
+ (function(o, s) {
235
+ const t = tt, e = o();
236
+ for (; ; )
237
+ try {
238
+ if (parseInt(t(323)) / 1 * (-parseInt(t(321)) / 2) + -parseInt(t(316)) / 3 * (-parseInt(t(309)) / 4) + parseInt(t(324)) / 5 + parseInt(t(314)) / 6 + -parseInt(t(322)) / 7 + -parseInt(t(318)) / 8 * (parseInt(t(310)) / 9) + parseInt(t(317)) / 10 === s) break;
239
+ e.push(e.shift());
240
+ } catch {
241
+ e.push(e.shift());
242
+ }
243
+ })(It, 434135);
244
+ function Je(o, s, t, e, i) {
245
+ const n = tt;
246
+ if (!(o[n(320)] === s && o.texVArr === t && o[n(312)] === e && o[n(313)] === i && o.texUSeg)) {
247
+ o[n(320)] = s, o[n(308)] = t, o.texCols = e, o[n(313)] = i, o[n(315)] = new Int16Array(e + 1), o[n(325)] = new Int16Array(i + 1), o[n(311)] = new Float32Array(e + 1), o[n(319)] = new Float32Array(i + 1);
248
+ for (let a = 0; a <= e; a++) {
249
+ const r = a / e, h = vt(s, r), x = s[h], c = s[h + 1], l = c - x;
250
+ o[n(315)][a] = h, o[n(311)][a] = l > 1e-9 ? (r - x) / l : 0;
251
+ }
252
+ for (let a = 0; a <= i; a++) {
253
+ const r = a / i, h = vt(t, r), x = t[h], c = t[h + 1], l = c - x;
254
+ o[n(325)][a] = h, o.texLV[a] = l > 1e-9 ? (r - x) / l : 0;
255
+ }
256
+ }
257
+ }
258
+ function Qe(o, s, t, e, i, n) {
259
+ const a = o[t][s], r = o[t][s + 1], h = o[t + 1][s], x = o[t + 1][s + 1];
260
+ return n ? Ye(a, r, h, x, e, i) : { x: a.x * (1 - e) * (1 - i) + r.x * e * (1 - i) + h.x * (1 - e) * i + x.x * e * i, y: a.y * (1 - e) * (1 - i) + r.y * e * (1 - i) + h.y * (1 - e) * i + x.y * e * i };
261
+ }
262
+ function It() {
263
+ const o = ["texLU", "texCols", "texRows", "4196082DhpCvk", "texUSeg", "869865rVPuIP", "5207680BPpydP", "591048GkUMHn", "texLV", "texUArr", "20882IgVimI", "5322191Vejadr", "8oNqpWL", "2164175vSiQqf", "texVSeg", "texVArr", "4yEldbT", "81ZMjkGC"];
264
+ return It = function() {
265
+ return o;
266
+ }, It();
267
+ }
268
+ function Ze(o) {
269
+ const s = tt, { texVerts: t, cache: e, grid: i, cols: n, rows: a, moved: r } = o, h = e.texUSeg, x = e[s(325)], c = e.texLU, l = e[s(319)];
270
+ if (!h || !x || !c || !l) return;
271
+ let u = 0;
272
+ for (let f = 0; f <= a; f++) {
273
+ const b = x[f], m = l[f];
274
+ for (let I = 0; I <= n; I++) {
275
+ const d = h[I], p = c[I], y = Qe(i, d, b, p, m, r);
276
+ t[u++] = y.x, t[u++] = y.y;
277
+ }
278
+ }
279
+ }
280
+ (function(o, s) {
281
+ const t = et, e = o();
282
+ for (; ; )
283
+ try {
284
+ if (parseInt(t(451)) / 1 * (-parseInt(t(432)) / 2) + -parseInt(t(434)) / 3 + parseInt(t(448)) / 4 * (parseInt(t(445)) / 5) + parseInt(t(429)) / 6 + parseInt(t(431)) / 7 + parseInt(t(442)) / 8 * (parseInt(t(456)) / 9) + -parseInt(t(455)) / 10 === s) break;
285
+ e.push(e.shift());
286
+ } catch {
287
+ e.push(e.shift());
288
+ }
289
+ })(wt, 166708);
290
+ function et(o, s) {
291
+ const t = wt();
292
+ return et = function(e, i) {
293
+ return e = e - 429, t[e];
294
+ }, et(o, s);
295
+ }
296
+ function rt(o) {
297
+ const s = et;
298
+ return o ? { dx: Number(o.dx) || 0, dy: Number(o.dy) || 0, baseDx: o[s(435)] !== void 0 && Number(o[s(435)]) || 0, baseDy: o[s(452)] !== void 0 && Number(o[s(452)]) || 0, moved: !!o[s(433)] } : null;
299
+ }
300
+ function wt() {
301
+ const o = ["1980960ORyJAw", "max", "2149847bHRbws", "12PKcjfR", "moved", "46749kBtfQY", "baseDx", "uLines 无效", "vLines 无效", "pin", "min", "uLines", "object", "6496aPXdlT", "isArray", "grid 行数不匹配", "15aosjYx", "grid", "grid 列数不匹配", "399480dFCCHk", "map", "length", "39581wnPqaG", "baseDy", "vLines", "无效 JSON", "7948180QIhwYe", "3078GnXMEY"];
302
+ return wt = function() {
303
+ return o;
304
+ }, wt();
305
+ }
306
+ function $e(o) {
307
+ const s = et;
308
+ if (!o || typeof o !== s(441)) throw new Error(s(454));
309
+ const t = o[s(440)], e = o.vLines, i = o[s(446)];
310
+ if (!Array[s(443)](t) || t.length < 2) throw new Error(s(436));
311
+ if (!Array[s(443)](e) || e[s(450)] < 2) throw new Error(s(437));
312
+ if (!Array[s(443)](i) || i[s(450)] !== e[s(450)]) throw new Error(s(444));
313
+ for (let a = 0; a < i[s(450)]; a++)
314
+ if (!Array.isArray(i[a]) || i[a][s(450)] !== t[s(450)]) throw new Error(s(447));
315
+ const n = i.map((a) => a[s(449)]((r) => {
316
+ const h = s, x = { x: Number(r.x) || 0, y: Number(r.y) || 0, pin: !!r[h(438)] }, c = rt(r.r);
317
+ c && (x.r = c);
318
+ const l = rt(r.l);
319
+ l && (x.l = l);
320
+ const u = rt(r.u);
321
+ u && (x.u = u);
322
+ const f = rt(r.d);
323
+ return f && (x.d = f), x;
324
+ }));
325
+ return { uLines: [...t], vLines: [...e], grid: n };
326
+ }
327
+ function G(o, s) {
328
+ const t = Ct();
329
+ return G = function(e, i) {
330
+ return e = e - 423, t[e];
331
+ }, G(o, s);
332
+ }
333
+ (function(o, s) {
334
+ const t = G, e = o();
335
+ for (; ; )
336
+ try {
337
+ if (-parseInt(t(424)) / 1 + -parseInt(t(429)) / 2 + -parseInt(t(433)) / 3 * (-parseInt(t(423)) / 4) + -parseInt(t(431)) / 5 * (-parseInt(t(425)) / 6) + parseInt(t(434)) / 7 + -parseInt(t(427)) / 8 * (parseInt(t(437)) / 9) + -parseInt(t(428)) / 10 === s) break;
338
+ e.push(e.shift());
339
+ } catch {
340
+ e.push(e.shift());
341
+ }
342
+ })(Ct, 122472);
343
+ function we(o, s, t = 1e-12) {
344
+ const e = G;
345
+ if (o === s) return !0;
346
+ if (!o || !s || o[e(426)] !== s[e(426)]) return !1;
347
+ for (let i = 0; i < o[e(426)]; i++) if (Math[e(430)](o[i] - s[i]) > t) return !1;
348
+ return !0;
349
+ }
350
+ function Mt(o, s, t, e) {
351
+ if (!Array[G(435)](o) || o.length < 2 || s <= t || s >= 1 - t) return !1;
352
+ for (const n of o) if (Math.abs(n - s) < e) return !1;
353
+ return !0;
354
+ }
355
+ function Me(o, s) {
356
+ const t = G, e = [...o, s];
357
+ return e[t(438)]((i, n) => i - n), e;
358
+ }
359
+ function Ce(o, s, t, e, i, n) {
360
+ const a = Mt(o, t, i, n), r = Mt(s, e, i, n);
361
+ if (!a && !r) return null;
362
+ const h = a ? Me(o, t) : [...o], x = r ? Me(s, e) : [...s];
363
+ return { newU: h, newV: x };
364
+ }
365
+ function Ae(o, s, t = 1e-9) {
366
+ const e = G;
367
+ if (!Array[e(435)](o) || o[e(426)] < 3) return null;
368
+ const i = o[e(436)]((n, a) => a > 0 && a < o[e(426)] - 1 && Math.abs(n - s) < t);
369
+ return i < 0 ? null : o[e(432)]((n, a) => a !== i);
370
+ }
371
+ function ts(o, s, t, e, i = 1e-9) {
372
+ let n = null, a = null;
373
+ t != null && (n = Ae(o, t, i)), e != null && (a = Ae(s, e, i));
374
+ const r = n ?? o, h = a ?? s;
375
+ return { newU: [...r], newV: [...h], changed: n !== null || a !== null };
376
+ }
377
+ function Ct() {
378
+ const o = ["242996UcjFQx", "abs", "130nAnOXa", "filter", "489nxWfij", "1666315tkHuOj", "isArray", "findIndex", "27711eNJCMj", "sort", "5164hmnCXY", "77285Oitlpa", "45078tLCipz", "length", "632ZPeaTB", "793200mvrxFm"];
379
+ return Ct = function() {
380
+ return o;
381
+ }, Ct();
382
+ }
383
+ function At() {
384
+ const o = ["368935BvmPSK", "359409YWCDYo", "18gAUVUk", "tol", "847uIaCJd", "1827287nTXiwY", "30169dlIhOn", "8gqDvdx", "6136phlVdy", "77928ZatPlQ", "6980veoaju", "12eQKRyw", "length", "1206haQVPK", "abs"];
385
+ return At = function() {
386
+ return o;
387
+ }, At();
388
+ }
389
+ (function(o, s) {
390
+ const t = st, e = o();
391
+ for (; ; )
392
+ try {
393
+ if (parseInt(t(197)) / 1 * (-parseInt(t(198)) / 2) + parseInt(t(192)) / 3 + -parseInt(t(200)) / 4 + parseInt(t(191)) / 5 * (-parseInt(t(193)) / 6) + -parseInt(t(195)) / 7 * (-parseInt(t(199)) / 8) + -parseInt(t(189)) / 9 * (-parseInt(t(201)) / 10) + parseInt(t(196)) / 11 * (parseInt(t(202)) / 12) === s) break;
394
+ e.push(e.shift());
395
+ } catch {
396
+ e.push(e.shift());
397
+ }
398
+ })(At, 110740);
399
+ function Le(o, s, t) {
400
+ const e = st;
401
+ for (let i = 0; i < o[e(203)]; i++) if (Math[e(190)](o[i] - s) < t) return i;
402
+ return -1;
403
+ }
404
+ function st(o, s) {
405
+ const t = At();
406
+ return st = function(e, i) {
407
+ return e = e - 189, t[e];
408
+ }, st(o, s);
409
+ }
410
+ function es(o) {
411
+ const s = st, { oldU: t, oldV: e, oldG: i, newU: n, newV: a, sampleOld: r } = o, h = o[s(194)] ?? 1e-10, x = n[s(203)], c = a[s(203)], l = new Array(c);
412
+ for (let u = 0; u < c; u++) {
413
+ const f = a[u], b = Le(e, f, h), m = new Array(x);
414
+ for (let I = 0; I < x; I++) {
415
+ const d = n[I], p = Le(t, d, h);
416
+ if (b >= 0 && p >= 0) m[I] = { reuse: !0, node: i[b][p] };
417
+ else {
418
+ const y = r(d, f);
419
+ m[I] = { reuse: !1, x: y.x, y: y.y };
420
+ }
421
+ }
422
+ l[u] = m;
423
+ }
424
+ return l;
425
+ }
426
+ (function(o, s) {
427
+ const t = it, e = o();
428
+ for (; ; )
429
+ try {
430
+ if (-parseInt(t(241)) / 1 + parseInt(t(230)) / 2 * (parseInt(t(232)) / 3) + parseInt(t(236)) / 4 + -parseInt(t(229)) / 5 + parseInt(t(235)) / 6 + parseInt(t(239)) / 7 * (-parseInt(t(227)) / 8) + parseInt(t(234)) / 9 === s) break;
431
+ e.push(e.shift());
432
+ } catch {
433
+ e.push(e.shift());
434
+ }
435
+ })(Lt, 594146);
436
+ function Lt() {
437
+ const o = ["baseDy", "14084127sDqCJF", "4559826aWVToY", "1241004XjKQXX", "max", "baseDx", "2660SbVkMC", "min", "796631ZLfaRb", "6624lcDrDR", "length", "4820165FzuKQm", "68650gcsCKL", "moved", "3TEbHQl"];
438
+ return Lt = function() {
439
+ return o;
440
+ }, Lt();
441
+ }
442
+ function it(o, s) {
443
+ const t = Lt();
444
+ return it = function(e, i) {
445
+ return e = e - 227, t[e];
446
+ }, it(o, s);
447
+ }
448
+ function Te(o) {
449
+ const s = it;
450
+ return Math[s(237)](0, Math[s(240)](1, o));
451
+ }
452
+ function ss(o, s, t) {
453
+ const i = (b, m) => o(Te(b), Te(m)), n = i(s, t);
454
+ let a, r, h;
455
+ s <= 1e-3 ? (a = n, r = i(s + 1e-3, t), h = 1e-3) : s >= 1 - 1e-3 ? (a = i(s - 1e-3, t), r = n, h = 1e-3) : (a = i(s - 1e-3, t), r = i(s + 1e-3, t), h = 2 * 1e-3);
456
+ const x = { x: (r.x - a.x) / h, y: (r.y - a.y) / h };
457
+ let c, l, u;
458
+ t <= 1e-3 ? (c = n, l = i(s, t + 1e-3), u = 1e-3) : t >= 1 - 1e-3 ? (c = i(s, t - 1e-3), l = n, u = 1e-3) : (c = i(s, t - 1e-3), l = i(s, t + 1e-3), u = 2 * 1e-3);
459
+ const f = { x: (l.x - c.x) / u, y: (l.y - c.y) / u };
460
+ return { du: x, dv: f };
461
+ }
462
+ function is(o) {
463
+ const s = it, { uLines: t, vLines: e, grid: i, sampleOld: n } = o, a = e.length, r = t[s(228)];
464
+ for (let h = 0; h < a; h++) for (let x = 0; x < r; x++) {
465
+ const c = i[h][x], l = t[x], u = e[h], { du: f, dv: b } = ss(n, l, u), m = x < r - 1 ? t[x + 1] - t[x] : 0, I = x > 0 ? t[x] - t[x - 1] : 0, d = h < a - 1 ? e[h + 1] - e[h] : 0, p = h > 0 ? e[h] - e[h - 1] : 0, y = { dx: f.x * m / 3, dy: f.y * m / 3 }, M = { dx: -f.x * I / 3, dy: -f.y * I / 3 }, v = { dx: b.x * d / 3, dy: b.y * d / 3 }, g = { dx: -b.x * p / 3, dy: -b.y * p / 3 }, w = (P) => {
466
+ let T = null;
467
+ return P === "r" && x + 1 < r && (T = i[h][x + 1]), P === "l" && x - 1 >= 0 && (T = i[h][x - 1]), P === "d" && h + 1 < a && (T = i[h + 1][x]), P === "u" && h - 1 >= 0 && (T = i[h - 1][x]), T ? { dx: (T.x - c.x) / 3, dy: (T.y - c.y) / 3 } : { dx: 0, dy: 0 };
468
+ }, C = (P, T) => {
469
+ const N = s, E = c[P];
470
+ if (!E) return;
471
+ const R = w(P);
472
+ E.dx = T.dx - R.dx, E.dy = T.dy - R.dy, E[N(231)] = !0, E[N(238)] = 0, E[N(233)] = 0;
473
+ };
474
+ C("r", y), C("l", M), C("d", v), C("u", g);
475
+ }
476
+ }
477
+ (function(o, s) {
478
+ const t = W, e = o();
479
+ for (; ; )
480
+ try {
481
+ if (parseInt(t(121)) / 1 + -parseInt(t(118)) / 2 * (parseInt(t(139)) / 3) + parseInt(t(122)) / 4 * (-parseInt(t(135)) / 5) + parseInt(t(119)) / 6 + parseInt(t(134)) / 7 * (-parseInt(t(127)) / 8) + parseInt(t(133)) / 9 * (parseInt(t(124)) / 10) + -parseInt(t(125)) / 11 === s) break;
482
+ e.push(e.shift());
483
+ } catch {
484
+ e.push(e.shift());
485
+ }
486
+ })(Tt, 291417);
487
+ function W(o, s) {
488
+ const t = Tt();
489
+ return W = function(e, i) {
490
+ return e = e - 118, t[e];
491
+ }, W(o, s);
492
+ }
493
+ function F(o) {
494
+ const s = W;
495
+ return Math[s(136)](0, Math[s(130)](1, o));
496
+ }
497
+ function Se(o, s, t, e) {
498
+ const i = W;
499
+ let n = 0, a = 0, r = 1 / 0;
500
+ const h = 96, x = s.valid && Math[i(123)](s.x - t, s.y - e) < h;
501
+ if (x && (n = s.u, a = s.v), !x)
502
+ for (let d = 0; d <= 18; d++) {
503
+ const p = d / 18;
504
+ for (let y = 0; y <= 18; y++) {
505
+ const M = y / 18, v = o(M, p), g = Math[i(123)](v.x - t, v.y - e);
506
+ g < r && (r = g, n = M, a = p);
507
+ }
508
+ }
509
+ const c = x ? 0.05 : 1 / 18, l = 10;
510
+ for (let I = -l; I <= l; I++) {
511
+ const d = F(a + I / l * c);
512
+ for (let p = -l; p <= l; p++) {
513
+ const y = F(n + p / l * c), M = o(y, d), v = Math[i(123)](M.x - t, M.y - e);
514
+ v < r && (r = v, n = y, a = d);
515
+ }
516
+ }
517
+ let u = n, f = a;
518
+ for (let I = 0; I < 8; I++) {
519
+ const d = o(u, f), p = d.x - t, y = d.y - e;
520
+ if (Math.hypot(p, y) < 0.15) break;
521
+ const v = 1e-3, g = o(F(u + v), f), w = o(u, F(f + v)), C = (g.x - d.x) / v, P = (g.y - d.y) / v, T = (w.x - d.x) / v, N = (w.y - d.y) / v, E = C * C + P * P, R = C * T + P * N, U = T * T + N * N, B = E * U - R * R;
522
+ if (Math[i(132)](B) < 1e-9) break;
523
+ const j = -(C * p + P * y), q = -(T * p + N * y), Oe = (U * j - R * q) / B, Ve = (-R * j + E * q) / B;
524
+ u = F(u + Oe), f = F(f + Ve);
525
+ }
526
+ const b = o(u, f), m = Math.hypot(b.x - t, b.y - e);
527
+ return s.valid = !0, s.x = t, s.y = e, s.u = u, s.v = f, { u, v: f, dist: m };
528
+ }
529
+ const kt = 90;
530
+ function ns(o, s, t, e) {
531
+ const i = W;
532
+ let n = F(s), a = o(n), r = Math[i(123)](a.x - t, a.y - e), h = 1 / kt;
533
+ for (let x = 0; x < 12; x++) {
534
+ let c = !1;
535
+ for (const l of [-1, 1]) {
536
+ const u = F(n + l * h), f = o(u), b = Math[i(123)](f.x - t, f.y - e);
537
+ b < r && (r = b, a = f, n = u, c = !0);
538
+ }
539
+ if (c || (h *= 0.5), h < 1e-5) break;
540
+ }
541
+ return { t: n, d: r, p: a };
542
+ }
543
+ function Tt() {
544
+ const o = ["top", "45JAKpxi", "52174MUKmoM", "2266830BcpDFU", "length", "578587JagdxG", "3748MTCCng", "hypot", "59810mtYtRK", "3455705kymvqL", "find", "477816yuVlPR", "name", "right", "min", "axis", "abs", "774nCXHAL", "7aequCp", "2210SnVIty", "max", "cornerDist"];
545
+ return Tt = function() {
546
+ return o;
547
+ }, Tt();
548
+ }
549
+ function rs(o, s, t, e) {
550
+ var i;
551
+ const n = W, a = [{ name: n(138), fn: (b) => o(b, 0), axis: "u" }, { name: "bottom", fn: (b) => o(b, 1), axis: "u" }, { name: "left", fn: (b) => o(0, b), axis: "v" }, { name: n(129), fn: (b) => o(1, b), axis: "v" }];
552
+ let r = null;
553
+ for (const b of a)
554
+ for (let m = 0; m <= kt; m++) {
555
+ const I = m / kt, d = b.fn(I), p = Math[n(123)](d.x - t, d.y - e);
556
+ (!r || p < r.d) && (r = { edge: b[n(128)], axis: b[n(131)], t: I, d: p, x: d.x, y: d.y });
557
+ }
558
+ if (!r) return null;
559
+ const h = a[n(126)]((b) => b[n(128)] === r.edge), x = ns(h.fn, r.t, t, e);
560
+ r.t = x.t, r.d = x.d, r.x = x.p.x, r.y = x.p.y;
561
+ const c = s[n(120)], l = ((i = s[0]) == null ? void 0 : i[n(120)]) || 0, u = c && l ? [s[0][0], s[0][l - 1], s[c - 1][0], s[c - 1][l - 1]] : [];
562
+ let f = 1 / 0;
563
+ for (const b of u) f = Math[n(130)](f, Math[n(123)](b.x - t, b.y - e));
564
+ return r[n(137)] = f, r;
565
+ }
566
+ const _ = K;
567
+ (function(o, s) {
568
+ const t = K, e = o();
569
+ for (; ; )
570
+ try {
571
+ if (-parseInt(t(279)) / 1 * (parseInt(t(286)) / 2) + -parseInt(t(380)) / 3 + -parseInt(t(347)) / 4 * (-parseInt(t(392)) / 5) + parseInt(t(239)) / 6 * (parseInt(t(332)) / 7) + -parseInt(t(266)) / 8 + parseInt(t(336)) / 9 * (parseInt(t(411)) / 10) + parseInt(t(228)) / 11 * (-parseInt(t(216)) / 12) === s) break;
572
+ e.push(e.shift());
573
+ } catch {
574
+ e.push(e.shift());
575
+ }
576
+ })(St, 161124);
577
+ const ot = 44, Ne = 24, Pe = 18, Ee = 14, De = 60, Re = 5, os = 300, as = 14, hs = 18, at = 1e-4, ht = 0.02, X = 2976767, J = 16777215;
578
+ function ct(o) {
579
+ var s;
580
+ for (const t of o) for (const e of t) for (const i of ["r", "l", "u", "d"]) if ((s = e[i]) != null && s.moved) return !0;
581
+ return !1;
582
+ }
583
+ function lt(o) {
584
+ return Math.max(0, Math[K(313)](1, o));
585
+ }
586
+ function xt(o, s, t, e, i, n) {
587
+ return Ke(o, s, t, e, i, n, (a, r, h, x, c, l) => Ye(a, r, h, x, c, l));
588
+ }
589
+ function St() {
590
+ const o = ["_syncGPU", "isFinite", "push", "_onPointerDown", "dblLast", "_nb", "addEventListener", "_texResLow", "getTransformConfig", "7764dqtBbS", "_hitArm", "_translateAll", "sel", "cos", "_surfaceFn", "_updateHover", "24hPzKjW", "dragging", "clientX", "curve", "_domToLocal", "sort", "length", "baseDx", "_renderCtrl", "map", "baseScale", "keys", "reuse", "moved", "_pxToLocal", "Container", "material", "add", "showGuide", "grabbing", "now", "undefined", "pivot", "lineStyle", "nudgeSelected", "transformPoint", "_rawCorners", "min", "remove", "eventMode", "corners", "renderer", "_cornerPts", "curveCtrl", "_loadMeshData", "getBoundingClientRect", "global", "scaleX", "setTransformConfig", "ty0", "texture", "update", "pointerout", "lockAxis", "hover", "drawPolygon", "765989IWRUFp", "data", "lTex", "showCross", "166437ERvTEa", "_rebuildTexMesh", "pointermove", "addIndex", "atan2", "removeEventListener", "hitArea", "_fedToLocal", "getRelativeScale", "vLines", "restoreTransformState", "72ydbNLi", "type", "addChild", "restoreDeform", "Geometry", "setTranslateAbsolute", "hasMovedArms", "abs", "Graphics", "app", "transformConfig", "moveTo", "setControlPointsInteractive", "cursor", "newU", "hxOff", "pin", "baseDy", "cornerDist", "mapPositionToPoint", "scale", "setGuide", "drawCircle", "worldTransform", "_applyTopologyChange", "texRes", "width", "move", "texMesh", "screen", "clientY", "_insertVLineAt", "_hitNode", "400698mHfgIV", "newV", "rawCurveCtrl0", "tickerFn", "getTranslateAbsolute", "lineTo", "parent", "meshInstance", "applyInverse", "endFill", "_rotateAll", "_onWinMove", "79175JOfMnS", "_forEachNode", "vertices", "_hitThreshold", "needsUpdate", "_relScale", "_exportMeshBase", "ticker", "sortChildren", "arm", "rotation", "uLines", "shiftKey", "_center", "grid", "rawCorners0", "zIndex", "_rawCurveCtrl", "sortableChildren", "100ejZkKr", "scaleY", "_forEachArm", "_applyTransformToGrid", "pointerup", "translateX", "_addWinListeners", "height", "reduce", "_insertCross", "translateY", "pointercancel", "updateTransform", "removeChildren", "setScaleAbsoluteAxes", "inv", "left", "stopPropagation", "pivot0", "_onWinUp", "deleteSelectedControlPoint", "12upGsdr", "removeChild", "exportState", "texVerts", "sqrt", "flags", "winActive", "mesh", "grab", "sin", "valid", "crosshair", "1807289wbyGVU", "getMeshBounds", "setGuideMode", "Rectangle", "_removeWinListeners", "lCtrl", "aVertexPosition", "round", "node", "events", "containerRef", "12VVOhzC", "_scaleAll", "pointerId", "controllersEnabled", "Mesh", "activePointerId", "dist", "getBuffer", "_scheduleTick", "texParamCache", "Point", "clear", "_insertULineAt", "flipY", "destroy", "auto", "guideMode", "fitToLayer", "texGeom", "none", "creteMesh", "addAttribute", "_getWorldScale", "max", "flipX", "nativeEvent", "setInteractive", "1093256zyNzJp", "toLocal", "beginFill", "hypot"];
591
+ return St = function() {
592
+ return o;
593
+ }, St();
594
+ }
595
+ function ut(o, s, t) {
596
+ const e = t(s), i = e ? (e.x - o.x) / 3 : 0, n = e ? (e.y - o.y) / 3 : 0, a = Y(o, s);
597
+ return { x: o.x + i + a.dx, y: o.y + n + a.dy };
598
+ }
599
+ function K(o, s) {
600
+ const t = St();
601
+ return K = function(e, i) {
602
+ return e = e - 209, t[e];
603
+ }, K(o, s);
604
+ }
605
+ class ke {
606
+ constructor(s, t) {
607
+ L(this, ce), L(this, "uLines", [0, 1]), L(this, he, [0, 1]), L(this, ae, []), L(this, oe, !1), L(this, "sel", { vi: -1, ui: -1, arm: null }), L(this, re), L(this, ne), L(this, "gC", null), L(this, ie, null), L(this, se, null), L(this, ee, null), L(this, te, ot), L(this, $t, { texUArr: null, texVArr: null, texCols: -1, texRows: -1, texUSeg: null, texVSeg: null, texLU: null, texLV: null }), L(this, Zt, { valid: !1, x: 0, y: 0, u: 0.5, v: 0.5 }), L(this, Qt, { showCross: !1, showGuide: !0, guideMode: _(289) }), L(this, "hover", { valid: !1, u: 0.5, v: 0.5, x: 0, y: 0, t: 0 }), L(this, "containerRef"), L(this, Jt), L(this, qt, !1), L(this, Kt, 1), L(this, jt, null), L(this, "transformConfig", { translateX: 0, translateY: 0, rotation: 0, scale: 1, scaleX: 1, scaleY: 1, flipX: 1, flipY: 1 }), L(this, Wt, []), L(this, "_rawCurveCtrl", []), L(this, "activePointerId", null), L(this, Gt, null), L(this, zt, !1), L(this, Ht, { t: 0, x: 0, y: 0 }), L(this, Bt, !1), L(this, Ft), L(this, Vt, (i) => {
608
+ var n, a;
609
+ const r = _;
610
+ if (!this[r(287)] || this[r(244)] != null && i[r(241)] !== this[r(244)]) return;
611
+ const { x: h, y: x } = this[r(290)](i), c = h - this[r(287)].ox, l = x - this[r(287)].oy;
612
+ if (this.dragging[r(348)] === r(223)) {
613
+ const u = h - this.dragging.ox, f = x - this[r(287)].oy, b = this.dragging.grid0;
614
+ if (b)
615
+ for (let m = 0; m < this[r(345)][r(292)]; m++) for (let I = 0; I < this[r(403)][r(292)]; I++) {
616
+ const d = (n = b[m]) == null ? void 0 : n[I], p = (a = this[r(406)][m]) == null ? void 0 : a[I];
617
+ !d || !p || (p.x = d.x + u, p.y = d.y + f);
618
+ }
619
+ this.dragging[r(407)] && (this[r(312)] = this.dragging[r(407)][r(295)]((m) => ({ x: m.x + u, y: m.y + f }))), this.dragging.rawCurveCtrl0 && (this[r(409)] = this[r(287)][r(382)][r(295)]((m) => ({ x: m.x + u, y: m.y + f }))), this[r(287)][r(213)] && (this[r(308)] = { x: this[r(287)].pivot0.x + u, y: this[r(287)][r(213)].y + f }), this[r(357)][r(416)] = (this[r(287)].tx0 ?? this[r(357)].translateX) + u, this.transformConfig[r(421)] = (this.dragging[r(325)] ?? this.transformConfig.translateY) + f;
620
+ } else if (this[r(287)][r(348)] === r(236)) {
621
+ let u = c, f = l;
622
+ i.shiftKey ? (this.dragging.lockAxis || (this[r(287)][r(329)] = Math[r(354)](c) >= Math[r(354)](l) ? "x" : "y"), this.dragging[r(329)] === "x" ? f = 0 : u = 0) : this[r(287)][r(329)] = null;
623
+ const b = this[r(406)][this[r(287)].vi][this[r(287)].ui];
624
+ b.x = (this[r(287)].px ?? b.x) + u, b.y = (this[r(287)].py ?? b.y) + f, b.pin = !0, this.hasMovedArms = ct(this[r(406)]);
625
+ const m = this.vLines.length, I = this[r(403)][r(292)], d = this[r(287)].vi, p = this[r(287)].ui;
626
+ if ((d === 0 || d === m - 1) && (p === 0 || p === I - 1)) {
627
+ const M = d === 0 && p === 0 ? 0 : d === 0 && p === I - 1 ? 1 : d === m - 1 && p === I - 1 ? 2 : 3;
628
+ this[r(312)][M] && (this[r(312)][M] = { x: b.x, y: b.y });
629
+ }
630
+ } else if (this[r(287)][r(348)] === r(401)) {
631
+ const u = this[r(406)][this[r(287)].vi][this[r(287)].ui], f = this[r(287)][r(401)];
632
+ u[f] || (u[f] = { dx: 0, dy: 0, moved: !1, baseDx: 0, baseDy: 0 });
633
+ const b = this._nb(this[r(287)].vi, this[r(287)].ui, f), m = b ? (b.x - u.x) / 3 : 0, I = b ? (b.y - u.y) / 3 : 0;
634
+ let d = h + (this[r(287)][r(362)] ?? 0), p = x + (this[r(287)].hyOff ?? 0);
635
+ if (i[r(404)]) {
636
+ const w = d - u.x, C = p - u.y, P = Math[r(269)](w, C);
637
+ if (P > 1e-6) {
638
+ const T = 10 * Math.PI / 180, N = Math[r(340)](C, w), E = Math[r(235)](N / T) * T;
639
+ d = u.x + P * Math[r(283)](E), p = u.y + P * Math[r(225)](E);
640
+ }
641
+ }
642
+ const y = d - u.x - m, M = p - u.y - I, v = Number(u[f][r(293)]) || 0, g = Number(u[f][r(364)]) || 0;
643
+ u[f].dx = v + y, u[f].dy = g + M, u[f][r(299)] = !0, this[r(353)] = !0;
644
+ }
645
+ this[r(247)]();
646
+ }), L(this, Ot, (i) => {
647
+ const n = _;
648
+ this[n(244)] != null && i[n(241)] !== this[n(244)] || (this[n(287)] = null, this[n(244)] = null, this[n(232)](), this._texResHigh(), this[n(270)](), this[n(242)] && this._renderCtrl(), this[n(375)] && (this[n(375)][n(360)] = "grab"));
649
+ }), L(this, "transformPoint", (i) => {
650
+ const n = _, a = this[n(405)](), { x: r, y: h } = this[n(308)] || a, x = this[n(357)].rotation * Math.PI / 180, c = Math[n(283)](x), l = Math[n(225)](x), u = this.transformConfig[n(367)] * this[n(357)][n(323)] * this[n(357)][n(263)], f = this[n(357)].scale * this[n(357)][n(412)] * this[n(357)][n(252)], b = (i.x - r) * u, m = (i.y - h) * f;
651
+ return { x: b * c - m * l + r + this.transformConfig.translateX, y: b * l + m * c + h + this.transformConfig[n(421)] };
652
+ });
653
+ const e = _;
654
+ this[e(356)] = s, this[e(334)] = new A[e(301)](), this[e(233)] = new A[e(301)]();
655
+ }
656
+ setContainer(s) {
657
+ const t = _;
658
+ this.containerRef = s, this[t(334)][t(424)](), this[t(233)].removeChildren();
659
+ try {
660
+ s[t(410)] = !0;
661
+ } catch {
662
+ }
663
+ this.lTex[t(408)] = 0, this[t(233)][t(408)] = 10, s[t(349)](this[t(334)], this.lCtrl);
664
+ try {
665
+ s[t(400)]();
666
+ } catch {
667
+ }
668
+ }
669
+ async [(ce = _(356), he = _(345), ae = _(406), oe = _(353), re = _(334), ne = _(233), ie = _(375), se = _(257), ee = _(219), te = _(372), $t = _(248), Zt = _(210), Qt = _(221), Jt = _(387), qt = _(242), Kt = _(296), jt = _(308), Wt = _(312), Gt = _(287), zt = _(222), Ht = _(274), Bt = _(396), Ft = _(383), _(259))](s) {
670
+ const t = _;
671
+ return this._rebuildTexMesh(s, ot), this[t(387)] = this[t(334)], this[t(334)];
672
+ }
673
+ [_(256)](s, t, e) {
674
+ const i = _, n = t[i(373)], a = t[i(418)], r = Math.max(s[i(373)] / n, s[i(418)] / a);
675
+ this.baseScale = e?.[i(296)] ?? Math.min(1, r);
676
+ const h = n * this.baseScale, x = a * this[i(296)], c = (s[i(373)] - h) / 2, l = (s.height - x) / 2;
677
+ if (this[i(308)] = { x: c + h / 2, y: l + x / 2 }, this[i(403)] = [0, 1], this[i(345)] = [0, 1], this[i(406)] = [[z(c, l, 0, 0, 2, 2, null), z(c + h, l, 1, 0, 2, 2, null)], [z(c, l + x, 0, 1, 2, 2, null), z(c + h, l + x, 1, 1, 2, 2, null)]], this.grid[0][0].pin = this.grid[0][1][i(363)] = this[i(406)][1][0][i(363)] = this[i(406)][1][1][i(363)] = !0, this.hasMovedArms = !1, this._rawCorners = [{ x: c, y: l }, { x: c + h, y: l }, { x: c + h, y: l + x }, { x: c, y: l + x }], this._rawCurveCtrl = [{ x: c + h * 0.33, y: l }, { x: c + h * 0.66, y: l }, { x: c + h, y: l + x * 0.33 }, { x: c + h, y: l + x * 0.66 }, { x: c + h * 0.66, y: l + x }, { x: c + h * 0.33, y: l + x }, { x: c, y: l + x * 0.66 }, { x: c, y: l + x * 0.33 }], this[i(357)] = { translateX: 0, translateY: 0, rotation: 0, scale: 1, scaleX: 1, scaleY: 1, flipX: 1, flipY: 1 }, e) {
678
+ const { scale: u, scaleX: f, scaleY: b, translateX: m, translateY: I, baseScale: d, ...p } = e;
679
+ Object[i(297)](p)[i(292)] && this[i(324)](p);
680
+ const y = f ?? u ?? void 0, M = b ?? u ?? void 0;
681
+ if ((y != null || M != null) && this[i(209)]({ scaleX: y, scaleY: M }), m != null || I != null) {
682
+ const v = this[i(384)]();
683
+ this[i(352)]({ x: m ?? v.x, y: I ?? v.y });
684
+ }
685
+ }
686
+ this._syncGPU();
687
+ }
688
+ [_(350)](s) {
689
+ var t, e;
690
+ const i = _;
691
+ if (s) {
692
+ if (Ge(s[i(223)])) {
693
+ this._loadMeshData(s[i(223)]);
694
+ return;
695
+ }
696
+ if ((((t = s[i(316)]) == null ? void 0 : t[i(292)]) ?? 0) >= 4 && (((e = s[i(319)]) == null ? void 0 : e[i(292)]) ?? 0) >= 8) {
697
+ const n = ze({ corners: s[i(316)], curveCtrl: s.curveCtrl });
698
+ this[i(312)] = s.corners.map((a) => ({ x: a.x, y: a.y })), this[i(409)] = s.curveCtrl.map((a) => ({ x: a.x, y: a.y })), this[i(320)](n);
699
+ return;
700
+ }
701
+ if (s.vertices && this[i(257)]) {
702
+ const n = s[i(394)], a = (this.texRes + 1) * (this[i(372)] + 1) * 2;
703
+ if (n[i(292)] !== a && this.texMesh) {
704
+ const h = Math[i(220)](n[i(292)] / 2), x = Math.round(h - 1);
705
+ if (Number.isFinite(h) && Math[i(354)](h - Math.round(h)) < 1e-6 && x >= 8 && x <= 96) {
706
+ const c = this[i(375)][i(302)][i(326)];
707
+ this[i(337)](c, x);
708
+ }
709
+ }
710
+ const r = (this[i(372)] + 1) * (this.texRes + 1) * 2;
711
+ if (n[i(292)] === r && this[i(257)]) {
712
+ const h = this[i(257)].getBuffer(i(234));
713
+ h[i(333)] = new Float32Array(n), h[i(327)]();
714
+ }
715
+ }
716
+ }
717
+ }
718
+ [_(218)]() {
719
+ const s = _, t = this[s(384)](), e = this._exportMeshBase();
720
+ return { baseScale: this.baseScale || 1, position: { x: t.x, y: t.y }, mesh: e };
721
+ }
722
+ [_(398)]() {
723
+ const s = _, t = [...this[s(403)]], e = [...this.vLines], i = this[s(357)], n = Number(i[s(416)]) || 0, a = Number(i.translateY) || 0, r = (Number(i[s(402)]) || 0) * Math.PI / 180, h = (Number(i[s(367)]) || 1) * (Number(i[s(323)]) || 1) * (Number(i[s(263)]) || 1), x = (Number(i[s(367)]) || 1) * (Number(i[s(412)]) || 1) * (Number(i.flipY) || 1), c = this.pivot ? { x: this.pivot.x - n, y: this[s(308)].y - a } : null, l = Math[s(283)](r), u = Math[s(225)](r), f = Math[s(354)](h) > 1e-9 ? 1 / h : 1, b = Math[s(354)](x) > 1e-9 ? 1 / x : 1, m = (p) => {
724
+ let y = p.x - n, M = p.y - a;
725
+ if (c) {
726
+ const v = y - c.x, g = M - c.y, w = v * l + g * u, C = -v * u + g * l;
727
+ y = c.x + w * f, M = c.y + C * b;
728
+ }
729
+ return { x: y, y: M };
730
+ }, I = (p) => {
731
+ const y = p.dx * l + p.dy * u, M = -p.dx * u + p.dy * l;
732
+ return { dx: y * f, dy: M * b };
733
+ }, d = this[s(406)][s(295)]((p) => p[s(295)]((y) => {
734
+ const M = s, v = m({ x: Number(y.x) || 0, y: Number(y.y) || 0 }), g = { x: v.x, y: v.y, pin: !!y[M(363)] };
735
+ for (const w of ["r", "l", "u", "d"]) {
736
+ const C = y?.[w];
737
+ if (!C) continue;
738
+ const P = I({ dx: Number(C.dx) || 0, dy: Number(C.dy) || 0 }), T = I({ dx: Number(C[M(293)]) || 0, dy: Number(C[M(364)]) || 0 });
739
+ g[w] = { dx: P.dx, dy: P.dy, baseDx: T.dx, baseDy: T.dy, moved: !!C.moved };
740
+ }
741
+ return g;
742
+ }));
743
+ return { uLines: t, vLines: e, grid: d };
744
+ }
745
+ [_(393)](s) {
746
+ const t = _;
747
+ for (let e = 0; e < this[t(345)].length; e++)
748
+ for (let i = 0; i < this.uLines[t(292)]; i++)
749
+ s(this[t(406)][e][i], e, i);
750
+ }
751
+ [_(413)](s, t) {
752
+ for (const e of ["r", "l", "u", "d"]) {
753
+ const i = s?.[e];
754
+ i && t(i);
755
+ }
756
+ }
757
+ [_(281)](s, t) {
758
+ const e = _;
759
+ !s && !t || (this[e(393)]((i) => {
760
+ i.x += s, i.y += t;
761
+ }), this[e(312)] = this[e(312)][e(295)]((i) => ({ x: i.x + s, y: i.y + t })), this._rawCurveCtrl = this[e(409)][e(295)]((i) => ({ x: i.x + s, y: i.y + t })), this[e(308)] && (this[e(308)] = { x: this[e(308)].x + s, y: this[e(308)].y + t }));
762
+ }
763
+ [_(390)](s) {
764
+ const t = _;
765
+ if (!s || !this.pivot) return;
766
+ const { x: e, y: i } = this[t(308)], n = Math[t(283)](s), a = Math[t(225)](s), r = (x) => {
767
+ const c = x.x - e, l = x.y - i;
768
+ return { x: c * n - l * a + e, y: c * a + l * n + i };
769
+ }, h = (x) => {
770
+ const c = x.dx, l = x.dy;
771
+ return { dx: c * n - l * a, dy: c * a + l * n };
772
+ };
773
+ this[t(393)]((x) => {
774
+ const c = t, l = r(x);
775
+ x.x = l.x, x.y = l.y, this[c(413)](x, (u) => {
776
+ const f = c, b = h({ dx: Number(u.dx) || 0, dy: Number(u.dy) || 0 }), m = h({ dx: Number(u[f(293)]) || 0, dy: Number(u.baseDy) || 0 });
777
+ u.dx = b.dx, u.dy = b.dy, u[f(293)] = m.dx, u[f(364)] = m.dy;
778
+ });
779
+ }), this[t(312)] = this._rawCorners[t(295)](r), this._rawCurveCtrl = this[t(409)][t(295)](r);
780
+ }
781
+ _scaleAll(s, t) {
782
+ const e = _;
783
+ if (!s && !t || !this[e(308)] || s === 1 && t === 1) return;
784
+ const { x: i, y: n } = this[e(308)], a = (r) => ({ x: i + (r.x - i) * s, y: n + (r.y - n) * t });
785
+ this[e(393)]((r) => {
786
+ const h = e, x = a(r);
787
+ r.x = x.x, r.y = x.y, this[h(413)](r, (c) => {
788
+ const l = h;
789
+ c.dx = (Number(c.dx) || 0) * s, c.dy = (Number(c.dy) || 0) * t, c[l(293)] = (Number(c[l(293)]) || 0) * s, c.baseDy = (Number(c[l(364)]) || 0) * t;
790
+ });
791
+ }), this._rawCorners = this[e(312)][e(295)](a), this[e(409)] = this._rawCurveCtrl[e(295)](a);
792
+ }
793
+ [_(324)](s) {
794
+ const t = _, e = { ...this[t(357)] }, i = { ...this[t(357)], ...s }, n = (i.translateX ?? 0) - (e[t(416)] ?? 0), a = (i[t(421)] ?? 0) - (e[t(421)] ?? 0);
795
+ (n || a) && this._translateAll(n, a);
796
+ const r = (i[t(402)] ?? 0) - (e[t(402)] ?? 0);
797
+ r && this[t(390)](r * Math.PI / 180);
798
+ const h = (e[t(367)] ?? 1) * (e[t(323)] ?? 1) * (e[t(263)] ?? 1), x = (e.scale ?? 1) * (e[t(412)] ?? 1) * (e[t(252)] ?? 1), c = (i.scale ?? 1) * (i[t(323)] ?? 1) * (i[t(263)] ?? 1), l = (i[t(367)] ?? 1) * (i[t(412)] ?? 1) * (i.flipY ?? 1), u = Math[t(354)](h) > 1e-9 ? c / h : 1, f = Math[t(354)](x) > 1e-9 ? l / x : 1;
799
+ (u !== 1 || f !== 1) && this[t(240)](u, f), this[t(357)] = i, this[t(270)](), this.controllersEnabled && this[t(294)]();
800
+ }
801
+ [_(278)]() {
802
+ return { ...this.transformConfig, baseScale: this.baseScale };
803
+ }
804
+ [_(344)](s) {
805
+ return (s || this[_(296)] || 1) / (this.baseScale || 1);
806
+ }
807
+ [_(229)]() {
808
+ const s = _;
809
+ if (!this.grid[s(292)]) return { minX: 0, minY: 0, maxX: 0, maxY: 0, width: 0, height: 0, valid: !1 };
810
+ let t = 1 / 0, e = 1 / 0, i = -1 / 0, n = -1 / 0;
811
+ for (const a of this[s(406)]) for (const r of a) {
812
+ if (!r) continue;
813
+ const h = Number(r.x) || 0, x = Number(r.y) || 0;
814
+ h < t && (t = h), x < e && (e = x), h > i && (i = h), x > n && (n = x);
815
+ }
816
+ return !Number[s(271)](t) || !Number[s(271)](e) || !Number[s(271)](i) || !Number[s(271)](n) ? { minX: 0, minY: 0, maxX: 0, maxY: 0, width: 0, height: 0, valid: !1 } : { minX: t, minY: e, maxX: i, maxY: n, width: Math[s(262)](0, i - t), height: Math[s(262)](0, n - e), valid: !0 };
817
+ }
818
+ [_(346)](s) {
819
+ const t = _;
820
+ s && (this[t(357)] = { ...this.transformConfig, ...s });
821
+ }
822
+ [_(209)](s) {
823
+ const t = _, e = {};
824
+ s.scaleX != null && (e[t(323)] = s[t(323)] / (this.baseScale || 1)), s.scaleY != null && (e[t(412)] = s[t(412)] / (this[t(296)] || 1)), this[t(324)](e);
825
+ }
826
+ [_(384)]() {
827
+ const s = this._cornerPts();
828
+ let t = 1 / 0, e = 1 / 0;
829
+ for (const i of s)
830
+ i.x < t && (t = i.x), i.y < e && (e = i.y);
831
+ return { x: t, y: e };
832
+ }
833
+ setTranslateAbsolute(s) {
834
+ const t = _, e = this[t(384)]();
835
+ this[t(324)]({ translateX: this[t(357)].translateX + (s.x - e.x), translateY: this[t(357)].translateY + (s.y - e.y) });
836
+ }
837
+ [_(265)](s) {
838
+ const t = _;
839
+ this[t(375)] && (this[t(375)][t(315)] = s ? "static" : "none", this[t(375)][t(360)] = s ? t(224) : "default"), this.lTex[t(315)] = t(s ? 254 : 258);
840
+ }
841
+ [_(359)](s) {
842
+ }
843
+ showControllers(s, t = !1) {
844
+ var e;
845
+ const i = _;
846
+ if (this[i(242)] = s, !s)
847
+ this[i(282)] = { vi: -1, ui: -1, arm: null }, this[i(330)][i(226)] = !1, (e = this.gC) == null || e[i(250)](), this[i(375)] && (this[i(375)][i(342)] = null);
848
+ else {
849
+ if (this[i(238)]) {
850
+ this[i(233)][i(408)] = Math.max(this[i(233)][i(408)] || 0, 10), this[i(238)][i(349)](this.lCtrl);
851
+ try {
852
+ this.containerRef[i(410)] = !0;
853
+ } catch {
854
+ }
855
+ try {
856
+ this[i(238)][i(400)]();
857
+ } catch {
858
+ }
859
+ }
860
+ this._renderCtrl();
861
+ }
862
+ }
863
+ [_(368)](s, t) {
864
+ const e = _;
865
+ this[e(221)][e(304)] = !!s, t && (this[e(221)].guideMode = e(t === "screen" ? 376 : 289)), this.flags[e(304)] || (this[e(330)][e(226)] = !1), this[e(242)] && this[e(294)]();
866
+ }
867
+ [_(230)](s) {
868
+ const t = _;
869
+ this[t(368)](this[t(221)][t(304)], s);
870
+ }
871
+ setCrossOverlay(s) {
872
+ const t = _;
873
+ this[t(221)][t(335)] = !!s, this[t(242)] && this[t(294)]();
874
+ }
875
+ [_(310)](s, t) {
876
+ var e;
877
+ const i = _;
878
+ if (!this[i(406)][i(292)] || this[i(282)].vi < 0 || this[i(282)].ui < 0 || this[i(282)][i(401)]) return !1;
879
+ const n = (e = this[i(406)][this[i(282)].vi]) == null ? void 0 : e[this[i(282)].ui];
880
+ return n ? (n[i(363)] = !0, n.x += s, n.y += t, this[i(247)](), !0) : !1;
881
+ }
882
+ [_(215)]() {
883
+ const s = _;
884
+ if (!this[s(406)][s(292)] || this[s(282)].vi < 0 || this.sel.ui < 0) return !1;
885
+ const t = this[s(345)][s(292)], e = this[s(403)][s(292)], i = this[s(282)].ui > 0 && this[s(282)].ui < e - 1, n = this[s(282)].vi > 0 && this[s(282)].vi < t - 1;
886
+ if (!i && !n) return !1;
887
+ const a = i ? this[s(403)][this[s(282)].ui] : null, r = n ? this[s(345)][this[s(282)].vi] : null, h = ts(this.uLines, this[s(345)], a, r, 1e-9);
888
+ if (!h.changed) return !1;
889
+ const x = this._applyTopologyChange(h.newU, h[s(381)]);
890
+ return x && (this.sel = { vi: -1, ui: -1, arm: null }), x;
891
+ }
892
+ dispose() {
893
+ var s, t, e;
894
+ const i = _;
895
+ this[i(232)](), this[i(383)] && (this[i(356)].ticker[i(314)](this[i(383)]), this[i(383)] = void 0);
896
+ try {
897
+ (s = this.texMesh) == null || s[i(253)]({ children: !0, texture: !1, baseTexture: !1 });
898
+ } catch {
899
+ }
900
+ try {
901
+ (t = this[i(257)]) == null || t.destroy();
902
+ } catch {
903
+ }
904
+ this[i(375)] = null, this[i(257)] = null, this[i(219)] = null;
905
+ try {
906
+ (e = this.gC) == null || e[i(253)]();
907
+ } catch {
908
+ }
909
+ this.gC = null, this[i(387)] = void 0, this[i(334)][i(386)] && this[i(334)][i(386)].removeChild(this[i(334)]), this[i(233)].parent && this.lCtrl[i(386)][i(217)](this.lCtrl);
910
+ }
911
+ [_(261)](s) {
912
+ const t = _, e = s[t(370)];
913
+ if (!e) return { x: 1, y: 1 };
914
+ const i = Math[t(220)](e.a * e.a + e.c * e.c), n = Math[t(220)](e.b * e.b + e.d * e.d);
915
+ return { x: i || 1, y: n || 1 };
916
+ }
917
+ _pxToLocal(s) {
918
+ const t = _;
919
+ try {
920
+ this.lCtrl[t(423)]();
921
+ } catch {
922
+ }
923
+ const { x: e, y: i } = this._getWorldScale(this[t(233)]), n = Math[t(262)](1e-6, Math[t(313)](e || 1, i || 1));
924
+ return s / n;
925
+ }
926
+ [_(337)](s, t) {
927
+ var e, i;
928
+ const n = _;
929
+ try {
930
+ (e = this[n(375)]) == null || e[n(253)]({ children: !0, texture: !1, baseTexture: !1 });
931
+ } catch {
932
+ }
933
+ try {
934
+ (i = this[n(257)]) == null || i[n(253)]();
935
+ } catch {
936
+ }
937
+ this[n(334)][n(424)](), this[n(372)] = t;
938
+ const a = t, r = t;
939
+ this[n(219)] = new Float32Array((a + 1) * (r + 1) * 2);
940
+ const h = new Float32Array((a + 1) * (r + 1) * 2);
941
+ let x = 0;
942
+ for (let u = 0; u <= r; u++) for (let f = 0; f <= a; f++)
943
+ h[x++] = f / a, h[x++] = u / r;
944
+ const c = [], l = a + 1;
945
+ for (let u = 0; u < r; u++) for (let f = 0; f < a; f++) {
946
+ const b = u * l + f, m = b + 1, I = (u + 1) * l + f, d = I + 1;
947
+ c[n(272)](b, m, I, m, d, I);
948
+ }
949
+ this[n(257)] = new A[n(351)]()[n(260)](n(234), this[n(219)], 2).addAttribute("aTextureCoord", h, 2)[n(339)](c), this[n(375)] = new A[n(243)](this[n(257)], new A.MeshMaterial(s)), this[n(375)][n(315)] = "static", this[n(375)][n(360)] = n(224), this[n(334)][n(349)](this[n(375)]), this[n(270)](), this[n(375)].on("pointerdown", (u) => {
950
+ const f = n;
951
+ u[f(212)](), this[f(244)] = u.pointerId, this._onPointerDown(u);
952
+ }), this[n(375)].on(n(338), (u) => {
953
+ const f = n;
954
+ if (this.dragging) return;
955
+ const b = u.nativeEvent, { x: m, y: I } = b ? this[f(290)](b) : this[f(343)](u[f(322)]);
956
+ if (this.controllersEnabled) {
957
+ const d = this[f(280)](m, I), p = d ? null : this[f(379)](m, I);
958
+ this[f(375)] && (this.texMesh[f(360)] = f(d ? 227 : p ? 374 : 224));
959
+ } else this[f(375)] && (this[f(375)].cursor = "grab");
960
+ this.controllersEnabled && this[f(221)].showGuide && this._updateHover(m, I);
961
+ }), this.texMesh.on(n(328), () => {
962
+ const u = n;
963
+ this[u(287)] || this[u(375)] && (this[u(375)][u(360)] = u(224));
964
+ });
965
+ }
966
+ _syncGPU() {
967
+ const s = _;
968
+ if (!this[s(257)] || !this[s(406)][s(292)] || !this[s(219)]) return;
969
+ const t = this[s(372)], e = this[s(372)];
970
+ Je(this[s(248)], this.uLines, this[s(345)], t, e), Ze({ texVerts: this[s(219)], cache: this[s(248)], grid: this[s(406)], cols: t, rows: e, moved: this.hasMovedArms }), this[s(257)][s(246)](s(234)).update();
971
+ }
972
+ [_(294)]() {
973
+ var s;
974
+ const t = _;
975
+ if (!this[t(233)]) return;
976
+ !this.gC && (this.gC = new A[t(355)](), this.lCtrl[t(349)](this.gC));
977
+ const e = this.gC;
978
+ if (e[t(250)](), !this[t(406)][t(292)]) return;
979
+ const i = (d) => this._pxToLocal(d), n = 1.3, a = 0.85, r = 1.5, h = 1, x = 1.5, c = this[t(353)], l = (d, p) => xt(this[t(403)], this.vLines, this[t(406)], d, p, c), u = (d) => {
980
+ const p = t;
981
+ let y = !0;
982
+ for (let M = 0; M <= De; M++) {
983
+ const v = d(M / De);
984
+ y ? (e[p(358)](v.x, v.y), y = !1) : e[p(385)](v.x, v.y);
985
+ }
986
+ }, f = (d) => {
987
+ e.lineStyle(i(n), X, 0.95), u(d);
988
+ };
989
+ f((d) => l(d, 0)), f((d) => l(1, d)), f((d) => l(d, 1)), f((d) => l(0, d));
990
+ const b = (d) => {
991
+ e[t(309)](i(n), X, 0.95), u(d);
992
+ };
993
+ for (const d of this.uLines) d > 1e-6 && d < 1 - 1e-6 && b((p) => l(d, p));
994
+ for (const d of this[t(345)]) d > 1e-6 && d < 1 - 1e-6 && b((p) => l(p, d));
995
+ if (this.flags[t(304)] && this.hover[t(226)])
996
+ if (e[t(309)](i(a), X, 0.22), this[t(221)][t(255)] === t(376)) {
997
+ let d = 1 / 0, p = 1 / 0, y = -1 / 0, M = -1 / 0;
998
+ for (const C of this.grid) for (const P of C)
999
+ P.x < d && (d = P.x), P.y < p && (p = P.y), P.x > y && (y = P.x), P.y > M && (M = P.y);
1000
+ const v = 160, g = this[t(330)].x, w = this[t(330)].y;
1001
+ e.moveTo(d - v, w), e[t(385)](y + v, w), e[t(358)](g, p - v), e.lineTo(g, M + v);
1002
+ } else {
1003
+ const d = this[t(330)].u, p = this[t(330)].v;
1004
+ u((y) => l(d, y)), u((y) => l(y, p));
1005
+ }
1006
+ if (this.flags[t(335)]) {
1007
+ const y = i(7);
1008
+ e[t(309)](i(2.2), J, 0.65);
1009
+ for (let M = 0; M <= 18; M++) for (let v = 0; v <= 18; v++) {
1010
+ const g = v / 18, w = M / 18, C = l(g, w);
1011
+ e[t(358)](C.x - y, C.y), e.lineTo(C.x + y, C.y), e[t(358)](C.x, C.y - y), e[t(385)](C.x, C.y + y);
1012
+ }
1013
+ e[t(309)](i(1.2), X, 0.85);
1014
+ for (let M = 0; M <= 18; M++) for (let v = 0; v <= 18; v++) {
1015
+ const g = v / 18, w = M / 18, C = l(g, w);
1016
+ e.moveTo(C.x - y, C.y), e[t(385)](C.x + y, C.y), e[t(358)](C.x, C.y - y), e[t(385)](C.x, C.y + y);
1017
+ }
1018
+ }
1019
+ const m = this[t(345)].length, I = this.uLines[t(292)];
1020
+ if (this[t(242)] && this[t(375)]) {
1021
+ let d = 1 / 0, p = 1 / 0, y = -1 / 0, M = -1 / 0;
1022
+ for (let v = 0; v < m; v++) for (let g = 0; g < I; g++) {
1023
+ const w = this.grid[v][g];
1024
+ w && (w.x < d && (d = w.x), w.y < p && (p = w.y), w.x > y && (y = w.x), w.y > M && (M = w.y));
1025
+ }
1026
+ if (this[t(282)].vi >= 0 && this[t(282)].ui >= 0) {
1027
+ const v = (s = this[t(406)][this[t(282)].vi]) == null ? void 0 : s[this[t(282)].ui];
1028
+ if (v) for (const g of ft(this[t(282)].vi, this[t(282)].ui, m, I)) {
1029
+ const w = ut(v, g, (C) => this[t(275)](this.sel.vi, this.sel.ui, C));
1030
+ w.x < d && (d = w.x), w.y < p && (p = w.y), w.x > y && (y = w.x), w.y > M && (M = w.y);
1031
+ }
1032
+ }
1033
+ if (Number[t(271)](d) && Number.isFinite(p) && Number.isFinite(y) && Number[t(271)](M)) {
1034
+ const v = i(Math.max(Pe, Ee) + 18);
1035
+ this[t(375)][t(342)] = new A[t(231)](d - v, p - v, Math[t(262)](1, y - d + v * 2), Math[t(262)](1, M - p + v * 2));
1036
+ }
1037
+ }
1038
+ for (let d = 0; d < m; d++) for (let p = 0; p < I; p++) {
1039
+ const y = this.grid[d][p], M = (d === 0 || d === m - 1) && (p === 0 || p === I - 1), v = d === 0 || d === m - 1 || p === 0 || p === I - 1, g = d === this[t(282)].vi && p === this[t(282)].ui;
1040
+ if (v) {
1041
+ const w = i(5), C = y.x - w, P = y.y - w, T = w * 2, N = w * 2;
1042
+ e.lineStyle(i(g ? x : h), X, 0.98), e[t(268)](g ? X : J, 0.98), e.drawRect(C, P, T, N), e[t(389)]();
1043
+ } else {
1044
+ const w = i(5.5);
1045
+ e[t(309)](i(g ? x : h), X, 0.98), e[t(268)](g ? X : J, 0.98), e[t(369)](y.x, y.y, w), e[t(389)]();
1046
+ }
1047
+ if (g) {
1048
+ const w = ft(d, p, m, I);
1049
+ for (const C of w) {
1050
+ if (!this[t(275)](d, p, C)) continue;
1051
+ const T = ut(y, C, (U) => this[t(275)](d, p, U)), N = this[t(282)][t(401)] === C;
1052
+ e[t(309)](i(r), X, 0.98), e[t(358)](y.x, y.y), e[t(385)](T.x, T.y), e[t(309)](i(h), X, 0.98), e[t(268)](N ? X : J, 0.98);
1053
+ const E = i(Re);
1054
+ e[t(331)]([T.x, T.y - E, T.x + E, T.y, T.x, T.y + E, T.x - E, T.y]), e[t(389)](), e[t(309)](i(0.95), J, 0.7);
1055
+ const R = i(Re + 0.5);
1056
+ e[t(331)]([T.x, T.y - R, T.x + R, T.y, T.x, T.y + R, T.x - R, T.y]);
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ _nb(s, t, e) {
1062
+ var i, n, a, r;
1063
+ const h = _;
1064
+ return e === "r" ? ((i = this[h(406)][s]) == null ? void 0 : i[t + 1]) ?? null : e === "l" ? ((n = this.grid[s]) == null ? void 0 : n[t - 1]) ?? null : e === "d" ? ((a = this.grid[s + 1]) == null ? void 0 : a[t]) ?? null : e === "u" ? ((r = this[h(406)][s - 1]) == null ? void 0 : r[t]) ?? null : null;
1065
+ }
1066
+ [_(379)](s, t) {
1067
+ const e = _, i = this[e(300)](Pe);
1068
+ for (let n = 0; n < this[e(345)].length; n++) for (let a = 0; a < this[e(403)][e(292)]; a++) {
1069
+ const r = this.grid[n][a];
1070
+ if (Math[e(269)](s - r.x, t - r.y) < i) return { vi: n, ui: a };
1071
+ }
1072
+ return null;
1073
+ }
1074
+ [_(280)](s, t) {
1075
+ const e = _;
1076
+ if (this[e(282)].vi < 0) return null;
1077
+ const i = this.grid[this[e(282)].vi][this.sel.ui], n = this[e(300)](Ee);
1078
+ for (const a of ft(this[e(282)].vi, this[e(282)].ui, this[e(345)][e(292)], this[e(403)].length)) {
1079
+ const r = ut(i, a, (h) => this[e(275)](this[e(282)].vi, this[e(282)].ui, h));
1080
+ if (Math[e(269)](s - r.x, t - r.y) < n) return a;
1081
+ }
1082
+ return null;
1083
+ }
1084
+ [_(343)](s) {
1085
+ const t = _;
1086
+ if (this[t(238)]) {
1087
+ const e = this[t(238)].toLocal(s);
1088
+ return { x: e.x, y: e.y };
1089
+ }
1090
+ return { x: s.x, y: s.y };
1091
+ }
1092
+ [_(290)](s) {
1093
+ var t;
1094
+ const e = _, i = (t = this.app[e(317)]) == null ? void 0 : t[e(237)];
1095
+ if (i?.[e(366)]) {
1096
+ const x = new A[e(249)]();
1097
+ if (i[e(366)](x, s[e(288)], s.clientY), this[e(238)]) {
1098
+ const c = this[e(238)][e(267)](x);
1099
+ return { x: c.x, y: c.y };
1100
+ }
1101
+ return { x: x.x, y: x.y };
1102
+ }
1103
+ const n = this[e(356)].view, a = n[e(321)]();
1104
+ if (!a || a[e(373)] <= 0) return { x: s[e(288)], y: s.clientY };
1105
+ const r = (s[e(288)] - a[e(211)]) * (this[e(356)][e(317)].width / a.width), h = (s[e(377)] - a.top) * (this[e(356)].renderer[e(418)] / a[e(418)]);
1106
+ if (this[e(238)]) {
1107
+ this[e(238)][e(423)]();
1108
+ const x = this[e(238)][e(370)][e(388)]({ x: r, y: h });
1109
+ return { x: x.x, y: x.y };
1110
+ }
1111
+ return { x: r, y: h };
1112
+ }
1113
+ [_(273)](s) {
1114
+ const t = _, e = s[t(264)], { x: i, y: n } = e ? this[t(290)](e) : this._fedToLocal(s[t(322)]), a = Date[t(306)](), r = a - this.dblLast.t < os && Math.hypot(i - this[t(274)].x, n - this[t(274)].y) < 15;
1115
+ if (this[t(274)] = { t: a, x: i, y: n }, r && this[t(242)] && !this.dragging) {
1116
+ const x = this._hitNode(i, n), c = this._hitArm(i, n);
1117
+ if (!x && !c) {
1118
+ this._insertLinesAt(i, n) && this._renderCtrl();
1119
+ return;
1120
+ }
1121
+ }
1122
+ if (this[t(242)]) {
1123
+ const x = this[t(280)](i, n);
1124
+ if (x) {
1125
+ const l = this.grid[this[t(282)].vi][this[t(282)].ui], u = l[x] || { dx: 0, dy: 0 }, f = ut(l, x, (b) => this._nb(this[t(282)].vi, this[t(282)].ui, b));
1126
+ this[t(282)].arm = x, this[t(287)] = { type: t(401), vi: this[t(282)].vi, ui: this[t(282)].ui, arm: x, ox: i, oy: n, odx: u.dx || 0, ody: u.dy || 0, hxOff: f.x - i, hyOff: f.y - n, lockAxis: null }, this[t(294)](), this[t(417)](), this._texResLow();
1127
+ return;
1128
+ }
1129
+ const c = this[t(379)](i, n);
1130
+ if (c) {
1131
+ this.sel = { vi: c.vi, ui: c.ui, arm: null };
1132
+ const l = this[t(406)][c.vi][c.ui];
1133
+ this[t(287)] = { type: t(236), vi: c.vi, ui: c.ui, ox: i, oy: n, px: l.x, py: l.y, lockAxis: null }, this[t(294)](), this[t(417)](), this[t(277)]();
1134
+ return;
1135
+ }
1136
+ this.sel = { vi: -1, ui: -1, arm: null }, this._renderCtrl();
1137
+ }
1138
+ const h = this[t(406)][t(295)]((x) => x[t(295)]((c) => ({ x: c.x, y: c.y })));
1139
+ this[t(287)] = { type: t(223), ox: i, oy: n, grid0: h, rawCorners0: this[t(312)].map((x) => ({ x: x.x, y: x.y })), rawCurveCtrl0: this[t(409)].map((x) => ({ x: x.x, y: x.y })), pivot0: this[t(308)] ? { x: this[t(308)].x, y: this.pivot.y } : null, tx0: this.transformConfig[t(416)], ty0: this[t(357)][t(421)], lockAxis: null }, this[t(375)] && (this[t(375)][t(360)] = t(305)), this[t(417)]();
1140
+ }
1141
+ [_(417)]() {
1142
+ const s = _;
1143
+ this[s(222)] || (this[s(222)] = !0, window[s(276)](s(338), this[s(391)], { passive: !0 }), window[s(276)](s(415), this[s(214)]), window.addEventListener(s(422), this[s(214)]));
1144
+ }
1145
+ [_(232)]() {
1146
+ const s = _;
1147
+ this[s(222)] && (this[s(222)] = !1, window[s(341)](s(338), this[s(391)]), window[s(341)]("pointerup", this[s(214)]), window[s(341)](s(422), this[s(214)]));
1148
+ }
1149
+ [(Vt = _(391), Ot = _(214), _(247))]() {
1150
+ const s = _;
1151
+ this[s(396)] = !0, !this.tickerFn && (this.tickerFn = () => {
1152
+ const t = s;
1153
+ this.needsUpdate && (this[t(396)] = !1, this[t(270)](), this[t(242)] && this[t(294)]());
1154
+ }, this.app[s(399)][s(303)](this[s(383)]));
1155
+ }
1156
+ [_(277)]() {
1157
+ const s = _;
1158
+ this[s(375)] && this.texRes !== Ne && this._rebuildTexMesh(this[s(375)][s(302)][s(326)], Ne);
1159
+ }
1160
+ _texResHigh() {
1161
+ const s = _;
1162
+ this[s(375)] && this.texRes !== ot && this[s(337)](this.texMesh.material[s(326)], ot);
1163
+ }
1164
+ [_(395)](s, t) {
1165
+ const e = _;
1166
+ let i = 1 / 0, n = 1 / 0, a = -1 / 0, r = -1 / 0;
1167
+ for (const l of this[e(406)]) for (const u of l)
1168
+ u.x < i && (i = u.x), u.y < n && (n = u.y), u.x > a && (a = u.x), u.y > r && (r = u.y);
1169
+ const h = Math[e(262)](0, a - i), x = Math[e(262)](0, r - n), c = Math[e(313)](h, x);
1170
+ return Math.max(this[e(300)](36), c * 0.1);
1171
+ }
1172
+ [_(285)](s, t) {
1173
+ const e = _, i = typeof performance !== e(307) && performance[e(306)] ? performance[e(306)]() : Date.now(), n = i - (this[e(330)].t || 0), a = Math[e(269)](s - (this[e(330)].x || 0), t - (this[e(330)].y || 0));
1174
+ if (!(n > 28 || a > 2 || !this[e(330)][e(226)])) return;
1175
+ if (this[e(330)].x = s, this[e(330)].y = t, this[e(330)].t = i, this[e(221)].guideMode === e(376)) {
1176
+ this[e(330)][e(226)] || (this.hover[e(226)] = !0), this[e(247)]();
1177
+ return;
1178
+ }
1179
+ const r = this._surfaceFn(), h = Se(r, this[e(210)], s, t), x = this._hitThreshold(s, t);
1180
+ if (!!(h && h.dist < x)) {
1181
+ const l = Math[e(354)]((this[e(330)].u || 0) - h.u), u = Math.abs((this[e(330)].v || 0) - h.v);
1182
+ this[e(330)].u = h.u, this.hover.v = h.v, !this[e(330)][e(226)] || l > 1e-4 || u > 1e-4 ? (this.hover.valid = !0, this[e(247)]()) : this[e(330)][e(226)] = !0;
1183
+ } else this[e(330)].valid && (this[e(330)][e(226)] = !1, this._scheduleTick());
1184
+ }
1185
+ _surfaceFn() {
1186
+ const s = _, t = this.hasMovedArms;
1187
+ return (e, i) => xt(this.uLines, this[s(345)], this[s(406)], e, i, t);
1188
+ }
1189
+ [_(251)](s) {
1190
+ const t = _;
1191
+ if (!Mt(this[t(403)], s, at, ht)) return !1;
1192
+ const e = [...this[t(403)], s][t(291)]((i, n) => i - n);
1193
+ return this[t(371)](e, [...this[t(345)]]);
1194
+ }
1195
+ _insertVLineAt(s) {
1196
+ const t = _;
1197
+ if (!Mt(this[t(345)], s, at, ht)) return !1;
1198
+ const e = [...this.vLines, s][t(291)]((i, n) => i - n);
1199
+ return this[t(371)]([...this[t(403)]], e);
1200
+ }
1201
+ _insertLinesAt(s, t) {
1202
+ const e = _;
1203
+ if (!this[e(406)][e(292)]) return !1;
1204
+ const i = this[e(284)](), n = rs(i, this[e(406)], s, t), a = this[e(300)](as), r = this[e(300)](hs);
1205
+ if (n && n.d <= a && n[e(365)] > r) return n.axis === "u" ? this[e(251)](n.t) : this[e(378)](n.t);
1206
+ const h = Se(i, this[e(210)], s, t), x = this[e(395)](s, t);
1207
+ if (!h || !(h[e(245)] < x)) return !1;
1208
+ const c = Ce(this[e(403)], this[e(345)], h.u, h.v, at, ht);
1209
+ return c ? this._applyTopologyChange(c[e(361)], c[e(381)]) : !1;
1210
+ }
1211
+ [_(420)](s, t) {
1212
+ const e = _, i = Ce(this.uLines, this[e(345)], s, t, at, ht);
1213
+ i && this[e(371)](i[e(361)], i[e(381)]);
1214
+ }
1215
+ _insertU(s) {
1216
+ this[_(251)](s);
1217
+ }
1218
+ _insertV(s) {
1219
+ this[_(378)](s);
1220
+ }
1221
+ [_(320)](s) {
1222
+ const t = _, e = $e(s);
1223
+ this[t(403)] = e[t(403)], this[t(345)] = e[t(345)];
1224
+ const i = e[t(345)][t(292)], n = e[t(403)][t(292)];
1225
+ this.grid = e.grid[t(295)]((a, r) => a[t(295)]((h, x) => z(h.x, h.y, x, r, n, i, h))), this[t(353)] = ct(this[t(406)]);
1226
+ {
1227
+ let a = 1 / 0, r = 1 / 0, h = -1 / 0, x = -1 / 0;
1228
+ for (const c of this[t(406)]) for (const l of c)
1229
+ l.x < a && (a = l.x), l.y < r && (r = l.y), l.x > h && (h = l.x), l.y > x && (x = l.y);
1230
+ Number.isFinite(a) && Number[t(271)](r) && Number.isFinite(h) && Number[t(271)](x) && (this[t(308)] = { x: (a + h) / 2, y: (r + x) / 2 });
1231
+ }
1232
+ this[t(330)].valid = !1, this[t(210)][t(226)] = !1, this[t(270)](), this.controllersEnabled && this[t(294)]();
1233
+ }
1234
+ [_(371)](s, t) {
1235
+ const e = _, i = [...this[e(403)]], n = [...this[e(345)]], a = this[e(406)];
1236
+ if (we(i, s, 1e-12) && we(n, t, 1e-12)) return !1;
1237
+ const r = ct(a), h = (f, b) => xt(i, n, a, lt(f), lt(b), r), x = es({ oldU: i, oldV: n, oldG: a, newU: s, newV: t, sampleOld: h, tol: 1e-10 }), c = s[e(292)], l = t[e(292)], u = new Array(l);
1238
+ for (let f = 0; f < l; f++) {
1239
+ const b = new Array(c);
1240
+ for (let m = 0; m < c; m++) {
1241
+ const I = x[f][m];
1242
+ if (I[e(298)]) {
1243
+ const d = I[e(236)];
1244
+ b[m] = z(d.x, d.y, m, f, c, l, d);
1245
+ } else b[m] = z(I.x, I.y, m, f, c, l, null);
1246
+ }
1247
+ u[f] = b;
1248
+ }
1249
+ if (this[e(403)] = [...s], this.vLines = [...t], this[e(406)] = u, this[e(210)][e(226)] = !1, this[e(330)][e(226)] = !1, r) {
1250
+ const f = (b, m) => xt(i, n, a, lt(b), lt(m), !0);
1251
+ is({ uLines: this[e(403)], vLines: this.vLines, grid: this[e(406)], sampleOld: f }), this[e(353)] = !0;
1252
+ } else this.hasMovedArms = ct(this[e(406)]);
1253
+ return this[e(270)](), this[e(242)] && this[e(294)](), !0;
1254
+ }
1255
+ [_(414)]() {
1256
+ const s = _;
1257
+ if (!this[s(406)][s(292)]) return;
1258
+ const t = this.vLines.length, e = this[s(403)][s(292)];
1259
+ for (let i = 0; i < t; i++) for (let n = 0; n < e; n++) {
1260
+ const a = this[s(406)][i][n];
1261
+ if (!a[s(363)] || !((i === 0 || i === t - 1) && (n === 0 || n === e - 1))) continue;
1262
+ const h = i === 0 && n === 0 ? 0 : i === 0 && n === e - 1 ? 1 : i === t - 1 && n === e - 1 ? 2 : 3, x = this[s(312)][h];
1263
+ if (!x) continue;
1264
+ const c = this[s(311)](x);
1265
+ a.x = c.x, a.y = c.y;
1266
+ }
1267
+ }
1268
+ _center() {
1269
+ const s = _, t = this[s(318)]();
1270
+ return t[s(292)] ? { x: t[s(419)]((e, i) => ({ x: e.x + i.x }), { x: 0 }).x / t.length, y: t[s(419)]((e, i) => ({ y: e.y + i.y }), { y: 0 }).y / t[s(292)] } : { x: 0, y: 0 };
1271
+ }
1272
+ [_(318)]() {
1273
+ const s = _, t = (n) => {
1274
+ const a = K, r = this[a(311)](n);
1275
+ return { x: r.x, y: r.y };
1276
+ };
1277
+ if (!this[s(406)][s(292)]) return this[s(312)][s(295)](t);
1278
+ const e = this[s(345)][s(292)], i = this[s(403)][s(292)];
1279
+ return [{ x: this[s(406)][0][0].x, y: this[s(406)][0][0].y }, { x: this[s(406)][0][i - 1].x, y: this[s(406)][0][i - 1].y }, { x: this[s(406)][e - 1][i - 1].x, y: this[s(406)][e - 1][i - 1].y }, { x: this[s(406)][e - 1][0].x, y: this.grid[e - 1][0].y }];
1280
+ }
1281
+ [_(397)](s) {
1282
+ const t = _;
1283
+ return s == null ? 1 : s / (this[t(296)] || 1);
1284
+ }
1285
+ }
1286
+ const S = Pt;
1287
+ (function(o, s) {
1288
+ const t = Pt, e = o();
1289
+ for (; ; )
1290
+ try {
1291
+ if (parseInt(t(148)) / 1 * (-parseInt(t(139)) / 2) + -parseInt(t(171)) / 3 + parseInt(t(250)) / 4 + -parseInt(t(186)) / 5 * (-parseInt(t(215)) / 6) + -parseInt(t(253)) / 7 * (-parseInt(t(261)) / 8) + -parseInt(t(144)) / 9 * (parseInt(t(204)) / 10) + parseInt(t(181)) / 11 === s) break;
1292
+ e.push(e.shift());
1293
+ } catch {
1294
+ e.push(e.shift());
1295
+ }
1296
+ })(Nt, 515235);
1297
+ function Nt() {
1298
+ const o = ["color", "14591181fHptga", "SpriteMaskFilter", "image/webp", "addChild", "_v2", "2785mSwRLU", "sortChildren", "resizeHandler", "_boundKeydown", "baseScale", "tint", "push", "Sprite", "textarea", "all", "translateY", "screen", "number", "flipY", "showControllers", "flipX", "set", "valid", "107560vuWZuT", "export", "removeBg", "getTransformConfig", "addImage", "bind", "vertices", "children", "prop", "image", "activeElement", "3606JAWaRU", "devicePixelRatio", "toLowerCase", "opacity", "clientWidth", "orig", "subdiv", "restoreTransformState", "prepare", "cache", "hotkeys", "keydown", "getTranslateAbsolute", "getBlendMode", "clear", "update", "Assets", "ArrowLeft", "fromURL", "Backspace", "blendMode", "Application", "alpha", "renderable", "load", "frame", "removeChild", "setHighlight", "MULTIPLY", "texture", "extract", "includes", "BaseTextureCache", "setPreferences", "off", "238836godiAx", "get", "shiftKey", "105IrEEHV", "ArrowRight", "keyboardControlHandler", "height", "stage", "BLEND_MODES", "bgSize", "corners", "232248qHyXJu", "buildMeshAndApplyLayer", "activeLayerName", "delete", "forEach", "mesh", "scaleY", "config", "TextureCache", "filters", "setTransformConfig", "resize", "startsWith", "layers", "sortableChildren", "SCALE_MODES", "map", "textureSize", "sqrt", "offscreenRender", "create", "parent", "from", "rotation", "anonymous", "enableEventControl", "composeColoredLayerToMultiplySprite", "renderer", "zIndex", "clientHeight", "translateX", "exportState", "selectLayer", "preventDefault", "Texture", "width", "addSticker", "value", "find", "destroy", "keys", "transform", "position", "entries", "ALPHA_MODES", "getState", "app", "container", "ArrowDown", "reset", "upload", "http", "RenderTexture", "scaleX", "has", "https", "addEventListener", "baseTexture", "scale", "utils", "setTranslateAbsolute", "渲染失败", "onOffscreenRender", "4mzzufN", "clearStage", "ArrowUp", "showHighlight", "filter", "9FZMTKH", "design", "Delete", "NO_PREMULTIPLIED_ALPHA", "470347oVrcMM", "toBlob", "setInteractive", "NORMAL", "originZIndex", "toggleHighlight", "blob:", "meshInstance", "deleteSelectedControlPoint", "moveStickerWhenNoSel", "nudgeSelected", "creteMesh", "highlightManager", "#fff", "enable", "name", "key", "render", "meshManager", "view", "max", "input", "tagName", "2069151aJgaqa", "maskTextureMap", "dispose", "Container", "stagePadding", "min", "floor", "length", "setScaleAbsoluteAxes"];
1299
+ return Nt = function() {
1300
+ return o;
1301
+ }, Nt();
1302
+ }
1303
+ A[S(231)][S(248)]({ crossOrigin: S(285) });
1304
+ const cs = (o) => {
1305
+ var s, t, e, i;
1306
+ const n = S, a = ((s = o?.[n(220)]) == null ? void 0 : s.width) || ((t = o?.[n(240)]) == null ? void 0 : t[n(111)]) || o?.[n(111)] || 0, r = ((e = o?.orig) == null ? void 0 : e[n(256)]) || ((i = o?.[n(240)]) == null ? void 0 : i.height) || o?.[n(256)] || 0;
1307
+ return { w: a, h: r };
1308
+ }, Xe = async (o, s = 10) => {
1309
+ var t;
1310
+ const e = S;
1311
+ for (let i = 0; i < s; i++) {
1312
+ const { w: n, h: a } = cs(o || void 0);
1313
+ if (n > 0 && a > 0 && ((t = o?.[e(133)]) != null && t[e(203)])) return { w: n, h: a };
1314
+ await new Promise((r) => requestAnimationFrame(() => r(null)));
1315
+ }
1316
+ return null;
1317
+ }, Ue = (o) => {
1318
+ var s, t;
1319
+ const e = S;
1320
+ try {
1321
+ o?.[e(133)] && (o[e(133)].alphaMode = A[e(120)][e(147)]);
1322
+ } catch {
1323
+ }
1324
+ try {
1325
+ (t = (s = o?.[e(133)]) == null ? void 0 : s[e(230)]) == null || t.call(s);
1326
+ } catch {
1327
+ }
1328
+ };
1329
+ function Pt(o, s) {
1330
+ const t = Nt();
1331
+ return Pt = function(e, i) {
1332
+ return e = e - 109, t[e];
1333
+ }, Pt(o, s);
1334
+ }
1335
+ class us {
1336
+ constructor(s, t = !1, e = {}) {
1337
+ L(this, "app"), L(this, ye), L(this, _e), L(this, "maskTextureMap"), L(this, "layers", /* @__PURE__ */ new Map()), L(this, de), L(this, fe), L(this, "subdiv"), L(this, ue), L(this, xe, { enabled: !0, meshNudge: !0, meshDeletePoint: !0, moveStickerWhenNoSel: !0 }), L(this, "_boundKeydown"), L(this, "resizeHandler", (n) => {
1338
+ var a, r;
1339
+ const h = S;
1340
+ this[h(122)][h(257)][h(118)][h(202)]((n?.width || this[h(122)][h(197)][h(111)]) / 2, (n?.[h(256)] || this[h(122)][h(197)][h(256)]) / 2);
1341
+ const x = Math[h(176)]((n?.[h(111)] || this[h(122)][h(197)][h(111)]) / (((a = this[h(259)]) == null ? void 0 : a[h(111)]) || this[h(122)][h(257)][h(111)]), (n?.[h(256)] || this[h(122)][h(197)][h(256)]) / (((r = this[h(259)]) == null ? void 0 : r[h(256)]) || this.app.stage[h(256)])) * this[h(175)];
1342
+ this[h(122)][h(257)][h(134)][h(202)](x);
1343
+ }), L(this, le, (n) => {
1344
+ const a = S, r = Object[a(116)](A[a(258)])[a(114)]((h) => h.toLowerCase() === n);
1345
+ if (r) return A.BLEND_MODES[r];
1346
+ });
1347
+ const i = S;
1348
+ this.app = new A[i(236)]({ width: s instanceof HTMLElement ? s[i(219)] : s.width, height: s instanceof HTMLElement ? s[i(290)] : s[i(256)], antialias: !0, resolution: window[i(216)] || 1, autoDensity: !0, resizeTo: s instanceof HTMLElement ? s : void 0, backgroundColor: i(161), backgroundAlpha: t ? 0 : 1, preserveDrawingBuffer: t }), this[i(122)].stage[i(275)] = !0, this[i(280)] = t, this[i(160)] = new He(this[i(122)]), this[i(172)] = /* @__PURE__ */ new Map(), this[i(221)] = e[i(221)] || 24, this[i(175)] = e[i(175)] || 1, this._boundKeydown = this[i(255)][i(209)](this), s instanceof HTMLElement && this.app.renderer.on("resize", (n, a) => {
1349
+ this[i(188)]({ width: n, height: a });
1350
+ });
1351
+ }
1352
+ get [(ye = S(160), _e = S(259), de = S(263), fe = S(280), ue = S(175), xe = S(225), S(167))]() {
1353
+ return this[S(122)].view;
1354
+ }
1355
+ async initState(s) {
1356
+ const t = S;
1357
+ try {
1358
+ const e = await A.Assets[t(239)](s), i = A[t(193)][t(283)](e);
1359
+ this[t(259)] = { width: i[t(111)], height: i[t(256)] }, this[t(122)][t(257)].pivot[t(202)](i[t(111)] / 2, i[t(256)] / 2), this.app.stage[t(118)][t(202)](this.app.screen[t(111)] / 2, this[t(122)][t(197)][t(256)] / 2);
1360
+ const n = Math[t(176)](this.app[t(197)][t(111)] / i.width, this.app.screen[t(256)] / i[t(256)]) * this[t(175)];
1361
+ this.app[t(257)][t(134)][t(202)](n), this[t(122)].stage[t(184)](i), this[t(286)]();
1362
+ } catch {
1363
+ }
1364
+ }
1365
+ async [S(208)](s, t = {}) {
1366
+ const e = S, i = new A.Container();
1367
+ t.name && (i[e(163)] = t.name), i.x = t.x || 0, i.y = t.y || 0, typeof t[e(289)] === e(198) && (i[e(289)] = t[e(289)]);
1368
+ const n = await A[e(231)][e(239)](s), a = A[e(193)].from(n);
1369
+ if (t.blendMode && (a[e(235)] = t[e(235)]), typeof t[e(218)] === e(198)) {
1370
+ const r = t[e(218)] > 1 ? t.opacity / 255 : t.opacity;
1371
+ a[e(237)] = Math[e(168)](0, Math[e(176)](1, r));
1372
+ }
1373
+ return t[e(180)] && (a[e(191)] = t[e(180)], a[e(235)] = t.blendMode ?? A[e(258)][e(151)]), i.addChild(a), !this[e(280)] && this.app[e(257)][e(184)](i), i;
1374
+ }
1375
+ async [S(262)](s, t, e) {
1376
+ var i, n, a, r, h, x;
1377
+ const c = S, l = await s[c(159)](e), u = t[c(278)] ?? ((i = t.config) == null ? void 0 : i.textureSize), f = e[c(111)] || 0, b = e[c(256)] || 0, m = u?.[0] || 0, I = u?.[1] || 0, d = m > 0 && I > 0 && f > 0 && b > 0 && (m !== f || I !== b), p = d ? m / f : 1, y = d ? I / b : 1, M = d ? Math[c(279)](p * y) : 1, v = (n = t[c(268)]) == null ? void 0 : n[c(266)], g = (a = t[c(268)]) == null ? void 0 : a[c(260)], w = (r = t[c(268)]) == null ? void 0 : r.curveCtrl, C = (h = t[c(268)]) == null ? void 0 : h[c(210)], P = (() => {
1378
+ var N;
1379
+ const E = c, R = (N = t[E(268)]) == null ? void 0 : N[E(117)];
1380
+ return !R || !d ? R : { ...R, ...typeof R[E(190)] === E(198) ? { baseScale: R[E(190)] * M } : {}, ...typeof R[E(134)] === E(198) ? { scale: R[E(134)] * M } : {}, ...typeof R[E(129)] === E(198) ? { scaleX: R.scaleX * p } : {}, ...typeof R[E(267)] === E(198) ? { scaleY: R[E(267)] * y } : {} };
1381
+ })();
1382
+ if (!!(v || g || w || C)) {
1383
+ s.fitToLayer({ width: t[c(111)], height: t[c(256)] }, e, { baseScale: P?.baseScale }), s.restoreDeform({ mesh: v, corners: g, curveCtrl: w, vertices: C });
1384
+ const N = P || {};
1385
+ if (!!v && N[c(185)] === !0) s[c(222)](N);
1386
+ else {
1387
+ const U = {};
1388
+ typeof N[c(284)] === c(198) && (U[c(284)] = N[c(284)]), typeof N[c(201)] === c(198) && (U.flipX = N[c(201)]), typeof N[c(199)] === c(198) && (U.flipY = N[c(199)]), Object[c(116)](U)[c(178)] && s[c(271)](U);
1389
+ const B = typeof N[c(129)] === c(198) ? N[c(129)] : typeof N[c(134)] === c(198) ? N[c(134)] : void 0, j = typeof N[c(267)] === c(198) ? N[c(267)] : typeof N.scale === c(198) ? N.scale : void 0;
1390
+ if ((B !== void 0 || j !== void 0) && s[c(179)]({ ...B !== void 0 ? { scaleX: B } : {}, ...j !== void 0 ? { scaleY: j } : {} }), typeof N[c(291)] === c(198) || typeof N[c(196)] === c(198)) {
1391
+ const q = s[c(227)]();
1392
+ s[c(136)]({ x: typeof N[c(291)] === c(198) ? N[c(291)] : q.x, y: typeof N.translateY === c(198) ? N[c(196)] : q.y });
1393
+ }
1394
+ }
1395
+ } else s.fitToLayer({ width: t[c(111)], height: t[c(256)] }, e, (x = t[c(268)]) == null ? void 0 : x[c(117)]);
1396
+ return l;
1397
+ }
1398
+ async addSticker(s, t) {
1399
+ var e, i;
1400
+ const n = S, a = new A[n(174)]();
1401
+ a[n(163)] = t[n(163)], typeof t[n(289)] === n(198) && (a.zIndex = t[n(289)]), a.position[n(202)](t.x, t.y);
1402
+ const r = new ke(this.app, this[n(221)]);
1403
+ r.setContainer(a);
1404
+ const [h, x] = await Promise.all([this[n(280)] || s instanceof ImageBitmap || s[n(273)](n(154)) ? s instanceof ImageBitmap ? A.Texture.from(s) : A[n(110)][n(233)](s) : A[n(231)][n(239)](s), A[n(231)][n(239)](t[n(213)])]);
1405
+ s instanceof ImageBitmap && (Ue(h), await Xe(h));
1406
+ const c = await this[n(262)](r, t, h), l = A[n(193)].from(x), u = new A[n(182)](l);
1407
+ if (u.blendMode = ((e = t[n(268)]) == null ? void 0 : e.blendMode) ?? A[n(258)].MULTIPLY, c[n(270)] = [u], a[n(184)](l), a.addChild(c), c[n(237)] = ((i = t[n(268)]) == null ? void 0 : i[n(218)]) ?? 1, l[n(238)] = !1, this[n(160)].toggleHighlight(!1), r.setInteractive(t[n(162)] ?? !1), r[n(200)](t[n(162)] ?? !1), t[n(162)] && (this.activeLayerName = t[n(163)]), t.toFront) {
1408
+ const f = Math.max(...this.app.stage[n(211)][n(277)]((b) => b[n(289)]));
1409
+ a[n(289)] = f + 1;
1410
+ }
1411
+ return this.layers[n(202)](t[n(163)], { container: a, meshManager: r, originZIndex: a.zIndex }), this[n(280)] ? a : (this.app[n(257)][n(184)](a), r.getTransformConfig());
1412
+ }
1413
+ async [S(287)](s, t, e, i, n = 1) {
1414
+ var a, r, h, x, c;
1415
+ const l = S, u = ((a = s.config) == null ? void 0 : a[l(235)]) ?? A.BLEND_MODES[l(243)], f = new A[l(174)]();
1416
+ f.position[l(202)](s.x * n, s.y * n), f[l(134)][l(202)](n);
1417
+ const b = new ke(this.app, this[l(221)]);
1418
+ b.setContainer(f);
1419
+ const [m, I] = await Promise.all([s.texture instanceof ImageBitmap ? A[l(110)][l(283)](s[l(244)]) : (r = s[l(244)]) != null && r[l(273)](l(131)) ? A[l(231)][l(239)](s[l(244)]) : A[l(110)][l(233)](s[l(244)]), A[l(231)][l(239)](s[l(213)])]);
1420
+ s[l(244)] instanceof ImageBitmap && (Ue(m), await Xe(m)), m[l(133)] && (m[l(133)].scaleMode = A[l(276)].LINEAR);
1421
+ const d = await this[l(262)](b, s, m), p = A[l(193)][l(283)](I), y = new A.SpriteMaskFilter(p);
1422
+ b[l(155)][l(270)] = [y], f[l(184)](p), p[l(238)] = !1;
1423
+ const M = A[l(193)][l(283)](I);
1424
+ M.tint = t, M[l(235)] = A[l(258)].NORMAL, u !== A[l(258)][l(151)] && f.addChild(M), f[l(184)](d), d[l(235)] = A[l(258)][l(151)], d[l(237)] = ((h = s[l(268)]) == null ? void 0 : h[l(218)]) ?? 1, await new Promise((w) => requestAnimationFrame(() => w(null))), (c = (x = this.app.renderer[l(223)]) == null ? void 0 : x[l(126)]) == null || c.call(x, f);
1425
+ const v = A[l(128)][l(281)]({ width: Math[l(177)](i[l(111)] * n), height: Math[l(177)](i[l(256)] * n) });
1426
+ this[l(122)].renderer[l(165)](f, { renderTexture: v, clear: !0 });
1427
+ const g = new A.Sprite(v);
1428
+ return g[l(235)] = u, g[l(289)] = e, b[l(173)](), f[l(115)]({ children: !0 }), g;
1429
+ }
1430
+ toggleControllers(s, t) {
1431
+ const e = S, i = this[e(274)].get(s);
1432
+ i && i.meshManager[e(200)](t, !0);
1433
+ }
1434
+ [S(293)](s) {
1435
+ const t = S;
1436
+ this[t(263)] = s;
1437
+ for (const [e, i] of this[t(274)][t(119)]()) {
1438
+ const n = e === s;
1439
+ i.meshManager[t(150)](n), i[t(166)].showControllers(n), i.container[t(289)] = n ? 9999 : i[t(152)] ?? 0;
1440
+ }
1441
+ s && (this.highlightManager[t(153)](!1), this.app.stage[t(187)]());
1442
+ }
1443
+ async removeSticker(s) {
1444
+ const t = S;
1445
+ if (!this.activeLayerName) return;
1446
+ const e = this[t(274)][t(251)](this.activeLayerName);
1447
+ e && (e[t(166)].setInteractive(!1), e[t(166)][t(200)](!1), e[t(166)][t(173)](), e[t(123)].parent && e[t(123)][t(282)][t(241)](e[t(123)]), e.container[t(115)]({ children: !0 }), this[t(274)][t(264)](this[t(263)]), this[t(142)](s));
1448
+ }
1449
+ async updateSticker(s) {
1450
+ const t = S;
1451
+ if (!this[t(263)]) return;
1452
+ const e = this.layers[t(251)](this.activeLayerName);
1453
+ if (e)
1454
+ if ([t(235), t(125)].includes(s[t(212)]) && (e.meshManager[t(155)][t(270)][0][t(235)] = s[t(212)] === "reset" ? A.BLEND_MODES[t(243)] : s.value), [t(218), t(125)][t(246)](s[t(212)]) && (e[t(166)][t(155)][t(237)] = s[t(212)] === "reset" ? 1 : s[t(113)]), s[t(212)] === "scale") {
1455
+ if (typeof s[t(113)] == "number") {
1456
+ const i = s.value;
1457
+ e.meshManager[t(179)]({ scaleX: i, scaleY: i });
1458
+ } else if (s.value && typeof s.value == "object") {
1459
+ const i = s.value, n = typeof i[t(134)] === t(198) ? i.scale : void 0, a = typeof i[t(129)] === t(198) ? i[t(129)] : n, r = typeof i[t(267)] === t(198) ? i.scaleY : n;
1460
+ (a !== void 0 || r !== void 0) && e[t(166)][t(179)]({ ...a !== void 0 ? { scaleX: a } : {}, ...r !== void 0 ? { scaleY: r } : {} });
1461
+ }
1462
+ } else
1463
+ ["scaleX", t(267)][t(246)](s.prop) ? e[t(166)][t(179)]({ [s[t(212)]]: s[t(113)] }) : s[t(212)] === t(125) ? e.meshManager[t(271)](s[t(113)]) : e[t(166)][t(271)]({ [s[t(212)]]: s.value });
1464
+ }
1465
+ async [S(142)](s) {
1466
+ const t = S, e = this[t(172)].has(s.name) ? this[t(172)][t(251)](s[t(163)]) : await A[t(231)][t(239)](s[t(213)]);
1467
+ !this[t(172)][t(130)](s[t(163)]) && this.maskTextureMap[t(202)](s[t(163)], e), this[t(160)][t(242)](e, { x: s.x, y: s.y }), this[t(293)]("");
1468
+ }
1469
+ [S(121)]() {
1470
+ const s = S;
1471
+ return Array[s(283)](this[s(274)].values()).map((t) => ({ ...t[s(166)][s(292)](), id: t[s(123)][s(163)] }));
1472
+ }
1473
+ hasChild(s) {
1474
+ const t = S;
1475
+ return this[t(122)][t(257)].getChildByName(s) !== null;
1476
+ }
1477
+ [S(140)]() {
1478
+ const s = S;
1479
+ this[s(122)][s(257)].removeChildren();
1480
+ }
1481
+ keyboardControlHandler(s) {
1482
+ const t = S;
1483
+ if (!this.hotkeys.enabled) return;
1484
+ const e = document[t(214)], i = e && e.tagName ? String(e[t(170)])[t(217)]() : "";
1485
+ if (i === t(169) || i === "select" || i === t(194) || !this[t(263)]) return;
1486
+ const n = this[t(274)][t(251)](this[t(263)]);
1487
+ if (!n) return;
1488
+ if (this.hotkeys.meshNudge && (s[t(164)] === t(141) || s[t(164)] === t(124) || s[t(164)] === "ArrowLeft" || s.key === t(254))) {
1489
+ const r = s[t(252)] ? 10 : 1;
1490
+ let h = 0, x = 0;
1491
+ if (s[t(164)] === "ArrowUp" && (x = -r), s[t(164)] === t(124) && (x = r), s[t(164)] === "ArrowLeft" && (h = -r), s[t(164)] === t(254) && (h = r), n.meshManager[t(158)](h, x)) {
1492
+ s.preventDefault();
1493
+ return;
1494
+ }
1495
+ }
1496
+ if (this[t(225)].meshDeletePoint && (s[t(164)] === t(146) || s.key === t(234)) && n[t(166)][t(156)]()) {
1497
+ s[t(109)]();
1498
+ return;
1499
+ }
1500
+ if (!this[t(225)][t(157)]) return;
1501
+ const a = s[t(252)] ? 20 : 5;
1502
+ switch (s[t(164)]) {
1503
+ case t(141):
1504
+ n[t(166)][t(271)]({ translateY: n[t(166)][t(207)]()[t(196)] - a }), s[t(109)]();
1505
+ break;
1506
+ case "ArrowDown":
1507
+ n[t(166)][t(271)]({ translateY: n[t(166)][t(207)]()[t(196)] + a }), s[t(109)]();
1508
+ break;
1509
+ case t(232):
1510
+ n.meshManager[t(271)]({ translateX: n[t(166)][t(207)]()[t(291)] - a }), s[t(109)]();
1511
+ break;
1512
+ case t(254):
1513
+ n[t(166)][t(271)]({ translateX: n[t(166)][t(207)]()[t(291)] + a }), s[t(109)]();
1514
+ break;
1515
+ }
1516
+ }
1517
+ async [(le = S(228), S(138))](s, t) {
1518
+ var e, i;
1519
+ const n = S, { color: a, scale: r = 1, cleanCache: h = !0, quality: x = 0.5, format: c = n(183) } = t, l = new A[n(174)]();
1520
+ l[n(275)] = !0;
1521
+ const u = s[n(114)]((d) => d.name === "bg");
1522
+ if (!u) return;
1523
+ const f = Math[n(177)](u.width * r), b = Math[n(177)](u[n(256)] * r);
1524
+ this.app[n(288)][n(272)](f, b);
1525
+ const m = [];
1526
+ let I = null;
1527
+ try {
1528
+ await Promise[n(195)](s[n(143)]((y) => !t[n(206)] || y[n(163)] !== "bg" && t[n(206)])[n(143)]((y) => !y[n(145)] || a || y[n(244)])[n(277)](async (y, M) => {
1529
+ var v, g;
1530
+ const w = n;
1531
+ if (y.design) {
1532
+ if (y.texture) {
1533
+ if (a) {
1534
+ const C = await this[w(287)](y, a, M, u, r);
1535
+ l[w(184)](C);
1536
+ } else {
1537
+ const C = await this[w(112)](y[w(244)], y);
1538
+ C[w(118)][w(202)](y.x * r, y.y * r), C[w(134)][w(202)](r), C[w(289)] = M, l[w(184)](C);
1539
+ }
1540
+ typeof y[w(244)] == "string" && m[w(192)](y[w(244)]);
1541
+ } else if (a) {
1542
+ const C = await this[w(208)](y[w(213)], { x: y.x * r, y: y.y * r, color: a, blendMode: A[w(258)].MULTIPLY, zIndex: M });
1543
+ C.scale[w(202)](r), l[w(184)](C);
1544
+ }
1545
+ } else {
1546
+ const C = y[w(205)] ? this[w(228)]((v = y[w(205)]) == null ? void 0 : v.blend) : void 0, P = y[w(205)] ? (g = y[w(205)]) == null ? void 0 : g[w(218)] : void 0, T = await this[w(208)](y.image, { x: y.x * r, y: y.y * r, zIndex: M, blendMode: C, opacity: P, name: y.name });
1547
+ T.scale[w(202)](r), l[w(184)](T);
1548
+ }
1549
+ })), await new Promise((y) => requestAnimationFrame(() => y(null))), (i = (e = this.app.renderer[n(223)]) == null ? void 0 : e[n(126)]) == null || i.call(e, l), I = A[n(128)][n(281)]({ width: f, height: b, alphaMode: A[n(120)][n(147)] }), this.app[n(288)].render(l, { renderTexture: I, clear: !0 });
1550
+ const d = this[n(122)][n(288)][n(245)].canvas(I), p = await new Promise((y) => {
1551
+ d[n(149)](y, c, x);
1552
+ });
1553
+ return l[n(115)]({ children: !0 }), I[n(115)](!0), m[n(265)]((y) => {
1554
+ const M = n;
1555
+ if (!y[M(273)](M(127)) || h) {
1556
+ const v = A[M(135)][M(247)][y];
1557
+ v && v.destroy(), delete A[M(135)][M(247)][y], delete A[M(135)].TextureCache[y];
1558
+ }
1559
+ }), p;
1560
+ } catch (d) {
1561
+ console.log(n(137), d), l.destroy({ children: !0, texture: !0, baseTexture: !0 }), I?.[n(115)](!0), m[n(265)]((p) => {
1562
+ const y = n;
1563
+ delete A[y(135)][y(247)][p], delete A[y(135)][y(269)][p];
1564
+ });
1565
+ return;
1566
+ }
1567
+ }
1568
+ enableEventControl() {
1569
+ const s = S;
1570
+ this[s(189)] || (this._boundKeydown = this.keyboardControlHandler[s(209)](this)), window[s(132)](s(226), this[s(189)]);
1571
+ }
1572
+ destroy() {
1573
+ const s = S;
1574
+ try {
1575
+ this[s(189)] && window.removeEventListener(s(226), this[s(189)]), this[s(274)][s(265)]((t) => {
1576
+ const e = s;
1577
+ t[e(166)][e(173)]();
1578
+ }), this[s(122)].renderer && this[s(122)][s(288)][s(249)]("resize"), this[s(274)][s(229)](), this[s(172)][s(265)]((t) => {
1579
+ t[s(115)](!0);
1580
+ }), this.maskTextureMap[s(229)](), this.app[s(115)](!0, { children: !0, texture: !0, baseTexture: !0 }), A[s(231)][s(224)][s(125)]();
1581
+ } catch {
1582
+ }
1583
+ }
1584
+ }
1585
+ const D = Et;
1586
+ (function(o, s) {
1587
+ const t = Et, e = o();
1588
+ for (; ; )
1589
+ try {
1590
+ if (-parseInt(t(364)) / 1 + parseInt(t(308)) / 2 + -parseInt(t(339)) / 3 * (-parseInt(t(354)) / 4) + parseInt(t(356)) / 5 * (parseInt(t(360)) / 6) + parseInt(t(381)) / 7 + parseInt(t(394)) / 8 + -parseInt(t(366)) / 9 === s) break;
1591
+ e.push(e.shift());
1592
+ } catch {
1593
+ e.push(e.shift());
1594
+ }
1595
+ })(Dt, 154268);
1596
+ function Et(o, s) {
1597
+ const t = Dt();
1598
+ return Et = function(e, i) {
1599
+ return e = e - 307, t[e];
1600
+ }, Et(o, s);
1601
+ }
1602
+ function Dt() {
1603
+ const o = ["setTarget", "lastIndexOf", "filter", "StandardMaterial", "setParent", "wAng", "hasOwnProperty", "WRAP_ADDRESSMODE", "updateTextureTransform", "addEventListener", "subtract", "274503hVInFy", "Texture", "vAng", "MinMax", "init", "Material", "runRenderLoop", "environmentTexture", "scene", "diffuseColor", "FromHexString", "string", "updateSamplingMode", "find", "radius", "8gfiZzr", "fov", "20PwloGO", "albedoColor", "material", "MeshBuilder", "310974vXTZjT", "root", "TRILINEAR_SAMPLINGMODE", "CubeTexture", "118407BURjIh", "TextureDirtyFlag", "4014234eWcdUn", "call", "function", "canvas", "getTotalVertices", "render", "computeWorldMatrix", "meshes", "scale", "vOffset", "forEach", "diffuseTexture", "getTransform", "devicePixelRatio", "name", "860930dCUNkC", "Engine", "prototype", "engine", "includes", "isVisible", "Mesh", "Color3", "dispose", "substring", "albedoTexture", "CreateFromPrefilteredData", "placeholder", "40896DDXVtO", "attachControl", "alpha", "PBRMaterial", "markAsDirty", "wrapU", "beta", "updateMaterialColor", "setEnvironment", "onResize", "400562Wwrxyn", "replaceTexture", "createDefaultSkybox", "max", "resize", "uAng", "vScale", "tan", "camera", "getMeshByName", "panningSensibility", "LINEAR_LINEAR_MIPLINEAR", "uOffset", "length", "scaling", "materialTextureMap", "uScale", "rootProxy", "removeEventListener", "add"];
1604
+ return Dt = function() {
1605
+ return o;
1606
+ }, Dt();
1607
+ }
1608
+ const ls = { u_offset: D(320), v_offset: D(375), u_scale: D(324), v_scale: D(314), u_ang: D(313), v_ang: D(341), w_ang: D(333) };
1609
+ class fs {
1610
+ constructor(s) {
1611
+ L(this, "scene"), L(this, Ie), L(this, ge), L(this, me), L(this, ve), L(this, be, {}), L(this, pe);
1612
+ const t = D;
1613
+ this[t(369)] = s;
1614
+ }
1615
+ [(Ie = D(369), ge = D(384), me = D(316), ve = D(361), be = D(323), pe = D(307), D(343))](s = {}) {
1616
+ const t = D, { adaptToDeviceRatio: e = !0, clearColor: i = new k.Color4(0.4, 0.4, 0.4, 1), envUrl: n, skyboxBlur: a = 0.6, envSamplingMode: r = k[t(340)].LINEAR_LINEAR_MIPLINEAR } = s;
1617
+ this[t(384)] = new k[t(382)](this[t(369)], !0, { preserveDrawingBuffer: !0, stencil: !0 }, e), this.engine.setHardwareScalingLevel(1 / (window[t(379)] || 1)), this.scene = new k.Scene(this.engine), this[t(347)].clearColor = i, this[t(316)] = new k.ArcRotateCamera("cam", Math.PI / 3, Math.PI / 2, 6, new k.Vector3(0, 0, 0), this[t(347)]), this[t(316)][t(395)](this.canvas, !0), this.camera.wheelPrecision = 50, this[t(316)][t(318)] = 50, n && this[t(402)](n, a, r), this[t(361)] = k[t(359)].CreateBox(t(325), { size: 1e-3 }, this[t(347)]), this[t(361)][t(386)] = !1, this[t(384)][t(345)](() => {
1618
+ const h = t;
1619
+ this[h(347)][h(371)]();
1620
+ }), this.onResize = () => this[t(384)] && this[t(384)].resize(), window[t(337)](t(312), this.onResize);
1621
+ }
1622
+ [D(402)](s, t = 0.6, e = k[D(340)][D(319)]) {
1623
+ const i = D, n = k[i(363)][i(392)](s, this[i(347)]);
1624
+ return n[i(351)](e), this[i(347)][i(346)] = n, this[i(347)][i(310)](n, !0, void 0, t), n;
1625
+ }
1626
+ async loadModel(s, t = {}) {
1627
+ const e = D, { targetSize: i = 2, orientHandleLeft: n = !0 } = t, a = s[e(390)](0, s[e(329)]("/") + 1), r = s[e(390)](s[e(329)]("/") + 1), { meshes: h } = await k.SceneLoader.ImportMeshAsync("", a, r, this[e(347)]), x = h[e(330)]((g) => g !== this[e(347)][e(317)](e(325)));
1628
+ x.forEach((g) => {
1629
+ const w = e;
1630
+ g.parent || g[w(332)](this[w(361)]);
1631
+ });
1632
+ let c = x[e(330)]((g) => typeof g.getBoundingInfo === e(368) && typeof g[e(370)] === e(368) && g.getTotalVertices() > 0);
1633
+ if (!c.length) {
1634
+ const g = k[e(359)].CreateBox(e(393), { size: 1 }, this[e(347)]);
1635
+ g[e(332)](this[e(361)]), c = [g];
1636
+ }
1637
+ c.forEach((g) => g[e(372)](!0));
1638
+ const { min: l, max: u } = k[e(387)][e(342)](c), f = u.subtract(l), b = Math[e(311)](f.x, f.y, f.z) || 1, m = i / b;
1639
+ this[e(361)][e(322)].set(m, m, m), c[e(376)]((g) => g[e(372)](!0));
1640
+ const { min: I, max: d } = k[e(387)][e(342)](c), p = I[e(327)](d)[e(374)](0.5), y = d[e(338)](I)[e(321)]() * 0.5 || 1;
1641
+ this[e(316)][e(328)](p);
1642
+ const M = this[e(316)][e(355)], v = y / Math[e(315)](M * 0.5);
1643
+ if (this[e(316)][e(353)] = v, n) {
1644
+ const g = d.x - p.x, w = p.x - I.x;
1645
+ this[e(316)][e(396)] = g >= w ? Math.PI / 2 : -Math.PI / 2, this[e(316)][e(400)] = Math.PI / 2;
1646
+ }
1647
+ return x;
1648
+ }
1649
+ [D(317)](s) {
1650
+ const t = D;
1651
+ return this.scene[t(373)][t(352)]((e) => e[t(358)] && e[t(358)][t(380)] === s);
1652
+ }
1653
+ getTransform(s = {}) {
1654
+ const t = D, e = {};
1655
+ return Object.keys(s)[t(376)]((i) => {
1656
+ e[ls[i]] = s[i];
1657
+ }), e;
1658
+ }
1659
+ updateTextureTransform(s, t) {
1660
+ var e, i;
1661
+ const n = D;
1662
+ t = this[n(378)](t);
1663
+ const a = this[n(317)](s), r = this[n(323)][s] || ((e = a?.[n(358)]) == null ? void 0 : e.albedoTexture) || ((i = a?.[n(358)]) == null ? void 0 : i.diffuseTexture);
1664
+ if (r) {
1665
+ for (const h in t)
1666
+ if (Object[n(383)][n(334)][n(367)](r, h)) {
1667
+ let x = t[h];
1668
+ typeof x === n(350) && (x = Number(x)), [n(313), n(341), "wAng"][n(385)](h) && (x = x * Math.PI / 180), r[h] = x;
1669
+ }
1670
+ r[n(399)] = k[n(340)][n(335)], r.wrapV = k.Texture.WRAP_ADDRESSMODE, a && a[n(358)] && a.material[n(398)](k[n(344)][n(365)]);
1671
+ }
1672
+ }
1673
+ [D(401)](s, t) {
1674
+ const e = D, i = this.scene.meshes[e(330)]((n) => n[e(358)] && s[e(385)](n[e(358)][e(380)]));
1675
+ i[e(321)] && (t[e(321)] === 4 && (t = "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]), i[e(376)]((n) => {
1676
+ const a = e;
1677
+ n[a(358)] instanceof k[a(397)] ? n[a(358)][a(357)] = k[a(388)][a(349)](t) : n[a(358)] instanceof k[a(331)] && (n[a(358)][a(348)] = k[a(388)][a(349)](t));
1678
+ }));
1679
+ }
1680
+ [D(309)](s, t, e = {}, i = !0) {
1681
+ const n = D, a = this[n(317)](t);
1682
+ if (a)
1683
+ return new Promise((r) => {
1684
+ const h = n, x = new k.Texture(s, this.scene, !1, !1, k[h(340)][h(362)], () => {
1685
+ const c = h;
1686
+ x.hasAlpha = !0, this.materialTextureMap[t] = x, e && this[c(336)](t, e), i && (a.material instanceof k[c(397)] ? a.material[c(391)] = x : a[c(358)] instanceof k[c(331)] && (a[c(358)][c(377)] = x), r(null));
1687
+ }, (c) => {
1688
+ r(null);
1689
+ });
1690
+ });
1691
+ }
1692
+ toggleTextureVisible(s, t) {
1693
+ const e = D, i = this[e(317)](s);
1694
+ i && (i[e(358)] instanceof k[e(397)] ? i[e(358)].albedoTexture = t ? this.materialTextureMap[s] : null : i[e(358)] instanceof k[e(331)] && (i[e(358)][e(377)] = t ? this[e(323)][s] : null));
1695
+ }
1696
+ [D(389)]() {
1697
+ const s = D;
1698
+ try {
1699
+ this.onResize && window[s(326)](s(312), this[s(307)]), this[s(347)] && this[s(347)][s(389)](), this[s(384)] && this.engine.dispose();
1700
+ } finally {
1701
+ }
1702
+ }
1703
+ }
1704
+ (function(o, s) {
1705
+ for (var t = Xt, e = o(); ; )
1706
+ try {
1707
+ var i = parseInt(t(349)) / 1 * (-parseInt(t(355)) / 2) + -parseInt(t(356)) / 3 + -parseInt(t(353)) / 4 * (parseInt(t(354)) / 5) + parseInt(t(350)) / 6 + parseInt(t(357)) / 7 * (parseInt(t(347)) / 8) + parseInt(t(352)) / 9 + -parseInt(t(351)) / 10 * (-parseInt(t(348)) / 11);
1708
+ if (i === s) break;
1709
+ e.push(e.shift());
1710
+ } catch {
1711
+ e.push(e.shift());
1712
+ }
1713
+ })(Rt, 999444);
1714
+ function Xt(o, s) {
1715
+ var t = Rt();
1716
+ return Xt = function(e, i) {
1717
+ e = e - 347;
1718
+ var n = t[e];
1719
+ return n;
1720
+ }, Xt(o, s);
1721
+ }
1722
+ function Rt() {
1723
+ var o = ["24485GwbYqT", "3289646BNyLGP", "5522325PxjYih", "750673aXXlPq", "104KNeldY", "440QmrrPa", "1KLupQr", "7830018hotbmS", "507710ggQFMO", "8858151udfdaa", "1004tuxNnk"];
1724
+ return Rt = function() {
1725
+ return o;
1726
+ }, Rt();
1727
+ }
1728
+ export {
1729
+ fs as Sticker3DPlugin,
1730
+ us as StickerPlugin
1731
+ };