build-dxf 0.0.20-9 → 0.0.21

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 (38) hide show
  1. package/README.md +3 -0
  2. package/package.json +6 -4
  3. package/src/build.d.ts +4 -0
  4. package/src/build.js +1403 -1922
  5. package/src/index.css +1 -649
  6. package/src/index.js +7 -7
  7. package/src/index2.js +327 -516
  8. package/src/index3.js +1798 -1841
  9. package/src/selectLocalFile.js +1960 -3146
  10. package/src/utils/CommandManager/CommandFlow.d.ts +17 -4
  11. package/src/utils/CommandManager/CommandManager.d.ts +11 -2
  12. package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +10 -0
  13. package/src/utils/DxfSystem/components/Dxf.d.ts +35 -5
  14. package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -1
  15. package/src/utils/DxfSystem/index.d.ts +2 -0
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +45 -0
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +15 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +9 -0
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +15 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +22 -4
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -2
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +14 -0
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +33 -0
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +13 -0
  27. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection copy.d.ts +82 -0
  28. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +43 -7
  29. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +21 -0
  30. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{mergeLine.d.ts → ViewAngle.d.ts} +5 -3
  31. package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +4 -1
  32. package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +4 -1
  33. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +3 -0
  34. package/src/utils/PointVirtualGrid/index.d.ts +8 -0
  35. package/src/utils/Quadtree/LineSegment.d.ts +34 -1
  36. package/src/utils/Quadtree/Point.d.ts +7 -1
  37. package/src/utils/Quadtree/Quadtree.d.ts +1 -1
  38. package/src/utils/deepClone.d.ts +6 -0
package/src/index3.js CHANGED
@@ -1,134 +1,73 @@
1
- import * as THREE from "three";
2
- import { i as isString, n as noop, r as resolveUnref, t as tryOnScopeDispose, c as isClient, d as tryOnMounted, e as identity, f as buildProps, g as definePropType, _ as _export_sfc$1, u as useNamespace, h as isNumber, j as addUnit, w as withInstall, k as useEmptyValuesProps, l as useSizeProp, p as provideGlobalConfig, m as iconPropType, o as useGlobalComponentSettings, T as TypeComponentsMap, q as ElIcon, s as TypeComponents, v as useTimeoutFn, x as isString$1, y as isFunction, z as isBoolean, A as isElement, B as withInstallFunction, L as Lines, D as DomEventRegister, b as ElCheckbox, E as ElButton, S as SelectLocalFile } from "./selectLocalFile.js";
3
- import { C as Component, L as LineSegment, P as Point, B as Box2, E as EventDispatcher, b as PointVirtualGrid, Q as Quadtree, W as WhiteModel } from "./build.js";
1
+ import * as m from "three";
2
+ import { i as mt, n as ht, r as Je, t as qe, c as De, d as ut, e as pt, f as Ae, g as G, _ as Ze, u as gt, h as ve, j as Be, w as vt, k as ft, l as yt, p as wt, m as bt, o as Ct, T as Ne, q as Re, s as xt, v as Et, x as Oe, y as Pe, z as ke, A as Mt, B as Lt, L as fe, D as kt, b as Fe, E as ue, S as It } from "./selectLocalFile.js";
3
+ import { C as Ce, L as W, P as V, B as Ye, E as Xe, b as Ke, Q as ze, u as Pt, W as Dt } from "./build.js";
4
4
  import "clipper-lib";
5
5
  import "dxf-writer";
6
6
  import "three/addons/controls/OrbitControls.js";
7
- import { watch, ref, defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, vShow, shallowReactive, onMounted, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, withModifiers, nextTick, isVNode, render, toRaw, onUnmounted, renderList, createStaticVNode, TransitionGroup, createApp } from "vue";
8
- function unrefElement(elRef) {
9
- var _a;
10
- const plain = resolveUnref(elRef);
11
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
7
+ import { watch as H, ref as A, defineComponent as ce, computed as P, createElementBlock as B, openBlock as I, normalizeClass as z, unref as g, renderSlot as we, createVNode as F, Transition as be, withCtx as T, withDirectives as $e, createElementVNode as k, normalizeStyle as _e, createTextVNode as ie, toDisplayString as re, vShow as et, shallowReactive as At, onMounted as tt, createBlock as pe, createCommentVNode as J, resolveDynamicComponent as _t, Fragment as ge, withModifiers as St, nextTick as ye, isVNode as nt, render as Te, toRaw as Bt, onUnmounted as Nt, renderList as Ie, createStaticVNode as Rt, TransitionGroup as Ot, createApp as Ft } from "vue";
8
+ function ot(r) {
9
+ var e;
10
+ const t = Je(r);
11
+ return (e = t?.$el) != null ? e : t;
12
12
  }
13
- const defaultWindow = isClient ? window : void 0;
14
- function useEventListener(...args) {
15
- let target;
16
- let events;
17
- let listeners;
18
- let options;
19
- if (isString(args[0]) || Array.isArray(args[0])) {
20
- [events, listeners, options] = args;
21
- target = defaultWindow;
22
- } else {
23
- [target, events, listeners, options] = args;
24
- }
25
- if (!target)
26
- return noop;
27
- if (!Array.isArray(events))
28
- events = [events];
29
- if (!Array.isArray(listeners))
30
- listeners = [listeners];
31
- const cleanups = [];
32
- const cleanup = () => {
33
- cleanups.forEach((fn) => fn());
34
- cleanups.length = 0;
13
+ const st = De ? window : void 0;
14
+ function Kt(...r) {
15
+ let e, t, n, o;
16
+ if (mt(r[0]) || Array.isArray(r[0]) ? ([t, n, o] = r, e = st) : [e, t, n, o] = r, !e)
17
+ return ht;
18
+ Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
19
+ const s = [], a = () => {
20
+ s.forEach((l) => l()), s.length = 0;
21
+ }, d = (l, h, w, p) => (l.addEventListener(h, w, p), () => l.removeEventListener(h, w, p)), i = H(() => [ot(e), Je(o)], ([l, h]) => {
22
+ a(), l && s.push(...t.flatMap((w) => n.map((p) => d(l, w, p, h))));
23
+ }, { immediate: !0, flush: "post" }), c = () => {
24
+ i(), a();
35
25
  };
36
- const register = (el, event, listener, options2) => {
37
- el.addEventListener(event, listener, options2);
38
- return () => el.removeEventListener(event, listener, options2);
39
- };
40
- const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
41
- cleanup();
42
- if (!el)
43
- return;
44
- cleanups.push(...events.flatMap((event) => {
45
- return listeners.map((listener) => register(el, event, listener, options2));
46
- }));
47
- }, { immediate: true, flush: "post" });
48
- const stop = () => {
49
- stopWatch();
50
- cleanup();
51
- };
52
- tryOnScopeDispose(stop);
53
- return stop;
26
+ return qe(c), c;
54
27
  }
55
- function useSupported(callback, sync = false) {
56
- const isSupported = ref();
57
- const update = () => isSupported.value = Boolean(callback());
58
- update();
59
- tryOnMounted(update, sync);
60
- return isSupported;
28
+ function zt(r, e = !1) {
29
+ const t = A(), n = () => t.value = !!r();
30
+ return n(), ut(n, e), t;
61
31
  }
62
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
63
- const globalKey = "__vueuse_ssr_handlers__";
64
- _global[globalKey] = _global[globalKey] || {};
65
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
66
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
67
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
68
- var __objRest$2 = (source, exclude) => {
69
- var target = {};
70
- for (var prop in source)
71
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
72
- target[prop] = source[prop];
73
- if (source != null && __getOwnPropSymbols$g)
74
- for (var prop of __getOwnPropSymbols$g(source)) {
75
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
76
- target[prop] = source[prop];
77
- }
78
- return target;
32
+ const Ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, je = "__vueuse_ssr_handlers__";
33
+ Ve[je] = Ve[je] || {};
34
+ var Ge = Object.getOwnPropertySymbols, Tt = Object.prototype.hasOwnProperty, Vt = Object.prototype.propertyIsEnumerable, jt = (r, e) => {
35
+ var t = {};
36
+ for (var n in r)
37
+ Tt.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
38
+ if (r != null && Ge)
39
+ for (var n of Ge(r))
40
+ e.indexOf(n) < 0 && Vt.call(r, n) && (t[n] = r[n]);
41
+ return t;
79
42
  };
80
- function useResizeObserver(target, callback, options = {}) {
81
- const _a = options, { window: window2 = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
82
- let observer;
83
- const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
84
- const cleanup = () => {
85
- if (observer) {
86
- observer.disconnect();
87
- observer = void 0;
88
- }
43
+ function Gt(r, e, t = {}) {
44
+ const n = t, { window: o = st } = n, s = jt(n, ["window"]);
45
+ let a;
46
+ const d = zt(() => o && "ResizeObserver" in o), i = () => {
47
+ a && (a.disconnect(), a = void 0);
48
+ }, c = H(() => ot(r), (h) => {
49
+ i(), d.value && o && h && (a = new ResizeObserver(e), a.observe(h, s));
50
+ }, { immediate: !0, flush: "post" }), l = () => {
51
+ i(), c();
89
52
  };
90
- const stopWatch = watch(() => unrefElement(target), (el) => {
91
- cleanup();
92
- if (isSupported.value && window2 && el) {
93
- observer = new ResizeObserver(callback);
94
- observer.observe(el, observerOptions);
95
- }
96
- }, { immediate: true, flush: "post" });
97
- const stop = () => {
98
- cleanup();
99
- stopWatch();
100
- };
101
- tryOnScopeDispose(stop);
102
- return {
103
- isSupported,
104
- stop
53
+ return qe(l), {
54
+ isSupported: d,
55
+ stop: l
105
56
  };
106
57
  }
107
- var SwipeDirection;
108
- (function(SwipeDirection2) {
109
- SwipeDirection2["UP"] = "UP";
110
- SwipeDirection2["RIGHT"] = "RIGHT";
111
- SwipeDirection2["DOWN"] = "DOWN";
112
- SwipeDirection2["LEFT"] = "LEFT";
113
- SwipeDirection2["NONE"] = "NONE";
114
- })(SwipeDirection || (SwipeDirection = {}));
115
- var __defProp = Object.defineProperty;
116
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
117
- var __hasOwnProp = Object.prototype.hasOwnProperty;
118
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
119
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
120
- var __spreadValues = (a, b) => {
121
- for (var prop in b || (b = {}))
122
- if (__hasOwnProp.call(b, prop))
123
- __defNormalProp(a, prop, b[prop]);
124
- if (__getOwnPropSymbols)
125
- for (var prop of __getOwnPropSymbols(b)) {
126
- if (__propIsEnum.call(b, prop))
127
- __defNormalProp(a, prop, b[prop]);
128
- }
129
- return a;
58
+ var Qe;
59
+ (function(r) {
60
+ r.UP = "UP", r.RIGHT = "RIGHT", r.DOWN = "DOWN", r.LEFT = "LEFT", r.NONE = "NONE";
61
+ })(Qe || (Qe = {}));
62
+ var Qt = Object.defineProperty, He = Object.getOwnPropertySymbols, Ht = Object.prototype.hasOwnProperty, Wt = Object.prototype.propertyIsEnumerable, We = (r, e, t) => e in r ? Qt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Ut = (r, e) => {
63
+ for (var t in e || (e = {}))
64
+ Ht.call(e, t) && We(r, t, e[t]);
65
+ if (He)
66
+ for (var t of He(e))
67
+ Wt.call(e, t) && We(r, t, e[t]);
68
+ return r;
130
69
  };
131
- const _TransitionPresets = {
70
+ const Jt = {
132
71
  easeInSine: [0.12, 0, 0.39, 0],
133
72
  easeOutSine: [0.61, 1, 0.88, 1],
134
73
  easeInOutSine: [0.37, 0, 0.63, 1],
@@ -154,14 +93,12 @@ const _TransitionPresets = {
154
93
  easeOutBack: [0.34, 1.56, 0.64, 1],
155
94
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
156
95
  };
157
- __spreadValues({
158
- linear: identity
159
- }, _TransitionPresets);
160
- const mutable = (val) => val;
161
- const EVENT_CODE = {
96
+ Ut({
97
+ linear: pt
98
+ }, Jt);
99
+ const qt = (r) => r, Zt = {
162
100
  esc: "Escape"
163
- };
164
- const badgeProps = buildProps({
101
+ }, Yt = Ae({
165
102
  value: {
166
103
  type: [String, Number],
167
104
  default: ""
@@ -179,551 +116,440 @@ const badgeProps = buildProps({
179
116
  },
180
117
  showZero: {
181
118
  type: Boolean,
182
- default: true
119
+ default: !0
183
120
  },
184
121
  color: String,
185
122
  badgeStyle: {
186
- type: definePropType([String, Object, Array])
123
+ type: G([String, Object, Array])
187
124
  },
188
125
  offset: {
189
- type: definePropType(Array),
126
+ type: G(Array),
190
127
  default: [0, 0]
191
128
  },
192
129
  badgeClass: {
193
130
  type: String
194
131
  }
195
- });
196
- const __default__$1 = defineComponent({
132
+ }), Xt = ce({
197
133
  name: "ElBadge"
198
- });
199
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
200
- ...__default__$1,
201
- props: badgeProps,
202
- setup(__props, { expose }) {
203
- const props = __props;
204
- const ns = useNamespace("badge");
205
- const content = computed(() => {
206
- if (props.isDot)
207
- return "";
208
- if (isNumber(props.value) && isNumber(props.max)) {
209
- return props.max < props.value ? `${props.max}+` : `${props.value}`;
210
- }
211
- return `${props.value}`;
212
- });
213
- const style = computed(() => {
214
- var _a, _b, _c, _d, _e;
134
+ }), $t = /* @__PURE__ */ ce({
135
+ ...Xt,
136
+ props: Yt,
137
+ setup(r, { expose: e }) {
138
+ const t = r, n = gt("badge"), o = P(() => t.isDot ? "" : ve(t.value) && ve(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = P(() => {
139
+ var a, d, i, c, l;
215
140
  return [
216
141
  {
217
- backgroundColor: props.color,
218
- marginRight: addUnit(-((_b = (_a = props.offset) == null ? void 0 : _a[0]) != null ? _b : 0)),
219
- marginTop: addUnit((_d = (_c = props.offset) == null ? void 0 : _c[1]) != null ? _d : 0)
142
+ backgroundColor: t.color,
143
+ marginRight: Be(-((d = (a = t.offset) == null ? void 0 : a[0]) != null ? d : 0)),
144
+ marginTop: Be((c = (i = t.offset) == null ? void 0 : i[1]) != null ? c : 0)
220
145
  },
221
- (_e = props.badgeStyle) != null ? _e : {}
146
+ (l = t.badgeStyle) != null ? l : {}
222
147
  ];
223
148
  });
224
- expose({
225
- content
226
- });
227
- return (_ctx, _cache) => {
228
- return openBlock(), createElementBlock("div", {
229
- class: normalizeClass(unref(ns).b())
230
- }, [
231
- renderSlot(_ctx.$slots, "default"),
232
- createVNode(Transition, {
233
- name: `${unref(ns).namespace.value}-zoom-in-center`,
234
- persisted: ""
235
- }, {
236
- default: withCtx(() => [
237
- withDirectives(createElementVNode("sup", {
238
- class: normalizeClass([
239
- unref(ns).e("content"),
240
- unref(ns).em("content", _ctx.type),
241
- unref(ns).is("fixed", !!_ctx.$slots.default),
242
- unref(ns).is("dot", _ctx.isDot),
243
- unref(ns).is("hide-zero", !_ctx.showZero && props.value === 0),
244
- _ctx.badgeClass
245
- ]),
246
- style: normalizeStyle(unref(style))
247
- }, [
248
- renderSlot(_ctx.$slots, "content", { value: unref(content) }, () => [
249
- createTextVNode(toDisplayString(unref(content)), 1)
250
- ])
251
- ], 6), [
252
- [vShow, !_ctx.hidden && (unref(content) || _ctx.isDot || _ctx.$slots.content)]
149
+ return e({
150
+ content: o
151
+ }), (a, d) => (I(), B("div", {
152
+ class: z(g(n).b())
153
+ }, [
154
+ we(a.$slots, "default"),
155
+ F(be, {
156
+ name: `${g(n).namespace.value}-zoom-in-center`,
157
+ persisted: ""
158
+ }, {
159
+ default: T(() => [
160
+ $e(k("sup", {
161
+ class: z([
162
+ g(n).e("content"),
163
+ g(n).em("content", a.type),
164
+ g(n).is("fixed", !!a.$slots.default),
165
+ g(n).is("dot", a.isDot),
166
+ g(n).is("hide-zero", !a.showZero && t.value === 0),
167
+ a.badgeClass
168
+ ]),
169
+ style: _e(g(s))
170
+ }, [
171
+ we(a.$slots, "content", { value: g(o) }, () => [
172
+ ie(re(g(o)), 1)
253
173
  ])
254
- ]),
255
- _: 3
256
- }, 8, ["name"])
257
- ], 2);
258
- };
174
+ ], 6), [
175
+ [et, !a.hidden && (g(o) || a.isDot || a.$slots.content)]
176
+ ])
177
+ ]),
178
+ _: 3
179
+ }, 8, ["name"])
180
+ ], 2));
259
181
  }
260
182
  });
261
- var Badge = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "badge.vue"]]);
262
- const ElBadge = withInstall(Badge);
263
- const configProviderProps = buildProps({
183
+ var en = /* @__PURE__ */ Ze($t, [["__file", "badge.vue"]]);
184
+ const tn = vt(en), nn = Ae({
264
185
  a11y: {
265
186
  type: Boolean,
266
- default: true
187
+ default: !0
267
188
  },
268
189
  locale: {
269
- type: definePropType(Object)
190
+ type: G(Object)
270
191
  },
271
- size: useSizeProp,
192
+ size: yt,
272
193
  button: {
273
- type: definePropType(Object)
194
+ type: G(Object)
274
195
  },
275
196
  card: {
276
- type: definePropType(Object)
197
+ type: G(Object)
277
198
  },
278
199
  dialog: {
279
- type: definePropType(Object)
200
+ type: G(Object)
280
201
  },
281
202
  link: {
282
- type: definePropType(Object)
203
+ type: G(Object)
283
204
  },
284
205
  experimentalFeatures: {
285
- type: definePropType(Object)
206
+ type: G(Object)
286
207
  },
287
208
  keyboardNavigation: {
288
209
  type: Boolean,
289
- default: true
210
+ default: !0
290
211
  },
291
212
  message: {
292
- type: definePropType(Object)
213
+ type: G(Object)
293
214
  },
294
215
  zIndex: Number,
295
216
  namespace: {
296
217
  type: String,
297
218
  default: "el"
298
219
  },
299
- ...useEmptyValuesProps
300
- });
301
- const messageConfig = {};
302
- defineComponent({
220
+ ...ft
221
+ }), K = {};
222
+ ce({
303
223
  name: "ElConfigProvider",
304
- props: configProviderProps,
305
- setup(props, { slots }) {
306
- const config = provideGlobalConfig(props);
307
- watch(() => props.message, (val) => {
308
- var _a, _b;
309
- Object.assign(messageConfig, (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.message) != null ? _b : {}, val != null ? val : {});
310
- }, { immediate: true, deep: true });
311
- return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
224
+ props: nn,
225
+ setup(r, { slots: e }) {
226
+ const t = wt(r);
227
+ return H(() => r.message, (n) => {
228
+ var o, s;
229
+ Object.assign(K, (s = (o = t?.value) == null ? void 0 : o.message) != null ? s : {}, n ?? {});
230
+ }, { immediate: !0, deep: !0 }), () => we(e, "default", { config: t?.value });
312
231
  }
313
232
  });
314
- const messageTypes = [
233
+ const at = [
315
234
  "primary",
316
235
  "success",
317
236
  "info",
318
237
  "warning",
319
238
  "error"
320
- ];
321
- const messageDefaults = mutable({
239
+ ], S = qt({
322
240
  customClass: "",
323
- dangerouslyUseHTMLString: false,
241
+ dangerouslyUseHTMLString: !1,
324
242
  duration: 3e3,
325
243
  icon: void 0,
326
244
  id: "",
327
245
  message: "",
328
246
  onClose: void 0,
329
- showClose: false,
247
+ showClose: !1,
330
248
  type: "info",
331
- plain: false,
249
+ plain: !1,
332
250
  offset: 16,
333
251
  zIndex: 0,
334
- grouping: false,
252
+ grouping: !1,
335
253
  repeatNum: 1,
336
- appendTo: isClient ? document.body : void 0
337
- });
338
- const messageProps = buildProps({
254
+ appendTo: De ? document.body : void 0
255
+ }), on = Ae({
339
256
  customClass: {
340
257
  type: String,
341
- default: messageDefaults.customClass
258
+ default: S.customClass
342
259
  },
343
260
  dangerouslyUseHTMLString: {
344
261
  type: Boolean,
345
- default: messageDefaults.dangerouslyUseHTMLString
262
+ default: S.dangerouslyUseHTMLString
346
263
  },
347
264
  duration: {
348
265
  type: Number,
349
- default: messageDefaults.duration
266
+ default: S.duration
350
267
  },
351
268
  icon: {
352
- type: iconPropType,
353
- default: messageDefaults.icon
269
+ type: bt,
270
+ default: S.icon
354
271
  },
355
272
  id: {
356
273
  type: String,
357
- default: messageDefaults.id
274
+ default: S.id
358
275
  },
359
276
  message: {
360
- type: definePropType([
277
+ type: G([
361
278
  String,
362
279
  Object,
363
280
  Function
364
281
  ]),
365
- default: messageDefaults.message
282
+ default: S.message
366
283
  },
367
284
  onClose: {
368
- type: definePropType(Function),
369
- default: messageDefaults.onClose
285
+ type: G(Function),
286
+ default: S.onClose
370
287
  },
371
288
  showClose: {
372
289
  type: Boolean,
373
- default: messageDefaults.showClose
290
+ default: S.showClose
374
291
  },
375
292
  type: {
376
293
  type: String,
377
- values: messageTypes,
378
- default: messageDefaults.type
294
+ values: at,
295
+ default: S.type
379
296
  },
380
297
  plain: {
381
298
  type: Boolean,
382
- default: messageDefaults.plain
299
+ default: S.plain
383
300
  },
384
301
  offset: {
385
302
  type: Number,
386
- default: messageDefaults.offset
303
+ default: S.offset
387
304
  },
388
305
  zIndex: {
389
306
  type: Number,
390
- default: messageDefaults.zIndex
307
+ default: S.zIndex
391
308
  },
392
309
  grouping: {
393
310
  type: Boolean,
394
- default: messageDefaults.grouping
311
+ default: S.grouping
395
312
  },
396
313
  repeatNum: {
397
314
  type: Number,
398
- default: messageDefaults.repeatNum
399
- }
400
- });
401
- const messageEmits = {
402
- destroy: () => true
403
- };
404
- const instances = shallowReactive([]);
405
- const getInstance = (id) => {
406
- const idx = instances.findIndex((instance) => instance.id === id);
407
- const current = instances[idx];
408
- let prev;
409
- if (idx > 0) {
410
- prev = instances[idx - 1];
411
- }
412
- return { current, prev };
413
- };
414
- const getLastOffset = (id) => {
415
- const { prev } = getInstance(id);
416
- if (!prev)
417
- return 0;
418
- return prev.vm.exposed.bottom.value;
419
- };
420
- const getOffsetOrSpace = (id, offset) => {
421
- const idx = instances.findIndex((instance) => instance.id === id);
422
- return idx > 0 ? 16 : offset;
423
- };
424
- const __default__ = defineComponent({
315
+ default: S.repeatNum
316
+ }
317
+ }), sn = {
318
+ destroy: () => !0
319
+ }, Q = At([]), an = (r) => {
320
+ const e = Q.findIndex((o) => o.id === r), t = Q[e];
321
+ let n;
322
+ return e > 0 && (n = Q[e - 1]), { current: t, prev: n };
323
+ }, rn = (r) => {
324
+ const { prev: e } = an(r);
325
+ return e ? e.vm.exposed.bottom.value : 0;
326
+ }, dn = (r, e) => Q.findIndex((n) => n.id === r) > 0 ? 16 : e, ln = ce({
425
327
  name: "ElMessage"
426
- });
427
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
428
- ...__default__,
429
- props: messageProps,
430
- emits: messageEmits,
431
- setup(__props, { expose, emit }) {
432
- const props = __props;
433
- const { Close } = TypeComponents;
434
- const isStartTransition = ref(false);
435
- const { ns, zIndex } = useGlobalComponentSettings("message");
436
- const { currentZIndex, nextZIndex } = zIndex;
437
- const messageRef = ref();
438
- const visible = ref(false);
439
- const height = ref(0);
440
- let stopTimer = void 0;
441
- const badgeType = computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
442
- const typeClass = computed(() => {
443
- const type = props.type;
444
- return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
445
- });
446
- const iconComponent = computed(() => props.icon || TypeComponentsMap[props.type] || "");
447
- const lastOffset = computed(() => getLastOffset(props.id));
448
- const offset = computed(() => getOffsetOrSpace(props.id, props.offset) + lastOffset.value);
449
- const bottom = computed(() => height.value + offset.value);
450
- const customStyle = computed(() => ({
451
- top: `${offset.value}px`,
452
- zIndex: currentZIndex.value
328
+ }), cn = /* @__PURE__ */ ce({
329
+ ...ln,
330
+ props: on,
331
+ emits: sn,
332
+ setup(r, { expose: e, emit: t }) {
333
+ const n = r, { Close: o } = xt, s = A(!1), { ns: a, zIndex: d } = Ct("message"), { currentZIndex: i, nextZIndex: c } = d, l = A(), h = A(!1), w = A(0);
334
+ let p;
335
+ const x = P(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), y = P(() => {
336
+ const v = n.type;
337
+ return { [a.bm("icon", v)]: v && Ne[v] };
338
+ }), E = P(() => n.icon || Ne[n.type] || ""), b = P(() => rn(n.id)), D = P(() => dn(n.id, n.offset) + b.value), R = P(() => w.value + D.value), ae = P(() => ({
339
+ top: `${D.value}px`,
340
+ zIndex: i.value
453
341
  }));
454
- function startTimer() {
455
- if (props.duration === 0)
456
- return;
457
- ({ stop: stopTimer } = useTimeoutFn(() => {
458
- close();
459
- }, props.duration));
342
+ function q() {
343
+ n.duration !== 0 && ({ stop: p } = Et(() => {
344
+ M();
345
+ }, n.duration));
460
346
  }
461
- function clearTimer() {
462
- stopTimer == null ? void 0 : stopTimer();
347
+ function _() {
348
+ p?.();
463
349
  }
464
- function close() {
465
- visible.value = false;
466
- nextTick(() => {
467
- var _a;
468
- if (!isStartTransition.value) {
469
- (_a = props.onClose) == null ? void 0 : _a.call(props);
470
- emit("destroy");
471
- }
350
+ function M() {
351
+ h.value = !1, ye(() => {
352
+ var v;
353
+ s.value || ((v = n.onClose) == null || v.call(n), t("destroy"));
472
354
  });
473
355
  }
474
- function keydown({ code }) {
475
- if (code === EVENT_CODE.esc) {
476
- close();
477
- }
356
+ function O({ code: v }) {
357
+ v === Zt.esc && M();
478
358
  }
479
- onMounted(() => {
480
- startTimer();
481
- nextZIndex();
482
- visible.value = true;
483
- });
484
- watch(() => props.repeatNum, () => {
485
- clearTimer();
486
- startTimer();
487
- });
488
- useEventListener(document, "keydown", keydown);
489
- useResizeObserver(messageRef, () => {
490
- height.value = messageRef.value.getBoundingClientRect().height;
491
- });
492
- expose({
493
- visible,
494
- bottom,
495
- close
496
- });
497
- return (_ctx, _cache) => {
498
- return openBlock(), createBlock(Transition, {
499
- name: unref(ns).b("fade"),
500
- onBeforeEnter: ($event) => isStartTransition.value = true,
501
- onBeforeLeave: _ctx.onClose,
502
- onAfterLeave: ($event) => _ctx.$emit("destroy"),
503
- persisted: ""
504
- }, {
505
- default: withCtx(() => [
506
- withDirectives(createElementVNode("div", {
507
- id: _ctx.id,
508
- ref_key: "messageRef",
509
- ref: messageRef,
510
- class: normalizeClass([
511
- unref(ns).b(),
512
- { [unref(ns).m(_ctx.type)]: _ctx.type },
513
- unref(ns).is("closable", _ctx.showClose),
514
- unref(ns).is("plain", _ctx.plain),
515
- _ctx.customClass
359
+ return tt(() => {
360
+ q(), c(), h.value = !0;
361
+ }), H(() => n.repeatNum, () => {
362
+ _(), q();
363
+ }), Kt(document, "keydown", O), Gt(l, () => {
364
+ w.value = l.value.getBoundingClientRect().height;
365
+ }), e({
366
+ visible: h,
367
+ bottom: R,
368
+ close: M
369
+ }), (v, Z) => (I(), pe(be, {
370
+ name: g(a).b("fade"),
371
+ onBeforeEnter: (j) => s.value = !0,
372
+ onBeforeLeave: v.onClose,
373
+ onAfterLeave: (j) => v.$emit("destroy"),
374
+ persisted: ""
375
+ }, {
376
+ default: T(() => [
377
+ $e(k("div", {
378
+ id: v.id,
379
+ ref_key: "messageRef",
380
+ ref: l,
381
+ class: z([
382
+ g(a).b(),
383
+ { [g(a).m(v.type)]: v.type },
384
+ g(a).is("closable", v.showClose),
385
+ g(a).is("plain", v.plain),
386
+ v.customClass
387
+ ]),
388
+ style: _e(g(ae)),
389
+ role: "alert",
390
+ onMouseenter: _,
391
+ onMouseleave: q
392
+ }, [
393
+ v.repeatNum > 1 ? (I(), pe(g(tn), {
394
+ key: 0,
395
+ value: v.repeatNum,
396
+ type: g(x),
397
+ class: z(g(a).e("badge"))
398
+ }, null, 8, ["value", "type", "class"])) : J("v-if", !0),
399
+ g(E) ? (I(), pe(g(Re), {
400
+ key: 1,
401
+ class: z([g(a).e("icon"), g(y)])
402
+ }, {
403
+ default: T(() => [
404
+ (I(), pe(_t(g(E))))
516
405
  ]),
517
- style: normalizeStyle(unref(customStyle)),
518
- role: "alert",
519
- onMouseenter: clearTimer,
520
- onMouseleave: startTimer
521
- }, [
522
- _ctx.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), {
406
+ _: 1
407
+ }, 8, ["class"])) : J("v-if", !0),
408
+ we(v.$slots, "default", {}, () => [
409
+ v.dangerouslyUseHTMLString ? (I(), B(ge, { key: 1 }, [
410
+ J(" Caution here, message could've been compromised, never use user's input as message "),
411
+ k("p", {
412
+ class: z(g(a).e("content")),
413
+ innerHTML: v.message
414
+ }, null, 10, ["innerHTML"])
415
+ ], 2112)) : (I(), B("p", {
523
416
  key: 0,
524
- value: _ctx.repeatNum,
525
- type: unref(badgeType),
526
- class: normalizeClass(unref(ns).e("badge"))
527
- }, null, 8, ["value", "type", "class"])) : createCommentVNode("v-if", true),
528
- unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
529
- key: 1,
530
- class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
531
- }, {
532
- default: withCtx(() => [
533
- (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
534
- ]),
535
- _: 1
536
- }, 8, ["class"])) : createCommentVNode("v-if", true),
537
- renderSlot(_ctx.$slots, "default", {}, () => [
538
- !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
539
- key: 0,
540
- class: normalizeClass(unref(ns).e("content"))
541
- }, toDisplayString(_ctx.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
542
- createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
543
- createElementVNode("p", {
544
- class: normalizeClass(unref(ns).e("content")),
545
- innerHTML: _ctx.message
546
- }, null, 10, ["innerHTML"])
547
- ], 2112))
417
+ class: z(g(a).e("content"))
418
+ }, re(v.message), 3))
419
+ ]),
420
+ v.showClose ? (I(), pe(g(Re), {
421
+ key: 2,
422
+ class: z(g(a).e("closeBtn")),
423
+ onClick: St(M, ["stop"])
424
+ }, {
425
+ default: T(() => [
426
+ F(g(o))
548
427
  ]),
549
- _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
550
- key: 2,
551
- class: normalizeClass(unref(ns).e("closeBtn")),
552
- onClick: withModifiers(close, ["stop"])
553
- }, {
554
- default: withCtx(() => [
555
- createVNode(unref(Close))
556
- ]),
557
- _: 1
558
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
559
- ], 46, ["id"]), [
560
- [vShow, visible.value]
561
- ])
562
- ]),
563
- _: 3
564
- }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]);
565
- };
428
+ _: 1
429
+ }, 8, ["class", "onClick"])) : J("v-if", !0)
430
+ ], 46, ["id"]), [
431
+ [et, h.value]
432
+ ])
433
+ ]),
434
+ _: 3
435
+ }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
566
436
  }
567
437
  });
568
- var MessageConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "message.vue"]]);
569
- let seed = 1;
570
- const normalizeOptions = (params) => {
571
- const options = !params || isString$1(params) || isVNode(params) || isFunction(params) ? { message: params } : params;
572
- const normalized = {
573
- ...messageDefaults,
574
- ...options
438
+ var mn = /* @__PURE__ */ Ze(cn, [["__file", "message.vue"]]);
439
+ let hn = 1;
440
+ const it = (r) => {
441
+ const e = !r || Oe(r) || nt(r) || Pe(r) ? { message: r } : r, t = {
442
+ ...S,
443
+ ...e
575
444
  };
576
- if (!normalized.appendTo) {
577
- normalized.appendTo = document.body;
578
- } else if (isString$1(normalized.appendTo)) {
579
- let appendTo = document.querySelector(normalized.appendTo);
580
- if (!isElement(appendTo)) {
581
- appendTo = document.body;
582
- }
583
- normalized.appendTo = appendTo;
584
- }
585
- if (isBoolean(messageConfig.grouping) && !normalized.grouping) {
586
- normalized.grouping = messageConfig.grouping;
587
- }
588
- if (isNumber(messageConfig.duration) && normalized.duration === 3e3) {
589
- normalized.duration = messageConfig.duration;
590
- }
591
- if (isNumber(messageConfig.offset) && normalized.offset === 16) {
592
- normalized.offset = messageConfig.offset;
593
- }
594
- if (isBoolean(messageConfig.showClose) && !normalized.showClose) {
595
- normalized.showClose = messageConfig.showClose;
596
- }
597
- if (isBoolean(messageConfig.plain) && !normalized.plain) {
598
- normalized.plain = messageConfig.plain;
599
- }
600
- return normalized;
601
- };
602
- const closeMessage = (instance) => {
603
- const idx = instances.indexOf(instance);
604
- if (idx === -1)
445
+ if (!t.appendTo)
446
+ t.appendTo = document.body;
447
+ else if (Oe(t.appendTo)) {
448
+ let n = document.querySelector(t.appendTo);
449
+ Mt(n) || (n = document.body), t.appendTo = n;
450
+ }
451
+ return ke(K.grouping) && !t.grouping && (t.grouping = K.grouping), ve(K.duration) && t.duration === 3e3 && (t.duration = K.duration), ve(K.offset) && t.offset === 16 && (t.offset = K.offset), ke(K.showClose) && !t.showClose && (t.showClose = K.showClose), ke(K.plain) && !t.plain && (t.plain = K.plain), t;
452
+ }, un = (r) => {
453
+ const e = Q.indexOf(r);
454
+ if (e === -1)
605
455
  return;
606
- instances.splice(idx, 1);
607
- const { handler } = instance;
608
- handler.close();
609
- };
610
- const createMessage = ({ appendTo, ...options }, context) => {
611
- const id = `message_${seed++}`;
612
- const userOnClose = options.onClose;
613
- const container = document.createElement("div");
614
- const props = {
615
- ...options,
616
- id,
456
+ Q.splice(e, 1);
457
+ const { handler: t } = r;
458
+ t.close();
459
+ }, pn = ({ appendTo: r, ...e }, t) => {
460
+ const n = `message_${hn++}`, o = e.onClose, s = document.createElement("div"), a = {
461
+ ...e,
462
+ id: n,
617
463
  onClose: () => {
618
- userOnClose == null ? void 0 : userOnClose();
619
- closeMessage(instance);
464
+ o?.(), un(l);
620
465
  },
621
466
  onDestroy: () => {
622
- render(null, container);
467
+ Te(null, s);
623
468
  }
624
- };
625
- const vnode = createVNode(MessageConstructor, props, isFunction(props.message) || isVNode(props.message) ? {
626
- default: isFunction(props.message) ? props.message : () => props.message
469
+ }, d = F(mn, a, Pe(a.message) || nt(a.message) ? {
470
+ default: Pe(a.message) ? a.message : () => a.message
627
471
  } : null);
628
- vnode.appContext = context || message._context;
629
- render(vnode, container);
630
- appendTo.appendChild(container.firstElementChild);
631
- const vm = vnode.component;
632
- const handler = {
633
- close: () => {
634
- vm.exposed.close();
635
- }
636
- };
637
- const instance = {
638
- id,
639
- vnode,
640
- vm,
641
- handler,
642
- props: vnode.component.props
472
+ d.appContext = t || le._context, Te(d, s), r.appendChild(s.firstElementChild);
473
+ const i = d.component, l = {
474
+ id: n,
475
+ vnode: d,
476
+ vm: i,
477
+ handler: {
478
+ close: () => {
479
+ i.exposed.close();
480
+ }
481
+ },
482
+ props: d.component.props
643
483
  };
644
- return instance;
645
- };
646
- const message = (options = {}, context) => {
647
- if (!isClient)
648
- return { close: () => void 0 };
649
- const normalized = normalizeOptions(options);
650
- if (normalized.grouping && instances.length) {
651
- const instance2 = instances.find(({ vnode: vm }) => {
652
- var _a;
653
- return ((_a = vm.props) == null ? void 0 : _a.message) === normalized.message;
484
+ return l;
485
+ }, le = (r = {}, e) => {
486
+ if (!De)
487
+ return { close: () => {
488
+ } };
489
+ const t = it(r);
490
+ if (t.grouping && Q.length) {
491
+ const o = Q.find(({ vnode: s }) => {
492
+ var a;
493
+ return ((a = s.props) == null ? void 0 : a.message) === t.message;
654
494
  });
655
- if (instance2) {
656
- instance2.props.repeatNum += 1;
657
- instance2.props.type = normalized.type;
658
- return instance2.handler;
659
- }
660
- }
661
- if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) {
662
- return { close: () => void 0 };
663
- }
664
- const instance = createMessage(normalized, context);
665
- instances.push(instance);
666
- return instance.handler;
495
+ if (o)
496
+ return o.props.repeatNum += 1, o.props.type = t.type, o.handler;
497
+ }
498
+ if (ve(K.max) && Q.length >= K.max)
499
+ return { close: () => {
500
+ } };
501
+ const n = pn(t, e);
502
+ return Q.push(n), n.handler;
667
503
  };
668
- messageTypes.forEach((type) => {
669
- message[type] = (options = {}, appContext) => {
670
- const normalized = normalizeOptions(options);
671
- return message({ ...normalized, type }, appContext);
504
+ at.forEach((r) => {
505
+ le[r] = (e = {}, t) => {
506
+ const n = it(e);
507
+ return le({ ...n, type: r }, t);
672
508
  };
673
509
  });
674
- function closeAll(type) {
675
- const instancesToClose = [...instances];
676
- for (const instance of instancesToClose) {
677
- if (!type || type === instance.props.type) {
678
- instance.handler.close();
679
- }
680
- }
510
+ function gn(r) {
511
+ const e = [...Q];
512
+ for (const t of e)
513
+ (!r || r === t.props.type) && t.handler.close();
681
514
  }
682
- message.closeAll = closeAll;
683
- message._context = null;
684
- const ElMessage = withInstallFunction(message, "$message");
685
- class CommandFlowComponent extends Component {
515
+ le.closeAll = gn;
516
+ le._context = null;
517
+ const L = Lt(le, "$message");
518
+ class N extends Ce {
686
519
  _renderer;
687
520
  get renderer() {
688
- if (!this._renderer) this._renderer = this.parent?.findComponentByName("Renderer");
689
- return this._renderer;
521
+ return this._renderer || (this._renderer = this.parent?.findComponentByName("Renderer")), this._renderer;
690
522
  }
691
523
  _domElement;
692
524
  get domElement() {
693
- if (!this._domElement) this._domElement = this.editor?.domContainer?.domElement;
694
- return this._domElement;
525
+ return this._domElement || (this._domElement = this.editor?.domContainer?.domElement), this._domElement;
695
526
  }
696
527
  _editor;
697
528
  get editor() {
698
- if (!this._editor) this._editor = this.parent?.findComponentByName("Editor");
699
- return this._editor;
529
+ return this._editor || (this._editor = this.parent?.findComponentByName("Editor")), this._editor;
700
530
  }
701
531
  _eventInput;
702
532
  get eventInput() {
703
- if (!this._eventInput) this._eventInput = this.parent?.findComponentByName("EventInput");
704
- return this._eventInput;
533
+ return this._eventInput || (this._eventInput = this.parent?.findComponentByName("EventInput")), this._eventInput;
705
534
  }
706
535
  _renderManager;
707
536
  get renderManager() {
708
- if (!this._renderManager) this._renderManager = this.parent?.findComponentByName("RenderManager");
709
- return this._renderManager;
537
+ return this._renderManager || (this._renderManager = this.parent?.findComponentByName("RenderManager")), this._renderManager;
710
538
  }
711
539
  _commandManager;
712
540
  get commandManager() {
713
- if (!this._commandManager) this._commandManager = this.editor?.commandManager;
714
- return this._commandManager;
541
+ return this._commandManager || (this._commandManager = this.editor?.commandManager), this._commandManager;
715
542
  }
716
543
  _default;
717
544
  get default() {
718
- if (!this._default) this._default = this.parent?.findComponentByName("Default");
719
- return this._default;
545
+ return this._default || (this._default = this.parent?.findComponentByName("Default")), this._default;
720
546
  }
721
547
  interruptKeys = ["escape"];
722
548
  commandName = "";
723
549
  constructor() {
724
550
  super();
725
551
  }
726
- onAddFromParent(parent) {
552
+ onAddFromParent(e) {
727
553
  this.editor.addEventListener("cancelCommand", () => {
728
554
  this.cancel();
729
555
  });
@@ -732,23 +558,21 @@ class CommandFlowComponent extends Component {
732
558
  * 取消
733
559
  */
734
560
  cancel() {
735
- const commandName = this.commandName || this.constructor.commandName;
736
- if (this.commandManager.currentName !== commandName) return;
737
- this.commandManager.cancel();
561
+ const e = this.commandName || this.constructor.commandName;
562
+ this.commandManager.currentName === e && this.commandManager.cancel();
738
563
  }
739
564
  /**
740
565
  * 创建中断处理命令节点
741
566
  * @returns
742
567
  */
743
568
  createInterrupt() {
744
- return (next, data) => {
569
+ return (e, t) => {
745
570
  this.addEventRecord(
746
571
  "clear",
747
572
  this.eventInput.addEventListener("codeChange", async () => {
748
- if (this.eventInput.isKeyDowns(this.interruptKeys)) this.cancel();
573
+ this.eventInput.isKeyDowns(this.interruptKeys) && this.cancel();
749
574
  })
750
- );
751
- next(data);
575
+ ), e(t);
752
576
  };
753
577
  }
754
578
  /**
@@ -756,184 +580,153 @@ class CommandFlowComponent extends Component {
756
580
  * @param cursor
757
581
  * @returns
758
582
  */
759
- createCursor(cursor) {
760
- return (next, data) => {
761
- const defaultCursor = this.domElement.style.cursor;
762
- this.domElement.style.cursor = cursor;
763
- this.addEventRecord("clear", () => {
764
- this.domElement.style.cursor = defaultCursor ?? "default";
765
- });
766
- next(data);
583
+ createCursor(e) {
584
+ return (t, n) => {
585
+ const o = this.domElement.style.cursor;
586
+ this.domElement.style.cursor = e, this.addEventRecord("clear", () => {
587
+ this.domElement.style.cursor = o ?? "default";
588
+ }), t(n);
767
589
  };
768
590
  }
769
591
  /**
770
592
  * 创建清理
771
593
  * @returns
772
594
  */
773
- createFinally(keys = []) {
595
+ createFinally(e = []) {
774
596
  return () => {
775
- this.canceEventRecord("clear");
776
- keys.forEach((k) => this.canceEventRecord(k));
597
+ this.canceEventRecord("clear"), e.forEach((t) => this.canceEventRecord(t));
777
598
  };
778
599
  }
779
600
  }
780
- class DrawLine extends CommandFlowComponent {
601
+ class vn extends N {
781
602
  static name = "DrawLine";
782
- container = new THREE.Group();
603
+ container = new m.Group();
783
604
  interruptKeys = ["escape"];
784
605
  withdrawalKeys = ["control", "z"];
785
606
  shortcutKeys = ["control", "l"];
786
607
  confirmKeys = ["enter"];
787
608
  commandName = "draw-line";
788
- onAddFromParent(parent) {
789
- super.onAddFromParent(parent);
790
- this.editor.container.add(this.container);
791
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this));
792
- commandFlow.addEventListener("finally", this.createFinally());
793
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
794
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
795
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
796
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
609
+ onAddFromParent(e) {
610
+ super.onAddFromParent(e), this.editor.container.add(this.container);
611
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
612
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
797
613
  }
798
614
  /** 选择点
799
615
  * @param next
800
616
  */
801
- selectPoint(next) {
802
- let editor = this.parent?.findComponentByName("Editor"), start = null, end = null, points = [], circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 65280 })), dom = editor.domContainer.domElement, line2 = new Lines([], 16711935), auxiliaryLine = new Lines([
803
- new THREE.Vector3(-1e4, 0, 0),
804
- new THREE.Vector3(1e4, 0, 0),
805
- new THREE.Vector3(0, -1e4, 0),
806
- new THREE.Vector3(0, 1e4, 0)
617
+ selectPoint(e) {
618
+ let t = this.parent?.findComponentByName("Editor"), n = null, o = null, s = [], a = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 65280 })), d = t.domContainer.domElement, i = new fe([], 16711935), c = new fe([
619
+ new m.Vector3(-1e4, 0, 0),
620
+ new m.Vector3(1e4, 0, 0),
621
+ new m.Vector3(0, -1e4, 0),
622
+ new m.Vector3(0, 1e4, 0)
807
623
  ], 16711935);
808
- auxiliaryLine.material = new THREE.LineDashedMaterial({
624
+ c.material = new m.LineDashedMaterial({
809
625
  color: 4235007,
810
626
  dashSize: 0.1,
811
627
  gapSize: 0.1,
812
628
  linewidth: 0.1
813
- });
814
- this.container.add(line2);
815
- const updateLine = () => {
816
- line2.setPoint(...points, start, end);
817
- auxiliaryLine.position.copy(end);
818
- this.container.add(auxiliaryLine);
819
- auxiliaryLine.computeLineDistances();
820
- };
821
- const currentPoint = new THREE.Vector3();
629
+ }), this.container.add(i);
630
+ const l = () => {
631
+ i.setPoint(...s, n, o), c.position.copy(o), this.container.add(c), c.computeLineDistances();
632
+ }, h = new m.Vector3();
822
633
  this.addEventRecord(
823
634
  "clear",
824
- editor.addEventListener("pointerPositionChange", () => {
825
- const { point, find } = editor.renderManager.adsorption();
826
- if (find) {
827
- circle.position.set(point.x, point.y, 0);
828
- this.container.add(circle);
829
- dom.style.cursor = "none";
830
- } else {
831
- circle.removeFromParent();
832
- dom.style.cursor = "crosshair";
833
- }
834
- currentPoint.copy(point);
835
- if (!(start && end)) return;
836
- if (editor.eventInput.isKeyDown("shift")) {
837
- const x = Math.abs(editor.pointerPosition.x - start.x), y = Math.abs(editor.pointerPosition.y - start.y);
838
- if (x > y) end.set(editor.pointerPosition.x, start.y, 0);
839
- else end.set(start.x, editor.pointerPosition.y, 0);
840
- updateLine();
841
- currentPoint.copy(end);
842
- return;
635
+ t.addEventListener("pointerPositionChange", () => {
636
+ const { point: w, find: p } = t.renderManager.adsorption();
637
+ if (this.dispatchEvent({ type: "pointerMove", point: w }), p ? (a.position.set(w.x, w.y, 0), this.container.add(a), d.style.cursor = "none") : (a.removeFromParent(), d.style.cursor = "crosshair"), h.copy(w), !!(n && o)) {
638
+ if (t.eventInput.isKeyDown("shift")) {
639
+ const x = Math.abs(t.pointerPosition.x - n.x), y = Math.abs(t.pointerPosition.y - n.y);
640
+ x > y ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), l(), h.copy(o);
641
+ return;
642
+ }
643
+ o.set(t.pointerPosition.x, t.pointerPosition.y, 0), l();
843
644
  }
844
- end.set(editor.pointerPosition.x, editor.pointerPosition.y, 0);
845
- updateLine();
846
645
  }),
847
- editor.eventInput.addEventListener("codeChange", async () => {
848
- if (editor.eventInput.isKeyDown("mouse_0")) {
849
- if (!start) {
850
- start = currentPoint.clone();
851
- end = currentPoint.clone();
852
- updateLine();
646
+ t.eventInput.addEventListener("codeChange", async () => {
647
+ if (t.eventInput.isKeyDown("mouse_0")) {
648
+ if (!n) {
649
+ n = h.clone(), o = h.clone(), l();
853
650
  return;
854
651
  }
855
- end = currentPoint.clone();
856
- points.push(start.clone(), end.clone());
857
- start.copy(end);
858
- updateLine();
859
- } else if (editor.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
860
- if (points.length) {
861
- const { point } = editor.renderManager.adsorption();
862
- points.pop();
863
- end?.copy(point);
864
- start?.copy(points.pop());
865
- updateLine();
652
+ o = h.clone(), s.push(n.clone(), o.clone()), n.copy(o), l();
653
+ } else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
654
+ if (s.length) {
655
+ const { point: w } = t.renderManager.adsorption();
656
+ s.pop(), o?.copy(w), n?.copy(s.pop()), l();
866
657
  }
867
- } else if (editor.eventInput.isKeyDowns(this.confirmKeys)) next(points);
658
+ } else t.eventInput.isKeyDowns(this.confirmKeys) && e(s);
868
659
  }),
869
660
  function() {
870
- line2.removeFromParent();
871
- circle.removeFromParent();
872
- auxiliaryLine.removeFromParent();
661
+ i.removeFromParent(), a.removeFromParent(), c.removeFromParent();
873
662
  }
874
663
  );
875
664
  }
665
+ /** 结束, 汇总结果
666
+ * @param points
667
+ */
668
+ end(e, t) {
669
+ const n = [];
670
+ for (let o = 0; o < t.length; o += 2)
671
+ n.push(new W(V.from(t[o]), V.from(t[o + 1])));
672
+ e(n);
673
+ }
876
674
  /** 执行完成
877
675
  */
878
- completed(points) {
879
- const editor = this.editor, lines = [];
880
- for (let i = 0; i < points.length; i += 2) {
881
- lines.push(new LineSegment(Point.from(points[i]), Point.from(points[i + 1])));
882
- }
883
- editor.renderManager.addLines(lines);
884
- editor.renderManager.draw();
676
+ completed(e) {
677
+ this.renderManager.addLines(e), this.renderManager.draw();
678
+ }
679
+ /** 回滚操作
680
+ * @param data
681
+ */
682
+ rollback(e) {
683
+ return e.forEach((t) => this.renderManager.removeLine(t)), this.renderManager.draw(), e;
684
+ }
685
+ /** 撤回回滚
686
+ * @param lines
687
+ * @returns
688
+ */
689
+ revokeRollback(e) {
690
+ return this.completed(e), e;
885
691
  }
886
692
  }
887
- class Default extends Component {
693
+ class Se extends Ce {
888
694
  static name = "Default";
889
695
  get editor() {
890
696
  return this.parent?.findComponentByName("Editor");
891
697
  }
892
698
  renderer;
893
- container = new THREE.Group();
699
+ container = new m.Group();
894
700
  onAddFromParent() {
895
- const editor = this.editor, commandManager = editor.commandManager;
896
- this.renderer = this.parent?.findComponentByName("Renderer");
897
- editor.container.add(this.container);
898
- commandManager.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this));
899
- commandManager.addEventListener("startedBefore", (e) => {
900
- if (e.currentName === "default" && e.name !== "default") commandManager.cancel();
901
- });
902
- commandManager.addEventListener("finally", (e) => e.name !== "default" && commandManager.start("default"));
903
- editor.eventInput.addCancelDefaultBehavior(() => editor.eventInput.isOnlyKeyDowns(["control", "g"]));
701
+ const e = this.editor, t = e.commandManager;
702
+ this.renderer = this.parent?.findComponentByName("Renderer"), e.container.add(this.container), t.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this)), t.addEventListener("startedBefore", (n) => {
703
+ n.currentName === "default" && n.name !== "default" && t.cancel();
704
+ }), t.addEventListener("finally", (n) => n.name !== "default" && t.start("default")), e.eventInput.addCancelDefaultBehavior(() => e.eventInput.isOnlyKeyDowns(["control", "g"]));
904
705
  }
905
706
  selectLines = [];
906
- selectLineObject3D = new THREE.Mesh();
707
+ selectLineObject3D = new m.Mesh();
907
708
  /** 添加选择的线段
908
709
  * @param lineSegment
909
710
  */
910
- addSelectLine(lineSegment) {
911
- if (this.selectLines.indexOf(lineSegment) > -1) return;
912
- this.selectLines.push(lineSegment);
913
- this.updateSelectLinesGeometry();
914
- this.dispatchEvent({
711
+ addSelectLine(e) {
712
+ this.selectLines.indexOf(e) > -1 || (this.selectLines.push(e), this.updateSelectLinesGeometry(), this.dispatchEvent({
915
713
  type: "selectLineChange"
916
- });
714
+ }));
917
715
  }
918
716
  /** 移除选择的线段
919
717
  * @param lineSegment
920
718
  */
921
- removeSelectLine(lineSegment) {
922
- const i = this.selectLines.indexOf(lineSegment);
923
- if (i > -1) {
924
- this.selectLines.splice(i, 1);
925
- this.updateSelectLinesGeometry();
926
- this.dispatchEvent({
927
- type: "selectLineChange"
928
- });
929
- }
719
+ removeSelectLine(e) {
720
+ const t = this.selectLines.indexOf(e);
721
+ t > -1 && (this.selectLines.splice(t, 1), this.updateSelectLinesGeometry(), this.dispatchEvent({
722
+ type: "selectLineChange"
723
+ }));
930
724
  }
931
725
  /**
932
726
  * 移除所有选中线段
933
727
  */
934
728
  removeSelectLineAll() {
935
- this.selectLines.length = 0;
936
- this.dispatchEvent({
729
+ this.selectLines.length = 0, this.dispatchEvent({
937
730
  type: "selectLineChange"
938
731
  });
939
732
  }
@@ -942,14 +735,11 @@ class Default extends Component {
942
735
  * 更新选择的线段
943
736
  */
944
737
  updateSelectLinesGeometry() {
945
- if (this._timer) clearTimeout(this._timer);
946
- this._timer = setTimeout(() => {
738
+ this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
947
739
  if (this.destroyed) return;
948
- if (this.selectLines.length) this.container.add(this.selectLineObject3D);
949
- else this.selectLineObject3D.removeFromParent();
950
- const editor = this.editor;
951
- const position = this.selectLines.flatMap((line2) => line2.expandToRectangle(0.04, "bothSides").createGeometry());
952
- this.selectLineObject3D.geometry = editor.renderManager.createGeometry({ position }, position.length / 3);
740
+ this.selectLines.length ? this.container.add(this.selectLineObject3D) : this.selectLineObject3D.removeFromParent();
741
+ const e = this.editor, t = this.selectLines.flatMap((n) => n.expandToRectangle(0.04, "bothSides").createGeometry());
742
+ this.selectLineObject3D.geometry = e.renderManager.createGeometry({ position: t }, t.length / 3);
953
743
  }, 10);
954
744
  }
955
745
  /**
@@ -957,91 +747,74 @@ class Default extends Component {
957
747
  * @param next
958
748
  */
959
749
  start() {
960
- const editor = this.editor, eventInput = editor.eventInput, object3D = new THREE.Mesh(), dom = editor.domContainer.domElement;
961
- let currentSelectLine = null;
962
- object3D.position.z = 0.01;
963
- this.selectLineObject3D.position.z = object3D.position.z + 0.01;
964
- object3D.material = new THREE.MeshBasicMaterial({ color: 55561 });
965
- const showSelectBox = () => {
966
- const startPoint = editor.pointerPosition.clone(), endPoint = editor.pointerPosition.clone(), mesh = new THREE.Mesh();
967
- this.container.add(mesh);
968
- mesh.position.z = 0.05;
969
- mesh.material = new THREE.MeshBasicMaterial({
750
+ const e = this.editor, t = e.eventInput, n = new m.Mesh(), o = e.domContainer.domElement;
751
+ let s = null;
752
+ n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new m.MeshBasicMaterial({ color: 55561 });
753
+ const a = () => {
754
+ const d = e.pointerPosition.clone(), i = e.pointerPosition.clone(), c = new m.Mesh();
755
+ this.container.add(c), c.position.z = 0.05, c.material = new m.MeshBasicMaterial({
970
756
  color: 16777215,
971
- transparent: true,
757
+ transparent: !0,
972
758
  opacity: 0.5
973
759
  });
974
- const update = () => {
975
- const minX = Math.min(startPoint.x, endPoint.x), maxX = Math.max(startPoint.x, endPoint.x), minY = Math.min(startPoint.y, endPoint.y), maxY = Math.max(startPoint.y, endPoint.y);
976
- const position = [
977
- minX,
978
- maxY,
760
+ const l = () => {
761
+ const p = Math.min(d.x, i.x), x = Math.max(d.x, i.x), y = Math.min(d.y, i.y), E = Math.max(d.y, i.y), b = [
762
+ p,
763
+ E,
979
764
  0,
980
- maxX,
981
- minY,
765
+ x,
766
+ y,
982
767
  0,
983
- maxX,
984
- maxY,
768
+ x,
769
+ E,
985
770
  0,
986
- minX,
987
- maxY,
771
+ p,
772
+ E,
988
773
  0,
989
- minX,
990
- minY,
774
+ p,
775
+ y,
991
776
  0,
992
- maxX,
993
- minY,
777
+ x,
778
+ y,
994
779
  0
995
780
  ];
996
- mesh.geometry = editor.renderManager.createGeometry({ position }, position.length / 3);
997
- };
998
- const move = () => {
999
- endPoint.copy(editor.pointerPosition);
1000
- update();
1001
- };
1002
- const end = () => {
1003
- document.removeEventListener("mousemove", move);
1004
- document.removeEventListener("mouseup", end);
1005
- mesh.removeFromParent();
1006
- const minX = Math.min(startPoint.x, endPoint.x), maxX = Math.max(startPoint.x, endPoint.x), minY = Math.min(startPoint.y, endPoint.y), maxY = Math.max(startPoint.y, endPoint.y);
1007
- const box = new Box2(minX, maxX, minY, maxY);
1008
- const resultList = editor.renderManager.quadtree.queryBox(box);
1009
- this.removeSelectLineAll();
1010
- resultList.forEach((result) => this.addSelectLine(result.line));
1011
- this.updateSelectLinesGeometry();
781
+ c.geometry = e.renderManager.createGeometry({ position: b }, b.length / 3);
782
+ }, h = () => {
783
+ i.copy(e.pointerPosition), l();
784
+ }, w = () => {
785
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", w), c.removeFromParent();
786
+ const p = Math.min(d.x, i.x), x = Math.max(d.x, i.x), y = Math.min(d.y, i.y), E = Math.max(d.y, i.y), b = new Ye(p, x, y, E), D = e.renderManager.quadtree.queryBox(b);
787
+ this.removeSelectLineAll(), D.forEach((R) => this.addSelectLine(R.line)), this.updateSelectLinesGeometry();
1012
788
  };
1013
- document.addEventListener("mousemove", move);
1014
- document.addEventListener("mouseup", end);
789
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", w);
1015
790
  };
1016
791
  this.addEventRecord(
1017
792
  "clear",
1018
793
  // 注册鼠标指针位置变化事件
1019
- editor.addEventListener("pointerPositionChange", () => {
1020
- const { line: line2 } = editor.renderManager.adsorption(0.05);
1021
- if (line2) {
1022
- const rectangle = line2.expandToRectangle(0.02, "bothSides");
1023
- object3D.geometry = editor.renderManager.createGeometry({ position: rectangle.createGeometry() }, 6);
1024
- this.container.add(object3D);
1025
- dom.style.cursor = "pointer";
1026
- currentSelectLine = line2;
1027
- } else {
1028
- object3D.removeFromParent();
1029
- dom.style.cursor = "default";
1030
- currentSelectLine = null;
1031
- }
794
+ e.addEventListener("pointerPositionChange", () => {
795
+ const { line: d } = e.renderManager.adsorption(0.04);
796
+ if (d) {
797
+ const i = d.expandToRectangle(0.025, "bothSides");
798
+ n.geometry = e.renderManager.createGeometry({ position: i.createGeometry() }, 6), this.container.add(n), o.style.cursor = "pointer", s = d;
799
+ } else
800
+ n.removeFromParent(), o.style.cursor = "default", s = null;
1032
801
  }),
1033
- eventInput.addEventListener("codeChange", () => {
1034
- if (eventInput.isKeyDown("mouse_0")) {
1035
- if (!currentSelectLine) return showSelectBox();
1036
- if (eventInput.isKeyDown("alt")) {
1037
- return this.removeSelectLine(currentSelectLine);
1038
- }
1039
- if (!eventInput.isKeyDown("control")) this.removeSelectLineAll();
1040
- this.addSelectLine(currentSelectLine);
1041
- }
802
+ t.addEventListener("codeChange", () => {
803
+ if (t.isKeyDown("mouse_0")) {
804
+ if (!s) return a();
805
+ if (t.isKeyDown("alt"))
806
+ return this.removeSelectLine(s);
807
+ t.isKeyDown("control") || this.removeSelectLineAll(), this.addSelectLine(s);
808
+ } else if (t.isKeyDown("mouse_1")) {
809
+ if (!s) return;
810
+ this.removeSelectLine(s);
811
+ } else if (t.isKeyDown("mouse_2")) {
812
+ if (!s) return;
813
+ this.addSelectLine(s);
814
+ } else t.isKeyDowns(["control", "z"]) ? e.commandManager.rollback() : t.isKeyDowns(["control", "y"]) && e.commandManager.revokeRollback();
1042
815
  }),
1043
816
  function() {
1044
- object3D.removeFromParent();
817
+ n.removeFromParent();
1045
818
  }
1046
819
  );
1047
820
  }
@@ -1049,34 +822,46 @@ class Default extends Component {
1049
822
  * 清理
1050
823
  */
1051
824
  finally() {
1052
- this.canceEventRecord("clear");
1053
- this.removeSelectLineAll();
1054
- this.updateSelectLinesGeometry();
825
+ this.canceEventRecord("clear"), this.removeSelectLineAll(), this.updateSelectLinesGeometry();
1055
826
  }
1056
827
  }
1057
- class CommandFlow extends EventDispatcher {
828
+ class fn extends Xe {
1058
829
  list = [];
1059
830
  rollbacklist = [];
1060
- revokeList = [];
1061
- add(operation) {
1062
- this.list.push(operation);
1063
- return this;
831
+ revokeRollbacklist = [];
832
+ // 是否写入操作记录
833
+ writeOperationList = !0;
834
+ /**
835
+ *
836
+ * @param operation
837
+ * @returns
838
+ */
839
+ add(e) {
840
+ return this.list.push(e), this;
1064
841
  }
1065
- addRollback(callBack) {
842
+ /** 添加回滚回调列表
843
+ * @param callBack
844
+ */
845
+ addRollback(e) {
846
+ return this.rollbacklist.push(e), this;
1066
847
  }
1067
- addRevoke(callBack) {
848
+ /** 添加撤回回滚回调列表
849
+ * @param callBack
850
+ * @returns
851
+ */
852
+ addRevokeRollback(e) {
853
+ return this.revokeRollbacklist.push(e), this;
1068
854
  }
1069
855
  }
1070
- class CommandManager extends EventDispatcher {
856
+ class yn extends Xe {
1071
857
  commandFlowMap = /* @__PURE__ */ new Map();
1072
- lock = false;
858
+ lock = !1;
1073
859
  abortController = null;
1074
860
  resolve = null;
1075
861
  currentName = null;
1076
- _disabled = false;
1077
- set disabled(disabled) {
1078
- this._disabled = disabled;
1079
- if (this._disabled) this.cancel();
862
+ _disabled = !1;
863
+ set disabled(e) {
864
+ this._disabled = e, this._disabled && this.cancel();
1080
865
  }
1081
866
  get disabled() {
1082
867
  return this._disabled;
@@ -1093,11 +878,10 @@ class CommandManager extends EventDispatcher {
1093
878
  * @param name
1094
879
  * @returns
1095
880
  */
1096
- addCommandFlow(name) {
1097
- if (this.commandFlowMap.has(name)) throw new Error(`${name} 命令已经存在`);
1098
- const commandFlow = new CommandFlow();
1099
- this.commandFlowMap.set(name, commandFlow);
1100
- return commandFlow;
881
+ addCommandFlow(e) {
882
+ if (this.commandFlowMap.has(e)) throw new Error(`${e} 命令已经存在`);
883
+ const t = new fn();
884
+ return this.commandFlowMap.set(e, t), t;
1101
885
  }
1102
886
  executionPromise = null;
1103
887
  executionResolve = null;
@@ -1105,162 +889,141 @@ class CommandManager extends EventDispatcher {
1105
889
  * @param name
1106
890
  * @returns
1107
891
  */
1108
- async start(name, data = null, step = 0) {
892
+ async start(e, t = null, n = 0) {
1109
893
  if (this.disabled) throw new Error("命令管理器已禁用,无法启动新的命令流");
1110
- this.dispatchEvent({
894
+ if (this.dispatchEvent({
1111
895
  type: "startedBefore",
1112
- name,
896
+ name: e,
1113
897
  currentName: this.currentName
1114
- });
1115
- this.executionPromise && await this.executionPromise;
1116
- this.executionPromise = null;
1117
- if (this.lock) {
898
+ }), this.executionPromise && await this.executionPromise, this.executionPromise = null, this.lock)
1118
899
  throw new Error("命令管理器已被 " + this.currentName + " 命令锁定,无法启动新的命令流,请退出或等待命令执行结束");
1119
- }
1120
- const commandFlow = this.commandFlowMap.get(name);
1121
- if (!commandFlow) {
1122
- throw new Error(`命令流 ${name} 不存在`);
1123
- }
1124
- this.lock = true;
1125
- this.abortController = new AbortController();
1126
- this.currentName = name;
1127
- commandFlow.dispatchEvent({ type: "started" });
1128
- this.dispatchEvent({ type: "started", name });
900
+ const o = this.commandFlowMap.get(e);
901
+ if (!o)
902
+ throw new Error(`命令流 ${e} 不存在`);
903
+ this.lock = !0, this.abortController = new AbortController(), this.currentName = e, o.dispatchEvent({ type: "started" }), this.dispatchEvent({ type: "started", name: e });
1129
904
  try {
1130
- for (let i = step; i < commandFlow.list.length; i++) {
1131
- const operation = commandFlow.list[i];
1132
- commandFlow.dispatchEvent({ type: "executing", index: i });
1133
- this.dispatchEvent({ type: "executing", name, index: i });
1134
- data = await new Promise((resolve) => {
1135
- this.resolve = resolve;
1136
- operation(resolve, data);
1137
- });
1138
- if (this.abortController.signal.aborted) {
1139
- commandFlow.dispatchEvent({ type: "executionInterrupt", index: i });
1140
- this.dispatchEvent({ type: "executionInterrupt", name, index: i });
1141
- this.dispatchEvent({ type: "cancel", name });
905
+ for (let s = n; s < o.list.length; s++) {
906
+ const a = o.list[s];
907
+ if (o.dispatchEvent({ type: "executing", index: s }), this.dispatchEvent({ type: "executing", name: e, index: s }), t = await new Promise((d) => {
908
+ this.resolve = d, a(d, t);
909
+ }), this.abortController.signal.aborted) {
910
+ o.dispatchEvent({ type: "executionInterrupt", index: s }), this.dispatchEvent({ type: "executionInterrupt", name: e, index: s }), this.dispatchEvent({ type: "cancel", name: e });
1142
911
  break;
1143
- } else {
1144
- commandFlow.dispatchEvent({ type: "executionCompleted", index: i, data });
1145
- this.dispatchEvent({ type: "executionCompleted", name, index: i, data });
1146
- }
912
+ } else
913
+ o.dispatchEvent({ type: "executionCompleted", index: s, data: t }), this.dispatchEvent({ type: "executionCompleted", name: e, index: s, data: t });
1147
914
  }
1148
- } catch (error) {
1149
- console.error(error);
915
+ } catch (s) {
916
+ console.error(s);
1150
917
  } finally {
1151
- if (this.abortController && !this.abortController.signal.aborted) {
1152
- commandFlow.dispatchEvent({ type: "completed", data });
1153
- this.dispatchEvent({ type: "completed", name, data });
1154
- this.operationList.push({ name, data });
1155
- this.rollbackList.length = 0;
1156
- }
1157
- this.lock = false;
1158
- this.abortController = null;
1159
- this.currentName = null;
1160
- commandFlow.dispatchEvent({ type: "finally" });
1161
- this.dispatchEvent({ type: "finally", name });
1162
- if (this.executionResolve) {
1163
- this.executionResolve(null);
1164
- this.executionResolve = null;
1165
- }
918
+ this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), o.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
1166
919
  }
1167
- return data;
920
+ return t;
1168
921
  }
1169
922
  /** 取消当前命令
1170
923
  */
1171
924
  cancel() {
1172
- if (this.abortController) {
1173
- this.abortController.abort();
1174
- if (this.resolve) this.resolve();
1175
- this.executionPromise = new Promise((resolve) => this.executionResolve = resolve);
1176
- }
925
+ this.abortController && (this.abortController.abort(), this.resolve && this.resolve(), this.executionPromise = new Promise((e) => this.executionResolve = e));
1177
926
  }
1178
927
  /**
1179
928
  * 回滚
1180
929
  */
1181
930
  rollback() {
931
+ try {
932
+ const e = this.operationList.pop();
933
+ if (!e) return !1;
934
+ const t = this.commandFlowMap.get(e.name);
935
+ if (!t) return !1;
936
+ const n = t.rollbacklist.reduce((o, s) => s(o), e.data);
937
+ return this.dispatchEvent({ type: "rollback", name: e.name }), this.rollbackList.push({
938
+ data: n,
939
+ name: e.name
940
+ }), !0;
941
+ } catch (e) {
942
+ throw new Error(`回滚失败:${e}`);
943
+ }
1182
944
  }
1183
- revoke() {
945
+ /**
946
+ * 撤销回滚
947
+ */
948
+ revokeRollback() {
949
+ try {
950
+ const e = this.rollbackList.pop();
951
+ if (!e) return !1;
952
+ const t = this.commandFlowMap.get(e.name);
953
+ if (!t) return !1;
954
+ const n = t.revokeRollbacklist.reduce((o, s) => s(o), e.data);
955
+ return this.dispatchEvent({ type: "revokeRollback", name: e.name }), this.operationList.push({ name: e.name, data: n }), !0;
956
+ } catch (e) {
957
+ throw new Error(`撤回回滚失败:${e}`);
958
+ }
1184
959
  }
1185
960
  }
1186
- const connection = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e";
1187
- const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
961
+ const wn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5569'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M522.1888%20811.3152a412.1088%20412.1088%200%200%200-114.5344-269.7728l-244.48%20269.7728h359.0144zM450.816%20493.824c83.5072%2085.3504%20132.7104%20197.4784%20136.5504%20317.4912h417.5872v63.232H18.9952L676.1472%20149.4016l48.9472%2041.7792-274.2784%20302.6432z'%20%3e%3c/path%3e%3c/svg%3e", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
962
+ __proto__: null,
963
+ default: wn
964
+ }, Symbol.toStringTag, { value: "Module" })), Cn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e", xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
965
+ __proto__: null,
966
+ default: Cn
967
+ }, Symbol.toStringTag, { value: "Module" })), En = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8193'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M426.666667%20255.872c0%2031.232-8.405333%2060.544-23.04%2085.76L512%20451.498667l287.061333-287.061334a85.333333%2085.333333%200%200%201%20120.661334%200l-516.693334%20516.693334a170.666667%20170.666667%200%201%201-60.330666-60.330667l108.970666-108.970667-108.970666-108.970666A170.666667%20170.666667%200%201%201%20426.666667%20255.872z%20m-85.333334%200a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z%20m578.389334%20603.392a85.333333%2085.333333%200%200%201-120.661334%200l-226.858666-226.858667%2060.373333-60.330666%20287.146667%20287.146666zM682.666667%20469.205333h85.333333v85.333334h-85.333333v-85.333334z%20m170.666666%200h85.333334v85.333334h-85.333334v-85.333334z%20m-597.333333%200h85.333333v85.333334H256v-85.333334z%20m-170.666667%200h85.333334v85.333334H85.333333v-85.333334z%20m170.666667%20384a85.333333%2085.333333%200%201%200%200-170.666666%2085.333333%2085.333333%200%200%200%200%20170.666666z'%3e%3c/path%3e%3c/svg%3e", Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1188
968
  __proto__: null,
1189
- default: connection
1190
- }, Symbol.toStringTag, { value: "Module" }));
1191
- const deleteSelectLine = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e";
1192
- const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
969
+ default: En
970
+ }, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1193
971
  __proto__: null,
1194
- default: deleteSelectLine
1195
- }, Symbol.toStringTag, { value: "Module" }));
1196
- const deleteSelectWindow = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e";
1197
- const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
972
+ default: Ln
973
+ }, Symbol.toStringTag, { value: "Module" })), In = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e", Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1198
974
  __proto__: null,
1199
- default: deleteSelectWindow
1200
- }, Symbol.toStringTag, { value: "Module" }));
1201
- const door = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e";
1202
- const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
975
+ default: In
976
+ }, Symbol.toStringTag, { value: "Module" })), Dn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e", An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1203
977
  __proto__: null,
1204
- default: door
1205
- }, Symbol.toStringTag, { value: "Module" }));
1206
- const intersectionConnection = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e";
1207
- const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
978
+ default: Dn
979
+ }, Symbol.toStringTag, { value: "Module" })), _n = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e", Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1208
980
  __proto__: null,
1209
- default: intersectionConnection
1210
- }, Symbol.toStringTag, { value: "Module" }));
1211
- const line = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e";
1212
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
981
+ default: _n
982
+ }, Symbol.toStringTag, { value: "Module" })), Bn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1213
983
  __proto__: null,
1214
- default: line
1215
- }, Symbol.toStringTag, { value: "Module" }));
1216
- const mergeLine = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e";
1217
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
984
+ default: Bn
985
+ }, Symbol.toStringTag, { value: "Module" })), Rn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e", On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1218
986
  __proto__: null,
1219
- default: mergeLine
1220
- }, Symbol.toStringTag, { value: "Module" }));
1221
- const selectAll = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e";
1222
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
987
+ default: Rn
988
+ }, Symbol.toStringTag, { value: "Module" })), Fn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e", Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1223
989
  __proto__: null,
1224
- default: selectAll
1225
- }, Symbol.toStringTag, { value: "Module" }));
1226
- const selectPoint = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e";
1227
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
990
+ default: Fn
991
+ }, Symbol.toStringTag, { value: "Module" })), zn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e", Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1228
992
  __proto__: null,
1229
- default: selectPoint
1230
- }, Symbol.toStringTag, { value: "Module" }));
1231
- const verticalCorrection = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e";
1232
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
993
+ default: zn
994
+ }, Symbol.toStringTag, { value: "Module" })), Vn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e", jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1233
995
  __proto__: null,
1234
- default: verticalCorrection
1235
- }, Symbol.toStringTag, { value: "Module" }));
1236
- const window$1 = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e";
1237
- const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
996
+ default: Vn
997
+ }, Symbol.toStringTag, { value: "Module" })), Gn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e", Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1238
998
  __proto__: null,
1239
- default: window$1
1240
- }, Symbol.toStringTag, { value: "Module" }));
1241
- class RenderManager extends Component {
999
+ default: Gn
1000
+ }, Symbol.toStringTag, { value: "Module" })), Hn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e", Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1001
+ __proto__: null,
1002
+ default: Hn
1003
+ }, Symbol.toStringTag, { value: "Module" })), Un = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1759051895215'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1800'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M272.5888%20886.784v70.8608H203.2128V886.784h69.376z%20m416.256-256.6144l270.6944%20152.5248-270.6944%20148.1216v-114.8928H64.4608v-70.8608h624.384v-114.8928z%20m-416.256-26.88v70.912H203.2128v-70.912h69.376z%20m0-141.7216V532.48H203.2128V461.568h69.376z%20m-34.7136-398.336L385.024%20319.7952H272.5888V390.656H203.2128V319.8464H90.7776l147.0976-256.6656z'%20fill='%23444444'%20p-id='1801'%3e%3c/path%3e%3cpath%20d='M566.272%2073.3184l173.2608%20264.192V512h71.8848V337.5104l173.2608-264.192H898.048l-122.2656%20197.2224-122.88-197.2224H566.272z'%20fill='%230077FF'%20p-id='1802'%3e%3c/path%3e%3c/svg%3e", Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1004
+ __proto__: null,
1005
+ default: Un
1006
+ }, Symbol.toStringTag, { value: "Module" })), qn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e", Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1007
+ __proto__: null,
1008
+ default: qn
1009
+ }, Symbol.toStringTag, { value: "Module" })), Yn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKdUlEQVR4AeydbZrUKBRGq2YjOjvpWYntStSVjK5EdzLOSsr7arBLOkkBAcLHmacwlQQInMsZUvdP/3Xhv+oEbrfbk5XYz1P1gfLAC4KwCCCwQwBBduBwCwIIwhqAwA4BBNmBwy0IFBQEuBDonwCC9B9DZlCQAIIUhEvX/RNAkP5jyAwKEkCQgnDpun8CfQrSP3dm0AkBBOkkUAzzHAIIcg53ntoJAQTpJFAM8xwCCHIOd57aCQEE8QLFKQTuCSDIPQ2+Q8AjgCAeEE4hcE8AQe5p8B0CHgEE8YBwCoF7AghyT6Psd3rvkACCdBg0hlyPAILUY82TOiSAIB0GjSHXI4Ag9VjzpA4JIEiHQXs9ZK6UIoAgpcjS7xAEEGSIMDKJUgQQpBRZ+h2CAIIMEUYmUYoAgpQiO0q/k88DQSZfAEx/nwCC7PPh7uQEEGTyBcD09wkgyD4f7k5OAEEmXwBnTr+HZyNID1FijKcRQBAP/e12e2vl2cqHUsUe+c5K7OddqfG4fmMHNEN9BPGifL1ev9ulN1Y+FizP1nfsR21Kjun/2AHNUB9BVqJsknyyy1qMdpji89nm/HmKmUZOEkE2gNmCkSTaTTZqDHP5m831/TCz+TWRbP8iyA5KWzh/2+2RJfluc/zH5shngwCCbIC5u6wFNKIkmhM7x12g174iyBqVu2v2f1gtpBFft97b3L7dTZWvKwQQZAWKf8kWkn7Aqvi3ej1HjsDIIUggKJNEu8gImS0yVoExV7XXgugqZZXAIoleuVbvd3CRjFVkkBAkEphJ0mtmi4xVZKxVHUFEIb70ltnSrkfGKj7OFwRJgGa7iBacfpPomNBD9Sb8KE9EjiCJ4EwSZbVUEnuo1gw5DqCuKsiBcTbZ1CTRLtJyZouM1cGVgyAHAS6StPiqRcbqYGzVHEFE4WAxSVrLbJGxOhhT1xxBHInjx1YyW9rNyFgdj+fPHhDkJ4bj/9guooWp3yQ6Hu8wvQd+lKeze9VyFEFeTeyMCyaJsloqZzxez0QOUchYECQjTHVlkmgXOSOzRcZKAchcECQzUHW3SFLzVYuMlcAXKAhSAKq6NElqZbbIWAl4oYIghcAu3ZbObGmXImO1wC5xQJCHVNMr2C6iBazfJDqmd7Tdkh/l22yy3EGQLBi3OzFJlNVS2a6Udgc50rhFtUKQKFxplU0S7SI5M1tkrNJCEd0KQaKRpTVYJMnxqkXGKi0ESa0QJAlbWiOT5Ghmi4xVGvrkVgiSjC654UtmK64L7T5krOKYHa6NIIcRxnVgu4gWun6T6BjTmB/lMbQy1UWQTCBjujFJlNVSCW2GHKGkMtdDkMxAQ7szSbSLhGS2yFiFQi1QD0EKQA3tcpFk71WLjFUozEL1EKQQ2NBuTZKtzNahjFXo86m3TwBB9vnUuutntrSrkLGqRX/nOQiyA6fWLdtFJIR+k+iox/KjXBQaKAjSQBA0BJNEWS0V5BCQRgqCNBIIDcMk+WRFkuiU0gABBGkgCJ0NYarhIshU4WaysQQQJJYY9acigCBThZvJxhJAkFhi1J+KAIJMFe7WJ9ve+BCkvZgwooYIIEhDwWAo7RFAkPZiwogaIoAgDQWDobRHAEHaiwkjKkEgsU8ESQRHszkIIMgccWaWiQQQJBEczeYggCBzxJlZJhJAkERwNJuDQIggc5BglhBYIZBNkNvt9kSBQStrYGWtJ13KJsjy9K92pFwuMDiXgS3DPJ/cguQZFb1AoBECCNJIIBhGmwROFqRNKIwKAo4AgjgSHCGwQgBBVqBwCQKOAII4EhwhsEIAQVagcAkCjsC4grgZcoTAAQIIcgAeTccngCDjx5gZHiCAIAfg0XR8ArkF0V9KolwuMDiXQTZzswlyvV71ByenKMy1/VjnMiSbILkGRD8QaIkAgrQUDcbSHAEEaS4kDKglAgjSUjQYS3MEEKStkDCaxgggSGMBYThtEUCQtuLBaBojgCCNBYThtEUAQdqKB6NpjACCNBaQcsOh5xQCCJJCjTbTEECQaULNRFMIIEgKNdpMQwBBpgk1E00hgCAp1GjzJ4GBzxBk4OAyteMEEOQ4Q3oYmACCNBTc2+32bOVDQ0OafigI0sgSMDGebCj/Wvlo39/akU8DBBCkgSAsQuiP7rjR/Ldcc+fTHs+eOIKcHIFFBO0c/ki+Lvf865xXJIAgFWFvPEpy6PXKv63XrA9I4mOpe44gdXn/8TRb/FtyuHrP9uWdFT4nEUCQk8CbHFr8Ko9GoB/tZLYeUSp0H0EKgd3r1uTQK5V2j71q9/ckiV657q/x/RiBoNYIEoQpXyWTQwv9PmMV2jmZrVBSGeshSEaYj7pa5IjZOfwuyWz5RAqfI0hhwF73kkOvV97l4FPtPmS2gnEdr4ggxxkG9WC7x1E53HP0w57MlqNR+IgghQGre5NDi1pFpzmKfrST2cpB8kEfaYI86JTbLwRMDr1Safd4uZjnmyTRK1ee3uhllQCCrGLJc9Hk0AJOyViFDoDMViipxHoIkgjuUbNFjhI7h/9oMls+kYznCJIRpteV5NDrlXc5+6l2KTJb2bH+6hBBfnHI+q/tHrXkcONWAoDMlqOR8dicIBnndkpXJocWq0rt5+tHO5mtzNQRJCNQk0OvVNo9MvYa1ZUk0StXVCMqbxNAkG02UXdMDi3Mkhmr0PGQ2QolFVAPQQIgPaqyyHHmzuEPkcyWTyTxHEESwXnNJIder7zLp51qNyOzlQH/TIJkwPW6C9s9WpPDDVKJAjJbjkbiEUESwamZyaFFqKLTFot+tJPZOhAZBEmEZ3LolUq7R2IP1ZpJEr1yVXvgSA9CkIRomhxacC1krEJHT2YrlJRXD0E8II9OFzl62Dn8qZDZ8okEnCNIACSviuTQ69Xd5S6+atcjsxUZKgSJAGa7R69yuFkqoUBmy9EIOCJIACRVMTm0uFR02nPRj3YyW4ERRJAAUCaHXqm0ewTU7qKKJNErVxeDPXOQCPKAvsmhhdRTxurBjH7fJrP1G8X2FwTZZnNZ5Dh359gZX4ZbZLYeQESQfUCSQ69X+7X6vavdkczWTvwQZAOO7R6jy+FmrsQDmS1HwzsiiAdEpyaHFo2KTmco+tFOZmsl0giyAsUuvbHysWD5bH3HftSm5JhixzNFfQRZCfP1ev10LVjskV+sxH6+5B6T31/sgGaojyAzRJk5JhNAkGR0NJyBAILMEGXmmEwAQZLR0XAGAggyQ5Trz3GYJyLIMKFkIiUIIEgJqvQ5DAEEGSaUTKQEAQQpQZU+hyGAIMOEcpaJ1J0ngtTlzdM6I4AgnQWM4dYlgCB1efO0zgggSGcBY7h1CSBIXd48rWUCK2NDkBUoXIKAI4AgjgRHCKwQQJAVKFyCgCOAII4ERwisEECQFShcgoAjkEsQ1x9HCAxFAEGGCieTyU0AQXITpb+hCCDIUOFkMrkJIEhuovQ3FIEOBBmKN5PpjACCdBYwhluXAILU5c3TOiOAIJ0FjOHWJYAgdXnztM4IzC1IZ8FiuPUJIEh95jyxIwII0lGwGGp9AghSnzlP7IgAgnQULIZanwCCFGJOt2MQ+AEAAP//U3PGlQAAAAZJREFUAwA3ILMm/jaVEAAAAABJRU5ErkJggg==", Xn = new m.TextureLoader(), $n = Xn.load(Yn);
1010
+ class eo extends Ce {
1242
1011
  static name = "RenderManager";
1243
- container = new THREE.Group();
1012
+ container = new m.Group();
1244
1013
  lines = [];
1245
- pointVirtualGrid = new PointVirtualGrid();
1246
- quadtree = new Quadtree(new Box2());
1014
+ pointVirtualGrid = new Ke();
1015
+ quadtree = new ze(new Ye());
1247
1016
  actionHistory = /* @__PURE__ */ new Set();
1017
+ verticalReferenceLineFlag = new m.Mesh(new m.PlaneGeometry(0.3, 0.3), new m.MeshBasicMaterial({ map: $n, color: 58111, transparent: !0 }));
1248
1018
  onAddFromParent() {
1249
- const dxfLineModel = this.dxfLineModel;
1250
- this.editor.container.add(this.container);
1251
- this.editor.container.add(dxfLineModel.dxfModelGroup);
1252
- dxfLineModel.dxfLineModel.material = new THREE.LineBasicMaterial({
1253
- transparent: true,
1019
+ const e = this.dxfLineModel;
1020
+ this.editor.container.add(this.container), this.editor.container.add(e.dxfModelGroup), e.dxfLineModel.material = new m.LineBasicMaterial({
1021
+ transparent: !0,
1254
1022
  opacity: 0.5,
1255
1023
  color: 16777215
1256
- });
1257
- dxfLineModel.addEventListener("modelUpdate", (e) => {
1258
- e.model.position.z = 0;
1259
- dxfLineModel.dxfDoorsLineModel.visible = false;
1260
- });
1261
- this.variable.addEventListener("dxfVisible", (e) => dxfLineModel.dxfModelGroup.visible = e.value);
1262
- this.dxf.addEventListener("createGroup", () => this.reset());
1263
- this.reset();
1024
+ }), e.addEventListener("modelUpdate", (t) => {
1025
+ t.model.position.z = 0, e.dxfDoorsLineModel.visible = !1;
1026
+ }), this.variable.addEventListener("dxfVisible", (t) => e.dxfModelGroup.visible = t.value), this.dxf.addEventListener("createGroup", () => this.reset()), this.reset();
1264
1027
  }
1265
1028
  updatedMode = null;
1266
1029
  /** 重新设置数据
@@ -1269,184 +1032,149 @@ class RenderManager extends Component {
1269
1032
  if (this.updatedMode === "self") {
1270
1033
  this.updatedMode = null;
1271
1034
  return;
1272
- } else {
1035
+ } else
1273
1036
  this.updatedMode = "dxf";
1274
- }
1275
- this.pointVirtualGrid = new PointVirtualGrid();
1276
- const box = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
1277
- if (box.width === 0 || box.height === 0) box.set(-200, -200, 200, 200);
1278
- this.quadtree = new Quadtree(box);
1279
- this.lines.length = 0;
1280
- this.dxf.lineSegments.forEach((line2) => {
1281
- if (line2.userData.isDoor && !line2.userData.doorDirectConnection) return;
1282
- this.addLine(line2.clone());
1283
- });
1284
- this.dxf.doorLineSegment.forEach((line2) => {
1285
- const door2 = line2.clone();
1286
- door2.userData = {
1287
- isDoor: true,
1288
- doorDirectConnection: true
1289
- };
1290
- this.addLine(door2);
1291
- });
1292
- this.draw();
1037
+ this.pointVirtualGrid = new Ke();
1038
+ const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
1039
+ (e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new ze(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
1040
+ t.userData.isDoor || this.addLine(t.clone());
1041
+ }), this.dxf.doorLineSegment.forEach((t) => {
1042
+ const n = t.clone();
1043
+ n.userData = {
1044
+ isDoor: !0,
1045
+ doorDirectConnection: !0
1046
+ }, this.addLine(n);
1047
+ }), this.draw();
1293
1048
  }
1294
1049
  /** 添加线段
1295
1050
  * @param line
1296
1051
  */
1297
- addLine(line2) {
1298
- if (!line2.userData) line2.userData = {};
1299
- this.lines.push(line2);
1300
- this.pointVirtualGrid.insert(line2.start, line2);
1301
- this.pointVirtualGrid.insert(line2.end, line2);
1302
- const quadtreeNode = {
1303
- line: line2,
1052
+ addLine(e) {
1053
+ e.userData || (e.userData = {}), this.lines.push(e), this.pointVirtualGrid.insert(e.start, e), this.pointVirtualGrid.insert(e.end, e);
1054
+ const t = {
1055
+ line: e,
1304
1056
  userData: void 0
1305
1057
  };
1306
- line2.userData.quadtreeNode = quadtreeNode;
1307
- this.quadtree.insert(quadtreeNode);
1308
- this.actionHistory.add({
1058
+ e.userData.quadtreeNode = t, this.quadtree.insert(t), this.actionHistory.add({
1309
1059
  type: "addLine",
1310
- data: [line2]
1060
+ data: [e]
1311
1061
  });
1312
1062
  }
1313
1063
  /**
1314
1064
  * 批量添加
1315
1065
  * @param lines
1316
1066
  */
1317
- addLines(lines) {
1318
- for (let i = 0; i < lines.length; i++) {
1319
- const line2 = lines[i];
1320
- this.lines.push(line2);
1321
- this.pointVirtualGrid.insert(line2.start, line2);
1322
- this.pointVirtualGrid.insert(line2.end, line2);
1323
- const quadtreeNode = {
1324
- line: line2,
1067
+ addLines(e) {
1068
+ for (let t = 0; t < e.length; t++) {
1069
+ const n = e[t];
1070
+ this.lines.push(n), this.pointVirtualGrid.insert(n.start, n), this.pointVirtualGrid.insert(n.end, n);
1071
+ const o = {
1072
+ line: n,
1325
1073
  userData: void 0
1326
1074
  };
1327
- line2.userData.quadtreeNode = quadtreeNode;
1328
- this.quadtree.insert(quadtreeNode);
1075
+ n.userData.quadtreeNode = o, this.quadtree.insert(o);
1329
1076
  }
1330
1077
  this.actionHistory.add({
1331
1078
  type: "addLine",
1332
- data: [...lines]
1079
+ data: [...e]
1333
1080
  });
1334
1081
  }
1335
1082
  /** 移除线段
1336
1083
  * @param line
1337
1084
  */
1338
- removeLine(line2) {
1339
- line2.userData.quadtreeNode && this.quadtree.remove(line2.userData.quadtreeNode);
1340
- this.pointVirtualGrid.remove(line2.start);
1341
- this.pointVirtualGrid.remove(line2.end);
1342
- const index = this.lines.indexOf(line2);
1343
- this.lines.splice(index, 1);
1344
- this.draw();
1345
- this.actionHistory.add({
1085
+ removeLine(e) {
1086
+ e.userData.quadtreeNode && this.quadtree.remove(e.userData.quadtreeNode), this.pointVirtualGrid.remove(e.start), this.pointVirtualGrid.remove(e.end);
1087
+ const t = this.lines.indexOf(e);
1088
+ this.lines.splice(t, 1), this.draw(), this.actionHistory.add({
1346
1089
  type: "removeLine",
1347
- data: [line2]
1090
+ data: [e]
1348
1091
  });
1349
1092
  }
1350
1093
  /**
1351
1094
  * 绘制
1352
1095
  */
1353
- draw(synchronize = true) {
1096
+ draw(e = !0) {
1354
1097
  this.container.clear();
1355
- const position = [], doorPosition = [], windowPosition = [];
1356
- this.lines.forEach((line2) => {
1357
- line2.points.forEach((p) => {
1358
- if (line2.userData.isDoor) doorPosition.push(p.x, p.y, 0);
1359
- else position.push(p.x, p.y, 0);
1360
- });
1361
- if (line2.userData.isWindow && line2.userData.drawDoorData) {
1362
- line2.userData.drawDoorData.forEach(({ width, p }) => {
1363
- const center = Point.from(p), direction = line2.direction(), start = center.clone().add(direction.clone().multiplyScalar(width * 0.5)), end = center.clone().add(direction.clone().multiplyScalar(-width * 0.5));
1364
- windowPosition.push(start.x, start.y, 1e-3);
1365
- windowPosition.push(end.x, end.y, 1e-3);
1366
- });
1098
+ const t = [], n = [], o = [];
1099
+ this.lines.forEach((s) => {
1100
+ if (s.points.forEach((a) => {
1101
+ s.userData.isDoor ? n.push(a.x, a.y, 0) : t.push(a.x, a.y, 0);
1102
+ }), s.userData.isWindow && s.userData.drawWindow && s.userData.drawWindow.forEach(({ width: a, p: d }) => {
1103
+ const i = V.from(d), c = s.direction(), l = i.clone().add(c.clone().multiplyScalar(a * 0.5)), h = i.clone().add(c.clone().multiplyScalar(-a * 0.5));
1104
+ o.push(l.x, l.y, 1e-3), o.push(h.x, h.y, 1e-3);
1105
+ }), s.userData.isVerticalReferenceLine) {
1106
+ const a = s.center;
1107
+ this.verticalReferenceLineFlag.position.set(a.x, a.y, 0), this.container.add(this.verticalReferenceLineFlag);
1367
1108
  }
1368
- });
1369
- position.length && this.renderer.createLineSegments({
1370
- position
1371
- }, position.length / 3, {
1109
+ }), t.length && this.renderer.createLineSegments({
1110
+ position: t
1111
+ }, t.length / 3, {
1372
1112
  color: 5745151
1373
- }, this.container);
1374
- doorPosition.length && this.renderer.createLineSegments({
1375
- position: doorPosition
1376
- }, doorPosition.length / 3, {
1113
+ }, this.container), n.length && this.renderer.createLineSegments({
1114
+ position: n
1115
+ }, n.length / 3, {
1377
1116
  color: 16776960
1378
- }, this.container);
1379
- windowPosition.length && this.renderer.createLineSegments({
1380
- position: windowPosition
1381
- }, windowPosition.length / 3, {
1117
+ }, this.container), o.length && this.renderer.createLineSegments({
1118
+ position: o
1119
+ }, o.length / 3, {
1382
1120
  color: 16711935
1383
- }, this.container);
1384
- synchronize && this.synchronizeDxf();
1121
+ }, this.container), e && this.synchronizeDxf();
1385
1122
  }
1386
1123
  /** 获取鼠标当前点, 吸附后的点
1387
1124
  * @param point
1388
1125
  * @returns
1389
1126
  */
1390
- adsorption(radius = 0.1, pointVirtualGrid = this.pointVirtualGrid, quadtree = this.quadtree) {
1391
- const editor = this.parent?.findComponentByName("Editor"), point = Point.from(editor.pointerPosition);
1392
- const p = pointVirtualGrid.queryCircle(point, radius).sort((a, b) => a.point.distance(point) - b.point.distance(point));
1393
- if (p.length) return {
1394
- point: new THREE.Vector3(p[0].point.x, p[0].point.y, 0),
1395
- find: true,
1127
+ adsorption(e = 0.1, t = this.pointVirtualGrid, n = this.quadtree) {
1128
+ const o = this.parent?.findComponentByName("Editor"), s = V.from(o.pointerPosition), a = t.queryCircle(s, e).sort((i, c) => i.point.distance(s) - c.point.distance(s));
1129
+ if (a.length) return {
1130
+ point: new m.Vector3(a[0].point.x, a[0].point.y, 0),
1131
+ find: !0,
1396
1132
  mode: "point",
1397
- line: p[0].userData
1133
+ line: a[0].userData
1398
1134
  };
1399
- let result = quadtree.queryCircle(point, radius);
1400
- if (result.length) {
1401
- let projectPoints = result.map((res) => res.line.projectPoint(point));
1402
- projectPoints.sort((a, b) => {
1403
- if (a && b) return a.distance(point) - b.distance(point);
1404
- return 0;
1405
- });
1406
- result = result.filter((_, i) => !!projectPoints[i]);
1407
- projectPoints = projectPoints.filter((_, i) => !!projectPoints[i]);
1408
- return {
1409
- point: new THREE.Vector3(projectPoints[0].x, projectPoints[0].y, 0),
1410
- find: true,
1135
+ let d = n.queryCircle(s, e);
1136
+ if (d.length) {
1137
+ let i = d.map((c) => c.line.projectPoint(s));
1138
+ return i.sort((c, l) => c && l ? c.distance(s) - l.distance(s) : 0), d = d.filter((c, l) => !!i[l]), i = i.filter((c, l) => !!i[l]), {
1139
+ point: new m.Vector3(i[0].x, i[0].y, 0),
1140
+ find: !0,
1411
1141
  mode: "line",
1412
- line: result[0].line
1142
+ line: d[0].line
1413
1143
  };
1414
1144
  }
1415
1145
  return {
1416
- point: new THREE.Vector3(editor.pointerPosition.x, editor.pointerPosition.y, 0),
1417
- find: false
1146
+ point: new m.Vector3(o.pointerPosition.x, o.pointerPosition.y, 0),
1147
+ find: !1
1418
1148
  };
1419
1149
  }
1420
1150
  /** 创建几何体
1421
1151
  * @param rectangle
1422
1152
  */
1423
- createGeometry(map, count) {
1424
- const geometry = new THREE.BufferGeometry();
1425
- Object.keys(map).forEach((k) => {
1426
- geometry.setAttribute("position", new THREE.BufferAttribute(new Float32Array(map[k]), map[k].length / count));
1427
- });
1428
- return geometry;
1153
+ createGeometry(e, t) {
1154
+ const n = new m.BufferGeometry();
1155
+ return Object.keys(e).forEach((o) => {
1156
+ n.setAttribute("position", new m.BufferAttribute(new Float32Array(e[o]), e[o].length / t));
1157
+ }), n;
1429
1158
  }
1430
1159
  /**
1431
1160
  * 转为json
1432
1161
  */
1433
1162
  toJson() {
1434
- return this.lines.map((line2) => {
1435
- const userData = line2.userData;
1436
- const drawDoorData = userData.drawDoorData;
1437
- const insetionArr = this.quadtree.queryLineSegment(line2).filter((r) => r.line !== line2 && !r.userData?.isDoor).map((r) => ({ index: this.lines.indexOf(r.line) }));
1163
+ return this.lines.map((e) => {
1164
+ const t = e.userData, n = t.drawWindow, o = this.quadtree.queryLineSegment(e).filter((s) => s.line !== e && !s.userData?.isDoor).map((s) => ({ index: this.lines.indexOf(s.line) }));
1438
1165
  return {
1439
- start: line2.start.toJson(this.dxf.originalZAverage),
1440
- end: line2.end.toJson(this.dxf.originalZAverage),
1441
- insetionArr,
1442
- isDoor: userData.isDoor,
1443
- doorDirectConnection: userData.isDoor,
1444
- length: line2.length(),
1445
- isWindow: userData.isWindow,
1446
- drawDoorData: drawDoorData && drawDoorData.map((w) => ({
1447
- p: { x: w.p.x, y: w.p.y, z: w.p.z },
1448
- width: w.width,
1449
- full: w.full
1166
+ start: e.start.toJson(this.dxf.originalZAverage),
1167
+ end: e.end.toJson(this.dxf.originalZAverage),
1168
+ insetionArr: o,
1169
+ isDoor: t.isDoor,
1170
+ doorDirectConnection: t.isDoor,
1171
+ length: e.length(),
1172
+ isWindow: t.isWindow,
1173
+ isVerticalReferenceLine: t.isVerticalReferenceLine,
1174
+ drawWindow: n && n.map((s) => ({
1175
+ p: { x: s.p.x, y: s.p.y, z: s.p.z },
1176
+ width: s.width,
1177
+ full: s.full
1450
1178
  }))
1451
1179
  };
1452
1180
  });
@@ -1460,13 +1188,11 @@ class RenderManager extends Component {
1460
1188
  this.updatedMode = null;
1461
1189
  return;
1462
1190
  }
1463
- if (this._timer) clearTimeout(this._timer);
1464
- setTimeout(() => {
1191
+ this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
1465
1192
  this.updatedMode = "self";
1466
- const dxf = this.dxf;
1467
- const json = this.toJson();
1468
- dxf.set(json).then(() => {
1469
- dxf.lineOffset();
1193
+ const e = this.dxf, t = this.toJson();
1194
+ e.set(t).then(() => {
1195
+ e.lineOffset();
1470
1196
  });
1471
1197
  }, 10);
1472
1198
  }
@@ -1489,957 +1215,1231 @@ class RenderManager extends Component {
1489
1215
  return this.parent?.findComponentByName("DxfLineModel");
1490
1216
  }
1491
1217
  }
1492
- class DrawDoorLine extends CommandFlowComponent {
1218
+ class to extends N {
1493
1219
  static name = "DrawDoorLine";
1494
- container = new THREE.Group();
1220
+ container = new m.Group();
1495
1221
  interruptKeys = ["escape"];
1496
1222
  shortcutKeys = ["control", "m"];
1497
1223
  commandName = "draw-door-line";
1498
- onAddFromParent(parent) {
1499
- super.onAddFromParent(parent);
1500
- const editor = parent.findComponentByName("Editor"), eventInput = editor.eventInput, commandManager = editor.commandManager;
1224
+ onAddFromParent(e) {
1225
+ super.onAddFromParent(e);
1226
+ const t = e.findComponentByName("Editor"), n = t.eventInput, o = t.commandManager;
1501
1227
  this.editor.container.add(this.container);
1502
- const commandFlow = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this));
1503
- eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
1504
- commandFlow.addEventListener("finally", this.createFinally());
1505
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1506
- eventInput.addCancelDefaultBehavior(() => eventInput.isOnlyKeyDowns(this.shortcutKeys));
1507
- eventInput.addEventListener("codeChange", async () => {
1508
- eventInput.isKeyCombination(this.commandName) && await commandManager.start(this.commandName);
1228
+ const s = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1229
+ n.addKeyCombination(this.commandName, this.shortcutKeys), s.addEventListener("finally", this.createFinally()), s.addEventListener("completed", (a) => this.completed(a.data)), n.addCancelDefaultBehavior(() => n.isOnlyKeyDowns(this.shortcutKeys)), n.addEventListener("codeChange", async () => {
1230
+ n.isKeyCombination(this.commandName) && await o.start(this.commandName);
1509
1231
  });
1510
1232
  }
1511
1233
  /** 选择点
1512
1234
  * @param next
1513
1235
  */
1514
- selectPoint(next) {
1515
- let editor = this.parent?.findComponentByName("Editor"), start = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 65280 })), line2 = new Lines([], 16711935), auxiliaryLine = new Lines([
1516
- new THREE.Vector3(-1e4, 0, 0),
1517
- new THREE.Vector3(1e4, 0, 0),
1518
- new THREE.Vector3(0, -1e4, 0),
1519
- new THREE.Vector3(0, 1e4, 0)
1236
+ selectPoint(e) {
1237
+ let t = this.parent?.findComponentByName("Editor"), n = null, o = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 65280 })), s = new fe([], 16711935), a = new fe([
1238
+ new m.Vector3(-1e4, 0, 0),
1239
+ new m.Vector3(1e4, 0, 0),
1240
+ new m.Vector3(0, -1e4, 0),
1241
+ new m.Vector3(0, 1e4, 0)
1520
1242
  ], 16711935);
1521
- auxiliaryLine.material = new THREE.LineDashedMaterial({
1243
+ a.material = new m.LineDashedMaterial({
1522
1244
  color: 4235007,
1523
1245
  dashSize: 0.1,
1524
1246
  gapSize: 0.1,
1525
1247
  linewidth: 0.1
1526
- });
1527
- this.container.add(line2);
1528
- let currentPoint = null;
1248
+ }), this.container.add(s);
1249
+ let d = null;
1529
1250
  this.addEventRecord(
1530
1251
  "clear",
1531
- editor.addEventListener("pointerPositionChange", () => {
1532
- const { point, find } = editor.renderManager.adsorption(0.05);
1533
- start && line2.setPoint(start, point);
1534
- if (find) {
1535
- circle.position.set(point.x, point.y, 0);
1536
- this.container.add(circle);
1537
- this.domElement.style.cursor = "none";
1538
- currentPoint = point.clone();
1539
- } else {
1540
- currentPoint = null;
1541
- circle.removeFromParent();
1542
- this.domElement.style.cursor = "no-drop";
1543
- }
1252
+ t.addEventListener("pointerPositionChange", () => {
1253
+ const { point: i, find: c } = t.renderManager.adsorption(0.05);
1254
+ n && s.setPoint(n, i), this.dispatchEvent({ type: "pointerMove", point: i }), c ? (o.position.set(i.x, i.y, 0), this.container.add(o), this.domElement.style.cursor = "none", d = i.clone()) : (d = null, o.removeFromParent(), this.domElement.style.cursor = "no-drop");
1544
1255
  }),
1545
- editor.eventInput.addEventListener("codeChange", async () => {
1546
- if (editor.eventInput.isKeyDown("mouse_0") && currentPoint) {
1547
- if (!start) {
1548
- start = currentPoint.clone();
1256
+ t.eventInput.addEventListener("codeChange", async () => {
1257
+ if (t.eventInput.isKeyDown("mouse_0") && d) {
1258
+ if (!n) {
1259
+ n = d.clone();
1549
1260
  return;
1550
1261
  }
1551
- next([start.clone(), currentPoint.clone()]);
1262
+ e([n.clone(), d.clone()]);
1552
1263
  }
1553
1264
  }),
1554
1265
  function() {
1555
- line2.removeFromParent();
1556
- circle.removeFromParent();
1557
- auxiliaryLine.removeFromParent();
1266
+ s.removeFromParent(), o.removeFromParent(), a.removeFromParent();
1558
1267
  }
1559
1268
  );
1560
1269
  }
1561
- /** 执行完成
1270
+ /**
1271
+ * 结束处理
1272
+ * @param next
1273
+ * @param points
1562
1274
  */
1563
- completed(points) {
1564
- const editor = this.editor, lines = [];
1565
- for (let i = 0; i < points.length; i += 2) {
1566
- const line2 = new LineSegment(Point.from(points[i]), Point.from(points[i + 1]));
1567
- line2.userData.isDoor = true;
1568
- line2.userData.doorDirectConnection = true;
1569
- lines.push(line2);
1275
+ end(e, t) {
1276
+ const n = [];
1277
+ for (let o = 0; o < t.length; o += 2) {
1278
+ const s = V.from(t[o]), a = V.from(t[o + 1]), d = this.renderManager.quadtree.queryCircle(s, 1e-3)[0].line, i = this.renderManager.quadtree.queryCircle(a, 1e-3)[0].line;
1279
+ let c = null;
1280
+ d === i && (c = {
1281
+ oldLine: d,
1282
+ newLine1: new W(
1283
+ d.start,
1284
+ d.start.distance(s) < d.start.distance(a) ? s.clone() : a.clone()
1285
+ ),
1286
+ newLine2: new W(
1287
+ d.end,
1288
+ d.end.distance(s) < d.end.distance(a) ? s.clone() : a.clone()
1289
+ )
1290
+ });
1291
+ const l = new W(s, a);
1292
+ l.userData.isDoor = !0, l.userData.doorDirectConnection = !0, n.push({
1293
+ line: l,
1294
+ option: c
1295
+ });
1570
1296
  }
1571
- editor.renderManager.addLines(lines);
1572
- editor.renderManager.draw();
1297
+ e(n);
1298
+ }
1299
+ /** 执行完成
1300
+ */
1301
+ completed(e) {
1302
+ e.forEach(({ line: t, option: n }) => {
1303
+ this.renderManager.addLine(t), n && (this.renderManager.removeLine(n.oldLine), this.renderManager.addLines([n.newLine1, n.newLine2]));
1304
+ }), this.renderManager.draw();
1305
+ }
1306
+ /** 回滚操作
1307
+ * @param data
1308
+ */
1309
+ rollback(e) {
1310
+ return e.forEach(({ line: t, option: n }) => {
1311
+ this.renderManager.removeLine(t), n && (this.renderManager.addLine(n.oldLine), this.renderManager.removeLine(n.newLine1), this.renderManager.removeLine(n.newLine2));
1312
+ }), this.renderManager.draw(), e;
1313
+ }
1314
+ /** 撤回回滚
1315
+ * @param data
1316
+ * @returns
1317
+ */
1318
+ revokeRollback(e) {
1319
+ return this.completed(e), e;
1573
1320
  }
1574
1321
  }
1575
- class DrawWindow extends CommandFlowComponent {
1322
+ class no extends N {
1576
1323
  static name = "DrawWindow";
1577
- container = new THREE.Group();
1324
+ container = new m.Group();
1578
1325
  interruptKeys = ["escape"];
1579
1326
  shortcutKeys = ["control", "q"];
1580
1327
  commandName = "draw-window-line";
1581
- onAddFromParent(parent) {
1582
- super.onAddFromParent(parent);
1583
- this.editor.container.add(this.container);
1584
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this));
1585
- commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
1586
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1587
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
1588
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
1589
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1328
+ onAddFromParent(e) {
1329
+ super.onAddFromParent(e), this.editor.container.add(this.container);
1330
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1331
+ t.addEventListener("finally", this.createFinally(["selectPointStart"])), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1590
1332
  }
1591
1333
  /** 选择开始点
1592
1334
  * @param next
1593
1335
  */
1594
- selectPointStart(next) {
1595
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 })), currentLine = null;
1336
+ selectPointStart(e) {
1337
+ let t = null, n = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
1596
1338
  this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
1597
- const { point, line: line2, find } = this.editor.renderManager.adsorption();
1598
- if (find) {
1599
- this.domElement.style.cursor = "none";
1600
- circle.position.copy(point);
1601
- currentLine = line2;
1602
- currentPoint = point.clone();
1603
- this.container.add(circle);
1604
- } else {
1605
- this.domElement.style.cursor = "no-drop";
1606
- currentPoint = null;
1607
- circle.removeFromParent();
1608
- }
1339
+ const { point: s, line: a, find: d } = this.editor.renderManager.adsorption();
1340
+ this.dispatchEvent({ type: "pointerMove", point: s }), d ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
1609
1341
  })).add(this.eventInput.addEventListener("codeChange", () => {
1610
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
1611
- this.canceEventRecord("selectPointStart");
1612
- next({ point: currentPoint, line: currentLine });
1613
- }
1614
- }));
1615
- this.addEventRecord("clear").add(() => circle.removeFromParent());
1342
+ this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: o }));
1343
+ })), this.addEventRecord("clear").add(() => n.removeFromParent());
1616
1344
  }
1617
1345
  /** 选择结束点
1618
1346
  * @param next
1619
1347
  */
1620
- selectPointEnd(next, { point, line: line2 }) {
1621
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 }));
1622
- this.addEventRecord("clear").add(() => circle.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
1623
- const { point: point2, find, line: l } = this.editor.renderManager.adsorption();
1624
- if (find && l === line2) {
1625
- this.domElement.style.cursor = "none";
1626
- circle.position.copy(point2);
1627
- currentPoint = point2.clone();
1628
- this.container.add(circle);
1629
- } else {
1630
- this.domElement.style.cursor = "no-drop";
1631
- currentPoint = null;
1632
- circle.removeFromParent();
1633
- }
1348
+ selectPointEnd(e, { point: t, line: n }) {
1349
+ let o = null, s = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 }));
1350
+ this.addEventRecord("clear").add(() => s.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
1351
+ const { point: a, find: d, line: i } = this.editor.renderManager.adsorption();
1352
+ this.dispatchEvent({ type: "pointerMove", point: a }), d && i === n ? (this.domElement.style.cursor = "none", s.position.copy(a), o = a.clone(), this.container.add(s)) : (this.domElement.style.cursor = "no-drop", o = null, s.removeFromParent());
1634
1353
  })).add(this.eventInput.addEventListener("codeChange", () => {
1635
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) next({ line: line2, start: point, end: currentPoint });
1354
+ this.eventInput.isKeyDown("mouse_0") && o && e({ line: n, start: t, end: o });
1636
1355
  }));
1637
1356
  }
1357
+ /**
1358
+ * 结束处理
1359
+ * @param next
1360
+ * @param points
1361
+ */
1362
+ end(e, { start: t, end: n, line: o }) {
1363
+ const s = new W(V.from(t), V.from(n)), a = s.center, d = s.length(), i = {
1364
+ p: new m.Vector3(a.x, a.y, 0),
1365
+ width: d,
1366
+ full: Math.abs(d - o.length()) < 0.01
1367
+ };
1368
+ e({ line: o, doorDataItem: i });
1369
+ }
1638
1370
  /** 执行完成
1639
1371
  */
1640
- completed(data) {
1641
- const start = data.start, end = data.end, line2 = data.line, win = new LineSegment(Point.from(start), Point.from(end)), center = win.center, len = win.length();
1642
- line2.userData.isWindow = true;
1643
- if (!line2.userData.drawDoorData) line2.userData.drawDoorData = [];
1644
- line2.userData.drawDoorData.push({
1645
- p: new THREE.Vector3(center.x, center.y, 0),
1646
- width: len,
1647
- full: Math.abs(len - line2.length()) < 0.01
1648
- });
1649
- this.renderManager.draw();
1372
+ completed({ doorDataItem: e, line: t }) {
1373
+ t.userData.isWindow = !0, t.userData.drawWindow || (t.userData.drawWindow = []), t.userData.drawWindow.push(e), this.renderManager.draw();
1374
+ }
1375
+ /** 回滚操作
1376
+ * @param data
1377
+ */
1378
+ rollback(e) {
1379
+ const { doorDataItem: t, line: n } = e;
1380
+ if (n.userData.drawWindow) {
1381
+ const o = n.userData.drawWindow.indexOf(t);
1382
+ o !== -1 && (n.userData.drawWindow.splice(o, 1), n.userData.drawWindow.length === 0 && (delete n.userData.drawWindow, delete n.userData.isWindow), this.renderManager.draw());
1383
+ }
1384
+ return e;
1385
+ }
1386
+ /** 撤回回滚
1387
+ * @param data
1388
+ * @returns
1389
+ */
1390
+ revokeRollback(e) {
1391
+ return this.completed(e), e;
1650
1392
  }
1651
1393
  }
1652
- class VerticalCorrection extends CommandFlowComponent {
1394
+ class de extends N {
1653
1395
  static name = "VerticalCorrection";
1654
- container = new THREE.Group();
1396
+ container = new m.Group();
1655
1397
  shortcutKeys = ["control", "c"];
1398
+ shortcutKeys2 = ["control", "shift", "c"];
1656
1399
  static commandName = "verticalCorrection";
1657
- onAddFromParent(parent) {
1658
- super.onAddFromParent(parent);
1659
- this.editor.container.add(this.container);
1660
- this.container.position.z = 1e-3;
1661
- const commandFlow = this.commandManager.addCommandFlow(VerticalCorrection.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this));
1662
- commandFlow.addEventListener("finally", this.createFinally());
1663
- this.eventInput.addKeyCombination(VerticalCorrection.commandName, this.shortcutKeys);
1664
- this.eventInput.addEventListener("codeChange", async () => {
1665
- this.eventInput.isKeyCombination(VerticalCorrection.commandName) && await this.commandManager.start(VerticalCorrection.commandName, [...this.default.selectLines]);
1666
- });
1667
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1400
+ recursion = !1;
1401
+ onAddFromParent(e) {
1402
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
1403
+ const t = this.commandManager.addCommandFlow(de.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1404
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
1405
+ !this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
1406
+ }), this.eventInput.addEventListener("codeChange", async () => {
1407
+ this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(de.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !0, this.commandManager.start(de.commandName, [...this.default.selectLines]));
1408
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
1668
1409
  }
1669
1410
  /**
1670
1411
  * 进入命令约束
1671
1412
  */
1672
- constraint(next, selectLines) {
1673
- if (!Array.isArray(selectLines)) {
1674
- ElMessage({ message: "进入命令失败", type: "warning" });
1675
- this.cancel();
1676
- } else if (selectLines.length !== 1) {
1677
- ElMessage({ message: "请选择一条线段", type: "warning" });
1678
- this.cancel();
1679
- } else next(selectLines);
1413
+ constraint(e, t) {
1414
+ Array.isArray(t) ? t.length !== 1 ? (L({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1680
1415
  }
1681
1416
  /**
1682
1417
  * 线段是否为结尾线段
1683
1418
  * @param line
1684
1419
  */
1685
- lineIsPathEnd(line2) {
1686
- for (let i = 0; i < line2.points.length; i++) {
1687
- const point = line2.points[i];
1688
- const length = this.renderManager.pointVirtualGrid.queryPoint(point).filter((p) => !p.point.equal(point)).length;
1689
- if (length === 0) return true;
1420
+ lineIsPathEnd(e) {
1421
+ for (let t = 0; t < e.points.length; t++) {
1422
+ const n = e.points[t];
1423
+ if (this.renderManager.pointVirtualGrid.queryPoint(n).filter((s) => !s.point.equal(n)).length === 0) return !0;
1690
1424
  }
1691
- return false;
1425
+ return !1;
1692
1426
  }
1693
1427
  /**
1694
- * 设置所有相同点的位置
1695
- * @param point
1696
- * @param point2
1428
+ *
1429
+ * @param line0
1430
+ * @param line1
1697
1431
  */
1698
- setPointAll(point, point2) {
1699
- const resultList = this.renderManager.pointVirtualGrid.queryPoint(point);
1700
- resultList.forEach((result) => result.point.copy(point2));
1432
+ isTowLineSegmentConnect(e, t) {
1433
+ return !!(e.start.equal(t.start) || e.start.equal(t.end) || e.end.equal(t.start) || e.end.equal(t.end));
1701
1434
  }
1702
- /** 修正
1703
- * @param selectLine
1435
+ /**
1436
+ *
1437
+ * @param line
1438
+ * @param newStartPoint
1439
+ * @param newEndPoint
1440
+ * @param mode 需要匹配的点
1441
+ * @param record
1442
+ * @param id
1443
+ * @returns
1444
+ */
1445
+ setLinePoint(e, t, n, o = "all", s = [], a = Pt()) {
1446
+ if (e.userData.setLinePointUUid === a) return [];
1447
+ e.userData.setLinePointUUid = a;
1448
+ let d = [], i = [];
1449
+ (o === "start" || o === "all") && (d = this.renderManager.pointVirtualGrid.queryPoint(e.start).filter((w) => w.userData !== e)), (o === "end" || o === "all") && (i = this.renderManager.pointVirtualGrid.queryPoint(e.end).filter((w) => w.userData !== e));
1450
+ const c = e.clone();
1451
+ let l = "";
1452
+ t && (e.start.equal(t) || (l = "start"), s.push({
1453
+ point: e.start,
1454
+ oldPoint: e.start.clone(),
1455
+ newPoint: t,
1456
+ line: e
1457
+ }), e.start.copy(t)), n && (e.end.equal(n) || (l = l === "start" ? "all" : "end"), s.push({
1458
+ point: e.end,
1459
+ oldPoint: e.end.clone(),
1460
+ newPoint: n,
1461
+ line: e
1462
+ }), e.end.copy(n));
1463
+ const h = (w, p, x) => {
1464
+ w.forEach((y) => {
1465
+ const { point: E, userData: b } = y, D = b.start === E ? "start" : "end";
1466
+ if (b.directionEqual(c))
1467
+ if (D === "start") {
1468
+ const R = e.projectPoint(b.end, !1);
1469
+ if (R) return this.setLinePoint(b, p, R, "end", s, a);
1470
+ } else {
1471
+ const R = e.projectPoint(b.start, !1);
1472
+ if (R) return this.setLinePoint(b, R, p, "start", s, a);
1473
+ }
1474
+ (l === "all" || x === l) && this.setLinePoint(
1475
+ b,
1476
+ b.start === E ? p : b.start,
1477
+ b.end === E ? p : b.end,
1478
+ b.start === E ? "end" : "start",
1479
+ s,
1480
+ a
1481
+ );
1482
+ });
1483
+ };
1484
+ return h(d, e.start, "start"), h(i, e.end, "end"), [...d, ...i];
1485
+ }
1486
+ /** 修正2
1487
+ * 第一步:确定需要修复的线段
1488
+ * 第二步:查找与该线段相交的其他线段
1489
+ * 第三步:找出两端点相交的线段,其他为区间相交
1490
+ * 第四步:修正相交的线段的另一个端点
1491
+ * 第五步:判断是否有方向一致的线段,有就调整,调整方法:查找连续平行的线段,求点在线段方向的投影,直到不平行的线段结束
1492
+ * 第六步: 中间线段采用投影修正
1493
+ * @param targettLine
1704
1494
  * @param vistedList
1705
1495
  */
1706
- correction(selectLine, vistedList = /* @__PURE__ */ new Set()) {
1707
- if (vistedList.has(selectLine)) return;
1708
- vistedList.add(selectLine);
1709
- const lines = this.renderManager.quadtree.queryLineSegment(selectLine).filter(({ line: line2 }) => {
1710
- if (line2 === selectLine || line2.userData.isDoor) return false;
1711
- return true;
1712
- }).map((result) => result.line), selectLineDirection = selectLine.direction();
1713
- lines.forEach((line2) => {
1714
- if (vistedList.has(line2)) return false;
1715
- const direction = line2.direction(), angle = selectLineDirection.angleBetween(direction, "angle"), gap = Math.abs(90 - angle);
1716
- if (gap > 20 || gap < 2) return;
1717
- const mode0 = selectLine.start.equal(line2.start) || selectLine.start.equal(line2.end) ? "start" : "end", mode1 = line2.start.equal(selectLine.start) || line2.start.equal(selectLine.end) ? "start" : "end";
1718
- const point = selectLine.projectPoint(mode1 === "start" ? line2.end : line2.start, false);
1719
- if (!point) return;
1720
- const point0 = mode0 === "start" ? selectLine.start : selectLine.end, point1 = mode1 === "start" ? line2.start : line2.end;
1721
- this.setPointAll(point0, point);
1722
- this.setPointAll(point1, point);
1723
- this.renderManager.removeLine(line2);
1724
- this.renderManager.addLine(line2);
1725
- });
1726
- lines.forEach((line2) => this.correction(line2, vistedList));
1727
- return vistedList;
1496
+ correction(e, t = [], n = /* @__PURE__ */ new Set()) {
1497
+ n.add(e);
1498
+ const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: i }) => !(i === e || i.userData.isDoor || n.has(i))).map((i) => i.line), s = e.direction(), [a, d] = o.reduce((i, c) => {
1499
+ const [l, h] = i;
1500
+ return c.sameEndpoint(e) ? l.push(c) : h.push(c), i;
1501
+ }, [[], []]);
1502
+ return a.forEach((i) => {
1503
+ const c = i.direction(), l = s.angleBetween(c, "angle");
1504
+ if (Math.abs(90 - l) > 20) return !1;
1505
+ const w = e.sameEndpointAsStart(i) ? e.start : e.end, p = i.sameEndpointAsStart(e) ? i.end : i.start, x = new W(
1506
+ p.clone().add(s.clone().multiplyScalar(1)),
1507
+ p.clone().add(s.clone().multiplyScalar(-1))
1508
+ ), y = x.projectPoint(w, !1);
1509
+ if (y) {
1510
+ const E = [];
1511
+ this.setLinePoint(
1512
+ i,
1513
+ i.start === p ? y : i.start,
1514
+ i.end === p ? y : i.end,
1515
+ i.start === p ? "start" : "end",
1516
+ E
1517
+ ), t.push(E);
1518
+ }
1519
+ return n.add(i), !1;
1520
+ }), this.recursion && o.forEach((i) => this.correction(i, t, n)), t;
1728
1521
  }
1729
1522
  /** 开始
1730
1523
  * @param next
1731
1524
  */
1732
- verticalCorrection(next, selectLines) {
1733
- this.correction(selectLines[0]);
1734
- this.renderManager.draw();
1735
- next();
1525
+ verticalCorrection(e, t) {
1526
+ e(this.correction(t[0]));
1527
+ }
1528
+ /** 执行完成
1529
+ * @param data
1530
+ */
1531
+ completed(e) {
1532
+ e.forEach((t) => {
1533
+ t.forEach((n) => {
1534
+ const { line: o, newPoint: s, point: a } = n;
1535
+ a.copy(s), this.renderManager.removeLine(o), this.renderManager.addLine(o);
1536
+ });
1537
+ }), this.renderManager.draw();
1538
+ }
1539
+ /** 回滚操作
1540
+ * @param data
1541
+ */
1542
+ rollback(e) {
1543
+ for (let t = e.length - 1; t >= 0; t--) {
1544
+ const n = e[t];
1545
+ for (let o = n.length - 1; o >= 0; o--) {
1546
+ const s = n[o], { line: a, oldPoint: d, point: i } = s;
1547
+ i.copy(d), this.renderManager.removeLine(a), this.renderManager.addLine(a);
1548
+ }
1549
+ }
1550
+ return this.renderManager.draw(), e;
1551
+ }
1552
+ /** 撤回回滚
1553
+ * @param lines
1554
+ * @returns
1555
+ */
1556
+ revokeRollback(e) {
1557
+ return this.completed(e), e;
1736
1558
  }
1737
1559
  }
1738
- class MergeLine extends CommandFlowComponent {
1560
+ class Y extends N {
1739
1561
  static name = "MergeLine";
1740
1562
  shortcutKeys = ["control", "g"];
1741
1563
  static commandName = "merge-line";
1742
- onAddFromParent(parent) {
1743
- super.onAddFromParent(parent);
1744
- const defaultComponent = parent.findComponentByType(Default);
1745
- const commandFlow = this.commandManager.addCommandFlow(MergeLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this));
1746
- commandFlow.addEventListener("finally", this.createFinally());
1747
- this.eventInput.addKeyCombination(MergeLine.commandName, this.shortcutKeys);
1748
- this.eventInput.addEventListener("codeChange", async () => {
1749
- defaultComponent?.selectLines.length === 2 && this.eventInput.isKeyCombination(MergeLine.commandName) && await this.commandManager.start(MergeLine.commandName, [...this.default.selectLines]);
1750
- });
1751
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1564
+ onAddFromParent(e) {
1565
+ super.onAddFromParent(e);
1566
+ const t = e.findComponentByType(Se), n = this.commandManager.addCommandFlow(Y.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1567
+ n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(Y.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1568
+ t?.selectLines.length === 2 && this.eventInput.isKeyCombination(Y.commandName) && await this.commandManager.start(Y.commandName, [...this.default.selectLines]);
1569
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1752
1570
  }
1753
1571
  /**
1754
1572
  * 进入命令约束
1755
1573
  */
1756
- constraint(next, selectLines) {
1757
- if (!Array.isArray(selectLines)) {
1758
- ElMessage({ message: "进入命令失败", type: "warning" });
1759
- this.cancel();
1760
- } else if (selectLines.length !== 2) {
1761
- ElMessage({ message: "未执行线段合并,请选择两条线段", type: "warning" });
1762
- this.cancel();
1763
- } else {
1764
- next(selectLines);
1765
- }
1574
+ constraint(e, t) {
1575
+ Array.isArray(t) ? t.length !== 2 ? (L({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1766
1576
  }
1767
1577
  /** 开始
1768
1578
  * @param next
1579
+ * @todo 合并所有
1769
1580
  */
1770
- mergeLine(next, selectLines) {
1771
- const editor = this.editor, line1 = selectLines[0], line2 = selectLines[1];
1772
- for (let i = 0; i < line1.points.length; i++) {
1773
- const p1 = line1.points[i];
1774
- for (let j = 0; j < line2.points.length; j++) {
1775
- const p2 = line2.points[j];
1776
- if (p1.equal(p2)) {
1777
- const p1Next = line1.points[(i + 1) % 2];
1778
- const p2Next = line2.points[(j + 1) % 2];
1779
- editor.renderManager.removeLine(line1);
1780
- editor.renderManager.removeLine(line2);
1781
- const line3 = new LineSegment(p1Next, p2Next);
1782
- editor.renderManager.addLine(line3);
1783
- editor.renderManager.draw();
1784
- ElMessage({ message: "已合并", type: "success" });
1785
- return next();
1581
+ mergeLine(e, t) {
1582
+ const n = t[0], o = t[1];
1583
+ for (let s = 0; s < n.points.length; s++) {
1584
+ const a = n.points[s];
1585
+ for (let d = 0; d < o.points.length; d++) {
1586
+ const i = o.points[d];
1587
+ if (a.equal(i)) {
1588
+ const c = n.points[(s + 1) % 2], l = o.points[(d + 1) % 2], h = new W(c, l);
1589
+ return e({ line1: n, line2: o, newLine: h }), L({ message: "已合并", type: "success" });
1786
1590
  }
1787
1591
  }
1788
1592
  }
1789
- ElMessage({ message: "合并失败,两条线未找到共用点", type: "warning" });
1790
- next();
1593
+ L({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
1594
+ }
1595
+ /** 执行完成
1596
+ * @param data
1597
+ */
1598
+ completed(e) {
1599
+ this.renderManager.removeLine(e.line1), this.renderManager.removeLine(e.line2), this.renderManager.addLine(e.newLine), this.renderManager.draw();
1600
+ }
1601
+ /** 回滚操作
1602
+ * @param data
1603
+ */
1604
+ rollback(e) {
1605
+ return this.renderManager.addLines([e.line1, e.line2]), this.renderManager.removeLine(e.newLine), this.renderManager.draw(), e;
1606
+ }
1607
+ /** 撤回回滚
1608
+ * @param lines
1609
+ * @returns
1610
+ */
1611
+ revokeRollback(e) {
1612
+ return this.completed(e), e;
1791
1613
  }
1792
1614
  }
1793
- class DeleteSelectLine extends CommandFlowComponent {
1615
+ class X extends N {
1794
1616
  static name = "DeleteSelectLine";
1795
1617
  shortcutKeys = ["Delete"];
1796
1618
  static commandName = "deleteSelectLine";
1797
- onAddFromParent(parent) {
1798
- super.onAddFromParent(parent);
1799
- const commandFlow = this.commandManager.addCommandFlow(DeleteSelectLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this));
1800
- commandFlow.addEventListener("finally", this.createFinally());
1801
- this.eventInput.addKeyCombination(DeleteSelectLine.commandName, this.shortcutKeys);
1802
- this.eventInput.addEventListener("codeChange", async () => {
1803
- this.eventInput.isKeyCombination(DeleteSelectLine.commandName) && await this.commandManager.start(DeleteSelectLine.commandName, [...this.default.selectLines]);
1804
- });
1805
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1619
+ onAddFromParent(e) {
1620
+ super.onAddFromParent(e), this.commandManager.addCommandFlow(X.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this)).addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(X.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1621
+ this.eventInput.isKeyCombination(X.commandName) && await this.commandManager.start(X.commandName, [...this.default.selectLines]);
1622
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1806
1623
  }
1807
1624
  /**
1808
1625
  * 进入命令约束
1809
1626
  */
1810
- constraint(next, selectLines) {
1811
- if (!Array.isArray(selectLines)) {
1812
- ElMessage({ message: "请选择线段", type: "warning" });
1813
- this.cancel();
1814
- } else {
1815
- next(selectLines);
1816
- }
1627
+ constraint(e, t) {
1628
+ Array.isArray(t) ? t.length === 0 ? (L({ message: "请选择线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1817
1629
  }
1818
1630
  /** 开始
1819
1631
  * @param next
1820
1632
  */
1821
- delete(next, selectLines) {
1822
- const editor = this.editor;
1823
- selectLines.forEach((line2) => editor.renderManager.removeLine(line2));
1824
- ElMessage({ message: "删除成功", type: "success" });
1825
- next();
1633
+ delete(e, t) {
1634
+ t.forEach((n) => this.renderManager.removeLine(n)), L({ message: "删除成功", type: "success" }), e(t);
1635
+ }
1636
+ /** 回滚操作
1637
+ * @param data
1638
+ */
1639
+ rollback(e) {
1640
+ return this.renderManager.addLines(e), this.renderManager.draw(), e;
1641
+ }
1642
+ /** 撤回回滚
1643
+ * @param lines
1644
+ * @returns
1645
+ */
1646
+ revokeRollback(e) {
1647
+ return e.forEach((t) => this.renderManager.removeLine(t)), e;
1826
1648
  }
1827
1649
  }
1828
- class ConnectionLine extends CommandFlowComponent {
1650
+ class $ extends N {
1829
1651
  static name = "ConnectionLine";
1830
1652
  shortcutKeys = ["Shift", "L"];
1831
1653
  static commandName = "connectionLine";
1832
- onAddFromParent(parent) {
1833
- super.onAddFromParent(parent);
1834
- const commandFlow = this.commandManager.addCommandFlow(ConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this));
1835
- commandFlow.addEventListener("finally", this.createFinally());
1836
- this.eventInput.addKeyCombination(ConnectionLine.commandName, this.shortcutKeys);
1837
- this.eventInput.addEventListener("codeChange", async () => {
1838
- this.eventInput.isKeyCombination(ConnectionLine.commandName) && await this.commandManager.start(ConnectionLine.commandName, [...this.default.selectLines]);
1839
- });
1840
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1654
+ onAddFromParent(e) {
1655
+ super.onAddFromParent(e);
1656
+ const t = this.commandManager.addCommandFlow($.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1657
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination($.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1658
+ this.eventInput.isKeyCombination($.commandName) && await this.commandManager.start($.commandName, [...this.default.selectLines]);
1659
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1841
1660
  }
1842
1661
  /**
1843
1662
  * 进入命令约束
1844
1663
  */
1845
- constraint(next, selectLines) {
1846
- if (!Array.isArray(selectLines)) {
1847
- ElMessage({ message: "进入命令失败", type: "warning" });
1848
- this.cancel();
1849
- } else if (selectLines.length !== 2) {
1850
- ElMessage({ message: "请选择2条线段", type: "warning" });
1851
- this.cancel();
1852
- } else {
1853
- next(selectLines);
1854
- }
1664
+ constraint(e, t) {
1665
+ Array.isArray(t) ? t.length !== 2 ? (L({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1855
1666
  }
1856
- /** 开始
1667
+ /** 连接
1857
1668
  * @param next
1858
1669
  */
1859
- connection(next, selectLines) {
1860
- const editor = this.editor;
1861
- let start, end, diatance = Infinity;
1862
- for (let i = 0; i < 2; i++)
1863
- for (let j = 0; j < 2; j++) {
1864
- const point1 = selectLines[0].points[i];
1865
- const point2 = selectLines[1].points[j];
1866
- const d = point1.distance(point2);
1867
- if (d < diatance) {
1868
- start = point1;
1869
- end = point2;
1870
- diatance = d;
1871
- }
1670
+ connection(e, t) {
1671
+ let n, o, s = 1 / 0;
1672
+ for (let a = 0; a < 2; a++)
1673
+ for (let d = 0; d < 2; d++) {
1674
+ const i = t[0].points[a], c = t[1].points[d], l = i.distance(c);
1675
+ l < s && (n = i, o = c, s = l);
1872
1676
  }
1873
- if (start && end) {
1874
- const line2 = new LineSegment(start.clone(), end.clone());
1875
- editor.renderManager.addLine(line2);
1876
- editor.renderManager.draw();
1877
- ElMessage({ message: "连接成功", type: "success" });
1878
- }
1879
- next();
1677
+ if (n && o) {
1678
+ const a = new W(n.clone(), o.clone());
1679
+ e(a), L({ message: "连接成功", type: "success" });
1680
+ } else this.cancel();
1681
+ }
1682
+ /** 成功
1683
+ * @param next
1684
+ * @param selectLines
1685
+ */
1686
+ completed(e) {
1687
+ this.renderManager.addLine(e), this.renderManager.draw();
1688
+ }
1689
+ /** 回滚操作
1690
+ * @param data
1691
+ */
1692
+ rollback(e) {
1693
+ return this.renderManager.removeLine(e), e;
1694
+ }
1695
+ /** 撤回回滚
1696
+ * @param lines
1697
+ * @returns
1698
+ */
1699
+ revokeRollback(e) {
1700
+ return this.completed(e), e;
1880
1701
  }
1881
1702
  }
1882
- class IntersectionConnectionLine extends CommandFlowComponent {
1703
+ class ee extends N {
1883
1704
  static name = "IntersectionConnectionLine";
1884
1705
  shortcutKeys = ["control", "Shift", "L"];
1885
1706
  static commandName = "intersectionConnectionLine";
1886
- onAddFromParent(parent) {
1887
- super.onAddFromParent(parent);
1888
- const commandFlow = this.commandManager.addCommandFlow(IntersectionConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this));
1889
- commandFlow.addEventListener("finally", this.createFinally());
1890
- this.eventInput.addKeyCombination(IntersectionConnectionLine.commandName, this.shortcutKeys);
1891
- this.eventInput.addEventListener("codeChange", async () => {
1892
- this.eventInput.isKeyCombination(IntersectionConnectionLine.commandName) && await this.commandManager.start(IntersectionConnectionLine.commandName, [...this.default.selectLines]);
1893
- });
1894
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1707
+ onAddFromParent(e) {
1708
+ super.onAddFromParent(e);
1709
+ const t = this.commandManager.addCommandFlow(ee.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1710
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(ee.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1711
+ this.eventInput.isKeyCombination(ee.commandName) && await this.commandManager.start(ee.commandName, [...this.default.selectLines]);
1712
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1895
1713
  }
1896
1714
  /**
1897
1715
  * 进入命令约束
1898
1716
  */
1899
- constraint(next, selectLines) {
1900
- if (!Array.isArray(selectLines)) {
1901
- ElMessage({ message: "进入命令失败", type: "warning" });
1902
- this.cancel();
1903
- } else if (selectLines.length !== 2) {
1904
- ElMessage({ message: "请选择2条线段", type: "warning" });
1905
- this.cancel();
1906
- } else {
1907
- next(selectLines);
1908
- }
1717
+ constraint(e, t) {
1718
+ Array.isArray(t) ? t.length !== 2 ? (L({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1909
1719
  }
1910
1720
  /** 开始
1911
1721
  * @param next
1912
1722
  */
1913
- connection(next, selectLines) {
1914
- const editor = this.editor, line1 = selectLines[0], line2 = selectLines[1], point = selectLines[0].getIntersection(selectLines[1]);
1915
- if (!point) return;
1916
- editor.renderManager.removeLine(line1);
1917
- editor.renderManager.removeLine(line2);
1918
- if (line1.start.distance(point) < line1.end.distance(point)) {
1919
- line1.start.copy(point);
1920
- } else {
1921
- line1.end.copy(point);
1922
- }
1923
- if (line2.start.distance(point) < line2.end.distance(point)) {
1924
- line2.start.copy(point);
1925
- } else {
1926
- line2.end.copy(point);
1927
- }
1928
- editor.renderManager.addLines([line1, line2]);
1929
- editor.renderManager.draw();
1930
- ElMessage({ message: "连接成功", type: "success" });
1931
- next();
1723
+ connection(e, t) {
1724
+ const n = t[0], o = t[1], s = t[0].getIntersection(t[1]);
1725
+ if (!s) return;
1726
+ const a = n.points.map((l) => l.clone()), d = o.points.map((l) => l.clone());
1727
+ n.start.distance(s) < n.end.distance(s) ? n.start.copy(s) : n.end.copy(s), o.start.distance(s) < o.end.distance(s) ? o.start.copy(s) : o.end.copy(s);
1728
+ const i = n.points.map((l) => l.clone()), c = o.points.map((l) => l.clone());
1729
+ e({ line1: n, line2: o, oldLine1: a, oldLine2: d, newLine1: i, newLine2: c }), L({ message: "连接成功", type: "success" });
1730
+ }
1731
+ /** 执行完成
1732
+ * @param next
1733
+ * @param selectLines
1734
+ */
1735
+ completed({ line1: e, line2: t, newLine1: n, newLine2: o }) {
1736
+ this.renderManager.removeLine(e), this.renderManager.removeLine(t), e.set(...n), t.set(...o), this.renderManager.addLines([e, t]), this.renderManager.draw();
1737
+ }
1738
+ /** 回滚操作
1739
+ * @param data
1740
+ */
1741
+ rollback(e) {
1742
+ const { line1: t, line2: n, oldLine1: o, oldLine2: s } = e;
1743
+ return this.renderManager.removeLine(t), this.renderManager.removeLine(n), t.set(...o), n.set(...s), this.renderManager.addLines([t, n]), this.renderManager.draw(), e;
1744
+ }
1745
+ /** 撤回回滚
1746
+ * @param lines
1747
+ * @returns
1748
+ */
1749
+ revokeRollback(e) {
1750
+ return this.completed(e), e;
1932
1751
  }
1933
1752
  }
1934
- class DeleteSelectWindow extends CommandFlowComponent {
1753
+ class te extends N {
1935
1754
  static name = "DeleteSelectWindow";
1936
1755
  shortcutKeys = ["Q", "Delete"];
1937
1756
  static commandName = "deleteSelectWindow";
1938
- onAddFromParent(parent) {
1939
- super.onAddFromParent(parent);
1940
- const commandFlow = this.commandManager.addCommandFlow(DeleteSelectWindow.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this));
1941
- commandFlow.addEventListener("finally", this.createFinally());
1942
- this.eventInput.addKeyCombination(DeleteSelectWindow.commandName, this.shortcutKeys);
1943
- this.eventInput.addEventListener("codeChange", async () => {
1944
- this.eventInput.isKeyCombination(DeleteSelectWindow.commandName) && await this.commandManager.start(DeleteSelectWindow.commandName, [...this.default.selectLines]);
1945
- });
1946
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1757
+ onAddFromParent(e) {
1758
+ super.onAddFromParent(e);
1759
+ const t = this.commandManager.addCommandFlow(te.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1760
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(te.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1761
+ this.eventInput.isKeyCombination(te.commandName) && await this.commandManager.start(te.commandName, [...this.default.selectLines]);
1762
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1947
1763
  }
1948
1764
  /**
1949
1765
  * 进入命令约束
1950
1766
  */
1951
- constraint(next, selectLines) {
1952
- if (!Array.isArray(selectLines)) {
1953
- ElMessage({ message: "进入命令失败", type: "warning" });
1954
- this.cancel();
1955
- } else if (!selectLines.some((l) => l.userData.isWindow)) {
1956
- ElMessage({ message: "请选择有窗户线段", type: "warning" });
1957
- this.cancel();
1958
- } else {
1959
- next(selectLines);
1960
- }
1767
+ constraint(e, t) {
1768
+ Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (L({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1961
1769
  }
1962
1770
  /** 开始
1963
1771
  * @param next
1964
1772
  */
1965
- connection(next, selectLines) {
1966
- let is = false;
1967
- selectLines.forEach((line2) => {
1968
- if (!line2.userData.isWindow) return;
1969
- line2.userData = {};
1970
- is = true;
1971
- });
1972
- this.renderManager.draw();
1973
- is && ElMessage({ message: "删除窗户成功", type: "success" });
1974
- next();
1773
+ end(e, t) {
1774
+ let n = !1, o = [];
1775
+ t.forEach((s) => {
1776
+ s.userData.isWindow && (o.push({
1777
+ line: s,
1778
+ drawDoorData: s.userData.drawDoorData
1779
+ }), n = !0);
1780
+ }), n && L({ message: "删除窗户成功", type: "success" }), e(o);
1781
+ }
1782
+ /**
1783
+ * 完成
1784
+ * @param list
1785
+ */
1786
+ completed(e) {
1787
+ e.forEach((t) => {
1788
+ const n = t.line.userData;
1789
+ n && (delete n.isWindow, delete n.drawDoorData);
1790
+ }), this.renderManager.draw();
1791
+ }
1792
+ /** 回滚操作
1793
+ * @param data
1794
+ */
1795
+ rollback(e) {
1796
+ return e.forEach((t) => {
1797
+ t.line.userData || (t.line.userData = {});
1798
+ const n = t.line.userData;
1799
+ n.isWindow = !0, n.drawDoorData = t.drawDoorData;
1800
+ }), this.renderManager.draw(), e;
1801
+ }
1802
+ /** 撤回回滚
1803
+ * @param lines
1804
+ * @returns
1805
+ */
1806
+ revokeRollback(e) {
1807
+ return this.completed(e), e;
1975
1808
  }
1976
1809
  }
1977
- class SelectAll extends CommandFlowComponent {
1810
+ class ne extends N {
1978
1811
  static name = "SelectAll";
1979
- container = new THREE.Group();
1812
+ container = new m.Group();
1980
1813
  shortcutKeys = ["control", "a"];
1981
1814
  static commandName = "selectAll";
1982
- onAddFromParent(parent) {
1983
- super.onAddFromParent(parent);
1984
- this.editor.container.add(this.container);
1985
- this.container.position.z = 1e-3;
1986
- const commandFlow = this.commandManager.addCommandFlow(SelectAll.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this));
1987
- commandFlow.addEventListener("finally", this.createFinally());
1988
- this.eventInput.addKeyCombination(SelectAll.commandName, this.shortcutKeys);
1989
- this.eventInput.addEventListener("codeChange", async () => {
1990
- this.eventInput.isKeyCombination(SelectAll.commandName) && await this.commandManager.start(SelectAll.commandName);
1991
- });
1992
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1815
+ onAddFromParent(e) {
1816
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
1817
+ const t = this.commandManager.addCommandFlow(ne.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1818
+ t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(ne.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1819
+ this.eventInput.isKeyCombination(ne.commandName) && await this.commandManager.start(ne.commandName);
1820
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1993
1821
  }
1994
1822
  /** 开始
1995
1823
  * @param next
1996
1824
  */
1997
- selectAll(next) {
1998
- this.renderManager.lines.map((line2) => this.default.addSelectLine(line2));
1999
- next();
1825
+ selectAll(e) {
1826
+ e([...this.renderManager.lines]);
1827
+ }
1828
+ /** 执行完成
1829
+ */
1830
+ completed(e) {
1831
+ e.map((t) => this.default.addSelectLine(t));
1832
+ }
1833
+ /** 回滚操作
1834
+ * @param lines
1835
+ */
1836
+ rollback(e) {
1837
+ return e.map((t) => this.default.removeSelectLine(t)), e;
1838
+ }
1839
+ /** 撤回回滚
1840
+ * @param lines
1841
+ * @returns
1842
+ */
1843
+ revokeRollback(e) {
1844
+ return this.completed(e), e;
1845
+ }
1846
+ }
1847
+ class oe extends N {
1848
+ static name = "ViewAngle";
1849
+ shortcutKeys = ["r"];
1850
+ static commandName = "viewAngle";
1851
+ onAddFromParent(e) {
1852
+ super.onAddFromParent(e);
1853
+ const t = this.commandManager.addCommandFlow(oe.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.viewAngle.bind(this));
1854
+ t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(oe.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1855
+ this.eventInput.isKeyCombination(oe.commandName) && await this.commandManager.start(oe.commandName, [...this.default.selectLines]);
1856
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1857
+ }
1858
+ /**
1859
+ * 进入命令约束
1860
+ */
1861
+ constraint(e, t) {
1862
+ Array.isArray(t) ? t.length !== 2 || !t[0].sameEndpoint(t[1]) ? (L({ message: "请选择两条具有端点相交的线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1863
+ }
1864
+ /**
1865
+ *
1866
+ * @param next
1867
+ * @param selectLines
1868
+ */
1869
+ viewAngle(e, t) {
1870
+ const [n, o] = t, s = Math.min(0.5, n.length(), o.length());
1871
+ let a, d, i, c = 0, l = 0;
1872
+ n.sameEndpointAsStart(o) ? (a = n.start, d = n.end) : (a = n.end, d = n.start), o.sameEndpointAsStart(n) ? i = o.end : i = o.start;
1873
+ function h(M, O) {
1874
+ const v = O.x - M.x, Z = O.y - M.y;
1875
+ let j = Math.atan2(Z, v) * (180 / Math.PI);
1876
+ return j < 0 && (j += 360), j;
1877
+ }
1878
+ const w = h(a, d), p = h(a, i), x = Math.min(w, p), y = Math.max(w, p), E = [];
1879
+ function b(M, O) {
1880
+ for (let v = M; v <= O; v++) {
1881
+ const Z = Math.cos(v * Math.PI / 180) * s + a.x, j = Math.sin(v * Math.PI / 180) * s + a.y, xe = Math.cos((v + 1) * Math.PI / 180) * s + a.x, Ee = Math.sin((v + 1) * Math.PI / 180) * s + a.y;
1882
+ E.push(Z, j, 0, xe, Ee, 0);
1883
+ }
1884
+ }
1885
+ y - x > 180 ? (b(0, x), b(y, 360), c = 360 - (y - x), l = (y + c / 2) % 360) : (b(x, y), c = y - x, l = x + c / 2);
1886
+ const D = new m.LineSegments();
1887
+ D.geometry = this.renderManager.createGeometry({
1888
+ position: E
1889
+ }, E.length / 3), D.material = new m.LineBasicMaterial({ color: 16711935 }), this.renderManager.container.add(D);
1890
+ const R = Math.cos(l * Math.PI / 180) * s + a.x, ae = Math.sin(l * Math.PI / 180) * s + a.y, q = this.renderer.createText(Number(c.toFixed(2)), new m.Vector3(R, ae, 0), {
1891
+ textShadow: "0px 0px 2px #000"
1892
+ }, this.renderManager.container);
1893
+ let _ = 0;
1894
+ this.addEventRecord("clear").add(() => D.removeFromParent()).add(() => q.removeFromParent()).add(this.eventInput.addEventListener("codeChange", () => {
1895
+ this.eventInput.isOnlyKeyDown("enter") ? e() : this.eventInput.isOnlyKeyDown("mouse_0") && (_++, _ === 1 ? setTimeout(() => _ = 0, 500) : _ === 2 && (e(), _ = 0));
1896
+ }));
1897
+ }
1898
+ }
1899
+ class rt extends N {
1900
+ static name = "ClippingLine";
1901
+ container = new m.Group();
1902
+ shortcutKeys = ["control", "x"];
1903
+ commandName = "clippingLine";
1904
+ static commandName = "clippingLine";
1905
+ onAddFromParent(e) {
1906
+ super.onAddFromParent(e), this.editor.container.add(this.container);
1907
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1908
+ t.addEventListener("finally", this.createFinally(["selectPointStart"])), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1909
+ }
1910
+ /** 选择开始点
1911
+ * @param next
1912
+ */
1913
+ selectPointStart(e) {
1914
+ let t = null, n = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
1915
+ this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
1916
+ const { point: s, line: a, find: d } = this.editor.renderManager.adsorption();
1917
+ this.dispatchEvent({ type: "pointerMove", point: s }), d ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
1918
+ })).add(this.eventInput.addEventListener("codeChange", () => {
1919
+ this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: o }));
1920
+ })), this.addEventRecord("clear").add(() => n.removeFromParent());
1921
+ }
1922
+ /** 选择结束点
1923
+ * @param next
1924
+ */
1925
+ selectPointEnd(e, { point: t, line: n }) {
1926
+ let o = null, s = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 }));
1927
+ this.addEventRecord("clear").add(() => s.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
1928
+ const { point: a, find: d, line: i } = this.editor.renderManager.adsorption();
1929
+ this.dispatchEvent({ type: "pointerMove", point: a }), d && i === n ? (this.domElement.style.cursor = "none", s.position.copy(a), o = a.clone(), this.container.add(s)) : (this.domElement.style.cursor = "no-drop", o = null, s.removeFromParent());
1930
+ })).add(this.eventInput.addEventListener("codeChange", () => {
1931
+ this.eventInput.isKeyDown("mouse_0") && o && e({ line: n, start: t, end: o });
1932
+ }));
1933
+ }
1934
+ /**
1935
+ * 结束处理
1936
+ * @param next
1937
+ * @param points
1938
+ */
1939
+ end(e, { start: t, end: n, line: o }) {
1940
+ const s = V.from(t), a = V.from(n);
1941
+ e({
1942
+ oldLine: o,
1943
+ newLine1: new W(
1944
+ o.start,
1945
+ o.start.distance(s) < o.start.distance(a) ? s.clone() : a.clone()
1946
+ ),
1947
+ newLine2: new W(
1948
+ o.end,
1949
+ o.end.distance(s) < o.end.distance(a) ? s.clone() : a.clone()
1950
+ )
1951
+ });
1952
+ }
1953
+ /** 执行完成
1954
+ */
1955
+ completed(e) {
1956
+ this.renderManager.removeLine(e.oldLine), this.renderManager.addLines([e.newLine1, e.newLine2]), this.renderManager.draw();
1957
+ }
1958
+ /** 回滚操作
1959
+ * @param data
1960
+ */
1961
+ rollback(e) {
1962
+ return this.renderManager.addLine(e.oldLine), this.renderManager.removeLine(e.newLine1), this.renderManager.removeLine(e.newLine2), e;
1963
+ }
1964
+ /** 撤回回滚
1965
+ * @param data
1966
+ * @returns
1967
+ */
1968
+ revokeRollback(e) {
1969
+ return this.completed(e), e;
2000
1970
  }
2001
1971
  }
2002
- const _hoisted_1 = {
1972
+ class se extends N {
1973
+ static name = "VerticalReferenceLine";
1974
+ shortcutKeys = ["v"];
1975
+ static commandName = "VerticalReferenceLine";
1976
+ onAddFromParent(e) {
1977
+ super.onAddFromParent(e);
1978
+ const t = this.commandManager.addCommandFlow(se.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalReferenceLine.bind(this));
1979
+ t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(se.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1980
+ this.eventInput.isKeyCombination(se.commandName) && await this.commandManager.start(se.commandName, [...this.default.selectLines]);
1981
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1982
+ }
1983
+ /**
1984
+ * 进入命令约束
1985
+ */
1986
+ constraint(e, t) {
1987
+ Array.isArray(t) ? t.length !== 1 ? (L({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : t[0].userData.isDoor ? (L({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
1988
+ }
1989
+ /**
1990
+ *
1991
+ * @param next
1992
+ * @param selectLines
1993
+ */
1994
+ verticalReferenceLine(e, t) {
1995
+ this.renderManager.lines.forEach((n) => {
1996
+ delete n.userData.isVerticalReferenceLine;
1997
+ }), t[0].userData.isVerticalReferenceLine = !0, e(), this.renderManager.draw();
1998
+ }
1999
+ }
2000
+ const oo = {
2003
2001
  key: 0,
2004
2002
  class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
2005
- };
2006
- const _hoisted_2 = { class: "text-start max-w-[150px]" };
2007
- const _hoisted_3 = { class: "inline-block ml-[10px] text-[var(--color-primary)]" };
2008
- const _hoisted_4 = {
2003
+ }, so = { class: "text-start max-w-[150px]" }, ao = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, io = {
2009
2004
  key: 0,
2010
- class: "p-[5px] max-w-[180px]"
2011
- };
2012
- const _hoisted_5 = { class: "text-[14px] flex flex-col" };
2013
- const _hoisted_6 = ["onClick"];
2014
- const _hoisted_7 = { class: "flex flex-row items-center" };
2015
- const _hoisted_8 = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" };
2016
- const _hoisted_9 = ["src"];
2017
- const _hoisted_10 = {
2005
+ class: "p-[5px] max-w-[200px]"
2006
+ }, ro = { class: "text-[14px] flex flex-col" }, lo = ["onClick"], co = { class: "flex flex-row items-center" }, mo = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, ho = ["src"], uo = { class: "text-wrap" }, po = {
2018
2007
  key: 1,
2019
2008
  class: "text-[#999]"
2020
- };
2021
- const _hoisted_11 = {
2009
+ }, go = {
2022
2010
  style: { "--el-color-primary": "var(--primary-color)" },
2023
2011
  class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
2024
- };
2025
- const _hoisted_12 = {
2012
+ }, vo = {
2026
2013
  key: 0,
2027
2014
  class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
2028
- };
2029
- const _hoisted_13 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
2030
- const _hoisted_14 = ["onClick", "title"];
2031
- const _hoisted_15 = ["src"];
2032
- const _sfc_main = /* @__PURE__ */ defineComponent({
2015
+ }, fo = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" }, yo = ["onClick", "title"], wo = ["src"], bo = /* @__PURE__ */ ce({
2033
2016
  __name: "EditorTool",
2034
2017
  props: {
2035
2018
  dxfSystem: {},
2036
2019
  permission: {}
2037
2020
  },
2038
- setup(__props) {
2039
- function setEditorToolPosition(left, top, rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect()) {
2040
- const minX = 0, maxX = rect.width - toolBarRect.width, minY = 0, maxY = rect.height - toolBarRect.height;
2041
- left = Math.max(minX, Math.min(left, maxX));
2042
- top = Math.max(minY, Math.min(top, maxY));
2043
- toolBarPosition.value = { left, top };
2021
+ setup(r) {
2022
+ function e(C, u, f = h.value.getBoundingClientRect(), U = w.value.getBoundingClientRect()) {
2023
+ const me = f.width - U.width, he = 0, Le = f.height - U.height;
2024
+ C = Math.max(0, Math.min(C, me)), u = Math.max(he, Math.min(u, Le)), _.value = { left: C, top: u };
2044
2025
  }
2045
- function startCurrentCommandItem(item) {
2046
- if (currentCommand.value === item.command) return;
2047
- editor.commandManager.start(item.command);
2026
+ function t(C) {
2027
+ x.value === C.command || x.value !== "default" || b.commandManager.start(C.command);
2048
2028
  }
2049
- function setLines(lines) {
2050
- if (lines) {
2051
- localStorage.setItem("lines", JSON.stringify(lines));
2029
+ function n(C) {
2030
+ if (C) {
2031
+ localStorage.setItem("lines", JSON.stringify(C));
2052
2032
  try {
2053
- dxfSystem.Dxf.set(lines);
2054
- dxfSystem.Dxf.lineOffset();
2055
- } catch (error) {
2056
- console.log(error);
2033
+ y.Dxf.set(C), y.Dxf.lineOffset();
2034
+ } catch (u) {
2035
+ console.log(u);
2057
2036
  }
2058
2037
  }
2059
2038
  }
2060
- async function selectLocalFile() {
2061
- const data = await SelectLocalFile.json();
2062
- if (Array.isArray(data)) {
2063
- localStorage.removeItem("orbitControls");
2064
- setLines(data);
2065
- }
2039
+ async function o() {
2040
+ const C = await It.json();
2041
+ Array.isArray(C) && (localStorage.removeItem("orbitControls"), n(C));
2066
2042
  }
2067
- function dragMoveHelper({ offsetX, offsetY }) {
2068
- domEventRegister.mouseMoveEventProxylock = true;
2069
- const cusor = document.body.style.cursor;
2043
+ function s({ offsetX: C, offsetY: u }) {
2044
+ E.mouseMoveEventProxylock = !0;
2045
+ const f = document.body.style.cursor;
2070
2046
  document.body.style.cursor = "move";
2071
- const move = (e) => {
2072
- const rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect();
2073
- setEditorToolPosition(
2074
- e.pageX - rect.left - offsetX,
2075
- e.pageY - rect.top - offsetY,
2076
- rect,
2077
- toolBarRect
2078
- );
2079
- e.stopPropagation();
2080
- document.body.style.cursor = "move";
2047
+ const U = (me) => {
2048
+ const he = h.value.getBoundingClientRect(), Le = w.value.getBoundingClientRect();
2049
+ e(
2050
+ me.pageX - he.left - C,
2051
+ me.pageY - he.top - u,
2052
+ he,
2053
+ Le
2054
+ ), me.stopPropagation(), document.body.style.cursor = "move";
2055
+ }, Me = () => {
2056
+ document.body.removeEventListener("mousemove", U), document.removeEventListener("mouseup", Me), document.body.style.cursor = f, E.mouseMoveEventProxylock = !1;
2081
2057
  };
2082
- const end = () => {
2083
- document.body.removeEventListener("mousemove", move);
2084
- document.removeEventListener("mouseup", end);
2085
- document.body.style.cursor = cusor;
2086
- domEventRegister.mouseMoveEventProxylock = false;
2087
- };
2088
- document.body.addEventListener("mousemove", move);
2089
- document.addEventListener("mouseup", end);
2058
+ document.body.addEventListener("mousemove", U), document.addEventListener("mouseup", Me);
2090
2059
  }
2091
- const props = __props;
2092
- const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), toolBarExpand = ref(true), currentCommand = ref(""), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), editor = dxfSystem.findComponentByType(Editor$1), defaultComponent = dxfSystem.findComponentByType(Default), whiteModel = dxfSystem.findComponentByType(WhiteModel), toolBarPosition = ref({ left: 10, top: 10 }), images = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": __vite_glob_0_0, "./assets/images/deleteSelectLine.svg": __vite_glob_0_1, "./assets/images/deleteSelectWindow.svg": __vite_glob_0_2, "./assets/images/door.svg": __vite_glob_0_3, "./assets/images/intersectionConnection.svg": __vite_glob_0_4, "./assets/images/line.svg": __vite_glob_0_5, "./assets/images/mergeLine.svg": __vite_glob_0_6, "./assets/images/selectAll.svg": __vite_glob_0_7, "./assets/images/selectPoint.svg": __vite_glob_0_8, "./assets/images/verticalCorrection.svg": __vite_glob_0_9, "./assets/images/window.svg": __vite_glob_0_10 }), showShortcutKey = ref(false), selectLineCount = ref(0), hasWindowLine = ref(false), resizeObserver = new ResizeObserver(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top)), shortcutKeys = [
2093
- { "name": "开启绘制线段命令", "shortcut": "Ctrl + L" },
2094
- { "name": "开启绘制门线命令", "shortcut": "Ctrl + M" },
2095
- { "name": "开启绘制窗户线命令", "shortcut": "Ctrl + Q" },
2096
- { "name": "开启点修改命令", "shortcut": "Ctrl + P" },
2097
- { "name": "线段方向移动线段点(点修改命令下)", "shortcut": "Shift + 移动" },
2098
- { "name": "删除线段", "shortcut": "选中 + Delete" },
2099
- { "name": "删除窗户线", "shortcut": "选中 + Q + Delete" },
2100
- { "name": "选中", "shortcut": "鼠标左键" },
2101
- { "name": "多选", "shortcut": "鼠标左键 + Ctrl" },
2102
- { "name": "取消选中", "shortcut": "鼠标左键 + Alt" },
2103
- { "name": "框选", "shortcut": "鼠标左键 + 移动" },
2104
- { "name": "线段同方向合并", "shortcut": "Ctrl + G" },
2105
- { "name": "线段连接", "shortcut": "选中 + Shift + L" },
2106
- { "name": "线段交点连接", "shortcut": "选中 + Ctrl + Shift + L" },
2107
- { "name": "命令确认", "shortcut": "Enter" },
2108
- { "name": "取消命令", "shortcut": "Esc" }
2109
- ], commandList = [
2060
+ const a = r, d = A(!0), i = A(!0), c = A(!0), l = A(!1), h = A(), w = A(), p = A(!0), x = A(""), y = Bt(a.dxfSystem), E = y.findComponentByType(kt), b = y.findComponentByType(dt), D = y.findComponentByType(Se), R = y.findComponentByType(Dt), ae = A(0), q = A(0), _ = A({ left: 10, top: 100 }), M = /* @__PURE__ */ Object.assign({ "./assets/images/angle.svg": bn, "./assets/images/connection.svg": xn, "./assets/images/cutLine.svg": Mn, "./assets/images/deleteSelectLine.svg": kn, "./assets/images/deleteSelectWindow.svg": Pn, "./assets/images/door.svg": An, "./assets/images/intersectionConnection.svg": Sn, "./assets/images/line.svg": Nn, "./assets/images/mergeLine.svg": On, "./assets/images/revokeRollback.svg": Kn, "./assets/images/rollback.svg": Tn, "./assets/images/selectAll.svg": jn, "./assets/images/selectPoint.svg": Qn, "./assets/images/verticalCorrection.svg": Wn, "./assets/images/verticalLine.svg": Jn, "./assets/images/window.svg": Zn }), O = A(!1), v = A(0), Z = A(!1), j = new ResizeObserver(() => e(_.value.left, _.value.top)), xe = [
2061
+ { name: "开启绘制线段命令", shortcut: "Ctrl + L" },
2062
+ { name: "开启绘制门线命令", shortcut: "Ctrl + M" },
2063
+ { name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
2064
+ { name: "开启点修改命令", shortcut: "Ctrl + P" },
2065
+ { name: "线段方向移动线段点(点修改命令下)", shortcut: "Shift + 移动" },
2066
+ { name: "删除线段", shortcut: "选中 + Delete" },
2067
+ { name: "删除窗户线", shortcut: "选中 + Q + Delete" },
2068
+ { name: "选中", shortcut: "鼠标左键" },
2069
+ { name: "多选", shortcut: "鼠标左键 + Ctrl" },
2070
+ { name: "取消选中", shortcut: "鼠标左键 + Alt" },
2071
+ { name: "框选", shortcut: "鼠标左键 + 移动" },
2072
+ { name: "线段同方向合并", shortcut: "Ctrl + G" },
2073
+ { name: "线段连接", shortcut: "选中 + Shift + L" },
2074
+ { name: "线段交点连接", shortcut: "选中 + Ctrl + Shift + L" },
2075
+ { name: "垂直修正", shortcut: "Ctrl + C 或 Ctrl + Shift + C" },
2076
+ { name: "命令确认", shortcut: "Enter" },
2077
+ { name: "取消命令", shortcut: "Esc" },
2078
+ { name: "回滚操作", shortcut: "Ctrl + Z" },
2079
+ { name: "取消回滚操作", shortcut: "Ctrl + Y" }
2080
+ ], Ee = [
2110
2081
  {
2111
2082
  command: "default",
2112
2083
  name: "默认",
2113
- show: false,
2084
+ show: !1,
2114
2085
  shortcut: ""
2115
2086
  },
2116
2087
  {
2117
2088
  command: "draw-line",
2118
2089
  name: "绘制线段",
2119
- src: images["./assets/images/line.svg"].default,
2120
- show: true,
2090
+ src: M["./assets/images/line.svg"].default,
2091
+ show: !0,
2121
2092
  shortcut: "Ctrl + L"
2122
2093
  },
2123
2094
  {
2124
2095
  command: "draw-door-line",
2125
2096
  name: "绘制门线",
2126
- show: true,
2127
- src: images["./assets/images/door.svg"].default,
2097
+ show: !0,
2098
+ src: M["./assets/images/door.svg"].default,
2128
2099
  shortcut: "Ctrl + M"
2129
2100
  },
2130
2101
  {
2131
2102
  command: "draw-window-line",
2132
2103
  name: "绘制窗户线",
2133
- show: true,
2134
- src: images["./assets/images/window.svg"].default,
2104
+ show: !0,
2105
+ src: M["./assets/images/window.svg"].default,
2135
2106
  shortcut: "Ctrl + Q"
2136
2107
  },
2137
2108
  {
2138
2109
  command: "point",
2139
2110
  name: "点修改",
2140
- show: true,
2141
- src: images["./assets/images/selectPoint.svg"].default,
2111
+ show: !0,
2112
+ src: M["./assets/images/selectPoint.svg"].default,
2142
2113
  shortcut: "Ctrl + P"
2114
+ },
2115
+ {
2116
+ command: rt.commandName,
2117
+ name: "裁剪线段",
2118
+ show: !0,
2119
+ src: M["./assets/images/cutLine.svg"].default,
2120
+ shortcut: "Ctrl + X"
2143
2121
  }
2144
- ], otherCommandList = [
2122
+ ], lt = [
2145
2123
  {
2146
- command: MergeLine.commandName,
2124
+ command: "",
2125
+ name: "操作回滚",
2126
+ src: M["./assets/images/rollback.svg"].default,
2127
+ show: P(() => ae.value !== 0),
2128
+ shortcut: "Ctrl + Z",
2129
+ action() {
2130
+ b.commandManager.rollback();
2131
+ }
2132
+ },
2133
+ {
2134
+ command: "",
2135
+ name: "撤销操作回滚",
2136
+ src: M["./assets/images/revokeRollback.svg"].default,
2137
+ show: P(() => q.value !== 0),
2138
+ shortcut: "Ctrl + Y",
2139
+ class: "rotateY-[180deg]",
2140
+ action() {
2141
+ b.commandManager.revokeRollback();
2142
+ }
2143
+ },
2144
+ {
2145
+ command: Y.commandName,
2147
2146
  name: "合并",
2148
- src: images["./assets/images/mergeLine.svg"].default,
2149
- show: computed(() => selectLineCount.value === 2),
2147
+ src: M["./assets/images/mergeLine.svg"].default,
2148
+ show: P(() => v.value === 2),
2150
2149
  shortcut: "Ctrl + G"
2151
2150
  },
2152
2151
  {
2153
- command: ConnectionLine.commandName,
2152
+ command: $.commandName,
2154
2153
  name: "两点连接",
2155
- show: computed(() => selectLineCount.value === 2),
2156
- src: images["./assets/images/connection.svg"].default,
2154
+ show: P(() => v.value === 2),
2155
+ src: M["./assets/images/connection.svg"].default,
2157
2156
  shortcut: "Shift + L"
2158
2157
  },
2159
2158
  {
2160
- command: IntersectionConnectionLine.commandName,
2159
+ command: ee.commandName,
2161
2160
  name: "延长线交点连接",
2162
- show: computed(() => selectLineCount.value === 2),
2163
- src: images["./assets/images/intersectionConnection.svg"].default,
2161
+ show: P(() => v.value === 2),
2162
+ src: M["./assets/images/intersectionConnection.svg"].default,
2164
2163
  shortcut: "Ctrl + Shift + L"
2165
2164
  },
2166
2165
  {
2167
- command: VerticalCorrection.commandName,
2166
+ command: de.commandName,
2168
2167
  name: "线段垂直纠正",
2169
- show: computed(() => selectLineCount.value === 1),
2170
- src: images["./assets/images/verticalCorrection.svg"].default,
2171
- shortcut: "Ctrl + C"
2168
+ show: P(() => v.value === 1),
2169
+ src: M["./assets/images/verticalCorrection.svg"].default,
2170
+ shortcut: "Ctrl + C 或 Ctrl + Shift + C"
2172
2171
  },
2173
2172
  {
2174
- command: SelectAll.commandName,
2173
+ command: se.commandName,
2174
+ name: "y轴垂直基准线",
2175
+ show: P(
2176
+ () => v.value === 1 && !D.selectLines[0].userData.isDoor
2177
+ ),
2178
+ src: M["./assets/images/verticalLine.svg"].default,
2179
+ shortcut: "V"
2180
+ },
2181
+ {
2182
+ command: oe.commandName,
2183
+ name: "角度显示",
2184
+ show: P(() => v.value === 2 && D.selectLines[0].sameEndpoint(D.selectLines[1])),
2185
+ src: M["./assets/images/angle.svg"].default,
2186
+ shortcut: "r"
2187
+ },
2188
+ {
2189
+ command: ne.commandName,
2175
2190
  name: "全选",
2176
- show: computed(() => selectLineCount.value !== editor.renderManager.lines.length),
2177
- src: images["./assets/images/selectAll.svg"].default,
2191
+ show: P(() => v.value !== b.renderManager.lines.length),
2192
+ src: M["./assets/images/selectAll.svg"].default,
2178
2193
  shortcut: "Ctrl + A"
2179
2194
  },
2180
2195
  {
2181
- command: DeleteSelectWindow.commandName,
2196
+ command: te.commandName,
2182
2197
  name: "清除窗户",
2183
- show: computed(() => hasWindowLine.value),
2184
- src: images["./assets/images/deleteSelectWindow.svg"].default,
2198
+ show: P(() => Z.value),
2199
+ src: M["./assets/images/deleteSelectWindow.svg"].default,
2185
2200
  shortcut: "Q + Delete"
2186
2201
  },
2187
2202
  {
2188
- command: DeleteSelectLine.commandName,
2203
+ command: X.commandName,
2189
2204
  name: "删除",
2190
- show: computed(() => selectLineCount.value > 0),
2191
- src: images["./assets/images/deleteSelectLine.svg"].default,
2205
+ show: P(() => v.value > 0),
2206
+ src: M["./assets/images/deleteSelectLine.svg"].default,
2192
2207
  shortcut: "Delete"
2193
2208
  }
2194
2209
  ];
2195
- watch(toolBarPosition, () => localStorage.setItem("editorToolPosition", JSON.stringify(toolBarPosition.value)));
2196
- watch(showShortcutKey, () => localStorage.setItem("showShortcutKey", showShortcutKey.value + ""));
2197
- watch(toolBarExpand, () => {
2198
- localStorage.setItem("toolBarExpand", toolBarExpand.value + "");
2199
- if (toolBarExpand.value) {
2200
- nextTick(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top));
2201
- }
2202
- });
2203
- watch(originalLineVisible, () => dxfSystem.Variable.set("originalLineVisible", originalLineVisible.value));
2204
- watch(dxfVisible, () => dxfSystem.Variable.set("dxfVisible", dxfVisible.value));
2205
- watch(whiteModelVisible, () => dxfSystem.Variable.set("whiteModelVisible", whiteModelVisible.value));
2206
- dxfSystem.Variable.addEventListener("isLook", (e) => isLook.value = e.value);
2207
- dxfSystem.Variable.addEventListener("originalLineVisible", (e) => originalLineVisible.value = e.value);
2208
- dxfSystem.Variable.addEventListener("dxfVisible", (e) => dxfVisible.value = e.value);
2209
- dxfSystem.Variable.addEventListener("whiteModelVisible", (e) => whiteModelVisible.value = e.value);
2210
- const startedEventCancel = editor.commandManager.addEventListener("started", (e) => {
2211
- currentCommand.value = e.name;
2210
+ H(_, () => localStorage.setItem("editorToolPosition", JSON.stringify(_.value))), H(O, () => localStorage.setItem("showShortcutKey", O.value + "")), H(p, () => {
2211
+ localStorage.setItem("toolBarExpand", p.value + ""), p.value && ye(() => e(_.value.left, _.value.top));
2212
+ }), H(d, () => y.Variable.set("originalLineVisible", d.value)), H(i, () => y.Variable.set("dxfVisible", i.value)), H(c, () => y.Variable.set("whiteModelVisible", c.value)), y.Variable.addEventListener("isLook", (C) => l.value = C.value), y.Variable.addEventListener("originalLineVisible", (C) => d.value = C.value), y.Variable.addEventListener("dxfVisible", (C) => i.value = C.value), y.Variable.addEventListener("whiteModelVisible", (C) => c.value = C.value);
2213
+ const ct = b.commandManager.addEventListener("started", (C) => {
2214
+ x.value = C.name;
2212
2215
  });
2213
- if (localStorage.getItem("showShortcutKey")) {
2214
- showShortcutKey.value = localStorage.getItem("showShortcutKey") === "true";
2215
- }
2216
- if (localStorage.getItem("toolBarExpand")) {
2217
- toolBarExpand.value = localStorage.getItem("toolBarExpand") === "true";
2218
- }
2219
- onMounted(() => {
2220
- toolBarRef.value.style.display = "none";
2221
- setTimeout(() => {
2222
- toolBarRef.value.style.display = "block";
2223
- if (localStorage.getItem("editorToolPosition")) {
2224
- const { left, top } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
2225
- setEditorToolPosition(left, top);
2226
- nextTick(() => resizeObserver.observe(elRef.value));
2227
- } else {
2228
- nextTick(() => resizeObserver.observe(elRef.value));
2229
- }
2230
- }, 100);
2231
- defaultComponent.addEventListener("selectLineChange", () => {
2232
- selectLineCount.value = defaultComponent.selectLines.length;
2233
- hasWindowLine.value = defaultComponent.selectLines.some((l) => l.userData.isWindow);
2216
+ return localStorage.getItem("showShortcutKey") && (O.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (p.value = localStorage.getItem("toolBarExpand") === "true"), tt(() => {
2217
+ w.value.style.display = "none", setTimeout(() => {
2218
+ if (w.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
2219
+ const { left: C, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
2220
+ e(C, u), ye(() => j.observe(h.value));
2221
+ } else
2222
+ ye(() => j.observe(h.value));
2223
+ }, 100), D.addEventListener("selectLineChange", () => {
2224
+ v.value = D.selectLines.length, Z.value = D.selectLines.some((C) => C.userData.isWindow);
2225
+ }), ["rollback", "completed", "revokeRollback"].forEach((C) => {
2226
+ b.commandManager.addEventListener(C, () => {
2227
+ setTimeout(() => {
2228
+ ae.value = b.commandManager.operationList.length, q.value = b.commandManager.rollbackList.length;
2229
+ });
2230
+ });
2234
2231
  });
2235
- });
2236
- onUnmounted(() => {
2237
- domEventRegister.mouseMoveEventProxylock = false;
2238
- startedEventCancel();
2239
- resizeObserver.disconnect();
2240
- });
2241
- return (_ctx, _cache) => {
2242
- return openBlock(), createElementBlock("div", {
2243
- ref_key: "elRef",
2244
- ref: elRef,
2245
- class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
2232
+ }), Nt(() => {
2233
+ E.mouseMoveEventProxylock = !1, ct(), j.disconnect();
2234
+ }), (C, u) => (I(), B("div", {
2235
+ ref_key: "elRef",
2236
+ ref: h,
2237
+ class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
2238
+ }, [
2239
+ F(be, null, {
2240
+ default: T(() => [
2241
+ O.value ? (I(), B("div", oo, [
2242
+ (I(), B(ge, null, Ie(xe, (f) => k("div", {
2243
+ class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
2244
+ key: f.name
2245
+ }, [
2246
+ k("p", so, re(f.name), 1),
2247
+ k("span", ao, re(f.shortcut), 1)
2248
+ ])), 64))
2249
+ ])) : J("", !0)
2250
+ ]),
2251
+ _: 1
2252
+ }),
2253
+ k("div", {
2254
+ ref_key: "toolBarRef",
2255
+ ref: w,
2256
+ style: _e({ left: _.value.left + "px", top: _.value.top + "px" }),
2257
+ class: z(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": p.value }]),
2258
+ onMousedown: u[9] || (u[9] = (f) => f.stopPropagation())
2246
2259
  }, [
2247
- createVNode(Transition, null, {
2248
- default: withCtx(() => [
2249
- showShortcutKey.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
2250
- (openBlock(), createElementBlock(Fragment, null, renderList(shortcutKeys, (item) => {
2251
- return createElementVNode("div", {
2252
- class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
2253
- key: item.name
2254
- }, [
2255
- createElementVNode("p", _hoisted_2, toDisplayString(item.name), 1),
2256
- createElementVNode("span", _hoisted_3, toDisplayString(item.shortcut), 1)
2257
- ]);
2258
- }), 64))
2259
- ])) : createCommentVNode("", true)
2260
- ]),
2261
- _: 1
2262
- }),
2263
- createElementVNode("div", {
2264
- ref_key: "toolBarRef",
2265
- ref: toolBarRef,
2266
- style: normalizeStyle({ left: toolBarPosition.value.left + "px", top: toolBarPosition.value.top + "px" }),
2267
- class: normalizeClass(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
2268
- onMousedown: _cache[8] || (_cache[8] = (e) => e.stopPropagation())
2260
+ k("div", {
2261
+ onMousedown: s,
2262
+ class: z([{ "border-b-[#eee] border-b-1": p.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
2269
2263
  }, [
2270
- createElementVNode("div", {
2271
- onMousedown: dragMoveHelper,
2272
- class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
2264
+ u[11] || (u[11] = Rt('<div class="flex flex-row" data-v-205ff80d><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-205ff80d><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-205ff80d><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-205ff80d></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-205ff80d>绘制工具</h5></div>', 1)),
2265
+ k("div", {
2266
+ onMousedown: u[0] || (u[0] = (f) => f.stopPropagation()),
2267
+ onClick: u[1] || (u[1] = (f) => p.value = !p.value),
2268
+ class: "cursor-pointer flex items-center p-[0px_5px]"
2273
2269
  }, [
2274
- _cache[10] || (_cache[10] = createStaticVNode('<div class="flex flex-row" data-v-6aea548c><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-6aea548c><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-6aea548c><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-6aea548c></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-6aea548c>绘制工具</h5></div>', 1)),
2275
- createElementVNode("div", {
2276
- onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
2277
- onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
2278
- class: "cursor-pointer flex items-center p-[0px_5px]"
2270
+ (I(), B("svg", {
2271
+ fill: "#666",
2272
+ class: z([{ "rotate-90": p.value }, "transition-all"]),
2273
+ viewBox: "0 0 1024 1024",
2274
+ version: "1.1",
2275
+ xmlns: "http://www.w3.org/2000/svg",
2276
+ width: "12",
2277
+ height: "12"
2278
+ }, u[10] || (u[10] = [
2279
+ k("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
2280
+ ]), 2))
2281
+ ], 32)
2282
+ ], 34),
2283
+ p.value ? (I(), B("div", io, [
2284
+ k("ul", ro, [
2285
+ (I(), B(ge, null, Ie(Ee, (f) => (I(), B(ge, {
2286
+ key: f.command
2279
2287
  }, [
2280
- (openBlock(), createElementBlock("svg", {
2281
- fill: "#666",
2282
- class: normalizeClass([{ "rotate-90": toolBarExpand.value }, "transition-all"]),
2283
- viewBox: "0 0 1024 1024",
2284
- version: "1.1",
2285
- xmlns: "http://www.w3.org/2000/svg",
2286
- width: "12",
2287
- height: "12"
2288
- }, _cache[9] || (_cache[9] = [
2289
- createElementVNode("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
2290
- ]), 2))
2291
- ], 32)
2292
- ], 34),
2293
- toolBarExpand.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
2294
- createElementVNode("ul", _hoisted_5, [
2295
- (openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
2296
- return openBlock(), createElementBlock(Fragment, {
2297
- key: item.command
2298
- }, [
2299
- item.show ? (openBlock(), createElementBlock("li", {
2300
- key: 0,
2301
- onClick: ($event) => startCurrentCommandItem(item),
2302
- class: normalizeClass([{ "!bg-[var(--primary-color)] text-[#fff]": currentCommand.value === item.command }, "gap-[20px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
2288
+ f.show ? (I(), B("li", {
2289
+ key: 0,
2290
+ onClick: (U) => t(f),
2291
+ class: z([{
2292
+ "!bg-[var(--primary-color)] text-[#fff]": x.value === f.command,
2293
+ "!cursor-no-drop": x.value !== f.command && x.value !== "default"
2294
+ }, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
2295
+ }, [
2296
+ k("div", co, [
2297
+ k("div", mo, [
2298
+ k("img", {
2299
+ class: "size-[14px]",
2300
+ src: f.src,
2301
+ alt: "",
2302
+ srcset: ""
2303
+ }, null, 8, ho)
2304
+ ]),
2305
+ k("span", uo, re(f.name), 1)
2306
+ ]),
2307
+ x.value === f.command ? (I(), B("div", {
2308
+ key: 0,
2309
+ title: "取消命令(Esc)",
2310
+ class: "active:scale-[0.7] transition-all",
2311
+ onClick: u[2] || (u[2] = (U) => (g(b).cancelCommand(), U.stopPropagation()))
2312
+ }, u[12] || (u[12] = [
2313
+ k("svg", {
2314
+ fill: "#fff",
2315
+ width: "16",
2316
+ height: "16",
2317
+ viewBox: "0 0 1024 1024",
2318
+ version: "1.1",
2319
+ xmlns: "http://www.w3.org/2000/svg"
2303
2320
  }, [
2304
- createElementVNode("div", _hoisted_7, [
2305
- createElementVNode("div", _hoisted_8, [
2306
- createElementVNode("img", {
2307
- class: "size-[14px]",
2308
- src: item.src,
2309
- alt: "",
2310
- srcset: ""
2311
- }, null, 8, _hoisted_9)
2312
- ]),
2313
- createElementVNode("span", null, toDisplayString(item.name), 1)
2314
- ]),
2315
- currentCommand.value === item.command ? (openBlock(), createElementBlock("div", {
2316
- key: 0,
2317
- title: "取消命令(Esc)",
2318
- class: "active:scale-[0.7] transition-all",
2319
- onClick: _cache[2] || (_cache[2] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
2320
- }, _cache[11] || (_cache[11] = [
2321
- createElementVNode("svg", {
2322
- fill: "#fff",
2323
- width: "16",
2324
- height: "16",
2325
- viewBox: "0 0 1024 1024",
2326
- version: "1.1",
2327
- xmlns: "http://www.w3.org/2000/svg"
2328
- }, [
2329
- createElementVNode("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
2330
- createElementVNode("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
2331
- ], -1)
2332
- ]))) : item.shortcut ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(item.shortcut), 1)) : createCommentVNode("", true)
2333
- ], 10, _hoisted_6)) : createCommentVNode("", true)
2334
- ], 64);
2335
- }), 64))
2336
- ]),
2337
- createElementVNode("div", _hoisted_11, [
2338
- createVNode(unref(ElCheckbox), {
2339
- size: "small",
2340
- modelValue: showShortcutKey.value,
2341
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => showShortcutKey.value = $event),
2342
- label: "快捷键提示"
2343
- }, null, 8, ["modelValue"]),
2344
- createVNode(unref(ElCheckbox), {
2345
- size: "small",
2346
- modelValue: dxfVisible.value,
2347
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dxfVisible.value = $event),
2348
- label: "dxf"
2349
- }, null, 8, ["modelValue"])
2350
- ]),
2351
- _ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_12, [
2352
- createVNode(unref(ElButton), {
2353
- style: { "padding": "5px", "font-size": "10px" },
2354
- size: "small",
2355
- type: "success",
2356
- onClick: selectLocalFile
2357
- }, {
2358
- default: withCtx(() => _cache[12] || (_cache[12] = [
2359
- createTextVNode(" 选择文件 ", -1)
2360
- ])),
2361
- _: 1,
2362
- __: [12]
2363
- }),
2364
- createVNode(unref(ElButton), {
2365
- style: { "padding": "5px", "font-size": "10px" },
2366
- size: "small",
2367
- type: "primary",
2368
- onClick: _cache[5] || (_cache[5] = ($event) => console.log(unref(dxfSystem).Dxf.originalData))
2369
- }, {
2370
- default: withCtx(() => _cache[13] || (_cache[13] = [
2371
- createTextVNode(" 打印Json ", -1)
2372
- ])),
2373
- _: 1,
2374
- __: [13]
2375
- }),
2376
- createVNode(unref(ElButton), {
2377
- style: { "padding": "5px", "font-size": "10px" },
2378
- size: "small",
2379
- type: "primary",
2380
- onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).Dxf.download("test.dxf"))
2381
- }, {
2382
- default: withCtx(() => _cache[14] || (_cache[14] = [
2383
- createTextVNode(" 下载DXF ", -1)
2384
- ])),
2385
- _: 1,
2386
- __: [14]
2387
- }),
2388
- createVNode(unref(ElButton), {
2389
- style: { "padding": "5px", "font-size": "10px" },
2390
- size: "small",
2391
- type: "primary",
2392
- onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
2393
- }, {
2394
- default: withCtx(() => _cache[15] || (_cache[15] = [
2395
- createTextVNode(" 下载白膜 ", -1)
2396
- ])),
2397
- _: 1,
2398
- __: [15]
2399
- })
2400
- ])) : createCommentVNode("", true),
2401
- createVNode(Transition, null, {
2402
- default: withCtx(() => [
2403
- createElementVNode("div", _hoisted_13, [
2404
- createVNode(TransitionGroup, null, {
2405
- default: withCtx(() => [
2406
- (openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
2407
- return createElementVNode("div", {
2408
- onClick: ($event) => item.show.value && unref(editor).commandManager.start(item.command, [...unref(defaultComponent).selectLines]),
2409
- title: `${item.name}(${item.shortcut})`,
2410
- class: normalizeClass(["relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[2px] p-[2px] transition-all cursor-pointer", { "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !item.show.value }]),
2411
- key: item.command
2412
- }, [
2413
- createElementVNode("img", {
2414
- class: "size-[14px]",
2415
- src: item.src
2416
- }, null, 8, _hoisted_15)
2417
- ], 10, _hoisted_14);
2418
- }), 64))
2419
- ]),
2420
- _: 1
2421
- })
2422
- ])
2423
- ]),
2424
- _: 1
2321
+ k("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
2322
+ k("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
2323
+ ], -1)
2324
+ ]))) : f.shortcut ? (I(), B("div", po, re(f.shortcut), 1)) : J("", !0)
2325
+ ], 10, lo)) : J("", !0)
2326
+ ], 64))), 64))
2327
+ ]),
2328
+ k("div", go, [
2329
+ F(g(Fe), {
2330
+ size: "small",
2331
+ modelValue: O.value,
2332
+ "onUpdate:modelValue": u[3] || (u[3] = (f) => O.value = f),
2333
+ label: "快捷键提示"
2334
+ }, null, 8, ["modelValue"]),
2335
+ F(g(Fe), {
2336
+ size: "small",
2337
+ modelValue: i.value,
2338
+ "onUpdate:modelValue": u[4] || (u[4] = (f) => i.value = f),
2339
+ label: "dxf"
2340
+ }, null, 8, ["modelValue"])
2341
+ ]),
2342
+ C.permission === "admin" ? (I(), B("div", vo, [
2343
+ F(g(ue), {
2344
+ style: { padding: "5px", "font-size": "10px" },
2345
+ size: "small",
2346
+ type: "success",
2347
+ onClick: o
2348
+ }, {
2349
+ default: T(() => u[13] || (u[13] = [
2350
+ ie(" 选择文件 ", -1)
2351
+ ])),
2352
+ _: 1,
2353
+ __: [13]
2354
+ }),
2355
+ F(g(ue), {
2356
+ style: { padding: "5px", "font-size": "10px" },
2357
+ size: "small",
2358
+ type: "primary",
2359
+ onClick: u[5] || (u[5] = (f) => console.log(g(y).Dxf.originalData))
2360
+ }, {
2361
+ default: T(() => u[14] || (u[14] = [
2362
+ ie(" 打印Json ", -1)
2363
+ ])),
2364
+ _: 1,
2365
+ __: [14]
2366
+ }),
2367
+ F(g(ue), {
2368
+ style: { padding: "5px", "font-size": "10px" },
2369
+ size: "small",
2370
+ type: "primary",
2371
+ onClick: u[6] || (u[6] = (f) => g(y).Dxf.download("test.dxf"))
2372
+ }, {
2373
+ default: T(() => u[15] || (u[15] = [
2374
+ ie(" 下载DXF ", -1)
2375
+ ])),
2376
+ _: 1,
2377
+ __: [15]
2378
+ }),
2379
+ F(g(ue), {
2380
+ style: { padding: "5px", "font-size": "10px" },
2381
+ size: "small",
2382
+ type: "primary",
2383
+ onClick: u[7] || (u[7] = (f) => g(y).AngleCorrectionDxf.downloadImage("dxf.jpg"))
2384
+ }, {
2385
+ default: T(() => u[16] || (u[16] = [
2386
+ ie(" 下载JPG ", -1)
2387
+ ])),
2388
+ _: 1,
2389
+ __: [16]
2390
+ }),
2391
+ F(g(ue), {
2392
+ style: { padding: "5px", "font-size": "10px" },
2393
+ size: "small",
2394
+ type: "primary",
2395
+ onClick: u[8] || (u[8] = (f) => g(R).downloadGltf("test.glb", !0))
2396
+ }, {
2397
+ default: T(() => u[17] || (u[17] = [
2398
+ ie(" 下载白膜 ", -1)
2399
+ ])),
2400
+ _: 1,
2401
+ __: [17]
2425
2402
  })
2426
- ])) : createCommentVNode("", true)
2427
- ], 38)
2428
- ], 512);
2429
- };
2430
- }
2431
- });
2432
- const _export_sfc = (sfc, props) => {
2433
- const target = sfc.__vccOpts || sfc;
2434
- for (const [key, val] of props) {
2435
- target[key] = val;
2436
- }
2437
- return target;
2438
- };
2439
- const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6aea548c"]]);
2440
- let Editor$1 = class Editor extends Component {
2403
+ ])) : J("", !0),
2404
+ F(be, null, {
2405
+ default: T(() => [
2406
+ k("div", fo, [
2407
+ F(Ot, null, {
2408
+ default: T(() => [
2409
+ (I(), B(ge, null, Ie(lt, (f) => k("div", {
2410
+ onClick: (U) => f.show.value && x.value === "default" && (f.action ? f.action() : g(b).commandManager.start(f.command, [...g(D).selectLines])),
2411
+ title: `${f.name}(${f.shortcut})`,
2412
+ class: z(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
2413
+ "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !f.show.value || x.value !== "default",
2414
+ [f.class ?? ""]: !0
2415
+ }]),
2416
+ key: f.command
2417
+ }, [
2418
+ k("img", {
2419
+ class: "size-[14px]",
2420
+ src: f.src
2421
+ }, null, 8, wo)
2422
+ ], 10, yo)), 64))
2423
+ ]),
2424
+ _: 1
2425
+ })
2426
+ ])
2427
+ ]),
2428
+ _: 1
2429
+ })
2430
+ ])) : J("", !0)
2431
+ ], 38)
2432
+ ], 512));
2433
+ }
2434
+ }), Co = (r, e) => {
2435
+ const t = r.__vccOpts || r;
2436
+ for (const [n, o] of e)
2437
+ t[n] = o;
2438
+ return t;
2439
+ }, xo = /* @__PURE__ */ Co(bo, [["__scopeId", "data-v-205ff80d"]]);
2440
+ let dt = class extends Ce {
2441
2441
  static name = "Editor";
2442
- container = new THREE.Group();
2442
+ container = new m.Group();
2443
2443
  get renderer() {
2444
2444
  return this.parent?.findComponentByName("Renderer");
2445
2445
  }
@@ -2461,32 +2461,55 @@ let Editor$1 = class Editor extends Component {
2461
2461
  get domContainer() {
2462
2462
  return this.parent?.findComponentByName("DomContainer");
2463
2463
  }
2464
- commandManager = new CommandManager();
2465
- plane = new THREE.Mesh(new THREE.PlaneGeometry(2e3, 2e3, 2, 2));
2464
+ commandManager = new yn();
2465
+ plane = new m.Mesh(new m.PlaneGeometry(2e3, 2e3, 2, 2));
2466
2466
  app;
2467
2467
  domElement = document.createElement("div");
2468
2468
  viewPermission;
2469
- constructor(viewPermission) {
2470
- super();
2471
- this.viewPermission = viewPermission;
2472
- }
2473
- onAddFromParent() {
2469
+ imgEl = document.createElement("img");
2470
+ imgWidth = 80;
2471
+ constructor(e) {
2472
+ super(), this.viewPermission = e, Object.assign(this.imgEl.style, {
2473
+ position: "absolute",
2474
+ left: "5px",
2475
+ top: "5px",
2476
+ width: `${this.imgWidth}px`,
2477
+ height: `${this.imgWidth}px`,
2478
+ borderRadius: "10px",
2479
+ objectFit: "contain",
2480
+ background: "rgba(255,255,255,0.2)",
2481
+ pointerEvents: "none",
2482
+ cursor: "pointer",
2483
+ transition: "all 0.25s"
2484
+ }), this.imgEl.addEventListener("mousedown", (t) => t.stopPropagation()), this.imgEl.addEventListener("mouseup", (t) => t.stopPropagation()), this.imgEl.addEventListener("mousemove", (t) => t.stopPropagation()), this.imgEl.draggable = !1;
2485
+ }
2486
+ onAddFromParent(e) {
2474
2487
  setTimeout(() => this.openEdit(), 10);
2475
- const grid = new THREE.GridHelper(200, 100, 6710886, 4473924);
2476
- grid.rotation.x = Math.PI * 0.5;
2477
- grid.position.z = -0.01;
2478
- this.container.add(grid);
2479
- this.container.add(this.plane);
2480
- this.plane.visible = false;
2481
- const cancelEvent = this.addEventListener("update", () => {
2482
- if (this.domContainer.domElement.parentElement) {
2483
- this.domContainer.domElement.parentElement.appendChild(this.domElement);
2484
- cancelEvent();
2485
- }
2488
+ const t = new m.GridHelper(200, 100, 6710886, 4473924);
2489
+ t.rotation.x = Math.PI * 0.5, t.position.z = -0.01, this.container.add(t), this.container.add(this.plane), this.plane.visible = !1;
2490
+ const n = this.addEventListener("update", () => {
2491
+ this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), this.domContainer.domElement.parentElement.appendChild(this.imgEl), n());
2486
2492
  });
2487
2493
  setTimeout(() => {
2488
- this.app = createApp(EditorTool, { dxfSystem: this.parent, permission: this.viewPermission });
2489
- this.app.mount(this.domElement);
2494
+ this.app = Ft(xo, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
2495
+ }), e.AngleCorrectionDxf.addEventListener("lineOffset", async () => {
2496
+ this.imgEl.src && URL.revokeObjectURL(this.imgEl.src), setTimeout(async () => {
2497
+ this.imgEl.src = URL.createObjectURL(await e.AngleCorrectionDxf.toDxfImageBlob("Centimeters", "image/png", "transparent"));
2498
+ });
2499
+ }), this.domEventRegister.addEventListener("mousedown", (o) => {
2500
+ o.x < this.imgWidth + 10 && o.x > 10 && o.y < this.imgWidth && o.y > 10 && Object.assign(this.imgEl.style, {
2501
+ width: `${Math.min(this.imgWidth * 10, this.renderer.width * 0.9)}px`,
2502
+ height: `${Math.min(this.imgWidth * 10, this.renderer.height * 0.9)}px`,
2503
+ background: "rgba(0,0,0,1)",
2504
+ zIndex: 100
2505
+ });
2506
+ }), this.domEventRegister.addEventListener("mousemove", (o) => {
2507
+ o.x < this.imgWidth + 10 && o.x > 10 && o.y < this.imgWidth && o.y > 10 || Object.assign(this.imgEl.style, {
2508
+ width: `${this.imgWidth}px`,
2509
+ height: `${this.imgWidth}px`,
2510
+ background: "rgba(255,255,255,0.2)",
2511
+ zIndex: 0
2512
+ });
2490
2513
  });
2491
2514
  }
2492
2515
  /**
@@ -2497,179 +2520,113 @@ let Editor$1 = class Editor extends Component {
2497
2520
  type: "cancelCommand"
2498
2521
  });
2499
2522
  }
2500
- coords = new THREE.Vector2();
2501
- pointerPosition = new THREE.Vector2();
2523
+ coords = new m.Vector2();
2524
+ pointerPosition = new m.Vector2();
2502
2525
  _exitEditCallBack;
2503
2526
  /**
2504
2527
  * 打开编辑器
2505
2528
  */
2506
2529
  openEdit() {
2507
- const renderer = this.renderer, domEventRegister = this.domEventRegister, dxf = this.dxf, orbitControls = renderer.orbitControls, camera = renderer.camera, center = dxf.box.center, cameraPosition = renderer.camera.position.clone(), target = orbitControls?.target?.clone(), size = new THREE.Vector2(), raycaster = new THREE.Raycaster(), coords = this.coords, pointerPosition = this.pointerPosition;
2508
- this.container.position.z = dxf.originalZAverage;
2509
- renderer.scene.add(this.container);
2510
- if (orbitControls) {
2511
- camera.position.set(center.x, center.y, 5);
2512
- orbitControls.target.set(center.x, center.y, 0);
2513
- orbitControls.enableRotate = false;
2514
- }
2515
- const mousemoveFun = () => {
2516
- renderer.renderer.getSize(size);
2517
- const x = domEventRegister.pointer.x / size.x * 2 - 1;
2518
- const y = -(domEventRegister.pointer.y / size.y * 2 - 1);
2519
- coords.set(x, y);
2520
- raycaster.setFromCamera(coords, renderer.camera.children.length ? renderer.camera.children[0] : renderer.camera);
2521
- const intersections = raycaster.intersectObject(this.plane);
2522
- if (intersections.length) {
2523
- pointerPosition.copy(intersections[0].point);
2524
- this.dispatchEvent({
2525
- type: "pointerPositionChange",
2526
- position: pointerPosition
2527
- });
2528
- }
2530
+ const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, d = e.camera.position.clone(), i = o?.target?.clone(), c = new m.Vector2(), l = new m.Raycaster(), h = this.coords, w = this.pointerPosition;
2531
+ this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
2532
+ const p = () => {
2533
+ e.renderer.getSize(c);
2534
+ const x = t.pointer.x / c.x * 2 - 1, y = -(t.pointer.y / c.y * 2 - 1);
2535
+ h.set(x, y), l.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
2536
+ const E = l.intersectObject(this.plane);
2537
+ E.length && (w.copy(E[0].point), this.dispatchEvent({
2538
+ type: "pointerPositionChange",
2539
+ position: w
2540
+ }));
2529
2541
  };
2530
- domEventRegister.addEventListener("mousemove", mousemoveFun);
2531
- this.commandManager.disabled = false;
2532
- this.commandManager.start("default");
2533
- this._exitEditCallBack = () => {
2534
- domEventRegister.removeEventListener("mousemove", mousemoveFun);
2535
- if (orbitControls) {
2536
- camera.position.copy(cameraPosition);
2537
- orbitControls.enableRotate = true;
2538
- orbitControls.target.copy(target);
2539
- }
2542
+ t.addEventListener("mousemove", p), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
2543
+ t.removeEventListener("mousemove", p), o && (s.position.copy(d), o.enableRotate = !0, o.target.copy(i));
2540
2544
  };
2541
2545
  }
2542
2546
  /**
2543
2547
  * 退出编辑
2544
2548
  */
2545
2549
  exitEdit() {
2546
- if (typeof this._exitEditCallBack === "function") {
2547
- this._exitEditCallBack();
2548
- this._exitEditCallBack = void 0;
2549
- this.commandManager.disabled = true;
2550
- }
2550
+ typeof this._exitEditCallBack == "function" && (this._exitEditCallBack(), this._exitEditCallBack = void 0, this.commandManager.disabled = !0);
2551
2551
  }
2552
2552
  destroy() {
2553
- super.destroy();
2554
- this.exitEdit();
2555
- this.renderer.scene.remove(this.container);
2556
- this.domElement.remove();
2557
- this.app?.unmount();
2553
+ super.destroy(), this.exitEdit(), this.renderer.scene.remove(this.container), this.domElement.remove(), this.app?.unmount();
2558
2554
  }
2559
2555
  };
2560
- class PointDrag extends CommandFlowComponent {
2556
+ class Eo extends N {
2561
2557
  static name = "PointDrag";
2562
- container = new THREE.Group();
2558
+ container = new m.Group();
2563
2559
  interruptKeys = ["escape"];
2564
2560
  shortcutKeys = ["control", "p"];
2565
2561
  commandName = "point";
2566
- onAddFromParent(parent) {
2567
- super.onAddFromParent(parent);
2568
- this.editor.container.add(this.container);
2569
- this.container.position.z = 1e-3;
2570
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this));
2571
- commandFlow.addEventListener("finally", this.createFinally());
2572
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2573
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
2574
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
2575
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2562
+ onAddFromParent(e) {
2563
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
2564
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2565
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2576
2566
  }
2577
2567
  /** 选择开始点
2578
2568
  * @param next
2579
2569
  */
2580
- selectPoint(next) {
2581
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 })), currentLine = null;
2570
+ selectPoint(e) {
2571
+ let t = null, n = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
2582
2572
  this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
2583
- const { point, line: line2, find, mode } = this.editor.renderManager.adsorption();
2584
- if (find && mode === "point") {
2585
- this.domElement.style.cursor = "none";
2586
- circle.position.copy(point);
2587
- currentLine = line2;
2588
- currentPoint = point.clone();
2589
- this.container.add(circle);
2590
- } else {
2591
- this.domElement.style.cursor = "no-drop";
2592
- currentPoint = null;
2593
- circle.removeFromParent();
2594
- }
2573
+ const { point: s, line: a, find: d, mode: i } = this.editor.renderManager.adsorption();
2574
+ this.dispatchEvent({ type: "pointerMove", point: s }), d && i === "point" ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
2595
2575
  })).add(this.eventInput.addEventListener("codeChange", () => {
2596
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
2597
- this.canceEventRecord("selectPointStart");
2598
- circle.material.color.set(65280);
2599
- next({ point: currentPoint, line: currentLine });
2600
- }
2601
- }));
2602
- this.addEventRecord("clear").add(() => circle.removeFromParent());
2576
+ this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), n.material.color.set(65280), e({ point: t, line: o }));
2577
+ })), this.addEventRecord("clear").add(() => n.removeFromParent());
2603
2578
  }
2604
2579
  /** 拖拽点
2605
2580
  * @description 拖拽点到指定位置
2606
2581
  * @param next
2607
2582
  * @param param1
2608
2583
  */
2609
- drag(next, { point, line: line2 }) {
2584
+ drag(e, { point: t, line: n }) {
2610
2585
  this.domElement.style.cursor = "crosshair";
2611
- const mode = line2.start.equal(Point.from(point)) ? "start" : "end", start = mode == "start" ? new THREE.Vector3(line2.end.x, line2.end.y, 0) : new THREE.Vector3(line2.start.x, line2.start.y, 0), end = point.clone(), lines = new Lines([start, end], 16711935), circle = new THREE.Mesh(new THREE.SphereGeometry(0.03), new THREE.MeshBasicMaterial({ color: 16711935 }));
2612
- this.container.add(lines);
2613
- this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
2614
- let { point: point2, find } = this.editor.renderManager.adsorption(), cursor = "none";
2615
- if (point2) {
2616
- if (this.eventInput.isKeyDown("shift")) {
2617
- const p = line2.projectPoint(Point.from(point2), false);
2618
- point2.set(p?.x ?? point2.x, p?.y ?? point2.y, 0);
2619
- find = true;
2620
- cursor = "crosshair";
2621
- }
2622
- if (find) {
2623
- circle.position.copy(point2);
2624
- this.container.add(circle);
2625
- } else {
2626
- circle.removeFromParent();
2627
- cursor = "crosshair";
2586
+ const o = n.start.equal(V.from(t)) ? "start" : "end", s = o == "start" ? new m.Vector3(n.end.x, n.end.y, 0) : new m.Vector3(n.start.x, n.start.y, 0), a = t.clone(), d = new fe([s, a], 16711935), i = new m.Mesh(new m.SphereGeometry(0.03), new m.MeshBasicMaterial({ color: 16711935 }));
2587
+ this.container.add(d), this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
2588
+ let { point: c, find: l } = this.editor.renderManager.adsorption(), h = "none";
2589
+ if (c) {
2590
+ if (this.dispatchEvent({ type: "pointerMove", point: c }), this.eventInput.isKeyDown("shift")) {
2591
+ const w = n.projectPoint(V.from(c), !1);
2592
+ c.set(w?.x ?? c.x, w?.y ?? c.y, 0), l = !0, h = "crosshair";
2628
2593
  }
2629
- end.copy(point2);
2630
- lines.setPoint(start, end);
2631
- this.domElement.style.cursor = cursor;
2594
+ l ? (i.position.copy(c), this.container.add(i)) : (i.removeFromParent(), h = "crosshair"), a.copy(c), d.setPoint(s, a), this.domElement.style.cursor = h;
2632
2595
  }
2633
2596
  })).add(this.eventInput.addEventListener("codeChange", () => {
2634
- if (this.eventInput.isKeyDown("mouse_0")) {
2635
- this.canceEventRecord("selectPointStart");
2636
- next({ point: end, line: line2, mode });
2637
- }
2638
- })).add(() => circle.removeFromParent()).add(() => lines.removeFromParent());
2597
+ this.eventInput.isKeyDown("mouse_0") && (this.canceEventRecord("selectPointStart"), e({ point: a, oldPoint: o === "end" ? n.end.clone() : n.start.clone(), line: n, mode: o }));
2598
+ })).add(() => i.removeFromParent()).add(() => d.removeFromParent());
2639
2599
  }
2640
2600
  /** 执行完成
2641
2601
  */
2642
- completed(data) {
2643
- const { line: line2, point, mode } = data;
2644
- this.renderManager.removeLine(line2);
2645
- if (mode === "end") line2.end.set(point.x, point.y);
2646
- else if (mode === "start") line2.start.set(point.x, point.y);
2647
- this.renderManager.addLine(line2);
2648
- this.renderManager.draw();
2602
+ completed(e) {
2603
+ const { line: t, point: n, mode: o } = e;
2604
+ this.renderManager.removeLine(t), o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw();
2605
+ }
2606
+ /** 回滚操作
2607
+ * @param data
2608
+ */
2609
+ rollback(e) {
2610
+ const { line: t, oldPoint: n, mode: o } = e;
2611
+ return o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw(), e;
2612
+ }
2613
+ /** 撤回回滚
2614
+ * @param lines
2615
+ * @returns
2616
+ */
2617
+ revokeRollback(e) {
2618
+ return this.completed(e), e;
2649
2619
  }
2650
2620
  }
2651
- function Editor_(dxfSystem, option = {}) {
2652
- dxfSystem.addComponent(new Editor$1(option.viewPermission));
2653
- dxfSystem.addComponent(new RenderManager());
2654
- dxfSystem.addComponent(new Default());
2655
- dxfSystem.addComponent(new DrawLine());
2656
- dxfSystem.addComponent(new DrawDoorLine());
2657
- dxfSystem.addComponent(new DrawWindow());
2658
- dxfSystem.addComponent(new PointDrag());
2659
- dxfSystem.addComponent(new DeleteSelectLine());
2660
- dxfSystem.addComponent(new MergeLine());
2661
- dxfSystem.addComponent(new VerticalCorrection());
2662
- dxfSystem.addComponent(new ConnectionLine());
2663
- dxfSystem.addComponent(new IntersectionConnectionLine());
2664
- dxfSystem.addComponent(new DeleteSelectWindow());
2665
- dxfSystem.addComponent(new SelectAll());
2621
+ function Ue(r, e = {}) {
2622
+ r.addComponent(new dt(e.viewPermission)), r.addComponent(new eo()), r.addComponent(new Se()), r.addComponent(new vn()), r.addComponent(new to()), r.addComponent(new no()), r.addComponent(new Eo()), r.addComponent(new X()), r.addComponent(new Y()), r.addComponent(new de()), r.addComponent(new $()), r.addComponent(new ee()), r.addComponent(new te()), r.addComponent(new ne()), r.addComponent(new oe()), r.addComponent(new se()), r.addComponent(new rt());
2666
2623
  }
2667
- const Editor2 = Object.assign(Editor_, {
2668
- create(option = {}) {
2669
- return (dxfSystem) => Editor_(dxfSystem, option);
2624
+ const _o = Object.assign(Ue, {
2625
+ create(r = {}) {
2626
+ return (e) => Ue(e, r);
2670
2627
  }
2671
2628
  });
2672
2629
  export {
2673
- Editor2 as Editor,
2674
- Editor_
2630
+ _o as Editor,
2631
+ Ue as Editor_
2675
2632
  };