@flyfish-group/file-viewer 1.0.22 → 1.0.23

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 (211) hide show
  1. package/README.md +10 -10
  2. package/dist/components/3MFLoader.js +1 -1
  3. package/dist/components/AMFLoader.js +1 -1
  4. package/dist/components/AudioViewer.js +1 -1
  5. package/dist/components/CadViewer.js +1 -1
  6. package/dist/components/CodeViewer.js +1 -1
  7. package/dist/components/ColladaLoader.js +1 -1
  8. package/dist/components/DrawingViewer.js +1 -1
  9. package/dist/components/EdaViewer.js +1 -1
  10. package/dist/components/EmailViewer.js +1 -1
  11. package/dist/components/EpubViewer.js +1 -1
  12. package/dist/components/FBXLoader.js +1 -1
  13. package/dist/components/GLTFLoader.js +1 -1
  14. package/dist/components/ImageViewer.js +1 -1
  15. package/dist/components/KMZLoader.js +1 -1
  16. package/dist/components/MarkdownViewer.js +1 -1
  17. package/dist/components/OBJLoader.js +1 -1
  18. package/dist/components/OfdViewer.js +1 -1
  19. package/dist/components/PCDLoader.js +1 -1
  20. package/dist/components/PLYLoader.js +1 -1
  21. package/dist/components/STLLoader.js +1 -1
  22. package/dist/components/TDSLoader.js +1 -1
  23. package/dist/components/USDLoader.js +1 -1
  24. package/dist/components/UmdViewer.js +2 -2
  25. package/dist/components/VRMLLoader.js +1 -1
  26. package/dist/components/VTKLoader.js +1 -1
  27. package/dist/components/XYZLoader.js +1 -1
  28. package/dist/components/XlsxTable.js +1 -1
  29. package/dist/components/___vite-browser-external_commonjs-proxy.js +1 -1
  30. package/dist/components/_commonjs-dynamic-modules.js +1 -1
  31. package/dist/components/_commonjsHelpers.js +1 -1
  32. package/dist/components/ar-SA-G6X2FPQ2.js +1 -1
  33. package/dist/components/arc.js +1 -1
  34. package/dist/components/architecture-7EHR7CIX.js +1 -1
  35. package/dist/components/architectureDiagram-3BPJPVTR.js +1 -1
  36. package/dist/components/az-AZ-76LH7QW2.js +1 -1
  37. package/dist/components/bg-BG-XCXSNQG7.js +1 -1
  38. package/dist/components/blockDiagram-GPEHLZMM.js +1 -1
  39. package/dist/components/bn-BD-2XOGV67Q.js +1 -1
  40. package/dist/components/c4Diagram-AAUBKEIU.js +1 -1
  41. package/dist/components/ca-ES-6MX7JW3Y.js +1 -1
  42. package/dist/components/cfb.js +1 -1
  43. package/dist/components/channel.js +1 -1
  44. package/dist/components/chunk-2J33WTMH.js +1 -1
  45. package/dist/components/chunk-4BX2VUAB.js +1 -1
  46. package/dist/components/chunk-55IACEB6.js +1 -1
  47. package/dist/components/chunk-727SXJPM.js +1 -1
  48. package/dist/components/chunk-AQP2D5EJ.js +1 -1
  49. package/dist/components/chunk-FMBD7UC4.js +1 -1
  50. package/dist/components/chunk-ND2GUHAM.js +1 -1
  51. package/dist/components/chunk-QZHKN3VN.js +1 -1
  52. package/dist/components/classDiagram-4FO5ZUOK.js +1 -1
  53. package/dist/components/classDiagram-v2-Q7XG4LA2.js +1 -1
  54. package/dist/components/cose-bilkent-S5V4N54A.js +1 -1
  55. package/dist/components/cs-CZ-2BRQDIVT.js +1 -1
  56. package/dist/components/cytoscape.esm.js +1 -1
  57. package/dist/components/da-DK-5WZEPLOC.js +1 -1
  58. package/dist/components/dagre-BM42HDAG.js +1 -1
  59. package/dist/components/de-DE-XR44H4JA.js +1 -1
  60. package/dist/components/defaultLocale.js +1 -1
  61. package/dist/components/diagram-2AECGRRQ.js +1 -1
  62. package/dist/components/diagram-5GNKFQAL.js +1 -1
  63. package/dist/components/diagram-KO2AKTUF.js +1 -1
  64. package/dist/components/diagram-LMA3HP47.js +1 -1
  65. package/dist/components/diagram-OG6HWLK6.js +1 -1
  66. package/dist/components/directory-open-01563666.js +1 -1
  67. package/dist/components/directory-open-4ed118d0.js +1 -1
  68. package/dist/components/docx-preview.js +2 -2
  69. package/dist/components/el-GR-BZB4AONW.js +1 -1
  70. package/dist/components/en-B4ZKOASM.js +1 -1
  71. package/dist/components/erDiagram-TEJ5UH35.js +1 -1
  72. package/dist/components/es-ES-U4NZUMDT.js +1 -1
  73. package/dist/components/eu-ES-A7QVB2H4.js +1 -1
  74. package/dist/components/eventmodeling-FCH6USID.js +1 -1
  75. package/dist/components/fa-IR-HGAKTJCU.js +1 -1
  76. package/dist/components/fflate.module.js +1 -1
  77. package/dist/components/fi-FI-Z5N7JZ37.js +1 -1
  78. package/dist/components/file-open-002ab408.js +1 -1
  79. package/dist/components/file-open-7c801643.js +1 -1
  80. package/dist/components/file-save-3189631c.js +1 -1
  81. package/dist/components/file-save-745eba88.js +1 -1
  82. package/dist/components/flowDiagram-I6XJVG4X.js +1 -1
  83. package/dist/components/fr-FR-RHASNOE6.js +1 -1
  84. package/dist/components/ganttDiagram-6RSMTGT7.js +1 -1
  85. package/dist/components/gitGraph-WXDBUCRP.js +1 -1
  86. package/dist/components/gitGraphDiagram-PVQCEYII.js +1 -1
  87. package/dist/components/gl-ES-HMX3MZ6V.js +1 -1
  88. package/dist/components/global-compiler.js +1 -1
  89. package/dist/components/global-renderer.js +1 -1
  90. package/dist/components/graph.js +1 -1
  91. package/dist/components/he-IL-6SHJWFNN.js +1 -1
  92. package/dist/components/hi-IN-IWLTKZ5I.js +1 -1
  93. package/dist/components/hu-HU-A5ZG7DT2.js +1 -1
  94. package/dist/components/id-ID-SAP4L64H.js +1 -1
  95. package/dist/components/image-GAAHSSAO.js +1 -1
  96. package/dist/components/image-blob-reduce.esm.js +1 -1
  97. package/dist/components/index10.js +1 -1
  98. package/dist/components/index11.js +1 -1
  99. package/dist/components/index12.js +1 -1
  100. package/dist/components/index13.js +1 -1
  101. package/dist/components/index14.js +1 -1
  102. package/dist/components/index15.js +1 -1
  103. package/dist/components/index16.js +1 -1
  104. package/dist/components/index17.js +1 -1
  105. package/dist/components/index18.js +1 -1
  106. package/dist/components/index19.js +1 -1
  107. package/dist/components/index2.js +1 -1
  108. package/dist/components/index20.js +1 -1
  109. package/dist/components/index21.js +1 -1
  110. package/dist/components/index22.js +2 -2
  111. package/dist/components/index23.js +1 -1
  112. package/dist/components/index24.js +1 -1
  113. package/dist/components/index3.js +1 -1
  114. package/dist/components/index4.js +1 -1
  115. package/dist/components/index5.js +1 -1
  116. package/dist/components/index6.js +1 -1
  117. package/dist/components/index7.js +1 -1
  118. package/dist/components/index8.js +1 -1
  119. package/dist/components/index9.js +1 -1
  120. package/dist/components/info-J43DQDTF.js +1 -1
  121. package/dist/components/infoDiagram-5YYISTIA.js +1 -1
  122. package/dist/components/init.js +1 -1
  123. package/dist/components/ishikawaDiagram-YF4QCWOH.js +1 -1
  124. package/dist/components/it-IT-JPQ66NNP.js +1 -1
  125. package/dist/components/ja-JP-DBVTYXUO.js +1 -1
  126. package/dist/components/journeyDiagram-JHISSGLW.js +1 -1
  127. package/dist/components/jszip.min.js +1 -1
  128. package/dist/components/kaa-6HZHGXH3.js +1 -1
  129. package/dist/components/kab-KAB-ZGHBKWFO.js +1 -1
  130. package/dist/components/kanban-definition-UN3LZRKU.js +1 -1
  131. package/dist/components/katex.js +1 -1
  132. package/dist/components/kk-KZ-P5N5QNE5.js +1 -1
  133. package/dist/components/km-KH-HSX4SM5Z.js +1 -1
  134. package/dist/components/ko-KR-MTYHY66A.js +1 -1
  135. package/dist/components/ku-TR-6OUDTVRD.js +1 -1
  136. package/dist/components/layout.js +1 -1
  137. package/dist/components/libarchive.js +1 -1
  138. package/dist/components/linear.js +1 -1
  139. package/dist/components/lt-LT-XHIRWOB4.js +1 -1
  140. package/dist/components/lv-LV-5QDEKY6T.js +1 -1
  141. package/dist/components/mermaid-parser.core.js +2 -2
  142. package/dist/components/mindmap-definition-RKZ34NQL.js +1 -1
  143. package/dist/components/mr-IN-CRQNXWMA.js +1 -1
  144. package/dist/components/my-MM-5M5IBNSE.js +1 -1
  145. package/dist/components/nb-NO-T6EIAALU.js +1 -1
  146. package/dist/components/nestedRender.js +1 -1
  147. package/dist/components/nl-NL-IS3SIHDZ.js +1 -1
  148. package/dist/components/nn-NO-6E72VCQL.js +1 -1
  149. package/dist/components/oc-FR-POXYY2M6.js +1 -1
  150. package/dist/components/ofd.js +1 -1
  151. package/dist/components/ordinal.js +1 -1
  152. package/dist/components/pa-IN-N4M65BXN.js +1 -1
  153. package/dist/components/packet-YPE3B663.js +1 -1
  154. package/dist/components/percentages-BXMCSKIN.js +1 -1
  155. package/dist/components/pica.js +1 -1
  156. package/dist/components/pie-LRSECV5Y.js +1 -1
  157. package/dist/components/pie.js +1 -1
  158. package/dist/components/pieDiagram-4H26LBE5.js +1 -1
  159. package/dist/components/pl-PL-T2D74RX3.js +1 -1
  160. package/dist/components/postal-mime.js +1 -1
  161. package/dist/components/printLayout.js +1 -1
  162. package/dist/components/pt-BR-5N22H2LF.js +1 -1
  163. package/dist/components/pt-PT-UZXXM6DQ.js +1 -1
  164. package/dist/components/quadrantDiagram-W4KKPZXB.js +1 -1
  165. package/dist/components/radar-GUYGQ44K.js +1 -1
  166. package/dist/components/requirementDiagram-4Y6WPE33.js +1 -1
  167. package/dist/components/ro-RO-JPDTUUEW.js +1 -1
  168. package/dist/components/rough.esm.js +1 -1
  169. package/dist/components/roundRect.js +1 -1
  170. package/dist/components/ru-RU-B4JR7IUQ.js +1 -1
  171. package/dist/components/sankeyDiagram-5OEKKPKP.js +1 -1
  172. package/dist/components/sequenceDiagram-3UESZ5HK.js +1 -1
  173. package/dist/components/si-LK-N5RQ5JYF.js +1 -1
  174. package/dist/components/sk-SK-C5VTKIMK.js +1 -1
  175. package/dist/components/sl-SI-NN7IZMDC.js +1 -1
  176. package/dist/components/stateDiagram-AJRCARHV.js +1 -1
  177. package/dist/components/stateDiagram-v2-BHNVJYJU.js +1 -1
  178. package/dist/components/subset-shared.chunk.js +1 -1
  179. package/dist/components/subset-worker.chunk.js +1 -1
  180. package/dist/components/sv-SE-XGPEYMSR.js +1 -1
  181. package/dist/components/ta-IN-2NMHFXQM.js +1 -1
  182. package/dist/components/th-TH-HPSO5L25.js +1 -1
  183. package/dist/components/time.js +1 -1
  184. package/dist/components/timeline-definition-PNZ67QCA.js +1 -1
  185. package/dist/components/tr-TR-DEFEU3FU.js +1 -1
  186. package/dist/components/transform.js +1 -1
  187. package/dist/components/treeView-BLDUP644.js +1 -1
  188. package/dist/components/treemap-LRROVOQU.js +1 -1
  189. package/dist/components/uk-UA-QMV73CPH.js +1 -1
  190. package/dist/components/vennDiagram-CIIHVFJN.js +1 -1
  191. package/dist/components/vi-VN-M7AON7JQ.js +1 -1
  192. package/dist/components/wardley-L42UT6IY.js +1 -1
  193. package/dist/components/wardleyDiagram-YWT4CUSO.js +1 -1
  194. package/dist/components/wasm-pack-shim.js +1 -1
  195. package/dist/components/wasm-pack-shim2.js +1 -1
  196. package/dist/components/worker-ref.js +1 -1
  197. package/dist/components/xychartDiagram-2RQKCTM6.js +1 -1
  198. package/dist/components/zh-CN-LNUGB5OW.js +1 -1
  199. package/dist/components/zh-HK-E62DVLB3.js +1 -1
  200. package/dist/components/zh-TW-RAJ6MFWO.js +1 -1
  201. package/dist/index.d.ts +48 -0
  202. package/dist/index.mjs +1 -1
  203. package/dist/style.css +1 -1
  204. package/dist/wasm/cad/DwgWorker-CuZJ5EUe.js +349 -0
  205. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  206. package/dist/wasm/cad/dwg-worker.js +349 -0
  207. package/dist/wasm/cad/index-C365l3i9.js +4161 -0
  208. package/dist/wasm/cad/libredwg-web.js +15 -0
  209. package/dist/wasm/cad/libredwg-web.wasm +0 -0
  210. package/package.json +9 -8
  211. package/dist/components/index25.js +0 -1
@@ -0,0 +1,4161 @@
1
+ var Sn = Object.defineProperty;
2
+ var Nn = (n, t, e) => t in n ? Sn(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var N = (n, t, e) => Nn(n, typeof t != "symbol" ? t + "" : t, e);
4
+ var It;
5
+ (function(n) {
6
+ n[n.CP_UTF8 = 0] = "CP_UTF8", n[n.CP_US_ASCII = 1] = "CP_US_ASCII", n[n.CP_ISO_8859_1 = 2] = "CP_ISO_8859_1", n[n.CP_ISO_8859_2 = 3] = "CP_ISO_8859_2", n[n.CP_ISO_8859_3 = 4] = "CP_ISO_8859_3", n[n.CP_ISO_8859_4 = 5] = "CP_ISO_8859_4", n[n.CP_ISO_8859_5 = 6] = "CP_ISO_8859_5", n[n.CP_ISO_8859_6 = 7] = "CP_ISO_8859_6", n[n.CP_ISO_8859_7 = 8] = "CP_ISO_8859_7", n[n.CP_ISO_8859_8 = 9] = "CP_ISO_8859_8", n[n.CP_ISO_8859_9 = 10] = "CP_ISO_8859_9", n[n.CP_CP437 = 11] = "CP_CP437", n[n.CP_CP850 = 12] = "CP_CP850", n[n.CP_CP852 = 13] = "CP_CP852", n[n.CP_CP855 = 14] = "CP_CP855", n[n.CP_CP857 = 15] = "CP_CP857", n[n.CP_CP860 = 16] = "CP_CP860", n[n.CP_CP861 = 17] = "CP_CP861", n[n.CP_CP863 = 18] = "CP_CP863", n[n.CP_CP864 = 19] = "CP_CP864", n[n.CP_CP865 = 20] = "CP_CP865", n[n.CP_CP869 = 21] = "CP_CP869", n[n.CP_CP932 = 22] = "CP_CP932", n[n.CP_MACINTOSH = 23] = "CP_MACINTOSH", n[n.CP_BIG5 = 24] = "CP_BIG5", n[n.CP_CP949 = 25] = "CP_CP949", n[n.CP_JOHAB = 26] = "CP_JOHAB", n[n.CP_CP866 = 27] = "CP_CP866", n[n.CP_ANSI_1250 = 28] = "CP_ANSI_1250", n[n.CP_ANSI_1251 = 29] = "CP_ANSI_1251", n[n.CP_ANSI_1252 = 30] = "CP_ANSI_1252", n[n.CP_GB2312 = 31] = "CP_GB2312", n[n.CP_ANSI_1253 = 32] = "CP_ANSI_1253", n[n.CP_ANSI_1254 = 33] = "CP_ANSI_1254", n[n.CP_ANSI_1255 = 34] = "CP_ANSI_1255", n[n.CP_ANSI_1256 = 35] = "CP_ANSI_1256", n[n.CP_ANSI_1257 = 36] = "CP_ANSI_1257", n[n.CP_ANSI_874 = 37] = "CP_ANSI_874", n[n.CP_ANSI_932 = 38] = "CP_ANSI_932", n[n.CP_ANSI_936 = 39] = "CP_ANSI_936", n[n.CP_ANSI_949 = 40] = "CP_ANSI_949", n[n.CP_ANSI_950 = 41] = "CP_ANSI_950", n[n.CP_ANSI_1361 = 42] = "CP_ANSI_1361", n[n.CP_UTF16 = 43] = "CP_UTF16", n[n.CP_ANSI_1258 = 44] = "CP_ANSI_1258", n[n.CP_UNDEFINED = 255] = "CP_UNDEFINED";
7
+ })(It || (It = {}));
8
+ const Gn = [
9
+ "utf-8",
10
+ // 0
11
+ "utf-8",
12
+ // US ASCII
13
+ "iso-8859-1",
14
+ "iso-8859-2",
15
+ "iso-8859-3",
16
+ "iso-8859-4",
17
+ "iso-8859-5",
18
+ "iso-8859-6",
19
+ "iso-8859-7",
20
+ "iso-8859-8",
21
+ "iso-8859-9",
22
+ // 10
23
+ "utf-8",
24
+ // DOS English
25
+ "utf-8",
26
+ // 12 DOS Latin-1
27
+ "utf-8",
28
+ // DOS Central European
29
+ "utf-8",
30
+ // DOS Cyrillic
31
+ "utf-8",
32
+ // DOS Turkish
33
+ "utf-8",
34
+ // DOS Portoguese
35
+ "utf-8",
36
+ // DOS Icelandic
37
+ "utf-8",
38
+ // DOS Hebrew
39
+ "utf-8",
40
+ // DOS Arabic (IBM)
41
+ "utf-8",
42
+ // DOS Nordic
43
+ "utf-8",
44
+ // DOS Greek
45
+ "shift-jis",
46
+ // DOS Japanese (shiftjis)
47
+ "macintosh",
48
+ // 23
49
+ "big5",
50
+ "utf-8",
51
+ // Korean (Wansung + Johab)
52
+ "utf-8",
53
+ // Johab?
54
+ "ibm866",
55
+ // Russian
56
+ "windows-1250",
57
+ // Central + Eastern European
58
+ "windows-1251",
59
+ // Cyrillic
60
+ "windows-1252",
61
+ // Western European
62
+ "gbk",
63
+ // EUC-CN Chinese
64
+ "windows-1253",
65
+ // Greek
66
+ "windows-1254",
67
+ // Turkish
68
+ "windows-1255",
69
+ // Hebrew
70
+ "windows-1256",
71
+ // Arabic
72
+ "windows-1257",
73
+ // Baltic
74
+ "windows-874",
75
+ // Thai
76
+ "shift-jis",
77
+ // 38 Japanese (extended shiftjis, windows-31j)
78
+ "gbk",
79
+ // 39 Simplified Chinese
80
+ "euc-kr",
81
+ // 40 Korean Wansung
82
+ "big5",
83
+ // 41 Trad Chinese
84
+ "utf-8",
85
+ // 42 Korean Wansung
86
+ "utf-16le",
87
+ "windows-1258"
88
+ // Vietnamese
89
+ ], At = (n) => Gn[n];
90
+ var Pt;
91
+ (function(n) {
92
+ n[n.Rotated = 0] = "Rotated", n[n.Aligned = 1] = "Aligned", n[n.Angular = 2] = "Angular", n[n.Diameter = 3] = "Diameter", n[n.Radius = 4] = "Radius", n[n.Angular3Point = 5] = "Angular3Point", n[n.Ordinate = 6] = "Ordinate", n[n.ReferenceIsExclusive = 32] = "ReferenceIsExclusive", n[n.IsOrdinateXTypeFlag = 64] = "IsOrdinateXTypeFlag", n[n.IsCustomTextPositionFlag = 128] = "IsCustomTextPositionFlag";
93
+ })(Pt || (Pt = {}));
94
+ var m;
95
+ (function(n) {
96
+ n[n.TopLeft = 1] = "TopLeft", n[n.TopCenter = 2] = "TopCenter", n[n.TopRight = 3] = "TopRight", n[n.MiddleLeft = 4] = "MiddleLeft", n[n.MiddleCenter = 5] = "MiddleCenter", n[n.MiddleRight = 6] = "MiddleRight", n[n.BottomLeft = 7] = "BottomLeft", n[n.BottomCenter = 8] = "BottomCenter", n[n.BottomRight = 9] = "BottomRight";
97
+ })(m || (m = {}));
98
+ var Tt;
99
+ (function(n) {
100
+ n[n.AtLeast = 1] = "AtLeast", n[n.Exact = 2] = "Exact";
101
+ })(Tt || (Tt = {}));
102
+ var Ct;
103
+ (function(n) {
104
+ n[n.Center = 0] = "Center", n[n.Above = 1] = "Above", n[n.Outside = 2] = "Outside", n[n.JIS = 3] = "JIS", n[n.Below = 4] = "Below";
105
+ })(Ct || (Ct = {}));
106
+ var ht;
107
+ (function(n) {
108
+ n[n.Feet = 0] = "Feet", n[n.None = 1] = "None", n[n.Inch = 2] = "Inch", n[n.FeetAndInch = 3] = "FeetAndInch", n[n.Leading = 4] = "Leading", n[n.Trailing = 8] = "Trailing", n[n.LeadingAndTrailing = 12] = "LeadingAndTrailing";
109
+ })(ht || (ht = {}));
110
+ var Yt;
111
+ (function(n) {
112
+ n[n.None = 0] = "None", n[n.Leading = 1] = "Leading", n[n.Trailing = 2] = "Trailing", n[n.LeadingAndTrailing = 3] = "LeadingAndTrailing";
113
+ })(Yt || (Yt = {}));
114
+ var Rt;
115
+ (function(n) {
116
+ n[n.Center = 0] = "Center", n[n.Left = 1] = "Left", n[n.Right = 2] = "Right", n[n.OverFirst = 3] = "OverFirst", n[n.OverSecond = 4] = "OverSecond";
117
+ })(Rt || (Rt = {}));
118
+ var ft;
119
+ (function(n) {
120
+ n[n.Bottom = 0] = "Bottom", n[n.Center = 1] = "Center", n[n.Top = 2] = "Top";
121
+ })(ft || (ft = {}));
122
+ var z;
123
+ (function(n) {
124
+ n[n.PatternFill = 0] = "PatternFill", n[n.SolidFill = 1] = "SolidFill";
125
+ })(z || (z = {}));
126
+ var Z;
127
+ (function(n) {
128
+ n[n.NonAssociative = 0] = "NonAssociative", n[n.Associative = 1] = "Associative";
129
+ })(Z || (Z = {}));
130
+ var vt;
131
+ (function(n) {
132
+ n[n.Normal = 0] = "Normal", n[n.Outer = 1] = "Outer", n[n.Ignore = 2] = "Ignore";
133
+ })(vt || (vt = {}));
134
+ var Lt;
135
+ (function(n) {
136
+ n[n.UserDefined = 0] = "UserDefined", n[n.Predefined = 1] = "Predefined", n[n.Custom = 2] = "Custom";
137
+ })(Lt || (Lt = {}));
138
+ var St;
139
+ (function(n) {
140
+ n[n.NotAnnotated = 0] = "NotAnnotated", n[n.Annotated = 1] = "Annotated";
141
+ })(St || (St = {}));
142
+ var Et;
143
+ (function(n) {
144
+ n[n.Solid = 0] = "Solid", n[n.Gradient = 1] = "Gradient";
145
+ })(Et || (Et = {}));
146
+ var q;
147
+ (function(n) {
148
+ n[n.TwoColor = 0] = "TwoColor", n[n.OneColor = 1] = "OneColor";
149
+ })(q || (q = {}));
150
+ var Nt;
151
+ (function(n) {
152
+ n[n.Default = 0] = "Default", n[n.External = 1] = "External", n[n.Polyline = 2] = "Polyline", n[n.Derived = 4] = "Derived", n[n.Textbox = 8] = "Textbox", n[n.Outermost = 16] = "Outermost";
153
+ })(Nt || (Nt = {}));
154
+ var F;
155
+ (function(n) {
156
+ n[n.Line = 1] = "Line", n[n.Circular = 2] = "Circular", n[n.Elliptic = 3] = "Elliptic", n[n.Spline = 4] = "Spline";
157
+ })(F || (F = {}));
158
+ var Gt;
159
+ (function(n) {
160
+ n[n.CLOSED_POLYLINE = 1] = "CLOSED_POLYLINE", n[n.CURVE_FIT = 2] = "CURVE_FIT", n[n.SPLINE_FIT = 4] = "SPLINE_FIT", n[n.POLYLINE_3D = 8] = "POLYLINE_3D", n[n.POLYGON_3D = 16] = "POLYGON_3D", n[n.CLOSED_POLYGON = 32] = "CLOSED_POLYGON", n[n.POLYFACE = 64] = "POLYFACE", n[n.CONTINUOUS = 128] = "CONTINUOUS";
161
+ })(Gt || (Gt = {}));
162
+ var Dt;
163
+ (function(n) {
164
+ n[n.NONE = 0] = "NONE", n[n.QUADRATIC = 5] = "QUADRATIC", n[n.CUBIC = 6] = "CUBIC", n[n.BEZIER = 8] = "BEZIER";
165
+ })(Dt || (Dt = {}));
166
+ var Wt;
167
+ (function(n) {
168
+ n[n.NONE = 0] = "NONE", n[n.MIRRORED_X = 2] = "MIRRORED_X", n[n.MIRRORED_Y = 4] = "MIRRORED_Y";
169
+ })(Wt || (Wt = {}));
170
+ var Q;
171
+ (function(n) {
172
+ n[n.LEFT = 0] = "LEFT", n[n.CENTER = 1] = "CENTER", n[n.RIGHT = 2] = "RIGHT", n[n.ALIGNED = 3] = "ALIGNED", n[n.MIDDLE = 4] = "MIDDLE", n[n.FIT = 5] = "FIT";
173
+ })(Q || (Q = {}));
174
+ var Mt;
175
+ (function(n) {
176
+ n[n.BASELINE = 0] = "BASELINE", n[n.BOTTOM = 1] = "BOTTOM", n[n.MIDDLE = 2] = "MIDDLE", n[n.TOP = 3] = "TOP";
177
+ })(Mt || (Mt = {}));
178
+ const Dn = Object.freeze([
179
+ "ACADMAINTVER",
180
+ "ACADVER",
181
+ "ANGBASE",
182
+ "ANGDIR",
183
+ "ATTMODE",
184
+ "AUNITS",
185
+ "AUPREC",
186
+ "CECOLOR",
187
+ "CELTSCALE",
188
+ "CELTYPE",
189
+ "CELWEIGHT",
190
+ "CEPSNID",
191
+ "CEPSNTYPE",
192
+ "CHAMFERA",
193
+ "CHAMFERB",
194
+ "CHAMFERC",
195
+ "CHAMFERD",
196
+ "CLAYER",
197
+ "CMLJUST",
198
+ "CMLSCALE",
199
+ "CMLSTYLE",
200
+ "CSHADOW",
201
+ "DIMADEC",
202
+ "DIMALT",
203
+ "DIMALTD",
204
+ "DIMALTF",
205
+ "DIMALTRND",
206
+ "DIMALTTD",
207
+ "DIMALTTZ",
208
+ "DIMALTU",
209
+ "DIMALTZ",
210
+ "DIMAPOST",
211
+ "DIMASO",
212
+ "DIMASSOC",
213
+ "DIMASZ",
214
+ "DIMATFIT",
215
+ "DIMAUNIT",
216
+ "DIMAZIN",
217
+ "DIMBLK",
218
+ "DIMBLK1",
219
+ "DIMBLK2",
220
+ "DIMCEN",
221
+ "DIMCLRD",
222
+ "DIMCLRE",
223
+ "DIMCLRT",
224
+ "DIMDEC",
225
+ "DIMDLE",
226
+ "DIMDLI",
227
+ "DIMDSEP",
228
+ "DIMEXE",
229
+ "DIMEXO",
230
+ "DIMFAC",
231
+ "DIMGAP",
232
+ "DIMJUST",
233
+ "DIMLDRBLK",
234
+ "DIMLFAC",
235
+ "DIMLIM",
236
+ "DIMLUNIT",
237
+ "DIMLWD",
238
+ "DIMLWE",
239
+ "DIMPOST",
240
+ "DIMRND",
241
+ "DIMSAH",
242
+ "DIMSCALE",
243
+ "DIMSD1",
244
+ "DIMSD2",
245
+ "DIMSE1",
246
+ "DIMSE2",
247
+ "DIMSHO",
248
+ "DIMSOXD",
249
+ "DIMSTYLE",
250
+ "DIMTAD",
251
+ "DIMTDEC",
252
+ "DIMTFAC",
253
+ "DIMTIH",
254
+ "DIMTIX",
255
+ "DIMTM",
256
+ "DIMTMOVE",
257
+ "DIMTOFL",
258
+ "DIMTOH",
259
+ "DIMTOL",
260
+ "DIMTOLJ",
261
+ "DIMTP",
262
+ "DIMTSZ",
263
+ "DIMTVP",
264
+ "DIMTXSTY",
265
+ "DIMTXT",
266
+ "DIMTZIN",
267
+ "DIMUPT",
268
+ "DIMZIN",
269
+ "DISPSILH",
270
+ "DRAGVS",
271
+ "DWGCODEPAGE",
272
+ "ELEVATION",
273
+ "ENDCAPS",
274
+ "EXTMAX",
275
+ "EXTMIN",
276
+ "EXTNAMES",
277
+ "FILLETRAD",
278
+ "FILLMODE",
279
+ "FINGERPRINTGUID",
280
+ "HALOGAP",
281
+ "HANDSEED",
282
+ "HIDETEXT",
283
+ "HYPERLINKBASE",
284
+ "INDEXCTL",
285
+ "INSBASE",
286
+ "INSUNITS",
287
+ "INTERFERECOLOR",
288
+ "INTERFEREOBJVS",
289
+ "INTERFEREVPVS",
290
+ "INTERSECTIONCOLOR",
291
+ "INTERSECTIONDISPLAY",
292
+ "JOINSTYLE",
293
+ "LIMCHECK",
294
+ "LIMMAX",
295
+ "LIMMIN",
296
+ "LTSCALE",
297
+ "LUNITS",
298
+ "LUPREC",
299
+ "LWDISPLAY",
300
+ "MAXACTVP",
301
+ "MEASUREMENT",
302
+ "MENU",
303
+ "MIRRTEXT",
304
+ "OBSCOLOR",
305
+ "OBSLTYPE",
306
+ "ORTHOMODE",
307
+ "PDMODE",
308
+ "PDSIZE",
309
+ "PELEVATION",
310
+ "PEXTMAX",
311
+ "PEXTMIN",
312
+ "PINSBASE",
313
+ "PLIMCHECK",
314
+ "PLIMMAX",
315
+ "PLIMMIN",
316
+ "PLINEGEN",
317
+ "PLINEWID",
318
+ "PROJECTNAME",
319
+ "PROXYGRAPHICS",
320
+ "PSLTSCALE",
321
+ "PSTYLEMODE",
322
+ "PSVPSCALE",
323
+ "PUCSBASE",
324
+ "PUCSNAME",
325
+ "PUCSORG",
326
+ "PUCSORGBACK",
327
+ "PUCSORGBOTTOM",
328
+ "PUCSORGFRONT",
329
+ "PUCSORGLEFT",
330
+ "PUCSORGRIGHT",
331
+ "PUCSORGTOP",
332
+ "PUCSORTHOREF",
333
+ "PUCSORTHOVIEW",
334
+ "PUCSXDIR",
335
+ "PUCSYDIR",
336
+ "QTEXTMODE",
337
+ "REGENMODE",
338
+ "SHADEDGE",
339
+ "SHADEDIF",
340
+ "SHADOWPLANELOCATION",
341
+ "SKETCHINC",
342
+ "SKPOLY",
343
+ "SORTENTS",
344
+ "SPLINESEGS",
345
+ "SPLINETYPE",
346
+ "SURFTAB1",
347
+ "SURFTAB2",
348
+ "SURFTYPE",
349
+ "SURFU",
350
+ "SURFV",
351
+ "TDCREATE",
352
+ "TDINDWG",
353
+ "TDUCREATE",
354
+ "TDUPDATE",
355
+ "TDUSRTIMER",
356
+ "TDUUPDATE",
357
+ "TEXTSIZE",
358
+ "TEXTSTYLE",
359
+ "THICKNESS",
360
+ "TILEMODE",
361
+ "TRACEWID",
362
+ "TREEDEPTH",
363
+ "UCSBASE",
364
+ "UCSNAME",
365
+ "UCSORG",
366
+ "UCSORGBACK",
367
+ "UCSORGBOTTOM",
368
+ "UCSORGFRONT",
369
+ "UCSORGLEFT",
370
+ "UCSORGRIGHT",
371
+ "UCSORGTOP",
372
+ "UCSORTHOREF",
373
+ "UCSORTHOVIEW",
374
+ "UCSXDIR",
375
+ "UCSYDIR",
376
+ "UNITMODE",
377
+ "USERI1",
378
+ "USERI2",
379
+ "USERI3",
380
+ "USERI4",
381
+ "USERI5",
382
+ "USERR1",
383
+ "USERR2",
384
+ "USERR3",
385
+ "USERR4",
386
+ "USERR5",
387
+ "USRTIMER",
388
+ "VERSIONGUID",
389
+ "VISRETAIN",
390
+ "WORLDVIEW",
391
+ "XCLIPFRAME",
392
+ "XEDIT"
393
+ ]);
394
+ var gt;
395
+ (function(n) {
396
+ n[n.NotApplicable = 0] = "NotApplicable", n[n.KeepExisting = 1] = "KeepExisting", n[n.UseClone = 2] = "UseClone", n[n.XrefName = 3] = "XrefName", n[n.Name = 4] = "Name", n[n.UnmangleName = 5] = "UnmangleName";
397
+ })(gt || (gt = {}));
398
+ const Wn = [
399
+ {
400
+ type: "invalid",
401
+ hdr: "INVALI",
402
+ description: "No DWG",
403
+ version: 0
404
+ },
405
+ {
406
+ type: "r1.1",
407
+ hdr: "MC0.0",
408
+ description: "MicroCAD Release 1.1",
409
+ version: 0
410
+ },
411
+ {
412
+ type: "r1.2",
413
+ hdr: "AC1.2",
414
+ description: "AutoCAD Release 1.2",
415
+ version: 0
416
+ },
417
+ {
418
+ type: "r1.3",
419
+ hdr: "AC1.3",
420
+ description: "AutoCAD Release 1.3",
421
+ version: 1
422
+ },
423
+ {
424
+ type: "r1.4",
425
+ hdr: "AC1.40",
426
+ description: "AutoCAD Release 1.4",
427
+ version: 2
428
+ },
429
+ { type: "r2.0b", hdr: "AC1.50", description: "AutoCAD 2.0 beta", version: 3 },
430
+ // not seen
431
+ {
432
+ type: "r2.0",
433
+ hdr: "AC1.50",
434
+ description: "AutoCAD Release 2.0",
435
+ version: 4
436
+ },
437
+ {
438
+ type: "r2.10",
439
+ hdr: "AC2.10",
440
+ description: "AutoCAD Release 2.10",
441
+ version: 5
442
+ },
443
+ {
444
+ type: "r2.21",
445
+ hdr: "AC2.21",
446
+ description: "AutoCAD Release 2.21",
447
+ version: 6
448
+ },
449
+ {
450
+ type: "r2.22",
451
+ hdr: "AC2.22",
452
+ description: "AutoCAD Release 2.22",
453
+ version: 7
454
+ },
455
+ {
456
+ type: "r2.4",
457
+ hdr: "AC1001",
458
+ description: "AutoCAD Release 2.4",
459
+ version: 8
460
+ },
461
+ {
462
+ type: "r2.5",
463
+ hdr: "AC1002",
464
+ description: "AutoCAD Release 2.5",
465
+ version: 9
466
+ },
467
+ {
468
+ type: "r2.6",
469
+ hdr: "AC1003",
470
+ description: "AutoCAD Release 2.6",
471
+ version: 10
472
+ },
473
+ { type: "r9", hdr: "AC1004", description: "AutoCAD Release 9", version: 11 },
474
+ {
475
+ type: "r9c1",
476
+ hdr: "AC1005",
477
+ description: "AutoCAD Release 9c1",
478
+ version: 12
479
+ },
480
+ {
481
+ type: "r10",
482
+ hdr: "AC1006",
483
+ description: "AutoCAD Release 10",
484
+ version: 13
485
+ },
486
+ {
487
+ type: "r11b1",
488
+ hdr: "AC1007",
489
+ description: "AutoCAD 11 beta 1",
490
+ version: 14
491
+ },
492
+ {
493
+ type: "r11b2",
494
+ hdr: "AC1008",
495
+ description: "AutoCAD 11 beta 2",
496
+ version: 15
497
+ },
498
+ {
499
+ type: "r11",
500
+ hdr: "AC1009",
501
+ description: "AutoCAD Release 11/12 (LT R1/R2)",
502
+ version: 16
503
+ },
504
+ {
505
+ type: "r13b1",
506
+ hdr: "AC1010",
507
+ description: "AutoCAD pre-R13 a",
508
+ version: 17
509
+ },
510
+ {
511
+ type: "r13b2",
512
+ hdr: "AC1011",
513
+ description: "AutoCAD pre-R13 b",
514
+ version: 18
515
+ },
516
+ {
517
+ type: "r13",
518
+ hdr: "AC1012",
519
+ description: "AutoCAD Release 13",
520
+ version: 19
521
+ },
522
+ {
523
+ type: "r13c3",
524
+ hdr: "AC1013",
525
+ description: "AutoCAD Release 13c3",
526
+ version: 20
527
+ },
528
+ {
529
+ type: "r14",
530
+ hdr: "AC1014",
531
+ description: "AutoCAD Release 14",
532
+ version: 21
533
+ },
534
+ {
535
+ type: "r2000b",
536
+ hdr: "AC1500",
537
+ description: "AutoCAD 2000 beta",
538
+ version: 22
539
+ },
540
+ {
541
+ type: "r2000",
542
+ hdr: "AC1015",
543
+ description: "AutoCAD Release 2000",
544
+ version: 23
545
+ },
546
+ {
547
+ type: "r2000i",
548
+ hdr: "AC1016",
549
+ description: "AutoCAD Release 2000i",
550
+ version: 23
551
+ },
552
+ {
553
+ type: "r2002",
554
+ hdr: "AC1017",
555
+ description: "AutoCAD Release 2002",
556
+ version: 23
557
+ },
558
+ {
559
+ type: "r2004a",
560
+ hdr: "AC402a",
561
+ description: "AutoCAD 2004 alpha a",
562
+ version: 24
563
+ },
564
+ {
565
+ type: "r2004b",
566
+ hdr: "AC402b",
567
+ description: "AutoCAD 2004 alpha b",
568
+ version: 24
569
+ },
570
+ {
571
+ type: "r2004c",
572
+ hdr: "AC1018",
573
+ description: "AutoCAD 2004 beta",
574
+ version: 24
575
+ },
576
+ // (includes versions AC1019/0x19 and AC1020/0x1a)
577
+ {
578
+ type: "r2004",
579
+ hdr: "AC1018",
580
+ description: "AutoCAD Release 2004",
581
+ version: 25
582
+ },
583
+ //{ type: "r2005", hdr: "AC1019", description: "AutoCAD 2005", version: 0x19 }, // not seen
584
+ //{ type: "r2006", hdr: "AC1020", description: "AutoCAD 2006", version: 0x19 }, // not seen
585
+ {
586
+ type: "r2007a",
587
+ hdr: "AC701a",
588
+ description: "AutoCAD 2007 alpha",
589
+ version: 26
590
+ },
591
+ {
592
+ type: "r2007b",
593
+ hdr: "AC1021",
594
+ description: "AutoCAD 2007 beta",
595
+ version: 26
596
+ },
597
+ {
598
+ type: "r2007",
599
+ hdr: "AC1021",
600
+ description: "AutoCAD Release 2007",
601
+ version: 27
602
+ },
603
+ //{ type: "r2008", hdr: "AC1022", description: "AutoCAD 2008", version: 0x1b }, // not seen
604
+ //{ type: "r2009", hdr: "AC1023", description: "AutoCAD 2009", version: 0x1b }, // not seen
605
+ {
606
+ type: "r2010b",
607
+ hdr: "AC1024",
608
+ description: "AutoCAD 2010 beta",
609
+ version: 28
610
+ },
611
+ {
612
+ type: "r2010",
613
+ hdr: "AC1024",
614
+ description: "AutoCAD Release 2010",
615
+ version: 29
616
+ },
617
+ //{ type: "r2011", hdr: "AC1025", description: "AutoCAD 2011", version: 0x1d }, // not seen
618
+ //{ type: "r2012", hdr: "AC1026", description: "AutoCAD 2012", version: 0x1e }, // not seen
619
+ {
620
+ type: "r2013b",
621
+ hdr: "AC1027",
622
+ description: "AutoCAD 2013 beta",
623
+ version: 30
624
+ },
625
+ {
626
+ type: "r2013",
627
+ hdr: "AC1027",
628
+ description: "AutoCAD Release 2013",
629
+ version: 31
630
+ },
631
+ //{ type: "r2014", hdr: "AC1028", description: "AutoCAD 2014", version: 0x1f }, // not seen
632
+ //{ type: "r2015", hdr: "AC1029", description: "AutoCAD 2015", version: 0x1f }, // not seen
633
+ //{ type: "r2016", hdr: "AC1030", description: "AutoCAD 2016", version: 0x1f }, // not seen
634
+ //{ type: "r2017", hdr: "AC1031", description: "AutoCAD 2017", version: 0x20 }, // not seen
635
+ {
636
+ type: "r2018b",
637
+ hdr: "AC1032",
638
+ description: "AutoCAD 2018 beta",
639
+ version: 32
640
+ },
641
+ {
642
+ type: "r2018",
643
+ hdr: "AC1032",
644
+ description: "AutoCAD Release 2018",
645
+ version: 33
646
+ },
647
+ //{ type: "r2019", "AC1033", description: "AutoCAD Release 2019", version: 0x22 }, // not seen
648
+ //{ type: "r2020", "AC1034", description: "AutoCAD Release 2020", version: 0x23 }, // not seen
649
+ //{ type: "r2021", "AC1035", description: "AutoCAD Release 2021", version: 0x23 }, // not seen
650
+ {
651
+ type: "r2022b",
652
+ hdr: "AC103-4",
653
+ description: "AutoCAD 2022 beta",
654
+ version: 36
655
+ },
656
+ { type: "r>2022", hdr: "", description: "AutoCAD Release >2022", version: 0 }
657
+ ];
658
+ async function yt(n = {}) {
659
+ const t = Mn(n), e = await import(
660
+ /* @vite-ignore */
661
+ t
662
+ ), a = e.default ?? e.createModule ?? e;
663
+ if (typeof a != "function")
664
+ throw new Error(`LibreDWG runtime module at ${t} did not export a createModule function.`);
665
+ return a(n);
666
+ }
667
+ function Mn(n) {
668
+ const t = n.locateFile;
669
+ if (typeof t == "function")
670
+ try {
671
+ const e = t("libredwg-web.js", "");
672
+ if (typeof e == "string" && e.length > 0) return e;
673
+ } catch {
674
+ }
675
+ return typeof document < "u" && document.baseURI ? new URL("wasm/libredwg-web.js", document.baseURI).href : typeof location < "u" && location.href ? new URL("/wasm/libredwg-web.js", location.origin).href : "/wasm/libredwg-web.js";
676
+ }
677
+ var xt;
678
+ (function(n) {
679
+ n[n.DWG_SUPERTYPE_ENTITY = 0] = "DWG_SUPERTYPE_ENTITY", n[n.DWG_SUPERTYPE_OBJECT = 1] = "DWG_SUPERTYPE_OBJECT";
680
+ })(xt || (xt = {}));
681
+ var P;
682
+ (function(n) {
683
+ n[n.DWG_TYPE_UNUSED = 0] = "DWG_TYPE_UNUSED", n[n.DWG_TYPE_TEXT = 1] = "DWG_TYPE_TEXT", n[n.DWG_TYPE_ATTRIB = 2] = "DWG_TYPE_ATTRIB", n[n.DWG_TYPE_ATTDEF = 3] = "DWG_TYPE_ATTDEF", n[n.DWG_TYPE_BLOCK = 4] = "DWG_TYPE_BLOCK", n[n.DWG_TYPE_ENDBLK = 5] = "DWG_TYPE_ENDBLK", n[n.DWG_TYPE_SEQEND = 6] = "DWG_TYPE_SEQEND", n[n.DWG_TYPE_INSERT = 7] = "DWG_TYPE_INSERT", n[n.DWG_TYPE_MINSERT = 8] = "DWG_TYPE_MINSERT", n[n.DWG_TYPE_VERTEX_2D = 10] = "DWG_TYPE_VERTEX_2D", n[n.DWG_TYPE_VERTEX_3D = 11] = "DWG_TYPE_VERTEX_3D", n[n.DWG_TYPE_VERTEX_MESH = 12] = "DWG_TYPE_VERTEX_MESH", n[n.DWG_TYPE_VERTEX_PFACE = 13] = "DWG_TYPE_VERTEX_PFACE", n[n.DWG_TYPE_VERTEX_PFACE_FACE = 14] = "DWG_TYPE_VERTEX_PFACE_FACE", n[n.DWG_TYPE_POLYLINE_2D = 15] = "DWG_TYPE_POLYLINE_2D", n[n.DWG_TYPE_POLYLINE_3D = 16] = "DWG_TYPE_POLYLINE_3D", n[n.DWG_TYPE_ARC = 17] = "DWG_TYPE_ARC", n[n.DWG_TYPE_CIRCLE = 18] = "DWG_TYPE_CIRCLE", n[n.DWG_TYPE_LINE = 19] = "DWG_TYPE_LINE", n[n.DWG_TYPE_DIMENSION_ORDINATE = 20] = "DWG_TYPE_DIMENSION_ORDINATE", n[n.DWG_TYPE_DIMENSION_LINEAR = 21] = "DWG_TYPE_DIMENSION_LINEAR", n[n.DWG_TYPE_DIMENSION_ALIGNED = 22] = "DWG_TYPE_DIMENSION_ALIGNED", n[n.DWG_TYPE_DIMENSION_ANG3PT = 23] = "DWG_TYPE_DIMENSION_ANG3PT", n[n.DWG_TYPE_DIMENSION_ANG2LN = 24] = "DWG_TYPE_DIMENSION_ANG2LN", n[n.DWG_TYPE_DIMENSION_RADIUS = 25] = "DWG_TYPE_DIMENSION_RADIUS", n[n.DWG_TYPE_DIMENSION_DIAMETER = 26] = "DWG_TYPE_DIMENSION_DIAMETER", n[n.DWG_TYPE_POINT = 27] = "DWG_TYPE_POINT", n[n.DWG_TYPE_3DFACE = 28] = "DWG_TYPE_3DFACE", n[n.DWG_TYPE_POLYLINE_PFACE = 29] = "DWG_TYPE_POLYLINE_PFACE", n[n.DWG_TYPE_POLYLINE_MESH = 30] = "DWG_TYPE_POLYLINE_MESH", n[n.DWG_TYPE_SOLID = 31] = "DWG_TYPE_SOLID", n[n.DWG_TYPE_TRACE = 32] = "DWG_TYPE_TRACE", n[n.DWG_TYPE_SHAPE = 33] = "DWG_TYPE_SHAPE", n[n.DWG_TYPE_VIEWPORT = 34] = "DWG_TYPE_VIEWPORT", n[n.DWG_TYPE_ELLIPSE = 35] = "DWG_TYPE_ELLIPSE", n[n.DWG_TYPE_SPLINE = 36] = "DWG_TYPE_SPLINE", n[n.DWG_TYPE_REGION = 37] = "DWG_TYPE_REGION", n[n.DWG_TYPE_3DSOLID = 38] = "DWG_TYPE_3DSOLID", n[n.DWG_TYPE_BODY = 39] = "DWG_TYPE_BODY", n[n.DWG_TYPE_RAY = 40] = "DWG_TYPE_RAY", n[n.DWG_TYPE_XLINE = 41] = "DWG_TYPE_XLINE", n[n.DWG_TYPE_DICTIONARY = 42] = "DWG_TYPE_DICTIONARY", n[n.DWG_TYPE_OLEFRAME = 43] = "DWG_TYPE_OLEFRAME", n[n.DWG_TYPE_MTEXT = 44] = "DWG_TYPE_MTEXT", n[n.DWG_TYPE_LEADER = 45] = "DWG_TYPE_LEADER", n[n.DWG_TYPE_TOLERANCE = 46] = "DWG_TYPE_TOLERANCE", n[n.DWG_TYPE_MLINE = 47] = "DWG_TYPE_MLINE", n[n.DWG_TYPE_BLOCK_CONTROL = 48] = "DWG_TYPE_BLOCK_CONTROL", n[n.DWG_TYPE_BLOCK_HEADER = 49] = "DWG_TYPE_BLOCK_HEADER", n[n.DWG_TYPE_LAYER_CONTROL = 50] = "DWG_TYPE_LAYER_CONTROL", n[n.DWG_TYPE_LAYER = 51] = "DWG_TYPE_LAYER", n[n.DWG_TYPE_STYLE_CONTROL = 52] = "DWG_TYPE_STYLE_CONTROL", n[n.DWG_TYPE_STYLE = 53] = "DWG_TYPE_STYLE", n[n.DWG_TYPE_LTYPE_CONTROL = 56] = "DWG_TYPE_LTYPE_CONTROL", n[n.DWG_TYPE_LTYPE = 57] = "DWG_TYPE_LTYPE", n[n.DWG_TYPE_VIEW_CONTROL = 60] = "DWG_TYPE_VIEW_CONTROL", n[n.DWG_TYPE_VIEW = 61] = "DWG_TYPE_VIEW", n[n.DWG_TYPE_UCS_CONTROL = 62] = "DWG_TYPE_UCS_CONTROL", n[n.DWG_TYPE_UCS = 63] = "DWG_TYPE_UCS", n[n.DWG_TYPE_VPORT_CONTROL = 64] = "DWG_TYPE_VPORT_CONTROL", n[n.DWG_TYPE_VPORT = 65] = "DWG_TYPE_VPORT", n[n.DWG_TYPE_APPID_CONTROL = 66] = "DWG_TYPE_APPID_CONTROL", n[n.DWG_TYPE_APPID = 67] = "DWG_TYPE_APPID", n[n.DWG_TYPE_DIMSTYLE_CONTROL = 68] = "DWG_TYPE_DIMSTYLE_CONTROL", n[n.DWG_TYPE_DIMSTYLE = 69] = "DWG_TYPE_DIMSTYLE", n[n.DWG_TYPE_VX_CONTROL = 70] = "DWG_TYPE_VX_CONTROL", n[n.DWG_TYPE_VX_TABLE_RECORD = 71] = "DWG_TYPE_VX_TABLE_RECORD", n[n.DWG_TYPE_GROUP = 72] = "DWG_TYPE_GROUP", n[n.DWG_TYPE_MLINESTYLE = 73] = "DWG_TYPE_MLINESTYLE", n[n.DWG_TYPE_OLE2FRAME = 74] = "DWG_TYPE_OLE2FRAME", n[n.DWG_TYPE_DUMMY = 75] = "DWG_TYPE_DUMMY", n[n.DWG_TYPE_LONG_TRANSACTION = 76] = "DWG_TYPE_LONG_TRANSACTION", n[n.DWG_TYPE_LWPOLYLINE = 77] = "DWG_TYPE_LWPOLYLINE", n[n.DWG_TYPE_HATCH = 78] = "DWG_TYPE_HATCH", n[n.DWG_TYPE_XRECORD = 79] = "DWG_TYPE_XRECORD", n[n.DWG_TYPE_PLACEHOLDER = 80] = "DWG_TYPE_PLACEHOLDER", n[n.DWG_TYPE_VBA_PROJECT = 81] = "DWG_TYPE_VBA_PROJECT", n[n.DWG_TYPE_LAYOUT = 82] = "DWG_TYPE_LAYOUT", n[n.DWG_TYPE_PROXY_ENTITY = 498] = "DWG_TYPE_PROXY_ENTITY", n[n.DWG_TYPE_PROXY_OBJECT = 499] = "DWG_TYPE_PROXY_OBJECT", n[n.DWG_TYPE_ACDSRECORD = 500] = "DWG_TYPE_ACDSRECORD", n[n.DWG_TYPE_ACDSSCHEMA = 501] = "DWG_TYPE_ACDSSCHEMA", n[n.DWG_TYPE_ACMECOMMANDHISTORY = 502] = "DWG_TYPE_ACMECOMMANDHISTORY", n[n.DWG_TYPE_ACMESCOPE = 503] = "DWG_TYPE_ACMESCOPE", n[n.DWG_TYPE_ACMESTATEMGR = 504] = "DWG_TYPE_ACMESTATEMGR", n[n.DWG_TYPE_ACSH_BOOLEAN_CLASS = 505] = "DWG_TYPE_ACSH_BOOLEAN_CLASS", n[n.DWG_TYPE_ACSH_BOX_CLASS = 506] = "DWG_TYPE_ACSH_BOX_CLASS", n[n.DWG_TYPE_ACSH_BREP_CLASS = 507] = "DWG_TYPE_ACSH_BREP_CLASS", n[n.DWG_TYPE_ACSH_CHAMFER_CLASS = 508] = "DWG_TYPE_ACSH_CHAMFER_CLASS", n[n.DWG_TYPE_ACSH_CONE_CLASS = 509] = "DWG_TYPE_ACSH_CONE_CLASS", n[n.DWG_TYPE_ACSH_CYLINDER_CLASS = 510] = "DWG_TYPE_ACSH_CYLINDER_CLASS", n[n.DWG_TYPE_ACSH_EXTRUSION_CLASS = 511] = "DWG_TYPE_ACSH_EXTRUSION_CLASS", n[n.DWG_TYPE_ACSH_FILLET_CLASS = 512] = "DWG_TYPE_ACSH_FILLET_CLASS", n[n.DWG_TYPE_ACSH_HISTORY_CLASS = 513] = "DWG_TYPE_ACSH_HISTORY_CLASS", n[n.DWG_TYPE_ACSH_LOFT_CLASS = 514] = "DWG_TYPE_ACSH_LOFT_CLASS", n[n.DWG_TYPE_ACSH_PYRAMID_CLASS = 515] = "DWG_TYPE_ACSH_PYRAMID_CLASS", n[n.DWG_TYPE_ACSH_REVOLVE_CLASS = 516] = "DWG_TYPE_ACSH_REVOLVE_CLASS", n[n.DWG_TYPE_ACSH_SPHERE_CLASS = 517] = "DWG_TYPE_ACSH_SPHERE_CLASS", n[n.DWG_TYPE_ACSH_SWEEP_CLASS = 518] = "DWG_TYPE_ACSH_SWEEP_CLASS", n[n.DWG_TYPE_ACSH_TORUS_CLASS = 519] = "DWG_TYPE_ACSH_TORUS_CLASS", n[n.DWG_TYPE_ACSH_WEDGE_CLASS = 520] = "DWG_TYPE_ACSH_WEDGE_CLASS", n[n.DWG_TYPE_ALDIMOBJECTCONTEXTDATA = 521] = "DWG_TYPE_ALDIMOBJECTCONTEXTDATA", n[n.DWG_TYPE_ALIGNMENTPARAMETERENTITY = 522] = "DWG_TYPE_ALIGNMENTPARAMETERENTITY", n[n.DWG_TYPE_ANGDIMOBJECTCONTEXTDATA = 523] = "DWG_TYPE_ANGDIMOBJECTCONTEXTDATA", n[n.DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA = 524] = "DWG_TYPE_ANNOTSCALEOBJECTCONTEXTDATA", n[n.DWG_TYPE_ARCALIGNEDTEXT = 525] = "DWG_TYPE_ARCALIGNEDTEXT", n[n.DWG_TYPE_ARC_DIMENSION = 526] = "DWG_TYPE_ARC_DIMENSION", n[n.DWG_TYPE_ASSOC2DCONSTRAINTGROUP = 527] = "DWG_TYPE_ASSOC2DCONSTRAINTGROUP", n[n.DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY = 528] = "DWG_TYPE_ASSOC3POINTANGULARDIMACTIONBODY", n[n.DWG_TYPE_ASSOCACTION = 529] = "DWG_TYPE_ASSOCACTION", n[n.DWG_TYPE_ASSOCACTIONPARAM = 530] = "DWG_TYPE_ASSOCACTIONPARAM", n[n.DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY = 531] = "DWG_TYPE_ASSOCALIGNEDDIMACTIONBODY", n[n.DWG_TYPE_ASSOCARRAYACTIONBODY = 532] = "DWG_TYPE_ASSOCARRAYACTIONBODY", n[n.DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY = 533] = "DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY", n[n.DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS = 534] = "DWG_TYPE_ASSOCARRAYMODIFYPARAMETERS", n[n.DWG_TYPE_ASSOCARRAYPATHPARAMETERS = 535] = "DWG_TYPE_ASSOCARRAYPATHPARAMETERS", n[n.DWG_TYPE_ASSOCARRAYPOLARPARAMETERS = 536] = "DWG_TYPE_ASSOCARRAYPOLARPARAMETERS", n[n.DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS = 537] = "DWG_TYPE_ASSOCARRAYRECTANGULARPARAMETERS", n[n.DWG_TYPE_ASSOCASMBODYACTIONPARAM = 538] = "DWG_TYPE_ASSOCASMBODYACTIONPARAM", n[n.DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY = 539] = "DWG_TYPE_ASSOCBLENDSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM = 540] = "DWG_TYPE_ASSOCCOMPOUNDACTIONPARAM", n[n.DWG_TYPE_ASSOCDEPENDENCY = 541] = "DWG_TYPE_ASSOCDEPENDENCY", n[n.DWG_TYPE_ASSOCDIMDEPENDENCYBODY = 542] = "DWG_TYPE_ASSOCDIMDEPENDENCYBODY", n[n.DWG_TYPE_ASSOCEDGEACTIONPARAM = 543] = "DWG_TYPE_ASSOCEDGEACTIONPARAM", n[n.DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY = 544] = "DWG_TYPE_ASSOCEDGECHAMFERACTIONBODY", n[n.DWG_TYPE_ASSOCEDGEFILLETACTIONBODY = 545] = "DWG_TYPE_ASSOCEDGEFILLETACTIONBODY", n[n.DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY = 546] = "DWG_TYPE_ASSOCEXTENDSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY = 547] = "DWG_TYPE_ASSOCEXTRUDEDSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCFACEACTIONPARAM = 548] = "DWG_TYPE_ASSOCFACEACTIONPARAM", n[n.DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY = 549] = "DWG_TYPE_ASSOCFILLETSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCGEOMDEPENDENCY = 550] = "DWG_TYPE_ASSOCGEOMDEPENDENCY", n[n.DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY = 551] = "DWG_TYPE_ASSOCLOFTEDSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCMLEADERACTIONBODY = 552] = "DWG_TYPE_ASSOCMLEADERACTIONBODY", n[n.DWG_TYPE_ASSOCNETWORK = 553] = "DWG_TYPE_ASSOCNETWORK", n[n.DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY = 554] = "DWG_TYPE_ASSOCNETWORKSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCOBJECTACTIONPARAM = 555] = "DWG_TYPE_ASSOCOBJECTACTIONPARAM", n[n.DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY = 556] = "DWG_TYPE_ASSOCOFFSETSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCORDINATEDIMACTIONBODY = 557] = "DWG_TYPE_ASSOCORDINATEDIMACTIONBODY", n[n.DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM = 558] = "DWG_TYPE_ASSOCOSNAPPOINTREFACTIONPARAM", n[n.DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY = 559] = "DWG_TYPE_ASSOCPATCHSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCPATHACTIONPARAM = 560] = "DWG_TYPE_ASSOCPATHACTIONPARAM", n[n.DWG_TYPE_ASSOCPERSSUBENTMANAGER = 561] = "DWG_TYPE_ASSOCPERSSUBENTMANAGER", n[n.DWG_TYPE_ASSOCPLANESURFACEACTIONBODY = 562] = "DWG_TYPE_ASSOCPLANESURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCPOINTREFACTIONPARAM = 563] = "DWG_TYPE_ASSOCPOINTREFACTIONPARAM", n[n.DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY = 564] = "DWG_TYPE_ASSOCRESTOREENTITYSTATEACTIONBODY", n[n.DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY = 565] = "DWG_TYPE_ASSOCREVOLVEDSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCROTATEDDIMACTIONBODY = 566] = "DWG_TYPE_ASSOCROTATEDDIMACTIONBODY", n[n.DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY = 567] = "DWG_TYPE_ASSOCSWEPTSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY = 568] = "DWG_TYPE_ASSOCTRIMSURFACEACTIONBODY", n[n.DWG_TYPE_ASSOCVALUEDEPENDENCY = 569] = "DWG_TYPE_ASSOCVALUEDEPENDENCY", n[n.DWG_TYPE_ASSOCVARIABLE = 570] = "DWG_TYPE_ASSOCVARIABLE", n[n.DWG_TYPE_ASSOCVERTEXACTIONPARAM = 571] = "DWG_TYPE_ASSOCVERTEXACTIONPARAM", n[n.DWG_TYPE_BASEPOINTPARAMETERENTITY = 572] = "DWG_TYPE_BASEPOINTPARAMETERENTITY", n[n.DWG_TYPE_BLKREFOBJECTCONTEXTDATA = 573] = "DWG_TYPE_BLKREFOBJECTCONTEXTDATA", n[n.DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER = 574] = "DWG_TYPE_BLOCKALIGNEDCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKALIGNMENTGRIP = 575] = "DWG_TYPE_BLOCKALIGNMENTGRIP", n[n.DWG_TYPE_BLOCKALIGNMENTPARAMETER = 576] = "DWG_TYPE_BLOCKALIGNMENTPARAMETER", n[n.DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER = 577] = "DWG_TYPE_BLOCKANGULARCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKARRAYACTION = 578] = "DWG_TYPE_BLOCKARRAYACTION", n[n.DWG_TYPE_BLOCKBASEPOINTPARAMETER = 579] = "DWG_TYPE_BLOCKBASEPOINTPARAMETER", n[n.DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER = 580] = "DWG_TYPE_BLOCKDIAMETRICCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKFLIPACTION = 581] = "DWG_TYPE_BLOCKFLIPACTION", n[n.DWG_TYPE_BLOCKFLIPGRIP = 582] = "DWG_TYPE_BLOCKFLIPGRIP", n[n.DWG_TYPE_BLOCKFLIPPARAMETER = 583] = "DWG_TYPE_BLOCKFLIPPARAMETER", n[n.DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT = 584] = "DWG_TYPE_BLOCKGRIPLOCATIONCOMPONENT", n[n.DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER = 585] = "DWG_TYPE_BLOCKHORIZONTALCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER = 586] = "DWG_TYPE_BLOCKLINEARCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKLINEARGRIP = 587] = "DWG_TYPE_BLOCKLINEARGRIP", n[n.DWG_TYPE_BLOCKLINEARPARAMETER = 588] = "DWG_TYPE_BLOCKLINEARPARAMETER", n[n.DWG_TYPE_BLOCKLOOKUPACTION = 589] = "DWG_TYPE_BLOCKLOOKUPACTION", n[n.DWG_TYPE_BLOCKLOOKUPGRIP = 590] = "DWG_TYPE_BLOCKLOOKUPGRIP", n[n.DWG_TYPE_BLOCKLOOKUPPARAMETER = 591] = "DWG_TYPE_BLOCKLOOKUPPARAMETER", n[n.DWG_TYPE_BLOCKMOVEACTION = 592] = "DWG_TYPE_BLOCKMOVEACTION", n[n.DWG_TYPE_BLOCKPARAMDEPENDENCYBODY = 593] = "DWG_TYPE_BLOCKPARAMDEPENDENCYBODY", n[n.DWG_TYPE_BLOCKPOINTPARAMETER = 594] = "DWG_TYPE_BLOCKPOINTPARAMETER", n[n.DWG_TYPE_BLOCKPOLARGRIP = 595] = "DWG_TYPE_BLOCKPOLARGRIP", n[n.DWG_TYPE_BLOCKPOLARPARAMETER = 596] = "DWG_TYPE_BLOCKPOLARPARAMETER", n[n.DWG_TYPE_BLOCKPOLARSTRETCHACTION = 597] = "DWG_TYPE_BLOCKPOLARSTRETCHACTION", n[n.DWG_TYPE_BLOCKPROPERTIESTABLE = 598] = "DWG_TYPE_BLOCKPROPERTIESTABLE", n[n.DWG_TYPE_BLOCKPROPERTIESTABLEGRIP = 599] = "DWG_TYPE_BLOCKPROPERTIESTABLEGRIP", n[n.DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER = 600] = "DWG_TYPE_BLOCKRADIALCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKREPRESENTATION = 601] = "DWG_TYPE_BLOCKREPRESENTATION", n[n.DWG_TYPE_BLOCKROTATEACTION = 602] = "DWG_TYPE_BLOCKROTATEACTION", n[n.DWG_TYPE_BLOCKROTATIONGRIP = 603] = "DWG_TYPE_BLOCKROTATIONGRIP", n[n.DWG_TYPE_BLOCKROTATIONPARAMETER = 604] = "DWG_TYPE_BLOCKROTATIONPARAMETER", n[n.DWG_TYPE_BLOCKSCALEACTION = 605] = "DWG_TYPE_BLOCKSCALEACTION", n[n.DWG_TYPE_BLOCKSTRETCHACTION = 606] = "DWG_TYPE_BLOCKSTRETCHACTION", n[n.DWG_TYPE_BLOCKUSERPARAMETER = 607] = "DWG_TYPE_BLOCKUSERPARAMETER", n[n.DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER = 608] = "DWG_TYPE_BLOCKVERTICALCONSTRAINTPARAMETER", n[n.DWG_TYPE_BLOCKVISIBILITYGRIP = 609] = "DWG_TYPE_BLOCKVISIBILITYGRIP", n[n.DWG_TYPE_BLOCKVISIBILITYPARAMETER = 610] = "DWG_TYPE_BLOCKVISIBILITYPARAMETER", n[n.DWG_TYPE_BLOCKXYGRIP = 611] = "DWG_TYPE_BLOCKXYGRIP", n[n.DWG_TYPE_BLOCKXYPARAMETER = 612] = "DWG_TYPE_BLOCKXYPARAMETER", n[n.DWG_TYPE_CAMERA = 613] = "DWG_TYPE_CAMERA", n[n.DWG_TYPE_CELLSTYLEMAP = 614] = "DWG_TYPE_CELLSTYLEMAP", n[n.DWG_TYPE_CONTEXTDATAMANAGER = 615] = "DWG_TYPE_CONTEXTDATAMANAGER", n[n.DWG_TYPE_CSACDOCUMENTOPTIONS = 616] = "DWG_TYPE_CSACDOCUMENTOPTIONS", n[n.DWG_TYPE_CURVEPATH = 617] = "DWG_TYPE_CURVEPATH", n[n.DWG_TYPE_DATALINK = 618] = "DWG_TYPE_DATALINK", n[n.DWG_TYPE_DATATABLE = 619] = "DWG_TYPE_DATATABLE", n[n.DWG_TYPE_DBCOLOR = 620] = "DWG_TYPE_DBCOLOR", n[n.DWG_TYPE_DETAILVIEWSTYLE = 621] = "DWG_TYPE_DETAILVIEWSTYLE", n[n.DWG_TYPE_DGNDEFINITION = 622] = "DWG_TYPE_DGNDEFINITION", n[n.DWG_TYPE_DGNUNDERLAY = 623] = "DWG_TYPE_DGNUNDERLAY", n[n.DWG_TYPE_DICTIONARYVAR = 624] = "DWG_TYPE_DICTIONARYVAR", n[n.DWG_TYPE_DICTIONARYWDFLT = 625] = "DWG_TYPE_DICTIONARYWDFLT", n[n.DWG_TYPE_DIMASSOC = 626] = "DWG_TYPE_DIMASSOC", n[n.DWG_TYPE_DMDIMOBJECTCONTEXTDATA = 627] = "DWG_TYPE_DMDIMOBJECTCONTEXTDATA", n[n.DWG_TYPE_DWFDEFINITION = 628] = "DWG_TYPE_DWFDEFINITION", n[n.DWG_TYPE_DWFUNDERLAY = 629] = "DWG_TYPE_DWFUNDERLAY", n[n.DWG_TYPE_DYNAMICBLOCKPROXYNODE = 630] = "DWG_TYPE_DYNAMICBLOCKPROXYNODE", n[n.DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER = 631] = "DWG_TYPE_DYNAMICBLOCKPURGEPREVENTER", n[n.DWG_TYPE_EVALUATION_GRAPH = 632] = "DWG_TYPE_EVALUATION_GRAPH", n[n.DWG_TYPE_EXTRUDEDSURFACE = 633] = "DWG_TYPE_EXTRUDEDSURFACE", n[n.DWG_TYPE_FCFOBJECTCONTEXTDATA = 634] = "DWG_TYPE_FCFOBJECTCONTEXTDATA", n[n.DWG_TYPE_FIELD = 635] = "DWG_TYPE_FIELD", n[n.DWG_TYPE_FIELDLIST = 636] = "DWG_TYPE_FIELDLIST", n[n.DWG_TYPE_FLIPPARAMETERENTITY = 637] = "DWG_TYPE_FLIPPARAMETERENTITY", n[n.DWG_TYPE_FLIPACTIONENTITY = 638] = "DWG_TYPE_FLIPACTIONENTITY", n[n.DWG_TYPE_GEODATA = 639] = "DWG_TYPE_GEODATA", n[n.DWG_TYPE_GEOMAPIMAGE = 640] = "DWG_TYPE_GEOMAPIMAGE", n[n.DWG_TYPE_GEOPOSITIONMARKER = 641] = "DWG_TYPE_GEOPOSITIONMARKER", n[n.DWG_TYPE_GRADIENT_BACKGROUND = 642] = "DWG_TYPE_GRADIENT_BACKGROUND", n[n.DWG_TYPE_GROUND_PLANE_BACKGROUND = 643] = "DWG_TYPE_GROUND_PLANE_BACKGROUND", n[n.DWG_TYPE_HELIX = 644] = "DWG_TYPE_HELIX", n[n.DWG_TYPE_IBL_BACKGROUND = 645] = "DWG_TYPE_IBL_BACKGROUND", n[n.DWG_TYPE_IDBUFFER = 646] = "DWG_TYPE_IDBUFFER", n[n.DWG_TYPE_IMAGE = 647] = "DWG_TYPE_IMAGE", n[n.DWG_TYPE_IMAGEDEF = 648] = "DWG_TYPE_IMAGEDEF", n[n.DWG_TYPE_IMAGEDEF_REACTOR = 649] = "DWG_TYPE_IMAGEDEF_REACTOR", n[n.DWG_TYPE_IMAGE_BACKGROUND = 650] = "DWG_TYPE_IMAGE_BACKGROUND", n[n.DWG_TYPE_INDEX = 651] = "DWG_TYPE_INDEX", n[n.DWG_TYPE_LARGE_RADIAL_DIMENSION = 652] = "DWG_TYPE_LARGE_RADIAL_DIMENSION", n[n.DWG_TYPE_LAYERFILTER = 653] = "DWG_TYPE_LAYERFILTER", n[n.DWG_TYPE_LAYER_INDEX = 654] = "DWG_TYPE_LAYER_INDEX", n[n.DWG_TYPE_LAYOUTPRINTCONFIG = 655] = "DWG_TYPE_LAYOUTPRINTCONFIG", n[n.DWG_TYPE_LEADEROBJECTCONTEXTDATA = 656] = "DWG_TYPE_LEADEROBJECTCONTEXTDATA", n[n.DWG_TYPE_LIGHT = 657] = "DWG_TYPE_LIGHT", n[n.DWG_TYPE_LIGHTLIST = 658] = "DWG_TYPE_LIGHTLIST", n[n.DWG_TYPE_LINEARPARAMETERENTITY = 659] = "DWG_TYPE_LINEARPARAMETERENTITY", n[n.DWG_TYPE_LOFTEDSURFACE = 660] = "DWG_TYPE_LOFTEDSURFACE", n[n.DWG_TYPE_MATERIAL = 661] = "DWG_TYPE_MATERIAL", n[n.DWG_TYPE_MENTALRAYRENDERSETTINGS = 662] = "DWG_TYPE_MENTALRAYRENDERSETTINGS", n[n.DWG_TYPE_MESH = 663] = "DWG_TYPE_MESH", n[n.DWG_TYPE_MLEADEROBJECTCONTEXTDATA = 664] = "DWG_TYPE_MLEADEROBJECTCONTEXTDATA", n[n.DWG_TYPE_MLEADERSTYLE = 665] = "DWG_TYPE_MLEADERSTYLE", n[n.DWG_TYPE_MOVEACTIONENTITY = 666] = "DWG_TYPE_MOVEACTIONENTITY", n[n.DWG_TYPE_MOTIONPATH = 667] = "DWG_TYPE_MOTIONPATH", n[n.DWG_TYPE_MPOLYGON = 668] = "DWG_TYPE_MPOLYGON", n[n.DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA = 669] = "DWG_TYPE_MTEXTATTRIBUTEOBJECTCONTEXTDATA", n[n.DWG_TYPE_MTEXTOBJECTCONTEXTDATA = 670] = "DWG_TYPE_MTEXTOBJECTCONTEXTDATA", n[n.DWG_TYPE_MULTILEADER = 671] = "DWG_TYPE_MULTILEADER", n[n.DWG_TYPE_NAVISWORKSMODEL = 672] = "DWG_TYPE_NAVISWORKSMODEL", n[n.DWG_TYPE_NAVISWORKSMODELDEF = 673] = "DWG_TYPE_NAVISWORKSMODELDEF", n[n.DWG_TYPE_NPOCOLLECTION = 674] = "DWG_TYPE_NPOCOLLECTION", n[n.DWG_TYPE_NURBSURFACE = 675] = "DWG_TYPE_NURBSURFACE", n[n.DWG_TYPE_OBJECT_PTR = 676] = "DWG_TYPE_OBJECT_PTR", n[n.DWG_TYPE_ORDDIMOBJECTCONTEXTDATA = 677] = "DWG_TYPE_ORDDIMOBJECTCONTEXTDATA", n[n.DWG_TYPE_PARTIAL_VIEWING_INDEX = 678] = "DWG_TYPE_PARTIAL_VIEWING_INDEX", n[n.DWG_TYPE_PDFDEFINITION = 679] = "DWG_TYPE_PDFDEFINITION", n[n.DWG_TYPE_PDFUNDERLAY = 680] = "DWG_TYPE_PDFUNDERLAY", n[n.DWG_TYPE_PERSUBENTMGR = 681] = "DWG_TYPE_PERSUBENTMGR", n[n.DWG_TYPE_PLANESURFACE = 682] = "DWG_TYPE_PLANESURFACE", n[n.DWG_TYPE_PLOTSETTINGS = 683] = "DWG_TYPE_PLOTSETTINGS", n[n.DWG_TYPE_POINTCLOUD = 684] = "DWG_TYPE_POINTCLOUD", n[n.DWG_TYPE_POINTCLOUDCOLORMAP = 685] = "DWG_TYPE_POINTCLOUDCOLORMAP", n[n.DWG_TYPE_POINTCLOUDDEF = 686] = "DWG_TYPE_POINTCLOUDDEF", n[n.DWG_TYPE_POINTCLOUDDEFEX = 687] = "DWG_TYPE_POINTCLOUDDEFEX", n[n.DWG_TYPE_POINTCLOUDDEF_REACTOR = 688] = "DWG_TYPE_POINTCLOUDDEF_REACTOR", n[n.DWG_TYPE_POINTCLOUDDEF_REACTOR_EX = 689] = "DWG_TYPE_POINTCLOUDDEF_REACTOR_EX", n[n.DWG_TYPE_POINTCLOUDEX = 690] = "DWG_TYPE_POINTCLOUDEX", n[n.DWG_TYPE_POINTPARAMETERENTITY = 691] = "DWG_TYPE_POINTPARAMETERENTITY", n[n.DWG_TYPE_POINTPATH = 692] = "DWG_TYPE_POINTPATH", n[n.DWG_TYPE_POLARGRIPENTITY = 693] = "DWG_TYPE_POLARGRIPENTITY", n[n.DWG_TYPE_RADIMLGOBJECTCONTEXTDATA = 694] = "DWG_TYPE_RADIMLGOBJECTCONTEXTDATA", n[n.DWG_TYPE_RADIMOBJECTCONTEXTDATA = 695] = "DWG_TYPE_RADIMOBJECTCONTEXTDATA", n[n.DWG_TYPE_RAPIDRTRENDERSETTINGS = 696] = "DWG_TYPE_RAPIDRTRENDERSETTINGS", n[n.DWG_TYPE_RASTERVARIABLES = 697] = "DWG_TYPE_RASTERVARIABLES", n[n.DWG_TYPE_RENDERENTRY = 698] = "DWG_TYPE_RENDERENTRY", n[n.DWG_TYPE_RENDERENVIRONMENT = 699] = "DWG_TYPE_RENDERENVIRONMENT", n[n.DWG_TYPE_RENDERGLOBAL = 700] = "DWG_TYPE_RENDERGLOBAL", n[n.DWG_TYPE_RENDERSETTINGS = 701] = "DWG_TYPE_RENDERSETTINGS", n[n.DWG_TYPE_REVOLVEDSURFACE = 702] = "DWG_TYPE_REVOLVEDSURFACE", n[n.DWG_TYPE_ROTATIONPARAMETERENTITY = 703] = "DWG_TYPE_ROTATIONPARAMETERENTITY", n[n.DWG_TYPE_ROTATEACTIONENTITY = 704] = "DWG_TYPE_ROTATEACTIONENTITY", n[n.DWG_TYPE_RTEXT = 705] = "DWG_TYPE_RTEXT", n[n.DWG_TYPE_SCALE = 706] = "DWG_TYPE_SCALE", n[n.DWG_TYPE_SCALEACTIONENTITY = 707] = "DWG_TYPE_SCALEACTIONENTITY", n[n.DWG_TYPE_SECTIONOBJECT = 708] = "DWG_TYPE_SECTIONOBJECT", n[n.DWG_TYPE_SECTIONVIEWSTYLE = 709] = "DWG_TYPE_SECTIONVIEWSTYLE", n[n.DWG_TYPE_SECTION_MANAGER = 710] = "DWG_TYPE_SECTION_MANAGER", n[n.DWG_TYPE_SECTION_SETTINGS = 711] = "DWG_TYPE_SECTION_SETTINGS", n[n.DWG_TYPE_SKYLIGHT_BACKGROUND = 712] = "DWG_TYPE_SKYLIGHT_BACKGROUND", n[n.DWG_TYPE_SOLID_BACKGROUND = 713] = "DWG_TYPE_SOLID_BACKGROUND", n[n.DWG_TYPE_SORTENTSTABLE = 714] = "DWG_TYPE_SORTENTSTABLE", n[n.DWG_TYPE_SPATIAL_FILTER = 715] = "DWG_TYPE_SPATIAL_FILTER", n[n.DWG_TYPE_SPATIAL_INDEX = 716] = "DWG_TYPE_SPATIAL_INDEX", n[n.DWG_TYPE_STRETCHACTIONENTITY = 717] = "DWG_TYPE_STRETCHACTIONENTITY", n[n.DWG_TYPE_SUN = 718] = "DWG_TYPE_SUN", n[n.DWG_TYPE_SUNSTUDY = 719] = "DWG_TYPE_SUNSTUDY", n[n.DWG_TYPE_SWEPTSURFACE = 720] = "DWG_TYPE_SWEPTSURFACE", n[n.DWG_TYPE_TABLE = 721] = "DWG_TYPE_TABLE", n[n.DWG_TYPE_TABLECONTENT = 722] = "DWG_TYPE_TABLECONTENT", n[n.DWG_TYPE_TABLEGEOMETRY = 723] = "DWG_TYPE_TABLEGEOMETRY", n[n.DWG_TYPE_TABLESTYLE = 724] = "DWG_TYPE_TABLESTYLE", n[n.DWG_TYPE_TEXTOBJECTCONTEXTDATA = 725] = "DWG_TYPE_TEXTOBJECTCONTEXTDATA", n[n.DWG_TYPE_TVDEVICEPROPERTIES = 726] = "DWG_TYPE_TVDEVICEPROPERTIES", n[n.DWG_TYPE_VISIBILITYGRIPENTITY = 727] = "DWG_TYPE_VISIBILITYGRIPENTITY", n[n.DWG_TYPE_VISIBILITYPARAMETERENTITY = 728] = "DWG_TYPE_VISIBILITYPARAMETERENTITY", n[n.DWG_TYPE_VISUALSTYLE = 729] = "DWG_TYPE_VISUALSTYLE", n[n.DWG_TYPE_WIPEOUT = 730] = "DWG_TYPE_WIPEOUT", n[n.DWG_TYPE_WIPEOUTVARIABLES = 731] = "DWG_TYPE_WIPEOUTVARIABLES", n[n.DWG_TYPE_XREFPANELOBJECT = 732] = "DWG_TYPE_XREFPANELOBJECT", n[n.DWG_TYPE_XYPARAMETERENTITY = 733] = "DWG_TYPE_XYPARAMETERENTITY", n[n.DWG_TYPE_BREAKDATA = 734] = "DWG_TYPE_BREAKDATA", n[n.DWG_TYPE_BREAKPOINTREF = 735] = "DWG_TYPE_BREAKPOINTREF", n[n.DWG_TYPE_FLIPGRIPENTITY = 736] = "DWG_TYPE_FLIPGRIPENTITY", n[n.DWG_TYPE_LINEARGRIPENTITY = 737] = "DWG_TYPE_LINEARGRIPENTITY", n[n.DWG_TYPE_ROTATIONGRIPENTITY = 738] = "DWG_TYPE_ROTATIONGRIPENTITY", n[n.DWG_TYPE_XYGRIPENTITY = 739] = "DWG_TYPE_XYGRIPENTITY", n[n.DWG_TYPE__3DLINE = 740] = "DWG_TYPE__3DLINE", n[n.DWG_TYPE_REPEAT = 741] = "DWG_TYPE_REPEAT", n[n.DWG_TYPE_ENDREP = 742] = "DWG_TYPE_ENDREP", n[n.DWG_TYPE_JUMP = 743] = "DWG_TYPE_JUMP", n[n.DWG_TYPE_LOAD = 744] = "DWG_TYPE_LOAD", n[n.DWG_TYPE_FREED = 65533] = "DWG_TYPE_FREED", n[n.DWG_TYPE_UNKNOWN_ENT = 65534] = "DWG_TYPE_UNKNOWN_ENT", n[n.DWG_TYPE_UNKNOWN_OBJ = 65535] = "DWG_TYPE_UNKNOWN_OBJ";
684
+ })(P || (P = {}));
685
+ const bn = Object.fromEntries(Object.entries(P).map(([n, t]) => [t, n]));
686
+ var ct;
687
+ (function(n) {
688
+ n[n.DWG = 0] = "DWG", n[n.DXF = 1] = "DXF";
689
+ })(ct || (ct = {}));
690
+ var U;
691
+ (function(n) {
692
+ n[n.Line = 1] = "Line", n[n.CircularArc = 2] = "CircularArc", n[n.EllipticArc = 3] = "EllipticArc", n[n.Spline = 4] = "Spline";
693
+ })(U || (U = {}));
694
+ var pt;
695
+ (function(n) {
696
+ n[n.ByLayer = 192] = "ByLayer", n[n.ByBlock = 193] = "ByBlock", n[n.Entities = 194] = "Entities", n[n.TrueColor = 195] = "TrueColor", n[n.ForegroundColor = 197] = "ForegroundColor", n[n.None = 200] = "None";
697
+ })(pt || (pt = {}));
698
+ const gn = "*MODEL_SPACE", yn = "*PAPER_SPACE", Bt = (n) => n && n.toUpperCase() == gn, xn = (n) => n && n.toUpperCase().startsWith(yn), L = (n) => n.toString(16).toUpperCase();
699
+ class pn {
700
+ constructor(t) {
701
+ N(this, "libredwg");
702
+ N(this, "layers", /* @__PURE__ */ new Map());
703
+ N(this, "ltypes", /* @__PURE__ */ new Map());
704
+ N(this, "unknownEntityCount");
705
+ this.libredwg = t, this.unknownEntityCount = 0;
706
+ }
707
+ prepare(t, e = !1) {
708
+ (e || this.layers.size == 0) && (this.layers.clear(), t.tables.LAYER.entries.forEach((a) => {
709
+ this.layers.set(a.handle, a.name);
710
+ })), (e || this.ltypes.size == 0) && (this.ltypes.clear(), t.tables.LTYPE.entries.forEach((a) => {
711
+ this.ltypes.set(a.handle, a.name);
712
+ })), this.unknownEntityCount = 0;
713
+ }
714
+ clear() {
715
+ this.layers.clear(), this.ltypes.clear(), this.unknownEntityCount = 0;
716
+ }
717
+ convert(t) {
718
+ const e = this.libredwg, a = e.dwg_object_to_entity(t), _ = e.dwg_object_to_entity_tio(t);
719
+ if (a && _) {
720
+ const o = this.getCommonAttrs(a), i = e.dwg_object_get_fixedtype(t);
721
+ if (i == P.DWG_TYPE_3DFACE)
722
+ return this.convert3dFace(_, o);
723
+ if (i == P.DWG_TYPE_ARC)
724
+ return this.convertArc(_, o);
725
+ if (i == P.DWG_TYPE_ATTDEF)
726
+ return this.convertAttdef(_, o);
727
+ if (i == P.DWG_TYPE_CIRCLE)
728
+ return this.convertCircle(_, o);
729
+ if (i == P.DWG_TYPE_DIMENSION_ALIGNED || i == P.DWG_TYPE_DIMENSION_LINEAR)
730
+ return this.convertAlignedDimension(_, o);
731
+ if (i == P.DWG_TYPE_DIMENSION_ANG3PT)
732
+ return this.convert3PointAngularDimension(_, o);
733
+ if (i == P.DWG_TYPE_DIMENSION_DIAMETER)
734
+ return this.convertDiameterDimension(_, o);
735
+ if (i == P.DWG_TYPE_DIMENSION_ORDINATE)
736
+ return this.convertOrdinateDimension(_, o);
737
+ if (i == P.DWG_TYPE_DIMENSION_RADIUS)
738
+ return this.convertRadiusDimension(_, o);
739
+ if (i == P.DWG_TYPE_ELLIPSE)
740
+ return this.convertEllise(_, o);
741
+ if (i == P.DWG_TYPE_HATCH)
742
+ return this.convertHatch(_, o);
743
+ if (i == P.DWG_TYPE_IMAGE)
744
+ return this.convertImage(_, o);
745
+ if (i == P.DWG_TYPE_INSERT)
746
+ return this.convertInsert(_, o);
747
+ if (i == P.DWG_TYPE_LEADER)
748
+ return this.convertLeader(_, o);
749
+ if (i == P.DWG_TYPE_LINE)
750
+ return this.convertLine(_, o);
751
+ if (i == P.DWG_TYPE_LWPOLYLINE)
752
+ return this.convertLWPolyline(_, o);
753
+ if (i == P.DWG_TYPE_MLINE)
754
+ return this.convertMLine(_, o);
755
+ if (i == P.DWG_TYPE_MTEXT)
756
+ return this.convertMText(_, o);
757
+ if (i == P.DWG_TYPE_OLE2FRAME)
758
+ return this.convertOle2Frame(_, o);
759
+ if (i == P.DWG_TYPE_OLEFRAME)
760
+ return this.convertOleFrame(_, o);
761
+ if (i == P.DWG_TYPE_POINT)
762
+ return this.convertPoint(_, o);
763
+ if (i == P.DWG_TYPE_POLYLINE_2D)
764
+ return this.convertPolyline2d(_, o, t);
765
+ if (i == P.DWG_TYPE_POLYLINE_3D)
766
+ return this.convertPolyline3d(_, o, t);
767
+ if (i == P.DWG_TYPE_PROXY_ENTITY)
768
+ return this.convertProxy(_, o);
769
+ if (i == P.DWG_TYPE_RAY)
770
+ return this.convertRay(_, o);
771
+ if (i == P.DWG_TYPE_SECTIONOBJECT)
772
+ return this.convertSection(_, o);
773
+ if (i == P.DWG_TYPE_SOLID)
774
+ return this.convertSolid(_, o);
775
+ if (i == P.DWG_TYPE_SPLINE)
776
+ return this.convertSpline(_, o);
777
+ if (i == P.DWG_TYPE_TABLE)
778
+ return this.convertTable(_, o);
779
+ if (i == P.DWG_TYPE_TEXT)
780
+ return this.convertText(_, o);
781
+ if (i == P.DWG_TYPE_TOLERANCE)
782
+ return this.convertTolerance(_, o);
783
+ if (i == P.DWG_TYPE_VIEWPORT)
784
+ return this.convertViewport(_, o);
785
+ if (i == P.DWG_TYPE_WIPEOUT)
786
+ return this.convertWipeout(_, o);
787
+ if (i == P.DWG_TYPE_XLINE)
788
+ return this.convertXline(_, o);
789
+ i === P.DWG_TYPE_UNKNOWN_ENT && this.unknownEntityCount++;
790
+ }
791
+ }
792
+ convert3dFace(t, e) {
793
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "corner1").data, o = a.dwg_dynapi_entity_value(t, "corner2").data, i = a.dwg_dynapi_entity_value(t, "corner3").data, s = a.dwg_dynapi_entity_value(t, "corner4").data, r = a.dwg_dynapi_entity_value(t, "invis_flags").data;
794
+ return {
795
+ type: "3DFACE",
796
+ ...e,
797
+ corner1: _,
798
+ corner2: o,
799
+ corner3: i,
800
+ corner4: s,
801
+ flag: r
802
+ };
803
+ }
804
+ convertArc(t, e) {
805
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "center").data, o = a.dwg_dynapi_entity_value(t, "radius").data, i = a.dwg_dynapi_entity_value(t, "thickness").data, s = a.dwg_dynapi_entity_value(t, "extrusion").data, r = a.dwg_dynapi_entity_value(t, "start_angle").data, l = a.dwg_dynapi_entity_value(t, "end_angle").data;
806
+ return {
807
+ type: "ARC",
808
+ ...e,
809
+ thickness: i,
810
+ center: _,
811
+ radius: o,
812
+ startAngle: r,
813
+ endAngle: l,
814
+ extrusionDirection: s
815
+ };
816
+ }
817
+ convertEmbeddedMText(t, e) {
818
+ const a = this.libredwg, _ = a.dwg_dynapi_subclass_value(t, e, "attachment").data, o = a.dwg_dynapi_subclass_value(t, e, "ins_pt").data, i = a.dwg_dynapi_subclass_value(t, e, "x_axis_dir").data, s = a.dwg_dynapi_subclass_value(t, e, "rect_height").data, r = a.dwg_dynapi_subclass_value(t, e, "rect_width").data, l = a.dwg_dynapi_subclass_value(t, e, "extents_height").data, d = a.dwg_dynapi_subclass_value(t, e, "extents_width").data;
819
+ return {
820
+ insertionPoint: o,
821
+ rectHeight: s,
822
+ rectWidth: r,
823
+ extentsHeight: l,
824
+ extentsWidth: d,
825
+ attachmentPoint: _,
826
+ direction: i
827
+ // columnType: columnType,
828
+ // columnFlowReversed: columnFlowReversed,
829
+ // columnAutoHeight: columnAutoHeight,
830
+ // columnWidth: columnWidth,
831
+ // columnGutter: columnGutter,
832
+ // columnHeightCount: columnHeightCount,
833
+ // columnHeights: columnHeights
834
+ };
835
+ }
836
+ convertAttdef(t, e) {
837
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "default_value").data, o = this.convertTextBase(t);
838
+ o.text = _;
839
+ const i = a.dwg_dynapi_entity_value(t, "prompt").data, s = a.dwg_dynapi_entity_value(t, "tag").data, r = a.dwg_dynapi_entity_value(t, "flags").data, l = a.dwg_dynapi_entity_value(t, "field_length").data, d = a.dwg_dynapi_entity_value(t, "lock_position_flag").data, I = a.dwg_dynapi_entity_value(t, "keep_duplicate_records").data, c = a.dwg_dynapi_entity_value(t, "is_really_locked").data, E = a.dwg_dynapi_entity_value(t, "mtext_type").data, C = a.dwg_dynapi_entity_value(t, "alignment_pt").data;
840
+ return {
841
+ type: "ATTDEF",
842
+ ...e,
843
+ text: this.convertTextBase(t),
844
+ prompt: i,
845
+ tag: s,
846
+ flags: r,
847
+ fieldLength: l,
848
+ lockPositionFlag: d > 0,
849
+ duplicateRecordCloningFlag: I > 0,
850
+ mtextFlag: E,
851
+ isReallyLocked: c > 0,
852
+ alignmentPoint: C,
853
+ annotationScale: 1,
854
+ // TODO: Set the correct value
855
+ attrTag: "",
856
+ // TODO: Set the correct value
857
+ mtext: this.convertEmbeddedMText(t, "ATTDEF_mtext")
858
+ };
859
+ }
860
+ convertAttrib(t, e) {
861
+ const a = this.libredwg, _ = this.convertTextBase(t), o = a.dwg_dynapi_entity_value(t, "tag").data, i = a.dwg_dynapi_entity_value(t, "flags").data, s = a.dwg_dynapi_entity_value(t, "field_length").data, r = a.dwg_dynapi_entity_value(t, "lock_position_flag").data, l = a.dwg_dynapi_entity_value(t, "keep_duplicate_records").data, d = a.dwg_dynapi_entity_value(t, "mtext_type").data, I = a.dwg_dynapi_entity_value(t, "is_really_locked").data, c = a.dwg_dynapi_entity_value(t, "alignment_pt").data;
862
+ return {
863
+ type: "ATTRIB",
864
+ ...e,
865
+ text: _,
866
+ tag: o,
867
+ flags: i,
868
+ fieldLength: s,
869
+ lockPositionFlag: !!r,
870
+ duplicateRecordCloningFlag: !!l,
871
+ mtextFlag: d,
872
+ isReallyLocked: !!I,
873
+ numberOfSecondaryAttrs: 0,
874
+ // TODO: libredwg doesn't support it yet.
875
+ secondaryAttrsHardId: "0",
876
+ // TODO: libredwg doesn't support it yet.
877
+ alignmentPoint: { ...c, z: 0 },
878
+ annotationScale: 1,
879
+ // TODO: Set the correct value
880
+ attrTag: "",
881
+ // TODO: Set the correct value
882
+ mtext: this.convertEmbeddedMText(t, "ATTDEF_mtext")
883
+ };
884
+ }
885
+ convertCircle(t, e) {
886
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "center").data, o = a.dwg_dynapi_entity_value(t, "radius").data, i = a.dwg_dynapi_entity_value(t, "thickness").data, s = a.dwg_dynapi_entity_value(t, "extrusion").data;
887
+ return {
888
+ type: "CIRCLE",
889
+ ...e,
890
+ thickness: i,
891
+ center: _,
892
+ radius: o,
893
+ extrusionDirection: s
894
+ };
895
+ }
896
+ convertAlignedDimension(t, e) {
897
+ const a = this.libredwg, _ = this.getDimensionCommonAttrs(t), o = a.dwg_dynapi_entity_value(t, "clone_ins_pt").data, i = a.dwg_dynapi_entity_value(t, "xline1_pt").data, s = a.dwg_dynapi_entity_value(t, "xline2_pt").data, r = a.dwg_dynapi_entity_value(t, "ins_rotation").data, l = a.dwg_dynapi_entity_value(t, "oblique_angle").data;
898
+ return {
899
+ subclassMarker: "AcDbAlignedDimension",
900
+ ...e,
901
+ ..._,
902
+ insertionPoint: o,
903
+ subDefinitionPoint1: i,
904
+ subDefinitionPoint2: s,
905
+ rotationAngle: r ?? 0,
906
+ obliqueAngle: l
907
+ };
908
+ }
909
+ convert3PointAngularDimension(t, e) {
910
+ const a = this.libredwg, _ = this.getDimensionCommonAttrs(t), o = a.dwg_dynapi_entity_value(t, "xline1_pt").data, i = a.dwg_dynapi_entity_value(t, "xline2_pt").data, s = a.dwg_dynapi_entity_value(t, "center_pt").data, r = a.dwg_dynapi_entity_value(t, "xline2end_pt").data;
911
+ return {
912
+ subclassMarker: "AcDb3PointAngularDimension",
913
+ ...e,
914
+ ..._,
915
+ subDefinitionPoint1: o,
916
+ subDefinitionPoint2: i,
917
+ centerPoint: s,
918
+ arcPoint: r
919
+ };
920
+ }
921
+ convertDiameterDimension(t, e) {
922
+ const a = this.libredwg, _ = this.getDimensionCommonAttrs(t), o = a.dwg_dynapi_entity_value(t, "first_arc_pt").data, i = a.dwg_dynapi_entity_value(t, "leader_len").data;
923
+ return {
924
+ subclassMarker: "AcDbDiametricDimension",
925
+ ...e,
926
+ ..._,
927
+ centerPoint: o,
928
+ leaderLength: i
929
+ };
930
+ }
931
+ convertOrdinateDimension(t, e) {
932
+ const a = this.libredwg, _ = this.getDimensionCommonAttrs(t), o = a.dwg_dynapi_entity_value(t, "feature_location_pt").data, i = a.dwg_dynapi_entity_value(t, "leader_endpt").data;
933
+ return {
934
+ subclassMarker: "AcDbOrdinateDimension",
935
+ ...e,
936
+ ..._,
937
+ subDefinitionPoint1: o,
938
+ subDefinitionPoint2: i
939
+ };
940
+ }
941
+ convertRadiusDimension(t, e) {
942
+ const a = this.libredwg, _ = this.getDimensionCommonAttrs(t), o = a.dwg_dynapi_entity_value(t, "first_arc_pt").data, i = a.dwg_dynapi_entity_value(t, "leader_len").data;
943
+ return {
944
+ subclassMarker: "AcDbRadialDimension",
945
+ ...e,
946
+ ..._,
947
+ centerPoint: o,
948
+ leaderLength: i
949
+ };
950
+ }
951
+ convertEllise(t, e) {
952
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "center").data, o = a.dwg_dynapi_entity_value(t, "sm_axis").data, i = a.dwg_dynapi_entity_value(t, "extrusion").data, s = a.dwg_dynapi_entity_value(t, "axis_ratio").data, r = a.dwg_dynapi_entity_value(t, "start_angle").data, l = a.dwg_dynapi_entity_value(t, "end_angle").data;
953
+ return {
954
+ type: "ELLIPSE",
955
+ ...e,
956
+ center: _,
957
+ majorAxisEndPoint: o,
958
+ extrusionDirection: i,
959
+ axisRatio: s,
960
+ startAngle: r,
961
+ endAngle: l
962
+ };
963
+ }
964
+ convertHatch(t, e) {
965
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "extrusion").data, o = a.dwg_dynapi_entity_value(t, "name").data, i = a.dwg_dynapi_entity_value(t, "is_solid_fill").data, s = a.dwg_dynapi_entity_value(t, "is_associative").data, r = a.dwg_dynapi_entity_value(t, "num_paths").data, l = a.dwg_dynapi_entity_value(t, "paths").data, d = a.dwg_ptr_to_hatch_path_array(l, r), I = a.dwg_dynapi_entity_value(t, "style").data, c = a.dwg_dynapi_entity_value(t, "pattern_type").data, E = a.dwg_dynapi_entity_value(t, "angle").data, C = a.dwg_dynapi_entity_value(t, "scale_spacing").data, A = a.dwg_dynapi_entity_value(t, "num_deflines").data, u = a.dwg_dynapi_entity_value(t, "deflines").data, T = a.dwg_ptr_to_hatch_defline_array(u, A), h = a.dwg_dynapi_entity_value(t, "pixel_size").data, Y = a.dwg_dynapi_entity_value(t, "num_seeds").data, R = a.dwg_dynapi_entity_value(t, "seeds").data, f = a.dwg_ptr_to_point2d_array(R, Y), v = {
966
+ ...e,
967
+ // elevationPoint: DwgPoint3D
968
+ extrusionDirection: _,
969
+ patternName: o,
970
+ solidFill: i ? z.SolidFill : z.PatternFill,
971
+ // patternFillColor: number
972
+ associativity: s ? Z.Associative : Z.NonAssociative,
973
+ numberOfBoundaryPaths: r,
974
+ boundaryPaths: this.convertHatchBoundaryPaths(d),
975
+ hatchStyle: I,
976
+ patternType: c,
977
+ patternAngle: E,
978
+ patternScale: C,
979
+ numberOfDefinitionLines: A,
980
+ definitionLines: T.map((S) => ({
981
+ angle: S.angle,
982
+ base: S.pt0,
983
+ offset: S.offset,
984
+ numberOfDashLengths: S.dashes.length,
985
+ dashLengths: S.dashes
986
+ })),
987
+ pixelSize: h,
988
+ numberOfSeedPoints: Y,
989
+ // offsetVector?: DwgPoint3D
990
+ seedPoints: f
991
+ // gradientFlag?: DwgHatchGradientFlag
992
+ };
993
+ if (a.dwg_dynapi_entity_value(t, "is_gradient_fill").data > 0) {
994
+ const S = a.dwg_dynapi_entity_value(t, "gradient_name").data, y = a.dwg_dynapi_entity_value(t, "gradient_angle").data, x = a.dwg_dynapi_entity_value(t, "gradient_shift").data, M = a.dwg_dynapi_entity_value(t, "gradient_tint").data, g = a.dwg_dynapi_entity_value(t, "single_color_gradient").data, p = a.dwg_dynapi_entity_value(t, "colors").data, O = a.dwg_ptr_to_hatch_gradient_color_array(p, g == 1 ? 1 : 2);
995
+ return {
996
+ type: "HATCH",
997
+ ...v,
998
+ gradientFlag: Et.Gradient,
999
+ gradientColorFlag: g == 1 ? q.OneColor : q.TwoColor,
1000
+ gradientName: S,
1001
+ gradientRotation: y,
1002
+ gradientDefinition: x,
1003
+ colorTint: M,
1004
+ gradientColors: O
1005
+ };
1006
+ } else
1007
+ return {
1008
+ type: "HATCH",
1009
+ ...v
1010
+ };
1011
+ }
1012
+ convertHatchBoundaryPaths(t) {
1013
+ return t.filter((a) => a.num_segs_or_paths > 0).map((a) => {
1014
+ const _ = {
1015
+ boundaryPathTypeFlag: a.flag
1016
+ };
1017
+ if (a.flag & 2)
1018
+ return {
1019
+ ..._,
1020
+ hasBulge: a.bulges_present,
1021
+ isClosed: a.closed,
1022
+ numberOfVertices: a.num_segs_or_paths,
1023
+ vertices: a.polyline_paths.map((o) => ({
1024
+ x: o.point.x,
1025
+ y: o.point.y,
1026
+ bulge: o.bulge
1027
+ }))
1028
+ };
1029
+ {
1030
+ const o = a.segs.map((i) => {
1031
+ if (i.curve_type == U.Line)
1032
+ return {
1033
+ type: F.Line,
1034
+ start: i.first_endpoint,
1035
+ end: i.second_endpoint
1036
+ };
1037
+ if (i.curve_type == U.CircularArc)
1038
+ return {
1039
+ type: F.Circular,
1040
+ center: i.center,
1041
+ radius: i.radius,
1042
+ startAngle: i.start_angle,
1043
+ endAngle: i.end_angle,
1044
+ isCCW: i.is_ccw
1045
+ };
1046
+ if (i.curve_type == U.EllipticArc)
1047
+ return {
1048
+ type: F.Elliptic,
1049
+ center: i.center,
1050
+ end: i.endpoint,
1051
+ lengthOfMinorAxis: i.minor_major_ratio,
1052
+ startAngle: i.start_angle,
1053
+ endAngle: i.end_angle,
1054
+ isCCW: i.is_ccw
1055
+ };
1056
+ if (i.curve_type == U.Spline)
1057
+ return {
1058
+ type: F.Spline,
1059
+ degree: i.degree,
1060
+ isRational: i.is_rational,
1061
+ isPeriodic: i.is_periodic,
1062
+ numberOfKnots: i.num_knots,
1063
+ numberOfControlPoints: i.num_control_points,
1064
+ knots: i.knots,
1065
+ controlPoints: i.control_points,
1066
+ numberOfFitData: i.num_fitpts,
1067
+ fitDatum: i.fitpts,
1068
+ startTangent: i.start_tangent,
1069
+ endTangent: i.end_tangent
1070
+ };
1071
+ });
1072
+ return {
1073
+ ..._,
1074
+ numberOfEdges: a.num_segs_or_paths,
1075
+ edges: o
1076
+ };
1077
+ }
1078
+ });
1079
+ }
1080
+ convertImage(t, e) {
1081
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "class_version").data, o = a.dwg_dynapi_entity_value(t, "pt0").data, i = a.dwg_dynapi_entity_value(t, "uvec").data, s = a.dwg_dynapi_entity_value(t, "vvec").data, r = a.dwg_dynapi_entity_value(t, "image_size").data, l = a.dwg_dynapi_entity_value(t, "display_props").data, d = a.dwg_dynapi_entity_value(t, "clipping").data, I = a.dwg_dynapi_entity_value(t, "brightness").data, c = a.dwg_dynapi_entity_value(t, "contrast").data, E = a.dwg_dynapi_entity_value(t, "fade").data, C = a.dwg_dynapi_entity_value(t, "clip_mode").data, A = a.dwg_dynapi_entity_value(t, "clip_boundary_type").data, u = a.dwg_dynapi_entity_value(t, "num_clip_verts").data, T = a.dwg_dynapi_entity_value(t, "clip_verts").data, h = a.dwg_ptr_to_point3d_array(T, u), Y = a.dwg_dynapi_entity_value(t, "imagedef").data, R = L(a.dwg_ref_get_absref(Y)), f = a.dwg_dynapi_entity_value(t, "imagedefreactor").data, v = L(a.dwg_ref_get_absref(f));
1082
+ return {
1083
+ type: "IMAGE",
1084
+ ...e,
1085
+ version: _,
1086
+ position: o,
1087
+ uPixel: i,
1088
+ vPixel: s,
1089
+ imageSize: r,
1090
+ imageDefHandle: R,
1091
+ flags: l,
1092
+ clipping: d,
1093
+ brightness: I,
1094
+ contrast: c,
1095
+ fade: E,
1096
+ imageDefReactorHandle: v,
1097
+ clippingBoundaryType: A,
1098
+ countBoundaryPoints: u,
1099
+ clippingBoundaryPath: h,
1100
+ clipMode: C
1101
+ };
1102
+ }
1103
+ convertInsert(t, e) {
1104
+ const a = this.libredwg;
1105
+ let _ = "";
1106
+ const o = a.dwg_dynapi_entity_value(t, "block_header").data;
1107
+ if (o) {
1108
+ const u = a.dwg_ref_get_object(o);
1109
+ if (u) {
1110
+ const T = a.dwg_object_to_object_tio(u);
1111
+ T && (_ = a.dwg_entity_block_header_get_block(T).name);
1112
+ }
1113
+ }
1114
+ _ || (_ = a.dwg_dynapi_entity_value(t, "block_name").data);
1115
+ const i = a.dwg_dynapi_entity_value(t, "ins_pt").data, s = a.dwg_dynapi_entity_value(t, "scale").data, r = a.dwg_dynapi_entity_value(t, "rotation").data, l = a.dwg_dynapi_entity_value(t, "num_cols").data, d = a.dwg_dynapi_entity_value(t, "num_rows").data, I = a.dwg_dynapi_entity_value(t, "col_spacing").data, c = a.dwg_dynapi_entity_value(t, "row_spacing").data, E = a.dwg_dynapi_entity_value(t, "extrusion").data, C = a.dwg_entity_insert_get_attribs(t), A = [];
1116
+ return C.forEach((u) => {
1117
+ const T = a.dwg_object_to_entity(u), h = a.dwg_object_to_entity_tio(u);
1118
+ if (T && h) {
1119
+ const Y = this.getCommonAttrs(T);
1120
+ a.dwg_object_get_fixedtype(u) == P.DWG_TYPE_ATTRIB && A.push(this.convertAttrib(h, Y));
1121
+ }
1122
+ }), {
1123
+ type: "INSERT",
1124
+ ...e,
1125
+ name: _,
1126
+ insertionPoint: i,
1127
+ xScale: s ? s.x : 1,
1128
+ yScale: s ? s.y : 1,
1129
+ zScale: s ? s.z : 1,
1130
+ rotation: r,
1131
+ columnCount: l,
1132
+ rowCount: d,
1133
+ columnSpacing: I,
1134
+ rowSpacing: c,
1135
+ extrusionDirection: E,
1136
+ attribs: A
1137
+ };
1138
+ }
1139
+ convertLeader(t, e) {
1140
+ const a = this.libredwg, _ = a.dwg_entity_mtext_get_style_name(t), o = a.dwg_dynapi_entity_value(t, "arrowhead_type").data, i = a.dwg_dynapi_entity_value(t, "path_type").data, s = a.dwg_dynapi_entity_value(t, "annot_type").data, r = a.dwg_dynapi_entity_value(t, "hookline_dir").data, l = a.dwg_dynapi_entity_value(t, "hookline_on").data, d = a.dwg_dynapi_entity_value(t, "box_height").data, I = a.dwg_dynapi_entity_value(t, "box_width").data, c = a.dwg_dynapi_entity_value(t, "num_points").data, E = a.dwg_dynapi_entity_value(t, "points").data, C = c > 0 ? a.dwg_ptr_to_point3d_array(E, c) : [], A = a.dwg_dynapi_entity_value(t, "byblock_color").data, u = a.dwg_dynapi_entity_value(t, "extrusion").data, T = a.dwg_dynapi_entity_value(t, "x_direction").data, h = a.dwg_dynapi_entity_value(t, "inspt_offset").data, Y = a.dwg_dynapi_entity_value(t, "endptproj").data;
1141
+ return {
1142
+ type: "LEADER",
1143
+ ...e,
1144
+ styleName: _,
1145
+ isArrowheadEnabled: o > 0,
1146
+ isSpline: i > 0,
1147
+ leaderCreationFlag: s,
1148
+ isHooklineSameDirection: r > 0,
1149
+ isHooklineExists: l > 0,
1150
+ textHeight: d,
1151
+ textWidth: I,
1152
+ numberOfVertices: c,
1153
+ vertices: C,
1154
+ byBlockColor: A,
1155
+ normal: u,
1156
+ horizontalDirection: T,
1157
+ offsetFromBlock: h,
1158
+ offsetFromAnnotation: Y
1159
+ };
1160
+ }
1161
+ convertLine(t, e) {
1162
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "start").data, o = a.dwg_dynapi_entity_value(t, "end").data, i = a.dwg_dynapi_entity_value(t, "thickness").data, s = a.dwg_dynapi_entity_value(t, "extrusion").data;
1163
+ return {
1164
+ type: "LINE",
1165
+ ...e,
1166
+ thickness: i,
1167
+ startPoint: _,
1168
+ endPoint: o,
1169
+ extrusionDirection: s
1170
+ };
1171
+ }
1172
+ convertLWPolyline(t, e) {
1173
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "num_points").data, o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "const_width").data, s = a.dwg_dynapi_entity_value(t, "elevation").data, r = a.dwg_dynapi_entity_value(t, "thickness").data, l = a.dwg_dynapi_entity_value(t, "extrusion").data, d = [], I = a.dwg_dynapi_entity_value(t, "num_points").data, c = a.dwg_dynapi_entity_value(t, "points").data, E = a.dwg_ptr_to_point2d_array(c, I), C = a.dwg_dynapi_entity_value(t, "num_bulges").data, A = a.dwg_dynapi_entity_value(t, "bulges").data, u = a.dwg_ptr_to_double_array(A, C);
1174
+ return E.forEach((T, h) => {
1175
+ d.push({
1176
+ id: h,
1177
+ x: T.x,
1178
+ y: T.y,
1179
+ bulge: u.length > h ? u[h] : 0
1180
+ });
1181
+ }), {
1182
+ type: "LWPOLYLINE",
1183
+ ...e,
1184
+ numberOfVertices: _,
1185
+ flag: o,
1186
+ constantWidth: i,
1187
+ elevation: s,
1188
+ thickness: r,
1189
+ extrusionDirection: l,
1190
+ vertices: d
1191
+ };
1192
+ }
1193
+ convertMLine(t, e) {
1194
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "scale").data, o = a.dwg_dynapi_entity_value(t, "flags").data, i = a.dwg_dynapi_entity_value(t, "justification").data, s = a.dwg_dynapi_entity_value(t, "base_point").data, r = a.dwg_dynapi_entity_value(t, "extrusion").data, l = a.dwg_dynapi_entity_value(t, "num_lines").data, d = a.dwg_dynapi_entity_value(t, "num_verts").data, I = a.dwg_dynapi_entity_value(t, "verts").data, c = a.dwg_ptr_to_mline_vertex_array(I, d), E = [];
1195
+ return c.forEach((C) => {
1196
+ E.push({
1197
+ vertex: C.vertex,
1198
+ vertexDirection: C.vertex_direction,
1199
+ miterDirection: C.miter_direction,
1200
+ numberOfLines: C.num_lines,
1201
+ lines: C.lines.map((A) => ({
1202
+ numberOfSegmentParams: A.num_segparms,
1203
+ segmentParams: A.segparms,
1204
+ numberOfAreaFillParams: A.num_areafillparms,
1205
+ areaFillParams: A.areafillparms
1206
+ }))
1207
+ });
1208
+ }), {
1209
+ type: "MLINE",
1210
+ ...e,
1211
+ scale: _,
1212
+ flags: o,
1213
+ justification: i,
1214
+ startPoint: s,
1215
+ extrusionDirection: r,
1216
+ numberOfLines: l,
1217
+ numberOfVertices: d,
1218
+ vertices: E,
1219
+ mlineStyle: ""
1220
+ // TODO: Set the correct value
1221
+ };
1222
+ }
1223
+ convertOle2Frame(t, e) {
1224
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "oleversion").data, o = a.dwg_dynapi_entity_value(t, "oleclient").data, i = a.dwg_dynapi_entity_value(t, "data_size").data, s = a.dwg_dynapi_entity_value(t, "pt1").data, r = a.dwg_dynapi_entity_value(t, "pt2").data, l = a.dwg_dynapi_entity_value(t, "lock_aspect").data, d = a.dwg_dynapi_entity_value(t, "type").data, I = a.dwg_dynapi_entity_value(t, "mode").data, c = a.dwg_dynapi_entity_value(t, "data").data;
1225
+ return {
1226
+ type: "OLE2FRAME",
1227
+ ...e,
1228
+ oleVersion: _,
1229
+ oleClient: o,
1230
+ dataSize: i,
1231
+ leftUpPoint: s,
1232
+ rightDownPoint: r,
1233
+ lockAspect: l,
1234
+ oleObjectType: d,
1235
+ tileModeDescriptor: I,
1236
+ binaryData: c
1237
+ };
1238
+ }
1239
+ convertOleFrame(t, e) {
1240
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "flag").data, o = a.dwg_dynapi_entity_value(t, "mode").data, i = a.dwg_dynapi_entity_value(t, "data_size").data, s = a.dwg_dynapi_entity_value(t, "data").data;
1241
+ return {
1242
+ type: "OLEFRAME",
1243
+ ...e,
1244
+ flag: _,
1245
+ mode: o,
1246
+ dataSize: i,
1247
+ binaryData: s
1248
+ };
1249
+ }
1250
+ convertMText(t, e) {
1251
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "ins_pt").data, o = a.dwg_dynapi_entity_value(t, "text_height").data, i = a.dwg_dynapi_entity_value(t, "rect_height").data, s = a.dwg_dynapi_entity_value(t, "rect_width").data, r = a.dwg_dynapi_entity_value(t, "extents_width").data, l = a.dwg_dynapi_entity_value(t, "extents_height").data, d = a.dwg_dynapi_entity_value(t, "attachment").data, I = a.dwg_dynapi_entity_value(t, "flow_dir").data, c = a.dwg_dynapi_entity_value(t, "text").data, E = a.dwg_entity_mtext_get_style_name(t), C = a.dwg_dynapi_entity_value(t, "extrusion").data, A = a.dwg_dynapi_entity_value(t, "x_axis_dir").data, u = a.dwg_dynapi_entity_value(t, "linespace_style").data, T = a.dwg_dynapi_entity_value(t, "linespace_factor").data, h = a.dwg_dynapi_entity_value(t, "bg_fill_flag").data, Y = a.dwg_dynapi_entity_value(t, "bg_fill_scale").data, R = a.dwg_dynapi_entity_value(t, "bg_fill_color").data, f = a.dwg_dynapi_entity_value(t, "bg_fill_trans").data, v = a.dwg_dynapi_entity_value(t, "column_type").data, G = a.dwg_dynapi_entity_value(t, "flow_reversed").data, S = a.dwg_dynapi_entity_value(t, "auto_height").data, y = a.dwg_dynapi_entity_value(t, "column_width").data, x = a.dwg_dynapi_entity_value(t, "gutter").data, M = a.dwg_dynapi_entity_value(t, "num_column_heights").data, g = a.dwg_dynapi_entity_value(t, "column_heights").data, p = a.dwg_ptr_to_double_array(g, M);
1252
+ return {
1253
+ type: "MTEXT",
1254
+ ...e,
1255
+ insertionPoint: _,
1256
+ textHeight: o,
1257
+ rectHeight: i,
1258
+ rectWidth: s,
1259
+ extentsHeight: l,
1260
+ extentsWidth: r,
1261
+ attachmentPoint: d,
1262
+ drawingDirection: I,
1263
+ text: c,
1264
+ styleName: E,
1265
+ extrusionDirection: C,
1266
+ direction: A,
1267
+ rotation: 0,
1268
+ // TODO: Didn't find the corresponding field in libredwg
1269
+ lineSpacingStyle: u,
1270
+ lineSpacing: T,
1271
+ backgroundFill: h,
1272
+ // backgroundColor: backgroundColor.rgb, // TODO: Double check whether it should be color index
1273
+ fillBoxScale: Y,
1274
+ backgroundFillColor: R.rgb,
1275
+ // TODO: Double check whether it should be color index
1276
+ backgroundFillTransparency: f,
1277
+ columnType: v,
1278
+ // columnCount: columnCount,
1279
+ columnFlowReversed: G,
1280
+ columnAutoHeight: S,
1281
+ columnWidth: y,
1282
+ columnGutter: x,
1283
+ columnHeightCount: M,
1284
+ columnHeights: p
1285
+ };
1286
+ }
1287
+ convertPoint(t, e) {
1288
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "x").data, o = a.dwg_dynapi_entity_value(t, "y").data, i = a.dwg_dynapi_entity_value(t, "z").data, s = a.dwg_dynapi_entity_value(t, "thickness").data, r = a.dwg_dynapi_entity_value(t, "extrusion").data, l = a.dwg_dynapi_entity_value(t, "x_ang").data;
1289
+ return {
1290
+ type: "POINT",
1291
+ ...e,
1292
+ position: { x: _, y: o, z: i },
1293
+ thickness: s,
1294
+ extrusionDirection: r,
1295
+ angle: l
1296
+ };
1297
+ }
1298
+ convertPolyline2d(t, e, a) {
1299
+ const _ = this.libredwg, o = _.dwg_dynapi_entity_value(t, "flag").data, i = _.dwg_dynapi_entity_value(t, "curve_type").data, s = _.dwg_dynapi_entity_value(t, "start_width").data, r = _.dwg_dynapi_entity_value(t, "end_width").data, l = _.dwg_dynapi_entity_value(t, "elevation").data, d = _.dwg_dynapi_entity_value(t, "thickness").data, I = _.dwg_dynapi_entity_value(t, "extrusion").data, c = _.dwg_entity_polyline_2d_get_vertices(a);
1300
+ return {
1301
+ type: "POLYLINE2D",
1302
+ ...e,
1303
+ flag: o,
1304
+ smoothType: i,
1305
+ startWidth: s,
1306
+ endWidth: r,
1307
+ elevation: l,
1308
+ thickness: d,
1309
+ extrusionDirection: I,
1310
+ vertices: c.map((E) => ({
1311
+ x: E.point.x,
1312
+ y: E.point.y,
1313
+ z: E.point.z,
1314
+ startWidth: E.start_width,
1315
+ endWidth: E.end_width,
1316
+ bulge: E.bulge,
1317
+ flag: E.flag,
1318
+ tangentDirection: E.tangent_dir
1319
+ })),
1320
+ meshMVertexCount: 0,
1321
+ meshNVertexCount: 0,
1322
+ surfaceMDensity: 0,
1323
+ surfaceNDensity: 0
1324
+ };
1325
+ }
1326
+ convertPolyline3d(t, e, a) {
1327
+ const _ = this.libredwg, o = _.dwg_dynapi_entity_value(t, "flag").data, i = _.dwg_dynapi_entity_value(t, "curve_type").data, s = _.dwg_dynapi_entity_value(t, "start_width").data, r = _.dwg_dynapi_entity_value(t, "end_width").data, l = _.dwg_dynapi_entity_value(t, "extrusion").data, d = _.dwg_entity_polyline_3d_get_vertices(a);
1328
+ return {
1329
+ type: "POLYLINE3D",
1330
+ ...e,
1331
+ flag: o,
1332
+ smoothType: i,
1333
+ startWidth: s,
1334
+ endWidth: r,
1335
+ extrusionDirection: l,
1336
+ vertices: d.map((I) => ({
1337
+ x: I.point.x,
1338
+ y: I.point.y,
1339
+ z: I.point.z,
1340
+ flag: I.flag
1341
+ }))
1342
+ };
1343
+ }
1344
+ convertProxy(t, e) {
1345
+ const _ = this.libredwg.dwg_dynapi_entity_value(t, "class_id").data;
1346
+ return {
1347
+ type: "PROXY",
1348
+ ...e,
1349
+ applicationEntityClassId: _
1350
+ };
1351
+ }
1352
+ convertRay(t, e) {
1353
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "point").data, o = a.dwg_dynapi_entity_value(t, "vector").data;
1354
+ return {
1355
+ type: "RAY",
1356
+ ...e,
1357
+ firstPoint: _,
1358
+ unitDirection: o
1359
+ };
1360
+ }
1361
+ convertSection(t, e) {
1362
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "state").data, o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "name").data, s = a.dwg_dynapi_entity_value(t, "vert_dir").data, r = a.dwg_dynapi_entity_value(t, "top_height").data, l = a.dwg_dynapi_entity_value(t, "bottom_height").data, d = a.dwg_dynapi_entity_value(t, "indicator_alpha").data, I = a.dwg_dynapi_entity_value(t, "indicator_color").data, c = a.dwg_dynapi_entity_value(t, "num_verts").data, E = a.dwg_dynapi_entity_value(t, "verts").data, C = c > 0 ? a.dwg_ptr_to_point3d_array(E, c) : [], A = a.dwg_dynapi_entity_value(t, "num_blverts").data, u = a.dwg_dynapi_entity_value(t, "blverts").data, T = A > 0 ? a.dwg_ptr_to_point3d_array(u, A) : [], h = a.dwg_dynapi_entity_value(t, "geometrySettingHardId").data, Y = a.dwg_ref_get_handle_absolute_ref(h);
1363
+ return {
1364
+ type: "SECTION",
1365
+ ...e,
1366
+ state: _,
1367
+ flags: o,
1368
+ name: i,
1369
+ verticalDirection: s,
1370
+ topHeight: r,
1371
+ bottomHeight: l,
1372
+ indicatorTransparency: d,
1373
+ indicatorColor: I.rgb,
1374
+ numberOfVertices: c,
1375
+ vertices: C,
1376
+ numberOfBackLineVertices: A,
1377
+ backLineVertices: T,
1378
+ geometrySettingHardId: Y
1379
+ };
1380
+ }
1381
+ convertSolid(t, e) {
1382
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "corner1").data, o = a.dwg_dynapi_entity_value(t, "corner2").data, i = a.dwg_dynapi_entity_value(t, "corner3").data, s = a.dwg_dynapi_entity_value(t, "corner4").data, r = a.dwg_dynapi_entity_value(t, "thickness").data, l = a.dwg_dynapi_entity_value(t, "extrusion").data;
1383
+ return {
1384
+ type: "SOLID",
1385
+ ...e,
1386
+ corner1: _,
1387
+ corner2: o,
1388
+ corner3: i,
1389
+ corner4: s,
1390
+ thickness: r,
1391
+ extrusionDirection: l
1392
+ };
1393
+ }
1394
+ convertSpline(t, e) {
1395
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "splineflags").data, o = a.dwg_dynapi_entity_value(t, "degree").data, i = a.dwg_dynapi_entity_value(t, "knot_tol").data, s = a.dwg_dynapi_entity_value(t, "num_knots").data, r = a.dwg_dynapi_entity_value(t, "knots").data, l = a.dwg_ptr_to_double_array(r, s), d = a.dwg_dynapi_entity_value(t, "fit_tol").data, I = a.dwg_dynapi_entity_value(t, "num_fit_pts").data, c = a.dwg_dynapi_entity_value(t, "fit_pts").data, E = a.dwg_ptr_to_point3d_array(c, I), C = a.dwg_dynapi_entity_value(t, "weighted").data, A = a.dwg_dynapi_entity_value(t, "ctrl_tol").data, u = a.dwg_dynapi_entity_value(t, "num_ctrl_pts").data, T = a.dwg_dynapi_entity_value(t, "ctrl_pts").data, h = a.dwg_ptr_to_point4d_array(T, u), Y = a.dwg_dynapi_entity_value(t, "beg_tan_vec").data, R = a.dwg_dynapi_entity_value(t, "end_tan_vec").data;
1396
+ return {
1397
+ type: "SPLINE",
1398
+ ...e,
1399
+ // normal?: DwgPoint3D
1400
+ flag: _,
1401
+ degree: o,
1402
+ numberOfKnots: s,
1403
+ numberOfControlPoints: u,
1404
+ numberOfFitPoints: I,
1405
+ knotTolerance: i,
1406
+ controlTolerance: A,
1407
+ fitTolerance: d,
1408
+ startTangent: Y,
1409
+ endTangent: R,
1410
+ knots: l,
1411
+ weights: C ? h.map((f) => f.w) : void 0,
1412
+ controlPoints: h.map((f) => ({
1413
+ x: f.x,
1414
+ y: f.y,
1415
+ z: f.z
1416
+ })),
1417
+ fitPoints: E
1418
+ };
1419
+ }
1420
+ convertTable(t, e) {
1421
+ const a = this.libredwg, _ = a.dwg_dynapi_subclass_value(t, "ldata", "name").data, o = a.dwg_dynapi_entity_value(t, "ins_pt").data, i = a.dwg_dynapi_entity_value(t, "horiz_direction").data, s = a.dwg_dynapi_entity_value(t, "flag_for_table_value").data, r = a.dwg_dynapi_entity_value(t, "num_rows").data, l = a.dwg_dynapi_entity_value(t, "num_cols").data, d = a.dwg_dynapi_entity_value(t, "row_heights").data, I = a.dwg_ptr_to_double_array(d, r), c = a.dwg_dynapi_entity_value(t, "col_widths").data, E = a.dwg_ptr_to_double_array(c, l), C = a.dwg_dynapi_entity_value(t, "tablestyle").data, A = L(a.dwg_ref_get_absref(C)), u = a.dwg_dynapi_entity_value(t, "block_header").data, T = L(a.dwg_ref_get_absref(u)), h = a.dwg_dynapi_entity_value(t, "table_flag_override").data, Y = a.dwg_dynapi_entity_value(t, "border_color_overrides_flag").data, R = a.dwg_dynapi_entity_value(t, "border_lineweight_overrides_flag").data, f = a.dwg_dynapi_entity_value(t, "border_visibility_overrides_flag").data, v = a.dwg_dynapi_entity_value(t, "num_cells").data, G = a.dwg_dynapi_entity_value(t, "cells").data, S = a.dwg_ptr_to_table_cell_array(G, v);
1422
+ return {
1423
+ type: "ACAD_TABLE",
1424
+ ...e,
1425
+ name: _,
1426
+ startPoint: o,
1427
+ directionVector: i,
1428
+ // attachmentPoint: DwgAttachmentPoint
1429
+ tableValue: s,
1430
+ rowCount: r,
1431
+ columnCount: l,
1432
+ overrideFlag: h,
1433
+ borderColorOverrideFlag: Y,
1434
+ borderLineWeightOverrideFlag: R,
1435
+ borderVisibilityOverrideFlag: f,
1436
+ rowHeightArr: I,
1437
+ columnWidthArr: E,
1438
+ tableStyleId: A,
1439
+ blockRecordHandle: T,
1440
+ cells: this.convertTableCells(S),
1441
+ bmpPreview: ""
1442
+ };
1443
+ }
1444
+ convertTableCells(t) {
1445
+ const e = [];
1446
+ return t.forEach((a) => ({
1447
+ text: a.text_value,
1448
+ attachmentPoint: a.cell_alignment,
1449
+ textStyle: a.text_style,
1450
+ // TODO: Set the text style name instead of handle
1451
+ rotation: a.rotation,
1452
+ cellType: a.type,
1453
+ flagValue: a.flags,
1454
+ mergedValue: a.is_merged_value,
1455
+ autoFit: a.is_autofit_flag,
1456
+ // borderWidth?: number
1457
+ // borderHeight?: number
1458
+ topBorderVisibility: a.top_visibility,
1459
+ bottomBorderVisibility: a.bottom_visibility,
1460
+ leftBorderVisibility: a.left_visibility,
1461
+ rightBorderVisibility: a.right_visibility,
1462
+ overrideFlag: a.cell_flag_override,
1463
+ virtualEdgeFlag: a.virtual_edge_flag,
1464
+ // fieldObjetId?: string
1465
+ blockTableRecordI: a.block_handle.absolute_ref,
1466
+ blockScale: a.block_scale,
1467
+ blockAttrNum: a.attr_defs.length,
1468
+ attrDefineId: a.attr_defs.map((_) => _.attdef.absolute_ref),
1469
+ // attrText?: string
1470
+ // textHeight: number
1471
+ extendedCellFlags: a.additional_data_flag
1472
+ })), e;
1473
+ }
1474
+ convertTextBase(t) {
1475
+ const e = this.libredwg, a = e.dwg_dynapi_entity_value(t, "text_value").data, _ = e.dwg_dynapi_entity_value(t, "thickness").data, o = e.dwg_dynapi_entity_value(t, "ins_pt").data, i = e.dwg_dynapi_entity_value(t, "alignment_pt").data, s = e.dwg_dynapi_entity_value(t, "rotation").data, r = e.dwg_dynapi_entity_value(t, "height").data, l = e.dwg_dynapi_entity_value(t, "width_factor").data, d = e.dwg_dynapi_entity_value(t, "oblique_angle").data, I = e.dwg_entity_text_get_style_name(t), c = e.dwg_dynapi_entity_value(t, "generation").data, E = e.dwg_dynapi_entity_value(t, "horiz_alignment").data, C = e.dwg_dynapi_entity_value(t, "vert_alignment").data, A = e.dwg_dynapi_entity_value(t, "extrusion").data;
1476
+ return {
1477
+ text: a,
1478
+ thickness: _,
1479
+ startPoint: o,
1480
+ endPoint: i,
1481
+ textHeight: r,
1482
+ rotation: s,
1483
+ xScale: l,
1484
+ obliqueAngle: d,
1485
+ styleName: I,
1486
+ generationFlag: c,
1487
+ halign: E,
1488
+ valign: C,
1489
+ extrusionDirection: A
1490
+ };
1491
+ }
1492
+ convertText(t, e) {
1493
+ return {
1494
+ type: "TEXT",
1495
+ ...e,
1496
+ ...this.convertTextBase(t)
1497
+ };
1498
+ }
1499
+ convertTolerance(t, e) {
1500
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "ins_pt").data, o = a.dwg_dynapi_entity_value(t, "text_value").data, i = a.dwg_dynapi_entity_value(t, "x_direction").data, s = a.dwg_dynapi_entity_value(t, "extrusion").data, r = a.dwg_entity_get_dimstyle_name(t);
1501
+ return {
1502
+ type: "TOLERANCE",
1503
+ ...e,
1504
+ styleName: r,
1505
+ insertionPoint: _,
1506
+ text: o,
1507
+ extrusionDirection: s,
1508
+ xAxisDirection: i
1509
+ };
1510
+ }
1511
+ convertViewport(t, e) {
1512
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "center").data, o = a.dwg_dynapi_entity_value(t, "width").data, i = a.dwg_dynapi_entity_value(t, "height").data, s = a.dwg_dynapi_entity_value(t, "on_off").data, r = a.dwg_dynapi_entity_value(t, "VIEWCTR").data, l = a.dwg_dynapi_entity_value(t, "SNAPBASE").data, d = a.dwg_dynapi_entity_value(t, "SNAPUNIT").data, I = a.dwg_dynapi_entity_value(t, "GRIDUNIT").data, c = a.dwg_dynapi_entity_value(t, "VIEWDIR").data, E = a.dwg_dynapi_entity_value(t, "view_target").data, C = a.dwg_dynapi_entity_value(t, "lens_length").data, A = a.dwg_dynapi_entity_value(t, "front_clip_z").data, u = a.dwg_dynapi_entity_value(t, "back_clip_z").data, T = a.dwg_dynapi_entity_value(t, "VIEWSIZE").data, h = a.dwg_dynapi_entity_value(t, "SNAPANG").data, Y = a.dwg_dynapi_entity_value(t, "twist_angle").data, R = a.dwg_dynapi_entity_value(t, "circle_zoom").data, f = a.dwg_dynapi_entity_value(t, "status_flag").data, v = a.dwg_dynapi_entity_value(t, "style_sheet").data, G = a.dwg_dynapi_entity_value(t, "render_mode").data, S = a.dwg_dynapi_entity_value(t, "UCSVP").data, y = a.dwg_dynapi_entity_value(t, "ucsorg").data, x = a.dwg_dynapi_entity_value(t, "ucsxdir").data, M = a.dwg_dynapi_entity_value(t, "ucsydir").data, g = a.dwg_dynapi_entity_value(t, "named_ucs").data, p = a.dwg_ref_get_absref(g), O = a.dwg_dynapi_entity_value(t, "base_ucs").data, b = a.dwg_ref_get_absref(O), k = a.dwg_dynapi_entity_value(t, "UCSORTHOVIEW").data, X = a.dwg_dynapi_entity_value(t, "ucs_elevation").data, H = a.dwg_dynapi_entity_value(t, "shadeplot_mode").data, w = a.dwg_dynapi_entity_value(t, "use_default_lights").data, K = a.dwg_dynapi_entity_value(t, "default_lighting_type").data, B = a.dwg_dynapi_entity_value(t, "brightness").data, V = a.dwg_dynapi_entity_value(t, "contrast").data, nt = a.dwg_dynapi_entity_value(t, "grid_major").data, at = a.dwg_dynapi_entity_value(t, "background").data, et = a.dwg_ref_get_absref(at), _t = a.dwg_dynapi_entity_value(t, "shadeplot").data, it = a.dwg_ref_get_absref(_t), ot = a.dwg_dynapi_entity_value(t, "visualstyle").data, st = a.dwg_ref_get_absref(ot), rt = a.dwg_dynapi_entity_value(t, "sun").data, dt = a.dwg_ref_get_absref(rt);
1513
+ return {
1514
+ type: "VIEWPORT",
1515
+ ...e,
1516
+ viewportCenter: _,
1517
+ width: o,
1518
+ height: i,
1519
+ status: s,
1520
+ viewportId: 0,
1521
+ // Will be set later in LibreDwgConverter.convert
1522
+ displayCenter: r,
1523
+ snapBase: l,
1524
+ snapSpacing: d,
1525
+ gridSpacing: I,
1526
+ viewDirection: c,
1527
+ targetPoint: E,
1528
+ perspectiveLensLength: C,
1529
+ frontClipZ: A,
1530
+ backClipZ: u,
1531
+ viewHeight: T,
1532
+ snapAngle: h,
1533
+ viewTwistAngle: Y,
1534
+ circleZoomPercent: R,
1535
+ statusBitFlags: f,
1536
+ sheetName: v,
1537
+ renderMode: G,
1538
+ ucsPerViewport: S,
1539
+ ucsOrigin: y,
1540
+ ucsXAxis: x,
1541
+ ucsYAxis: M,
1542
+ ucsId: L(p),
1543
+ ucsBaseId: L(b),
1544
+ orthographicType: k,
1545
+ elevation: X,
1546
+ shadePlotMode: H,
1547
+ majorGridFrequency: nt,
1548
+ backgroundId: L(et),
1549
+ shadePlotId: L(it),
1550
+ visualStyleId: L(st),
1551
+ isDefaultLighting: !!w,
1552
+ defaultLightingType: K,
1553
+ brightness: B,
1554
+ contrast: V,
1555
+ sunId: L(dt)
1556
+ };
1557
+ }
1558
+ convertWipeout(t, e) {
1559
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "class_version").data, o = a.dwg_dynapi_entity_value(t, "pt0").data, i = a.dwg_dynapi_entity_value(t, "uvec").data, s = a.dwg_dynapi_entity_value(t, "vvec").data, r = a.dwg_dynapi_entity_value(t, "image_size").data, l = a.dwg_dynapi_entity_value(t, "display_props").data, d = a.dwg_dynapi_entity_value(t, "clipping").data, I = a.dwg_dynapi_entity_value(t, "brightness").data, c = a.dwg_dynapi_entity_value(t, "contrast").data, E = a.dwg_dynapi_entity_value(t, "fade").data, C = a.dwg_dynapi_entity_value(t, "clip_mode").data, A = a.dwg_dynapi_entity_value(t, "clip_boundary_type").data, u = a.dwg_dynapi_entity_value(t, "num_clip_verts").data, T = a.dwg_dynapi_entity_value(t, "clip_verts").data, h = a.dwg_ptr_to_point2d_array(T, u), Y = a.dwg_dynapi_entity_value(t, "imagedef").data, R = a.dwg_ref_get_absref(Y), f = a.dwg_dynapi_entity_value(t, "imagedefreactor").data, v = a.dwg_ref_get_absref(f);
1560
+ return {
1561
+ type: "WIPEOUT",
1562
+ ...e,
1563
+ version: _,
1564
+ position: o,
1565
+ uPixel: i,
1566
+ vPixel: s,
1567
+ imageSize: r,
1568
+ imageDefHandle: R,
1569
+ flags: l,
1570
+ clipping: d,
1571
+ brightness: I,
1572
+ contrast: c,
1573
+ fade: E,
1574
+ imageDefReactorHandle: v,
1575
+ clippingBoundaryType: A,
1576
+ countBoundaryPoints: u,
1577
+ clippingBoundaryPath: h,
1578
+ clipMode: C
1579
+ };
1580
+ }
1581
+ convertXline(t, e) {
1582
+ const a = this.libredwg, _ = a.dwg_dynapi_entity_value(t, "point").data, o = a.dwg_dynapi_entity_value(t, "vector").data;
1583
+ return {
1584
+ type: "XLINE",
1585
+ ...e,
1586
+ firstPoint: _,
1587
+ unitDirection: o
1588
+ };
1589
+ }
1590
+ getDimensionCommonAttrs(t) {
1591
+ const e = this.libredwg, a = e.dwg_dynapi_entity_value(t, "class_version").data, _ = e.dwg_entity_get_block_name(t, "block"), o = e.dwg_dynapi_entity_value(t, "def_pt").data, i = e.dwg_dynapi_entity_value(t, "text_midpt").data, s = e.dwg_dynapi_entity_value(t, "attachmentPoint").data, r = e.dwg_dynapi_entity_value(t, "flag").data, l = e.dwg_dynapi_entity_value(t, "lspace_factor").data, d = e.dwg_dynapi_entity_value(t, "lspace_factor").data, I = e.dwg_dynapi_entity_value(t, "act_measurement").data, c = e.dwg_dynapi_entity_value(t, "user_text").data, E = e.dwg_dynapi_entity_value(t, "text_rotation").data, C = e.dwg_dynapi_entity_value(t, "ins_rotation").data, A = e.dwg_dynapi_entity_value(t, "extrusion").data, u = e.dwg_entity_get_dimstyle_name(t);
1592
+ return {
1593
+ type: "DIMENSION",
1594
+ version: a,
1595
+ name: _,
1596
+ definitionPoint: o,
1597
+ textPoint: i,
1598
+ dimensionType: r,
1599
+ attachmentPoint: s,
1600
+ textLineSpacingStyle: l,
1601
+ textLineSpacingFactor: d || 1,
1602
+ measurement: I,
1603
+ text: c,
1604
+ textRotation: E,
1605
+ ocsRotation: C,
1606
+ extrusionDirection: A,
1607
+ styleName: u
1608
+ };
1609
+ }
1610
+ getCommonAttrs(t) {
1611
+ const e = this.libredwg, a = e.dwg_object_entity_get_color_object(t), _ = a.method, o = a.index;
1612
+ let i;
1613
+ (_ == 194 || (a.rgb >>> 24 & 255) === 194) && (i = a.rgb & 16777215);
1614
+ const s = this.getLayerName(t), r = e.dwg_object_entity_get_handle_object(t), l = e.dwg_object_entity_get_ownerhandle_object(t), d = e.dwg_object_entity_get_xdicobjhandle_object(t), I = this.getLtypeName(t), c = e.dwg_object_entity_get_line_weight(t), E = e.dwg_object_entity_get_ltype_scale(t), C = !e.dwg_object_entity_get_invisible(t), A = e.dwg_object_entity_get_xdata(t);
1615
+ return {
1616
+ handle: L(r.value),
1617
+ ownerDictionaryHardId: L(d.absolute_ref),
1618
+ ownerBlockRecordSoftId: L(l.absolute_ref),
1619
+ layer: s,
1620
+ color: i,
1621
+ colorIndex: o,
1622
+ colorName: a.name,
1623
+ lineType: I,
1624
+ lineweight: c,
1625
+ lineTypeScale: E,
1626
+ isVisible: C,
1627
+ transparency: a.alpha,
1628
+ transparencyType: a.alpha_type,
1629
+ xdata: A
1630
+ };
1631
+ }
1632
+ getLayerName(t) {
1633
+ const a = this.libredwg.dwg_object_entity_get_layer_object_ref(t);
1634
+ return this.layers.get(L(a.handleref.value)) ?? "0";
1635
+ }
1636
+ getLtypeName(t) {
1637
+ const a = this.libredwg.dwg_object_entity_get_ltype_object_ref(t);
1638
+ return this.ltypes.get(L(a.handleref.value)) ?? "";
1639
+ }
1640
+ }
1641
+ class mt {
1642
+ constructor(t) {
1643
+ N(this, "libredwg");
1644
+ N(this, "entityConverter");
1645
+ this.libredwg = t, this.entityConverter = new pn(t);
1646
+ }
1647
+ convert(t) {
1648
+ this.entityConverter.clear();
1649
+ const e = {
1650
+ tables: {
1651
+ APPID: {
1652
+ entries: []
1653
+ },
1654
+ BLOCK_RECORD: {
1655
+ entries: []
1656
+ },
1657
+ DIMSTYLE: {
1658
+ entries: []
1659
+ },
1660
+ LAYER: {
1661
+ entries: []
1662
+ },
1663
+ LTYPE: {
1664
+ entries: []
1665
+ },
1666
+ STYLE: {
1667
+ entries: []
1668
+ },
1669
+ VPORT: {
1670
+ entries: []
1671
+ }
1672
+ },
1673
+ objects: {
1674
+ DICTIONARY: [],
1675
+ IMAGEDEF: [],
1676
+ LAYOUT: [],
1677
+ SPATIAL_FILTER: []
1678
+ },
1679
+ header: {},
1680
+ entities: [],
1681
+ classes: []
1682
+ }, a = this.libredwg;
1683
+ this.convertHeader(t, e.header), this.convertClasses(t, e.classes);
1684
+ const _ = a.dwg_get_num_objects(t);
1685
+ for (let i = 0; i < _; i++) {
1686
+ const s = a.dwg_get_object(t, i);
1687
+ if (s) {
1688
+ const r = a.dwg_object_to_object_tio(s);
1689
+ if (r)
1690
+ switch (a.dwg_object_get_fixedtype(s)) {
1691
+ case P.DWG_TYPE_LAYER:
1692
+ {
1693
+ const d = this.convertLayer(r, s);
1694
+ e.tables.LAYER.entries.push(d), this.entityConverter.layers.set(d.handle, d.name);
1695
+ }
1696
+ break;
1697
+ case P.DWG_TYPE_LTYPE:
1698
+ {
1699
+ const d = this.convertLineType(r, s);
1700
+ e.tables.LTYPE.entries.push(d), this.entityConverter.ltypes.set(d.handle, d.name);
1701
+ }
1702
+ break;
1703
+ }
1704
+ }
1705
+ }
1706
+ for (let i = 0; i < _; i++) {
1707
+ const s = a.dwg_get_object(t, i);
1708
+ if (s) {
1709
+ const r = a.dwg_object_to_object_tio(s);
1710
+ if (r)
1711
+ switch (a.dwg_object_get_fixedtype(s)) {
1712
+ case P.DWG_TYPE_APPID:
1713
+ e.tables.APPID.entries.push(this.convertAppId(r));
1714
+ break;
1715
+ case P.DWG_TYPE_BLOCK_HEADER:
1716
+ {
1717
+ const d = this.convertBlockRecord(r, s);
1718
+ e.tables.BLOCK_RECORD.entries.push(d), (Bt(d.name) || xn(d.name)) && d.entities.forEach((I) => {
1719
+ e.entities.push(I), I.type === "INSERT" && I.attribs.forEach((c) => {
1720
+ e.entities.push(c);
1721
+ });
1722
+ });
1723
+ }
1724
+ break;
1725
+ case P.DWG_TYPE_DIMSTYLE:
1726
+ e.tables.DIMSTYLE.entries.push(this.convertDimStyle(r, s));
1727
+ break;
1728
+ case P.DWG_TYPE_STYLE:
1729
+ e.tables.STYLE.entries.push(this.convertStyle(r, s));
1730
+ break;
1731
+ case P.DWG_TYPE_VPORT:
1732
+ e.tables.VPORT.entries.push(this.convertViewport(r, s));
1733
+ break;
1734
+ case P.DWG_TYPE_DICTIONARY:
1735
+ e.objects.DICTIONARY.push(this.convertDictionary(r, s));
1736
+ break;
1737
+ case P.DWG_TYPE_IMAGEDEF:
1738
+ e.objects.IMAGEDEF.push(this.convertImageDef(r, s));
1739
+ break;
1740
+ case P.DWG_TYPE_LAYOUT:
1741
+ e.objects.LAYOUT.push(this.convertLayout(r, s));
1742
+ break;
1743
+ case P.DWG_TYPE_SPATIAL_FILTER:
1744
+ e.objects.SPATIAL_FILTER.push(this.convertSpatialFilter(r, s));
1745
+ break;
1746
+ }
1747
+ }
1748
+ }
1749
+ const o = e.entities.filter((i) => i.type === "VIEWPORT");
1750
+ return o.sort((i, s) => {
1751
+ const r = parseInt(i.handle, 16), l = parseInt(s.handle, 16);
1752
+ return r - l;
1753
+ }), o.forEach((i, s) => {
1754
+ i.viewportId = s + 1;
1755
+ }), e;
1756
+ }
1757
+ getConversionStats() {
1758
+ return {
1759
+ unknownEntityCount: this.entityConverter.unknownEntityCount
1760
+ };
1761
+ }
1762
+ convertHeader(t, e) {
1763
+ const a = this.libredwg;
1764
+ Dn.forEach((_) => {
1765
+ let o = _;
1766
+ (_ == "DIMBLK" || _ == "DIMBLK1" || _ == "DIMBLK2") && (o = o + "_T");
1767
+ let i = a.dwg_dynapi_header_value(t, o).data;
1768
+ _ == "CELTYPE" || _ == "CLAYER" || _ == "CLAYER" || _ == "DIMSTYLE" || _ == "DIMTXSTY" || _ == "TEXTSTYLE" ? i = i ? a.dwg_ref_get_object_name(i) : "" : _ == "DRAGVS" && (i = i ? a.dwg_ref_get_absref(i) : 2), e[_] = i;
1769
+ });
1770
+ }
1771
+ convertClasses(t, e) {
1772
+ const a = this.libredwg, _ = a.dwg_get_num_classes(t);
1773
+ for (let o = 0; o < _; o++) {
1774
+ const i = a.dwg_get_class(t, o);
1775
+ e.push({
1776
+ dxfName: i.dxfname,
1777
+ cppName: i.cppname,
1778
+ appName: i.appname,
1779
+ capabilitiesFlag: i.proxyflag,
1780
+ instanceCount: i.num_instances,
1781
+ wasAProxyFlag: i.s_zombie,
1782
+ // DWG_TYPE_PROXY_ENTITY = 0x1F2 /* 498 */,
1783
+ // DWG_TYPE_PROXY_OBJECT = 0x1F3 /* 499 */,
1784
+ isAnEntityFlag: i.item_class_id === 498
1785
+ });
1786
+ }
1787
+ }
1788
+ convertAppId(t) {
1789
+ const e = this.libredwg, a = e.dwg_dynapi_entity_value(t, "name").data, _ = e.dwg_dynapi_entity_value(t, "flag").data;
1790
+ return {
1791
+ name: a,
1792
+ standardFlag: _
1793
+ };
1794
+ }
1795
+ convertBlockRecord(t, e) {
1796
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_entity_block_header_get_block(t);
1797
+ o.name && (_.name = o.name);
1798
+ const i = a.dwg_dynapi_entity_value(t, "num_owned").data, s = a.dwg_dynapi_entity_value(t, "flag").data, r = a.dwg_dynapi_entity_value(t, "description").data, l = a.dwg_dynapi_entity_value(t, "base_pt").data, d = a.dwg_dynapi_entity_value(t, "insert_units").data, I = a.dwg_dynapi_entity_value(t, "explodable").data, c = a.dwg_dynapi_entity_value(t, "block_scaling").data, E = a.dwg_dynapi_entity_value(t, "layout").data, C = L(a.dwg_ref_get_absref(E));
1799
+ let A = "";
1800
+ const u = (Y) => {
1801
+ const R = new Array(Y.length);
1802
+ for (let f = 0; f < Y.length; f++)
1803
+ R[f] = Y[f].toString(16).toUpperCase();
1804
+ return R.join("");
1805
+ }, T = a.dwg_entity_block_header_get_preview(t);
1806
+ T && T.length > 0 && (A = u(T));
1807
+ let h = this.convertEntities(e, _.handle);
1808
+ if (!h || h.length == 0) {
1809
+ h = [];
1810
+ const Y = a.dwg_dynapi_entity_value(t, "entities").data;
1811
+ if (Y) {
1812
+ const R = a.dwg_ptr_to_object_ref_ptr_array(Y, i), f = this.entityConverter;
1813
+ for (let v = 0; v < i; v++) {
1814
+ const G = a.dwg_ref_get_object(R[v]), S = f.convert(G);
1815
+ S && (S.ownerBlockRecordSoftId = _.handle, h.push(S));
1816
+ }
1817
+ }
1818
+ }
1819
+ return {
1820
+ ..._,
1821
+ flags: s,
1822
+ description: r,
1823
+ basePoint: l,
1824
+ layout: C,
1825
+ insertionUnits: d,
1826
+ explodability: I,
1827
+ scalability: c,
1828
+ bmpPreview: A,
1829
+ entities: h
1830
+ };
1831
+ }
1832
+ convertEntities(t, e) {
1833
+ const a = this.libredwg, _ = this.entityConverter, o = [];
1834
+ let i = a.get_first_owned_entity(t);
1835
+ for (; i; ) {
1836
+ const s = _.convert(i);
1837
+ s && (s.ownerBlockRecordSoftId = e, o.push(s)), i = a.get_next_owned_entity(t, i);
1838
+ }
1839
+ return o;
1840
+ }
1841
+ convertDimStyle(t, e) {
1842
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_dynapi_entity_value(t, "DIMTOL").data, i = a.dwg_dynapi_entity_value(t, "DIMLIM").data, s = a.dwg_dynapi_entity_value(t, "DIMTIH").data, r = a.dwg_dynapi_entity_value(t, "DIMTOH").data, l = a.dwg_dynapi_entity_value(t, "DIMSE1").data, d = a.dwg_dynapi_entity_value(t, "DIMSE2").data, I = a.dwg_dynapi_entity_value(t, "DIMALT").data, c = a.dwg_dynapi_entity_value(t, "DIMTOFL").data, E = a.dwg_dynapi_entity_value(t, "DIMSAH").data, C = a.dwg_dynapi_entity_value(t, "DIMTIX").data, A = a.dwg_dynapi_entity_value(t, "DIMSOXD").data, u = a.dwg_dynapi_entity_value(t, "DIMALTD").data, T = a.dwg_dynapi_entity_value(t, "DIMZIN").data, h = a.dwg_dynapi_entity_value(t, "DIMSD1").data, Y = a.dwg_dynapi_entity_value(t, "DIMSD2").data, R = a.dwg_dynapi_entity_value(t, "DIMTOLJ").data, f = a.dwg_dynapi_entity_value(t, "DIMJUST").data, v = a.dwg_dynapi_entity_value(t, "DIMFIT").data, G = a.dwg_dynapi_entity_value(t, "DIMUPT").data, S = a.dwg_dynapi_entity_value(t, "DIMTZIN").data, y = a.dwg_dynapi_entity_value(t, "DIMALTZ").data, x = a.dwg_dynapi_entity_value(t, "DIMALTTZ").data, M = a.dwg_dynapi_entity_value(t, "DIMTAD").data, g = a.dwg_dynapi_entity_value(t, "DIMUNIT").data, p = a.dwg_dynapi_entity_value(t, "DIMAUNIT").data, O = a.dwg_dynapi_entity_value(t, "DIMDEC").data, b = a.dwg_dynapi_entity_value(t, "DIMTDEC").data, k = a.dwg_dynapi_entity_value(t, "DIMALTU").data, X = a.dwg_dynapi_entity_value(t, "DIMALTTD").data, H = a.dwg_dynapi_entity_value(t, "DIMSCALE").data, w = a.dwg_dynapi_entity_value(t, "DIMASZ").data, K = a.dwg_dynapi_entity_value(t, "DIMEXO").data, B = a.dwg_dynapi_entity_value(t, "DIMDLI").data, V = a.dwg_dynapi_entity_value(t, "DIMEXE").data, nt = a.dwg_dynapi_entity_value(t, "DIMRND").data, at = a.dwg_dynapi_entity_value(t, "DIMDLE").data, et = a.dwg_dynapi_entity_value(t, "DIMTP").data, _t = a.dwg_dynapi_entity_value(t, "DIMTM").data, it = a.dwg_dynapi_entity_value(t, "DIMFXL").data, ot = a.dwg_dynapi_entity_value(t, "DIMJOGANG").data, st = a.dwg_dynapi_entity_value(t, "DIMTFILL").data, rt = a.dwg_dynapi_entity_value(t, "DIMTFILLCLR").data, dt = a.dwg_dynapi_entity_value(t, "DIMAZIN").data, Ft = a.dwg_dynapi_entity_value(t, "DIMARCSYM").data, Ut = a.dwg_dynapi_entity_value(t, "DIMTXT").data, bt = a.dwg_dynapi_entity_value(t, "DIMCEN").data, kt = a.dwg_dynapi_entity_value(t, "DIMTSZ").data, Xt = a.dwg_dynapi_entity_value(t, "DIMALTF").data, Ht = a.dwg_dynapi_entity_value(t, "DIMLFAC").data, Kt = a.dwg_dynapi_entity_value(t, "DIMTVP").data, Vt = a.dwg_dynapi_entity_value(t, "DIMTFAC").data, $t = a.dwg_dynapi_entity_value(t, "DIMGAP").data, Jt = a.dwg_dynapi_entity_value(t, "DIMPOST").data, zt = a.dwg_dynapi_entity_value(t, "DIMAPOST").data, Zt = a.dwg_dynapi_entity_value(t, "DIMBLK_T").data, qt = a.dwg_dynapi_entity_value(t, "DIMBLK1_T").data, Qt = a.dwg_dynapi_entity_value(t, "DIMBLK2_T").data, jt = a.dwg_dynapi_entity_value(t, "DIMALTRND").data, tn = a.dwg_dynapi_entity_value(t, "DIMCLRD_N").data, nn = a.dwg_dynapi_entity_value(t, "DIMCLRE_N").data, an = a.dwg_dynapi_entity_value(t, "DIMCLRT_N").data, en = a.dwg_dynapi_entity_value(t, "DIMCLRD").data, _n = a.dwg_dynapi_entity_value(t, "DIMCLRE").data, on = a.dwg_dynapi_entity_value(t, "DIMCLRT").data, sn = a.dwg_dynapi_entity_value(t, "DIMADEC").data, rn = a.dwg_dynapi_entity_value(t, "DIMFRAC").data, dn = a.dwg_dynapi_entity_value(t, "DIMLUNIT").data, ln = a.dwg_dynapi_entity_value(t, "DIMDSEP").data, En = a.dwg_dynapi_entity_value(t, "DIMTMOVE").data, cn = a.dwg_dynapi_entity_value(t, "DIMATFIT").data, un = a.dwg_dynapi_entity_value(t, "DIMFXLON").data, In = a.dwg_dynapi_entity_value(t, "DIMTXTDIRECTION").data, An = a.dwg_dynapi_entity_value(t, "DIMALTMZF").data, Pn = a.dwg_dynapi_entity_value(t, "DIMALTMZS").data, Tn = a.dwg_dynapi_entity_value(t, "DIMMZF").data, Cn = a.dwg_dynapi_entity_value(t, "DIMMZS").data, hn = a.dwg_dynapi_entity_value(t, "DIMLWD").data, Yn = a.dwg_dynapi_entity_value(t, "DIMLWE").data, Rn = a.dwg_dynapi_entity_value(t, "DIMTXSTY").data, fn = a.dwg_ref_get_absref(Rn), vn = a.dwg_dynapi_entity_value(t, "DIMLDRBLK").data, Ln = a.dwg_ref_get_absref(vn);
1843
+ return {
1844
+ ..._,
1845
+ DIMPOST: Jt,
1846
+ DIMAPOST: zt,
1847
+ DIMBLK: Zt,
1848
+ DIMBLK1: qt,
1849
+ DIMBLK2: Qt,
1850
+ DIMSCALE: H,
1851
+ DIMASZ: w,
1852
+ DIMEXO: K,
1853
+ DIMDLI: B,
1854
+ DIMEXE: V,
1855
+ DIMRND: nt,
1856
+ DIMDLE: at,
1857
+ DIMTP: et,
1858
+ DIMTM: _t,
1859
+ DIMTXT: Ut,
1860
+ DIMCEN: bt,
1861
+ DIMTSZ: kt,
1862
+ DIMALTF: Xt,
1863
+ DIMLFAC: Ht,
1864
+ DIMTVP: Kt,
1865
+ DIMTFAC: Vt,
1866
+ DIMGAP: $t,
1867
+ DIMALTRND: jt,
1868
+ DIMTOL: o,
1869
+ DIMLIM: i,
1870
+ DIMTIH: s,
1871
+ DIMTOH: r,
1872
+ DIMSE1: l,
1873
+ DIMSE2: d,
1874
+ DIMTAD: M,
1875
+ DIMZIN: T,
1876
+ DIMAZIN: dt,
1877
+ DIMALT: I,
1878
+ DIMALTD: u,
1879
+ DIMTOFL: c,
1880
+ DIMSAH: E,
1881
+ DIMTIX: C,
1882
+ DIMSOXD: A,
1883
+ DIMCLRD: en,
1884
+ DIMCLRE: _n,
1885
+ DIMCLRT: on,
1886
+ DIMADEC: sn,
1887
+ DIMUNIT: g,
1888
+ DIMDEC: O,
1889
+ DIMTDEC: b,
1890
+ DIMALTU: k,
1891
+ DIMALTTD: X,
1892
+ DIMAUNIT: p,
1893
+ DIMFRAC: rn,
1894
+ DIMLUNIT: dn,
1895
+ DIMDSEP: String.fromCharCode(ln),
1896
+ DIMTMOVE: En,
1897
+ DIMJUST: f,
1898
+ DIMSD1: h,
1899
+ DIMSD2: Y,
1900
+ DIMTOLJ: R,
1901
+ DIMTZIN: S,
1902
+ DIMALTZ: y,
1903
+ DIMALTTZ: x,
1904
+ DIMFIT: v,
1905
+ DIMUPT: G,
1906
+ DIMATFIT: cn,
1907
+ DIMTXSTY: fn,
1908
+ DIMLDRBLK: Ln,
1909
+ DIMLWD: hn,
1910
+ DIMLWE: Yn,
1911
+ DIMFXL: it,
1912
+ DIMJOGANG: ot,
1913
+ DIMTFILL: st,
1914
+ DIMTFILLCLR: rt,
1915
+ DIMARCSYM: Ft,
1916
+ DIMCLRD_N: tn,
1917
+ DIMCLRE_N: nn,
1918
+ DIMCLRT_N: an,
1919
+ DIMFXLON: un,
1920
+ DIMTXTDIRECTION: In,
1921
+ DIMALTMZF: An,
1922
+ DIMALTMZS: Pn,
1923
+ DIMMZF: Tn,
1924
+ DIMMZS: Cn
1925
+ };
1926
+ }
1927
+ convertLayer(t, e) {
1928
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "frozen").data, s = a.dwg_dynapi_entity_value(t, "off").data, r = a.dwg_dynapi_entity_value(t, "frozen_in_new").data, l = a.dwg_dynapi_entity_value(t, "plotflockedlag").data, d = a.dwg_dynapi_entity_value(t, "plotflag").data, I = a.dwg_dynapi_entity_value(t, "linewt").data, c = a.dwg_dynapi_entity_value(t, "color").data, E = a.dwg_dynapi_entity_value(t, "ltype").data;
1929
+ let C = "Continuous";
1930
+ if (E)
1931
+ try {
1932
+ C = a.dwg_ref_get_object_name(E);
1933
+ } catch {
1934
+ }
1935
+ const A = c.method;
1936
+ let u = 256, T = 16777215;
1937
+ return A === 195 || (c.rgb >>> 24 & 255) === 195 ? u = c.rgb & 255 : A == 194 || (c.rgb >>> 24 & 255) === 194 ? T = c.rgb & 16777215 : c.index >= 1 && c.index <= 255 && (u = c.index), {
1938
+ ..._,
1939
+ standardFlag: o,
1940
+ colorIndex: u,
1941
+ color: T,
1942
+ colorName: c.name,
1943
+ transparency: c.alpha,
1944
+ lineType: C,
1945
+ frozen: i != 0,
1946
+ off: s != 0,
1947
+ frozenInNew: r != 0,
1948
+ locked: l != 0,
1949
+ plotFlag: d,
1950
+ lineweight: I,
1951
+ plotStyleNameObjectId: "",
1952
+ materialObjectId: ""
1953
+ };
1954
+ }
1955
+ convertLineType(t, e) {
1956
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "description").data, s = a.dwg_dynapi_entity_value(t, "numdashes").data, r = a.dwg_dynapi_entity_value(t, "pattern_len").data, l = a.dwg_dynapi_entity_value(t, "dashes").data, d = l ? a.dwg_ptr_to_ltype_dash_array(l, s) : [];
1957
+ return {
1958
+ ..._,
1959
+ description: i,
1960
+ standardFlag: o,
1961
+ numberOfLineTypes: s,
1962
+ totalPatternLength: r,
1963
+ pattern: this.convertLineTypePattern(d)
1964
+ };
1965
+ }
1966
+ convertLineTypePattern(t) {
1967
+ const e = [];
1968
+ return t.forEach((a) => {
1969
+ e.push({
1970
+ elementLength: a.length || 0,
1971
+ elementTypeFlag: a.complex_shapecode,
1972
+ shapeNumber: a.shape_flag,
1973
+ // TODO: convert style handle to style object id
1974
+ // styleObjectId: dash.style,
1975
+ scale: a.scale,
1976
+ rotation: a.rotation,
1977
+ offsetX: a.x_offset,
1978
+ offsetY: a.y_offset,
1979
+ text: a.text
1980
+ });
1981
+ }), e;
1982
+ }
1983
+ convertStyle(t, e) {
1984
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "width_factor").data, s = a.dwg_dynapi_entity_value(t, "oblique_angle").data, r = a.dwg_dynapi_entity_value(t, "generation").data, l = a.dwg_dynapi_entity_value(t, "last_height").data, d = a.dwg_dynapi_entity_value(t, "font_file").data, I = a.dwg_dynapi_entity_value(t, "bigfont_file").data;
1985
+ return {
1986
+ ..._,
1987
+ standardFlag: o,
1988
+ fixedTextHeight: 0,
1989
+ // TODO: Set the correct value
1990
+ widthFactor: i,
1991
+ obliqueAngle: s,
1992
+ textGenerationFlag: r,
1993
+ lastHeight: l,
1994
+ font: d,
1995
+ bigFont: I
1996
+ };
1997
+ }
1998
+ convertViewport(t, e) {
1999
+ const a = this.libredwg, _ = this.getCommonTableEntryAttrs(t, e), o = a.dwg_dynapi_entity_value(t, "flag").data, i = a.dwg_dynapi_entity_value(t, "VIEWSIZE").data, s = a.dwg_dynapi_entity_value(t, "aspect_ratio").data, r = a.dwg_dynapi_entity_value(t, "VIEWCTR").data, l = a.dwg_dynapi_entity_value(t, "view_target").data, d = a.dwg_dynapi_entity_value(t, "VIEWDIR").data, I = a.dwg_dynapi_entity_value(t, "view_twist").data, c = a.dwg_dynapi_entity_value(t, "lens_length").data, E = a.dwg_dynapi_entity_value(t, "front_clip_z").data, C = a.dwg_dynapi_entity_value(t, "back_clip_z").data, A = a.dwg_dynapi_entity_value(t, "VIEWMODE").data, u = a.dwg_dynapi_entity_value(t, "render_mode").data, T = a.dwg_dynapi_entity_value(t, "use_default_lights").data != 0, h = a.dwg_dynapi_entity_value(t, "default_lightning_type").data, Y = a.dwg_dynapi_entity_value(t, "brightness").data, R = a.dwg_dynapi_entity_value(t, "contrast").data, f = a.dwg_dynapi_entity_value(t, "ambient_color").data, v = a.dwg_dynapi_entity_value(t, "lower_left").data, G = a.dwg_dynapi_entity_value(t, "upper_right").data, S = a.dwg_dynapi_entity_value(t, "circle_zoom").data, y = a.dwg_dynapi_entity_value(t, "UCSICON").data, x = a.dwg_dynapi_entity_value(t, "GRIDUNIT").data, M = a.dwg_dynapi_entity_value(t, "SNAPANG").data, g = a.dwg_dynapi_entity_value(t, "SNAPBASE").data, p = a.dwg_dynapi_entity_value(t, "SNAPUNIT").data, O = a.dwg_dynapi_entity_value(t, "ucsorg").data, b = a.dwg_dynapi_entity_value(t, "ucsxdir").data, k = a.dwg_dynapi_entity_value(t, "ucsydir").data, X = a.dwg_dynapi_entity_value(t, "ucs_elevation").data, H = a.dwg_dynapi_entity_value(t, "grid_major").data, w = a.dwg_dynapi_entity_value(t, "background").data, K = w ? L(a.dwg_ref_get_absref(w)) : void 0, B = a.dwg_dynapi_entity_value(t, "visualstyle").data, V = B ? L(a.dwg_ref_get_absref(B)) : void 0;
2000
+ return {
2001
+ ..._,
2002
+ standardFlag: o,
2003
+ lowerLeftCorner: v,
2004
+ upperRightCorner: G,
2005
+ center: r,
2006
+ snapBasePoint: g,
2007
+ snapSpacing: p,
2008
+ gridSpacing: x,
2009
+ viewDirectionFromTarget: d,
2010
+ viewTarget: l,
2011
+ lensLength: c,
2012
+ frontClippingPlane: E,
2013
+ backClippingPlane: C,
2014
+ viewHeight: i,
2015
+ aspectRatio: s,
2016
+ snapRotationAngle: M,
2017
+ viewTwistAngle: I,
2018
+ circleSides: S,
2019
+ frozenLayers: [],
2020
+ // TODO: Set the correct value
2021
+ styleSheet: "",
2022
+ // TODO: Set the correct value
2023
+ renderMode: u,
2024
+ viewMode: A,
2025
+ ucsIconSetting: y,
2026
+ ucsOrigin: O,
2027
+ ucsXAxis: b,
2028
+ ucsYAxis: k,
2029
+ orthographicType: 0,
2030
+ // TODO: Set the correct value
2031
+ elevation: X,
2032
+ shadePlotSetting: 0,
2033
+ // TODO: Set the correct value
2034
+ majorGridLines: H,
2035
+ backgroundObjectId: K,
2036
+ // shadePlotObjectId: undefined,
2037
+ visualStyleObjectId: V,
2038
+ isDefaultLightingOn: T,
2039
+ defaultLightingType: h,
2040
+ brightness: Y,
2041
+ contrast: R,
2042
+ // TODO: Not sure whether 'index' or 'rgb' should be used
2043
+ ambientColor: f.index
2044
+ };
2045
+ }
2046
+ getCommonTableEntryAttrs(t, e) {
2047
+ const a = this.libredwg, _ = a.dwg_object_get_tio(e), o = a.dwg_object_object_get_ownerhandle_object(_), i = a.dwg_object_get_handle_object(e);
2048
+ return {
2049
+ handle: L(i.value),
2050
+ ownerHandle: L(o.absolute_ref),
2051
+ name: a.dwg_dynapi_entity_value(t, "name").data
2052
+ };
2053
+ }
2054
+ convertDictionary(t, e) {
2055
+ const a = this.libredwg, _ = this.getCommonObjectAttrs(e), o = a.dwg_dynapi_entity_value(t, "is_hardowner").data, i = a.dwg_dynapi_entity_value(t, "cloning").data, s = a.dwg_dynapi_entity_value(t, "numitems").data, r = a.dwg_dynapi_entity_value(t, "itemhandles").data, l = a.dwg_ptr_to_object_ref_array(r, s), d = a.dwg_object_dictionary_get_texts(e), I = {};
2056
+ return l.forEach((c, E) => I[d[E]] = L(c.absolute_ref)), {
2057
+ ..._,
2058
+ isHardOwner: !!o,
2059
+ cloningFlag: i,
2060
+ entries: I
2061
+ };
2062
+ }
2063
+ convertImageDef(t, e) {
2064
+ const a = this.libredwg, _ = this.getCommonObjectAttrs(e), o = a.dwg_dynapi_entity_value(t, "image_size").data, i = a.dwg_dynapi_entity_value(t, "file_path").data, s = a.dwg_dynapi_entity_value(t, "is_loaded").data, r = a.dwg_dynapi_entity_value(t, "pixel_size").data, l = a.dwg_dynapi_entity_value(t, "resunits").data;
2065
+ return {
2066
+ ..._,
2067
+ fileName: i,
2068
+ size: o,
2069
+ sizeOfOnePixel: r,
2070
+ isLoaded: s,
2071
+ resolutionUnits: l
2072
+ };
2073
+ }
2074
+ convertLayout(t, e) {
2075
+ const a = this.libredwg, _ = this.getCommonObjectAttrs(e), o = a.dwg_dynapi_entity_value(t, "layout_name").data, i = a.dwg_dynapi_entity_value(t, "tab_order").data, s = a.dwg_dynapi_entity_value(t, "layout_flags").data, r = a.dwg_dynapi_entity_value(t, "INSBASE").data, l = a.dwg_dynapi_entity_value(t, "LIMMIN").data, d = a.dwg_dynapi_entity_value(t, "LIMMAX").data, I = a.dwg_dynapi_entity_value(t, "UCSORG").data, c = a.dwg_dynapi_entity_value(t, "UCSXDIR").data, E = a.dwg_dynapi_entity_value(t, "UCSYDIR").data, C = a.dwg_dynapi_entity_value(t, "UCSORTHOVIEW").data, A = a.dwg_dynapi_entity_value(t, "EXTMIN").data, u = a.dwg_dynapi_entity_value(t, "EXTMAX").data, T = a.dwg_dynapi_entity_value(t, "ucs_elevation").data, h = a.dwg_dynapi_entity_value(t, "block_header").data, Y = L(a.dwg_ref_get_absref(h)), R = a.dwg_dynapi_entity_value(t, "active_viewport").data, f = L(a.dwg_ref_get_absref(R)), v = a.dwg_dynapi_entity_value(t, "named_ucs").data, G = v ? L(a.dwg_ref_get_absref(v)) : void 0;
2076
+ return {
2077
+ ..._,
2078
+ layoutName: o,
2079
+ controlFlag: s,
2080
+ tabOrder: i,
2081
+ minLimit: l,
2082
+ maxLimit: d,
2083
+ insertionPoint: r,
2084
+ minExtent: A,
2085
+ maxExtent: u,
2086
+ elevation: T,
2087
+ ucsOrigin: I,
2088
+ ucsXAxis: c,
2089
+ ucsYAxis: E,
2090
+ orthographicType: C,
2091
+ paperSpaceTableId: Y,
2092
+ viewportId: f,
2093
+ namedUcsId: G,
2094
+ // orthographicUcsId?: string;
2095
+ shadePlotId: ""
2096
+ // TODO: Set the correct value
2097
+ };
2098
+ }
2099
+ convertSpatialFilter(t, e) {
2100
+ const a = this.libredwg, _ = this.getCommonObjectAttrs(e), o = a.dwg_dynapi_entity_value(t, "origin").data, i = a.dwg_dynapi_entity_value(t, "num_clip_verts").data, s = a.dwg_dynapi_entity_value(t, "clip_verts").data, r = a.dwg_ptr_to_point2d_array(s, i), l = a.dwg_dynapi_entity_value(t, "extrusion").data, d = a.dwg_dynapi_entity_value(t, "display_boundary_on").data, I = a.dwg_dynapi_entity_value(t, "front_clip_on").data, c = a.dwg_dynapi_entity_value(t, "front_clip_z").data, E = a.dwg_dynapi_entity_value(t, "back_clip_on").data, C = a.dwg_dynapi_entity_value(t, "back_clip_z").data, A = a.dwg_dynapi_entity_value(t, "transform").data, u = a.dwg_ptr_to_double_array(A, 12), T = a.dwg_dynapi_entity_value(t, "inverse_transform").data, h = a.dwg_ptr_to_double_array(T, 12);
2101
+ return {
2102
+ ..._,
2103
+ origin: o,
2104
+ numberOfPointsOnClipBoundary: i,
2105
+ vertices: r,
2106
+ extrusionDirection: l,
2107
+ clipBoundaryVisible: !!d,
2108
+ frontClippingPlaneFlag: !!I,
2109
+ frontClippingPlaneDistance: c,
2110
+ backClippingPlaneFlag: !!E,
2111
+ backClippingPlaneDistance: C,
2112
+ matrix: u,
2113
+ invertBlockMatrix: h
2114
+ };
2115
+ }
2116
+ getCommonObjectAttrs(t) {
2117
+ const e = this.libredwg, a = e.dwg_object_get_tio(t), _ = e.dwg_object_object_get_ownerhandle_object(a), o = e.dwg_object_get_handle_object(t);
2118
+ return {
2119
+ handle: L(o.value),
2120
+ ownerHandle: L(_.absolute_ref)
2121
+ };
2122
+ }
2123
+ }
2124
+ class D {
2125
+ constructor() {
2126
+ N(this, "min");
2127
+ N(this, "max");
2128
+ N(this, "valid");
2129
+ this.min = { x: 1 / 0, y: 1 / 0 }, this.max = { x: -1 / 0, y: -1 / 0 }, this.valid = !1;
2130
+ }
2131
+ /**
2132
+ * Expands the bounding box to include a given point.
2133
+ *
2134
+ * @param point - The point to include in the bounding box.
2135
+ * @returns This bounding box after expansion.
2136
+ */
2137
+ expandByPoint(t) {
2138
+ return this.min.x = Math.min(this.min.x, t.x), this.min.y = Math.min(this.min.y, t.y), this.max.x = Math.max(this.max.x, t.x), this.max.y = Math.max(this.max.y, t.y), this.valid = !0, this;
2139
+ }
2140
+ /**
2141
+ * Applies a scaling and translation transformation to this bounding box.
2142
+ *
2143
+ * @param scale - The scaling factors in x and y directions.
2144
+ * @param translation - The translation offsets in x and y directions.
2145
+ * @returns This bounding box after transformation.
2146
+ */
2147
+ transform(t, e) {
2148
+ const a = this.getCorners().map((_) => ({
2149
+ x: _.x * t.x + e.x,
2150
+ y: _.y * t.y + e.y
2151
+ }));
2152
+ this.reset();
2153
+ for (const _ of a)
2154
+ this.expandByPoint(_);
2155
+ return this;
2156
+ }
2157
+ /**
2158
+ * Applies a rotation around a specific point to this bounding box.
2159
+ *
2160
+ * @param angleInRad - The angle of rotation in radians.
2161
+ * @param point - The center of rotation.
2162
+ * @returns This bounding box after rotation.
2163
+ */
2164
+ rotate(t, e) {
2165
+ const a = Math.cos(t), _ = Math.sin(t), o = this.getCorners().map((i) => {
2166
+ const s = i.x - e.x, r = i.y - e.y;
2167
+ return {
2168
+ x: e.x + s * a - r * _,
2169
+ y: e.y + s * _ + r * a
2170
+ };
2171
+ });
2172
+ this.reset();
2173
+ for (const i of o)
2174
+ this.expandByPoint(i);
2175
+ return this;
2176
+ }
2177
+ /**
2178
+ * Creates a deep copy of this bounding box.
2179
+ *
2180
+ * @returns A new instance of Box2D with the same properties.
2181
+ */
2182
+ clone() {
2183
+ const t = new D();
2184
+ return t.min = { x: this.min.x, y: this.min.y }, t.max = { x: this.max.x, y: this.max.y }, t.valid = this.valid, t;
2185
+ }
2186
+ /**
2187
+ * Resets this bounding box to its initial unbounded state.
2188
+ */
2189
+ reset() {
2190
+ this.min = { x: 1 / 0, y: 1 / 0 }, this.max = { x: -1 / 0, y: -1 / 0 }, this.valid = !1;
2191
+ }
2192
+ /**
2193
+ * Retrieves the four corner points of the bounding box.
2194
+ *
2195
+ * @returns An array of corner points in the order:
2196
+ * bottom-left, top-left, bottom-right, top-right.
2197
+ */
2198
+ getCorners() {
2199
+ return [
2200
+ { x: this.min.x, y: this.min.y },
2201
+ { x: this.min.x, y: this.max.y },
2202
+ { x: this.max.x, y: this.min.y },
2203
+ { x: this.max.x, y: this.max.y }
2204
+ ];
2205
+ }
2206
+ }
2207
+ function mn(n, t, e, a, _) {
2208
+ const o = e.length;
2209
+ if (o === 0)
2210
+ throw new Error("points must not be empty");
2211
+ const i = e[0].length;
2212
+ if (n < 0 || n > 1)
2213
+ throw new Error(`t out of bounds [0,1]: ${n}`);
2214
+ if (t < 1)
2215
+ throw new Error("degree must be at least 1 (linear)");
2216
+ if (t > o - 1)
2217
+ throw new Error("degree must be less than or equal to point count - 1");
2218
+ const s = _ ?? new Array(o).fill(1), r = a ?? (() => {
2219
+ const A = [];
2220
+ for (let u = 0; u < o + t + 1; u++)
2221
+ A.push(u);
2222
+ return A;
2223
+ })();
2224
+ if (r.length !== o + t + 1)
2225
+ throw new Error("bad knot vector length");
2226
+ const l = [t, r.length - 1 - t], d = r[l[0]], I = r[l[1]];
2227
+ n = n * (I - d) + d, n = Math.max(n, d), n = Math.min(n, I);
2228
+ let c = l[0];
2229
+ for (; c < l[1] && !(n >= r[c] && n <= r[c + 1]); c++)
2230
+ ;
2231
+ const E = new Array(o);
2232
+ for (let A = 0; A < o; A++) {
2233
+ E[A] = new Array(i + 1);
2234
+ for (let u = 0; u < i; u++)
2235
+ E[A][u] = e[A][u] * s[A];
2236
+ E[A][i] = s[A];
2237
+ }
2238
+ for (let A = 1; A <= t + 1; A++)
2239
+ for (let u = c; u > c - t - 1 + A; u--) {
2240
+ const T = r[u + t + 1 - A] - r[u], h = T === 0 ? 0 : (n - r[u]) / T;
2241
+ for (let Y = 0; Y < i + 1; Y++)
2242
+ E[u][Y] = (1 - h) * E[u - 1][Y] + h * E[u][Y];
2243
+ }
2244
+ const C = new Array(i);
2245
+ for (let A = 0; A < i; A++)
2246
+ C[A] = On(E[c][A] / E[c][i], -9);
2247
+ return C;
2248
+ }
2249
+ function On(n, t) {
2250
+ if (isNaN(n) || !Number.isInteger(t))
2251
+ return NaN;
2252
+ const [e, a = "0"] = n.toString().split("e"), _ = Math.round(+`${e}e${+a - t}`), [o, i = "0"] = _.toString().split("e");
2253
+ return +`${o}e${+i + t}`;
2254
+ }
2255
+ const J = {
2256
+ aliceblue: 15792383,
2257
+ antiquewhite: 16444375,
2258
+ aqua: 65535,
2259
+ aquamarine: 8388564,
2260
+ azure: 15794175,
2261
+ beige: 16119260,
2262
+ bisque: 16770244,
2263
+ black: 0,
2264
+ blanchedalmond: 16772045,
2265
+ blue: 255,
2266
+ blueviolet: 9055202,
2267
+ brown: 10824234,
2268
+ burlywood: 14596231,
2269
+ cadetblue: 6266528,
2270
+ chartreuse: 8388352,
2271
+ chocolate: 13789470,
2272
+ coral: 16744272,
2273
+ cornflowerblue: 6591981,
2274
+ cornsilk: 16775388,
2275
+ crimson: 14423100,
2276
+ cyan: 65535,
2277
+ darkblue: 139,
2278
+ darkcyan: 35723,
2279
+ darkgoldenrod: 12092939,
2280
+ darkgray: 11119017,
2281
+ darkgreen: 25600,
2282
+ darkkhaki: 12433259,
2283
+ darkmagenta: 9109643,
2284
+ darkolivegreen: 5597999,
2285
+ darkorange: 16747520,
2286
+ darkorchid: 10040012,
2287
+ darkred: 9109504,
2288
+ darksalmon: 15308410,
2289
+ darkseagreen: 9419919,
2290
+ darkslateblue: 4734347,
2291
+ darkslategray: 3100495,
2292
+ darkturquoise: 52945,
2293
+ darkviolet: 9699539,
2294
+ deeppink: 16716947,
2295
+ deepskyblue: 49151,
2296
+ dimgrey: 6908265,
2297
+ dodgerblue: 2003199,
2298
+ firebrick: 11674146,
2299
+ floralwhite: 16775920,
2300
+ forestgreen: 2263842,
2301
+ fuchsia: 16711935,
2302
+ gainsboro: 14474460,
2303
+ ghostwhite: 16316671,
2304
+ gold: 16766720,
2305
+ goldenrod: 14329120,
2306
+ gray: 8421504,
2307
+ green: 32768,
2308
+ greenyellow: 11403055,
2309
+ grey: 8421504,
2310
+ honeydew: 15794160,
2311
+ hotpink: 16738740,
2312
+ indianred: 13458524,
2313
+ indigo: 4915330,
2314
+ ivory: 16777200,
2315
+ khaki: 15787660,
2316
+ lavender: 15132410,
2317
+ lavenderblush: 16773365,
2318
+ lawngreen: 8190976,
2319
+ lemonchiffon: 16775885,
2320
+ lightblue: 11393254,
2321
+ lightcoral: 15761536,
2322
+ lightcyan: 14745599,
2323
+ lightgoldenrodyellow: 16448210,
2324
+ lightgray: 13882323,
2325
+ lightgreen: 9498256,
2326
+ lightgrey: 13882323,
2327
+ lightpink: 16758465,
2328
+ lightsalmon: 16752762,
2329
+ lightseagreen: 2142890,
2330
+ lightskyblue: 8900346,
2331
+ lightslategray: 7833753,
2332
+ lightslategrey: 7833753,
2333
+ lightsteelblue: 11584734,
2334
+ lightyellow: 16777184,
2335
+ lime: 65280,
2336
+ limegreen: 3329330,
2337
+ linen: 16445670,
2338
+ magenta: 16711935,
2339
+ maroon: 8388608,
2340
+ mediumaquamarine: 6737322,
2341
+ mediumblue: 205,
2342
+ mediumorchid: 12211667,
2343
+ mediumpurple: 9662683,
2344
+ mediumseagreen: 3978097,
2345
+ mediumslateblue: 8087790,
2346
+ mediumspringgreen: 64154,
2347
+ mediumturquoise: 4772300,
2348
+ mediumvioletred: 13047173,
2349
+ midnightblue: 1644912,
2350
+ mintcream: 16121850,
2351
+ mistyrose: 16770273,
2352
+ moccasin: 16770229,
2353
+ navajowhite: 16768685,
2354
+ navy: 128,
2355
+ oldlace: 16643558,
2356
+ olive: 8421376,
2357
+ olivedrab: 7048739,
2358
+ orange: 16753920,
2359
+ orangered: 16729344,
2360
+ orchid: 14315734,
2361
+ palegoldenrod: 15657130,
2362
+ palegreen: 10025880,
2363
+ paleturquoise: 11529966,
2364
+ palevioletred: 14381203,
2365
+ papayawhip: 16773077,
2366
+ peachpuff: 16767673,
2367
+ peru: 13468991,
2368
+ pink: 16761035,
2369
+ plum: 14524637,
2370
+ powderblue: 11591910,
2371
+ purple: 8388736,
2372
+ rebeccapurple: 6697881,
2373
+ red: 16711680,
2374
+ rosybrown: 12357519,
2375
+ royalblue: 4286945,
2376
+ saddlebrown: 9127187,
2377
+ salmon: 16416882,
2378
+ sandybrown: 16032864,
2379
+ seagreen: 3050327,
2380
+ seashell: 16774638,
2381
+ sienna: 10506797,
2382
+ silver: 12632256,
2383
+ skyblue: 8900331,
2384
+ slateblue: 6970061,
2385
+ slategrey: 7372944,
2386
+ snow: 16775930,
2387
+ springgreen: 65407,
2388
+ steelblue: 4620980,
2389
+ tan: 13808780,
2390
+ teal: 32896,
2391
+ thistle: 14204888,
2392
+ tomato: 16737095,
2393
+ turquoise: 4251856,
2394
+ violet: 15631086,
2395
+ wheat: 16113331,
2396
+ white: 16777215,
2397
+ whitesmoke: 16119285,
2398
+ yellow: 16776960,
2399
+ yellowgreen: 10145074
2400
+ }, lt = [
2401
+ 0,
2402
+ 16711680,
2403
+ 16776960,
2404
+ 65280,
2405
+ 65535,
2406
+ 255,
2407
+ 16711935,
2408
+ 16777215,
2409
+ 8421504,
2410
+ 12632256,
2411
+ 16711680,
2412
+ 16744319,
2413
+ 13369344,
2414
+ 13395558,
2415
+ 10027008,
2416
+ 10046540,
2417
+ 8323072,
2418
+ 8339263,
2419
+ 4980736,
2420
+ 4990502,
2421
+ 16727808,
2422
+ 16752511,
2423
+ 13382400,
2424
+ 13401958,
2425
+ 10036736,
2426
+ 10051404,
2427
+ 8331008,
2428
+ 8343359,
2429
+ 4985600,
2430
+ 4992806,
2431
+ 16744192,
2432
+ 16760703,
2433
+ 13395456,
2434
+ 13408614,
2435
+ 10046464,
2436
+ 10056268,
2437
+ 8339200,
2438
+ 8347455,
2439
+ 4990464,
2440
+ 4995366,
2441
+ 16760576,
2442
+ 16768895,
2443
+ 13408512,
2444
+ 13415014,
2445
+ 10056192,
2446
+ 10061132,
2447
+ 8347392,
2448
+ 8351551,
2449
+ 4995328,
2450
+ 4997670,
2451
+ 16776960,
2452
+ 16777087,
2453
+ 13421568,
2454
+ 13421670,
2455
+ 10000384,
2456
+ 10000460,
2457
+ 8355584,
2458
+ 8355647,
2459
+ 5000192,
2460
+ 5000230,
2461
+ 12582656,
2462
+ 14679935,
2463
+ 10079232,
2464
+ 11717734,
2465
+ 7510016,
2466
+ 8755276,
2467
+ 6258432,
2468
+ 7307071,
2469
+ 3755008,
2470
+ 4344870,
2471
+ 8388352,
2472
+ 12582783,
2473
+ 6736896,
2474
+ 10079334,
2475
+ 5019648,
2476
+ 7510092,
2477
+ 4161280,
2478
+ 6258495,
2479
+ 2509824,
2480
+ 3755046,
2481
+ 4194048,
2482
+ 10485631,
2483
+ 3394560,
2484
+ 8375398,
2485
+ 2529280,
2486
+ 6264908,
2487
+ 2064128,
2488
+ 5209919,
2489
+ 1264640,
2490
+ 3099686,
2491
+ 65280,
2492
+ 8388479,
2493
+ 52224,
2494
+ 6736998,
2495
+ 38912,
2496
+ 5019724,
2497
+ 32512,
2498
+ 4161343,
2499
+ 19456,
2500
+ 2509862,
2501
+ 65343,
2502
+ 8388511,
2503
+ 52275,
2504
+ 6737023,
2505
+ 38950,
2506
+ 5019743,
2507
+ 32543,
2508
+ 4161359,
2509
+ 19475,
2510
+ 2509871,
2511
+ 65407,
2512
+ 8388543,
2513
+ 52326,
2514
+ 6737049,
2515
+ 38988,
2516
+ 5019762,
2517
+ 32575,
2518
+ 4161375,
2519
+ 19494,
2520
+ 2509881,
2521
+ 65471,
2522
+ 8388575,
2523
+ 52377,
2524
+ 6737074,
2525
+ 39026,
2526
+ 5019781,
2527
+ 32607,
2528
+ 4161391,
2529
+ 19513,
2530
+ 2509890,
2531
+ 65535,
2532
+ 8388607,
2533
+ 52428,
2534
+ 6737100,
2535
+ 39064,
2536
+ 5019800,
2537
+ 32639,
2538
+ 4161407,
2539
+ 19532,
2540
+ 2509900,
2541
+ 49151,
2542
+ 8380415,
2543
+ 39372,
2544
+ 6730444,
2545
+ 29336,
2546
+ 5014936,
2547
+ 24447,
2548
+ 4157311,
2549
+ 14668,
2550
+ 2507340,
2551
+ 32767,
2552
+ 8372223,
2553
+ 26316,
2554
+ 6724044,
2555
+ 19608,
2556
+ 5010072,
2557
+ 16255,
2558
+ 4153215,
2559
+ 9804,
2560
+ 2505036,
2561
+ 16383,
2562
+ 8364031,
2563
+ 13260,
2564
+ 6717388,
2565
+ 9880,
2566
+ 5005208,
2567
+ 8063,
2568
+ 4149119,
2569
+ 4940,
2570
+ 2502476,
2571
+ 255,
2572
+ 8355839,
2573
+ 204,
2574
+ 6710988,
2575
+ 152,
2576
+ 5000344,
2577
+ 127,
2578
+ 4145023,
2579
+ 76,
2580
+ 2500172,
2581
+ 4129023,
2582
+ 10452991,
2583
+ 3342540,
2584
+ 8349388,
2585
+ 2490520,
2586
+ 6245528,
2587
+ 2031743,
2588
+ 5193599,
2589
+ 1245260,
2590
+ 3089996,
2591
+ 8323327,
2592
+ 12550143,
2593
+ 6684876,
2594
+ 10053324,
2595
+ 4980888,
2596
+ 7490712,
2597
+ 4128895,
2598
+ 6242175,
2599
+ 2490444,
2600
+ 3745356,
2601
+ 12517631,
2602
+ 14647295,
2603
+ 10027212,
2604
+ 11691724,
2605
+ 7471256,
2606
+ 8735896,
2607
+ 6226047,
2608
+ 7290751,
2609
+ 3735628,
2610
+ 4335180,
2611
+ 16711935,
2612
+ 16744447,
2613
+ 13369548,
2614
+ 13395660,
2615
+ 9961624,
2616
+ 9981080,
2617
+ 8323199,
2618
+ 8339327,
2619
+ 4980812,
2620
+ 4990540,
2621
+ 16711871,
2622
+ 16744415,
2623
+ 13369497,
2624
+ 13395634,
2625
+ 9961586,
2626
+ 9981061,
2627
+ 8323167,
2628
+ 8339311,
2629
+ 4980793,
2630
+ 4990530,
2631
+ 16711807,
2632
+ 16744383,
2633
+ 13369446,
2634
+ 13395609,
2635
+ 9961548,
2636
+ 9981042,
2637
+ 8323135,
2638
+ 8339295,
2639
+ 4980774,
2640
+ 4990521,
2641
+ 16711743,
2642
+ 16744351,
2643
+ 13369395,
2644
+ 13395583,
2645
+ 9961510,
2646
+ 9981023,
2647
+ 8323103,
2648
+ 8339279,
2649
+ 4980755,
2650
+ 4990511,
2651
+ 3355443,
2652
+ 5987163,
2653
+ 8684676,
2654
+ 11382189,
2655
+ 14079702,
2656
+ 16777215,
2657
+ 0
2658
+ ];
2659
+ function $(n, t, e) {
2660
+ return Math.max(t, Math.min(e, n));
2661
+ }
2662
+ const j = class j {
2663
+ constructor() {
2664
+ N(this, "_colorIndex");
2665
+ N(this, "_color");
2666
+ N(this, "_colorName");
2667
+ this._colorIndex = 256, this._color = null, this._colorName = null;
2668
+ }
2669
+ get color() {
2670
+ return this._color;
2671
+ }
2672
+ set color(t) {
2673
+ t == null ? this._color = null : (this._color = Math.round($(t, 0, 256 * 256 * 256 - 1)), this._colorIndex = this.getColorIndexByValue(this._color), this._colorName = this.getColorNameByValue(this._color));
2674
+ }
2675
+ get hexColor() {
2676
+ if (this._color && this._color > 0 && this._color <= 16777215) {
2677
+ let t = this._color.toString(16).toUpperCase();
2678
+ for (; t.length < 6; )
2679
+ t = "0" + t;
2680
+ return `0x${t}`;
2681
+ }
2682
+ return "";
2683
+ }
2684
+ get cssColor() {
2685
+ return `rgb(${this.red},${this.green},${this.blue})`;
2686
+ }
2687
+ get red() {
2688
+ return this.color != null ? this.color >> 16 & 255 : null;
2689
+ }
2690
+ get green() {
2691
+ return this.color != null ? this.color >> 8 & 255 : null;
2692
+ }
2693
+ get blue() {
2694
+ return this.color != null ? this.color & 255 : null;
2695
+ }
2696
+ /**
2697
+ * AutoCAD color index value. The index value will be in the range 0 to 256. 0 and 256 are special values.
2698
+ * If value less than 0 is set, 0 will be used. If value greater than 256 is set, 256 will be used.
2699
+ * - 0 indicates that the entity uses the color of the BlockReference that's displaying it. If the entity
2700
+ * is not displayed through a block reference (for example, it is directly owned by the model space
2701
+ * block table record) and its color is 0, then it will display as though its color were 7.
2702
+ * - 256 indicates that the entity uses the color specified in the layer table record it references.
2703
+ */
2704
+ get colorIndex() {
2705
+ return this._colorIndex;
2706
+ }
2707
+ set colorIndex(t) {
2708
+ t == null ? this._colorIndex = null : (this._colorIndex = $(t, 0, 256), this._color = lt[t], this._colorName = this.getColorNameByValue(this._color));
2709
+ }
2710
+ get colorName() {
2711
+ return this._colorName;
2712
+ }
2713
+ set colorName(t) {
2714
+ if (t) {
2715
+ const e = J[t.toLowerCase()];
2716
+ e !== void 0 ? (this._colorName = t, this._color = e, this._colorIndex = this.getColorIndexByValue(this._color)) : console.warn("Unknown color: " + t);
2717
+ } else
2718
+ this._colorName = null;
2719
+ }
2720
+ get hasColorName() {
2721
+ return this._colorName == null;
2722
+ }
2723
+ get hasColorIndex() {
2724
+ return this._colorIndex == null;
2725
+ }
2726
+ get isByLayer() {
2727
+ return this.colorIndex == 256;
2728
+ }
2729
+ setByLayer() {
2730
+ return this.colorIndex = 256, this;
2731
+ }
2732
+ get isByBlock() {
2733
+ return this.colorIndex == 0;
2734
+ }
2735
+ setByBlock() {
2736
+ return this.colorIndex = 0, this;
2737
+ }
2738
+ setScalar(t) {
2739
+ return this.setRGB(t, t, t), this;
2740
+ }
2741
+ setRGB(t, e, a) {
2742
+ const _ = Math.round($(t, 0, 255)), o = Math.round($(e, 0, 255)), i = Math.round($(a, 0, 255));
2743
+ return this.color = (_ << 16) + (o << 8) + i, this;
2744
+ }
2745
+ setColorName(t) {
2746
+ const e = J[t.toLowerCase()];
2747
+ return e !== void 0 ? this.color = e : console.warn("Unknown color " + t), this;
2748
+ }
2749
+ clone() {
2750
+ const t = new j();
2751
+ return t.colorIndex = this.colorIndex, t.color = this.color, t._colorName = this._colorName, this;
2752
+ }
2753
+ copy(t) {
2754
+ return this.colorIndex = t.colorIndex, this.color = t.color, this._colorName = t._colorName, this;
2755
+ }
2756
+ equals(t) {
2757
+ return t.color == this.color && t.colorIndex == this.colorIndex && t._colorName == this._colorName;
2758
+ }
2759
+ toString() {
2760
+ return this.isByLayer ? "ByLayer" : this.isByBlock ? "ByBlock" : this.colorName ? this.colorName : this.hexColor;
2761
+ }
2762
+ getColorNameByValue(t) {
2763
+ for (const [e, a] of Object.entries(J))
2764
+ if (a === t)
2765
+ return e;
2766
+ return null;
2767
+ }
2768
+ getColorIndexByValue(t) {
2769
+ const e = lt.length - 1;
2770
+ for (let a = 1; a < e; ++a)
2771
+ if (lt[a] === t)
2772
+ return a;
2773
+ return null;
2774
+ }
2775
+ };
2776
+ N(j, "NAMES", J);
2777
+ let ut = j;
2778
+ class W {
2779
+ constructor(t, e) {
2780
+ N(this, "x");
2781
+ N(this, "y");
2782
+ this.x = t, this.y = e;
2783
+ }
2784
+ add(t) {
2785
+ return new W(this.x + t.x, this.y + t.y);
2786
+ }
2787
+ sub(t) {
2788
+ return new W(this.x - t.x, this.y - t.y);
2789
+ }
2790
+ multiply(t) {
2791
+ return new W(this.x * t, this.y * t);
2792
+ }
2793
+ length() {
2794
+ return Math.sqrt(this.x ** 2 + this.y ** 2);
2795
+ }
2796
+ norm() {
2797
+ const t = this.length();
2798
+ return t === 0 ? new W(0, 0) : new W(this.x / t, this.y / t);
2799
+ }
2800
+ }
2801
+ function wn(n, t, e, a = 5) {
2802
+ let _, o, i;
2803
+ e < 0 ? (_ = Math.atan(-e) * 4, o = new W(n.x, n.y), i = new W(t.x, t.y)) : (_ = Math.atan(e) * 4, o = new W(t.x, t.y), i = new W(n.x, n.y));
2804
+ const s = i.sub(o), r = s.length(), l = o.add(s.multiply(0.5)), d = Math.abs(r / 2 / Math.tan(_ / 2)), I = s.norm(), c = new W(I.x * Math.cos(Math.PI / 2) - I.y * Math.sin(Math.PI / 2), I.y * Math.cos(Math.PI / 2) + I.x * Math.sin(Math.PI / 2)), E = _ < Math.PI ? l.add(c.multiply(-d)) : l.add(c.multiply(d)), C = Math.atan2(i.y - E.y, i.x - E.x) / Math.PI * 180;
2805
+ let A = Math.atan2(o.y - E.y, o.x - E.x) / Math.PI * 180;
2806
+ A < C && (A += 360);
2807
+ const u = i.sub(E).length(), T = Math.floor(C / a) * a + a, h = Math.ceil(A / a) * a - a, Y = [];
2808
+ for (let R = T; R <= h; R += a) {
2809
+ const f = R / 180 * Math.PI, v = E.add(new W(Math.cos(f) * u, Math.sin(f) * u));
2810
+ Y.push(v);
2811
+ }
2812
+ return e < 0 && Y.reverse(), Y;
2813
+ }
2814
+ function Bn(n, t = !1) {
2815
+ let e = [];
2816
+ const a = n.vertices.map((_) => ({
2817
+ x: _.x,
2818
+ y: _.y,
2819
+ bulge: _.bulge
2820
+ }));
2821
+ t && a.push(a[0]);
2822
+ for (let _ = 0, o = a.length; _ < o - 1; ++_) {
2823
+ const i = a[_], s = a[_ + 1];
2824
+ e.push(i), a[_].bulge && (e = e.concat(wn(i, s, n.vertices[_].bulge))), _ === o - 2 && e.push(s);
2825
+ }
2826
+ return e;
2827
+ }
2828
+ class Fn {
2829
+ constructor() {
2830
+ N(this, "blockMap", /* @__PURE__ */ new Map());
2831
+ }
2832
+ rotate(t, e) {
2833
+ const a = Math.cos(e), _ = Math.sin(e);
2834
+ return {
2835
+ x: t.x * a - t.y * _,
2836
+ y: t.x * _ + t.y * a
2837
+ };
2838
+ }
2839
+ /**
2840
+ * Interpolates a B-spline curve and returns the resulting polyline.
2841
+ *
2842
+ * @param controlPoints The control points of the B-spline.
2843
+ * @param degree The degree of the B-spline.
2844
+ * @param knots The knot vector.
2845
+ * @param interpolationsPerSplineSegment Number of interpolated points per spline segment.
2846
+ * @param weights Optional weight vector for rational B-splines.
2847
+ * @returns An array of interpolated 2D points representing the polyline.
2848
+ */
2849
+ interpolateBSpline(t, e, a, _ = 25, o) {
2850
+ const i = [], s = t.map((d) => [d.x, d.y]), r = [a[e]], l = [
2851
+ a[e],
2852
+ a[a.length - 1 - e]
2853
+ ];
2854
+ for (let d = e + 1; d < a.length - e; ++d)
2855
+ r[r.length - 1] !== a[d] && r.push(a[d]);
2856
+ for (let d = 1; d < r.length; ++d) {
2857
+ const I = r[d - 1], c = r[d];
2858
+ for (let E = 0; E <= _; ++E) {
2859
+ let A = (E / _ * (c - I) + I - l[0]) / (l[1] - l[0]);
2860
+ A = Math.max(0, Math.min(1, A));
2861
+ const u = mn(A, e, s, a, o);
2862
+ i.push({ x: u[0], y: u[1] });
2863
+ }
2864
+ }
2865
+ return i;
2866
+ }
2867
+ addFlipXIfApplicable(t, { bbox: e, element: a }) {
2868
+ return "extrusionDirection" in t && t.extrusionDirection.z === -1 ? {
2869
+ bbox: new D().expandByPoint({ x: -e.min.x, y: e.min.y }).expandByPoint({ x: -e.max.x, y: e.max.y }),
2870
+ element: `<g transform="matrix(-1 0 0 1 0 0)">${a}</g>`
2871
+ } : { bbox: e, element: a };
2872
+ }
2873
+ line(t) {
2874
+ const e = new D().expandByPoint({ x: t.startPoint.x, y: t.startPoint.y }).expandByPoint({ x: t.endPoint.x, y: t.endPoint.y }), a = `<line x1="${t.startPoint.x}" y1="${t.startPoint.y}" x2="${t.endPoint.x}" y2="${t.endPoint.y}" />`;
2875
+ return { bbox: e, element: a };
2876
+ }
2877
+ ray(t) {
2878
+ const a = t.firstPoint, _ = {
2879
+ x: a.x + t.unitDirection.x * 1e4,
2880
+ y: a.y + t.unitDirection.y * 1e4
2881
+ }, o = new D().expandByPoint(a).expandByPoint(_), i = `<line x1="${a.x}" y1="${a.y}" x2="${_.x}" y2="${_.y}" />`;
2882
+ return { bbox: o, element: i };
2883
+ }
2884
+ xline(t) {
2885
+ const a = {
2886
+ x: t.firstPoint.x - t.unitDirection.x * 1e4,
2887
+ y: t.firstPoint.y - t.unitDirection.y * 1e4
2888
+ }, _ = {
2889
+ x: t.firstPoint.x + t.unitDirection.x * 1e4,
2890
+ y: t.firstPoint.y + t.unitDirection.y * 1e4
2891
+ }, o = new D().expandByPoint(a).expandByPoint(_), i = `<line x1="${a.x}" y1="${a.y}" x2="${_.x}" y2="${_.y}" />`;
2892
+ return { bbox: o, element: i };
2893
+ }
2894
+ extractMTextLines(t) {
2895
+ return t.replace(/\\U\+([0-9A-Fa-f]{4})/g, (e, a) => String.fromCharCode(parseInt(a, 16))).replace(/\\P/g, `
2896
+ `).replace(/\\[LOlo]/g, "").replace(/\\[Ff][^;\\]*?(?:\|[^;\\]*)*;/g, "").replace(/\\[KkCcHhWwTtAa][^;\\]*;?/g, "").replace(/\\[a-zA-Z]+;?/g, "").replace(/%%(d|p|c|%)/gi, "").replace(/\\\\/g, "\\").replace(/\\~/g, " ").replace(/[{}]/g, "").split(`
2897
+ `).map((e) => e.trim()).filter((e) => e.length > 0);
2898
+ }
2899
+ lines(t, e, a, _, o = "start") {
2900
+ const i = new D().expandByPoint({
2901
+ x: a.x,
2902
+ y: a.y
2903
+ }).expandByPoint({
2904
+ x: a.x + _,
2905
+ y: a.y - t.length * e * 1.5
2906
+ }), s = t.map((r, l) => {
2907
+ const d = a.x, I = a.y - l * e * 1.5, c = `translate(${d},${I}) scale(1,-1) translate(${-d},${-I})`;
2908
+ return `<text x="${d}" y="${I}" font-size="${e}" text-anchor="${o}" transform="${c}">${r}</text>`;
2909
+ });
2910
+ return { bbox: i, element: s.join(`
2911
+ `) };
2912
+ }
2913
+ mtext(t) {
2914
+ const e = t.textHeight, a = t.insertionPoint, _ = this.extractMTextLines(t.text), o = t.attachmentPoint;
2915
+ let i = "start";
2916
+ return o == m.BottomCenter || o == m.MiddleCenter || o == m.TopCenter ? i = "middle" : (o == m.BottomRight || o == m.MiddleRight || o == m.TopRight) && (i = "end"), this.lines(_, e, a, t.extentsWidth, i);
2917
+ }
2918
+ table(t) {
2919
+ const { rowCount: e, columnCount: a, rowHeightArr: _, columnWidthArr: o, startPoint: i, cells: s } = t, r = i.x, l = i.y, d = [];
2920
+ for (let u = 0, T = l; u < e; u++) {
2921
+ const h = _[u];
2922
+ let Y = r;
2923
+ for (let R = 0; R < a; R++) {
2924
+ const f = u * a + R, v = s[f], G = o[R];
2925
+ d.push({ x: Y, y: T, width: G, height: h, cell: v, row: u, col: R }), Y += G;
2926
+ }
2927
+ T += h;
2928
+ }
2929
+ const I = d.map(({ x: u, y: T, width: h, height: Y, cell: R }) => {
2930
+ const f = [];
2931
+ R.topBorderVisibility && f.push(`<line x1="${u}" y1="${T}" x2="${u + h}" y2="${T}" stroke="black" />`), R.bottomBorderVisibility && f.push(`<line x1="${u}" y1="${T + Y}" x2="${u + h}" y2="${T + Y}" stroke="black" />`), R.leftBorderVisibility && f.push(`<line x1="${u}" y1="${T}" x2="${u}" y2="${T + Y}" stroke="black" />`), R.rightBorderVisibility && f.push(`<line x1="${u + h}" y1="${T}" x2="${u + h}" y2="${T + Y}" stroke="black" />`);
2932
+ const v = u + h / 2, G = T + Y / 2 + R.textHeight / 3, S = `<text x="${v}" y="${G}" font-size="${R.textHeight}" text-anchor="middle" dominant-baseline="middle">${R.text}</text>`;
2933
+ return [...f, S].join(`
2934
+ `);
2935
+ }).join(`
2936
+ `), c = o.reduce((u, T) => u + T, 0), E = _.reduce((u, T) => u + T, 0), C = new D().expandByPoint({ x: r, y: l }).expandByPoint({ x: r + c, y: l + E }), A = `
2937
+ <svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${E}" viewBox="${r} ${l} ${c} ${E}">
2938
+ ${I}
2939
+ </svg>
2940
+ `.trim();
2941
+ return {
2942
+ bbox: C,
2943
+ element: A
2944
+ };
2945
+ }
2946
+ text(t) {
2947
+ const e = t.textHeight, a = t.startPoint, _ = [t.text];
2948
+ let o = t.endPoint.x - t.endPoint.x;
2949
+ t.halign == 0 && (o = t.text.length * e + t.startPoint.x);
2950
+ let i = "start";
2951
+ return t.halign == Q.CENTER ? i = "middle" : t.halign == Q.RIGHT && (i = "end"), this.lines(_, e, a, o, i);
2952
+ }
2953
+ vertices(t, e = !1) {
2954
+ const a = t.reduce((o, i) => o.expandByPoint(i), new D());
2955
+ let _ = t.reduce((o, i, s) => (o += s === 0 ? "M" : "L", o += i.x + "," + i.y, o), "");
2956
+ return e && (_ += "Z"), { bbox: a, element: `<path d="${_}" />` };
2957
+ }
2958
+ circle(t) {
2959
+ const e = new D().expandByPoint({
2960
+ x: t.center.x + t.radius,
2961
+ y: t.center.y + t.radius
2962
+ }).expandByPoint({
2963
+ x: t.center.x - t.radius,
2964
+ y: t.center.y - t.radius
2965
+ }), a = `<circle cx="${t.center.x}" cy="${t.center.y}" r="${t.radius}" />`;
2966
+ return {
2967
+ bbox: e,
2968
+ element: a
2969
+ };
2970
+ }
2971
+ ellipseOrArc(t, e, a, _, o, i, s) {
2972
+ const r = Math.sqrt(a * a + _ * _), l = o * r, d = -Math.atan2(-_, a), I = this.bboxEllipseOrArc(t, e, a, _, o, i, s);
2973
+ if (Math.abs(i - s) < 1e-9 || Math.abs(i - s + Math.PI * 2) < 1e-9) {
2974
+ const c = `<g transform="rotate(${d / Math.PI * 180} ${t}, ${e})"><ellipse cx="${t}" cy="${e}" rx="${r}" ry="${l}" /></g>`;
2975
+ return { bbox: I, element: c };
2976
+ } else {
2977
+ const c = this.rotate({ x: Math.cos(i) * r, y: Math.sin(i) * l }, d), E = { x: t + c.x, y: e + c.y }, C = this.rotate({ x: Math.cos(s) * r, y: Math.sin(s) * l }, d), A = { x: t + C.x, y: e + C.y }, T = (s < i ? s + Math.PI * 2 : s) - i < Math.PI ? 0 : 1, Y = `<path d="${`M ${E.x} ${E.y} A ${r} ${l} ${d / Math.PI * 180} ${T} 1 ${A.x} ${A.y}`}" />`;
2978
+ return { bbox: I, element: Y };
2979
+ }
2980
+ }
2981
+ bboxEllipseOrArc(t, e, a, _, o, i, s) {
2982
+ for (; i < 0; )
2983
+ i += Math.PI * 2;
2984
+ for (; s <= i; )
2985
+ s += Math.PI * 2;
2986
+ const r = [];
2987
+ if (Math.abs(a) < 1e-12 || Math.abs(_) < 1e-12)
2988
+ for (let E = 0; E < 4; E++)
2989
+ r.push(E / 2 * Math.PI);
2990
+ else
2991
+ r[0] = Math.atan(-_ * o / a) - Math.PI, r[1] = Math.atan(a * o / _) - Math.PI, r[2] = r[0] - Math.PI, r[3] = r[1] - Math.PI;
2992
+ for (let E = 4; E >= 0; E--) {
2993
+ for (; r[E] < i; )
2994
+ r[E] += Math.PI * 2;
2995
+ r[E] > s && r.splice(E, 1);
2996
+ }
2997
+ r.push(i), r.push(s);
2998
+ const l = r.map((E) => ({ x: Math.cos(E), y: Math.sin(E) })), d = [
2999
+ [a, -_ * o],
3000
+ [_, a * o]
3001
+ ];
3002
+ return l.map((E) => ({
3003
+ x: E.x * d[0][0] + E.y * d[0][1] + t,
3004
+ y: E.x * d[1][0] + E.y * d[1][1] + e
3005
+ })).reduce((E, C) => (E.expandByPoint(C), E), new D());
3006
+ }
3007
+ ellipse(t) {
3008
+ const { bbox: e, element: a } = this.ellipseOrArc(t.center.x, t.center.y, t.majorAxisEndPoint.x, t.majorAxisEndPoint.y, t.axisRatio, t.startAngle, t.endAngle);
3009
+ return {
3010
+ bbox: e,
3011
+ element: a
3012
+ };
3013
+ }
3014
+ arc(t) {
3015
+ const { bbox: e, element: a } = this.ellipseOrArc(t.center.x, t.center.y, t.radius, 0, 1, t.startAngle, t.endAngle);
3016
+ return {
3017
+ bbox: e,
3018
+ element: a
3019
+ };
3020
+ }
3021
+ dimension(t) {
3022
+ const e = this.blockMap.get(t.name);
3023
+ return e ? {
3024
+ bbox: e.bbox,
3025
+ element: `<use href="#${t.name}" />`
3026
+ } : null;
3027
+ }
3028
+ insert(t) {
3029
+ const e = this.blockMap.get(t.name);
3030
+ if (e) {
3031
+ const a = t.insertionPoint, _ = t.rotation * (180 / Math.PI), o = `translate(${a.x},${a.y}) rotate(${_}) scale(${t.xScale},${t.yScale})`;
3032
+ return {
3033
+ bbox: e.bbox.clone().transform({ x: t.xScale, y: t.yScale }, { x: a.x, y: a.y }).rotate(t.rotation, a),
3034
+ element: `<use href="#${t.name}" transform="${o}" />`
3035
+ };
3036
+ }
3037
+ return null;
3038
+ }
3039
+ block(t, e) {
3040
+ const a = t.entities, { bbox: _, elements: o } = a.reduce((i, s) => {
3041
+ const r = this.entityToBoundsAndElement(s);
3042
+ if (r) {
3043
+ const { bbox: l, element: d } = r;
3044
+ l.valid && (i.bbox.expandByPoint(l.min), i.bbox.expandByPoint(l.max));
3045
+ const I = this.getEntityColor(e.tables.LAYER.entries, s), c = s.type == "TEXT" || s.type == "MTEXT" ? I.cssColor : "none";
3046
+ I.isByBlock ? i.elements.push(`<g id="${s.handle}">${d}</g>`) : i.elements.push(`<g id="${s.handle}" stroke="${I.cssColor}" fill="${c}">${d}</g>`);
3047
+ }
3048
+ return i;
3049
+ }, {
3050
+ bbox: new D(),
3051
+ elements: []
3052
+ });
3053
+ return _.valid ? {
3054
+ bbox: _,
3055
+ element: `<g id="${t.name}">${o.join(`
3056
+ `)}</g>`
3057
+ } : null;
3058
+ }
3059
+ entityToBoundsAndElement(t) {
3060
+ let e = null;
3061
+ switch (t.type) {
3062
+ case "ARC":
3063
+ e = this.arc(t);
3064
+ break;
3065
+ case "CIRCLE":
3066
+ e = this.circle(t);
3067
+ break;
3068
+ case "DIMENSION":
3069
+ e = this.dimension(t);
3070
+ break;
3071
+ case "ELLIPSE":
3072
+ e = this.ellipse(t);
3073
+ break;
3074
+ case "INSERT":
3075
+ e = this.insert(t);
3076
+ break;
3077
+ case "LINE":
3078
+ e = this.line(t);
3079
+ break;
3080
+ case "LWPOLYLINE": {
3081
+ const a = t, _ = !!(a.flag & 512), o = Bn(a, _);
3082
+ e = this.vertices(o, _);
3083
+ break;
3084
+ }
3085
+ case "MTEXT":
3086
+ e = this.mtext(t);
3087
+ break;
3088
+ case "SPLINE": {
3089
+ const a = t;
3090
+ e = this.vertices(this.interpolateBSpline(a.controlPoints, a.degree, a.knots, 25, a.weights));
3091
+ break;
3092
+ }
3093
+ case "POLYLINE":
3094
+ break;
3095
+ case "RAY":
3096
+ e = this.ray(t);
3097
+ break;
3098
+ case "TABLE":
3099
+ e = this.table(t);
3100
+ break;
3101
+ case "TEXT":
3102
+ e = this.text(t);
3103
+ break;
3104
+ case "XLINE":
3105
+ e = this.xline(t);
3106
+ break;
3107
+ default:
3108
+ e = null;
3109
+ break;
3110
+ }
3111
+ return e ? this.addFlipXIfApplicable(t, e) : null;
3112
+ }
3113
+ getEntityColor(t, e) {
3114
+ const a = new ut();
3115
+ if (e.colorIndex != null ? a.colorIndex = e.colorIndex : e.colorName ? a.colorName = e.colorName : e.color != null && (a.color = e.color), a.colorIndex == 7 && (a.colorIndex = 256), a.isByLayer) {
3116
+ const _ = t.find((o) => o.name === e.layer);
3117
+ _ != null && (a.colorIndex = _.colorIndex);
3118
+ }
3119
+ return a.color == null && (a.color = 16777215), a;
3120
+ }
3121
+ convert(t) {
3122
+ let e = null;
3123
+ this.blockMap.clear();
3124
+ let a = "";
3125
+ t.tables.BLOCK_RECORD.entries.forEach((i) => {
3126
+ if (Bt(i.name))
3127
+ e = i;
3128
+ else {
3129
+ const s = this.block(i, t);
3130
+ s && (a += s.element, this.blockMap.set(i.name, s));
3131
+ }
3132
+ });
3133
+ const _ = this.block(e, t), o = _ && _.bbox.valid ? {
3134
+ x: _.bbox.min.x,
3135
+ y: -_.bbox.max.y,
3136
+ width: _.bbox.max.x - _.bbox.min.x,
3137
+ height: _.bbox.max.y - _.bbox.min.y
3138
+ } : {
3139
+ x: 0,
3140
+ y: 0,
3141
+ width: 0,
3142
+ height: 0
3143
+ };
3144
+ return `<?xml version="1.0"?>
3145
+ <svg
3146
+ xmlns="http://www.w3.org/2000/svg"
3147
+ xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
3148
+ preserveAspectRatio="xMinYMin meet"
3149
+ viewBox="${o.x} ${o.y} ${o.width} ${o.height}"
3150
+ width="100%" height="100%"
3151
+ >
3152
+ <defs>${a}</defs>
3153
+ <g stroke="#000000" stroke-width="0.1%" fill="none" transform="matrix(1,0,0,-1,0,0)">
3154
+ ${_ ? _.element : ""}
3155
+ </g>
3156
+ </svg>`;
3157
+ }
3158
+ }
3159
+ var Ot;
3160
+ (function(n) {
3161
+ n[n.BMP = 2] = "BMP", n[n.WMF = 3] = "WMF", n[n.PNG = 6] = "PNG";
3162
+ })(Ot || (Ot = {}));
3163
+ const tt = class tt {
3164
+ constructor(t) {
3165
+ N(this, "wasmInstance");
3166
+ N(this, "decoder");
3167
+ return this.wasmInstance = t, new Proxy(this, {
3168
+ get: (e, a, _) => a in e ? Reflect.get(e, a, _) : Reflect.get(e.wasmInstance, a, _)
3169
+ });
3170
+ }
3171
+ dwg_read_data(t, e) {
3172
+ if (e == ct.DWG) {
3173
+ const a = "tmp.dwg";
3174
+ try {
3175
+ this.wasmInstance.FS.writeFile(a, new Uint8Array(t));
3176
+ const _ = this.wasmInstance.dwg_read_file(a);
3177
+ return _.error != 0 && console.log("Open dwg file with error code: ", _.error), _.data;
3178
+ } finally {
3179
+ this.wasmInstance.FS.analyzePath(a, !1).exists && this.wasmInstance.FS.unlink(a);
3180
+ }
3181
+ }
3182
+ }
3183
+ /**
3184
+ * Converts DWG file content to DXF file content.
3185
+ * @param fileContent DWG file content.
3186
+ * @returns Returns DXF file content if conversion succeeds. Otherwise returns null.
3187
+ */
3188
+ dwg_write_dxf(t) {
3189
+ const e = "tmp.dwg", a = "tmp.dxf";
3190
+ try {
3191
+ this.wasmInstance.FS.writeFile(e, new Uint8Array(t));
3192
+ const _ = this.wasmInstance.dwg_write_dxf(e, a);
3193
+ return _ != 0 ? (console.log("Convert dwg to dxf with error code: ", _), null) : this.wasmInstance.FS.readFile(a);
3194
+ } finally {
3195
+ this.wasmInstance.FS.analyzePath(e, !1).exists && this.wasmInstance.FS.unlink(e), this.wasmInstance.FS.analyzePath(a, !1).exists && this.wasmInstance.FS.unlink(a);
3196
+ }
3197
+ }
3198
+ /**
3199
+ * Gets the version of the dwg.
3200
+ * @param data Pointer to Dwg_Data instance.
3201
+ * @returns Return the version of the dwg
3202
+ */
3203
+ dwg_get_version_type(t) {
3204
+ const e = this.wasmInstance.dwg_get_version_type(t);
3205
+ return Wn[e];
3206
+ }
3207
+ /**
3208
+ * Gets code page of the dwg.
3209
+ * @param data Pointer to Dwg_Data instance.
3210
+ * @returns Return code page of the dwg
3211
+ */
3212
+ dwg_get_codepage(t) {
3213
+ return this.wasmInstance.dwg_get_codepage(t);
3214
+ }
3215
+ /**
3216
+ * Extracts thumbnail image from dwg.
3217
+ * @param data Pointer to Dwg_Data instance.
3218
+ * @returns Return thumbnail image data
3219
+ */
3220
+ dwg_bmp(t) {
3221
+ return this.wasmInstance.dwg_bmp(t);
3222
+ }
3223
+ /**
3224
+ * Returns the number of classes in dwg file.
3225
+ * @param data Pointer to Dwg_Data instance.
3226
+ * @returns Returns the number of classes in dwg file.
3227
+ */
3228
+ dwg_get_num_classes(t) {
3229
+ return this.wasmInstance.dwg_get_num_classes(t);
3230
+ }
3231
+ /**
3232
+ * Returns the nth class in dwg file.
3233
+ * @param data Pointer to Dwg_Data instance.
3234
+ * @param index Index of the class
3235
+ * @returns Returns the nth class in dwg file.
3236
+ */
3237
+ dwg_get_class(t, e) {
3238
+ return this.wasmInstance.dwg_get_class(t, e);
3239
+ }
3240
+ /**
3241
+ * Converts Dwg_Data instance to DwgDatabase instance. DwgDatabase instance doesn't depend on
3242
+ * Dwg_Data instance any more after conversion. So you can call function dwg_free to free memory
3243
+ * occupied by Dwg_Data.
3244
+ * @param data Pointer to Dwg_Data instance.
3245
+ * @returns Returns the converted DwgDatabase.
3246
+ */
3247
+ convert(t) {
3248
+ const e = this.dwg_get_codepage(t), a = At(e);
3249
+ return this.decoder = new TextDecoder(a), new mt(this).convert(t);
3250
+ }
3251
+ /**
3252
+ * Converts Dwg_Data instance to DwgDatabase instance and returns conversion statistics.
3253
+ * DwgDatabase instance doesn't depend on Dwg_Data instance any more after conversion.
3254
+ * So you can call function dwg_free to free memory occupied by Dwg_Data.
3255
+ * @param data Pointer to Dwg_Data instance.
3256
+ * @returns Returns the converted DwgDatabase and conversion statistics.
3257
+ */
3258
+ convertEx(t) {
3259
+ const e = this.dwg_get_codepage(t), a = At(e);
3260
+ this.decoder = new TextDecoder(a);
3261
+ const _ = new mt(this);
3262
+ return {
3263
+ database: _.convert(t),
3264
+ stats: _.getConversionStats()
3265
+ };
3266
+ }
3267
+ /**
3268
+ * Converts DwgDatabase instance to svg string.
3269
+ * @param data DwgDatabase instance.
3270
+ * @returns Returns the converted svg string.
3271
+ */
3272
+ dwg_to_svg(t) {
3273
+ return new Fn().convert(t);
3274
+ }
3275
+ /**
3276
+ * Frees the whole DWG. all tables, sections, objects, ...
3277
+ * @param data Pointer to Dwg_Data instance.
3278
+ */
3279
+ dwg_free(t) {
3280
+ this.wasmInstance.dwg_free(t);
3281
+ }
3282
+ /**
3283
+ * Frees the object (all three structs and its fields)
3284
+ * @group Dwg_Object Methods
3285
+ * @param ptr Pointer to one Dwg_Object instance.
3286
+ */
3287
+ dwg_free_object(t) {
3288
+ this.wasmInstance.dwg_free_object(t);
3289
+ }
3290
+ /**
3291
+ * Gets an object by its handle.
3292
+ * @group Handle Conversion Methods
3293
+ * @param data Pointer to Dwg_Data instance.
3294
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
3295
+ * @returns Returns the object whose handle is equal to the given handle.
3296
+ */
3297
+ dwg_ref_object(t, e) {
3298
+ return this.wasmInstance.dwg_ref_object(t, e);
3299
+ }
3300
+ /**
3301
+ * Gets an object by its handle without warning message.
3302
+ * @group Handle Conversion Methods
3303
+ * @param data Pointer to Dwg_Data instance.
3304
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
3305
+ * @returns Returns the object whose handle is equal to the given handle.
3306
+ */
3307
+ dwg_ref_object_silent(t, e) {
3308
+ return this.wasmInstance.dwg_ref_object_silent(t, e);
3309
+ }
3310
+ /**
3311
+ * Gets an object given its handle and relative base object.
3312
+ * @group Handle Conversion Methods
3313
+ * @param data Pointer to Dwg_Data instance.
3314
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
3315
+ * @param obj_ptr Pointer to the relative base object (Dwg_Object instance).
3316
+ * @returns Returns the object given its handle and relative base object.
3317
+ */
3318
+ dwg_ref_object_relative(t, e, a) {
3319
+ return this.wasmInstance.dwg_ref_object_relative(t, e, a);
3320
+ }
3321
+ /**
3322
+ * Resolves handle absref value to Dwg_Object instance.
3323
+ * @group Handle Conversion Methods
3324
+ * @param data Pointer to Dwg_Data instance.
3325
+ * @param absref Handle absref value.
3326
+ * @returns Returns the object with the given handle absref value.
3327
+ */
3328
+ dwg_resolve_handle(t, e) {
3329
+ return this.wasmInstance.dwg_resolve_handle(t, e);
3330
+ }
3331
+ /**
3332
+ * Resolves handle absref value to Dwg_Object instance without warning message.
3333
+ * @group Handle Conversion Methods
3334
+ * @param data Pointer to Dwg_Data instance.
3335
+ * @param absref Handle absref value.
3336
+ * @returns Returns the object with the given handle absref value.
3337
+ */
3338
+ dwg_resolve_handle_silent(t, e) {
3339
+ return this.wasmInstance.dwg_resolve_handle_silent(t, e);
3340
+ }
3341
+ /**
3342
+ * Sets ref->absolute_ref from the specified obj for a subsequent dwg_resolve_handle
3343
+ * @group Handle Conversion Methods
3344
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
3345
+ * @param obj_ptr Pointer to Dwg_Object instance.
3346
+ * @returns Returns 1 if set absref value correctly. Otherwise, return 0.
3347
+ */
3348
+ dwg_resolve_handleref(t, e) {
3349
+ return this.wasmInstance.dwg_resolve_handleref(t, e);
3350
+ }
3351
+ /**
3352
+ * Returns object (such as line type, layer name, dimension style, and etc.) name by its handle.
3353
+ * @group Handle Conversion Methods
3354
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
3355
+ * @returns Returns object name by its handle.
3356
+ */
3357
+ dwg_ref_get_object_name(t) {
3358
+ const e = this.wasmInstance, a = e.dwg_ref_get_object(t), _ = e.dwg_object_to_object_tio(a);
3359
+ return this.dwg_dynapi_entity_value(_, "name").data;
3360
+ }
3361
+ /**
3362
+ * Converts Dwg_Object_Object instance to Dwg_Object instance.
3363
+ * @group Object Conversion Methods
3364
+ * @param obj_ptr Pointer to Dwg_Object_Object instance.
3365
+ * @returns Returns one pointer to Dwg_Object instance.
3366
+ */
3367
+ dwg_obj_obj_to_object(t) {
3368
+ return this.wasmInstance.dwg_obj_obj_to_object(t);
3369
+ }
3370
+ /**
3371
+ * Converts Dwg_Object_* instance to Dwg_Object instance.
3372
+ * @group Object Conversion Methods
3373
+ * @param obj_generic_ptr Pointer to Dwg_Object_* instance.
3374
+ * @returns Returns one pointer to Dwg_Object instance.
3375
+ */
3376
+ dwg_obj_generic_to_object(t) {
3377
+ return this.wasmInstance.dwg_obj_generic_to_object(t);
3378
+ }
3379
+ /**
3380
+ * Converts Dwg_Object instance to Dwg_Object_Object instance.
3381
+ * @group Object Conversion Methods
3382
+ * @param obj_ptr Pointer to Dwg_Object instance.
3383
+ * @returns Returns one pointer to Dwg_Object_Object instance.
3384
+ */
3385
+ dwg_object_to_object(t) {
3386
+ return this.wasmInstance.dwg_object_to_object(t);
3387
+ }
3388
+ /**
3389
+ * Gets Dwg_Object_* instance (such as Dwg_Entity_LAYER, Dwg_Entity_STYLE, and etc.)
3390
+ * from Dwg_Object instance.
3391
+ * @group Object Conversion Methods
3392
+ * @param obj_ptr Pointer to Dwg_Object instance.
3393
+ * @returns Returns one pointer to Dwg_Object_Object_TIO_Ptr instance.
3394
+ */
3395
+ dwg_object_to_object_tio(t) {
3396
+ return this.wasmInstance.dwg_object_to_object_tio(t);
3397
+ }
3398
+ /**
3399
+ * Converts Dwg_Object instance to Dwg_Object_Entity instance.
3400
+ * @group Object Conversion Methods
3401
+ * @param obj_ptr Pointer to Dwg_Object instance.
3402
+ * @returns Returns one pointer to Dwg_Object_Entity instance.
3403
+ */
3404
+ dwg_object_to_entity(t) {
3405
+ return this.wasmInstance.dwg_object_to_entity(t);
3406
+ }
3407
+ /**
3408
+ * Gets Dwg_Entity_* instance (such as Dwg_Entity_LINE, Dwg_Entity_SPLINE, and etc.)
3409
+ * from Dwg_Object instance.
3410
+ * @group Object Conversion Methods
3411
+ * @param obj_ptr Pointer to Dwg_Object instance.
3412
+ * @returns Returns one pointer to Dwg_Object_Object_TIO_Ptr instance.
3413
+ */
3414
+ dwg_object_to_entity_tio(t) {
3415
+ return this.wasmInstance.dwg_object_to_entity_tio(t);
3416
+ }
3417
+ /**
3418
+ * Returns all of entities in the model space. Each item in returned array
3419
+ * is one Dwg_Object pointer (Dwg_Object*).
3420
+ * @group GetAll Methods
3421
+ * @param data Pointer to Dwg_Data instance.
3422
+ * @returns Returns all of entities in the model space.
3423
+ */
3424
+ dwg_getall_entities_in_model_space(t) {
3425
+ const e = this.wasmInstance, a = e.dwg_model_space_object(t), _ = [];
3426
+ let o = e.get_first_owned_entity(a);
3427
+ for (; o; )
3428
+ _.push(o), o = e.get_next_owned_entity(a, o);
3429
+ return _;
3430
+ }
3431
+ /**
3432
+ * Returns all of objects in Dwg_Data instance with the specified type.
3433
+ * @group GetAll Methods
3434
+ * @param data Pointer to Dwg_Data instance.
3435
+ * @param type Object type.
3436
+ * @returns Returns all of objects with the specified type.
3437
+ */
3438
+ dwg_getall_object_by_type(t, e) {
3439
+ const a = this.wasmInstance, _ = a.dwg_get_num_objects(t), o = [];
3440
+ for (let i = 0; i < _; i++) {
3441
+ const s = a.dwg_get_object(t, i), r = a.dwg_object_to_object_tio(s);
3442
+ r && a.dwg_object_get_fixedtype(s) == e && o.push(r);
3443
+ }
3444
+ return o;
3445
+ }
3446
+ /**
3447
+ * Returns all of objects in Dwg_Data instance with the specified type.
3448
+ * @group GetAll Methods
3449
+ * @param data Pointer to Dwg_Data instance.
3450
+ * @param type Object type.
3451
+ * @returns Returns all of objects with the specified type.
3452
+ */
3453
+ dwg_getall_entity_by_type(t, e) {
3454
+ const a = this.wasmInstance, _ = a.dwg_get_num_objects(t), o = [];
3455
+ for (let i = 0; i < _; i++) {
3456
+ const s = a.dwg_get_object(t, i), r = a.dwg_object_to_entity_tio(s);
3457
+ r && a.dwg_object_get_fixedtype(s) == e && o.push(r);
3458
+ }
3459
+ return o;
3460
+ }
3461
+ /**
3462
+ * Returns all of layer objects in Dwg_Data instance.
3463
+ * @group GetAll Methods
3464
+ * @param data Pointer to Dwg_Data instance.
3465
+ * @returns Returns all of layer objects in Dwg_Data instance.
3466
+ */
3467
+ dwg_getall_LAYER(t) {
3468
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_LAYER);
3469
+ }
3470
+ /**
3471
+ * Returns all of line type objects in Dwg_Data instance.
3472
+ * @group GetAll Methods
3473
+ * @param data Pointer to Dwg_Data instance.
3474
+ * @returns Returns all of line type objects in Dwg_Data instance.
3475
+ */
3476
+ dwg_getall_LTYPE(t) {
3477
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_LTYPE);
3478
+ }
3479
+ /**
3480
+ * Returns all of text style objects in Dwg_Data instance.
3481
+ * @group GetAll Methods
3482
+ * @param data Pointer to Dwg_Data instance.
3483
+ * @returns Returns all of text style objects in Dwg_Data instance.
3484
+ */
3485
+ dwg_getall_STYLE(t) {
3486
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_STYLE);
3487
+ }
3488
+ /**
3489
+ * Returns all of dimension style objects in Dwg_Data instance.
3490
+ * @group GetAll Methods
3491
+ * @param data Pointer to Dwg_Data instance.
3492
+ * @returns Returns all of dimension style objects in Dwg_Data instance.
3493
+ */
3494
+ dwg_getall_DIMSTYLE(t) {
3495
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_DIMSTYLE);
3496
+ }
3497
+ /**
3498
+ * Returns all of viewport objects in Dwg_Data instance.
3499
+ * @group GetAll Methods
3500
+ * @param data Pointer to Dwg_Data instance.
3501
+ * @returns Returns all of viewport objects in Dwg_Data instance.
3502
+ */
3503
+ dwg_getall_VPORT(t) {
3504
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_VPORT);
3505
+ }
3506
+ /**
3507
+ * Returns all of layout objects in Dwg_Data instance.
3508
+ * @group GetAll Methods
3509
+ * @param data Pointer to Dwg_Data instance.
3510
+ * @returns Returns all of layout objects in Dwg_Data instance.
3511
+ */
3512
+ dwg_getall_LAYOUT(t) {
3513
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_LAYOUT);
3514
+ }
3515
+ /**
3516
+ * Returns all of block objects in Dwg_Data instance.
3517
+ * @group GetAll Methods
3518
+ * @param data Pointer to Dwg_Data instance.
3519
+ * @returns Returns all of block objects in Dwg_Data instance.
3520
+ */
3521
+ dwg_getall_BLOCK(t) {
3522
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_BLOCK);
3523
+ }
3524
+ /**
3525
+ * Returns all of block header objects in Dwg_Data instance.
3526
+ * @group GetAll Methods
3527
+ * @param data Pointer to Dwg_Data instance.
3528
+ * @returns Returns all of block header objects in Dwg_Data instance.
3529
+ */
3530
+ dwg_getall_BLOCK_HEADER(t) {
3531
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_BLOCK_HEADER);
3532
+ }
3533
+ /**
3534
+ * Returns all of image definition objects in Dwg_Data instance.
3535
+ * @group GetAll Methods
3536
+ * @param data Pointer to Dwg_Data instance.
3537
+ * @returns Returns all of image definition objects in Dwg_Data instance.
3538
+ */
3539
+ dwg_getall_IMAGEDEF(t) {
3540
+ return this.dwg_getall_object_by_type(t, P.DWG_TYPE_IMAGEDEF);
3541
+ }
3542
+ /**
3543
+ * Returns all of 2d vertex objects in Dwg_Data instance.
3544
+ * @group GetAll Methods
3545
+ * @param data Pointer to Dwg_Data instance.
3546
+ * @returns Returns all of 2d vertex objects in Dwg_Data instance.
3547
+ */
3548
+ dwg_getall_VERTEX_2D(t) {
3549
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_VERTEX_2D);
3550
+ }
3551
+ /**
3552
+ * Returns all of 3d vertex objects in Dwg_Data instance.
3553
+ * @group GetAll Methods
3554
+ * @param data Pointer to Dwg_Data instance.
3555
+ * @returns Returns all of 3d vertex objects in Dwg_Data instance.
3556
+ */
3557
+ dwg_getall_VERTEX_3D(t) {
3558
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_VERTEX_3D);
3559
+ }
3560
+ /**
3561
+ * Returns all of 2d polyline entities in Dwg_Data instance.
3562
+ * @group GetAll Methods
3563
+ * @param data Pointer to Dwg_Data instance.
3564
+ * @returns Returns all of 2d polyline entities in Dwg_Data instance.
3565
+ */
3566
+ dwg_getall_POLYLINE_2D(t) {
3567
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_POLYLINE_2D);
3568
+ }
3569
+ /**
3570
+ * Returns all of 3d polyline entities in Dwg_Data instance.
3571
+ * @group GetAll Methods
3572
+ * @param data Pointer to Dwg_Data instance.
3573
+ * @returns Returns all of 3d polyline entities in Dwg_Data instance.
3574
+ */
3575
+ dwg_getall_POLYLINE_3D(t) {
3576
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_POLYLINE_3D);
3577
+ }
3578
+ /**
3579
+ * Returns all of image entities in Dwg_Data instance.
3580
+ * @group GetAll Methods
3581
+ * @param data Pointer to Dwg_Data instance.
3582
+ * @returns Returns all of image entities in Dwg_Data instance.
3583
+ */
3584
+ dwg_getall_IMAGE(t) {
3585
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_IMAGE);
3586
+ }
3587
+ /**
3588
+ * Returns all of lwpolyline entities in Dwg_Data instance.
3589
+ * @group GetAll Methods
3590
+ * @param data Pointer to Dwg_Data instance.
3591
+ * @returns Returns all of lwpolyline entities in Dwg_Data instance.
3592
+ */
3593
+ dwg_getall_LWPOLYLINE(t) {
3594
+ return this.dwg_getall_entity_by_type(t, P.DWG_TYPE_LWPOLYLINE);
3595
+ }
3596
+ /**
3597
+ * Converts one C++ handle array to one JavaScript Dwg_Object_Ref array.
3598
+ * @group Array Methods
3599
+ * @param ptr Pointer to C++ handle array.
3600
+ * @param size The size of C++ handle array.
3601
+ * @returns Returns one JavaScript Dwg_Object_Ref array from the specified C++ handle array.
3602
+ */
3603
+ dwg_ptr_to_object_ref_array(t, e) {
3604
+ return this.wasmInstance.dwg_ptr_to_object_ref_array(t, e);
3605
+ }
3606
+ /**
3607
+ * Converts one C++ handle array to one JavaScript Dwg_Object_Ref_Ptr array.
3608
+ * @group Array Methods
3609
+ * @param ptr Pointer to C++ handle array.
3610
+ * @param size The size of C++ handle array.
3611
+ * @returns Returns one JavaScript Dwg_Object_Ref_Ptr array from the specified C++ handle array.
3612
+ */
3613
+ dwg_ptr_to_object_ref_ptr_array(t, e) {
3614
+ return this.wasmInstance.dwg_ptr_to_object_ref_ptr_array(t, e);
3615
+ }
3616
+ /**
3617
+ * Converts one C++ wchar_t* array to one JavaScript string array.
3618
+ * @group Array Methods
3619
+ * @param ptr Pointer to C++ wchar_t* array.
3620
+ * @param size The size of C++ wchar_t* array.
3621
+ * @returns Returns one JavaScript string array from the specified C++ wchar_t* array.
3622
+ */
3623
+ dwg_ptr_to_wchar_string_array(t, e) {
3624
+ return this.wasmInstance.dwg_ptr_to_wchar_string_array(t, e);
3625
+ }
3626
+ /**
3627
+ * Converts one C++ unsigned char array to one JavaScript number array.
3628
+ * @group Array Methods
3629
+ * @param ptr Pointer to C++ unsigned char array.
3630
+ * @param size The size of C++ unsigned char array.
3631
+ * @returns Returns one JavaScript number array from the specified C++ unsigned char array.
3632
+ */
3633
+ dwg_ptr_to_unsigned_char_array(t, e) {
3634
+ return this.wasmInstance.dwg_ptr_to_unsigned_char_array(t, e);
3635
+ }
3636
+ /**
3637
+ * Converts one C++ signed char array to one JavaScript number array.
3638
+ * @group Array Methods
3639
+ * @param ptr Pointer to C++ signed char array.
3640
+ * @param size The size of C++ signed char array.
3641
+ * @returns Returns one JavaScript number array from the specified C++ signed char array.
3642
+ */
3643
+ dwg_ptr_to_signed_char_array(t, e) {
3644
+ return this.wasmInstance.dwg_ptr_to_signed_char_array(t, e);
3645
+ }
3646
+ /**
3647
+ * Converts one C++ unsigned int16 array to one JavaScript number array.
3648
+ * @group Array Methods
3649
+ * @param ptr Pointer to C++ unsigned int16 array.
3650
+ * @param size The size of C++ unsigned int16 array.
3651
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int16 array.
3652
+ */
3653
+ dwg_ptr_to_uint16_t_array(t, e) {
3654
+ return this.wasmInstance.dwg_ptr_to_uint16_t_array(t, e);
3655
+ }
3656
+ /**
3657
+ * Converts one C++ int16 array to one JavaScript number array.
3658
+ * @group Array Methods
3659
+ * @param ptr Pointer to C++ int16 array.
3660
+ * @param size The size of C++ int16 array.
3661
+ * @returns Returns one JavaScript number array from the specified C++ int16 array.
3662
+ */
3663
+ dwg_ptr_to_int16_t_array(t, e) {
3664
+ return this.wasmInstance.dwg_ptr_to_int16_t_array(t, e);
3665
+ }
3666
+ /**
3667
+ * Converts one C++ unsigned int32 array to one JavaScript number array.
3668
+ * @group Array Methods
3669
+ * @param ptr Pointer to C++ unsigned int32 array.
3670
+ * @param size The size of C++ unsigned int32 array.
3671
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int32 array.
3672
+ */
3673
+ dwg_ptr_to_uint32_t_array(t, e) {
3674
+ return this.wasmInstance.dwg_ptr_to_uint32_t_array(t, e);
3675
+ }
3676
+ /**
3677
+ * Converts one C++ int32 array to one JavaScript number array.
3678
+ * @group Array Methods
3679
+ * @param ptr Pointer to C++ int32 array.
3680
+ * @param size The size of C++ int32 array.
3681
+ * @returns Returns one JavaScript number array from the specified C++ int32 array.
3682
+ */
3683
+ dwg_ptr_to_int32_t_array(t, e) {
3684
+ return this.wasmInstance.dwg_ptr_to_int32_t_array(t, e);
3685
+ }
3686
+ /**
3687
+ * Converts one C++ unsigned int64 array to one JavaScript number array.
3688
+ * @group Array Methods
3689
+ * @param ptr Pointer to C++ unsigned int64 array.
3690
+ * @param size The size of C++ unsigned int64 array.
3691
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int64 array.
3692
+ */
3693
+ dwg_ptr_to_uint64_t_array(t, e) {
3694
+ return this.wasmInstance.dwg_ptr_to_uint64_t_array(t, e);
3695
+ }
3696
+ /**
3697
+ * Converts one C++ int64 array to one JavaScript number array.
3698
+ * @group Array Methods
3699
+ * @param ptr Pointer to C++ int64 array.
3700
+ * @param size The size of C++ int64 array.
3701
+ * @returns Returns one JavaScript number array from the specified C++ int64 array.
3702
+ */
3703
+ dwg_ptr_to_int64_t_array(t, e) {
3704
+ return this.wasmInstance.dwg_ptr_to_int64_t_array(t, e);
3705
+ }
3706
+ /**
3707
+ * Converts one C++ double array to one JavaScript number array.
3708
+ * @group Array Methods
3709
+ * @param ptr Pointer to C++ double array.
3710
+ * @param size The size of C++ double array.
3711
+ * @returns Returns one JavaScript number array from the specified C++ double array.
3712
+ */
3713
+ dwg_ptr_to_double_array(t, e) {
3714
+ return this.wasmInstance.dwg_ptr_to_double_array(t, e);
3715
+ }
3716
+ /**
3717
+ * Converts one C++ 2d point array to one JavaScript 2d point array.
3718
+ * @group Array Methods
3719
+ * @param ptr Pointer to C++ 2d point array.
3720
+ * @param size The size of C++ 2 point array.
3721
+ * @returns Returns one JavaScript 2d point array from the specified C++ 2d point array.
3722
+ */
3723
+ dwg_ptr_to_point2d_array(t, e) {
3724
+ return this.wasmInstance.dwg_ptr_to_point2d_array(t, e);
3725
+ }
3726
+ /**
3727
+ * Converts one C++ 3d point array to one JavaScript 3d point array.
3728
+ * @group Array Methods
3729
+ * @param ptr Pointer to C++ 3d point array.
3730
+ * @param size The size of C++ 3d point array.
3731
+ * @returns Returns one JavaScript 3d point array from the specified C++ 3d point array.
3732
+ */
3733
+ dwg_ptr_to_point3d_array(t, e) {
3734
+ return this.wasmInstance.dwg_ptr_to_point3d_array(t, e);
3735
+ }
3736
+ /**
3737
+ * Converts one C++ 4d point array to one JavaScript 4d point array.
3738
+ * @group Array Methods
3739
+ * @param ptr Pointer to C++ 4d point array.
3740
+ * @param size The size of C++ 4d point array.
3741
+ * @returns Returns one JavaScript 4d point array from the specified C++ 4d point array.
3742
+ */
3743
+ dwg_ptr_to_point4d_array(t, e) {
3744
+ return this.wasmInstance.dwg_ptr_to_point4d_array(t, e);
3745
+ }
3746
+ /**
3747
+ * Converts one C++ line type array to one JavaScript line type array.
3748
+ * @group Array Methods
3749
+ * @param ptr Pointer to C++ line type array.
3750
+ * @param size The size of C++ line type array.
3751
+ * @returns Returns one JavaScript line type array from the specified C++ line type array.
3752
+ */
3753
+ dwg_ptr_to_ltype_dash_array(t, e) {
3754
+ return this.wasmInstance.dwg_ptr_to_ltype_dash_array(t, e);
3755
+ }
3756
+ /**
3757
+ * Converts one C++ table cell array to one JavaScript table cell array.
3758
+ * @group Array Methods
3759
+ * @group Dwg_Entity_TABLE Methods
3760
+ * @param ptr Pointer to C++ table cell array.
3761
+ * @param size The size of C++ table cell array.
3762
+ * @returns Returns one JavaScript table cell array from the specified C++ table cell array.
3763
+ */
3764
+ dwg_ptr_to_table_cell_array(t, e) {
3765
+ return this.wasmInstance.dwg_ptr_to_table_cell_array(t, e);
3766
+ }
3767
+ /**
3768
+ * Converts one C++ hatch definition line array to one JavaScript hatch definition line array.
3769
+ * @group Array Methods
3770
+ * @group Dwg_Entity_HATCH Methods
3771
+ * @param ptr Pointer to C++ hatch definition line array.
3772
+ * @param size The size of C++ hatch definition line array.
3773
+ * @returns Returns one JavaScript hatch definition line array from the specified C++ hatch definition line array.
3774
+ */
3775
+ dwg_ptr_to_hatch_defline_array(t, e) {
3776
+ return this.wasmInstance.dwg_ptr_to_hatch_defline_array(t, e);
3777
+ }
3778
+ /**
3779
+ * Converts one C++ hatch path array to one JavaScript hatch path array.
3780
+ * @group Array Methods
3781
+ * @group Dwg_Entity_HATCH Methods
3782
+ * @param ptr Pointer to C++ hatch path array.
3783
+ * @param size The size of C++ hatch path array.
3784
+ * @returns Returns one JavaScript hatch path array from the specified C++ hatch path array.
3785
+ */
3786
+ dwg_ptr_to_hatch_path_array(t, e) {
3787
+ return this.wasmInstance.dwg_ptr_to_hatch_path_array(t, e);
3788
+ }
3789
+ /**
3790
+ * Converts one C++ hatch gradient color array to one JavaScript hatch gradient color array.
3791
+ * @group Array Methods
3792
+ * @group Dwg_Entity_HATCH Methods
3793
+ * @param ptr Pointer to C++ hatch gradient color array.
3794
+ * @param size The size of C++ hatch gradient color array.
3795
+ * @returns Returns one JavaScript hatch gradient color array from the specified C++ hatch gradient color array.
3796
+ */
3797
+ dwg_ptr_to_hatch_gradient_color_array(t, e) {
3798
+ return this.wasmInstance.dwg_ptr_to_hatch_gradient_color_array(t, e);
3799
+ }
3800
+ /**
3801
+ * Converts one C++ mline vertex array to one JavaScript mline vertex array.
3802
+ * @group Array Methods
3803
+ * @group Dwg_Entity_MLINE Methods
3804
+ * @param ptr Pointer to C++ mline vertex array.
3805
+ * @param size The size of C++ mline vertex array.
3806
+ * @returns Returns one JavaScript mline vertex array from the specified C++ mline vertex array.
3807
+ */
3808
+ dwg_ptr_to_mline_vertex_array(t, e) {
3809
+ return this.wasmInstance.dwg_ptr_to_mline_vertex_array(t, e);
3810
+ }
3811
+ /**
3812
+ * Generic field value getter. Used to get the field value of one object or entity.
3813
+ * @group Dynamic API Methods
3814
+ * @param obj Pointer to one object or entity
3815
+ * @param field Field name of one object or entity
3816
+ * @returns Returns the field value of one object or entity.
3817
+ */
3818
+ dwg_dynapi_entity_value(t, e) {
3819
+ const a = this.wasmInstance.dwg_dynapi_entity_value(t, e);
3820
+ return a.bin && this.decoder && (a.data = this.decoder.decode(a.bin)), a;
3821
+ }
3822
+ /**
3823
+ * Header field value getter. Used to get the field value of dwg/dxf header.
3824
+ * @group Dynamic API Methods
3825
+ * @param data Pointer to Dwg_Data instance.
3826
+ * @param field Field name of header.
3827
+ * @returns Returns the field value of dwg/dxf header.
3828
+ */
3829
+ dwg_dynapi_header_value(t, e) {
3830
+ return this.wasmInstance.dwg_dynapi_header_value(t, e);
3831
+ }
3832
+ /**
3833
+ * The common field value getter. Used to get the value of object or entity common fields.
3834
+ * @group Dynamic API Methods
3835
+ * @param obj Pointer to one object or entity
3836
+ * @param field The name of object or entity common fields.
3837
+ * @returns Returns the value of object or entity common fields.
3838
+ */
3839
+ dwg_dynapi_common_value(t, e) {
3840
+ return this.wasmInstance.dwg_dynapi_common_value(t, e);
3841
+ }
3842
+ /**
3843
+ * The field of one object or entity may not be primitive type. It means one field may consist of
3844
+ * multiple sub-fields. This method is used to get the sub-field value of those complex field.
3845
+ * @group Dynamic API Methods
3846
+ * @param obj Pointer to one object or entity.
3847
+ * @param subclass The class name of the field with complex type.
3848
+ * @param field The field name of one object or entit.
3849
+ * @returns Returns the sub-field value of one complex field.
3850
+ */
3851
+ dwg_dynapi_subclass_value(t, e, a) {
3852
+ return this.wasmInstance.dwg_dynapi_subclass_value(t, e, a);
3853
+ }
3854
+ /**
3855
+ * Returns the handle of one Dwg_Object instance.
3856
+ * @group Dwg_Object Methods
3857
+ * @param ptr Pointer to one Dwg_Object instance.
3858
+ * @returns Returns the handle of one Dwg_Object instance.
3859
+ */
3860
+ dwg_object_get_handle_object(t) {
3861
+ return this.wasmInstance.dwg_object_get_handle_object(t);
3862
+ }
3863
+ /**
3864
+ * Returns the handle of one Dwg_Object_Object instance.
3865
+ * @group Dwg_Object_Object Methods
3866
+ * @param ptr Pointer to one Dwg_Object_Object instance.
3867
+ * @returns Returns the handle of one Dwg_Object_Object instance.
3868
+ */
3869
+ dwg_object_object_get_handle_object(t) {
3870
+ return this.wasmInstance.dwg_object_object_get_handle_object(t);
3871
+ }
3872
+ /**
3873
+ * Returns the owner handle of one Dwg_Object_Object instance.
3874
+ * @group Dwg_Object_Object Methods
3875
+ * @param ptr Pointer to one Dwg_Object_Object instance.
3876
+ * @returns Returns the owner handle of one Dwg_Object_Object instance.
3877
+ */
3878
+ dwg_object_object_get_ownerhandle_object(t) {
3879
+ return this.wasmInstance.dwg_object_object_get_ownerhandle_object(t);
3880
+ }
3881
+ /**
3882
+ * Returns the handle of one Dwg_Object_Entity instance.
3883
+ * @group Dwg_Object_Entity Methods
3884
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3885
+ * @returns Returns the handle of one Dwg_Object_Entity instance.
3886
+ */
3887
+ dwg_object_entity_get_handle_object(t) {
3888
+ return this.wasmInstance.dwg_object_entity_get_handle_object(t);
3889
+ }
3890
+ /**
3891
+ * Returns the owner handle of one Dwg_Object_Entity instance.
3892
+ * @group Dwg_Object_Entity Methods
3893
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3894
+ * @returns Returns the owner handle of one Dwg_Object_Entity instance.
3895
+ */
3896
+ dwg_object_entity_get_ownerhandle_object(t) {
3897
+ return this.wasmInstance.dwg_object_entity_get_ownerhandle_object(t);
3898
+ }
3899
+ /**
3900
+ * Returns hard-owner ID/handle to owner dictionary of one Dwg_Object_Entity instance.
3901
+ * @group Dwg_Object_Entity Methods
3902
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3903
+ * @returns Returns hard-owner ID/handle to owner dictionary of one Dwg_Object_Entity instance.
3904
+ */
3905
+ dwg_object_entity_get_xdicobjhandle_object(t) {
3906
+ return this.wasmInstance.dwg_object_entity_get_xdicobjhandle_object(t);
3907
+ }
3908
+ /**
3909
+ * Returns the layer handle of one Dwg_Object_Entity instance.
3910
+ * @group Dwg_Object_Entity Methods
3911
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3912
+ * @returns Returns the layer handle of one Dwg_Object_Entity instance.
3913
+ */
3914
+ dwg_object_entity_get_layer_object_ref(t) {
3915
+ return this.wasmInstance.dwg_object_entity_get_layer_object_ref(t);
3916
+ }
3917
+ /**
3918
+ * Returns the line type handle of one Dwg_Object_Entity instance.
3919
+ * @group Dwg_Object_Entity Methods
3920
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3921
+ * @returns Returns the line type handle of one Dwg_Object_Entity instance.
3922
+ */
3923
+ dwg_object_entity_get_ltype_object_ref(t) {
3924
+ return this.wasmInstance.dwg_object_entity_get_ltype_object_ref(t);
3925
+ }
3926
+ /**
3927
+ * Returns color value of one Dwg_Object_Entity instance.
3928
+ * @group Dwg_Object_Entity Methods
3929
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3930
+ * @returns Returns color value of one Dwg_Object_Entity instance.
3931
+ */
3932
+ dwg_object_entity_get_color_object(t) {
3933
+ return this.wasmInstance.dwg_object_entity_get_color_object(t);
3934
+ }
3935
+ /**
3936
+ * Returns xdata of one Dwg_Object_Entity instance.
3937
+ * @group Dwg_Object_Entity Methods
3938
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3939
+ * @returns Returns xdata of one Dwg_Object_Entity instance.
3940
+ */
3941
+ dwg_object_entity_get_xdata(t) {
3942
+ return this.wasmInstance.dwg_object_entity_get_xdata(t);
3943
+ }
3944
+ /**
3945
+ * Returns pointer to BLOCK_HEADER owner for generic entity from ent->ownerhandle.
3946
+ * @group Dwg_Object_Entity Methods
3947
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
3948
+ * @returns Returns pointer to BLOCK_HEADER owner.
3949
+ */
3950
+ dwg_entity_owner(t) {
3951
+ return this.wasmInstance.dwg_entity_owner(t);
3952
+ }
3953
+ /**
3954
+ * Returns block name of one Dwg_Entity_* instance with one block field. For example,
3955
+ * dimension entities have one 'block' field which represents the block that contains
3956
+ * the entities that make up the dimension picture.
3957
+ * @group Dwg_Entity_* Methods
3958
+ * @param ptr Pointer to one Dwg_Entity_* instance with one block field.
3959
+ * @param field Field name of the block.
3960
+ * @returns Returns block name of one Dwg_Entity_* instance.
3961
+ */
3962
+ dwg_entity_get_block_name(t, e) {
3963
+ const a = this.wasmInstance, _ = a.dwg_dynapi_entity_value(t, e).data, o = a.dwg_ref_get_object(_), i = a.dwg_object_to_object_tio(o);
3964
+ return this.dwg_entity_block_header_get_block(i).name;
3965
+ }
3966
+ /**
3967
+ * Returns dimension style name of one Dwg_Entity_* instance with one dimension style
3968
+ * field.
3969
+ * @group Dwg_Entity_* Methods
3970
+ * @param ptr Pointer to one Dwg_Entity_* instance.
3971
+ * @param field Field name of the dimension style.
3972
+ * @returns Returns dimension style name of one Dwg_Entity_* instance.
3973
+ */
3974
+ dwg_entity_get_dimstyle_name(t, e = "dimstyle") {
3975
+ const a = this.wasmInstance, _ = a.dwg_dynapi_entity_value(t, e).data, o = a.dwg_ref_get_object(_), i = a.dwg_object_to_object_tio(o);
3976
+ return this.dwg_dynapi_entity_value(i, "name").data;
3977
+ }
3978
+ /**
3979
+ * Returns block entity pointed by the specified block header.
3980
+ * @group Dwg_Entity_BLOCK_HEADER Methods
3981
+ * @param ptr Pointer to one Dwg_Entity_BLOCK_HEADER instance.
3982
+ * @returns Returns block entity pointed by the specified block header.
3983
+ */
3984
+ dwg_entity_block_header_get_block(t) {
3985
+ const e = this.wasmInstance, a = e.dwg_dynapi_entity_value(t, "block_entity").data, _ = e.dwg_ref_get_object(a), o = e.dwg_object_to_entity_tio(_), i = e.dwg_dynapi_entity_value(o, "name").data, s = e.dwg_dynapi_entity_value(o, "base_pt").data;
3986
+ return {
3987
+ name: i,
3988
+ base_pt: s
3989
+ // preR13 only
3990
+ };
3991
+ }
3992
+ /**
3993
+ * Returns preview image of the block pointed by the specified block header.
3994
+ * @group Dwg_Entity_BLOCK_HEADER Methods
3995
+ * @param ptr Pointer to one Dwg_Entity_BLOCK_HEADER instance.
3996
+ * @returns Returns preview image of the block pointed by the specified block header.
3997
+ */
3998
+ dwg_entity_block_header_get_preview(t) {
3999
+ return this.wasmInstance.dwg_entity_block_header_get_preview(t).data;
4000
+ }
4001
+ /**
4002
+ * Returns the first entity owned by the block header or null
4003
+ * @group Dwg_Entity_BLOCK_HEADER Methods
4004
+ * @param ptr Pointer to the block header.
4005
+ * @returns Returns the first entity owned by the block header or null
4006
+ */
4007
+ get_first_owned_entity(t) {
4008
+ return this.wasmInstance.get_first_owned_entity(t);
4009
+ }
4010
+ /**
4011
+ * Returns the next entity owned by the block header or null.
4012
+ * @group Dwg_Entity_BLOCK_HEADER Methods
4013
+ * @param ptr Pointer to the block header.
4014
+ * @param current Pointer to the current entity in the block header.
4015
+ * @returns Returns the next entity owned by the block header or null.
4016
+ */
4017
+ get_next_owned_entity(t, e) {
4018
+ return this.wasmInstance.get_next_owned_entity(t, e);
4019
+ }
4020
+ /**
4021
+ * Returns text style name of one Dwg_Entity_MTEXT instance.
4022
+ * @group Dwg_Entity_MTEXT Methods
4023
+ * @param ptr Pointer to one Dwg_Entity_MTEXT instance.
4024
+ * @returns Returns text style name of one Dwg_Entity_MTEXT instance.
4025
+ */
4026
+ dwg_entity_mtext_get_style_name(t) {
4027
+ const e = this.wasmInstance, a = e.dwg_dynapi_entity_value(t, "style").data, _ = e.dwg_ref_get_object(a), o = e.dwg_object_to_object_tio(_);
4028
+ return e.dwg_dynapi_entity_value(o, "name").data;
4029
+ }
4030
+ /**
4031
+ * Returns text style name of one Dwg_Entity_TEXT instance.
4032
+ * @group Dwg_Entity_TEXT Methods
4033
+ * @param ptr Pointer to one Dwg_Entity_TEXT instance.
4034
+ * @returns Returns text style name of one Dwg_Entity_TEXT instance.
4035
+ */
4036
+ dwg_entity_text_get_style_name(t) {
4037
+ return this.dwg_entity_mtext_get_style_name(t);
4038
+ }
4039
+ /**
4040
+ * Returns the number of points in Dwg_Entity_POLYLINE_2D.
4041
+ * @group Dwg_Entity_POLYLINE_2D Methods
4042
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
4043
+ * @returns Returns the number of points in one Dwg_Entity_POLYLINE_2D.
4044
+ */
4045
+ dwg_entity_polyline_2d_get_numpoints(t) {
4046
+ return this.wasmInstance.dwg_entity_polyline_2d_get_numpoints(t).data;
4047
+ }
4048
+ /**
4049
+ * Returns points in Dwg_Entity_POLYLINE_2D.
4050
+ * @group Dwg_Entity_POLYLINE_2D Methods
4051
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
4052
+ * @returns Returns points in one Dwg_Entity_POLYLINE_2D.
4053
+ */
4054
+ dwg_entity_polyline_2d_get_points(t) {
4055
+ return this.wasmInstance.dwg_entity_polyline_2d_get_points(t).data;
4056
+ }
4057
+ /**
4058
+ * Returns vertices in Dwg_Entity_POLYLINE_2D.
4059
+ * @group Dwg_Entity_POLYLINE_2D Methods
4060
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
4061
+ * @returns Returns vertices in one Dwg_Entity_POLYLINE_2D.
4062
+ */
4063
+ dwg_entity_polyline_2d_get_vertices(t) {
4064
+ return this.wasmInstance.dwg_entity_polyline_2d_get_vertices(t).data;
4065
+ }
4066
+ /**
4067
+ * Returns the number of points in Dwg_Entity_POLYLINE_3D.
4068
+ * @group Dwg_Entity_POLYLINE_3D Methods
4069
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
4070
+ * @returns Returns the number of points in one Dwg_Entity_POLYLINE_3D.
4071
+ */
4072
+ dwg_entity_polyline_3d_get_numpoints(t) {
4073
+ return this.wasmInstance.dwg_entity_polyline_3d_get_numpoints(t).data;
4074
+ }
4075
+ /**
4076
+ * Returns points in Dwg_Entity_POLYLINE_3D.
4077
+ * @group Dwg_Entity_POLYLINE_3D Methods
4078
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
4079
+ * @returns Returns points in one Dwg_Entity_POLYLINE_3D.
4080
+ */
4081
+ dwg_entity_polyline_3d_get_points(t) {
4082
+ return this.wasmInstance.dwg_entity_polyline_3d_get_points(t).data;
4083
+ }
4084
+ /**
4085
+ * Returns vertices in Dwg_Entity_POLYLINE_3D.
4086
+ * @group Dwg_Entity_POLYLINE_3D Methods
4087
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
4088
+ * @returns Returns vertices in one Dwg_Entity_POLYLINE_3D.
4089
+ */
4090
+ dwg_entity_polyline_3d_get_vertices(t) {
4091
+ return this.wasmInstance.dwg_entity_polyline_3d_get_vertices(t).data;
4092
+ }
4093
+ /**
4094
+ * Returns attributes associated with INSERT entity.
4095
+ * @group Dwg_Entity_INSERT Methods
4096
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_INSERT) instance.
4097
+ * @returns Returns attributes associated with INSERT entity.
4098
+ */
4099
+ dwg_entity_insert_get_attribs(t) {
4100
+ return this.wasmInstance.dwg_entity_insert_get_attribs(t).data;
4101
+ }
4102
+ /**
4103
+ * Returns texts in Dwg_Object_DICTIONARY.
4104
+ * @group Dwg_Object_DICTIONARY Methods
4105
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Object_DICTIONARY) instance.
4106
+ * @returns Returns texts in one Dwg_Object_DICTIONARY.
4107
+ */
4108
+ dwg_object_dictionary_get_texts(t) {
4109
+ return this.wasmInstance.dwg_object_dictionary_get_texts(t).data;
4110
+ }
4111
+ static createByWasmInstance(t) {
4112
+ return this.instance == null ? new tt(t) : this.instance;
4113
+ }
4114
+ static async create(t) {
4115
+ const e = t == null ? await yt() : await yt({
4116
+ locateFile: (a) => `${t}/${a}`
4117
+ });
4118
+ return this.createByWasmInstance(e);
4119
+ }
4120
+ };
4121
+ N(tt, "instance");
4122
+ let wt = tt;
4123
+ export {
4124
+ m as DwgAttachmentPoint,
4125
+ F as DwgBoundaryPathEdgeType,
4126
+ Nt as DwgBoundaryPathTypeFlag,
4127
+ It as DwgCodePage,
4128
+ gt as DwgDictionaryCloningFlags,
4129
+ Rt as DwgDimensionTextHorizontal,
4130
+ Tt as DwgDimensionTextLineSpacing,
4131
+ Ct as DwgDimensionTextVertical,
4132
+ ft as DwgDimensionToleranceTextVertical,
4133
+ Pt as DwgDimensionType,
4134
+ ht as DwgDimensionZeroSuppression,
4135
+ Yt as DwgDimensionZeroSuppressionAngular,
4136
+ Z as DwgHatchAssociativity,
4137
+ St as DwgHatchBoundaryAnnotation,
4138
+ q as DwgHatchGradientColorFlag,
4139
+ Et as DwgHatchGradientFlag,
4140
+ Lt as DwgHatchPatternType,
4141
+ z as DwgHatchSolidFill,
4142
+ vt as DwgHatchStyle,
4143
+ Gt as DwgPolylineFlag,
4144
+ Dt as DwgSmoothType,
4145
+ Wt as DwgTextGenerationFlag,
4146
+ Q as DwgTextHorizontalAlign,
4147
+ Mt as DwgTextVerticalAlign,
4148
+ Ot as DwgThumbnailImageType,
4149
+ pt as Dwg_Color_Method,
4150
+ ct as Dwg_File_Type,
4151
+ U as Dwg_Hatch_Edge_Type,
4152
+ xt as Dwg_Object_Supertype,
4153
+ P as Dwg_Object_Type,
4154
+ bn as Dwg_Object_Type_Inverted,
4155
+ Dn as HEADER_VARIABLES,
4156
+ wt as LibreDwg,
4157
+ yt as createModule,
4158
+ At as dwgCodePageToEncoding,
4159
+ Wn as dwgVersions
4160
+ };
4161
+ //# sourceMappingURL=index-C365l3i9.js.map