@mlightcad/mtext-parser 1.0.1 → 1.0.4

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/parser.es.js CHANGED
@@ -1,9 +1,9 @@
1
- var x = /* @__PURE__ */ ((s) => (s[s.NONE = 0] = "NONE", s[s.WORD = 1] = "WORD", s[s.STACK = 2] = "STACK", s[s.SPACE = 3] = "SPACE", s[s.NBSP = 4] = "NBSP", s[s.TABULATOR = 5] = "TABULATOR", s[s.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", s[s.NEW_COLUMN = 7] = "NEW_COLUMN", s[s.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", s[s.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", s))(x || {}), g = /* @__PURE__ */ ((s) => (s[s.BOTTOM = 0] = "BOTTOM", s[s.MIDDLE = 1] = "MIDDLE", s[s.TOP = 2] = "TOP", s))(g || {}), E = /* @__PURE__ */ ((s) => (s[s.DEFAULT = 0] = "DEFAULT", s[s.LEFT = 1] = "LEFT", s[s.RIGHT = 2] = "RIGHT", s[s.CENTER = 3] = "CENTER", s[s.JUSTIFIED = 4] = "JUSTIFIED", s[s.DISTRIBUTED = 5] = "DISTRIBUTED", s))(E || {}), m = /* @__PURE__ */ ((s) => (s[s.NONE = 0] = "NONE", s[s.UNDERLINE = 1] = "UNDERLINE", s[s.OVERLINE = 2] = "OVERLINE", s[s.STRIKE_THROUGH = 4] = "STRIKE_THROUGH", s))(m || {});
2
- const b = {
1
+ var k = /* @__PURE__ */ ((r) => (r[r.NONE = 0] = "NONE", r[r.WORD = 1] = "WORD", r[r.STACK = 2] = "STACK", r[r.SPACE = 3] = "SPACE", r[r.NBSP = 4] = "NBSP", r[r.TABULATOR = 5] = "TABULATOR", r[r.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", r[r.NEW_COLUMN = 7] = "NEW_COLUMN", r[r.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", r[r.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", r))(k || {}), b = /* @__PURE__ */ ((r) => (r[r.BOTTOM = 0] = "BOTTOM", r[r.MIDDLE = 1] = "MIDDLE", r[r.TOP = 2] = "TOP", r))(b || {}), E = /* @__PURE__ */ ((r) => (r[r.DEFAULT = 0] = "DEFAULT", r[r.LEFT = 1] = "LEFT", r[r.RIGHT = 2] = "RIGHT", r[r.CENTER = 3] = "CENTER", r[r.JUSTIFIED = 4] = "JUSTIFIED", r[r.DISTRIBUTED = 5] = "DISTRIBUTED", r))(E || {}), m = /* @__PURE__ */ ((r) => (r[r.NONE = 0] = "NONE", r[r.UNDERLINE = 1] = "UNDERLINE", r[r.OVERLINE = 2] = "OVERLINE", r[r.STRIKE_THROUGH = 4] = "STRIKE_THROUGH", r))(m || {});
2
+ const F = {
3
3
  c: "Ø",
4
4
  d: "°",
5
5
  p: "±"
6
- }, w = {
6
+ }, S = {
7
7
  l: 1,
8
8
  r: 2,
9
9
  c: 3,
@@ -11,36 +11,36 @@ const b = {
11
11
  d: 5
12
12
  /* DISTRIBUTED */
13
13
  };
14
- function I(s) {
15
- const [e, t, r] = s;
16
- return r << 16 | t << 8 | e;
14
+ function N(r) {
15
+ const [e, t, s] = r;
16
+ return s << 16 | t << 8 | e;
17
17
  }
18
- function _(s) {
19
- const e = s & 255, t = s >> 8 & 255, r = s >> 16 & 255;
20
- return [e, t, r];
18
+ function _(r) {
19
+ const e = r & 255, t = r >> 8 & 255, s = r >> 16 & 255;
20
+ return [e, t, s];
21
21
  }
22
- function S(s) {
23
- return s.replace(/\^(.)/g, (e, t) => {
24
- const r = t.charCodeAt(0);
25
- return r === 32 ? "^" : r === 73 ? " " : r === 74 ? `
26
- ` : r === 77 ? "" : "▯";
22
+ function I(r) {
23
+ return r.replace(/\^(.)/g, (e, t) => {
24
+ const s = t.charCodeAt(0);
25
+ return s === 32 ? "^" : s === 73 ? " " : s === 74 ? `
26
+ ` : s === 77 ? "" : "▯";
27
27
  });
28
28
  }
29
- function F(s) {
30
- return s.replace(/\r\n|\r|\n/g, "\\P");
29
+ function O(r) {
30
+ return r.replace(/\r\n|\r|\n/g, "\\P");
31
31
  }
32
- function C(s) {
33
- return s.replace(/\\P/g, "").replace(/\\~/g, "").includes("\\");
32
+ function R(r) {
33
+ return r.replace(/\\P/g, "").replace(/\\~/g, "").includes("\\");
34
34
  }
35
- class N {
35
+ class D {
36
36
  /**
37
37
  * Creates a new MTextParser instance
38
38
  * @param content - The MText content to parse
39
39
  * @param ctx - Optional initial MText context
40
40
  * @param yieldPropertyCommands - Whether to yield property change commands
41
41
  */
42
- constructor(e, t, r = !1) {
43
- this.ctxStack = [], this.continueStroke = !1, this.scanner = new p(S(e)), this.ctx = t ?? new d(), this.yieldPropertyCommands = r, this.decoder = new TextDecoder("gbk");
42
+ constructor(e, t, s = !1) {
43
+ this.ctxStack = [], this.continueStroke = !1, this.scanner = new p(I(e)), this.ctx = t ?? new f(), this.lastCtx = this.ctx.copy(), this.yieldPropertyCommands = s, this.decoder = new TextDecoder("gbk");
44
44
  }
45
45
  /**
46
46
  * Decode multi-byte character from hex code
@@ -76,32 +76,33 @@ class N {
76
76
  */
77
77
  parseStacking() {
78
78
  const e = new p(this.extractExpression(!0));
79
- let t = "", r = "", a = "";
80
- const n = () => {
81
- let i = e.peek(), o = !1;
82
- return i.charCodeAt(0) < 32 && (i = " "), i === "\\" && (o = !0, e.consume(1), i = e.peek()), e.consume(1), [i, o];
79
+ let t = "", s = "", n = "";
80
+ const i = () => {
81
+ let a = e.peek(), h = !1;
82
+ return a.charCodeAt(0) < 32 && (a = " "), a === "\\" && (h = !0, e.consume(1), a = e.peek()), e.consume(1), [a, h];
83
83
  }, c = () => {
84
- let i = "";
84
+ let a = "";
85
85
  for (; e.hasData; ) {
86
- const [o, h] = n();
87
- if (!h && "^/#".includes(o))
88
- return [i, o];
89
- i += o;
86
+ const [h, o] = i();
87
+ if (!o && "^/#".includes(h))
88
+ return [a, h];
89
+ a += h;
90
90
  }
91
- return [i, ""];
91
+ return [a, ""];
92
92
  }, l = () => {
93
- let i = "";
93
+ let a = "";
94
94
  for (; e.hasData; ) {
95
- const [o, h] = n();
96
- h && o === ";" ? i += ";" : i += o;
95
+ const [h, o] = i();
96
+ o && h === ";" ? a += ";" : a += h;
97
97
  }
98
- return i;
98
+ return a;
99
99
  };
100
- return [t, a] = c(), a && (r = l()), [2, [t, r, a]];
100
+ return [t, n] = c(), n && (s = l()), [2, [t, s, n]];
101
101
  }
102
102
  /**
103
103
  * Parse MText properties
104
104
  * @param cmd - The property command to parse
105
+ * @returns Property changes if yieldPropertyCommands is true and changes occurred
105
106
  */
106
107
  parseProperties(e) {
107
108
  const t = this.ctx.copy();
@@ -155,7 +156,28 @@ class N {
155
156
  default:
156
157
  throw new Error(`Unknown command: ${e}`);
157
158
  }
158
- t.continueStroke = this.continueStroke, this.ctx = t;
159
+ if (t.continueStroke = this.continueStroke, this.ctx = t, this.yieldPropertyCommands) {
160
+ const s = this.getPropertyChanges(this.lastCtx, t);
161
+ if (Object.keys(s).length > 0)
162
+ return this.lastCtx = this.ctx.copy(), {
163
+ command: e,
164
+ changes: s
165
+ };
166
+ }
167
+ }
168
+ /**
169
+ * Get property changes between two contexts
170
+ * @param oldCtx - The old context
171
+ * @param newCtx - The new context
172
+ * @returns Object containing changed properties
173
+ */
174
+ getPropertyChanges(e, t) {
175
+ const s = {};
176
+ if (e.underline !== t.underline && (s.underline = t.underline), e.overline !== t.overline && (s.overline = t.overline), e.strikeThrough !== t.strikeThrough && (s.strikeThrough = t.strikeThrough), e.aci !== t.aci && (s.aci = t.aci, s.rgb = t.rgb), e.rgb !== t.rgb && (s.rgb = t.rgb), e.align !== t.align && (s.align = t.align), JSON.stringify(e.fontFace) !== JSON.stringify(t.fontFace) && (s.fontFace = t.fontFace), e.capHeight !== t.capHeight && (s.capHeight = t.capHeight), e.widthFactor !== t.widthFactor && (s.widthFactor = t.widthFactor), e.charTrackingFactor !== t.charTrackingFactor && (s.charTrackingFactor = t.charTrackingFactor), e.oblique !== t.oblique && (s.oblique = t.oblique), JSON.stringify(e.paragraph) !== JSON.stringify(t.paragraph)) {
177
+ const n = {};
178
+ e.paragraph.indent !== t.paragraph.indent && (n.indent = t.paragraph.indent), e.paragraph.align !== t.paragraph.align && (n.align = t.paragraph.align), e.paragraph.left !== t.paragraph.left && (n.left = t.paragraph.left), e.paragraph.right !== t.paragraph.right && (n.right = t.paragraph.right), JSON.stringify(e.paragraph.tab_stops) !== JSON.stringify(t.paragraph.tab_stops) && (n.tab_stops = t.paragraph.tab_stops), Object.keys(n).length > 0 && (s.paragraph = n);
179
+ }
180
+ return s;
159
181
  }
160
182
  /**
161
183
  * Parse alignment property
@@ -219,8 +241,8 @@ class N {
219
241
  const t = this.extractFloatExpression(!0);
220
242
  if (t)
221
243
  if (t.endsWith("x")) {
222
- const r = parseFloat(t.slice(0, -1));
223
- e *= Math.abs(r);
244
+ const s = parseFloat(t.slice(0, -1));
245
+ e *= Math.abs(s);
224
246
  } else
225
247
  e = Math.abs(parseFloat(t));
226
248
  return e;
@@ -240,8 +262,8 @@ class N {
240
262
  parseAciColor(e) {
241
263
  const t = this.extractIntExpression();
242
264
  if (t) {
243
- const r = parseInt(t);
244
- r < 257 && (e.aci = r, e.rgb = null);
265
+ const s = parseInt(t);
266
+ s < 257 && (e.aci = s, e.rgb = null);
245
267
  }
246
268
  this.consumeOptionalTerminator();
247
269
  }
@@ -252,8 +274,8 @@ class N {
252
274
  parseRgbColor(e) {
253
275
  const t = this.extractIntExpression();
254
276
  if (t) {
255
- const r = parseInt(t) & 16777215, [a, n, c] = _(r);
256
- e.rgb = [c, n, a];
277
+ const s = parseInt(t) & 16777215, [n, i, c] = _(s);
278
+ e.rgb = [c, i, n];
257
279
  }
258
280
  this.consumeOptionalTerminator();
259
281
  }
@@ -263,10 +285,10 @@ class N {
263
285
  * @returns Extracted expression
264
286
  */
265
287
  extractFloatExpression(e = !1) {
266
- const t = e ? /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?x?/ : /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/, r = this.scanner.tail.match(t);
267
- if (r) {
268
- const a = r[0];
269
- return this.scanner.consume(a.length), a;
288
+ const t = e ? /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?x?/ : /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/, s = this.scanner.tail.match(t);
289
+ if (s) {
290
+ const n = s[0];
291
+ return this.scanner.consume(n.length), n;
270
292
  }
271
293
  return "";
272
294
  }
@@ -293,8 +315,8 @@ class N {
293
315
  const c = this.scanner.tail;
294
316
  return this.scanner.consume(c.length), c;
295
317
  }
296
- const a = this.scanner.peek(t - this.scanner.currentIndex - 1) === "\\", n = this.scanner.tail.slice(0, t - this.scanner.currentIndex + (a ? 1 : 0));
297
- return this.scanner.consume(n.length + 1), n;
318
+ const n = this.scanner.peek(t - this.scanner.currentIndex - 1) === "\\", i = this.scanner.tail.slice(0, t - this.scanner.currentIndex + (n ? 1 : 0));
319
+ return this.scanner.consume(i.length + 1), i;
298
320
  }
299
321
  /**
300
322
  * Parse font properties
@@ -303,14 +325,14 @@ class N {
303
325
  parseFontProperties(e) {
304
326
  const t = this.extractExpression().split("|");
305
327
  if (t.length > 0 && t[0]) {
306
- const r = t[0];
307
- let a = "Regular", n = 400;
328
+ const s = t[0];
329
+ let n = "Regular", i = 400;
308
330
  for (const c of t.slice(1))
309
- c.startsWith("b1") ? n = 700 : c.startsWith("i1") && (a = "Italic");
331
+ c.startsWith("b1") ? i = 700 : c.startsWith("i1") && (n = "Italic");
310
332
  e.fontFace = {
311
- family: r,
312
- style: a,
313
- weight: n
333
+ family: s,
334
+ style: n,
335
+ weight: i
314
336
  };
315
337
  }
316
338
  }
@@ -321,54 +343,54 @@ class N {
321
343
  */
322
344
  parseParagraphProperties(e) {
323
345
  const t = new p(this.extractExpression());
324
- let r = e.paragraph.indent, a = e.paragraph.left, n = e.paragraph.right, c = e.paragraph.align, l = [];
325
- const i = () => {
326
- const o = t.tail.match(/^[+-]?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/);
327
- if (o) {
328
- const h = parseFloat(o[0]);
329
- for (t.consume(o[0].length); t.peek() === ","; )
346
+ let s = e.paragraph.indent, n = e.paragraph.left, i = e.paragraph.right, c = e.paragraph.align, l = [];
347
+ const a = () => {
348
+ const h = t.tail.match(/^[+-]?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/);
349
+ if (h) {
350
+ const o = parseFloat(h[0]);
351
+ for (t.consume(h[0].length); t.peek() === ","; )
330
352
  t.consume(1);
331
- return h;
353
+ return o;
332
354
  }
333
355
  return 0;
334
356
  };
335
357
  for (; t.hasData; )
336
358
  switch (t.get()) {
337
359
  case "i":
338
- r = i();
360
+ s = a();
339
361
  break;
340
362
  case "l":
341
- a = i();
363
+ n = a();
342
364
  break;
343
365
  case "r":
344
- n = i();
366
+ i = a();
345
367
  break;
346
368
  case "x":
347
369
  break;
348
370
  case "q": {
349
- const h = t.get();
350
- for (c = w[h] || 0; t.peek() === ","; )
371
+ const o = t.get();
372
+ for (c = S[o] || 0; t.peek() === ","; )
351
373
  t.consume(1);
352
374
  break;
353
375
  }
354
376
  case "t":
355
377
  for (l = []; t.hasData; ) {
356
- const h = t.peek();
357
- if (h === "r" || h === "c") {
378
+ const o = t.peek();
379
+ if (o === "r" || o === "c") {
358
380
  t.consume(1);
359
- const u = i();
360
- l.push(h + u.toString());
381
+ const u = a();
382
+ l.push(o + u.toString());
361
383
  } else {
362
- const u = i();
384
+ const u = a();
363
385
  isNaN(u) ? t.consume(1) : l.push(u);
364
386
  }
365
387
  }
366
388
  break;
367
389
  }
368
390
  e.paragraph = {
369
- indent: r,
370
- left: a,
371
- right: n,
391
+ indent: s,
392
+ left: n,
393
+ right: i,
372
394
  align: c,
373
395
  tab_stops: l
374
396
  };
@@ -384,30 +406,30 @@ class N {
384
406
  * @yields MTextToken objects
385
407
  */
386
408
  *parse() {
387
- let r = null;
388
- const a = () => {
409
+ let s = null;
410
+ const n = () => {
389
411
  var c;
390
- let n = "";
412
+ let i = "";
391
413
  for (; this.scanner.hasData; ) {
392
- let l = !1, i = this.scanner.peek();
393
- const o = this.scanner.currentIndex;
394
- if (i.charCodeAt(0) < 32) {
395
- if (this.scanner.consume(1), i === " ")
414
+ let l = !1, a = this.scanner.peek();
415
+ const h = this.scanner.currentIndex;
416
+ if (a.charCodeAt(0) < 32) {
417
+ if (this.scanner.consume(1), a === " ")
396
418
  return [5, null];
397
- if (i === `
419
+ if (a === `
398
420
  `)
399
421
  return [6, null];
400
- i = " ";
422
+ a = " ";
401
423
  }
402
- if (i === "\\")
424
+ if (a === "\\")
403
425
  if ("\\{}".includes(this.scanner.peek(1)))
404
- l = !0, this.scanner.consume(1), i = this.scanner.peek();
426
+ l = !0, this.scanner.consume(1), a = this.scanner.peek();
405
427
  else {
406
- if (n)
407
- return [1, n];
428
+ if (i)
429
+ return [1, i];
408
430
  this.scanner.consume(1);
409
- const h = this.scanner.get();
410
- switch (h) {
431
+ const o = this.scanner.get();
432
+ switch (o) {
411
433
  case "~":
412
434
  return [4, null];
413
435
  case "P":
@@ -425,65 +447,63 @@ class N {
425
447
  const u = (c = this.scanner.tail.match(/^[0-9A-Fa-f]{4}/)) == null ? void 0 : c[0];
426
448
  if (u) {
427
449
  this.scanner.consume(4);
428
- const k = this.decodeMultiByteChar(u);
429
- return n ? [1, n] : [1, k];
450
+ const d = this.decodeMultiByteChar(u);
451
+ return i ? [1, i] : [1, d];
430
452
  }
431
453
  this.scanner.consume(-1);
432
454
  }
433
- n += "\\M";
455
+ i += "\\M";
434
456
  continue;
435
457
  default:
436
- if (h)
458
+ if (o)
437
459
  try {
438
- if (this.parseProperties(h), this.yieldPropertyCommands)
439
- return [
440
- 9,
441
- this.scanner.tail.slice(o, this.scanner.currentIndex)
442
- ];
460
+ const u = this.parseProperties(o);
461
+ if (this.yieldPropertyCommands && u)
462
+ return this.lastCtx = this.ctx.copy(), [9, u];
443
463
  continue;
444
464
  } catch {
445
465
  const u = this.scanner.tail.slice(
446
- o,
466
+ h,
447
467
  this.scanner.currentIndex
448
468
  );
449
- n += u;
469
+ i += u;
450
470
  }
451
471
  }
452
472
  continue;
453
473
  }
454
- if (i === "%" && this.scanner.peek(1) === "%") {
455
- const h = this.scanner.peek(2).toLowerCase(), u = b[h];
474
+ if (a === "%" && this.scanner.peek(1) === "%") {
475
+ const o = this.scanner.peek(2).toLowerCase(), u = F[o];
456
476
  if (u) {
457
- this.scanner.consume(3), n += u;
477
+ this.scanner.consume(3), i += u;
458
478
  continue;
459
479
  } else {
460
480
  this.scanner.consume(3);
461
481
  continue;
462
482
  }
463
483
  }
464
- if (i === " ")
465
- return n ? (this.scanner.consume(1), r = 3, [1, n]) : (this.scanner.consume(1), [3, null]);
484
+ if (a === " ")
485
+ return i ? (this.scanner.consume(1), s = 3, [1, i]) : (this.scanner.consume(1), [3, null]);
466
486
  if (!l) {
467
- if (i === "{") {
468
- if (n)
469
- return [1, n];
487
+ if (a === "{") {
488
+ if (i)
489
+ return [1, i];
470
490
  this.scanner.consume(1), this.pushCtx();
471
491
  continue;
472
- } else if (i === "}") {
473
- if (n)
474
- return [1, n];
492
+ } else if (a === "}") {
493
+ if (i)
494
+ return [1, i];
475
495
  this.scanner.consume(1), this.popCtx();
476
496
  continue;
477
497
  }
478
498
  }
479
- this.scanner.consume(1), i.charCodeAt(0) >= 32 && (n += i);
499
+ this.scanner.consume(1), a.charCodeAt(0) >= 32 && (i += a);
480
500
  }
481
- return n ? [1, n] : [0, null];
501
+ return i ? [1, i] : [0, null];
482
502
  };
483
503
  for (; ; ) {
484
- const [n, c] = a();
485
- if (n)
486
- yield new f(n, this.ctx, c), r && (yield new f(r, this.ctx, null), r = null);
504
+ const [i, c] = n();
505
+ if (i)
506
+ yield new g(i, this.ctx, c), s && (yield new g(s, this.ctx, null), s = null);
487
507
  else
488
508
  break;
489
509
  }
@@ -548,21 +568,21 @@ class p {
548
568
  * @returns Index of the character, or -1 if not found
549
569
  */
550
570
  find(e, t = !1) {
551
- let r = this._index;
552
- for (; r < this.textLen; ) {
553
- if (t && this.text[r] === "\\") {
554
- if (r + 1 < this.textLen) {
555
- if (this.text[r + 1] === e)
556
- return r + 1;
557
- r += 2;
571
+ let s = this._index;
572
+ for (; s < this.textLen; ) {
573
+ if (t && this.text[s] === "\\") {
574
+ if (s + 1 < this.textLen) {
575
+ if (this.text[s + 1] === e)
576
+ return s + 1;
577
+ s += 2;
558
578
  continue;
559
579
  }
560
- r++;
580
+ s++;
561
581
  continue;
562
582
  }
563
- if (this.text[r] === e)
564
- return r;
565
- r++;
583
+ if (this.text[s] === e)
584
+ return s;
585
+ s++;
566
586
  }
567
587
  return -1;
568
588
  }
@@ -589,7 +609,7 @@ class p {
589
609
  return e;
590
610
  }
591
611
  }
592
- class d {
612
+ class f {
593
613
  constructor() {
594
614
  this._stroke = 0, this.continueStroke = !1, this._aci = 7, this.rgb = null, this.align = 0, this.fontFace = { family: "", style: "Regular", weight: 400 }, this.capHeight = 1, this.widthFactor = 1, this.charTrackingFactor = 1, this.oblique = 0, this.paragraph = {
595
615
  indent: 0,
@@ -674,34 +694,34 @@ class d {
674
694
  * @returns A new context with the same properties
675
695
  */
676
696
  copy() {
677
- const e = new d();
697
+ const e = new f();
678
698
  return e._stroke = this._stroke, e.continueStroke = this.continueStroke, e._aci = this._aci, e.rgb = this.rgb, e.align = this.align, e.fontFace = { ...this.fontFace }, e.capHeight = this.capHeight, e.widthFactor = this.widthFactor, e.charTrackingFactor = this.charTrackingFactor, e.oblique = this.oblique, e.paragraph = { ...this.paragraph }, e;
679
699
  }
680
700
  }
681
- class f {
701
+ class g {
682
702
  /**
683
703
  * Create a new MText token
684
704
  * @param type - The token type
685
705
  * @param ctx - The text context at this token
686
706
  * @param data - Optional token data
687
707
  */
688
- constructor(e, t, r) {
689
- this.type = e, this.ctx = t, this.data = r;
708
+ constructor(e, t, s) {
709
+ this.type = e, this.ctx = t, this.data = s;
690
710
  }
691
711
  }
692
712
  export {
693
- d as MTextContext,
694
- g as MTextLineAlignment,
713
+ f as MTextContext,
714
+ b as MTextLineAlignment,
695
715
  E as MTextParagraphAlignment,
696
- N as MTextParser,
716
+ D as MTextParser,
697
717
  m as MTextStroke,
698
- f as MTextToken,
718
+ g as MTextToken,
699
719
  p as TextScanner,
700
- x as TokenType,
701
- S as caretDecode,
702
- F as escapeDxfLineEndings,
703
- C as hasInlineFormattingCodes,
720
+ k as TokenType,
721
+ I as caretDecode,
722
+ O as escapeDxfLineEndings,
723
+ R as hasInlineFormattingCodes,
704
724
  _ as int2rgb,
705
- I as rgb2int
725
+ N as rgb2int
706
726
  };
707
727
  //# sourceMappingURL=parser.es.js.map