zmdms-webui 1.9.5 → 1.9.6

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 (656) hide show
  1. package/dist/es/_virtual/_commonjs-dynamic-modules.js +5 -0
  2. package/dist/es/_virtual/_commonjsHelpers.js +1 -29
  3. package/dist/es/_virtual/exceljs.min.js +3 -0
  4. package/dist/es/node_modules/exceljs/dist/exceljs.min.js +44 -0
  5. package/dist/es/table/excel.js +5 -115
  6. package/package.json +2 -1
  7. package/dist/es/_virtual/BigInteger.js +0 -3
  8. package/dist/es/_virtual/BufferList.js +0 -3
  9. package/dist/es/_virtual/ColumnFormatter.js +0 -3
  10. package/dist/es/_virtual/ColumnParser.js +0 -3
  11. package/dist/es/_virtual/CsvFormatterStream.js +0 -3
  12. package/dist/es/_virtual/CsvParserStream.js +0 -3
  13. package/dist/es/_virtual/FieldFormatter.js +0 -3
  14. package/dist/es/_virtual/FormatterOptions.js +0 -3
  15. package/dist/es/_virtual/HeaderTransformer.js +0 -3
  16. package/dist/es/_virtual/NonQuotedColumnParser.js +0 -3
  17. package/dist/es/_virtual/Parser.js +0 -3
  18. package/dist/es/_virtual/ParserOptions.js +0 -3
  19. package/dist/es/_virtual/QuotedColumnParser.js +0 -3
  20. package/dist/es/_virtual/RowFormatter.js +0 -3
  21. package/dist/es/_virtual/RowParser.js +0 -3
  22. package/dist/es/_virtual/RowTransformerValidator.js +0 -3
  23. package/dist/es/_virtual/Scanner.js +0 -3
  24. package/dist/es/_virtual/Token.js +0 -3
  25. package/dist/es/_virtual/archive-entry.js +0 -3
  26. package/dist/es/_virtual/archive-output-stream.js +0 -3
  27. package/dist/es/_virtual/async.js +0 -6
  28. package/dist/es/_virtual/async2.js +0 -3
  29. package/dist/es/_virtual/base64.js +0 -3
  30. package/dist/es/_virtual/bl.js +0 -3
  31. package/dist/es/_virtual/browser-buffer-decode.js +0 -3
  32. package/dist/es/_virtual/browser-buffer-encode.js +0 -3
  33. package/dist/es/_virtual/comment-xform.js +0 -3
  34. package/dist/es/_virtual/comments-xform.js +0 -3
  35. package/dist/es/_virtual/common.js +0 -3
  36. package/dist/es/_virtual/common2.js +0 -3
  37. package/dist/es/_virtual/compressions.js +0 -3
  38. package/dist/es/_virtual/copy-style.js +0 -3
  39. package/dist/es/_virtual/crc32.js +0 -3
  40. package/dist/es/_virtual/defaults.js +0 -3
  41. package/dist/es/_virtual/deflate.js +0 -3
  42. package/dist/es/_virtual/deflate2.js +0 -3
  43. package/dist/es/_virtual/ed2.js +0 -3
  44. package/dist/es/_virtual/ed3.js +0 -3
  45. package/dist/es/_virtual/ed5.js +0 -3
  46. package/dist/es/_virtual/error.js +0 -3
  47. package/dist/es/_virtual/errors.js +0 -3
  48. package/dist/es/_virtual/errors2.js +0 -3
  49. package/dist/es/_virtual/errors3.js +0 -3
  50. package/dist/es/_virtual/errors4.js +0 -3
  51. package/dist/es/_virtual/errors5.js +0 -3
  52. package/dist/es/_virtual/errors6.js +0 -3
  53. package/dist/es/_virtual/errors7.js +0 -3
  54. package/dist/es/_virtual/es5.js +0 -3
  55. package/dist/es/_virtual/file.js +0 -3
  56. package/dist/es/_virtual/file2.js +0 -3
  57. package/dist/es/_virtual/flate.js +0 -3
  58. package/dist/es/_virtual/fstream.js +0 -3
  59. package/dist/es/_virtual/general-purpose-bit.js +0 -3
  60. package/dist/es/_virtual/headers.js +0 -3
  61. package/dist/es/_virtual/index10.js +0 -3
  62. package/dist/es/_virtual/index11.js +0 -3
  63. package/dist/es/_virtual/index12.js +0 -3
  64. package/dist/es/_virtual/index13.js +0 -3
  65. package/dist/es/_virtual/index14.js +0 -3
  66. package/dist/es/_virtual/index15.js +0 -3
  67. package/dist/es/_virtual/index16.js +0 -6
  68. package/dist/es/_virtual/index17.js +0 -3
  69. package/dist/es/_virtual/index18.js +0 -3
  70. package/dist/es/_virtual/index19.js +0 -3
  71. package/dist/es/_virtual/index20.js +0 -3
  72. package/dist/es/_virtual/index21.js +0 -3
  73. package/dist/es/_virtual/index22.js +0 -3
  74. package/dist/es/_virtual/index23.js +0 -3
  75. package/dist/es/_virtual/index24.js +0 -3
  76. package/dist/es/_virtual/index25.js +0 -3
  77. package/dist/es/_virtual/index26.js +0 -3
  78. package/dist/es/_virtual/index4.js +0 -3
  79. package/dist/es/_virtual/index5.js +0 -3
  80. package/dist/es/_virtual/index6.js +0 -3
  81. package/dist/es/_virtual/index7.js +0 -3
  82. package/dist/es/_virtual/index8.js +0 -3
  83. package/dist/es/_virtual/index9.js +0 -3
  84. package/dist/es/_virtual/inflate.js +0 -3
  85. package/dist/es/_virtual/inflate2.js +0 -3
  86. package/dist/es/_virtual/inherits.js +0 -3
  87. package/dist/es/_virtual/inherits_browser.js +0 -3
  88. package/dist/es/_virtual/old.js +0 -3
  89. package/dist/es/_virtual/once.js +0 -3
  90. package/dist/es/_virtual/promise.js +0 -3
  91. package/dist/es/_virtual/readable.js +0 -3
  92. package/dist/es/_virtual/readable2.js +0 -3
  93. package/dist/es/_virtual/readable3.js +0 -3
  94. package/dist/es/_virtual/readable4.js +0 -3
  95. package/dist/es/_virtual/readable5.js +0 -3
  96. package/dist/es/_virtual/readable6.js +0 -3
  97. package/dist/es/_virtual/readable7.js +0 -3
  98. package/dist/es/_virtual/readable8.js +0 -3
  99. package/dist/es/_virtual/saxes.js +0 -3
  100. package/dist/es/_virtual/signature.js +0 -3
  101. package/dist/es/_virtual/string_decoder.js +0 -3
  102. package/dist/es/_virtual/string_decoder2.js +0 -3
  103. package/dist/es/_virtual/string_decoder3.js +0 -3
  104. package/dist/es/_virtual/string_decoder4.js +0 -3
  105. package/dist/es/_virtual/string_decoder5.js +0 -3
  106. package/dist/es/_virtual/string_decoder6.js +0 -3
  107. package/dist/es/_virtual/string_decoder7.js +0 -3
  108. package/dist/es/_virtual/string_decoder8.js +0 -3
  109. package/dist/es/_virtual/strings.js +0 -3
  110. package/dist/es/_virtual/support.js +0 -3
  111. package/dist/es/_virtual/tmp.js +0 -3
  112. package/dist/es/_virtual/trees.js +0 -3
  113. package/dist/es/_virtual/types.js +0 -3
  114. package/dist/es/_virtual/types2.js +0 -3
  115. package/dist/es/_virtual/unzip.js +0 -3
  116. package/dist/es/_virtual/utf8.js +0 -3
  117. package/dist/es/_virtual/util.js +0 -3
  118. package/dist/es/_virtual/util2.js +0 -3
  119. package/dist/es/_virtual/utils.js +0 -3
  120. package/dist/es/_virtual/zip-archive-entry.js +0 -3
  121. package/dist/es/_virtual/zip-archive-output-stream.js +0 -3
  122. package/dist/es/node_modules/@fast-csv/format/build/src/CsvFormatterStream.js +0 -68
  123. package/dist/es/node_modules/@fast-csv/format/build/src/FormatterOptions.js +0 -40
  124. package/dist/es/node_modules/@fast-csv/format/build/src/formatter/FieldFormatter.js +0 -64
  125. package/dist/es/node_modules/@fast-csv/format/build/src/formatter/RowFormatter.js +0 -177
  126. package/dist/es/node_modules/@fast-csv/format/build/src/formatter/index.js +0 -15
  127. package/dist/es/node_modules/@fast-csv/format/build/src/index.js +0 -81
  128. package/dist/es/node_modules/@fast-csv/format/build/src/types.js +0 -8
  129. package/dist/es/node_modules/@fast-csv/parse/build/src/CsvParserStream.js +0 -220
  130. package/dist/es/node_modules/@fast-csv/parse/build/src/ParserOptions.js +0 -52
  131. package/dist/es/node_modules/@fast-csv/parse/build/src/index.js +0 -56
  132. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/Parser.js +0 -84
  133. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/RowParser.js +0 -82
  134. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/Scanner.js +0 -86
  135. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/Token.js +0 -33
  136. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/column/ColumnFormatter.js +0 -23
  137. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/column/ColumnParser.js +0 -31
  138. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/column/NonQuotedColumnParser.js +0 -35
  139. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/column/QuotedColumnParser.js +0 -103
  140. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/column/index.js +0 -23
  141. package/dist/es/node_modules/@fast-csv/parse/build/src/parser/index.js +0 -29
  142. package/dist/es/node_modules/@fast-csv/parse/build/src/transforms/HeaderTransformer.js +0 -122
  143. package/dist/es/node_modules/@fast-csv/parse/build/src/transforms/RowTransformerValidator.js +0 -99
  144. package/dist/es/node_modules/@fast-csv/parse/build/src/transforms/index.js +0 -15
  145. package/dist/es/node_modules/@fast-csv/parse/build/src/types.js +0 -8
  146. package/dist/es/node_modules/archiver/index.js +0 -92
  147. package/dist/es/node_modules/archiver/lib/core.js +0 -930
  148. package/dist/es/node_modules/archiver/lib/error.js +0 -49
  149. package/dist/es/node_modules/archiver/lib/plugins/json.js +0 -113
  150. package/dist/es/node_modules/archiver/lib/plugins/tar.js +0 -148
  151. package/dist/es/node_modules/archiver/lib/plugins/zip.js +0 -93
  152. package/dist/es/node_modules/archiver/node_modules/readable-stream/errors.js +0 -126
  153. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  154. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  155. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  156. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  157. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  158. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  159. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  160. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  161. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  162. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  163. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  164. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  165. package/dist/es/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  166. package/dist/es/node_modules/archiver/node_modules/readable-stream/readable.js +0 -32
  167. package/dist/es/node_modules/archiver/node_modules/string_decoder/lib/string_decoder.js +0 -285
  168. package/dist/es/node_modules/archiver-utils/file.js +0 -222
  169. package/dist/es/node_modules/archiver-utils/index.js +0 -165
  170. package/dist/es/node_modules/async/dist/async.js +0 -5948
  171. package/dist/es/node_modules/balanced-match/index.js +0 -63
  172. package/dist/es/node_modules/big-integer/BigInteger.js +0 -1453
  173. package/dist/es/node_modules/binary/index.js +0 -409
  174. package/dist/es/node_modules/binary/lib/vars.js +0 -30
  175. package/dist/es/node_modules/bl/BufferList.js +0 -398
  176. package/dist/es/node_modules/bl/bl.js +0 -91
  177. package/dist/es/node_modules/bl/node_modules/readable-stream/errors.js +0 -126
  178. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  179. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  180. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  181. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  182. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  183. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  184. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  185. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  186. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  187. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  188. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  189. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  190. package/dist/es/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  191. package/dist/es/node_modules/bl/node_modules/readable-stream/readable.js +0 -32
  192. package/dist/es/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js +0 -285
  193. package/dist/es/node_modules/brace-expansion/index.js +0 -206
  194. package/dist/es/node_modules/buffer-crc32/index.js +0 -115
  195. package/dist/es/node_modules/buffer-indexof-polyfill/index.js +0 -74
  196. package/dist/es/node_modules/buffer-indexof-polyfill/init-buffer.js +0 -10
  197. package/dist/es/node_modules/buffers/index.js +0 -268
  198. package/dist/es/node_modules/chainsaw/index.js +0 -149
  199. package/dist/es/node_modules/compress-commons/lib/archivers/archive-entry.js +0 -23
  200. package/dist/es/node_modules/compress-commons/lib/archivers/archive-output-stream.js +0 -128
  201. package/dist/es/node_modules/compress-commons/lib/archivers/zip/constants.js +0 -74
  202. package/dist/es/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js +0 -109
  203. package/dist/es/node_modules/compress-commons/lib/archivers/zip/unix-stat.js +0 -56
  204. package/dist/es/node_modules/compress-commons/lib/archivers/zip/util.js +0 -81
  205. package/dist/es/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js +0 -427
  206. package/dist/es/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js +0 -453
  207. package/dist/es/node_modules/compress-commons/lib/compress-commons.js +0 -21
  208. package/dist/es/node_modules/compress-commons/lib/util/index.js +0 -39
  209. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/errors.js +0 -126
  210. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  211. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  212. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  213. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  214. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  215. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  216. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  217. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  218. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  219. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  220. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  221. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  222. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  223. package/dist/es/node_modules/compress-commons/node_modules/readable-stream/readable.js +0 -32
  224. package/dist/es/node_modules/compress-commons/node_modules/string_decoder/lib/string_decoder.js +0 -285
  225. package/dist/es/node_modules/concat-map/index.js +0 -15
  226. package/dist/es/node_modules/core-util-is/lib/util.js +0 -119
  227. package/dist/es/node_modules/crc-32/crc32.js +0 -109
  228. package/dist/es/node_modules/crc32-stream/lib/crc32-stream.js +0 -52
  229. package/dist/es/node_modules/crc32-stream/lib/deflate-crc32-stream.js +0 -66
  230. package/dist/es/node_modules/crc32-stream/lib/index.js +0 -17
  231. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/errors.js +0 -126
  232. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  233. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  234. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  235. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  236. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  237. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  238. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  239. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  240. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  241. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  242. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  243. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  244. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  245. package/dist/es/node_modules/crc32-stream/node_modules/readable-stream/readable.js +0 -32
  246. package/dist/es/node_modules/crc32-stream/node_modules/string_decoder/lib/string_decoder.js +0 -285
  247. package/dist/es/node_modules/duplexer2/index.js +0 -81
  248. package/dist/es/node_modules/end-of-stream/index.js +0 -98
  249. package/dist/es/node_modules/exceljs/excel.js +0 -20
  250. package/dist/es/node_modules/exceljs/lib/csv/csv.js +0 -202
  251. package/dist/es/node_modules/exceljs/lib/doc/anchor.js +0 -93
  252. package/dist/es/node_modules/exceljs/lib/doc/cell.js +0 -1133
  253. package/dist/es/node_modules/exceljs/lib/doc/column.js +0 -324
  254. package/dist/es/node_modules/exceljs/lib/doc/data-validations.js +0 -21
  255. package/dist/es/node_modules/exceljs/lib/doc/defined-names.js +0 -201
  256. package/dist/es/node_modules/exceljs/lib/doc/enums.js +0 -48
  257. package/dist/es/node_modules/exceljs/lib/doc/image.js +0 -64
  258. package/dist/es/node_modules/exceljs/lib/doc/modelcontainer.js +0 -20
  259. package/dist/es/node_modules/exceljs/lib/doc/note.js +0 -69
  260. package/dist/es/node_modules/exceljs/lib/doc/range.js +0 -261
  261. package/dist/es/node_modules/exceljs/lib/doc/row.js +0 -418
  262. package/dist/es/node_modules/exceljs/lib/doc/table.js +0 -470
  263. package/dist/es/node_modules/exceljs/lib/doc/workbook.js +0 -226
  264. package/dist/es/node_modules/exceljs/lib/doc/worksheet.js +0 -942
  265. package/dist/es/node_modules/exceljs/lib/exceljs.nodejs.js +0 -22
  266. package/dist/es/node_modules/exceljs/lib/stream/xlsx/hyperlink-reader.js +0 -88
  267. package/dist/es/node_modules/exceljs/lib/stream/xlsx/sheet-comments-writer.js +0 -129
  268. package/dist/es/node_modules/exceljs/lib/stream/xlsx/sheet-rels-writer.js +0 -125
  269. package/dist/es/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js +0 -354
  270. package/dist/es/node_modules/exceljs/lib/stream/xlsx/workbook-writer.js +0 -365
  271. package/dist/es/node_modules/exceljs/lib/stream/xlsx/worksheet-reader.js +0 -369
  272. package/dist/es/node_modules/exceljs/lib/stream/xlsx/worksheet-writer.js +0 -747
  273. package/dist/es/node_modules/exceljs/lib/utils/browser-buffer-decode.js +0 -18
  274. package/dist/es/node_modules/exceljs/lib/utils/browser-buffer-encode.js +0 -20
  275. package/dist/es/node_modules/exceljs/lib/utils/cell-matrix.js +0 -170
  276. package/dist/es/node_modules/exceljs/lib/utils/col-cache.js +0 -289
  277. package/dist/es/node_modules/exceljs/lib/utils/copy-style.js +0 -47
  278. package/dist/es/node_modules/exceljs/lib/utils/encryptor.js +0 -57
  279. package/dist/es/node_modules/exceljs/lib/utils/iterate-stream.js +0 -50
  280. package/dist/es/node_modules/exceljs/lib/utils/parse-sax.js +0 -38
  281. package/dist/es/node_modules/exceljs/lib/utils/shared-formula.js +0 -48
  282. package/dist/es/node_modules/exceljs/lib/utils/shared-strings.js +0 -37
  283. package/dist/es/node_modules/exceljs/lib/utils/stream-buf.js +0 -371
  284. package/dist/es/node_modules/exceljs/lib/utils/string-buf.js +0 -84
  285. package/dist/es/node_modules/exceljs/lib/utils/under-dash.js +0 -186
  286. package/dist/es/node_modules/exceljs/lib/utils/utils.js +0 -177
  287. package/dist/es/node_modules/exceljs/lib/utils/xml-stream.js +0 -174
  288. package/dist/es/node_modules/exceljs/lib/utils/zip-stream.js +0 -95
  289. package/dist/es/node_modules/exceljs/lib/xlsx/defaultnumformats.js +0 -155
  290. package/dist/es/node_modules/exceljs/lib/xlsx/rel-type.js +0 -21
  291. package/dist/es/node_modules/exceljs/lib/xlsx/xform/base-xform.js +0 -150
  292. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/defined-name-xform.js +0 -96
  293. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/sheet-xform.js +0 -39
  294. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/workbook-calc-properties-xform.js +0 -30
  295. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/workbook-properties-xform.js +0 -33
  296. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/workbook-view-xform.js +0 -57
  297. package/dist/es/node_modules/exceljs/lib/xlsx/xform/book/workbook-xform.js +0 -269
  298. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/comment-xform.js +0 -114
  299. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/comments-xform.js +0 -92
  300. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/style/vml-position-xform.js +0 -43
  301. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/style/vml-protection-xform.js +0 -40
  302. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/vml-anchor-xform.js +0 -64
  303. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/vml-client-data-xform.js +0 -102
  304. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/vml-notes-xform.js +0 -113
  305. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/vml-shape-xform.js +0 -101
  306. package/dist/es/node_modules/exceljs/lib/xlsx/xform/comment/vml-textbox-xform.js +0 -68
  307. package/dist/es/node_modules/exceljs/lib/xlsx/xform/composite-xform.js +0 -60
  308. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/app-heading-pairs-xform.js +0 -36
  309. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/app-titles-of-parts-xform.js +0 -32
  310. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/app-xform.js +0 -108
  311. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/content-types-xform.js +0 -125
  312. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/core-xform.js +0 -144
  313. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/relationship-xform.js +0 -29
  314. package/dist/es/node_modules/exceljs/lib/xlsx/xform/core/relationships-xform.js +0 -79
  315. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/base-cell-anchor-xform.js +0 -52
  316. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/blip-fill-xform.js +0 -76
  317. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/blip-xform.js +0 -46
  318. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/c-nv-pic-pr-xform.js +0 -42
  319. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/c-nv-pr-xform.js +0 -74
  320. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/cell-position-xform.js +0 -82
  321. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/drawing-xform.js +0 -117
  322. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/ext-lst-xform.js +0 -47
  323. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/ext-xform.js +0 -48
  324. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/hlink-click-xform.js +0 -45
  325. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/nv-pic-pr-xform.js +0 -71
  326. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/one-cell-anchor-xform.js +0 -71
  327. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/pic-xform.js +0 -85
  328. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/sp-pr.js +0 -19
  329. package/dist/es/node_modules/exceljs/lib/xlsx/xform/drawing/two-cell-anchor-xform.js +0 -69
  330. package/dist/es/node_modules/exceljs/lib/xlsx/xform/list-xform.js +0 -99
  331. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/auto-filter-xform.js +0 -43
  332. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cell-xform.js +0 -495
  333. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/cf-rule-xform.js +0 -312
  334. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/cfvo-xform.js +0 -31
  335. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/color-scale-xform.js +0 -51
  336. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/conditional-formatting-xform.js +0 -53
  337. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/conditional-formattings-xform.js +0 -97
  338. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/databar-xform.js +0 -55
  339. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/ext-lst-ref-xform.js +0 -93
  340. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/formula-xform.js +0 -29
  341. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf/icon-set-xform.js +0 -53
  342. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/cf-icon-ext-xform.js +0 -31
  343. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/cf-rule-ext-xform.js +0 -106
  344. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/cfvo-ext-xform.js +0 -48
  345. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/conditional-formatting-ext-xform.js +0 -68
  346. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/conditional-formattings-ext-xform.js +0 -56
  347. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/databar-ext-xform.js +0 -105
  348. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/f-ext-xform.js +0 -29
  349. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/icon-set-ext-xform.js +0 -80
  350. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/sqref-ext-xform.js +0 -29
  351. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/col-xform.js +0 -91
  352. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/data-validations-xform.js +0 -263
  353. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/dimension-xform.js +0 -33
  354. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/drawing-xform.js +0 -37
  355. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/ext-lst-xform.js +0 -92
  356. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/header-footer-xform.js +0 -147
  357. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/hyperlink-xform.js +0 -58
  358. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/merge-cell-xform.js +0 -31
  359. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/merges.js +0 -63
  360. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/outline-properties-xform.js +0 -47
  361. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/page-breaks-xform.js +0 -31
  362. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/page-margins-xform.js +0 -54
  363. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/page-setup-properties-xform.js +0 -39
  364. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/page-setup-xform.js +0 -108
  365. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/picture-xform.js +0 -37
  366. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/print-options-xform.js +0 -54
  367. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/row-breaks-xform.js +0 -42
  368. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/row-xform.js +0 -148
  369. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/sheet-format-properties-xform.js +0 -60
  370. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/sheet-properties-xform.js +0 -97
  371. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/sheet-protection-xform.js +0 -94
  372. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/sheet-view-xform.js +0 -205
  373. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/table-part-xform.js +0 -37
  374. package/dist/es/node_modules/exceljs/lib/xlsx/xform/sheet/worksheet-xform.js +0 -570
  375. package/dist/es/node_modules/exceljs/lib/xlsx/xform/simple/boolean-xform.js +0 -35
  376. package/dist/es/node_modules/exceljs/lib/xlsx/xform/simple/date-xform.js +0 -70
  377. package/dist/es/node_modules/exceljs/lib/xlsx/xform/simple/integer-xform.js +0 -61
  378. package/dist/es/node_modules/exceljs/lib/xlsx/xform/simple/string-xform.js +0 -55
  379. package/dist/es/node_modules/exceljs/lib/xlsx/xform/static-xform.js +0 -69
  380. package/dist/es/node_modules/exceljs/lib/xlsx/xform/strings/phonetic-text-xform.js +0 -102
  381. package/dist/es/node_modules/exceljs/lib/xlsx/xform/strings/rich-text-xform.js +0 -107
  382. package/dist/es/node_modules/exceljs/lib/xlsx/xform/strings/shared-string-xform.js +0 -107
  383. package/dist/es/node_modules/exceljs/lib/xlsx/xform/strings/shared-strings-xform.js +0 -133
  384. package/dist/es/node_modules/exceljs/lib/xlsx/xform/strings/text-xform.js +0 -48
  385. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/alignment-xform.js +0 -178
  386. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/border-xform.js +0 -214
  387. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/color-xform.js +0 -67
  388. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/dxf-xform.js +0 -121
  389. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/fill-xform.js +0 -367
  390. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/font-xform.js +0 -110
  391. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/numfmt-xform.js +0 -69
  392. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/protection-xform.js +0 -64
  393. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/style-xform.js +0 -131
  394. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/styles-xform.js +0 -540
  395. package/dist/es/node_modules/exceljs/lib/xlsx/xform/style/underline-xform.js +0 -51
  396. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/auto-filter-xform.js +0 -86
  397. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/custom-filter-xform.js +0 -37
  398. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/filter-column-xform.js +0 -103
  399. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/filter-xform.js +0 -35
  400. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/table-column-xform.js +0 -48
  401. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/table-style-info-xform.js +0 -45
  402. package/dist/es/node_modules/exceljs/lib/xlsx/xform/table/table-xform.js +0 -140
  403. package/dist/es/node_modules/exceljs/lib/xlsx/xlsx.js +0 -720
  404. package/dist/es/node_modules/exceljs/lib/xlsx/xml/theme1.js +0 -6
  405. package/dist/es/node_modules/exceljs/node_modules/readable-stream/errors.js +0 -126
  406. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  407. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  408. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  409. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  410. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  411. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  412. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  413. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  414. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  415. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  416. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  417. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  418. package/dist/es/node_modules/exceljs/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  419. package/dist/es/node_modules/exceljs/node_modules/readable-stream/readable.js +0 -32
  420. package/dist/es/node_modules/exceljs/node_modules/string_decoder/lib/string_decoder.js +0 -285
  421. package/dist/es/node_modules/fast-csv/build/src/index.js +0 -27
  422. package/dist/es/node_modules/fs-constants/index.js +0 -6
  423. package/dist/es/node_modules/fs.realpath/index.js +0 -72
  424. package/dist/es/node_modules/fs.realpath/old.js +0 -309
  425. package/dist/es/node_modules/fstream/fstream.js +0 -51
  426. package/dist/es/node_modules/fstream/lib/abstract.js +0 -90
  427. package/dist/es/node_modules/fstream/lib/collect.js +0 -72
  428. package/dist/es/node_modules/fstream/lib/dir-reader.js +0 -268
  429. package/dist/es/node_modules/fstream/lib/dir-writer.js +0 -190
  430. package/dist/es/node_modules/fstream/lib/file-reader.js +0 -164
  431. package/dist/es/node_modules/fstream/lib/file-writer.js +0 -121
  432. package/dist/es/node_modules/fstream/lib/get-type.js +0 -35
  433. package/dist/es/node_modules/fstream/lib/link-reader.js +0 -67
  434. package/dist/es/node_modules/fstream/lib/link-writer.js +0 -111
  435. package/dist/es/node_modules/fstream/lib/proxy-reader.js +0 -110
  436. package/dist/es/node_modules/fstream/lib/proxy-writer.js +0 -127
  437. package/dist/es/node_modules/fstream/lib/reader.js +0 -277
  438. package/dist/es/node_modules/fstream/lib/socket-reader.js +0 -49
  439. package/dist/es/node_modules/fstream/lib/writer.js +0 -412
  440. package/dist/es/node_modules/fstream/node_modules/rimraf/rimraf.js +0 -379
  441. package/dist/es/node_modules/glob/common.js +0 -246
  442. package/dist/es/node_modules/glob/glob.js +0 -810
  443. package/dist/es/node_modules/glob/sync.js +0 -501
  444. package/dist/es/node_modules/graceful-fs/clone.js +0 -23
  445. package/dist/es/node_modules/graceful-fs/graceful-fs.js +0 -458
  446. package/dist/es/node_modules/graceful-fs/legacy-streams.js +0 -122
  447. package/dist/es/node_modules/graceful-fs/polyfills.js +0 -359
  448. package/dist/es/node_modules/immediate/lib/index.js +0 -84
  449. package/dist/es/node_modules/inflight/inflight.js +0 -59
  450. package/dist/es/node_modules/inherits/inherits.js +0 -21
  451. package/dist/es/node_modules/inherits/inherits_browser.js +0 -38
  452. package/dist/es/node_modules/jszip/lib/base64.js +0 -119
  453. package/dist/es/node_modules/jszip/lib/compressedObject.js +0 -79
  454. package/dist/es/node_modules/jszip/lib/compressions.js +0 -19
  455. package/dist/es/node_modules/jszip/lib/crc32.js +0 -79
  456. package/dist/es/node_modules/jszip/lib/defaults.js +0 -14
  457. package/dist/es/node_modules/jszip/lib/external.js +0 -20
  458. package/dist/es/node_modules/jszip/lib/flate.js +0 -91
  459. package/dist/es/node_modules/jszip/lib/generate/ZipFileWorker.js +0 -547
  460. package/dist/es/node_modules/jszip/lib/generate/index.js +0 -62
  461. package/dist/es/node_modules/jszip/lib/index.js +0 -63
  462. package/dist/es/node_modules/jszip/lib/load.js +0 -97
  463. package/dist/es/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +0 -77
  464. package/dist/es/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +0 -54
  465. package/dist/es/node_modules/jszip/lib/nodejsUtils.js +0 -57
  466. package/dist/es/node_modules/jszip/lib/object.js +0 -399
  467. package/dist/es/node_modules/jszip/lib/reader/ArrayReader.js +0 -61
  468. package/dist/es/node_modules/jszip/lib/reader/DataReader.js +0 -119
  469. package/dist/es/node_modules/jszip/lib/reader/NodeBufferReader.js +0 -23
  470. package/dist/es/node_modules/jszip/lib/reader/StringReader.js +0 -42
  471. package/dist/es/node_modules/jszip/lib/reader/Uint8ArrayReader.js +0 -26
  472. package/dist/es/node_modules/jszip/lib/reader/readerFor.js +0 -36
  473. package/dist/es/node_modules/jszip/lib/signature.js +0 -10
  474. package/dist/es/node_modules/jszip/lib/stream/ConvertWorker.js +0 -29
  475. package/dist/es/node_modules/jszip/lib/stream/Crc32Probe.js +0 -28
  476. package/dist/es/node_modules/jszip/lib/stream/DataLengthProbe.js +0 -31
  477. package/dist/es/node_modules/jszip/lib/stream/DataWorker.js +0 -119
  478. package/dist/es/node_modules/jszip/lib/stream/GenericWorker.js +0 -263
  479. package/dist/es/node_modules/jszip/lib/stream/StreamHelper.js +0 -223
  480. package/dist/es/node_modules/jszip/lib/support.js +0 -44
  481. package/dist/es/node_modules/jszip/lib/utf8.js +0 -283
  482. package/dist/es/node_modules/jszip/lib/utils.js +0 -519
  483. package/dist/es/node_modules/jszip/lib/zipEntries.js +0 -263
  484. package/dist/es/node_modules/jszip/lib/zipEntry.js +0 -305
  485. package/dist/es/node_modules/jszip/lib/zipObject.js +0 -140
  486. package/dist/es/node_modules/lazystream/lib/lazystream.js +0 -58
  487. package/dist/es/node_modules/lie/lib/index.js +0 -309
  488. package/dist/es/node_modules/listenercount/index.js +0 -3
  489. package/dist/es/node_modules/lodash.defaults/index.js +0 -670
  490. package/dist/es/node_modules/lodash.difference/index.js +0 -1174
  491. package/dist/es/node_modules/lodash.escaperegexp/index.js +0 -170
  492. package/dist/es/node_modules/lodash.flatten/index.js +0 -353
  493. package/dist/es/node_modules/lodash.groupby/index.js +0 -2379
  494. package/dist/es/node_modules/lodash.isboolean/index.js +0 -72
  495. package/dist/es/node_modules/lodash.isequal/index.js +0 -1858
  496. package/dist/es/node_modules/lodash.isfunction/index.js +0 -159
  497. package/dist/es/node_modules/lodash.isnil/index.js +0 -35
  498. package/dist/es/node_modules/lodash.isplainobject/index.js +0 -141
  499. package/dist/es/node_modules/lodash.isundefined/index.js +0 -32
  500. package/dist/es/node_modules/lodash.union/index.js +0 -1185
  501. package/dist/es/node_modules/lodash.uniq/index.js +0 -900
  502. package/dist/es/node_modules/minimatch/minimatch.js +0 -951
  503. package/dist/es/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
  504. package/dist/es/node_modules/mkdirp/index.js +0 -107
  505. package/dist/es/node_modules/normalize-path/index.js +0 -37
  506. package/dist/es/node_modules/once/once.js +0 -49
  507. package/dist/es/node_modules/pako/index.js +0 -21
  508. package/dist/es/node_modules/pako/lib/deflate.js +0 -409
  509. package/dist/es/node_modules/pako/lib/inflate.js +0 -434
  510. package/dist/es/node_modules/pako/lib/utils/common.js +0 -108
  511. package/dist/es/node_modules/pako/lib/utils/strings.js +0 -189
  512. package/dist/es/node_modules/pako/lib/zlib/adler32.js +0 -51
  513. package/dist/es/node_modules/pako/lib/zlib/constants.js +0 -68
  514. package/dist/es/node_modules/pako/lib/zlib/crc32.js +0 -59
  515. package/dist/es/node_modules/pako/lib/zlib/deflate.js +0 -1874
  516. package/dist/es/node_modules/pako/lib/zlib/gzheader.js +0 -58
  517. package/dist/es/node_modules/pako/lib/zlib/inffast.js +0 -345
  518. package/dist/es/node_modules/pako/lib/zlib/inflate.js +0 -1551
  519. package/dist/es/node_modules/pako/lib/zlib/inftrees.js +0 -346
  520. package/dist/es/node_modules/pako/lib/zlib/messages.js +0 -32
  521. package/dist/es/node_modules/pako/lib/zlib/trees.js +0 -1226
  522. package/dist/es/node_modules/pako/lib/zlib/zstream.js +0 -47
  523. package/dist/es/node_modules/path-is-absolute/index.js +0 -24
  524. package/dist/es/node_modules/process-nextick-args/index.js +0 -54
  525. package/dist/es/node_modules/readable-stream/lib/_stream_duplex.js +0 -120
  526. package/dist/es/node_modules/readable-stream/lib/_stream_passthrough.js +0 -35
  527. package/dist/es/node_modules/readable-stream/lib/_stream_readable.js +0 -1021
  528. package/dist/es/node_modules/readable-stream/lib/_stream_transform.js +0 -164
  529. package/dist/es/node_modules/readable-stream/lib/_stream_writable.js +0 -671
  530. package/dist/es/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -92
  531. package/dist/es/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -95
  532. package/dist/es/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  533. package/dist/es/node_modules/readable-stream/node_modules/isarray/index.js +0 -15
  534. package/dist/es/node_modules/readable-stream/node_modules/safe-buffer/index.js +0 -77
  535. package/dist/es/node_modules/readable-stream/passthrough.js +0 -5
  536. package/dist/es/node_modules/readable-stream/readable.js +0 -38
  537. package/dist/es/node_modules/readdir-glob/index.js +0 -250
  538. package/dist/es/node_modules/readdir-glob/node_modules/minimatch/lib/path.js +0 -6
  539. package/dist/es/node_modules/readdir-glob/node_modules/minimatch/minimatch.js +0 -949
  540. package/dist/es/node_modules/safe-buffer/index.js +0 -80
  541. package/dist/es/node_modules/saxes/saxes.js +0 -2066
  542. package/dist/es/node_modules/setimmediate/setImmediate.js +0 -187
  543. package/dist/es/node_modules/string_decoder/lib/string_decoder.js +0 -285
  544. package/dist/es/node_modules/string_decoder/node_modules/safe-buffer/index.js +0 -77
  545. package/dist/es/node_modules/tar-stream/extract.js +0 -265
  546. package/dist/es/node_modules/tar-stream/headers.js +0 -296
  547. package/dist/es/node_modules/tar-stream/index.js +0 -8
  548. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/errors.js +0 -126
  549. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  550. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  551. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  552. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  553. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  554. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  555. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  556. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  557. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  558. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  559. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  560. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  561. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  562. package/dist/es/node_modules/tar-stream/node_modules/readable-stream/readable.js +0 -32
  563. package/dist/es/node_modules/tar-stream/node_modules/string_decoder/lib/string_decoder.js +0 -285
  564. package/dist/es/node_modules/tar-stream/pack.js +0 -265
  565. package/dist/es/node_modules/tmp/lib/tmp.js +0 -854
  566. package/dist/es/node_modules/traverse/index.js +0 -322
  567. package/dist/es/node_modules/unzipper/lib/Buffer.js +0 -16
  568. package/dist/es/node_modules/unzipper/lib/BufferStream.js +0 -32
  569. package/dist/es/node_modules/unzipper/lib/Decrypt.js +0 -78
  570. package/dist/es/node_modules/unzipper/lib/NoopStream.js +0 -25
  571. package/dist/es/node_modules/unzipper/lib/Open/directory.js +0 -245
  572. package/dist/es/node_modules/unzipper/lib/Open/index.js +0 -109
  573. package/dist/es/node_modules/unzipper/lib/Open/unzip.js +0 -139
  574. package/dist/es/node_modules/unzipper/lib/PullStream.js +0 -152
  575. package/dist/es/node_modules/unzipper/lib/extract.js +0 -65
  576. package/dist/es/node_modules/unzipper/lib/parse.js +0 -302
  577. package/dist/es/node_modules/unzipper/lib/parseDateTime.js +0 -15
  578. package/dist/es/node_modules/unzipper/lib/parseExtraField.js +0 -41
  579. package/dist/es/node_modules/unzipper/lib/parseOne.js +0 -66
  580. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/any.js +0 -30
  581. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/async.js +0 -174
  582. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/bind.js +0 -76
  583. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/bluebird.js +0 -14
  584. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/call_get.js +0 -133
  585. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/cancel.js +0 -140
  586. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/catch_filter.js +0 -54
  587. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/context.js +0 -78
  588. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/debuggability.js +0 -924
  589. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/direct_resolve.js +0 -55
  590. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/each.js +0 -38
  591. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/errors.js +0 -128
  592. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/es5.js +0 -90
  593. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/filter.js +0 -21
  594. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/finally.js +0 -122
  595. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/generators.js +0 -234
  596. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/join.js +0 -177
  597. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/map.js +0 -178
  598. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/method.js +0 -66
  599. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/nodeback.js +0 -63
  600. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/nodeify.js +0 -69
  601. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/promise.js +0 -812
  602. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/promise_array.js +0 -194
  603. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/promisify.js +0 -326
  604. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/props.js +0 -130
  605. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/queue.js +0 -82
  606. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/race.js +0 -60
  607. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/reduce.js +0 -183
  608. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/schedule.js +0 -73
  609. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/settle.js +0 -54
  610. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/some.js +0 -160
  611. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/synchronous_inspection.js +0 -112
  612. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/thenables.js +0 -97
  613. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/timers.js +0 -104
  614. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/using.js +0 -238
  615. package/dist/es/node_modules/unzipper/node_modules/bluebird/js/release/util.js +0 -385
  616. package/dist/es/node_modules/unzipper/unzip.js +0 -21
  617. package/dist/es/node_modules/util-deprecate/node.js +0 -17
  618. package/dist/es/node_modules/uuid/dist/esm-browser/index.js +0 -9
  619. package/dist/es/node_modules/uuid/dist/esm-browser/md5.js +0 -215
  620. package/dist/es/node_modules/uuid/dist/esm-browser/nil.js +0 -3
  621. package/dist/es/node_modules/uuid/dist/esm-browser/parse.js +0 -35
  622. package/dist/es/node_modules/uuid/dist/esm-browser/regex.js +0 -3
  623. package/dist/es/node_modules/uuid/dist/esm-browser/rng.js +0 -21
  624. package/dist/es/node_modules/uuid/dist/esm-browser/sha1.js +0 -96
  625. package/dist/es/node_modules/uuid/dist/esm-browser/stringify.js +0 -31
  626. package/dist/es/node_modules/uuid/dist/esm-browser/v1.js +0 -96
  627. package/dist/es/node_modules/uuid/dist/esm-browser/v3.js +0 -7
  628. package/dist/es/node_modules/uuid/dist/esm-browser/v35.js +0 -66
  629. package/dist/es/node_modules/uuid/dist/esm-browser/v4.js +0 -24
  630. package/dist/es/node_modules/uuid/dist/esm-browser/v5.js +0 -7
  631. package/dist/es/node_modules/uuid/dist/esm-browser/validate.js +0 -7
  632. package/dist/es/node_modules/uuid/dist/esm-browser/version.js +0 -11
  633. package/dist/es/node_modules/wrappy/wrappy.js +0 -35
  634. package/dist/es/node_modules/xlsx/xlsx.js +0 -15892
  635. package/dist/es/node_modules/xmlchars/xml/1.0/ed5.js +0 -108
  636. package/dist/es/node_modules/xmlchars/xml/1.1/ed2.js +0 -148
  637. package/dist/es/node_modules/xmlchars/xmlns/1.0/ed3.js +0 -68
  638. package/dist/es/node_modules/zip-stream/index.js +0 -197
  639. package/dist/es/node_modules/zip-stream/node_modules/archiver-utils/file.js +0 -222
  640. package/dist/es/node_modules/zip-stream/node_modules/archiver-utils/index.js +0 -164
  641. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/errors.js +0 -126
  642. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_duplex.js +0 -113
  643. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_passthrough.js +0 -24
  644. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_readable.js +0 -1030
  645. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_transform.js +0 -140
  646. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_writable.js +0 -627
  647. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -191
  648. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -195
  649. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
  650. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -94
  651. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/from.js +0 -63
  652. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -95
  653. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/state.js +0 -33
  654. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/stream.js +0 -13
  655. package/dist/es/node_modules/zip-stream/node_modules/readable-stream/readable.js +0 -32
  656. package/dist/es/node_modules/zip-stream/node_modules/string_decoder/lib/string_decoder.js +0 -285
@@ -1,2066 +0,0 @@
1
- import { __exports as saxes } from '../../_virtual/saxes.js';
2
- import '../xmlchars/xml/1.0/ed5.js';
3
- import '../xmlchars/xml/1.1/ed2.js';
4
- import '../xmlchars/xmlns/1.0/ed3.js';
5
- import { __exports as ed5$1 } from '../../_virtual/ed5.js';
6
- import { __exports as ed2$1 } from '../../_virtual/ed2.js';
7
- import { __exports as ed3 } from '../../_virtual/ed3.js';
8
-
9
- Object.defineProperty(saxes, "__esModule", { value: true });
10
- const ed5 = ed5$1;
11
- const ed2 = ed2$1;
12
- const NSed3 = ed3;
13
- var isS = ed5.isS;
14
- var isChar10 = ed5.isChar;
15
- var isNameStartChar = ed5.isNameStartChar;
16
- var isNameChar = ed5.isNameChar;
17
- var S_LIST = ed5.S_LIST;
18
- var NAME_RE = ed5.NAME_RE;
19
- var isChar11 = ed2.isChar;
20
- var isNCNameStartChar = NSed3.isNCNameStartChar;
21
- var isNCNameChar = NSed3.isNCNameChar;
22
- var NC_NAME_RE = NSed3.NC_NAME_RE;
23
- const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
24
- const XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
25
- const rootNS = {
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- __proto__: null,
28
- xml: XML_NAMESPACE,
29
- xmlns: XMLNS_NAMESPACE,
30
- };
31
- const XML_ENTITIES = {
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- __proto__: null,
34
- amp: "&",
35
- gt: ">",
36
- lt: "<",
37
- quot: "\"",
38
- apos: "'",
39
- };
40
- // EOC: end-of-chunk
41
- const EOC = -1;
42
- const NL_LIKE = -2;
43
- const S_BEGIN = 0; // Initial state.
44
- const S_BEGIN_WHITESPACE = 1; // leading whitespace
45
- const S_DOCTYPE = 2; // <!DOCTYPE
46
- const S_DOCTYPE_QUOTE = 3; // <!DOCTYPE "//blah
47
- const S_DTD = 4; // <!DOCTYPE "//blah" [ ...
48
- const S_DTD_QUOTED = 5; // <!DOCTYPE "//blah" [ "foo
49
- const S_DTD_OPEN_WAKA = 6;
50
- const S_DTD_OPEN_WAKA_BANG = 7;
51
- const S_DTD_COMMENT = 8; // <!--
52
- const S_DTD_COMMENT_ENDING = 9; // <!-- blah -
53
- const S_DTD_COMMENT_ENDED = 10; // <!-- blah --
54
- const S_DTD_PI = 11; // <?
55
- const S_DTD_PI_ENDING = 12; // <?hi "there" ?
56
- const S_TEXT = 13; // general stuff
57
- const S_ENTITY = 14; // &amp and such
58
- const S_OPEN_WAKA = 15; // <
59
- const S_OPEN_WAKA_BANG = 16; // <!...
60
- const S_COMMENT = 17; // <!--
61
- const S_COMMENT_ENDING = 18; // <!-- blah -
62
- const S_COMMENT_ENDED = 19; // <!-- blah --
63
- const S_CDATA = 20; // <![CDATA[ something
64
- const S_CDATA_ENDING = 21; // ]
65
- const S_CDATA_ENDING_2 = 22; // ]]
66
- const S_PI_FIRST_CHAR = 23; // <?hi, first char
67
- const S_PI_REST = 24; // <?hi, rest of the name
68
- const S_PI_BODY = 25; // <?hi there
69
- const S_PI_ENDING = 26; // <?hi "there" ?
70
- const S_XML_DECL_NAME_START = 27; // <?xml
71
- const S_XML_DECL_NAME = 28; // <?xml foo
72
- const S_XML_DECL_EQ = 29; // <?xml foo=
73
- const S_XML_DECL_VALUE_START = 30; // <?xml foo=
74
- const S_XML_DECL_VALUE = 31; // <?xml foo="bar"
75
- const S_XML_DECL_SEPARATOR = 32; // <?xml foo="bar"
76
- const S_XML_DECL_ENDING = 33; // <?xml ... ?
77
- const S_OPEN_TAG = 34; // <strong
78
- const S_OPEN_TAG_SLASH = 35; // <strong /
79
- const S_ATTRIB = 36; // <a
80
- const S_ATTRIB_NAME = 37; // <a foo
81
- const S_ATTRIB_NAME_SAW_WHITE = 38; // <a foo _
82
- const S_ATTRIB_VALUE = 39; // <a foo=
83
- const S_ATTRIB_VALUE_QUOTED = 40; // <a foo="bar
84
- const S_ATTRIB_VALUE_CLOSED = 41; // <a foo="bar"
85
- const S_ATTRIB_VALUE_UNQUOTED = 42; // <a foo=bar
86
- const S_CLOSE_TAG = 43; // </a
87
- const S_CLOSE_TAG_SAW_WHITE = 44; // </a >
88
- const TAB = 9;
89
- const NL = 0xA;
90
- const CR = 0xD;
91
- const SPACE = 0x20;
92
- const BANG = 0x21;
93
- const DQUOTE = 0x22;
94
- const AMP = 0x26;
95
- const SQUOTE = 0x27;
96
- const MINUS = 0x2D;
97
- const FORWARD_SLASH = 0x2F;
98
- const SEMICOLON = 0x3B;
99
- const LESS = 0x3C;
100
- const EQUAL = 0x3D;
101
- const GREATER = 0x3E;
102
- const QUESTION = 0x3F;
103
- const OPEN_BRACKET = 0x5B;
104
- const CLOSE_BRACKET = 0x5D;
105
- const NEL = 0x85;
106
- const LS = 0x2028; // Line Separator
107
- const isQuote = (c) => c === DQUOTE || c === SQUOTE;
108
- const QUOTES = [DQUOTE, SQUOTE];
109
- const DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];
110
- const DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET];
111
- const XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];
112
- const ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];
113
- function nsPairCheck(parser, prefix, uri) {
114
- switch (prefix) {
115
- case "xml":
116
- if (uri !== XML_NAMESPACE) {
117
- parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`);
118
- }
119
- break;
120
- case "xmlns":
121
- if (uri !== XMLNS_NAMESPACE) {
122
- parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`);
123
- }
124
- break;
125
- }
126
- switch (uri) {
127
- case XMLNS_NAMESPACE:
128
- parser.fail(prefix === "" ?
129
- `the default namespace may not be set to ${uri}.` :
130
- `may not assign a prefix (even "xmlns") to the URI \
131
- ${XMLNS_NAMESPACE}.`);
132
- break;
133
- case XML_NAMESPACE:
134
- switch (prefix) {
135
- case "xml":
136
- // Assinging the XML namespace to "xml" is fine.
137
- break;
138
- case "":
139
- parser.fail(`the default namespace may not be set to ${uri}.`);
140
- break;
141
- default:
142
- parser.fail("may not assign the xml namespace to another prefix.");
143
- }
144
- break;
145
- }
146
- }
147
- function nsMappingCheck(parser, mapping) {
148
- for (const local of Object.keys(mapping)) {
149
- nsPairCheck(parser, local, mapping[local]);
150
- }
151
- }
152
- const isNCName = (name) => NC_NAME_RE.test(name);
153
- const isName = (name) => NAME_RE.test(name);
154
- const FORBIDDEN_START = 0;
155
- const FORBIDDEN_BRACKET = 1;
156
- const FORBIDDEN_BRACKET_BRACKET = 2;
157
- /**
158
- * The list of supported events.
159
- */
160
- saxes.EVENTS = [
161
- "xmldecl",
162
- "text",
163
- "processinginstruction",
164
- "doctype",
165
- "comment",
166
- "opentagstart",
167
- "attribute",
168
- "opentag",
169
- "closetag",
170
- "cdata",
171
- "error",
172
- "end",
173
- "ready",
174
- ];
175
- const EVENT_NAME_TO_HANDLER_NAME = {
176
- xmldecl: "xmldeclHandler",
177
- text: "textHandler",
178
- processinginstruction: "piHandler",
179
- doctype: "doctypeHandler",
180
- comment: "commentHandler",
181
- opentagstart: "openTagStartHandler",
182
- attribute: "attributeHandler",
183
- opentag: "openTagHandler",
184
- closetag: "closeTagHandler",
185
- cdata: "cdataHandler",
186
- error: "errorHandler",
187
- end: "endHandler",
188
- ready: "readyHandler",
189
- };
190
- class SaxesParser {
191
- /**
192
- * @param opt The parser options.
193
- */
194
- constructor(opt) {
195
- this.opt = opt !== null && opt !== void 0 ? opt : {};
196
- this.fragmentOpt = !!this.opt.fragment;
197
- const xmlnsOpt = this.xmlnsOpt = !!this.opt.xmlns;
198
- this.trackPosition = this.opt.position !== false;
199
- this.fileName = this.opt.fileName;
200
- if (xmlnsOpt) {
201
- // This is the function we use to perform name checks on PIs and entities.
202
- // When namespaces are used, colons are not allowed in PI target names or
203
- // entity names. So the check depends on whether namespaces are used. See:
204
- //
205
- // https://www.w3.org/XML/xml-names-19990114-errata.html
206
- // NE08
207
- //
208
- this.nameStartCheck = isNCNameStartChar;
209
- this.nameCheck = isNCNameChar;
210
- this.isName = isNCName;
211
- // eslint-disable-next-line @typescript-eslint/unbound-method
212
- this.processAttribs = this.processAttribsNS;
213
- // eslint-disable-next-line @typescript-eslint/unbound-method
214
- this.pushAttrib = this.pushAttribNS;
215
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
- this.ns = Object.assign({ __proto__: null }, rootNS);
217
- const additional = this.opt.additionalNamespaces;
218
- if (additional != null) {
219
- nsMappingCheck(this, additional);
220
- Object.assign(this.ns, additional);
221
- }
222
- }
223
- else {
224
- this.nameStartCheck = isNameStartChar;
225
- this.nameCheck = isNameChar;
226
- this.isName = isName;
227
- // eslint-disable-next-line @typescript-eslint/unbound-method
228
- this.processAttribs = this.processAttribsPlain;
229
- // eslint-disable-next-line @typescript-eslint/unbound-method
230
- this.pushAttrib = this.pushAttribPlain;
231
- }
232
- //
233
- // The order of the members in this table needs to correspond to the state
234
- // numbers given to the states that correspond to the methods being recorded
235
- // here.
236
- //
237
- this.stateTable = [
238
- /* eslint-disable @typescript-eslint/unbound-method */
239
- this.sBegin,
240
- this.sBeginWhitespace,
241
- this.sDoctype,
242
- this.sDoctypeQuote,
243
- this.sDTD,
244
- this.sDTDQuoted,
245
- this.sDTDOpenWaka,
246
- this.sDTDOpenWakaBang,
247
- this.sDTDComment,
248
- this.sDTDCommentEnding,
249
- this.sDTDCommentEnded,
250
- this.sDTDPI,
251
- this.sDTDPIEnding,
252
- this.sText,
253
- this.sEntity,
254
- this.sOpenWaka,
255
- this.sOpenWakaBang,
256
- this.sComment,
257
- this.sCommentEnding,
258
- this.sCommentEnded,
259
- this.sCData,
260
- this.sCDataEnding,
261
- this.sCDataEnding2,
262
- this.sPIFirstChar,
263
- this.sPIRest,
264
- this.sPIBody,
265
- this.sPIEnding,
266
- this.sXMLDeclNameStart,
267
- this.sXMLDeclName,
268
- this.sXMLDeclEq,
269
- this.sXMLDeclValueStart,
270
- this.sXMLDeclValue,
271
- this.sXMLDeclSeparator,
272
- this.sXMLDeclEnding,
273
- this.sOpenTag,
274
- this.sOpenTagSlash,
275
- this.sAttrib,
276
- this.sAttribName,
277
- this.sAttribNameSawWhite,
278
- this.sAttribValue,
279
- this.sAttribValueQuoted,
280
- this.sAttribValueClosed,
281
- this.sAttribValueUnquoted,
282
- this.sCloseTag,
283
- this.sCloseTagSawWhite,
284
- ];
285
- this._init();
286
- }
287
- /**
288
- * Indicates whether or not the parser is closed. If ``true``, wait for
289
- * the ``ready`` event to write again.
290
- */
291
- get closed() {
292
- return this._closed;
293
- }
294
- _init() {
295
- var _a;
296
- this.openWakaBang = "";
297
- this.text = "";
298
- this.name = "";
299
- this.piTarget = "";
300
- this.entity = "";
301
- this.q = null;
302
- this.tags = [];
303
- this.tag = null;
304
- this.topNS = null;
305
- this.chunk = "";
306
- this.chunkPosition = 0;
307
- this.i = 0;
308
- this.prevI = 0;
309
- this.carriedFromPrevious = undefined;
310
- this.forbiddenState = FORBIDDEN_START;
311
- this.attribList = [];
312
- // The logic is organized so as to minimize the need to check
313
- // this.opt.fragment while parsing.
314
- const { fragmentOpt } = this;
315
- this.state = fragmentOpt ? S_TEXT : S_BEGIN;
316
- // We want these to be all true if we are dealing with a fragment.
317
- this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot =
318
- this.sawRoot = fragmentOpt;
319
- // An XML declaration is intially possible only when parsing whole
320
- // documents.
321
- this.xmlDeclPossible = !fragmentOpt;
322
- this.xmlDeclExpects = ["version"];
323
- this.entityReturnState = undefined;
324
- let { defaultXMLVersion } = this.opt;
325
- if (defaultXMLVersion === undefined) {
326
- if (this.opt.forceXMLVersion === true) {
327
- throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
328
- }
329
- defaultXMLVersion = "1.0";
330
- }
331
- this.setXMLVersion(defaultXMLVersion);
332
- this.positionAtNewLine = 0;
333
- this.doctype = false;
334
- this._closed = false;
335
- this.xmlDecl = {
336
- version: undefined,
337
- encoding: undefined,
338
- standalone: undefined,
339
- };
340
- this.line = 1;
341
- this.column = 0;
342
- this.ENTITIES = Object.create(XML_ENTITIES);
343
- // eslint-disable-next-line no-unused-expressions
344
- (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);
345
- }
346
- /**
347
- * The stream position the parser is currently looking at. This field is
348
- * zero-based.
349
- *
350
- * This field is not based on counting Unicode characters but is to be
351
- * interpreted as a plain index into a JavaScript string.
352
- */
353
- get position() {
354
- return this.chunkPosition + this.i;
355
- }
356
- /**
357
- * The column number of the next character to be read by the parser. *
358
- * This field is zero-based. (The first column in a line is 0.)
359
- *
360
- * This field reports the index at which the next character would be in the
361
- * line if the line were represented as a JavaScript string. Note that this
362
- * *can* be different to a count based on the number of *Unicode characters*
363
- * due to how JavaScript handles astral plane characters.
364
- *
365
- * See [[column]] for a number that corresponds to a count of Unicode
366
- * characters.
367
- */
368
- get columnIndex() {
369
- return this.position - this.positionAtNewLine;
370
- }
371
- /**
372
- * Set an event listener on an event. The parser supports one handler per
373
- * event type. If you try to set an event handler over an existing handler,
374
- * the old handler is silently overwritten.
375
- *
376
- * @param name The event to listen to.
377
- *
378
- * @param handler The handler to set.
379
- */
380
- on(name, handler) {
381
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
382
- this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;
383
- }
384
- /**
385
- * Unset an event handler.
386
- *
387
- * @parma name The event to stop listening to.
388
- */
389
- off(name) {
390
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
391
- this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;
392
- }
393
- /**
394
- * Make an error object. The error object will have a message that contains
395
- * the ``fileName`` option passed at the creation of the parser. If position
396
- * tracking was turned on, it will also have line and column number
397
- * information.
398
- *
399
- * @param message The message describing the error to report.
400
- *
401
- * @returns An error object with a properly formatted message.
402
- */
403
- makeError(message) {
404
- var _a;
405
- let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : "";
406
- if (this.trackPosition) {
407
- if (msg.length > 0) {
408
- msg += ":";
409
- }
410
- msg += `${this.line}:${this.column}`;
411
- }
412
- if (msg.length > 0) {
413
- msg += ": ";
414
- }
415
- return new Error(msg + message);
416
- }
417
- /**
418
- * Report a parsing error. This method is made public so that client code may
419
- * check for issues that are outside the scope of this project and can report
420
- * errors.
421
- *
422
- * @param message The error to report.
423
- *
424
- * @returns this
425
- */
426
- fail(message) {
427
- const err = this.makeError(message);
428
- const handler = this.errorHandler;
429
- if (handler === undefined) {
430
- throw err;
431
- }
432
- else {
433
- handler(err);
434
- }
435
- return this;
436
- }
437
- /**
438
- * Write a XML data to the parser.
439
- *
440
- * @param chunk The XML data to write.
441
- *
442
- * @returns this
443
- */
444
- write(chunk) {
445
- if (this.closed) {
446
- return this.fail("cannot write after close; assign an onready handler.");
447
- }
448
- let end = false;
449
- if (chunk === null) {
450
- // We cannot return immediately because carriedFromPrevious may need
451
- // processing.
452
- end = true;
453
- chunk = "";
454
- }
455
- else if (typeof chunk === "object") {
456
- chunk = chunk.toString();
457
- }
458
- // We checked if performing a pre-decomposition of the string into an array
459
- // of single complete characters (``Array.from(chunk)``) would be faster
460
- // than the current repeated calls to ``charCodeAt``. As of August 2018, it
461
- // isn't. (There may be Node-specific code that would perform faster than
462
- // ``Array.from`` but don't want to be dependent on Node.)
463
- if (this.carriedFromPrevious !== undefined) {
464
- // The previous chunk had char we must carry over.
465
- chunk = `${this.carriedFromPrevious}${chunk}`;
466
- this.carriedFromPrevious = undefined;
467
- }
468
- let limit = chunk.length;
469
- const lastCode = chunk.charCodeAt(limit - 1);
470
- if (!end &&
471
- // A trailing CR or surrogate must be carried over to the next
472
- // chunk.
473
- (lastCode === CR || (lastCode >= 0xD800 && lastCode <= 0xDBFF))) {
474
- // The chunk ends with a character that must be carried over. We cannot
475
- // know how to handle it until we get the next chunk or the end of the
476
- // stream. So save it for later.
477
- this.carriedFromPrevious = chunk[limit - 1];
478
- limit--;
479
- chunk = chunk.slice(0, limit);
480
- }
481
- const { stateTable } = this;
482
- this.chunk = chunk;
483
- this.i = 0;
484
- while (this.i < limit) {
485
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
486
- stateTable[this.state].call(this);
487
- }
488
- this.chunkPosition += limit;
489
- return end ? this.end() : this;
490
- }
491
- /**
492
- * Close the current stream. Perform final well-formedness checks and reset
493
- * the parser tstate.
494
- *
495
- * @returns this
496
- */
497
- close() {
498
- return this.write(null);
499
- }
500
- /**
501
- * Get a single code point out of the current chunk. This updates the current
502
- * position if we do position tracking.
503
- *
504
- * This is the algorithm to use for XML 1.0.
505
- *
506
- * @returns The character read.
507
- */
508
- getCode10() {
509
- const { chunk, i } = this;
510
- this.prevI = i;
511
- // Yes, we do this instead of doing this.i++. Doing it this way, we do not
512
- // read this.i again, which is a bit faster.
513
- this.i = i + 1;
514
- if (i >= chunk.length) {
515
- return EOC;
516
- }
517
- // Using charCodeAt and handling the surrogates ourselves is faster
518
- // than using codePointAt.
519
- const code = chunk.charCodeAt(i);
520
- this.column++;
521
- if (code < 0xD800) {
522
- if (code >= SPACE || code === TAB) {
523
- return code;
524
- }
525
- switch (code) {
526
- case NL:
527
- this.line++;
528
- this.column = 0;
529
- this.positionAtNewLine = this.position;
530
- return NL;
531
- case CR:
532
- // We may get NaN if we read past the end of the chunk, which is fine.
533
- if (chunk.charCodeAt(i + 1) === NL) {
534
- // A \r\n sequence is converted to \n so we have to skip over the
535
- // next character. We already know it has a size of 1 so ++ is fine
536
- // here.
537
- this.i = i + 2;
538
- }
539
- // Otherwise, a \r is just converted to \n, so we don't have to skip
540
- // ahead.
541
- // In either case, \r becomes \n.
542
- this.line++;
543
- this.column = 0;
544
- this.positionAtNewLine = this.position;
545
- return NL_LIKE;
546
- default:
547
- // If we get here, then code < SPACE and it is not NL CR or TAB.
548
- this.fail("disallowed character.");
549
- return code;
550
- }
551
- }
552
- if (code > 0xDBFF) {
553
- // This is a specialized version of isChar10 that takes into account
554
- // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not
555
- // test cases that don't need testing.
556
- if (!(code >= 0xE000 && code <= 0xFFFD)) {
557
- this.fail("disallowed character.");
558
- }
559
- return code;
560
- }
561
- const final = 0x10000 + ((code - 0xD800) * 0x400) +
562
- (chunk.charCodeAt(i + 1) - 0xDC00);
563
- this.i = i + 2;
564
- // This is a specialized version of isChar10 that takes into account that in
565
- // this context necessarily final >= 0x10000.
566
- if (final > 0x10FFFF) {
567
- this.fail("disallowed character.");
568
- }
569
- return final;
570
- }
571
- /**
572
- * Get a single code point out of the current chunk. This updates the current
573
- * position if we do position tracking.
574
- *
575
- * This is the algorithm to use for XML 1.1.
576
- *
577
- * @returns {number} The character read.
578
- */
579
- getCode11() {
580
- const { chunk, i } = this;
581
- this.prevI = i;
582
- // Yes, we do this instead of doing this.i++. Doing it this way, we do not
583
- // read this.i again, which is a bit faster.
584
- this.i = i + 1;
585
- if (i >= chunk.length) {
586
- return EOC;
587
- }
588
- // Using charCodeAt and handling the surrogates ourselves is faster
589
- // than using codePointAt.
590
- const code = chunk.charCodeAt(i);
591
- this.column++;
592
- if (code < 0xD800) {
593
- if ((code > 0x1F && code < 0x7F) || (code > 0x9F && code !== LS) ||
594
- code === TAB) {
595
- return code;
596
- }
597
- switch (code) {
598
- case NL: // 0xA
599
- this.line++;
600
- this.column = 0;
601
- this.positionAtNewLine = this.position;
602
- return NL;
603
- case CR: { // 0xD
604
- // We may get NaN if we read past the end of the chunk, which is
605
- // fine.
606
- const next = chunk.charCodeAt(i + 1);
607
- if (next === NL || next === NEL) {
608
- // A CR NL or CR NEL sequence is converted to NL so we have to skip
609
- // over the next character. We already know it has a size of 1.
610
- this.i = i + 2;
611
- }
612
- // Otherwise, a CR is just converted to NL, no skip.
613
- }
614
- /* yes, fall through */
615
- case NEL: // 0x85
616
- case LS: // Ox2028
617
- this.line++;
618
- this.column = 0;
619
- this.positionAtNewLine = this.position;
620
- return NL_LIKE;
621
- default:
622
- this.fail("disallowed character.");
623
- return code;
624
- }
625
- }
626
- if (code > 0xDBFF) {
627
- // This is a specialized version of isCharAndNotRestricted that takes into
628
- // account that in this context code > 0xDBFF and code <= 0xFFFF. So it
629
- // does not test cases that don't need testing.
630
- if (!(code >= 0xE000 && code <= 0xFFFD)) {
631
- this.fail("disallowed character.");
632
- }
633
- return code;
634
- }
635
- const final = 0x10000 + ((code - 0xD800) * 0x400) +
636
- (chunk.charCodeAt(i + 1) - 0xDC00);
637
- this.i = i + 2;
638
- // This is a specialized version of isCharAndNotRestricted that takes into
639
- // account that in this context necessarily final >= 0x10000.
640
- if (final > 0x10FFFF) {
641
- this.fail("disallowed character.");
642
- }
643
- return final;
644
- }
645
- /**
646
- * Like ``getCode`` but with the return value normalized so that ``NL`` is
647
- * returned for ``NL_LIKE``.
648
- */
649
- getCodeNorm() {
650
- const c = this.getCode();
651
- return c === NL_LIKE ? NL : c;
652
- }
653
- unget() {
654
- this.i = this.prevI;
655
- this.column--;
656
- }
657
- /**
658
- * Capture characters into a buffer until encountering one of a set of
659
- * characters.
660
- *
661
- * @param chars An array of codepoints. Encountering a character in the array
662
- * ends the capture. (``chars`` may safely contain ``NL``.)
663
- *
664
- * @return The character code that made the capture end, or ``EOC`` if we hit
665
- * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
666
- * instead.
667
- */
668
- captureTo(chars) {
669
- let { i: start } = this;
670
- const { chunk } = this;
671
- // eslint-disable-next-line no-constant-condition
672
- while (true) {
673
- const c = this.getCode();
674
- const isNLLike = c === NL_LIKE;
675
- const final = isNLLike ? NL : c;
676
- if (final === EOC || chars.includes(final)) {
677
- this.text += chunk.slice(start, this.prevI);
678
- return final;
679
- }
680
- if (isNLLike) {
681
- this.text += `${chunk.slice(start, this.prevI)}\n`;
682
- start = this.i;
683
- }
684
- }
685
- }
686
- /**
687
- * Capture characters into a buffer until encountering a character.
688
- *
689
- * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT
690
- * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.
691
- *
692
- * @return ``true`` if we ran into the character. Otherwise, we ran into the
693
- * end of the current chunk.
694
- */
695
- captureToChar(char) {
696
- let { i: start } = this;
697
- const { chunk } = this;
698
- // eslint-disable-next-line no-constant-condition
699
- while (true) {
700
- let c = this.getCode();
701
- switch (c) {
702
- case NL_LIKE:
703
- this.text += `${chunk.slice(start, this.prevI)}\n`;
704
- start = this.i;
705
- c = NL;
706
- break;
707
- case EOC:
708
- this.text += chunk.slice(start);
709
- return false;
710
- }
711
- if (c === char) {
712
- this.text += chunk.slice(start, this.prevI);
713
- return true;
714
- }
715
- }
716
- }
717
- /**
718
- * Capture characters that satisfy ``isNameChar`` into the ``name`` field of
719
- * this parser.
720
- *
721
- * @return The character code that made the test fail, or ``EOC`` if we hit
722
- * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
723
- * instead.
724
- */
725
- captureNameChars() {
726
- const { chunk, i: start } = this;
727
- // eslint-disable-next-line no-constant-condition
728
- while (true) {
729
- const c = this.getCode();
730
- if (c === EOC) {
731
- this.name += chunk.slice(start);
732
- return EOC;
733
- }
734
- // NL is not a name char so we don't have to test specifically for it.
735
- if (!isNameChar(c)) {
736
- this.name += chunk.slice(start, this.prevI);
737
- return c === NL_LIKE ? NL : c;
738
- }
739
- }
740
- }
741
- /**
742
- * Skip white spaces.
743
- *
744
- * @return The character that ended the skip, or ``EOC`` if we hit
745
- * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
746
- * instead.
747
- */
748
- skipSpaces() {
749
- // eslint-disable-next-line no-constant-condition
750
- while (true) {
751
- const c = this.getCodeNorm();
752
- if (c === EOC || !isS(c)) {
753
- return c;
754
- }
755
- }
756
- }
757
- setXMLVersion(version) {
758
- this.currentXMLVersion = version;
759
- /* eslint-disable @typescript-eslint/unbound-method */
760
- if (version === "1.0") {
761
- this.isChar = isChar10;
762
- this.getCode = this.getCode10;
763
- }
764
- else {
765
- this.isChar = isChar11;
766
- this.getCode = this.getCode11;
767
- }
768
- /* eslint-enable @typescript-eslint/unbound-method */
769
- }
770
- // STATE ENGINE METHODS
771
- // This needs to be a state separate from S_BEGIN_WHITESPACE because we want
772
- // to be sure never to come back to this state later.
773
- sBegin() {
774
- // We are essentially peeking at the first character of the chunk. Since
775
- // S_BEGIN can be in effect only when we start working on the first chunk,
776
- // the index at which we must look is necessarily 0. Note also that the
777
- // following test does not depend on decoding surrogates.
778
- // If the initial character is 0xFEFF, ignore it.
779
- if (this.chunk.charCodeAt(0) === 0xFEFF) {
780
- this.i++;
781
- this.column++;
782
- }
783
- this.state = S_BEGIN_WHITESPACE;
784
- }
785
- sBeginWhitespace() {
786
- // We need to know whether we've encountered spaces or not because as soon
787
- // as we run into a space, an XML declaration is no longer possible. Rather
788
- // than slow down skipSpaces even in places where we don't care whether it
789
- // skipped anything or not, we check whether prevI is equal to the value of
790
- // i from before we skip spaces.
791
- const iBefore = this.i;
792
- const c = this.skipSpaces();
793
- if (this.prevI !== iBefore) {
794
- this.xmlDeclPossible = false;
795
- }
796
- switch (c) {
797
- case LESS:
798
- this.state = S_OPEN_WAKA;
799
- // We could naively call closeText but in this state, it is not normal
800
- // to have text be filled with any data.
801
- if (this.text.length !== 0) {
802
- throw new Error("no-empty text at start");
803
- }
804
- break;
805
- case EOC:
806
- break;
807
- default:
808
- this.unget();
809
- this.state = S_TEXT;
810
- this.xmlDeclPossible = false;
811
- }
812
- }
813
- sDoctype() {
814
- var _a;
815
- const c = this.captureTo(DOCTYPE_TERMINATOR);
816
- switch (c) {
817
- case GREATER: {
818
- // eslint-disable-next-line no-unused-expressions
819
- (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
820
- this.text = "";
821
- this.state = S_TEXT;
822
- this.doctype = true; // just remember that we saw it.
823
- break;
824
- }
825
- case EOC:
826
- break;
827
- default:
828
- this.text += String.fromCodePoint(c);
829
- if (c === OPEN_BRACKET) {
830
- this.state = S_DTD;
831
- }
832
- else if (isQuote(c)) {
833
- this.state = S_DOCTYPE_QUOTE;
834
- this.q = c;
835
- }
836
- }
837
- }
838
- sDoctypeQuote() {
839
- const q = this.q;
840
- if (this.captureToChar(q)) {
841
- this.text += String.fromCodePoint(q);
842
- this.q = null;
843
- this.state = S_DOCTYPE;
844
- }
845
- }
846
- sDTD() {
847
- const c = this.captureTo(DTD_TERMINATOR);
848
- if (c === EOC) {
849
- return;
850
- }
851
- this.text += String.fromCodePoint(c);
852
- if (c === CLOSE_BRACKET) {
853
- this.state = S_DOCTYPE;
854
- }
855
- else if (c === LESS) {
856
- this.state = S_DTD_OPEN_WAKA;
857
- }
858
- else if (isQuote(c)) {
859
- this.state = S_DTD_QUOTED;
860
- this.q = c;
861
- }
862
- }
863
- sDTDQuoted() {
864
- const q = this.q;
865
- if (this.captureToChar(q)) {
866
- this.text += String.fromCodePoint(q);
867
- this.state = S_DTD;
868
- this.q = null;
869
- }
870
- }
871
- sDTDOpenWaka() {
872
- const c = this.getCodeNorm();
873
- this.text += String.fromCodePoint(c);
874
- switch (c) {
875
- case BANG:
876
- this.state = S_DTD_OPEN_WAKA_BANG;
877
- this.openWakaBang = "";
878
- break;
879
- case QUESTION:
880
- this.state = S_DTD_PI;
881
- break;
882
- default:
883
- this.state = S_DTD;
884
- }
885
- }
886
- sDTDOpenWakaBang() {
887
- const char = String.fromCodePoint(this.getCodeNorm());
888
- const owb = this.openWakaBang += char;
889
- this.text += char;
890
- if (owb !== "-") {
891
- this.state = owb === "--" ? S_DTD_COMMENT : S_DTD;
892
- this.openWakaBang = "";
893
- }
894
- }
895
- sDTDComment() {
896
- if (this.captureToChar(MINUS)) {
897
- this.text += "-";
898
- this.state = S_DTD_COMMENT_ENDING;
899
- }
900
- }
901
- sDTDCommentEnding() {
902
- const c = this.getCodeNorm();
903
- this.text += String.fromCodePoint(c);
904
- this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;
905
- }
906
- sDTDCommentEnded() {
907
- const c = this.getCodeNorm();
908
- this.text += String.fromCodePoint(c);
909
- if (c === GREATER) {
910
- this.state = S_DTD;
911
- }
912
- else {
913
- this.fail("malformed comment.");
914
- // <!-- blah -- bloo --> will be recorded as
915
- // a comment of " blah -- bloo "
916
- this.state = S_DTD_COMMENT;
917
- }
918
- }
919
- sDTDPI() {
920
- if (this.captureToChar(QUESTION)) {
921
- this.text += "?";
922
- this.state = S_DTD_PI_ENDING;
923
- }
924
- }
925
- sDTDPIEnding() {
926
- const c = this.getCodeNorm();
927
- this.text += String.fromCodePoint(c);
928
- if (c === GREATER) {
929
- this.state = S_DTD;
930
- }
931
- }
932
- sText() {
933
- //
934
- // We did try a version of saxes where the S_TEXT state was split in two
935
- // states: one for text inside the root element, and one for text
936
- // outside. This was avoiding having to test this.tags.length to decide
937
- // what implementation to actually use.
938
- //
939
- // Peformance testing on gigabyte-size files did not show any advantage to
940
- // using the two states solution instead of the current one. Conversely, it
941
- // made the code a bit more complicated elsewhere. For instance, a comment
942
- // can appear before the root element so when a comment ended it was
943
- // necessary to determine whether to return to the S_TEXT state or to the
944
- // new text-outside-root state.
945
- //
946
- if (this.tags.length !== 0) {
947
- this.handleTextInRoot();
948
- }
949
- else {
950
- this.handleTextOutsideRoot();
951
- }
952
- }
953
- sEntity() {
954
- // This is essentially a specialized version of captureToChar(SEMICOLON...)
955
- let { i: start } = this;
956
- const { chunk } = this;
957
- // eslint-disable-next-line no-labels, no-restricted-syntax
958
- loop:
959
- // eslint-disable-next-line no-constant-condition
960
- while (true) {
961
- switch (this.getCode()) {
962
- case NL_LIKE:
963
- this.entity += `${chunk.slice(start, this.prevI)}\n`;
964
- start = this.i;
965
- break;
966
- case SEMICOLON: {
967
- const { entityReturnState } = this;
968
- const entity = this.entity + chunk.slice(start, this.prevI);
969
- this.state = entityReturnState;
970
- let parsed;
971
- if (entity === "") {
972
- this.fail("empty entity name.");
973
- parsed = "&;";
974
- }
975
- else {
976
- parsed = this.parseEntity(entity);
977
- this.entity = "";
978
- }
979
- if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {
980
- this.text += parsed;
981
- }
982
- // eslint-disable-next-line no-labels
983
- break loop;
984
- }
985
- case EOC:
986
- this.entity += chunk.slice(start);
987
- // eslint-disable-next-line no-labels
988
- break loop;
989
- }
990
- }
991
- }
992
- sOpenWaka() {
993
- // Reminder: a state handler is called with at least one character
994
- // available in the current chunk. So the first call to get code inside of
995
- // a state handler cannot return ``EOC``. That's why we don't test
996
- // for it.
997
- const c = this.getCode();
998
- // either a /, ?, !, or text is coming next.
999
- if (isNameStartChar(c)) {
1000
- this.state = S_OPEN_TAG;
1001
- this.unget();
1002
- this.xmlDeclPossible = false;
1003
- }
1004
- else {
1005
- switch (c) {
1006
- case FORWARD_SLASH:
1007
- this.state = S_CLOSE_TAG;
1008
- this.xmlDeclPossible = false;
1009
- break;
1010
- case BANG:
1011
- this.state = S_OPEN_WAKA_BANG;
1012
- this.openWakaBang = "";
1013
- this.xmlDeclPossible = false;
1014
- break;
1015
- case QUESTION:
1016
- this.state = S_PI_FIRST_CHAR;
1017
- break;
1018
- default:
1019
- this.fail("disallowed character in tag name");
1020
- this.state = S_TEXT;
1021
- this.xmlDeclPossible = false;
1022
- }
1023
- }
1024
- }
1025
- sOpenWakaBang() {
1026
- this.openWakaBang += String.fromCodePoint(this.getCodeNorm());
1027
- switch (this.openWakaBang) {
1028
- case "[CDATA[":
1029
- if (!this.sawRoot && !this.reportedTextBeforeRoot) {
1030
- this.fail("text data outside of root node.");
1031
- this.reportedTextBeforeRoot = true;
1032
- }
1033
- if (this.closedRoot && !this.reportedTextAfterRoot) {
1034
- this.fail("text data outside of root node.");
1035
- this.reportedTextAfterRoot = true;
1036
- }
1037
- this.state = S_CDATA;
1038
- this.openWakaBang = "";
1039
- break;
1040
- case "--":
1041
- this.state = S_COMMENT;
1042
- this.openWakaBang = "";
1043
- break;
1044
- case "DOCTYPE":
1045
- this.state = S_DOCTYPE;
1046
- if (this.doctype || this.sawRoot) {
1047
- this.fail("inappropriately located doctype declaration.");
1048
- }
1049
- this.openWakaBang = "";
1050
- break;
1051
- default:
1052
- // 7 happens to be the maximum length of the string that can possibly
1053
- // match one of the cases above.
1054
- if (this.openWakaBang.length >= 7) {
1055
- this.fail("incorrect syntax.");
1056
- }
1057
- }
1058
- }
1059
- sComment() {
1060
- if (this.captureToChar(MINUS)) {
1061
- this.state = S_COMMENT_ENDING;
1062
- }
1063
- }
1064
- sCommentEnding() {
1065
- var _a;
1066
- const c = this.getCodeNorm();
1067
- if (c === MINUS) {
1068
- this.state = S_COMMENT_ENDED;
1069
- // eslint-disable-next-line no-unused-expressions
1070
- (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
1071
- this.text = "";
1072
- }
1073
- else {
1074
- this.text += `-${String.fromCodePoint(c)}`;
1075
- this.state = S_COMMENT;
1076
- }
1077
- }
1078
- sCommentEnded() {
1079
- const c = this.getCodeNorm();
1080
- if (c !== GREATER) {
1081
- this.fail("malformed comment.");
1082
- // <!-- blah -- bloo --> will be recorded as
1083
- // a comment of " blah -- bloo "
1084
- this.text += `--${String.fromCodePoint(c)}`;
1085
- this.state = S_COMMENT;
1086
- }
1087
- else {
1088
- this.state = S_TEXT;
1089
- }
1090
- }
1091
- sCData() {
1092
- if (this.captureToChar(CLOSE_BRACKET)) {
1093
- this.state = S_CDATA_ENDING;
1094
- }
1095
- }
1096
- sCDataEnding() {
1097
- const c = this.getCodeNorm();
1098
- if (c === CLOSE_BRACKET) {
1099
- this.state = S_CDATA_ENDING_2;
1100
- }
1101
- else {
1102
- this.text += `]${String.fromCodePoint(c)}`;
1103
- this.state = S_CDATA;
1104
- }
1105
- }
1106
- sCDataEnding2() {
1107
- var _a;
1108
- const c = this.getCodeNorm();
1109
- switch (c) {
1110
- case GREATER: {
1111
- // eslint-disable-next-line no-unused-expressions
1112
- (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
1113
- this.text = "";
1114
- this.state = S_TEXT;
1115
- break;
1116
- }
1117
- case CLOSE_BRACKET:
1118
- this.text += "]";
1119
- break;
1120
- default:
1121
- this.text += `]]${String.fromCodePoint(c)}`;
1122
- this.state = S_CDATA;
1123
- }
1124
- }
1125
- // We need this separate state to check the first character fo the pi target
1126
- // with this.nameStartCheck which allows less characters than this.nameCheck.
1127
- sPIFirstChar() {
1128
- const c = this.getCodeNorm();
1129
- // This is first because in the case where the file is well-formed this is
1130
- // the branch taken. We optimize for well-formedness.
1131
- if (this.nameStartCheck(c)) {
1132
- this.piTarget += String.fromCodePoint(c);
1133
- this.state = S_PI_REST;
1134
- }
1135
- else if (c === QUESTION || isS(c)) {
1136
- this.fail("processing instruction without a target.");
1137
- this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;
1138
- }
1139
- else {
1140
- this.fail("disallowed character in processing instruction name.");
1141
- this.piTarget += String.fromCodePoint(c);
1142
- this.state = S_PI_REST;
1143
- }
1144
- }
1145
- sPIRest() {
1146
- // Capture characters into a piTarget while ``this.nameCheck`` run on the
1147
- // character read returns true.
1148
- const { chunk, i: start } = this;
1149
- // eslint-disable-next-line no-constant-condition
1150
- while (true) {
1151
- const c = this.getCodeNorm();
1152
- if (c === EOC) {
1153
- this.piTarget += chunk.slice(start);
1154
- return;
1155
- }
1156
- // NL cannot satisfy this.nameCheck so we don't have to test specifically
1157
- // for it.
1158
- if (!this.nameCheck(c)) {
1159
- this.piTarget += chunk.slice(start, this.prevI);
1160
- const isQuestion = c === QUESTION;
1161
- if (isQuestion || isS(c)) {
1162
- if (this.piTarget === "xml") {
1163
- if (!this.xmlDeclPossible) {
1164
- this.fail("an XML declaration must be at the start of the document.");
1165
- }
1166
- this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;
1167
- }
1168
- else {
1169
- this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;
1170
- }
1171
- }
1172
- else {
1173
- this.fail("disallowed character in processing instruction name.");
1174
- this.piTarget += String.fromCodePoint(c);
1175
- }
1176
- break;
1177
- }
1178
- }
1179
- }
1180
- sPIBody() {
1181
- if (this.text.length === 0) {
1182
- const c = this.getCodeNorm();
1183
- if (c === QUESTION) {
1184
- this.state = S_PI_ENDING;
1185
- }
1186
- else if (!isS(c)) {
1187
- this.text = String.fromCodePoint(c);
1188
- }
1189
- }
1190
- // The question mark character is not valid inside any of the XML
1191
- // declaration name/value pairs.
1192
- else if (this.captureToChar(QUESTION)) {
1193
- this.state = S_PI_ENDING;
1194
- }
1195
- }
1196
- sPIEnding() {
1197
- var _a;
1198
- const c = this.getCodeNorm();
1199
- if (c === GREATER) {
1200
- const { piTarget } = this;
1201
- if (piTarget.toLowerCase() === "xml") {
1202
- this.fail("the XML declaration must appear at the start of the document.");
1203
- }
1204
- // eslint-disable-next-line no-unused-expressions
1205
- (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {
1206
- target: piTarget,
1207
- body: this.text,
1208
- });
1209
- this.piTarget = this.text = "";
1210
- this.state = S_TEXT;
1211
- }
1212
- else if (c === QUESTION) {
1213
- // We ran into ?? as part of a processing instruction. We initially took
1214
- // the first ? as a sign that the PI was ending, but it is not. So we have
1215
- // to add it to the body but we take the new ? as a sign that the PI is
1216
- // ending.
1217
- this.text += "?";
1218
- }
1219
- else {
1220
- this.text += `?${String.fromCodePoint(c)}`;
1221
- this.state = S_PI_BODY;
1222
- }
1223
- this.xmlDeclPossible = false;
1224
- }
1225
- sXMLDeclNameStart() {
1226
- const c = this.skipSpaces();
1227
- // The question mark character is not valid inside any of the XML
1228
- // declaration name/value pairs.
1229
- if (c === QUESTION) {
1230
- // It is valid to go to S_XML_DECL_ENDING from this state.
1231
- this.state = S_XML_DECL_ENDING;
1232
- return;
1233
- }
1234
- if (c !== EOC) {
1235
- this.state = S_XML_DECL_NAME;
1236
- this.name = String.fromCodePoint(c);
1237
- }
1238
- }
1239
- sXMLDeclName() {
1240
- const c = this.captureTo(XML_DECL_NAME_TERMINATOR);
1241
- // The question mark character is not valid inside any of the XML
1242
- // declaration name/value pairs.
1243
- if (c === QUESTION) {
1244
- this.state = S_XML_DECL_ENDING;
1245
- this.name += this.text;
1246
- this.text = "";
1247
- this.fail("XML declaration is incomplete.");
1248
- return;
1249
- }
1250
- if (!(isS(c) || c === EQUAL)) {
1251
- return;
1252
- }
1253
- this.name += this.text;
1254
- this.text = "";
1255
- if (!this.xmlDeclExpects.includes(this.name)) {
1256
- switch (this.name.length) {
1257
- case 0:
1258
- this.fail("did not expect any more name/value pairs.");
1259
- break;
1260
- case 1:
1261
- this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
1262
- break;
1263
- default:
1264
- this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
1265
- }
1266
- }
1267
- this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;
1268
- }
1269
- sXMLDeclEq() {
1270
- const c = this.getCodeNorm();
1271
- // The question mark character is not valid inside any of the XML
1272
- // declaration name/value pairs.
1273
- if (c === QUESTION) {
1274
- this.state = S_XML_DECL_ENDING;
1275
- this.fail("XML declaration is incomplete.");
1276
- return;
1277
- }
1278
- if (isS(c)) {
1279
- return;
1280
- }
1281
- if (c !== EQUAL) {
1282
- this.fail("value required.");
1283
- }
1284
- this.state = S_XML_DECL_VALUE_START;
1285
- }
1286
- sXMLDeclValueStart() {
1287
- const c = this.getCodeNorm();
1288
- // The question mark character is not valid inside any of the XML
1289
- // declaration name/value pairs.
1290
- if (c === QUESTION) {
1291
- this.state = S_XML_DECL_ENDING;
1292
- this.fail("XML declaration is incomplete.");
1293
- return;
1294
- }
1295
- if (isS(c)) {
1296
- return;
1297
- }
1298
- if (!isQuote(c)) {
1299
- this.fail("value must be quoted.");
1300
- this.q = SPACE;
1301
- }
1302
- else {
1303
- this.q = c;
1304
- }
1305
- this.state = S_XML_DECL_VALUE;
1306
- }
1307
- sXMLDeclValue() {
1308
- const c = this.captureTo([this.q, QUESTION]);
1309
- // The question mark character is not valid inside any of the XML
1310
- // declaration name/value pairs.
1311
- if (c === QUESTION) {
1312
- this.state = S_XML_DECL_ENDING;
1313
- this.text = "";
1314
- this.fail("XML declaration is incomplete.");
1315
- return;
1316
- }
1317
- if (c === EOC) {
1318
- return;
1319
- }
1320
- const value = this.text;
1321
- this.text = "";
1322
- switch (this.name) {
1323
- case "version": {
1324
- this.xmlDeclExpects = ["encoding", "standalone"];
1325
- const version = value;
1326
- this.xmlDecl.version = version;
1327
- // This is the test specified by XML 1.0 but it is fine for XML 1.1.
1328
- if (!/^1\.[0-9]+$/.test(version)) {
1329
- this.fail("version number must match /^1\\.[0-9]+$/.");
1330
- }
1331
- // When forceXMLVersion is set, the XML declaration is ignored.
1332
- else if (!this.opt.forceXMLVersion) {
1333
- this.setXMLVersion(version);
1334
- }
1335
- break;
1336
- }
1337
- case "encoding":
1338
- if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {
1339
- this.fail("encoding value must match \
1340
- /^[A-Za-z0-9][A-Za-z0-9._-]*$/.");
1341
- }
1342
- this.xmlDeclExpects = ["standalone"];
1343
- this.xmlDecl.encoding = value;
1344
- break;
1345
- case "standalone":
1346
- if (value !== "yes" && value !== "no") {
1347
- this.fail("standalone value must match \"yes\" or \"no\".");
1348
- }
1349
- this.xmlDeclExpects = [];
1350
- this.xmlDecl.standalone = value;
1351
- break;
1352
- // We don't need to raise an error here since we've already raised one
1353
- // when checking what name was expected.
1354
- }
1355
- this.name = "";
1356
- this.state = S_XML_DECL_SEPARATOR;
1357
- }
1358
- sXMLDeclSeparator() {
1359
- const c = this.getCodeNorm();
1360
- // The question mark character is not valid inside any of the XML
1361
- // declaration name/value pairs.
1362
- if (c === QUESTION) {
1363
- // It is valid to go to S_XML_DECL_ENDING from this state.
1364
- this.state = S_XML_DECL_ENDING;
1365
- return;
1366
- }
1367
- if (!isS(c)) {
1368
- this.fail("whitespace required.");
1369
- this.unget();
1370
- }
1371
- this.state = S_XML_DECL_NAME_START;
1372
- }
1373
- sXMLDeclEnding() {
1374
- var _a;
1375
- const c = this.getCodeNorm();
1376
- if (c === GREATER) {
1377
- if (this.piTarget !== "xml") {
1378
- this.fail("processing instructions are not allowed before root.");
1379
- }
1380
- else if (this.name !== "version" &&
1381
- this.xmlDeclExpects.includes("version")) {
1382
- this.fail("XML declaration must contain a version.");
1383
- }
1384
- // eslint-disable-next-line no-unused-expressions
1385
- (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);
1386
- this.name = "";
1387
- this.piTarget = this.text = "";
1388
- this.state = S_TEXT;
1389
- }
1390
- else {
1391
- // We got here because the previous character was a ?, but the question
1392
- // mark character is not valid inside any of the XML declaration
1393
- // name/value pairs.
1394
- this.fail("The character ? is disallowed anywhere in XML declarations.");
1395
- }
1396
- this.xmlDeclPossible = false;
1397
- }
1398
- sOpenTag() {
1399
- var _a;
1400
- const c = this.captureNameChars();
1401
- if (c === EOC) {
1402
- return;
1403
- }
1404
- const tag = this.tag = {
1405
- name: this.name,
1406
- attributes: Object.create(null),
1407
- };
1408
- this.name = "";
1409
- if (this.xmlnsOpt) {
1410
- this.topNS = tag.ns = Object.create(null);
1411
- }
1412
- // eslint-disable-next-line no-unused-expressions
1413
- (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1414
- this.sawRoot = true;
1415
- if (!this.fragmentOpt && this.closedRoot) {
1416
- this.fail("documents may contain only one root.");
1417
- }
1418
- switch (c) {
1419
- case GREATER:
1420
- this.openTag();
1421
- break;
1422
- case FORWARD_SLASH:
1423
- this.state = S_OPEN_TAG_SLASH;
1424
- break;
1425
- default:
1426
- if (!isS(c)) {
1427
- this.fail("disallowed character in tag name.");
1428
- }
1429
- this.state = S_ATTRIB;
1430
- }
1431
- }
1432
- sOpenTagSlash() {
1433
- if (this.getCode() === GREATER) {
1434
- this.openSelfClosingTag();
1435
- }
1436
- else {
1437
- this.fail("forward-slash in opening tag not followed by >.");
1438
- this.state = S_ATTRIB;
1439
- }
1440
- }
1441
- sAttrib() {
1442
- const c = this.skipSpaces();
1443
- if (c === EOC) {
1444
- return;
1445
- }
1446
- if (isNameStartChar(c)) {
1447
- this.unget();
1448
- this.state = S_ATTRIB_NAME;
1449
- }
1450
- else if (c === GREATER) {
1451
- this.openTag();
1452
- }
1453
- else if (c === FORWARD_SLASH) {
1454
- this.state = S_OPEN_TAG_SLASH;
1455
- }
1456
- else {
1457
- this.fail("disallowed character in attribute name.");
1458
- }
1459
- }
1460
- sAttribName() {
1461
- const c = this.captureNameChars();
1462
- if (c === EQUAL) {
1463
- this.state = S_ATTRIB_VALUE;
1464
- }
1465
- else if (isS(c)) {
1466
- this.state = S_ATTRIB_NAME_SAW_WHITE;
1467
- }
1468
- else if (c === GREATER) {
1469
- this.fail("attribute without value.");
1470
- this.pushAttrib(this.name, this.name);
1471
- this.name = this.text = "";
1472
- this.openTag();
1473
- }
1474
- else if (c !== EOC) {
1475
- this.fail("disallowed character in attribute name.");
1476
- }
1477
- }
1478
- sAttribNameSawWhite() {
1479
- const c = this.skipSpaces();
1480
- switch (c) {
1481
- case EOC:
1482
- return;
1483
- case EQUAL:
1484
- this.state = S_ATTRIB_VALUE;
1485
- break;
1486
- default:
1487
- this.fail("attribute without value.");
1488
- // Should we do this???
1489
- // this.tag.attributes[this.name] = "";
1490
- this.text = "";
1491
- this.name = "";
1492
- if (c === GREATER) {
1493
- this.openTag();
1494
- }
1495
- else if (isNameStartChar(c)) {
1496
- this.unget();
1497
- this.state = S_ATTRIB_NAME;
1498
- }
1499
- else {
1500
- this.fail("disallowed character in attribute name.");
1501
- this.state = S_ATTRIB;
1502
- }
1503
- }
1504
- }
1505
- sAttribValue() {
1506
- const c = this.getCodeNorm();
1507
- if (isQuote(c)) {
1508
- this.q = c;
1509
- this.state = S_ATTRIB_VALUE_QUOTED;
1510
- }
1511
- else if (!isS(c)) {
1512
- this.fail("unquoted attribute value.");
1513
- this.state = S_ATTRIB_VALUE_UNQUOTED;
1514
- this.unget();
1515
- }
1516
- }
1517
- sAttribValueQuoted() {
1518
- // We deliberately do not use captureTo here. The specialized code we use
1519
- // here is faster than using captureTo.
1520
- const { q, chunk } = this;
1521
- let { i: start } = this;
1522
- // eslint-disable-next-line no-constant-condition
1523
- while (true) {
1524
- switch (this.getCode()) {
1525
- case q:
1526
- this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));
1527
- this.name = this.text = "";
1528
- this.q = null;
1529
- this.state = S_ATTRIB_VALUE_CLOSED;
1530
- return;
1531
- case AMP:
1532
- this.text += chunk.slice(start, this.prevI);
1533
- this.state = S_ENTITY;
1534
- this.entityReturnState = S_ATTRIB_VALUE_QUOTED;
1535
- return;
1536
- case NL:
1537
- case NL_LIKE:
1538
- case TAB:
1539
- this.text += `${chunk.slice(start, this.prevI)} `;
1540
- start = this.i;
1541
- break;
1542
- case LESS:
1543
- this.text += chunk.slice(start, this.prevI);
1544
- this.fail("disallowed character.");
1545
- return;
1546
- case EOC:
1547
- this.text += chunk.slice(start);
1548
- return;
1549
- }
1550
- }
1551
- }
1552
- sAttribValueClosed() {
1553
- const c = this.getCodeNorm();
1554
- if (isS(c)) {
1555
- this.state = S_ATTRIB;
1556
- }
1557
- else if (c === GREATER) {
1558
- this.openTag();
1559
- }
1560
- else if (c === FORWARD_SLASH) {
1561
- this.state = S_OPEN_TAG_SLASH;
1562
- }
1563
- else if (isNameStartChar(c)) {
1564
- this.fail("no whitespace between attributes.");
1565
- this.unget();
1566
- this.state = S_ATTRIB_NAME;
1567
- }
1568
- else {
1569
- this.fail("disallowed character in attribute name.");
1570
- }
1571
- }
1572
- sAttribValueUnquoted() {
1573
- // We don't do anything regarding EOL or space handling for unquoted
1574
- // attributes. We already have failed by the time we get here, and the
1575
- // contract that saxes upholds states that upon failure, it is not safe to
1576
- // rely on the data passed to event handlers (other than
1577
- // ``onerror``). Passing "bad" data is not a problem.
1578
- const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);
1579
- switch (c) {
1580
- case AMP:
1581
- this.state = S_ENTITY;
1582
- this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;
1583
- break;
1584
- case LESS:
1585
- this.fail("disallowed character.");
1586
- break;
1587
- case EOC:
1588
- break;
1589
- default:
1590
- if (this.text.includes("]]>")) {
1591
- this.fail("the string \"]]>\" is disallowed in char data.");
1592
- }
1593
- this.pushAttrib(this.name, this.text);
1594
- this.name = this.text = "";
1595
- if (c === GREATER) {
1596
- this.openTag();
1597
- }
1598
- else {
1599
- this.state = S_ATTRIB;
1600
- }
1601
- }
1602
- }
1603
- sCloseTag() {
1604
- const c = this.captureNameChars();
1605
- if (c === GREATER) {
1606
- this.closeTag();
1607
- }
1608
- else if (isS(c)) {
1609
- this.state = S_CLOSE_TAG_SAW_WHITE;
1610
- }
1611
- else if (c !== EOC) {
1612
- this.fail("disallowed character in closing tag.");
1613
- }
1614
- }
1615
- sCloseTagSawWhite() {
1616
- switch (this.skipSpaces()) {
1617
- case GREATER:
1618
- this.closeTag();
1619
- break;
1620
- case EOC:
1621
- break;
1622
- default:
1623
- this.fail("disallowed character in closing tag.");
1624
- }
1625
- }
1626
- // END OF STATE ENGINE METHODS
1627
- handleTextInRoot() {
1628
- // This is essentially a specialized version of captureTo which is optimized
1629
- // for performing the ]]> check. A previous version of this code, checked
1630
- // ``this.text`` for the presence of ]]>. It simplified the code but was
1631
- // very costly when character data contained a lot of entities to be parsed.
1632
- //
1633
- // Since we are using a specialized loop, we also keep track of the presence
1634
- // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.
1635
- //
1636
- let { i: start, forbiddenState } = this;
1637
- const { chunk, textHandler: handler } = this;
1638
- // eslint-disable-next-line no-labels, no-restricted-syntax
1639
- scanLoop:
1640
- // eslint-disable-next-line no-constant-condition
1641
- while (true) {
1642
- switch (this.getCode()) {
1643
- case LESS: {
1644
- this.state = S_OPEN_WAKA;
1645
- if (handler !== undefined) {
1646
- const { text } = this;
1647
- const slice = chunk.slice(start, this.prevI);
1648
- if (text.length !== 0) {
1649
- handler(text + slice);
1650
- this.text = "";
1651
- }
1652
- else if (slice.length !== 0) {
1653
- handler(slice);
1654
- }
1655
- }
1656
- forbiddenState = FORBIDDEN_START;
1657
- // eslint-disable-next-line no-labels
1658
- break scanLoop;
1659
- }
1660
- case AMP:
1661
- this.state = S_ENTITY;
1662
- this.entityReturnState = S_TEXT;
1663
- if (handler !== undefined) {
1664
- this.text += chunk.slice(start, this.prevI);
1665
- }
1666
- forbiddenState = FORBIDDEN_START;
1667
- // eslint-disable-next-line no-labels
1668
- break scanLoop;
1669
- case CLOSE_BRACKET:
1670
- switch (forbiddenState) {
1671
- case FORBIDDEN_START:
1672
- forbiddenState = FORBIDDEN_BRACKET;
1673
- break;
1674
- case FORBIDDEN_BRACKET:
1675
- forbiddenState = FORBIDDEN_BRACKET_BRACKET;
1676
- break;
1677
- case FORBIDDEN_BRACKET_BRACKET:
1678
- break;
1679
- default:
1680
- throw new Error("impossible state");
1681
- }
1682
- break;
1683
- case GREATER:
1684
- if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {
1685
- this.fail("the string \"]]>\" is disallowed in char data.");
1686
- }
1687
- forbiddenState = FORBIDDEN_START;
1688
- break;
1689
- case NL_LIKE:
1690
- if (handler !== undefined) {
1691
- this.text += `${chunk.slice(start, this.prevI)}\n`;
1692
- }
1693
- start = this.i;
1694
- forbiddenState = FORBIDDEN_START;
1695
- break;
1696
- case EOC:
1697
- if (handler !== undefined) {
1698
- this.text += chunk.slice(start);
1699
- }
1700
- // eslint-disable-next-line no-labels
1701
- break scanLoop;
1702
- default:
1703
- forbiddenState = FORBIDDEN_START;
1704
- }
1705
- }
1706
- this.forbiddenState = forbiddenState;
1707
- }
1708
- handleTextOutsideRoot() {
1709
- // This is essentially a specialized version of captureTo which is optimized
1710
- // for a specialized task. We keep track of the presence of non-space
1711
- // characters in the text since these are errors when appearing outside the
1712
- // document root element.
1713
- let { i: start } = this;
1714
- const { chunk, textHandler: handler } = this;
1715
- let nonSpace = false;
1716
- // eslint-disable-next-line no-labels, no-restricted-syntax
1717
- outRootLoop:
1718
- // eslint-disable-next-line no-constant-condition
1719
- while (true) {
1720
- const code = this.getCode();
1721
- switch (code) {
1722
- case LESS: {
1723
- this.state = S_OPEN_WAKA;
1724
- if (handler !== undefined) {
1725
- const { text } = this;
1726
- const slice = chunk.slice(start, this.prevI);
1727
- if (text.length !== 0) {
1728
- handler(text + slice);
1729
- this.text = "";
1730
- }
1731
- else if (slice.length !== 0) {
1732
- handler(slice);
1733
- }
1734
- }
1735
- // eslint-disable-next-line no-labels
1736
- break outRootLoop;
1737
- }
1738
- case AMP:
1739
- this.state = S_ENTITY;
1740
- this.entityReturnState = S_TEXT;
1741
- if (handler !== undefined) {
1742
- this.text += chunk.slice(start, this.prevI);
1743
- }
1744
- nonSpace = true;
1745
- // eslint-disable-next-line no-labels
1746
- break outRootLoop;
1747
- case NL_LIKE:
1748
- if (handler !== undefined) {
1749
- this.text += `${chunk.slice(start, this.prevI)}\n`;
1750
- }
1751
- start = this.i;
1752
- break;
1753
- case EOC:
1754
- if (handler !== undefined) {
1755
- this.text += chunk.slice(start);
1756
- }
1757
- // eslint-disable-next-line no-labels
1758
- break outRootLoop;
1759
- default:
1760
- if (!isS(code)) {
1761
- nonSpace = true;
1762
- }
1763
- }
1764
- }
1765
- if (!nonSpace) {
1766
- return;
1767
- }
1768
- // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags
1769
- // to avoid reporting errors for every single character that is out of
1770
- // place.
1771
- if (!this.sawRoot && !this.reportedTextBeforeRoot) {
1772
- this.fail("text data outside of root node.");
1773
- this.reportedTextBeforeRoot = true;
1774
- }
1775
- if (this.closedRoot && !this.reportedTextAfterRoot) {
1776
- this.fail("text data outside of root node.");
1777
- this.reportedTextAfterRoot = true;
1778
- }
1779
- }
1780
- pushAttribNS(name, value) {
1781
- var _a;
1782
- const { prefix, local } = this.qname(name);
1783
- const attr = { name, prefix, local, value };
1784
- this.attribList.push(attr);
1785
- // eslint-disable-next-line no-unused-expressions
1786
- (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
1787
- if (prefix === "xmlns") {
1788
- const trimmed = value.trim();
1789
- if (this.currentXMLVersion === "1.0" && trimmed === "") {
1790
- this.fail("invalid attempt to undefine prefix in XML 1.0");
1791
- }
1792
- this.topNS[local] = trimmed;
1793
- nsPairCheck(this, local, trimmed);
1794
- }
1795
- else if (name === "xmlns") {
1796
- const trimmed = value.trim();
1797
- this.topNS[""] = trimmed;
1798
- nsPairCheck(this, "", trimmed);
1799
- }
1800
- }
1801
- pushAttribPlain(name, value) {
1802
- var _a;
1803
- const attr = { name, value };
1804
- this.attribList.push(attr);
1805
- // eslint-disable-next-line no-unused-expressions
1806
- (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
1807
- }
1808
- /**
1809
- * End parsing. This performs final well-formedness checks and resets the
1810
- * parser to a clean state.
1811
- *
1812
- * @returns this
1813
- */
1814
- end() {
1815
- var _a, _b;
1816
- if (!this.sawRoot) {
1817
- this.fail("document must contain a root element.");
1818
- }
1819
- const { tags } = this;
1820
- while (tags.length > 0) {
1821
- const tag = tags.pop();
1822
- this.fail(`unclosed tag: ${tag.name}`);
1823
- }
1824
- if ((this.state !== S_BEGIN) && (this.state !== S_TEXT)) {
1825
- this.fail("unexpected end.");
1826
- }
1827
- const { text } = this;
1828
- if (text.length !== 0) {
1829
- // eslint-disable-next-line no-unused-expressions
1830
- (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);
1831
- this.text = "";
1832
- }
1833
- this._closed = true;
1834
- // eslint-disable-next-line no-unused-expressions
1835
- (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);
1836
- this._init();
1837
- return this;
1838
- }
1839
- /**
1840
- * Resolve a namespace prefix.
1841
- *
1842
- * @param prefix The prefix to resolve.
1843
- *
1844
- * @returns The namespace URI or ``undefined`` if the prefix is not defined.
1845
- */
1846
- resolve(prefix) {
1847
- var _a, _b;
1848
- let uri = this.topNS[prefix];
1849
- if (uri !== undefined) {
1850
- return uri;
1851
- }
1852
- const { tags } = this;
1853
- for (let index = tags.length - 1; index >= 0; index--) {
1854
- uri = tags[index].ns[prefix];
1855
- if (uri !== undefined) {
1856
- return uri;
1857
- }
1858
- }
1859
- uri = this.ns[prefix];
1860
- if (uri !== undefined) {
1861
- return uri;
1862
- }
1863
- return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);
1864
- }
1865
- /**
1866
- * Parse a qname into its prefix and local name parts.
1867
- *
1868
- * @param name The name to parse
1869
- *
1870
- * @returns
1871
- */
1872
- qname(name) {
1873
- // This is faster than using name.split(":").
1874
- const colon = name.indexOf(":");
1875
- if (colon === -1) {
1876
- return { prefix: "", local: name };
1877
- }
1878
- const local = name.slice(colon + 1);
1879
- const prefix = name.slice(0, colon);
1880
- if (prefix === "" || local === "" || local.includes(":")) {
1881
- this.fail(`malformed name: ${name}.`);
1882
- }
1883
- return { prefix, local };
1884
- }
1885
- processAttribsNS() {
1886
- var _a;
1887
- const { attribList } = this;
1888
- const tag = this.tag;
1889
- {
1890
- // add namespace info to tag
1891
- const { prefix, local } = this.qname(tag.name);
1892
- tag.prefix = prefix;
1893
- tag.local = local;
1894
- const uri = tag.uri = (_a = this.resolve(prefix)) !== null && _a !== void 0 ? _a : "";
1895
- if (prefix !== "") {
1896
- if (prefix === "xmlns") {
1897
- this.fail("tags may not have \"xmlns\" as prefix.");
1898
- }
1899
- if (uri === "") {
1900
- this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);
1901
- tag.uri = prefix;
1902
- }
1903
- }
1904
- }
1905
- if (attribList.length === 0) {
1906
- return;
1907
- }
1908
- const { attributes } = tag;
1909
- const seen = new Set();
1910
- // Note: do not apply default ns to attributes:
1911
- // http://www.w3.org/TR/REC-xml-names/#defaulting
1912
- for (const attr of attribList) {
1913
- const { name, prefix, local } = attr;
1914
- let uri;
1915
- let eqname;
1916
- if (prefix === "") {
1917
- uri = name === "xmlns" ? XMLNS_NAMESPACE : "";
1918
- eqname = name;
1919
- }
1920
- else {
1921
- uri = this.resolve(prefix);
1922
- // if there's any attributes with an undefined namespace,
1923
- // then fail on them now.
1924
- if (uri === undefined) {
1925
- this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);
1926
- uri = prefix;
1927
- }
1928
- eqname = `{${uri}}${local}`;
1929
- }
1930
- if (seen.has(eqname)) {
1931
- this.fail(`duplicate attribute: ${eqname}.`);
1932
- }
1933
- seen.add(eqname);
1934
- attr.uri = uri;
1935
- attributes[name] = attr;
1936
- }
1937
- this.attribList = [];
1938
- }
1939
- processAttribsPlain() {
1940
- const { attribList } = this;
1941
- // eslint-disable-next-line prefer-destructuring
1942
- const attributes = this.tag.attributes;
1943
- for (const { name, value } of attribList) {
1944
- if (attributes[name] !== undefined) {
1945
- this.fail(`duplicate attribute: ${name}.`);
1946
- }
1947
- attributes[name] = value;
1948
- }
1949
- this.attribList = [];
1950
- }
1951
- /**
1952
- * Handle a complete open tag. This parser code calls this once it has seen
1953
- * the whole tag. This method checks for well-formeness and then emits
1954
- * ``onopentag``.
1955
- */
1956
- openTag() {
1957
- var _a;
1958
- this.processAttribs();
1959
- const { tags } = this;
1960
- const tag = this.tag;
1961
- tag.isSelfClosing = false;
1962
- // There cannot be any pending text here due to the onopentagstart that was
1963
- // necessarily emitted before we get here. So we do not check text.
1964
- // eslint-disable-next-line no-unused-expressions
1965
- (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1966
- tags.push(tag);
1967
- this.state = S_TEXT;
1968
- this.name = "";
1969
- }
1970
- /**
1971
- * Handle a complete self-closing tag. This parser code calls this once it has
1972
- * seen the whole tag. This method checks for well-formeness and then emits
1973
- * ``onopentag`` and ``onclosetag``.
1974
- */
1975
- openSelfClosingTag() {
1976
- var _a, _b, _c;
1977
- this.processAttribs();
1978
- const { tags } = this;
1979
- const tag = this.tag;
1980
- tag.isSelfClosing = true;
1981
- // There cannot be any pending text here due to the onopentagstart that was
1982
- // necessarily emitted before we get here. So we do not check text.
1983
- // eslint-disable-next-line no-unused-expressions
1984
- (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1985
- // eslint-disable-next-line no-unused-expressions
1986
- (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);
1987
- const top = this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null;
1988
- if (top === null) {
1989
- this.closedRoot = true;
1990
- }
1991
- this.state = S_TEXT;
1992
- this.name = "";
1993
- }
1994
- /**
1995
- * Handle a complete close tag. This parser code calls this once it has seen
1996
- * the whole tag. This method checks for well-formeness and then emits
1997
- * ``onclosetag``.
1998
- */
1999
- closeTag() {
2000
- const { tags, name } = this;
2001
- // Our state after this will be S_TEXT, no matter what, and we can clear
2002
- // tagName now.
2003
- this.state = S_TEXT;
2004
- this.name = "";
2005
- if (name === "") {
2006
- this.fail("weird empty close tag.");
2007
- this.text += "</>";
2008
- return;
2009
- }
2010
- const handler = this.closeTagHandler;
2011
- let l = tags.length;
2012
- while (l-- > 0) {
2013
- const tag = this.tag = tags.pop();
2014
- this.topNS = tag.ns;
2015
- // eslint-disable-next-line no-unused-expressions
2016
- handler === null || handler === void 0 ? void 0 : handler(tag);
2017
- if (tag.name === name) {
2018
- break;
2019
- }
2020
- this.fail("unexpected close tag.");
2021
- }
2022
- if (l === 0) {
2023
- this.closedRoot = true;
2024
- }
2025
- else if (l < 0) {
2026
- this.fail(`unmatched closing tag: ${name}.`);
2027
- this.text += `</${name}>`;
2028
- }
2029
- }
2030
- /**
2031
- * Resolves an entity. Makes any necessary well-formedness checks.
2032
- *
2033
- * @param entity The entity to resolve.
2034
- *
2035
- * @returns The parsed entity.
2036
- */
2037
- parseEntity(entity) {
2038
- // startsWith would be significantly slower for this test.
2039
- // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
2040
- if (entity[0] !== "#") {
2041
- const defined = this.ENTITIES[entity];
2042
- if (defined !== undefined) {
2043
- return defined;
2044
- }
2045
- this.fail(this.isName(entity) ? "undefined entity." :
2046
- "disallowed character in entity name.");
2047
- return `&${entity};`;
2048
- }
2049
- let num = NaN;
2050
- if (entity[1] === "x" && /^#x[0-9a-f]+$/i.test(entity)) {
2051
- num = parseInt(entity.slice(2), 16);
2052
- }
2053
- else if (/^#[0-9]+$/.test(entity)) {
2054
- num = parseInt(entity.slice(1), 10);
2055
- }
2056
- // The character reference is required to match the CHAR production.
2057
- if (!this.isChar(num)) {
2058
- this.fail("malformed character entity.");
2059
- return `&${entity};`;
2060
- }
2061
- return String.fromCodePoint(num);
2062
- }
2063
- }
2064
- saxes.SaxesParser = SaxesParser;
2065
-
2066
- export { saxes as default };