@mlightcad/dxf-json-converter 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dxf-json-converter.umd.cjs +1 -1
- package/dist/dxf-parser-worker.js +179 -165
- package/lib/AcDbDxfConverter.d.ts +1 -1
- package/lib/AcDbDxfConverter.d.ts.map +1 -1
- package/lib/AcDbDxfConverter.js +19 -22
- package/lib/AcDbDxfConverter.js.map +1 -1
- package/lib/AcDbEntitiyConverter.d.ts +1 -0
- package/lib/AcDbEntitiyConverter.d.ts.map +1 -1
- package/lib/AcDbEntitiyConverter.js +9 -0
- package/lib/AcDbEntitiyConverter.js.map +1 -1
- package/package.json +3 -3
|
@@ -61,83 +61,83 @@ var Vr = [
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
return new (a || (a = Promise))(function(o, c) {
|
|
64
|
-
function f
|
|
64
|
+
function m(f) {
|
|
65
65
|
try {
|
|
66
|
-
|
|
66
|
+
d(t.next(f));
|
|
67
67
|
} catch (b) {
|
|
68
68
|
c(b);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function l(f) {
|
|
72
72
|
try {
|
|
73
|
-
|
|
73
|
+
d(t.throw(f));
|
|
74
74
|
} catch (b) {
|
|
75
75
|
c(b);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
78
|
+
function d(f) {
|
|
79
|
+
f.done ? o(f.value) : s(f.value).then(m, l);
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
d((t = t.apply(e, n || [])).next());
|
|
82
82
|
});
|
|
83
83
|
}, un = function(e, n) {
|
|
84
84
|
var a = { label: 0, sent: function() {
|
|
85
85
|
if (o[0] & 1) throw o[1];
|
|
86
86
|
return o[1];
|
|
87
87
|
}, trys: [], ops: [] }, t, s, o, c;
|
|
88
|
-
return c = { next:
|
|
88
|
+
return c = { next: m(0), throw: m(1), return: m(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
|
|
89
89
|
return this;
|
|
90
90
|
}), c;
|
|
91
|
-
function
|
|
92
|
-
return function(
|
|
93
|
-
return
|
|
91
|
+
function m(d) {
|
|
92
|
+
return function(f) {
|
|
93
|
+
return l([d, f]);
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function d
|
|
96
|
+
function l(d) {
|
|
97
97
|
if (t) throw new TypeError("Generator is already executing.");
|
|
98
|
-
for (; c && (c = 0,
|
|
99
|
-
if (t = 1, s && (o =
|
|
100
|
-
switch (s = 0, o && (
|
|
98
|
+
for (; c && (c = 0, d[0] && (a = 0)), a; ) try {
|
|
99
|
+
if (t = 1, s && (o = d[0] & 2 ? s.return : d[0] ? s.throw || ((o = s.return) && o.call(s), 0) : s.next) && !(o = o.call(s, d[1])).done) return o;
|
|
100
|
+
switch (s = 0, o && (d = [d[0] & 2, o.value]), d[0]) {
|
|
101
101
|
case 0:
|
|
102
102
|
case 1:
|
|
103
|
-
o =
|
|
103
|
+
o = d;
|
|
104
104
|
break;
|
|
105
105
|
case 4:
|
|
106
|
-
return a.label++, { value:
|
|
106
|
+
return a.label++, { value: d[1], done: !1 };
|
|
107
107
|
case 5:
|
|
108
|
-
a.label++, s =
|
|
108
|
+
a.label++, s = d[1], d = [0];
|
|
109
109
|
continue;
|
|
110
110
|
case 7:
|
|
111
|
-
|
|
111
|
+
d = a.ops.pop(), a.trys.pop();
|
|
112
112
|
continue;
|
|
113
113
|
default:
|
|
114
|
-
if (o = a.trys, !(o = o.length > 0 && o[o.length - 1]) && (
|
|
114
|
+
if (o = a.trys, !(o = o.length > 0 && o[o.length - 1]) && (d[0] === 6 || d[0] === 2)) {
|
|
115
115
|
a = 0;
|
|
116
116
|
continue;
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
a.label =
|
|
118
|
+
if (d[0] === 3 && (!o || d[1] > o[0] && d[1] < o[3])) {
|
|
119
|
+
a.label = d[1];
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
|
-
if (
|
|
123
|
-
a.label = o[1], o =
|
|
122
|
+
if (d[0] === 6 && a.label < o[1]) {
|
|
123
|
+
a.label = o[1], o = d;
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
if (o && a.label < o[2]) {
|
|
127
|
-
a.label = o[2], a.ops.push(
|
|
127
|
+
a.label = o[2], a.ops.push(d);
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
130
|
o[2] && a.ops.pop(), a.trys.pop();
|
|
131
131
|
continue;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
} catch (
|
|
135
|
-
|
|
133
|
+
d = n.call(e, a);
|
|
134
|
+
} catch (f) {
|
|
135
|
+
d = [6, f], s = 0;
|
|
136
136
|
} finally {
|
|
137
137
|
t = o = 0;
|
|
138
138
|
}
|
|
139
|
-
if (
|
|
140
|
-
return { value:
|
|
139
|
+
if (d[0] & 5) throw d[1];
|
|
140
|
+
return { value: d[0] ? d[1] : void 0, done: !0 };
|
|
141
141
|
}
|
|
142
142
|
}, mn = function() {
|
|
143
143
|
function e() {
|
|
@@ -147,31 +147,45 @@ var Vr = [
|
|
|
147
147
|
var n = this;
|
|
148
148
|
self.onmessage = function(a) {
|
|
149
149
|
return pn(n, void 0, void 0, function() {
|
|
150
|
-
var t, s, o, c,
|
|
151
|
-
return un(this, function(
|
|
152
|
-
switch (
|
|
150
|
+
var t, s, o, c, m;
|
|
151
|
+
return un(this, function(l) {
|
|
152
|
+
switch (l.label) {
|
|
153
153
|
case 0:
|
|
154
|
-
t = a.data, s = t.id, o = t.input,
|
|
154
|
+
t = a.data, s = t.id, o = t.input, l.label = 1;
|
|
155
155
|
case 1:
|
|
156
|
-
return
|
|
156
|
+
return l.trys.push([1, 3, , 4]), [4, this.executeTask(o)];
|
|
157
157
|
case 2:
|
|
158
|
-
return c =
|
|
158
|
+
return c = l.sent(), this.sendResponse(s, !0, c), [3, 4];
|
|
159
159
|
case 3:
|
|
160
|
-
return
|
|
160
|
+
return m = l.sent(), this.sendResponse(s, !1, void 0, m instanceof Error ? m.message : String(m)), [3, 4];
|
|
161
161
|
case 4:
|
|
162
162
|
return [2];
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
|
-
}, e.prototype.sendResponse = function(n, a, t, s) {
|
|
168
|
-
var
|
|
167
|
+
}, e.prototype.sendResponse = function(n, a, t, s, o) {
|
|
168
|
+
var c = {
|
|
169
169
|
id: n,
|
|
170
170
|
success: a,
|
|
171
171
|
data: t,
|
|
172
|
-
error: s
|
|
172
|
+
error: s,
|
|
173
|
+
errorCode: o
|
|
173
174
|
};
|
|
174
|
-
|
|
175
|
+
try {
|
|
176
|
+
self.postMessage(c);
|
|
177
|
+
} catch (l) {
|
|
178
|
+
var m = l instanceof Error ? l.message : String(l);
|
|
179
|
+
self.postMessage({
|
|
180
|
+
id: n,
|
|
181
|
+
success: !1,
|
|
182
|
+
error: m,
|
|
183
|
+
errorCode: this.classifyPostMessageError(m)
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}, e.prototype.classifyPostMessageError = function(n) {
|
|
187
|
+
var a = n.toLowerCase();
|
|
188
|
+
return a.includes("out of memory") || a.includes("data cannot be cloned") ? "worker_oom" : "worker_error";
|
|
175
189
|
}, e;
|
|
176
190
|
}(), Mr;
|
|
177
191
|
(function(e) {
|
|
@@ -270,30 +284,30 @@ function he(e) {
|
|
|
270
284
|
let ar = Symbol();
|
|
271
285
|
function u(e, n) {
|
|
272
286
|
return (a, t, s) => {
|
|
273
|
-
let o = function(
|
|
274
|
-
return
|
|
275
|
-
b.pushContext &&
|
|
276
|
-
let y =
|
|
287
|
+
let o = function(l, d = !1) {
|
|
288
|
+
return l.reduce((f, b) => {
|
|
289
|
+
b.pushContext && f.push({});
|
|
290
|
+
let y = f[f.length - 1];
|
|
277
291
|
for (let g of typeof b.code == "number" ? [b.code] : b.code) {
|
|
278
292
|
let S = y[g] ?? (y[g] = []);
|
|
279
293
|
b.isMultiple && S.length, S.push(b);
|
|
280
294
|
}
|
|
281
|
-
return
|
|
295
|
+
return f;
|
|
282
296
|
}, [{}]);
|
|
283
|
-
}(e, t.debug), c = !1,
|
|
297
|
+
}(e, t.debug), c = !1, m = o.length - 1;
|
|
284
298
|
for (; !h(a, 0, "EOF"); ) {
|
|
285
|
-
let
|
|
299
|
+
let l = function(A, w, V) {
|
|
286
300
|
return A.find((Pe, F) => {
|
|
287
301
|
var _;
|
|
288
302
|
return F >= V && ((_ = Pe[w]) == null ? void 0 : _.length);
|
|
289
303
|
});
|
|
290
|
-
}(o, a.code,
|
|
291
|
-
if (!
|
|
304
|
+
}(o, a.code, m), d = l == null ? void 0 : l[a.code], f = d == null ? void 0 : d[d.length - 1];
|
|
305
|
+
if (!l || !f) {
|
|
292
306
|
t.rewind();
|
|
293
307
|
break;
|
|
294
308
|
}
|
|
295
|
-
|
|
296
|
-
let { name: b, parser: y, isMultiple: g, isReducible: S } =
|
|
309
|
+
f.isMultiple || l[a.code].pop();
|
|
310
|
+
let { name: b, parser: y, isMultiple: g, isReducible: S } = f, v = y == null ? void 0 : y(a, t, s);
|
|
297
311
|
if (v === ar) {
|
|
298
312
|
t.rewind();
|
|
299
313
|
break;
|
|
@@ -302,7 +316,7 @@ function u(e, n) {
|
|
|
302
316
|
let [A, w] = yn(s, b);
|
|
303
317
|
g && !S ? (Object.prototype.hasOwnProperty.call(A, w) || (A[w] = []), A[w].push(v)) : A[w] = v;
|
|
304
318
|
}
|
|
305
|
-
|
|
319
|
+
f.pushContext && (m -= 1), c = !0, a = t.next();
|
|
306
320
|
}
|
|
307
321
|
return n && Object.setPrototypeOf(s, n), c;
|
|
308
322
|
};
|
|
@@ -345,14 +359,14 @@ function J(e, n, a) {
|
|
|
345
359
|
var t;
|
|
346
360
|
let s = e.value;
|
|
347
361
|
if (e = n.next(), !s.startsWith("{")) {
|
|
348
|
-
n.debug, function(c,
|
|
349
|
-
for (; !h(c, 102) && !h(c, 0, "EOF"); ) c =
|
|
362
|
+
n.debug, function(c, m) {
|
|
363
|
+
for (; !h(c, 102) && !h(c, 0, "EOF"); ) c = m.next();
|
|
350
364
|
}(e, n), e = n.next();
|
|
351
365
|
continue;
|
|
352
366
|
}
|
|
353
367
|
let o = s.slice(1).trim();
|
|
354
|
-
a.extensions ?? (a.extensions = {}), (t = a.extensions)[o] ?? (t[o] = []), function(c,
|
|
355
|
-
for (; !h(c, 102, "}") && !h(c, 0, "EOF"); )
|
|
368
|
+
a.extensions ?? (a.extensions = {}), (t = a.extensions)[o] ?? (t[o] = []), function(c, m, l) {
|
|
369
|
+
for (; !h(c, 102, "}") && !h(c, 0, "EOF"); ) l.push(c), c = m.next();
|
|
356
370
|
}(e, n, a.extensions[o]), e = n.next();
|
|
357
371
|
}
|
|
358
372
|
n.rewind();
|
|
@@ -799,8 +813,8 @@ function _r(e, n, a = !1) {
|
|
|
799
813
|
let c = o.trim().toLowerCase();
|
|
800
814
|
if (c === "" || c === "0" || c === "false" || c === "f" || c === "no") return !1;
|
|
801
815
|
if (c === "1" || c === "true" || c === "t" || c === "yes") return !0;
|
|
802
|
-
let
|
|
803
|
-
if (!Number.isNaN(
|
|
816
|
+
let m = Number.parseFloat(c);
|
|
817
|
+
if (!Number.isNaN(m)) return m !== 0;
|
|
804
818
|
throw TypeError("String '" + o + "' cannot be cast to Boolean type");
|
|
805
819
|
}(n.trim()) : e >= 300 && e <= 369 ? s : e >= 370 && e <= 389 ? parseInt(n.trim()) : e >= 390 && e <= 399 ? s : e >= 400 && e <= 409 ? parseInt(n.trim()) : e >= 410 && e <= 419 ? s : e >= 420 && e <= 429 ? parseInt(n.trim()) : e >= 430 && e <= 439 ? s : e >= 440 && e <= 459 ? parseInt(n.trim()) : e >= 460 && e <= 469 ? parseFloat(n.trim()) : e >= 470 && e <= 481 || e === 999 || e >= 1e3 && e <= 1009 ? s : e >= 1010 && e <= 1059 ? parseFloat(n.trim()) : e >= 1060 && e <= 1071 ? parseInt(n.trim()) : s;
|
|
806
820
|
}
|
|
@@ -822,25 +836,25 @@ let ma = [{ code: 330, name: "sourceBoundaryObjects", parser: r, isMultiple: !0
|
|
|
822
836
|
function lt(e, n) {
|
|
823
837
|
let a = { boundaryPathTypeFlag: e.value }, t = !!(a.boundaryPathTypeFlag & gn.Polyline), s = n.getReadIndex();
|
|
824
838
|
return e = n.next(), !t && function(o, c) {
|
|
825
|
-
let
|
|
826
|
-
for (;
|
|
827
|
-
let
|
|
828
|
-
if (Number.isNaN(
|
|
829
|
-
if (
|
|
830
|
-
if (
|
|
831
|
-
let
|
|
832
|
-
if (
|
|
833
|
-
if (
|
|
834
|
-
if (
|
|
835
|
-
if (
|
|
836
|
-
let b = parseInt(o[
|
|
839
|
+
let m = Math.min(o.length, c + 120), l = c;
|
|
840
|
+
for (; l < m - 1; ) {
|
|
841
|
+
let d = parseInt(o[l], 10);
|
|
842
|
+
if (Number.isNaN(d)) break;
|
|
843
|
+
if (d === 93) {
|
|
844
|
+
if (l + 3 >= o.length || parseInt(o[l + 2], 10) !== 72) return !1;
|
|
845
|
+
let f = _r(72, o[l + 3]);
|
|
846
|
+
if (f === 0) return !0;
|
|
847
|
+
if (f === 1) {
|
|
848
|
+
if (l + 5 < o.length && parseInt(o[l + 4], 10) === 73) return !0;
|
|
849
|
+
if (l + 8 < o.length && parseInt(o[l + 4], 10) === 10) {
|
|
850
|
+
let b = parseInt(o[l + 8], 10);
|
|
837
851
|
if (b === 10 || b === 42) return !0;
|
|
838
852
|
}
|
|
839
853
|
}
|
|
840
854
|
break;
|
|
841
855
|
}
|
|
842
|
-
if (
|
|
843
|
-
|
|
856
|
+
if (d === 0) break;
|
|
857
|
+
l += 2;
|
|
844
858
|
}
|
|
845
859
|
return !1;
|
|
846
860
|
}(n.getLines(), s) && (t = !0), t ? u(ct)(e, n, a) : u(it)(e, n, a), a;
|
|
@@ -984,7 +998,7 @@ let Dt = [{ code: 90, name: "overridenSubEntityCount", parser: r }, { code: 140,
|
|
|
984
998
|
let s = 0;
|
|
985
999
|
for (; s < t.length; ) {
|
|
986
1000
|
let o = t[s++], c = [];
|
|
987
|
-
for (let
|
|
1001
|
+
for (let m = 0; m < o; ++m) c.push(t[s++]);
|
|
988
1002
|
a.faceIndices.push(c);
|
|
989
1003
|
}
|
|
990
1004
|
} }, { code: 10, name: "vertices", parser: i, isMultiple: !0 }, { code: 92, name: "verticesCount", parser: r }, { code: 91, name: "subdivisionLevel", parser: r }, { code: 40, name: "blendCrease", parser: r }, { code: 72, name: "isBlendCreased", parser: p }, { code: 71, name: "version", parser: r }, { code: 100, name: "subclassMarker", parser: vn, pushContext: !0 }, ...E];
|
|
@@ -1150,42 +1164,42 @@ let Mt = {}, wt = [{ code: 300, parser: function(e, n, a) {
|
|
|
1150
1164
|
a.planeNormalReversed = t.value;
|
|
1151
1165
|
break;
|
|
1152
1166
|
case 302:
|
|
1153
|
-
t.value === "LEADER{" && (a.leaderSections ?? (a.leaderSections = []), a.leaderSections.push(function(c,
|
|
1154
|
-
let
|
|
1167
|
+
t.value === "LEADER{" && (a.leaderSections ?? (a.leaderSections = []), a.leaderSections.push(function(c, m) {
|
|
1168
|
+
let l, d;
|
|
1155
1169
|
if (c.value !== "LEADER{") return { leaderLines: [] };
|
|
1156
|
-
let
|
|
1157
|
-
for (;
|
|
1158
|
-
if ((
|
|
1159
|
-
tr(
|
|
1170
|
+
let f = { leaderLines: [] };
|
|
1171
|
+
for (; m.hasNext(); ) {
|
|
1172
|
+
if ((d = m.next()).code === 303) {
|
|
1173
|
+
tr(f, l);
|
|
1160
1174
|
break;
|
|
1161
1175
|
}
|
|
1162
|
-
switch (
|
|
1176
|
+
switch (d.code) {
|
|
1163
1177
|
case 290:
|
|
1164
|
-
|
|
1178
|
+
f.lastLeaderLinePointSet = d.value;
|
|
1165
1179
|
break;
|
|
1166
1180
|
case 291:
|
|
1167
|
-
|
|
1181
|
+
f.doglegVectorSet = d.value;
|
|
1168
1182
|
break;
|
|
1169
1183
|
case 10:
|
|
1170
|
-
|
|
1184
|
+
f.lastLeaderLinePoint = C(d, m);
|
|
1171
1185
|
break;
|
|
1172
1186
|
case 11:
|
|
1173
|
-
|
|
1187
|
+
f.doglegVector = C(d, m);
|
|
1174
1188
|
break;
|
|
1175
1189
|
case 12:
|
|
1176
|
-
|
|
1190
|
+
l ?? (l = {}), l.start = C(d, m);
|
|
1177
1191
|
break;
|
|
1178
1192
|
case 13:
|
|
1179
|
-
|
|
1193
|
+
l ?? (l = {}), l.end = C(d, m), tr(f, l), l = void 0;
|
|
1180
1194
|
break;
|
|
1181
1195
|
case 90:
|
|
1182
|
-
|
|
1196
|
+
f.leaderBranchIndex = d.value;
|
|
1183
1197
|
break;
|
|
1184
1198
|
case 40:
|
|
1185
|
-
|
|
1199
|
+
f.doglegLength = d.value;
|
|
1186
1200
|
break;
|
|
1187
1201
|
case 304:
|
|
1188
|
-
|
|
1202
|
+
d.value === "LEADER_LINE{" && f.leaderLines.push(function(b, y) {
|
|
1189
1203
|
let g, S;
|
|
1190
1204
|
if (b.value !== "LEADER_LINE{") return { vertices: [] };
|
|
1191
1205
|
let v = { vertices: [] };
|
|
@@ -1212,10 +1226,10 @@ let Mt = {}, wt = [{ code: 300, parser: function(e, n, a) {
|
|
|
1212
1226
|
}
|
|
1213
1227
|
}
|
|
1214
1228
|
return v;
|
|
1215
|
-
}(
|
|
1229
|
+
}(d, m));
|
|
1216
1230
|
}
|
|
1217
1231
|
}
|
|
1218
|
-
return
|
|
1232
|
+
return f;
|
|
1219
1233
|
}(t, n)));
|
|
1220
1234
|
break;
|
|
1221
1235
|
case 304:
|
|
@@ -1494,102 +1508,102 @@ class mr {
|
|
|
1494
1508
|
break;
|
|
1495
1509
|
case 171:
|
|
1496
1510
|
t.cells ?? (t.cells = []), t.cells.push(function(s, o) {
|
|
1497
|
-
let c = !1,
|
|
1498
|
-
for (; !s.isEOF() && o.code !== 0 && !
|
|
1511
|
+
let c = !1, m = !1, l = {};
|
|
1512
|
+
for (; !s.isEOF() && o.code !== 0 && !m; ) switch (o.code) {
|
|
1499
1513
|
case 171:
|
|
1500
1514
|
if (c) {
|
|
1501
|
-
|
|
1515
|
+
m = !0;
|
|
1502
1516
|
continue;
|
|
1503
1517
|
}
|
|
1504
|
-
|
|
1518
|
+
l.cellType = o.value, c = !0, o = s.next();
|
|
1505
1519
|
break;
|
|
1506
1520
|
case 172:
|
|
1507
|
-
|
|
1521
|
+
l.flagValue = o.value, o = s.next();
|
|
1508
1522
|
break;
|
|
1509
1523
|
case 173:
|
|
1510
|
-
|
|
1524
|
+
l.mergedValue = o.value, o = s.next();
|
|
1511
1525
|
break;
|
|
1512
1526
|
case 174:
|
|
1513
|
-
|
|
1527
|
+
l.autoFit = o.value, o = s.next();
|
|
1514
1528
|
break;
|
|
1515
1529
|
case 175:
|
|
1516
|
-
|
|
1530
|
+
l.borderWidth = o.value, o = s.next();
|
|
1517
1531
|
break;
|
|
1518
1532
|
case 176:
|
|
1519
|
-
|
|
1533
|
+
l.borderHeight = o.value, o = s.next();
|
|
1520
1534
|
break;
|
|
1521
1535
|
case 91:
|
|
1522
|
-
|
|
1536
|
+
l.overrideFlag = o.value, o = s.next();
|
|
1523
1537
|
break;
|
|
1524
1538
|
case 178:
|
|
1525
|
-
|
|
1539
|
+
l.virtualEdgeFlag = o.value, o = s.next();
|
|
1526
1540
|
break;
|
|
1527
1541
|
case 145:
|
|
1528
|
-
|
|
1542
|
+
l.rotation = o.value, o = s.next();
|
|
1529
1543
|
break;
|
|
1530
1544
|
case 345:
|
|
1531
|
-
|
|
1545
|
+
l.fieldObjetId = o.value, o = s.next();
|
|
1532
1546
|
break;
|
|
1533
1547
|
case 340:
|
|
1534
|
-
|
|
1548
|
+
l.blockTableRecordId = o.value, o = s.next();
|
|
1535
1549
|
break;
|
|
1536
1550
|
case 146:
|
|
1537
|
-
|
|
1551
|
+
l.blockScale = o.value, o = s.next();
|
|
1538
1552
|
break;
|
|
1539
1553
|
case 177:
|
|
1540
|
-
|
|
1554
|
+
l.blockAttrNum = o.value, o = s.next();
|
|
1541
1555
|
break;
|
|
1542
1556
|
case 7:
|
|
1543
|
-
|
|
1557
|
+
l.textStyle = o.value, o = s.next();
|
|
1544
1558
|
break;
|
|
1545
1559
|
case 140:
|
|
1546
|
-
|
|
1560
|
+
l.textHeight = o.value, o = s.next();
|
|
1547
1561
|
break;
|
|
1548
1562
|
case 170:
|
|
1549
|
-
|
|
1563
|
+
l.attachmentPoint = o.value, o = s.next();
|
|
1550
1564
|
break;
|
|
1551
1565
|
case 92:
|
|
1552
|
-
|
|
1566
|
+
l.extendedCellFlags = o.value, o = s.next();
|
|
1553
1567
|
break;
|
|
1554
1568
|
case 285:
|
|
1555
|
-
|
|
1569
|
+
l.rightBorderVisibility = !!(o.value ?? !0), o = s.next();
|
|
1556
1570
|
break;
|
|
1557
1571
|
case 286:
|
|
1558
|
-
|
|
1572
|
+
l.bottomBorderVisibility = !!(o.value ?? !0), o = s.next();
|
|
1559
1573
|
break;
|
|
1560
1574
|
case 288:
|
|
1561
|
-
|
|
1575
|
+
l.leftBorderVisibility = !!(o.value ?? !0), o = s.next();
|
|
1562
1576
|
break;
|
|
1563
1577
|
case 289:
|
|
1564
|
-
|
|
1578
|
+
l.topBorderVisibility = !!(o.value ?? !0), o = s.next();
|
|
1565
1579
|
break;
|
|
1566
1580
|
case 301:
|
|
1567
|
-
(function(
|
|
1581
|
+
(function(d, f, b) {
|
|
1568
1582
|
for (; b.code !== 304; ) switch (b.code) {
|
|
1569
1583
|
case 301:
|
|
1570
1584
|
case 93:
|
|
1571
1585
|
case 90:
|
|
1572
1586
|
case 94:
|
|
1573
|
-
b =
|
|
1587
|
+
b = f.next();
|
|
1574
1588
|
break;
|
|
1575
1589
|
case 1:
|
|
1576
|
-
|
|
1590
|
+
d.text = b.value, b = f.next();
|
|
1577
1591
|
break;
|
|
1578
1592
|
case 300:
|
|
1579
|
-
|
|
1593
|
+
d.attrText = b.value, b = f.next();
|
|
1580
1594
|
break;
|
|
1581
1595
|
case 302:
|
|
1582
|
-
|
|
1596
|
+
d.text = b.value ? b.value : d.text, b = f.next();
|
|
1583
1597
|
break;
|
|
1584
1598
|
default:
|
|
1585
|
-
b =
|
|
1599
|
+
b = f.next();
|
|
1586
1600
|
}
|
|
1587
|
-
})(
|
|
1601
|
+
})(l, s, o), o = s.next();
|
|
1588
1602
|
break;
|
|
1589
1603
|
default:
|
|
1590
|
-
return
|
|
1604
|
+
return l;
|
|
1591
1605
|
}
|
|
1592
|
-
return c = !1,
|
|
1606
|
+
return c = !1, m = !1, l;
|
|
1593
1607
|
}(n, a)), a = n.lastReadGroup;
|
|
1594
1608
|
break;
|
|
1595
1609
|
default:
|
|
@@ -1878,20 +1892,20 @@ function Wo(e) {
|
|
|
1878
1892
|
}
|
|
1879
1893
|
function jo(e, n = {}) {
|
|
1880
1894
|
if (!Br(e)) throw Error("Not a binary DXF file.");
|
|
1881
|
-
let { dxfVersion: a, encoding: t, r12: s } = function(
|
|
1895
|
+
let { dxfVersion: a, encoding: t, r12: s } = function(d, f, b) {
|
|
1882
1896
|
let y, g = !function(F) {
|
|
1883
1897
|
let _ = Re.length;
|
|
1884
1898
|
return F.length < _ + 9 || (F[_] === 0 && F[_ + 1] === 0 ? Yr(F.subarray(_ + 2, _ + 9)) === "SECTION" : F[_] !== 0 || Yr(F.subarray(_ + 1, _ + 8)) !== "SECTION");
|
|
1885
|
-
}(
|
|
1899
|
+
}(d), S = new DataView(d.buffer, d.byteOffset, d.byteLength), v = jr(b), A = "AC1009", w = f, V = Re.length, Pe = Math.min(d.length, V + 8192);
|
|
1886
1900
|
for (; V < Pe; ) {
|
|
1887
|
-
let [F, _] = sr(
|
|
1901
|
+
let [F, _] = sr(d, V, g), [Ie, Er] = ir(d, S, _, F, w, v);
|
|
1888
1902
|
if (F === 9 && Ie === "$ACADVER") {
|
|
1889
|
-
let [_e, gr] = sr(
|
|
1903
|
+
let [_e, gr] = sr(d, Er, g), [xr, yr] = ir(d, S, gr, _e, "utf-8", v);
|
|
1890
1904
|
_e === 1 && (A = xr), V = yr;
|
|
1891
1905
|
continue;
|
|
1892
1906
|
}
|
|
1893
1907
|
if (F === 9 && Ie === "$DWGCODEPAGE") {
|
|
1894
|
-
let [_e, gr] = sr(
|
|
1908
|
+
let [_e, gr] = sr(d, Er, g), [xr, yr] = ir(d, S, gr, _e, "ascii", v);
|
|
1895
1909
|
(_e === 3 || _e === 1) && (y = xr), V = yr;
|
|
1896
1910
|
continue;
|
|
1897
1911
|
}
|
|
@@ -1902,13 +1916,13 @@ function jo(e, n = {}) {
|
|
|
1902
1916
|
if (!_) return;
|
|
1903
1917
|
let Ie = _[1];
|
|
1904
1918
|
return Ie === "1252" ? "windows-1252" : Ie === "949" ? "euc-kr" : `windows-${Ie}`;
|
|
1905
|
-
}(y) ??
|
|
1906
|
-
}(e, n.encoding ?? "windows-1252", n.encodingFailureFatal ?? !1), o = [], c = new DataView(e.buffer, e.byteOffset, e.byteLength),
|
|
1907
|
-
for (;
|
|
1908
|
-
let [
|
|
1909
|
-
if (
|
|
1919
|
+
}(y) ?? f), { dxfVersion: A, encoding: w, r12: g };
|
|
1920
|
+
}(e, n.encoding ?? "windows-1252", n.encodingFailureFatal ?? !1), o = [], c = new DataView(e.buffer, e.byteOffset, e.byteLength), m = jr(n.encodingFailureFatal ?? !1), l = Re.length;
|
|
1921
|
+
for (; l < e.length; ) {
|
|
1922
|
+
let [d, f] = sr(e, l, s), [b, y] = ir(e, c, l = f, d, t, m);
|
|
1923
|
+
if (l = y, o.push(String(d), b), d === 0 && b === "EOF") break;
|
|
1910
1924
|
}
|
|
1911
|
-
if (o.length < 2 || o[o.length - 1] !== "EOF") throw Error(`Binary DXF ended without EOF group (version ${a}, offset ${
|
|
1925
|
+
if (o.length < 2 || o[o.length - 1] !== "EOF") throw Error(`Binary DXF ended without EOF group (version ${a}, offset ${l}).`);
|
|
1912
1926
|
return o;
|
|
1913
1927
|
}
|
|
1914
1928
|
function sr(e, n, a) {
|
|
@@ -1919,8 +1933,8 @@ function sr(e, n, a) {
|
|
|
1919
1933
|
return [e[n] | e[n + 1] << 8, n + 2];
|
|
1920
1934
|
}
|
|
1921
1935
|
function ir(e, n, a, t, s, o) {
|
|
1922
|
-
var c,
|
|
1923
|
-
let
|
|
1936
|
+
var c, m;
|
|
1937
|
+
let l;
|
|
1924
1938
|
if (Go.has(t)) {
|
|
1925
1939
|
let b = e[a];
|
|
1926
1940
|
a += 1;
|
|
@@ -1936,9 +1950,9 @@ function ir(e, n, a, t, s, o) {
|
|
|
1936
1950
|
if (Vo.has(t)) return [String(n.getInt32(a, !0)), a + 4];
|
|
1937
1951
|
if (Uo.has(t)) return [String(Number(n.getBigInt64(a, !0))), a + 8];
|
|
1938
1952
|
if (Ho.has(t)) return [String(n.getFloat64(a, !0)), a + 8];
|
|
1939
|
-
let
|
|
1940
|
-
for (;
|
|
1941
|
-
return [(c = o,
|
|
1953
|
+
let d = a, f = d;
|
|
1954
|
+
for (; f < e.length && e[f] !== 0; ) f++;
|
|
1955
|
+
return [(c = o, m = s, (l = c.byEncoding.get(m)) || (l = new TextDecoder(m, { fatal: c.fatal }), c.byEncoding.set(m, l)), l).decode(e.subarray(d, f)), f + 1];
|
|
1942
1956
|
}
|
|
1943
1957
|
function jr(e) {
|
|
1944
1958
|
return { fatal: e, byEncoding: /* @__PURE__ */ new Map() };
|
|
@@ -1980,9 +1994,9 @@ class zo extends EventTarget {
|
|
|
1980
1994
|
typeof c == "string" ? a.push(new TextEncoder().encode(c)) : a.push(c);
|
|
1981
1995
|
}), n.on("end", () => {
|
|
1982
1996
|
try {
|
|
1983
|
-
let c = a.reduce((
|
|
1984
|
-
for (let
|
|
1985
|
-
s(t.parseBuffer(
|
|
1997
|
+
let c = a.reduce((d, f) => d + f.length, 0), m = new Uint8Array(c), l = 0;
|
|
1998
|
+
for (let d of a) m.set(d, l), l += d.length;
|
|
1999
|
+
s(t.parseBuffer(m));
|
|
1986
2000
|
} catch (c) {
|
|
1987
2001
|
o(c);
|
|
1988
2002
|
}
|
|
@@ -2006,22 +2020,22 @@ class zo extends EventTarget {
|
|
|
2006
2020
|
parseAll(n) {
|
|
2007
2021
|
let a = { header: {}, blocks: {}, entities: [], tables: {}, objects: { byName: {}, byTree: void 0 } }, t = n.next();
|
|
2008
2022
|
for (; !h(t, 0, "EOF"); ) h(t, 0, "SECTION") && (h(t = n.next(), 2, "HEADER") ? a.header = oo(t = n.next(), n) : h(t, 2, "CLASSES") ? Nn(t = n.next(), n, a) : h(t, 2, "BLOCKS") ? a.blocks = So(t = n.next(), n) : h(t, 2, "ENTITIES") ? a.entities = sn(t = n.next(), n) : h(t, 2, "TABLES") ? a.tables = vo(t = n.next(), n) : h(t, 2, "OBJECTS") ? a.objects = Ro(t = n.next(), n) : h(t, 2, "THUMBNAILIMAGE") && (a.thumbnailImage = function(s, o, c = "base64") {
|
|
2009
|
-
let
|
|
2010
|
-
for (; !h(s, 0, "EOF") && !h(s, 0, "ENDSEC"); ) s.code === 90 ?
|
|
2011
|
-
if (c === "hex")
|
|
2023
|
+
let m, l = "", d = 0;
|
|
2024
|
+
for (; !h(s, 0, "EOF") && !h(s, 0, "ENDSEC"); ) s.code === 90 ? d = s.value : s.code === 310 && (l += s.value), s = o.next();
|
|
2025
|
+
if (c === "hex") m = l;
|
|
2012
2026
|
else {
|
|
2013
|
-
let
|
|
2027
|
+
let f = function(b) {
|
|
2014
2028
|
let y = b.length / 2, g = new Uint8Array(y);
|
|
2015
2029
|
for (let S = 0; S < y; S++) g[S] = parseInt(b.substr(2 * S, 2), 16);
|
|
2016
2030
|
return g;
|
|
2017
|
-
}(
|
|
2018
|
-
|
|
2031
|
+
}(l);
|
|
2032
|
+
m = c === "buffer" ? f : function(b) {
|
|
2019
2033
|
let y = "";
|
|
2020
2034
|
for (let g = 0; g < b.length; g++) y += String.fromCharCode(b[g]);
|
|
2021
2035
|
return btoa(y);
|
|
2022
|
-
}(
|
|
2036
|
+
}(f);
|
|
2023
2037
|
}
|
|
2024
|
-
return { size:
|
|
2038
|
+
return { size: d, data: m };
|
|
2025
2039
|
}(t = n.next(), n, this._options.thumbnailImageFormat))), t = n.next();
|
|
2026
2040
|
return a;
|
|
2027
2041
|
}
|
|
@@ -2052,9 +2066,9 @@ class Ko {
|
|
|
2052
2066
|
return s.version && s.version.value <= 23 && s.encoding ? o = new TextDecoder(s.encoding).decode(n) : o = new TextDecoder().decode(n), t.parseSync(o);
|
|
2053
2067
|
}
|
|
2054
2068
|
getDxfInfoFromBuffer(n) {
|
|
2055
|
-
var
|
|
2069
|
+
var d, f, b;
|
|
2056
2070
|
const t = new TextDecoder("utf-8");
|
|
2057
|
-
let s = 0, o = "", c = null,
|
|
2071
|
+
let s = 0, o = "", c = null, m = null, l = !1;
|
|
2058
2072
|
for (; s < n.byteLength; ) {
|
|
2059
2073
|
const y = Math.min(s + 65536, n.byteLength), g = n.slice(s, y);
|
|
2060
2074
|
s = y;
|
|
@@ -2062,25 +2076,25 @@ class Ko {
|
|
|
2062
2076
|
o = v.pop() ?? "";
|
|
2063
2077
|
for (let A = 0; A < v.length; A++) {
|
|
2064
2078
|
const w = v[A].trim();
|
|
2065
|
-
if (w === "SECTION" && ((
|
|
2066
|
-
|
|
2067
|
-
else if (w === "ENDSEC" &&
|
|
2068
|
-
return { version: c, encoding:
|
|
2069
|
-
if (
|
|
2070
|
-
const V = (
|
|
2079
|
+
if (w === "SECTION" && ((d = v[A + 2]) == null ? void 0 : d.trim()) === "HEADER")
|
|
2080
|
+
l = !0;
|
|
2081
|
+
else if (w === "ENDSEC" && l)
|
|
2082
|
+
return { version: c, encoding: m };
|
|
2083
|
+
if (l && w === "$ACADVER") {
|
|
2084
|
+
const V = (f = v[A + 2]) == null ? void 0 : f.trim();
|
|
2071
2085
|
V && (c = new dn(V));
|
|
2072
|
-
} else if (
|
|
2086
|
+
} else if (l && w === "$DWGCODEPAGE") {
|
|
2073
2087
|
const V = (b = v[A + 2]) == null ? void 0 : b.trim();
|
|
2074
2088
|
if (V) {
|
|
2075
2089
|
const Pe = Mr[V];
|
|
2076
|
-
|
|
2090
|
+
m = bn(Pe);
|
|
2077
2091
|
}
|
|
2078
2092
|
}
|
|
2079
|
-
if (c &&
|
|
2080
|
-
return { version: c, encoding:
|
|
2093
|
+
if (c && m)
|
|
2094
|
+
return { version: c, encoding: m };
|
|
2081
2095
|
}
|
|
2082
2096
|
}
|
|
2083
|
-
return { version: c, encoding:
|
|
2097
|
+
return { version: c, encoding: m };
|
|
2084
2098
|
}
|
|
2085
2099
|
}
|
|
2086
2100
|
class Zo extends mn {
|