@goodpeanuts/dsh-sui 0.0.0-stage → 0.1.0

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 (823) hide show
  1. package/README.md +100 -3
  2. package/THIRD_PARTY_NOTICES.txt +1064 -0
  3. package/apps/cli/dist/_virtual/_rolldown/runtime.mjs +35 -0
  4. package/apps/cli/dist/args.mjs +204 -0
  5. package/apps/cli/dist/cli.mjs +392 -0
  6. package/apps/cli/dist/errors.mjs +32 -0
  7. package/apps/cli/dist/help.mjs +73 -0
  8. package/apps/cli/dist/io.mjs +37 -0
  9. package/apps/cli/dist/main.mjs +10 -0
  10. package/apps/cli/dist/node_modules/.pnpm/@keyv_serialize@1.1.1/node_modules/@keyv/serialize/dist/index.mjs +37 -0
  11. package/apps/cli/dist/node_modules/.pnpm/@sec-ant_readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.mjs +81 -0
  12. package/apps/cli/dist/node_modules/.pnpm/@sec-ant_readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.mjs +1 -0
  13. package/apps/cli/dist/node_modules/.pnpm/@sindresorhus_is@7.2.0/node_modules/@sindresorhus/is/distribution/index.mjs +1015 -0
  14. package/apps/cli/dist/node_modules/.pnpm/@sindresorhus_is@7.2.0/node_modules/@sindresorhus/is/distribution/utilities.mjs +6 -0
  15. package/apps/cli/dist/node_modules/.pnpm/boolbase@1.0.0/node_modules/boolbase/index.mjs +15 -0
  16. package/apps/cli/dist/node_modules/.pnpm/byte-counter@0.1.0/node_modules/byte-counter/utilities.mjs +9 -0
  17. package/apps/cli/dist/node_modules/.pnpm/cacheable-lookup@7.0.0/node_modules/cacheable-lookup/source/index.mjs +279 -0
  18. package/apps/cli/dist/node_modules/.pnpm/cacheable-request@13.0.19/node_modules/cacheable-request/dist/index.mjs +274 -0
  19. package/apps/cli/dist/node_modules/.pnpm/cacheable-request@13.0.19/node_modules/cacheable-request/dist/types.mjs +15 -0
  20. package/apps/cli/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/helpers.mjs +15 -0
  21. package/apps/cli/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/index.mjs +159 -0
  22. package/apps/cli/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/positionals.mjs +33 -0
  23. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/attributes.mjs +465 -0
  24. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/css.mjs +94 -0
  25. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/extract.mjs +39 -0
  26. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/forms.mjs +63 -0
  27. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/manipulation.mjs +731 -0
  28. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/traversing.mjs +828 -0
  29. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/cheerio.mjs +53 -0
  30. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/index.mjs +11 -0
  31. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/load-parse.mjs +25 -0
  32. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/load.mjs +73 -0
  33. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/options.mjs +27 -0
  34. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/parse.mjs +53 -0
  35. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/parsers/parse5-adapter.mjs +42 -0
  36. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/static.mjs +165 -0
  37. package/apps/cli/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/utils.mjs +78 -0
  38. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/attributes.mjs +187 -0
  39. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/compile.mjs +77 -0
  40. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/general.mjs +89 -0
  41. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/index.mjs +43 -0
  42. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/aliases.mjs +32 -0
  43. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/filters.mjs +114 -0
  44. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/index.mjs +35 -0
  45. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.mjs +53 -0
  46. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/subselects.mjs +68 -0
  47. package/apps/cli/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/sort.mjs +60 -0
  48. package/apps/cli/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/index.mjs +50 -0
  49. package/apps/cli/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/parse.mjs +320 -0
  50. package/apps/cli/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/stringify.mjs +102 -0
  51. package/apps/cli/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/types.mjs +45 -0
  52. package/apps/cli/dist/node_modules/.pnpm/decompress-response@10.0.0/node_modules/decompress-response/index.mjs +59 -0
  53. package/apps/cli/dist/node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/foreignNames.mjs +103 -0
  54. package/apps/cli/dist/node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.mjs +144 -0
  55. package/apps/cli/dist/node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.mjs +51 -0
  56. package/apps/cli/dist/node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/index.mjs +128 -0
  57. package/apps/cli/dist/node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/node.mjs +312 -0
  58. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/feeds.mjs +161 -0
  59. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/helpers.mjs +113 -0
  60. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/index.mjs +56 -0
  61. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/legacy.mjs +141 -0
  62. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/manipulation.mjs +117 -0
  63. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/querying.mjs +124 -0
  64. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/stringify.mjs +69 -0
  65. package/apps/cli/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/traversal.mjs +109 -0
  66. package/apps/cli/dist/node_modules/.pnpm/encoding-sniffer@0.2.1/node_modules/encoding-sniffer/dist/esm/index.mjs +7 -0
  67. package/apps/cli/dist/node_modules/.pnpm/encoding-sniffer@0.2.1/node_modules/encoding-sniffer/dist/esm/sniffer.mjs +112 -0
  68. package/apps/cli/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/escape.mjs +83 -0
  69. package/apps/cli/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs +43 -0
  70. package/apps/cli/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.mjs +330 -0
  71. package/apps/cli/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/escape.mjs +49 -0
  72. package/apps/cli/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs +4 -0
  73. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs +57 -0
  74. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/decode.mjs +351 -0
  75. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs +5 -0
  76. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/generated/decode-data-xml.mjs +5 -0
  77. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/internal/bin-trie-flags.mjs +20 -0
  78. package/apps/cli/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/internal/decode-shared.mjs +14 -0
  79. package/apps/cli/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/index.mjs +871 -0
  80. package/apps/cli/dist/node_modules/.pnpm/form-data-encoder@4.1.0/node_modules/form-data-encoder/lib/index.mjs +279 -0
  81. package/apps/cli/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.mjs +54 -0
  82. package/apps/cli/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/buffer.mjs +14 -0
  83. package/apps/cli/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.mjs +80 -0
  84. package/apps/cli/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.mjs +41 -0
  85. package/apps/cli/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.mjs +8 -0
  86. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/as-promise/index.mjs +154 -0
  87. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/as-promise/types.mjs +20 -0
  88. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/calculate-retry-delay.mjs +20 -0
  89. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/diagnostics-channel.mjs +38 -0
  90. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/errors.mjs +132 -0
  91. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/index.mjs +923 -0
  92. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/options.mjs +1622 -0
  93. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/parse-link-header.mjs +27 -0
  94. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/response.mjs +36 -0
  95. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/timed-out.mjs +107 -0
  96. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/defer-to-connect.mjs +28 -0
  97. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/get-body-size.mjs +23 -0
  98. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-client-request.mjs +6 -0
  99. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-form-data.mjs +7 -0
  100. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-unix-socket-url.mjs +25 -0
  101. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/proxy-events.mjs +16 -0
  102. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/timer.mjs +114 -0
  103. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/unhandle.mjs +23 -0
  104. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/url-to-options.mjs +20 -0
  105. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/weakable-map.mjs +19 -0
  106. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/create.mjs +166 -0
  107. package/apps/cli/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/index.mjs +17 -0
  108. package/apps/cli/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/Parser.mjs +441 -0
  109. package/apps/cli/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/Tokenizer.mjs +661 -0
  110. package/apps/cli/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/index.mjs +19 -0
  111. package/apps/cli/dist/node_modules/.pnpm/http-cache-semantics@4.3.0/node_modules/http-cache-semantics/index.mjs +608 -0
  112. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/agent.mjs +441 -0
  113. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/auto.mjs +145 -0
  114. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/client-request.mjs +318 -0
  115. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/incoming-message.mjs +58 -0
  116. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/index.mjs +51 -0
  117. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/get-auth-headers.mjs +19 -0
  118. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h1-over-h2.mjs +84 -0
  119. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-h1.mjs +49 -0
  120. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-h2.mjs +38 -0
  121. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-hx.mjs +39 -0
  122. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/initialize.mjs +23 -0
  123. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.mjs +15 -0
  124. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/calculate-server-name.mjs +24 -0
  125. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/check-type.mjs +17 -0
  126. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/delay-async-destroy.mjs +28 -0
  127. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/errors.mjs +30 -0
  128. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.mjs +16 -0
  129. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/js-stream-socket.mjs +9 -0
  130. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/proxy-events.mjs +10 -0
  131. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/proxy-socket-handler.mjs +77 -0
  132. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/validate-header-name.mjs +15 -0
  133. package/apps/cli/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/validate-header-value.mjs +14 -0
  134. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.mjs +355 -0
  135. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-data.mjs +191 -0
  136. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/index.mjs +31 -0
  137. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.mjs +140 -0
  138. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.mjs +50 -0
  139. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data-generated.mjs +455 -0
  140. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data.mjs +151 -0
  141. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/big5-added.mjs +169 -0
  142. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp936.mjs +2584 -0
  143. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp949.mjs +2220 -0
  144. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp950.mjs +227 -0
  145. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/eucjp.mjs +425 -0
  146. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.mjs +427 -0
  147. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gbk-added.mjs +230 -0
  148. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/shiftjis.mjs +292 -0
  149. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.mjs +123 -0
  150. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.mjs +197 -0
  151. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.mjs +182 -0
  152. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/bom-handling.mjs +42 -0
  153. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.mjs +108 -0
  154. package/apps/cli/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.mjs +90 -0
  155. package/apps/cli/dist/node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.mjs +9 -0
  156. package/apps/cli/dist/node_modules/.pnpm/js-sha256@0.11.1/node_modules/js-sha256/src/sha256.mjs +495 -0
  157. package/apps/cli/dist/node_modules/.pnpm/keyv@5.6.0/node_modules/keyv/dist/index.mjs +740 -0
  158. package/apps/cli/dist/node_modules/.pnpm/lowercase-keys@3.0.0/node_modules/lowercase-keys/index.mjs +6 -0
  159. package/apps/cli/dist/node_modules/.pnpm/mimic-response@4.0.0/node_modules/mimic-response/index.mjs +53 -0
  160. package/apps/cli/dist/node_modules/.pnpm/normalize-url@8.1.1/node_modules/normalize-url/index.mjs +145 -0
  161. package/apps/cli/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/compile.mjs +37 -0
  162. package/apps/cli/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/index.mjs +31 -0
  163. package/apps/cli/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/parse.mjs +60 -0
  164. package/apps/cli/dist/node_modules/.pnpm/p-cancelable@4.0.1/node_modules/p-cancelable/index.mjs +86 -0
  165. package/apps/cli/dist/node_modules/.pnpm/parse5-htmlparser2-tree-adapter@7.1.0/node_modules/parse5-htmlparser2-tree-adapter/dist/index.mjs +187 -0
  166. package/apps/cli/dist/node_modules/.pnpm/parse5-parser-stream@7.1.2/node_modules/parse5-parser-stream/dist/index.mjs +2 -0
  167. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/doctype.mjs +101 -0
  168. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.mjs +66 -0
  169. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.mjs +259 -0
  170. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.mjs +544 -0
  171. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.mjs +19 -0
  172. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.mjs +91 -0
  173. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/index.mjs +41 -0
  174. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.mjs +91 -0
  175. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.mjs +2492 -0
  176. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.mjs +292 -0
  177. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.mjs +111 -0
  178. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.mjs +2067 -0
  179. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/preprocessor.mjs +154 -0
  180. package/apps/cli/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tree-adapters/default.mjs +164 -0
  181. package/apps/cli/dist/node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.mjs +77 -0
  182. package/apps/cli/dist/node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.mjs +47 -0
  183. package/apps/cli/dist/node_modules/.pnpm/responselike@4.0.2/node_modules/responselike/index.mjs +32 -0
  184. package/apps/cli/dist/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.mjs +45 -0
  185. package/apps/cli/dist/node_modules/.pnpm/tldts@7.4.18/node_modules/tldts/dist/cjs/index.mjs +22542 -0
  186. package/apps/cli/dist/node_modules/.pnpm/tough-cookie@6.0.0/node_modules/tough-cookie/dist/index.mjs +1761 -0
  187. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/index.mjs +221 -0
  188. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/abort-signal.mjs +44 -0
  189. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-connect.mjs +85 -0
  190. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-pipeline.mjs +174 -0
  191. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-request.mjs +155 -0
  192. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-stream.mjs +136 -0
  193. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-upgrade.mjs +88 -0
  194. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/index.mjs +17 -0
  195. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/readable.mjs +418 -0
  196. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/cache/memory-cache-store.mjs +190 -0
  197. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/cache/sqlite-cache-store.mjs +324 -0
  198. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/connect.mjs +115 -0
  199. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/constants.mjs +134 -0
  200. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/diagnostics.mjs +114 -0
  201. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/errors.mjs +412 -0
  202. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/request.mjs +282 -0
  203. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/socks5-client.mjs +288 -0
  204. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/socks5-utils.mjs +166 -0
  205. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/symbols.mjs +80 -0
  206. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/tree.mjs +124 -0
  207. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/util.mjs +940 -0
  208. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/agent.mjs +119 -0
  209. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/balanced-pool.mjs +129 -0
  210. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client-h1.mjs +1091 -0
  211. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client-h2.mjs +588 -0
  212. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client.mjs +385 -0
  213. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/dispatcher-base.mjs +121 -0
  214. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/dispatcher.mjs +35 -0
  215. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.mjs +105 -0
  216. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/fixed-queue.mjs +75 -0
  217. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/h2c-client.mjs +31 -0
  218. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/pool-base.mjs +155 -0
  219. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/pool.mjs +76 -0
  220. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/proxy-agent.mjs +233 -0
  221. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/retry-agent.mjs +37 -0
  222. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/round-robin-pool.mjs +94 -0
  223. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/socks5-proxy-agent.mjs +194 -0
  224. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/encoding/index.mjs +18 -0
  225. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/global.mjs +48 -0
  226. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/cache-handler.mjs +457 -0
  227. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/cache-revalidation-handler.mjs +82 -0
  228. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/decorator-handler.mjs +57 -0
  229. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/deduplication-handler.mjs +341 -0
  230. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/redirect-handler.mjs +131 -0
  231. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/retry-handler.mjs +332 -0
  232. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/unwrap-handler.mjs +88 -0
  233. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/wrap-handler.mjs +68 -0
  234. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/cache.mjs +350 -0
  235. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/decompress.mjs +416 -0
  236. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/deduplicate.mjs +69 -0
  237. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/dns.mjs +323 -0
  238. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/dump.mjs +65 -0
  239. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/redirect.mjs +20 -0
  240. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/response-error.mjs +73 -0
  241. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/retry.mjs +25 -0
  242. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/constants.mjs +590 -0
  243. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/llhttp-wasm.mjs +13 -0
  244. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.mjs +13 -0
  245. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/utils.mjs +16 -0
  246. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-agent.mjs +154 -0
  247. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-call-history.mjs +159 -0
  248. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-client.mjs +59 -0
  249. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-errors.mjs +28 -0
  250. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-interceptor.mjs +150 -0
  251. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-pool.mjs +59 -0
  252. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-symbols.mjs +37 -0
  253. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-utils.mjs +302 -0
  254. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/pending-interceptors-formatter.mjs +38 -0
  255. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-agent.mjs +268 -0
  256. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-recorder.mjs +424 -0
  257. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-utils.mjs +121 -0
  258. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/cache.mjs +440 -0
  259. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/date.mjs +332 -0
  260. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/promise.mjs +31 -0
  261. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/runtime-features.mjs +101 -0
  262. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/stats.mjs +31 -0
  263. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/timers.mjs +341 -0
  264. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/cache.mjs +462 -0
  265. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/cachestorage.mjs +103 -0
  266. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/util.mjs +39 -0
  267. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/constants.mjs +11 -0
  268. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/index.mjs +169 -0
  269. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/parse.mjs +108 -0
  270. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/util.mjs +239 -0
  271. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/eventsource-stream.mjs +317 -0
  272. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/eventsource.mjs +345 -0
  273. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/util.mjs +29 -0
  274. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/body.mjs +271 -0
  275. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/constants.mjs +224 -0
  276. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/data-url.mjs +247 -0
  277. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/formdata-parser.mjs +255 -0
  278. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/formdata.mjs +153 -0
  279. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/global.mjs +34 -0
  280. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/headers.mjs +400 -0
  281. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/index.mjs +776 -0
  282. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/request.mjs +602 -0
  283. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/response.mjs +358 -0
  284. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/util.mjs +795 -0
  285. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/infra/index.mjs +154 -0
  286. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.mjs +170 -0
  287. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/webidl/index.mjs +505 -0
  288. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/connection.mjs +166 -0
  289. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/constants.mjs +47 -0
  290. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/events.mjs +268 -0
  291. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/frame.mjs +105 -0
  292. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/permessage-deflate.mjs +85 -0
  293. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/receiver.mjs +323 -0
  294. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/sender.mjs +90 -0
  295. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/stream/websocketerror.mjs +78 -0
  296. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/stream/websocketstream.mjs +270 -0
  297. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/util.mjs +212 -0
  298. package/apps/cli/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/websocket.mjs +432 -0
  299. package/apps/cli/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/labels-to-names.mjs +224 -0
  300. package/apps/cli/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/supported-names.mjs +45 -0
  301. package/apps/cli/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/whatwg-encoding.mjs +40 -0
  302. package/apps/cli/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.mjs +54 -0
  303. package/apps/cli/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.mjs +92 -0
  304. package/apps/cli/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.mjs +62 -0
  305. package/apps/cli/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.mjs +24 -0
  306. package/apps/cli/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.mjs +47 -0
  307. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.mjs +26 -0
  308. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.mjs +35 -0
  309. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.mjs +17 -0
  310. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.mjs +800 -0
  311. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.mjs +508 -0
  312. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.mjs +366 -0
  313. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.mjs +60 -0
  314. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.mjs +32 -0
  315. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.mjs +63 -0
  316. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.mjs +253 -0
  317. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.mjs +118 -0
  318. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.mjs +65 -0
  319. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.mjs +48 -0
  320. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.mjs +1235 -0
  321. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.mjs +297 -0
  322. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.mjs +316 -0
  323. package/apps/cli/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.mjs +8 -0
  324. package/apps/cli/dist/packages/data-maintenance/src/archive.mjs +143 -0
  325. package/apps/cli/dist/packages/data-maintenance/src/contracts.mjs +17 -0
  326. package/apps/cli/dist/packages/data-maintenance/src/files.mjs +121 -0
  327. package/apps/cli/dist/packages/data-maintenance/src/index.mjs +494 -0
  328. package/apps/cli/dist/packages/data-maintenance/src/lease.mjs +53 -0
  329. package/apps/cli/dist/packages/data-maintenance/src/migration-backup.mjs +57 -0
  330. package/apps/cli/dist/packages/data-maintenance/src/paths.mjs +15 -0
  331. package/apps/cli/dist/packages/feidee/src/client.mjs +635 -0
  332. package/apps/cli/dist/packages/feidee/src/hash.mjs +10 -0
  333. package/apps/cli/dist/packages/feidee/src/index.mjs +8 -0
  334. package/apps/cli/dist/packages/feidee/src/mutation-gateway.mjs +165 -0
  335. package/apps/cli/dist/packages/feidee/src/parsers.mjs +634 -0
  336. package/apps/cli/dist/packages/feidee/src/transaction-text.mjs +39 -0
  337. package/apps/cli/dist/packages/feidee/src/write-contract.mjs +273 -0
  338. package/apps/cli/dist/packages/finance/src/date-range.mjs +74 -0
  339. package/apps/cli/dist/packages/finance/src/domain.mjs +18 -0
  340. package/apps/cli/dist/packages/finance/src/errors.mjs +221 -0
  341. package/apps/cli/dist/packages/finance/src/index.mjs +16 -0
  342. package/apps/cli/dist/packages/finance/src/metadata-query.mjs +32 -0
  343. package/apps/cli/dist/packages/finance/src/sync/progress.mjs +27 -0
  344. package/apps/cli/dist/packages/finance/src/sync/service.mjs +282 -0
  345. package/apps/cli/dist/packages/finance/src/transactions/audit.mjs +104 -0
  346. package/apps/cli/dist/packages/finance/src/transactions/canary.mjs +85 -0
  347. package/apps/cli/dist/packages/finance/src/transactions/compare.mjs +76 -0
  348. package/apps/cli/dist/packages/finance/src/transactions/contracts.mjs +92 -0
  349. package/apps/cli/dist/packages/finance/src/transactions/memo-policy.mjs +79 -0
  350. package/apps/cli/dist/packages/finance/src/transactions/mutation.mjs +656 -0
  351. package/apps/cli/dist/packages/finance/src/transactions/query.mjs +59 -0
  352. package/apps/cli/dist/packages/finance/src/transactions/statistics.mjs +67 -0
  353. package/apps/cli/dist/packages/finance/src/write-policy.mjs +4 -0
  354. package/apps/cli/dist/packages/finance-module/src/balance-preview.mjs +4 -0
  355. package/apps/cli/dist/packages/finance-module/src/contracts.mjs +13 -0
  356. package/apps/cli/dist/packages/finance-module/src/database.mjs +1292 -0
  357. package/apps/cli/dist/packages/finance-module/src/draft-entries.mjs +89 -0
  358. package/apps/cli/dist/packages/finance-module/src/draft-receipts.mjs +8 -0
  359. package/apps/cli/dist/packages/finance-module/src/historical-task-archives.mjs +24 -0
  360. package/apps/cli/dist/packages/finance-module/src/node.mjs +76 -0
  361. package/apps/cli/dist/packages/finance-module/src/personal-preferences.mjs +29 -0
  362. package/apps/cli/dist/packages/finance-module/src/route-contracts.mjs +11 -0
  363. package/apps/cli/dist/packages/finance-module/src/schema-compatibility.mjs +142 -0
  364. package/apps/cli/dist/packages/finance-module/src/service-record-domain.mjs +16 -0
  365. package/apps/cli/dist/packages/finance-module/src/service-record-store.mjs +119 -0
  366. package/apps/cli/dist/packages/finance-module/src/shared-draft-migration.mjs +39 -0
  367. package/apps/cli/dist/packages/finance-module/src/single-draft-migration.mjs +70 -0
  368. package/apps/cli/dist/packages/finance-module/src/storage.mjs +282 -0
  369. package/apps/cli/dist/packages/finance-module/src/web-contracts.mjs +38 -0
  370. package/apps/cli/dist/packages/local-store/src/checkpoint-backup.mjs +40 -0
  371. package/apps/cli/dist/packages/local-store/src/checkpoint-history.mjs +77 -0
  372. package/apps/cli/dist/packages/local-store/src/database.mjs +1523 -0
  373. package/apps/cli/dist/packages/local-store/src/exchange-rates.mjs +169 -0
  374. package/apps/cli/dist/packages/local-store/src/node.mjs +71 -0
  375. package/apps/cli/dist/packages/sdk/src/account-snapshot-service.mjs +582 -0
  376. package/apps/cli/dist/packages/sdk/src/auth.mjs +89 -0
  377. package/apps/cli/dist/packages/sdk/src/cache-analysis.mjs +393 -0
  378. package/apps/cli/dist/packages/sdk/src/config.mjs +64 -0
  379. package/apps/cli/dist/packages/sdk/src/credential-identity.mjs +8 -0
  380. package/apps/cli/dist/packages/sdk/src/credentials.mjs +86 -0
  381. package/apps/cli/dist/packages/sdk/src/exchange-rate-service.mjs +253 -0
  382. package/apps/cli/dist/packages/sdk/src/finance-cookie-cache.mjs +93 -0
  383. package/apps/cli/dist/packages/sdk/src/finance-session.mjs +215 -0
  384. package/apps/cli/dist/packages/sdk/src/frankfurter.mjs +125 -0
  385. package/apps/cli/dist/packages/sdk/src/node.mjs +53 -0
  386. package/apps/cli/dist/packages/sdk/src/probe.mjs +65 -0
  387. package/apps/cli/dist/packages/sdk/src/resource-lease-node.mjs +27 -0
  388. package/apps/cli/dist/packages/sdk/src/resource-lease-owner-node.mjs +68 -0
  389. package/apps/cli/dist/packages/sdk/src/resource-lease.mjs +143 -0
  390. package/apps/cli/dist/packages/sdk/src/runtime.mjs +643 -0
  391. package/apps/cli/dist/storage.mjs +11 -0
  392. package/bundles/sui-ledger/dist/_virtual/_rolldown/runtime.mjs +35 -0
  393. package/bundles/sui-ledger/dist/capabilities/tools.mjs +32 -0
  394. package/bundles/sui-ledger/dist/client.js +23511 -0
  395. package/bundles/sui-ledger/dist/finance-prompt.mjs +30 -0
  396. package/bundles/sui-ledger/dist/finance-state-context.mjs +38 -0
  397. package/bundles/sui-ledger/dist/index.mjs +198 -0
  398. package/bundles/sui-ledger/dist/maintenance-cli.mjs +76 -0
  399. package/bundles/sui-ledger/dist/node_modules/.pnpm/@deepseek-ai_dsh-home-paths_159c15e70066431314381a350c2ee56a/node_modules/@deepseek-ai/dsh-home-paths/lib/index.mjs +67 -0
  400. package/bundles/sui-ledger/dist/node_modules/.pnpm/@keyv_serialize@1.1.1/node_modules/@keyv/serialize/dist/index.mjs +37 -0
  401. package/bundles/sui-ledger/dist/node_modules/.pnpm/@sec-ant_readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.mjs +81 -0
  402. package/bundles/sui-ledger/dist/node_modules/.pnpm/@sec-ant_readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.mjs +1 -0
  403. package/bundles/sui-ledger/dist/node_modules/.pnpm/@sindresorhus_is@7.2.0/node_modules/@sindresorhus/is/distribution/index.mjs +1015 -0
  404. package/bundles/sui-ledger/dist/node_modules/.pnpm/@sindresorhus_is@7.2.0/node_modules/@sindresorhus/is/distribution/utilities.mjs +6 -0
  405. package/bundles/sui-ledger/dist/node_modules/.pnpm/boolbase@1.0.0/node_modules/boolbase/index.mjs +15 -0
  406. package/bundles/sui-ledger/dist/node_modules/.pnpm/byte-counter@0.1.0/node_modules/byte-counter/utilities.mjs +9 -0
  407. package/bundles/sui-ledger/dist/node_modules/.pnpm/cacheable-lookup@7.0.0/node_modules/cacheable-lookup/source/index.mjs +279 -0
  408. package/bundles/sui-ledger/dist/node_modules/.pnpm/cacheable-request@13.0.19/node_modules/cacheable-request/dist/index.mjs +274 -0
  409. package/bundles/sui-ledger/dist/node_modules/.pnpm/cacheable-request@13.0.19/node_modules/cacheable-request/dist/types.mjs +15 -0
  410. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/helpers.mjs +15 -0
  411. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/index.mjs +159 -0
  412. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/positionals.mjs +33 -0
  413. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/attributes.mjs +465 -0
  414. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/css.mjs +94 -0
  415. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/extract.mjs +39 -0
  416. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/forms.mjs +63 -0
  417. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/manipulation.mjs +731 -0
  418. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/api/traversing.mjs +828 -0
  419. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/cheerio.mjs +53 -0
  420. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/index.mjs +11 -0
  421. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/load-parse.mjs +25 -0
  422. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/load.mjs +73 -0
  423. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/options.mjs +27 -0
  424. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/parse.mjs +53 -0
  425. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/parsers/parse5-adapter.mjs +42 -0
  426. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/static.mjs +165 -0
  427. package/bundles/sui-ledger/dist/node_modules/.pnpm/cheerio@1.1.2/node_modules/cheerio/dist/esm/utils.mjs +78 -0
  428. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/attributes.mjs +187 -0
  429. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/compile.mjs +77 -0
  430. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/general.mjs +89 -0
  431. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/index.mjs +43 -0
  432. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/aliases.mjs +32 -0
  433. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/filters.mjs +114 -0
  434. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/index.mjs +35 -0
  435. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.mjs +53 -0
  436. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/pseudo-selectors/subselects.mjs +68 -0
  437. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-select@5.2.2/node_modules/css-select/lib/esm/sort.mjs +60 -0
  438. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/index.mjs +50 -0
  439. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/parse.mjs +320 -0
  440. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/stringify.mjs +102 -0
  441. package/bundles/sui-ledger/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/types.mjs +45 -0
  442. package/bundles/sui-ledger/dist/node_modules/.pnpm/decompress-response@10.0.0/node_modules/decompress-response/index.mjs +59 -0
  443. package/bundles/sui-ledger/dist/node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/foreignNames.mjs +103 -0
  444. package/bundles/sui-ledger/dist/node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.mjs +144 -0
  445. package/bundles/sui-ledger/dist/node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.mjs +51 -0
  446. package/bundles/sui-ledger/dist/node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/index.mjs +128 -0
  447. package/bundles/sui-ledger/dist/node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/node.mjs +312 -0
  448. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/feeds.mjs +161 -0
  449. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/helpers.mjs +113 -0
  450. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/index.mjs +56 -0
  451. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/legacy.mjs +141 -0
  452. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/manipulation.mjs +117 -0
  453. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/querying.mjs +124 -0
  454. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/stringify.mjs +69 -0
  455. package/bundles/sui-ledger/dist/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/traversal.mjs +109 -0
  456. package/bundles/sui-ledger/dist/node_modules/.pnpm/encoding-sniffer@0.2.1/node_modules/encoding-sniffer/dist/esm/index.mjs +7 -0
  457. package/bundles/sui-ledger/dist/node_modules/.pnpm/encoding-sniffer@0.2.1/node_modules/encoding-sniffer/dist/esm/sniffer.mjs +112 -0
  458. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/escape.mjs +83 -0
  459. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs +43 -0
  460. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.mjs +330 -0
  461. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/escape.mjs +49 -0
  462. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs +4 -0
  463. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs +57 -0
  464. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/decode.mjs +351 -0
  465. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs +5 -0
  466. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/generated/decode-data-xml.mjs +5 -0
  467. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/internal/bin-trie-flags.mjs +20 -0
  468. package/bundles/sui-ledger/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/esm/internal/decode-shared.mjs +14 -0
  469. package/bundles/sui-ledger/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/index.mjs +871 -0
  470. package/bundles/sui-ledger/dist/node_modules/.pnpm/form-data-encoder@4.1.0/node_modules/form-data-encoder/lib/index.mjs +279 -0
  471. package/bundles/sui-ledger/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.mjs +54 -0
  472. package/bundles/sui-ledger/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/buffer.mjs +14 -0
  473. package/bundles/sui-ledger/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.mjs +80 -0
  474. package/bundles/sui-ledger/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.mjs +41 -0
  475. package/bundles/sui-ledger/dist/node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.mjs +8 -0
  476. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/as-promise/index.mjs +154 -0
  477. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/as-promise/types.mjs +20 -0
  478. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/calculate-retry-delay.mjs +20 -0
  479. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/diagnostics-channel.mjs +38 -0
  480. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/errors.mjs +132 -0
  481. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/index.mjs +923 -0
  482. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/options.mjs +1622 -0
  483. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/parse-link-header.mjs +27 -0
  484. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/response.mjs +36 -0
  485. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/timed-out.mjs +107 -0
  486. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/defer-to-connect.mjs +28 -0
  487. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/get-body-size.mjs +23 -0
  488. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-client-request.mjs +6 -0
  489. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-form-data.mjs +7 -0
  490. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/is-unix-socket-url.mjs +25 -0
  491. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/proxy-events.mjs +16 -0
  492. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/timer.mjs +114 -0
  493. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/unhandle.mjs +23 -0
  494. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/url-to-options.mjs +20 -0
  495. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/core/utils/weakable-map.mjs +19 -0
  496. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/create.mjs +166 -0
  497. package/bundles/sui-ledger/dist/node_modules/.pnpm/got@14.6.5/node_modules/got/dist/source/index.mjs +17 -0
  498. package/bundles/sui-ledger/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/Parser.mjs +441 -0
  499. package/bundles/sui-ledger/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/Tokenizer.mjs +661 -0
  500. package/bundles/sui-ledger/dist/node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/dist/esm/index.mjs +19 -0
  501. package/bundles/sui-ledger/dist/node_modules/.pnpm/http-cache-semantics@4.3.0/node_modules/http-cache-semantics/index.mjs +608 -0
  502. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/agent.mjs +441 -0
  503. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/auto.mjs +145 -0
  504. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/client-request.mjs +318 -0
  505. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/incoming-message.mjs +58 -0
  506. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/index.mjs +51 -0
  507. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/get-auth-headers.mjs +19 -0
  508. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h1-over-h2.mjs +84 -0
  509. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-h1.mjs +49 -0
  510. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-h2.mjs +38 -0
  511. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/h2-over-hx.mjs +39 -0
  512. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/initialize.mjs +23 -0
  513. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.mjs +15 -0
  514. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/calculate-server-name.mjs +24 -0
  515. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/check-type.mjs +17 -0
  516. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/delay-async-destroy.mjs +28 -0
  517. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/errors.mjs +30 -0
  518. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.mjs +16 -0
  519. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/js-stream-socket.mjs +9 -0
  520. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/proxy-events.mjs +10 -0
  521. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/proxy-socket-handler.mjs +77 -0
  522. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/validate-header-name.mjs +15 -0
  523. package/bundles/sui-ledger/dist/node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/utils/validate-header-value.mjs +14 -0
  524. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.mjs +355 -0
  525. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-data.mjs +191 -0
  526. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/index.mjs +31 -0
  527. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.mjs +140 -0
  528. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.mjs +50 -0
  529. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data-generated.mjs +455 -0
  530. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data.mjs +151 -0
  531. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/big5-added.mjs +169 -0
  532. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp936.mjs +2584 -0
  533. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp949.mjs +2220 -0
  534. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp950.mjs +227 -0
  535. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/eucjp.mjs +425 -0
  536. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.mjs +427 -0
  537. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gbk-added.mjs +230 -0
  538. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/shiftjis.mjs +292 -0
  539. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.mjs +123 -0
  540. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.mjs +197 -0
  541. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.mjs +182 -0
  542. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/bom-handling.mjs +42 -0
  543. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.mjs +108 -0
  544. package/bundles/sui-ledger/dist/node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.mjs +90 -0
  545. package/bundles/sui-ledger/dist/node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.mjs +9 -0
  546. package/bundles/sui-ledger/dist/node_modules/.pnpm/js-sha256@0.11.1/node_modules/js-sha256/src/sha256.mjs +495 -0
  547. package/bundles/sui-ledger/dist/node_modules/.pnpm/keyv@5.6.0/node_modules/keyv/dist/index.mjs +740 -0
  548. package/bundles/sui-ledger/dist/node_modules/.pnpm/lowercase-keys@3.0.0/node_modules/lowercase-keys/index.mjs +6 -0
  549. package/bundles/sui-ledger/dist/node_modules/.pnpm/mimic-response@4.0.0/node_modules/mimic-response/index.mjs +53 -0
  550. package/bundles/sui-ledger/dist/node_modules/.pnpm/normalize-url@8.1.1/node_modules/normalize-url/index.mjs +145 -0
  551. package/bundles/sui-ledger/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/compile.mjs +37 -0
  552. package/bundles/sui-ledger/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/index.mjs +31 -0
  553. package/bundles/sui-ledger/dist/node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/parse.mjs +60 -0
  554. package/bundles/sui-ledger/dist/node_modules/.pnpm/p-cancelable@4.0.1/node_modules/p-cancelable/index.mjs +86 -0
  555. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5-htmlparser2-tree-adapter@7.1.0/node_modules/parse5-htmlparser2-tree-adapter/dist/index.mjs +187 -0
  556. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5-parser-stream@7.1.2/node_modules/parse5-parser-stream/dist/index.mjs +2 -0
  557. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/doctype.mjs +101 -0
  558. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.mjs +66 -0
  559. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.mjs +259 -0
  560. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.mjs +544 -0
  561. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.mjs +19 -0
  562. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.mjs +91 -0
  563. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/index.mjs +41 -0
  564. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.mjs +91 -0
  565. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.mjs +2492 -0
  566. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.mjs +292 -0
  567. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.mjs +111 -0
  568. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.mjs +2067 -0
  569. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/preprocessor.mjs +154 -0
  570. package/bundles/sui-ledger/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tree-adapters/default.mjs +164 -0
  571. package/bundles/sui-ledger/dist/node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.mjs +77 -0
  572. package/bundles/sui-ledger/dist/node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.mjs +47 -0
  573. package/bundles/sui-ledger/dist/node_modules/.pnpm/responselike@4.0.2/node_modules/responselike/index.mjs +32 -0
  574. package/bundles/sui-ledger/dist/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.mjs +45 -0
  575. package/bundles/sui-ledger/dist/node_modules/.pnpm/tldts@7.4.18/node_modules/tldts/dist/cjs/index.mjs +22542 -0
  576. package/bundles/sui-ledger/dist/node_modules/.pnpm/tough-cookie@6.0.0/node_modules/tough-cookie/dist/index.mjs +1761 -0
  577. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/index.mjs +221 -0
  578. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/abort-signal.mjs +44 -0
  579. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-connect.mjs +85 -0
  580. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-pipeline.mjs +174 -0
  581. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-request.mjs +155 -0
  582. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-stream.mjs +136 -0
  583. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/api-upgrade.mjs +88 -0
  584. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/index.mjs +17 -0
  585. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/api/readable.mjs +418 -0
  586. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/cache/memory-cache-store.mjs +190 -0
  587. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/cache/sqlite-cache-store.mjs +324 -0
  588. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/connect.mjs +115 -0
  589. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/constants.mjs +134 -0
  590. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/diagnostics.mjs +114 -0
  591. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/errors.mjs +412 -0
  592. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/request.mjs +282 -0
  593. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/socks5-client.mjs +288 -0
  594. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/socks5-utils.mjs +166 -0
  595. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/symbols.mjs +80 -0
  596. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/tree.mjs +124 -0
  597. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/core/util.mjs +940 -0
  598. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/agent.mjs +119 -0
  599. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/balanced-pool.mjs +129 -0
  600. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client-h1.mjs +1091 -0
  601. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client-h2.mjs +588 -0
  602. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/client.mjs +385 -0
  603. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/dispatcher-base.mjs +121 -0
  604. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/dispatcher.mjs +35 -0
  605. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.mjs +105 -0
  606. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/fixed-queue.mjs +75 -0
  607. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/h2c-client.mjs +31 -0
  608. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/pool-base.mjs +155 -0
  609. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/pool.mjs +76 -0
  610. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/proxy-agent.mjs +233 -0
  611. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/retry-agent.mjs +37 -0
  612. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/round-robin-pool.mjs +94 -0
  613. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/dispatcher/socks5-proxy-agent.mjs +194 -0
  614. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/encoding/index.mjs +18 -0
  615. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/global.mjs +48 -0
  616. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/cache-handler.mjs +457 -0
  617. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/cache-revalidation-handler.mjs +82 -0
  618. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/decorator-handler.mjs +57 -0
  619. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/deduplication-handler.mjs +341 -0
  620. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/redirect-handler.mjs +131 -0
  621. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/retry-handler.mjs +332 -0
  622. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/unwrap-handler.mjs +88 -0
  623. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/handler/wrap-handler.mjs +68 -0
  624. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/cache.mjs +350 -0
  625. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/decompress.mjs +416 -0
  626. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/deduplicate.mjs +69 -0
  627. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/dns.mjs +323 -0
  628. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/dump.mjs +65 -0
  629. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/redirect.mjs +20 -0
  630. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/response-error.mjs +73 -0
  631. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/interceptor/retry.mjs +25 -0
  632. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/constants.mjs +590 -0
  633. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/llhttp-wasm.mjs +13 -0
  634. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.mjs +13 -0
  635. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/llhttp/utils.mjs +16 -0
  636. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-agent.mjs +154 -0
  637. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-call-history.mjs +159 -0
  638. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-client.mjs +59 -0
  639. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-errors.mjs +28 -0
  640. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-interceptor.mjs +150 -0
  641. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-pool.mjs +59 -0
  642. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-symbols.mjs +37 -0
  643. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/mock-utils.mjs +302 -0
  644. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/pending-interceptors-formatter.mjs +38 -0
  645. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-agent.mjs +268 -0
  646. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-recorder.mjs +424 -0
  647. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/mock/snapshot-utils.mjs +121 -0
  648. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/cache.mjs +440 -0
  649. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/date.mjs +332 -0
  650. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/promise.mjs +31 -0
  651. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/runtime-features.mjs +101 -0
  652. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/stats.mjs +31 -0
  653. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/util/timers.mjs +341 -0
  654. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/cache.mjs +462 -0
  655. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/cachestorage.mjs +103 -0
  656. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cache/util.mjs +39 -0
  657. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/constants.mjs +11 -0
  658. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/index.mjs +169 -0
  659. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/parse.mjs +108 -0
  660. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/cookies/util.mjs +239 -0
  661. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/eventsource-stream.mjs +317 -0
  662. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/eventsource.mjs +345 -0
  663. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/eventsource/util.mjs +29 -0
  664. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/body.mjs +271 -0
  665. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/constants.mjs +224 -0
  666. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/data-url.mjs +247 -0
  667. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/formdata-parser.mjs +255 -0
  668. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/formdata.mjs +153 -0
  669. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/global.mjs +34 -0
  670. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/headers.mjs +400 -0
  671. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/index.mjs +776 -0
  672. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/request.mjs +602 -0
  673. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/response.mjs +358 -0
  674. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/fetch/util.mjs +795 -0
  675. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/infra/index.mjs +154 -0
  676. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.mjs +170 -0
  677. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/webidl/index.mjs +505 -0
  678. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/connection.mjs +166 -0
  679. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/constants.mjs +47 -0
  680. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/events.mjs +268 -0
  681. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/frame.mjs +105 -0
  682. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/permessage-deflate.mjs +85 -0
  683. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/receiver.mjs +323 -0
  684. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/sender.mjs +90 -0
  685. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/stream/websocketerror.mjs +78 -0
  686. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/stream/websocketstream.mjs +270 -0
  687. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/util.mjs +212 -0
  688. package/bundles/sui-ledger/dist/node_modules/.pnpm/undici@7.30.0/node_modules/undici/lib/web/websocket/websocket.mjs +432 -0
  689. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/labels-to-names.mjs +224 -0
  690. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/supported-names.mjs +45 -0
  691. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-encoding@3.1.1/node_modules/whatwg-encoding/lib/whatwg-encoding.mjs +40 -0
  692. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.mjs +54 -0
  693. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.mjs +92 -0
  694. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.mjs +62 -0
  695. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.mjs +24 -0
  696. package/bundles/sui-ledger/dist/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.mjs +47 -0
  697. package/bundles/sui-ledger/dist/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/dist/cpexcel.mjs +3348 -0
  698. package/bundles/sui-ledger/dist/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx.mjs +26473 -0
  699. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.mjs +26 -0
  700. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.mjs +35 -0
  701. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.mjs +17 -0
  702. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.mjs +800 -0
  703. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.mjs +508 -0
  704. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.mjs +366 -0
  705. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.mjs +60 -0
  706. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.mjs +32 -0
  707. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.mjs +63 -0
  708. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.mjs +253 -0
  709. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.mjs +118 -0
  710. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.mjs +65 -0
  711. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.mjs +48 -0
  712. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.mjs +1235 -0
  713. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.mjs +297 -0
  714. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.mjs +316 -0
  715. package/bundles/sui-ledger/dist/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.mjs +8 -0
  716. package/bundles/sui-ledger/dist/packages/data-maintenance/src/archive.mjs +143 -0
  717. package/bundles/sui-ledger/dist/packages/data-maintenance/src/contracts.mjs +17 -0
  718. package/bundles/sui-ledger/dist/packages/data-maintenance/src/files.mjs +158 -0
  719. package/bundles/sui-ledger/dist/packages/data-maintenance/src/index.mjs +494 -0
  720. package/bundles/sui-ledger/dist/packages/data-maintenance/src/lease.mjs +53 -0
  721. package/bundles/sui-ledger/dist/packages/data-maintenance/src/migration-backup.mjs +57 -0
  722. package/bundles/sui-ledger/dist/packages/data-maintenance/src/paths.mjs +15 -0
  723. package/bundles/sui-ledger/dist/packages/data-maintenance/src/runtime.mjs +132 -0
  724. package/bundles/sui-ledger/dist/packages/feidee/src/client.mjs +635 -0
  725. package/bundles/sui-ledger/dist/packages/feidee/src/hash.mjs +10 -0
  726. package/bundles/sui-ledger/dist/packages/feidee/src/index.mjs +8 -0
  727. package/bundles/sui-ledger/dist/packages/feidee/src/mutation-gateway.mjs +165 -0
  728. package/bundles/sui-ledger/dist/packages/feidee/src/parsers.mjs +634 -0
  729. package/bundles/sui-ledger/dist/packages/feidee/src/transaction-text.mjs +39 -0
  730. package/bundles/sui-ledger/dist/packages/feidee/src/write-contract.mjs +273 -0
  731. package/bundles/sui-ledger/dist/packages/finance/src/date-range.mjs +74 -0
  732. package/bundles/sui-ledger/dist/packages/finance/src/domain.mjs +18 -0
  733. package/bundles/sui-ledger/dist/packages/finance/src/errors.mjs +221 -0
  734. package/bundles/sui-ledger/dist/packages/finance/src/index.mjs +17 -0
  735. package/bundles/sui-ledger/dist/packages/finance/src/json-schema.mjs +212 -0
  736. package/bundles/sui-ledger/dist/packages/finance/src/metadata-query.mjs +32 -0
  737. package/bundles/sui-ledger/dist/packages/finance/src/money.mjs +39 -0
  738. package/bundles/sui-ledger/dist/packages/finance/src/public-error.mjs +10 -0
  739. package/bundles/sui-ledger/dist/packages/finance/src/sync/progress.mjs +27 -0
  740. package/bundles/sui-ledger/dist/packages/finance/src/sync/service.mjs +282 -0
  741. package/bundles/sui-ledger/dist/packages/finance/src/transactions/audit.mjs +104 -0
  742. package/bundles/sui-ledger/dist/packages/finance/src/transactions/canary.mjs +85 -0
  743. package/bundles/sui-ledger/dist/packages/finance/src/transactions/compare.mjs +76 -0
  744. package/bundles/sui-ledger/dist/packages/finance/src/transactions/contracts.mjs +83 -0
  745. package/bundles/sui-ledger/dist/packages/finance/src/transactions/memo-policy.mjs +79 -0
  746. package/bundles/sui-ledger/dist/packages/finance/src/transactions/mutation.mjs +656 -0
  747. package/bundles/sui-ledger/dist/packages/finance/src/transactions/query.mjs +59 -0
  748. package/bundles/sui-ledger/dist/packages/finance/src/transactions/statistics.mjs +67 -0
  749. package/bundles/sui-ledger/dist/packages/finance/src/write-policy.mjs +4 -0
  750. package/bundles/sui-ledger/dist/packages/finance-module/src/balance-preview.mjs +119 -0
  751. package/bundles/sui-ledger/dist/packages/finance-module/src/capabilities.mjs +1306 -0
  752. package/bundles/sui-ledger/dist/packages/finance-module/src/checkpoint-review.mjs +75 -0
  753. package/bundles/sui-ledger/dist/packages/finance-module/src/commit-failure.mjs +161 -0
  754. package/bundles/sui-ledger/dist/packages/finance-module/src/commit-recovery.mjs +41 -0
  755. package/bundles/sui-ledger/dist/packages/finance-module/src/contracts.mjs +13 -0
  756. package/bundles/sui-ledger/dist/packages/finance-module/src/data-version.mjs +8 -0
  757. package/bundles/sui-ledger/dist/packages/finance-module/src/database.mjs +1292 -0
  758. package/bundles/sui-ledger/dist/packages/finance-module/src/draft-entries.mjs +216 -0
  759. package/bundles/sui-ledger/dist/packages/finance-module/src/draft-receipts.mjs +16 -0
  760. package/bundles/sui-ledger/dist/packages/finance-module/src/finance-guidance.mjs +23 -0
  761. package/bundles/sui-ledger/dist/packages/finance-module/src/historical-task-archives.mjs +24 -0
  762. package/bundles/sui-ledger/dist/packages/finance-module/src/index.mjs +17 -0
  763. package/bundles/sui-ledger/dist/packages/finance-module/src/interactions.mjs +229 -0
  764. package/bundles/sui-ledger/dist/packages/finance-module/src/model-pages.mjs +61 -0
  765. package/bundles/sui-ledger/dist/packages/finance-module/src/model-views.mjs +206 -0
  766. package/bundles/sui-ledger/dist/packages/finance-module/src/node.mjs +76 -0
  767. package/bundles/sui-ledger/dist/packages/finance-module/src/personal-preferences.mjs +103 -0
  768. package/bundles/sui-ledger/dist/packages/finance-module/src/route-contracts.mjs +11 -0
  769. package/bundles/sui-ledger/dist/packages/finance-module/src/routes.mjs +427 -0
  770. package/bundles/sui-ledger/dist/packages/finance-module/src/schema-compatibility.mjs +142 -0
  771. package/bundles/sui-ledger/dist/packages/finance-module/src/sdk-adapter.mjs +100 -0
  772. package/bundles/sui-ledger/dist/packages/finance-module/src/service-record-domain.mjs +207 -0
  773. package/bundles/sui-ledger/dist/packages/finance-module/src/service-record-routes.mjs +91 -0
  774. package/bundles/sui-ledger/dist/packages/finance-module/src/service-record-store.mjs +119 -0
  775. package/bundles/sui-ledger/dist/packages/finance-module/src/service-record-tools.mjs +283 -0
  776. package/bundles/sui-ledger/dist/packages/finance-module/src/service-records.mjs +626 -0
  777. package/bundles/sui-ledger/dist/packages/finance-module/src/service.mjs +2525 -0
  778. package/bundles/sui-ledger/dist/packages/finance-module/src/shared-draft-migration.mjs +39 -0
  779. package/bundles/sui-ledger/dist/packages/finance-module/src/single-draft-migration.mjs +70 -0
  780. package/bundles/sui-ledger/dist/packages/finance-module/src/source-reader.mjs +354 -0
  781. package/bundles/sui-ledger/dist/packages/finance-module/src/storage.mjs +282 -0
  782. package/bundles/sui-ledger/dist/packages/finance-module/src/tool-contracts.mjs +42 -0
  783. package/bundles/sui-ledger/dist/packages/finance-module/src/web-contracts.mjs +74 -0
  784. package/bundles/sui-ledger/dist/packages/interaction/src/registry.mjs +36 -0
  785. package/bundles/sui-ledger/dist/packages/interaction/src/service.mjs +424 -0
  786. package/bundles/sui-ledger/dist/packages/local-store/src/checkpoint-backup.mjs +40 -0
  787. package/bundles/sui-ledger/dist/packages/local-store/src/checkpoint-history.mjs +77 -0
  788. package/bundles/sui-ledger/dist/packages/local-store/src/database.mjs +1523 -0
  789. package/bundles/sui-ledger/dist/packages/local-store/src/exchange-rates.mjs +169 -0
  790. package/bundles/sui-ledger/dist/packages/local-store/src/node.mjs +71 -0
  791. package/bundles/sui-ledger/dist/packages/local-store/src/readonly-node.mjs +486 -0
  792. package/bundles/sui-ledger/dist/packages/sdk/src/account-snapshot-service.mjs +582 -0
  793. package/bundles/sui-ledger/dist/packages/sdk/src/cache-analysis.mjs +597 -0
  794. package/bundles/sui-ledger/dist/packages/sdk/src/config.mjs +64 -0
  795. package/bundles/sui-ledger/dist/packages/sdk/src/credential-identity.mjs +7 -0
  796. package/bundles/sui-ledger/dist/packages/sdk/src/credentials.mjs +86 -0
  797. package/bundles/sui-ledger/dist/packages/sdk/src/exchange-rate-service.mjs +253 -0
  798. package/bundles/sui-ledger/dist/packages/sdk/src/finance-cookie-cache.mjs +93 -0
  799. package/bundles/sui-ledger/dist/packages/sdk/src/finance-session.mjs +215 -0
  800. package/bundles/sui-ledger/dist/packages/sdk/src/frankfurter.mjs +125 -0
  801. package/bundles/sui-ledger/dist/packages/sdk/src/ledger-money.mjs +183 -0
  802. package/bundles/sui-ledger/dist/packages/sdk/src/node-readonly.mjs +381 -0
  803. package/bundles/sui-ledger/dist/packages/sdk/src/node.mjs +53 -0
  804. package/bundles/sui-ledger/dist/packages/sdk/src/probe.mjs +65 -0
  805. package/bundles/sui-ledger/dist/packages/sdk/src/resource-lease-node.mjs +27 -0
  806. package/bundles/sui-ledger/dist/packages/sdk/src/resource-lease-owner-node.mjs +68 -0
  807. package/bundles/sui-ledger/dist/packages/sdk/src/resource-lease.mjs +143 -0
  808. package/bundles/sui-ledger/dist/packages/sdk/src/runtime.mjs +643 -0
  809. package/bundles/sui-ledger/dist/preferences-context.mjs +21 -0
  810. package/bundles/sui-ledger/dist/remote-write-policy.mjs +51 -0
  811. package/bundles/sui-ledger/dist/routes/finance-api.mjs +380 -0
  812. package/bundles/sui-ledger/dist/session/attachment-ownership.mjs +53 -0
  813. package/bundles/sui-ledger/dist/session/call-context.mjs +14 -0
  814. package/bundles/sui-ledger/dist/session/source-ports.mjs +74 -0
  815. package/bundles/sui-ledger/dist/storage/business-runtime.mjs +116 -0
  816. package/bundles/sui-ledger/dist/storage/maintenance-http.mjs +159 -0
  817. package/bundles/sui-ledger/dist/storage/paths.mjs +15 -0
  818. package/bundles/sui-ledger/dist/style.css +15416 -0
  819. package/bundles/sui-ledger/icon.svg +1 -0
  820. package/bundles/sui-ledger/locale/en.json +6 -0
  821. package/bundles/sui-ledger/locale/zh-CN.json +6 -0
  822. package/cordis.patch.yml +4 -0
  823. package/package.json +111 -3
@@ -0,0 +1,2492 @@
1
+ import { CODE_POINTS } from "../common/unicode.mjs";
2
+ import { ERR } from "../common/error-codes.mjs";
3
+ import { TokenType, getTokenAttr } from "../common/token.mjs";
4
+ import { ATTRS, DOCUMENT_MODE, NS, NUMBERED_HEADERS, SPECIAL_ELEMENTS, TAG_ID, TAG_NAMES, getTagID } from "../common/html.mjs";
5
+ import { Tokenizer, TokenizerMode } from "../tokenizer/index.mjs";
6
+ import { OpenElementStack } from "./open-element-stack.mjs";
7
+ import { EntryType, FormattingElementList } from "./formatting-element-list.mjs";
8
+ import { defaultTreeAdapter } from "../tree-adapters/default.mjs";
9
+ import { getDocumentMode, isConforming } from "../common/doctype.mjs";
10
+ import { adjustTokenMathMLAttrs, adjustTokenSVGAttrs, adjustTokenSVGTagName, adjustTokenXMLAttrs, causesExit, isIntegrationPoint } from "../common/foreign-content.mjs";
11
+ //#region ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js
12
+ const HIDDEN_INPUT_TYPE = "hidden";
13
+ const AA_OUTER_LOOP_ITER = 8;
14
+ const AA_INNER_LOOP_ITER = 3;
15
+ var InsertionMode;
16
+ (function(InsertionMode) {
17
+ InsertionMode[InsertionMode["INITIAL"] = 0] = "INITIAL";
18
+ InsertionMode[InsertionMode["BEFORE_HTML"] = 1] = "BEFORE_HTML";
19
+ InsertionMode[InsertionMode["BEFORE_HEAD"] = 2] = "BEFORE_HEAD";
20
+ InsertionMode[InsertionMode["IN_HEAD"] = 3] = "IN_HEAD";
21
+ InsertionMode[InsertionMode["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT";
22
+ InsertionMode[InsertionMode["AFTER_HEAD"] = 5] = "AFTER_HEAD";
23
+ InsertionMode[InsertionMode["IN_BODY"] = 6] = "IN_BODY";
24
+ InsertionMode[InsertionMode["TEXT"] = 7] = "TEXT";
25
+ InsertionMode[InsertionMode["IN_TABLE"] = 8] = "IN_TABLE";
26
+ InsertionMode[InsertionMode["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT";
27
+ InsertionMode[InsertionMode["IN_CAPTION"] = 10] = "IN_CAPTION";
28
+ InsertionMode[InsertionMode["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP";
29
+ InsertionMode[InsertionMode["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY";
30
+ InsertionMode[InsertionMode["IN_ROW"] = 13] = "IN_ROW";
31
+ InsertionMode[InsertionMode["IN_CELL"] = 14] = "IN_CELL";
32
+ InsertionMode[InsertionMode["IN_SELECT"] = 15] = "IN_SELECT";
33
+ InsertionMode[InsertionMode["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE";
34
+ InsertionMode[InsertionMode["IN_TEMPLATE"] = 17] = "IN_TEMPLATE";
35
+ InsertionMode[InsertionMode["AFTER_BODY"] = 18] = "AFTER_BODY";
36
+ InsertionMode[InsertionMode["IN_FRAMESET"] = 19] = "IN_FRAMESET";
37
+ InsertionMode[InsertionMode["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET";
38
+ InsertionMode[InsertionMode["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY";
39
+ InsertionMode[InsertionMode["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET";
40
+ })(InsertionMode || (InsertionMode = {}));
41
+ const BASE_LOC = {
42
+ startLine: -1,
43
+ startCol: -1,
44
+ startOffset: -1,
45
+ endLine: -1,
46
+ endCol: -1,
47
+ endOffset: -1
48
+ };
49
+ const TABLE_STRUCTURE_TAGS = /* @__PURE__ */ new Set([
50
+ TAG_ID.TABLE,
51
+ TAG_ID.TBODY,
52
+ TAG_ID.TFOOT,
53
+ TAG_ID.THEAD,
54
+ TAG_ID.TR
55
+ ]);
56
+ const defaultParserOptions = {
57
+ scriptingEnabled: true,
58
+ sourceCodeLocationInfo: false,
59
+ treeAdapter: defaultTreeAdapter,
60
+ onParseError: null
61
+ };
62
+ var Parser = class {
63
+ constructor(options, document, fragmentContext = null, scriptHandler = null) {
64
+ this.fragmentContext = fragmentContext;
65
+ this.scriptHandler = scriptHandler;
66
+ this.currentToken = null;
67
+ this.stopped = false;
68
+ /** @internal */
69
+ this.insertionMode = InsertionMode.INITIAL;
70
+ /** @internal */
71
+ this.originalInsertionMode = InsertionMode.INITIAL;
72
+ /** @internal */
73
+ this.headElement = null;
74
+ /** @internal */
75
+ this.formElement = null;
76
+ /** Indicates that the current node is not an element in the HTML namespace */
77
+ this.currentNotInHTML = false;
78
+ /**
79
+ * The template insertion mode stack is maintained from the left.
80
+ * Ie. the topmost element will always have index 0.
81
+ *
82
+ * @internal
83
+ */
84
+ this.tmplInsertionModeStack = [];
85
+ /** @internal */
86
+ this.pendingCharacterTokens = [];
87
+ /** @internal */
88
+ this.hasNonWhitespacePendingCharacterToken = false;
89
+ /** @internal */
90
+ this.framesetOk = true;
91
+ /** @internal */
92
+ this.skipNextNewLine = false;
93
+ /** @internal */
94
+ this.fosterParentingEnabled = false;
95
+ this.options = {
96
+ ...defaultParserOptions,
97
+ ...options
98
+ };
99
+ this.treeAdapter = this.options.treeAdapter;
100
+ this.onParseError = this.options.onParseError;
101
+ if (this.onParseError) this.options.sourceCodeLocationInfo = true;
102
+ this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();
103
+ this.tokenizer = new Tokenizer(this.options, this);
104
+ this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
105
+ this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
106
+ this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
107
+ this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
108
+ }
109
+ static parse(html, options) {
110
+ const parser = new this(options);
111
+ parser.tokenizer.write(html, true);
112
+ return parser.document;
113
+ }
114
+ static getFragmentParser(fragmentContext, options) {
115
+ const opts = {
116
+ ...defaultParserOptions,
117
+ ...options
118
+ };
119
+ fragmentContext !== null && fragmentContext !== void 0 || (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
120
+ const documentMock = opts.treeAdapter.createElement("documentmock", NS.HTML, []);
121
+ const parser = new this(opts, documentMock, fragmentContext);
122
+ if (parser.fragmentContextID === TAG_ID.TEMPLATE) parser.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
123
+ parser._initTokenizerForFragmentParsing();
124
+ parser._insertFakeRootElement();
125
+ parser._resetInsertionMode();
126
+ parser._findFormInFragmentContext();
127
+ return parser;
128
+ }
129
+ getFragment() {
130
+ const rootElement = this.treeAdapter.getFirstChild(this.document);
131
+ const fragment = this.treeAdapter.createDocumentFragment();
132
+ this._adoptNodes(rootElement, fragment);
133
+ return fragment;
134
+ }
135
+ /** @internal */
136
+ _err(token, code, beforeToken) {
137
+ var _a;
138
+ if (!this.onParseError) return;
139
+ const loc = (_a = token.location) !== null && _a !== void 0 ? _a : BASE_LOC;
140
+ const err = {
141
+ code,
142
+ startLine: loc.startLine,
143
+ startCol: loc.startCol,
144
+ startOffset: loc.startOffset,
145
+ endLine: beforeToken ? loc.startLine : loc.endLine,
146
+ endCol: beforeToken ? loc.startCol : loc.endCol,
147
+ endOffset: beforeToken ? loc.startOffset : loc.endOffset
148
+ };
149
+ this.onParseError(err);
150
+ }
151
+ /** @internal */
152
+ onItemPush(node, tid, isTop) {
153
+ var _a, _b;
154
+ (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 || _b.call(_a, node);
155
+ if (isTop && this.openElements.stackTop > 0) this._setContextModes(node, tid);
156
+ }
157
+ /** @internal */
158
+ onItemPop(node, isTop) {
159
+ var _a, _b;
160
+ if (this.options.sourceCodeLocationInfo) this._setEndLocation(node, this.currentToken);
161
+ (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 || _b.call(_a, node, this.openElements.current);
162
+ if (isTop) {
163
+ let current;
164
+ let currentTagId;
165
+ if (this.openElements.stackTop === 0 && this.fragmentContext) {
166
+ current = this.fragmentContext;
167
+ currentTagId = this.fragmentContextID;
168
+ } else ({current, currentTagId} = this.openElements);
169
+ this._setContextModes(current, currentTagId);
170
+ }
171
+ }
172
+ _setContextModes(current, tid) {
173
+ const isHTML = current === this.document || current && this.treeAdapter.getNamespaceURI(current) === NS.HTML;
174
+ this.currentNotInHTML = !isHTML;
175
+ this.tokenizer.inForeignNode = !isHTML && current !== void 0 && tid !== void 0 && !this._isIntegrationPoint(tid, current);
176
+ }
177
+ /** @protected */
178
+ _switchToTextParsing(currentToken, nextTokenizerState) {
179
+ this._insertElement(currentToken, NS.HTML);
180
+ this.tokenizer.state = nextTokenizerState;
181
+ this.originalInsertionMode = this.insertionMode;
182
+ this.insertionMode = InsertionMode.TEXT;
183
+ }
184
+ switchToPlaintextParsing() {
185
+ this.insertionMode = InsertionMode.TEXT;
186
+ this.originalInsertionMode = InsertionMode.IN_BODY;
187
+ this.tokenizer.state = TokenizerMode.PLAINTEXT;
188
+ }
189
+ /** @protected */
190
+ _getAdjustedCurrentElement() {
191
+ return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current;
192
+ }
193
+ /** @protected */
194
+ _findFormInFragmentContext() {
195
+ let node = this.fragmentContext;
196
+ while (node) {
197
+ if (this.treeAdapter.getTagName(node) === TAG_NAMES.FORM) {
198
+ this.formElement = node;
199
+ break;
200
+ }
201
+ node = this.treeAdapter.getParentNode(node);
202
+ }
203
+ }
204
+ _initTokenizerForFragmentParsing() {
205
+ if (!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== NS.HTML) return;
206
+ switch (this.fragmentContextID) {
207
+ case TAG_ID.TITLE:
208
+ case TAG_ID.TEXTAREA:
209
+ this.tokenizer.state = TokenizerMode.RCDATA;
210
+ break;
211
+ case TAG_ID.STYLE:
212
+ case TAG_ID.XMP:
213
+ case TAG_ID.IFRAME:
214
+ case TAG_ID.NOEMBED:
215
+ case TAG_ID.NOFRAMES:
216
+ case TAG_ID.NOSCRIPT:
217
+ this.tokenizer.state = TokenizerMode.RAWTEXT;
218
+ break;
219
+ case TAG_ID.SCRIPT:
220
+ this.tokenizer.state = TokenizerMode.SCRIPT_DATA;
221
+ break;
222
+ case TAG_ID.PLAINTEXT: this.tokenizer.state = TokenizerMode.PLAINTEXT;
223
+ }
224
+ }
225
+ /** @protected */
226
+ _setDocumentType(token) {
227
+ const name = token.name || "";
228
+ const publicId = token.publicId || "";
229
+ const systemId = token.systemId || "";
230
+ this.treeAdapter.setDocumentType(this.document, name, publicId, systemId);
231
+ if (token.location) {
232
+ const docTypeNode = this.treeAdapter.getChildNodes(this.document).find((node) => this.treeAdapter.isDocumentTypeNode(node));
233
+ if (docTypeNode) this.treeAdapter.setNodeSourceCodeLocation(docTypeNode, token.location);
234
+ }
235
+ }
236
+ /** @protected */
237
+ _attachElementToTree(element, location) {
238
+ if (this.options.sourceCodeLocationInfo) {
239
+ const loc = location && {
240
+ ...location,
241
+ startTag: location
242
+ };
243
+ this.treeAdapter.setNodeSourceCodeLocation(element, loc);
244
+ }
245
+ if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(element);
246
+ else {
247
+ const parent = this.openElements.currentTmplContentOrNode;
248
+ this.treeAdapter.appendChild(parent !== null && parent !== void 0 ? parent : this.document, element);
249
+ }
250
+ }
251
+ /**
252
+ * For self-closing tags. Add an element to the tree, but skip adding it
253
+ * to the stack.
254
+ */
255
+ /** @protected */
256
+ _appendElement(token, namespaceURI) {
257
+ const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
258
+ this._attachElementToTree(element, token.location);
259
+ }
260
+ /** @protected */
261
+ _insertElement(token, namespaceURI) {
262
+ const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
263
+ this._attachElementToTree(element, token.location);
264
+ this.openElements.push(element, token.tagID);
265
+ }
266
+ /** @protected */
267
+ _insertFakeElement(tagName, tagID) {
268
+ const element = this.treeAdapter.createElement(tagName, NS.HTML, []);
269
+ this._attachElementToTree(element, null);
270
+ this.openElements.push(element, tagID);
271
+ }
272
+ /** @protected */
273
+ _insertTemplate(token) {
274
+ const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs);
275
+ const content = this.treeAdapter.createDocumentFragment();
276
+ this.treeAdapter.setTemplateContent(tmpl, content);
277
+ this._attachElementToTree(tmpl, token.location);
278
+ this.openElements.push(tmpl, token.tagID);
279
+ if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(content, null);
280
+ }
281
+ /** @protected */
282
+ _insertFakeRootElement() {
283
+ const element = this.treeAdapter.createElement(TAG_NAMES.HTML, NS.HTML, []);
284
+ if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(element, null);
285
+ this.treeAdapter.appendChild(this.openElements.current, element);
286
+ this.openElements.push(element, TAG_ID.HTML);
287
+ }
288
+ /** @protected */
289
+ _appendCommentNode(token, parent) {
290
+ const commentNode = this.treeAdapter.createCommentNode(token.data);
291
+ this.treeAdapter.appendChild(parent, commentNode);
292
+ if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location);
293
+ }
294
+ /** @protected */
295
+ _insertCharacters(token) {
296
+ let parent;
297
+ let beforeElement;
298
+ if (this._shouldFosterParentOnInsertion()) {
299
+ ({parent, beforeElement} = this._findFosterParentingLocation());
300
+ if (beforeElement) this.treeAdapter.insertTextBefore(parent, token.chars, beforeElement);
301
+ else this.treeAdapter.insertText(parent, token.chars);
302
+ } else {
303
+ parent = this.openElements.currentTmplContentOrNode;
304
+ this.treeAdapter.insertText(parent, token.chars);
305
+ }
306
+ if (!token.location) return;
307
+ const siblings = this.treeAdapter.getChildNodes(parent);
308
+ const textNode = siblings[(beforeElement ? siblings.lastIndexOf(beforeElement) : siblings.length) - 1];
309
+ if (this.treeAdapter.getNodeSourceCodeLocation(textNode)) {
310
+ const { endLine, endCol, endOffset } = token.location;
311
+ this.treeAdapter.updateNodeSourceCodeLocation(textNode, {
312
+ endLine,
313
+ endCol,
314
+ endOffset
315
+ });
316
+ } else if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location);
317
+ }
318
+ /** @protected */
319
+ _adoptNodes(donor, recipient) {
320
+ for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
321
+ this.treeAdapter.detachNode(child);
322
+ this.treeAdapter.appendChild(recipient, child);
323
+ }
324
+ }
325
+ /** @protected */
326
+ _setEndLocation(element, closingToken) {
327
+ if (this.treeAdapter.getNodeSourceCodeLocation(element) && closingToken.location) {
328
+ const ctLoc = closingToken.location;
329
+ const tn = this.treeAdapter.getTagName(element);
330
+ const endLoc = closingToken.type === TokenType.END_TAG && tn === closingToken.tagName ? {
331
+ endTag: { ...ctLoc },
332
+ endLine: ctLoc.endLine,
333
+ endCol: ctLoc.endCol,
334
+ endOffset: ctLoc.endOffset
335
+ } : {
336
+ endLine: ctLoc.startLine,
337
+ endCol: ctLoc.startCol,
338
+ endOffset: ctLoc.startOffset
339
+ };
340
+ this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc);
341
+ }
342
+ }
343
+ shouldProcessStartTagTokenInForeignContent(token) {
344
+ if (!this.currentNotInHTML) return false;
345
+ let current;
346
+ let currentTagId;
347
+ if (this.openElements.stackTop === 0 && this.fragmentContext) {
348
+ current = this.fragmentContext;
349
+ currentTagId = this.fragmentContextID;
350
+ } else ({current, currentTagId} = this.openElements);
351
+ if (token.tagID === TAG_ID.SVG && this.treeAdapter.getTagName(current) === TAG_NAMES.ANNOTATION_XML && this.treeAdapter.getNamespaceURI(current) === NS.MATHML) return false;
352
+ return this.tokenizer.inForeignNode || (token.tagID === TAG_ID.MGLYPH || token.tagID === TAG_ID.MALIGNMARK) && currentTagId !== void 0 && !this._isIntegrationPoint(currentTagId, current, NS.HTML);
353
+ }
354
+ /** @protected */
355
+ _processToken(token) {
356
+ switch (token.type) {
357
+ case TokenType.CHARACTER:
358
+ this.onCharacter(token);
359
+ break;
360
+ case TokenType.NULL_CHARACTER:
361
+ this.onNullCharacter(token);
362
+ break;
363
+ case TokenType.COMMENT:
364
+ this.onComment(token);
365
+ break;
366
+ case TokenType.DOCTYPE:
367
+ this.onDoctype(token);
368
+ break;
369
+ case TokenType.START_TAG:
370
+ this._processStartTag(token);
371
+ break;
372
+ case TokenType.END_TAG:
373
+ this.onEndTag(token);
374
+ break;
375
+ case TokenType.EOF:
376
+ this.onEof(token);
377
+ break;
378
+ case TokenType.WHITESPACE_CHARACTER: this.onWhitespaceCharacter(token);
379
+ }
380
+ }
381
+ /** @protected */
382
+ _isIntegrationPoint(tid, element, foreignNS) {
383
+ const ns = this.treeAdapter.getNamespaceURI(element);
384
+ const attrs = this.treeAdapter.getAttrList(element);
385
+ return isIntegrationPoint(tid, ns, attrs, foreignNS);
386
+ }
387
+ /** @protected */
388
+ _reconstructActiveFormattingElements() {
389
+ const listLength = this.activeFormattingElements.entries.length;
390
+ if (listLength) {
391
+ const endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element));
392
+ const unopenIdx = endIndex === -1 ? listLength - 1 : endIndex - 1;
393
+ for (let i = unopenIdx; i >= 0; i--) {
394
+ const entry = this.activeFormattingElements.entries[i];
395
+ this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
396
+ entry.element = this.openElements.current;
397
+ }
398
+ }
399
+ }
400
+ /** @protected */
401
+ _closeTableCell() {
402
+ this.openElements.generateImpliedEndTags();
403
+ this.openElements.popUntilTableCellPopped();
404
+ this.activeFormattingElements.clearToLastMarker();
405
+ this.insertionMode = InsertionMode.IN_ROW;
406
+ }
407
+ /** @protected */
408
+ _closePElement() {
409
+ this.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.P);
410
+ this.openElements.popUntilTagNamePopped(TAG_ID.P);
411
+ }
412
+ /** @protected */
413
+ _resetInsertionMode() {
414
+ for (let i = this.openElements.stackTop; i >= 0; i--) switch (i === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[i]) {
415
+ case TAG_ID.TR:
416
+ this.insertionMode = InsertionMode.IN_ROW;
417
+ return;
418
+ case TAG_ID.TBODY:
419
+ case TAG_ID.THEAD:
420
+ case TAG_ID.TFOOT:
421
+ this.insertionMode = InsertionMode.IN_TABLE_BODY;
422
+ return;
423
+ case TAG_ID.CAPTION:
424
+ this.insertionMode = InsertionMode.IN_CAPTION;
425
+ return;
426
+ case TAG_ID.COLGROUP:
427
+ this.insertionMode = InsertionMode.IN_COLUMN_GROUP;
428
+ return;
429
+ case TAG_ID.TABLE:
430
+ this.insertionMode = InsertionMode.IN_TABLE;
431
+ return;
432
+ case TAG_ID.BODY:
433
+ this.insertionMode = InsertionMode.IN_BODY;
434
+ return;
435
+ case TAG_ID.FRAMESET:
436
+ this.insertionMode = InsertionMode.IN_FRAMESET;
437
+ return;
438
+ case TAG_ID.SELECT:
439
+ this._resetInsertionModeForSelect(i);
440
+ return;
441
+ case TAG_ID.TEMPLATE:
442
+ this.insertionMode = this.tmplInsertionModeStack[0];
443
+ return;
444
+ case TAG_ID.HTML:
445
+ this.insertionMode = this.headElement ? InsertionMode.AFTER_HEAD : InsertionMode.BEFORE_HEAD;
446
+ return;
447
+ case TAG_ID.TD:
448
+ case TAG_ID.TH:
449
+ if (i > 0) {
450
+ this.insertionMode = InsertionMode.IN_CELL;
451
+ return;
452
+ }
453
+ break;
454
+ case TAG_ID.HEAD: if (i > 0) {
455
+ this.insertionMode = InsertionMode.IN_HEAD;
456
+ return;
457
+ }
458
+ }
459
+ this.insertionMode = InsertionMode.IN_BODY;
460
+ }
461
+ /** @protected */
462
+ _resetInsertionModeForSelect(selectIdx) {
463
+ if (selectIdx > 0) for (let i = selectIdx - 1; i > 0; i--) {
464
+ const tn = this.openElements.tagIDs[i];
465
+ if (tn === TAG_ID.TEMPLATE) break;
466
+ else if (tn === TAG_ID.TABLE) {
467
+ this.insertionMode = InsertionMode.IN_SELECT_IN_TABLE;
468
+ return;
469
+ }
470
+ }
471
+ this.insertionMode = InsertionMode.IN_SELECT;
472
+ }
473
+ /** @protected */
474
+ _isElementCausesFosterParenting(tn) {
475
+ return TABLE_STRUCTURE_TAGS.has(tn);
476
+ }
477
+ /** @protected */
478
+ _shouldFosterParentOnInsertion() {
479
+ return this.fosterParentingEnabled && this.openElements.currentTagId !== void 0 && this._isElementCausesFosterParenting(this.openElements.currentTagId);
480
+ }
481
+ /** @protected */
482
+ _findFosterParentingLocation() {
483
+ for (let i = this.openElements.stackTop; i >= 0; i--) {
484
+ const openElement = this.openElements.items[i];
485
+ switch (this.openElements.tagIDs[i]) {
486
+ case TAG_ID.TEMPLATE:
487
+ if (this.treeAdapter.getNamespaceURI(openElement) === NS.HTML) return {
488
+ parent: this.treeAdapter.getTemplateContent(openElement),
489
+ beforeElement: null
490
+ };
491
+ break;
492
+ case TAG_ID.TABLE: {
493
+ const parent = this.treeAdapter.getParentNode(openElement);
494
+ if (parent) return {
495
+ parent,
496
+ beforeElement: openElement
497
+ };
498
+ return {
499
+ parent: this.openElements.items[i - 1],
500
+ beforeElement: null
501
+ };
502
+ }
503
+ }
504
+ }
505
+ return {
506
+ parent: this.openElements.items[0],
507
+ beforeElement: null
508
+ };
509
+ }
510
+ /** @protected */
511
+ _fosterParentElement(element) {
512
+ const location = this._findFosterParentingLocation();
513
+ if (location.beforeElement) this.treeAdapter.insertBefore(location.parent, element, location.beforeElement);
514
+ else this.treeAdapter.appendChild(location.parent, element);
515
+ }
516
+ /** @protected */
517
+ _isSpecialElement(element, id) {
518
+ const ns = this.treeAdapter.getNamespaceURI(element);
519
+ return SPECIAL_ELEMENTS[ns].has(id);
520
+ }
521
+ /** @internal */
522
+ onCharacter(token) {
523
+ this.skipNextNewLine = false;
524
+ if (this.tokenizer.inForeignNode) {
525
+ characterInForeignContent(this, token);
526
+ return;
527
+ }
528
+ switch (this.insertionMode) {
529
+ case InsertionMode.INITIAL:
530
+ tokenInInitialMode(this, token);
531
+ break;
532
+ case InsertionMode.BEFORE_HTML:
533
+ tokenBeforeHtml(this, token);
534
+ break;
535
+ case InsertionMode.BEFORE_HEAD:
536
+ tokenBeforeHead(this, token);
537
+ break;
538
+ case InsertionMode.IN_HEAD:
539
+ tokenInHead(this, token);
540
+ break;
541
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
542
+ tokenInHeadNoScript(this, token);
543
+ break;
544
+ case InsertionMode.AFTER_HEAD:
545
+ tokenAfterHead(this, token);
546
+ break;
547
+ case InsertionMode.IN_BODY:
548
+ case InsertionMode.IN_CAPTION:
549
+ case InsertionMode.IN_CELL:
550
+ case InsertionMode.IN_TEMPLATE:
551
+ characterInBody(this, token);
552
+ break;
553
+ case InsertionMode.TEXT:
554
+ case InsertionMode.IN_SELECT:
555
+ case InsertionMode.IN_SELECT_IN_TABLE:
556
+ this._insertCharacters(token);
557
+ break;
558
+ case InsertionMode.IN_TABLE:
559
+ case InsertionMode.IN_TABLE_BODY:
560
+ case InsertionMode.IN_ROW:
561
+ characterInTable(this, token);
562
+ break;
563
+ case InsertionMode.IN_TABLE_TEXT:
564
+ characterInTableText(this, token);
565
+ break;
566
+ case InsertionMode.IN_COLUMN_GROUP:
567
+ tokenInColumnGroup(this, token);
568
+ break;
569
+ case InsertionMode.AFTER_BODY:
570
+ tokenAfterBody(this, token);
571
+ break;
572
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
573
+ }
574
+ }
575
+ /** @internal */
576
+ onNullCharacter(token) {
577
+ this.skipNextNewLine = false;
578
+ if (this.tokenizer.inForeignNode) {
579
+ nullCharacterInForeignContent(this, token);
580
+ return;
581
+ }
582
+ switch (this.insertionMode) {
583
+ case InsertionMode.INITIAL:
584
+ tokenInInitialMode(this, token);
585
+ break;
586
+ case InsertionMode.BEFORE_HTML:
587
+ tokenBeforeHtml(this, token);
588
+ break;
589
+ case InsertionMode.BEFORE_HEAD:
590
+ tokenBeforeHead(this, token);
591
+ break;
592
+ case InsertionMode.IN_HEAD:
593
+ tokenInHead(this, token);
594
+ break;
595
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
596
+ tokenInHeadNoScript(this, token);
597
+ break;
598
+ case InsertionMode.AFTER_HEAD:
599
+ tokenAfterHead(this, token);
600
+ break;
601
+ case InsertionMode.TEXT:
602
+ this._insertCharacters(token);
603
+ break;
604
+ case InsertionMode.IN_TABLE:
605
+ case InsertionMode.IN_TABLE_BODY:
606
+ case InsertionMode.IN_ROW:
607
+ characterInTable(this, token);
608
+ break;
609
+ case InsertionMode.IN_COLUMN_GROUP:
610
+ tokenInColumnGroup(this, token);
611
+ break;
612
+ case InsertionMode.AFTER_BODY:
613
+ tokenAfterBody(this, token);
614
+ break;
615
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
616
+ }
617
+ }
618
+ /** @internal */
619
+ onComment(token) {
620
+ this.skipNextNewLine = false;
621
+ if (this.currentNotInHTML) {
622
+ appendComment(this, token);
623
+ return;
624
+ }
625
+ switch (this.insertionMode) {
626
+ case InsertionMode.INITIAL:
627
+ case InsertionMode.BEFORE_HTML:
628
+ case InsertionMode.BEFORE_HEAD:
629
+ case InsertionMode.IN_HEAD:
630
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
631
+ case InsertionMode.AFTER_HEAD:
632
+ case InsertionMode.IN_BODY:
633
+ case InsertionMode.IN_TABLE:
634
+ case InsertionMode.IN_CAPTION:
635
+ case InsertionMode.IN_COLUMN_GROUP:
636
+ case InsertionMode.IN_TABLE_BODY:
637
+ case InsertionMode.IN_ROW:
638
+ case InsertionMode.IN_CELL:
639
+ case InsertionMode.IN_SELECT:
640
+ case InsertionMode.IN_SELECT_IN_TABLE:
641
+ case InsertionMode.IN_TEMPLATE:
642
+ case InsertionMode.IN_FRAMESET:
643
+ case InsertionMode.AFTER_FRAMESET:
644
+ appendComment(this, token);
645
+ break;
646
+ case InsertionMode.IN_TABLE_TEXT:
647
+ tokenInTableText(this, token);
648
+ break;
649
+ case InsertionMode.AFTER_BODY:
650
+ appendCommentToRootHtmlElement(this, token);
651
+ break;
652
+ case InsertionMode.AFTER_AFTER_BODY:
653
+ case InsertionMode.AFTER_AFTER_FRAMESET: appendCommentToDocument(this, token);
654
+ }
655
+ }
656
+ /** @internal */
657
+ onDoctype(token) {
658
+ this.skipNextNewLine = false;
659
+ switch (this.insertionMode) {
660
+ case InsertionMode.INITIAL:
661
+ doctypeInInitialMode(this, token);
662
+ break;
663
+ case InsertionMode.BEFORE_HEAD:
664
+ case InsertionMode.IN_HEAD:
665
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
666
+ case InsertionMode.AFTER_HEAD:
667
+ this._err(token, ERR.misplacedDoctype);
668
+ break;
669
+ case InsertionMode.IN_TABLE_TEXT: tokenInTableText(this, token);
670
+ }
671
+ }
672
+ /** @internal */
673
+ onStartTag(token) {
674
+ this.skipNextNewLine = false;
675
+ this.currentToken = token;
676
+ this._processStartTag(token);
677
+ if (token.selfClosing && !token.ackSelfClosing) this._err(token, ERR.nonVoidHtmlElementStartTagWithTrailingSolidus);
678
+ }
679
+ /**
680
+ * Processes a given start tag.
681
+ *
682
+ * `onStartTag` checks if a self-closing tag was recognized. When a token
683
+ * is moved inbetween multiple insertion modes, this check for self-closing
684
+ * could lead to false positives. To avoid this, `_processStartTag` is used
685
+ * for nested calls.
686
+ *
687
+ * @param token The token to process.
688
+ * @protected
689
+ */
690
+ _processStartTag(token) {
691
+ if (this.shouldProcessStartTagTokenInForeignContent(token)) startTagInForeignContent(this, token);
692
+ else this._startTagOutsideForeignContent(token);
693
+ }
694
+ /** @protected */
695
+ _startTagOutsideForeignContent(token) {
696
+ switch (this.insertionMode) {
697
+ case InsertionMode.INITIAL:
698
+ tokenInInitialMode(this, token);
699
+ break;
700
+ case InsertionMode.BEFORE_HTML:
701
+ startTagBeforeHtml(this, token);
702
+ break;
703
+ case InsertionMode.BEFORE_HEAD:
704
+ startTagBeforeHead(this, token);
705
+ break;
706
+ case InsertionMode.IN_HEAD:
707
+ startTagInHead(this, token);
708
+ break;
709
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
710
+ startTagInHeadNoScript(this, token);
711
+ break;
712
+ case InsertionMode.AFTER_HEAD:
713
+ startTagAfterHead(this, token);
714
+ break;
715
+ case InsertionMode.IN_BODY:
716
+ startTagInBody(this, token);
717
+ break;
718
+ case InsertionMode.IN_TABLE:
719
+ startTagInTable(this, token);
720
+ break;
721
+ case InsertionMode.IN_TABLE_TEXT:
722
+ tokenInTableText(this, token);
723
+ break;
724
+ case InsertionMode.IN_CAPTION:
725
+ startTagInCaption(this, token);
726
+ break;
727
+ case InsertionMode.IN_COLUMN_GROUP:
728
+ startTagInColumnGroup(this, token);
729
+ break;
730
+ case InsertionMode.IN_TABLE_BODY:
731
+ startTagInTableBody(this, token);
732
+ break;
733
+ case InsertionMode.IN_ROW:
734
+ startTagInRow(this, token);
735
+ break;
736
+ case InsertionMode.IN_CELL:
737
+ startTagInCell(this, token);
738
+ break;
739
+ case InsertionMode.IN_SELECT:
740
+ startTagInSelect(this, token);
741
+ break;
742
+ case InsertionMode.IN_SELECT_IN_TABLE:
743
+ startTagInSelectInTable(this, token);
744
+ break;
745
+ case InsertionMode.IN_TEMPLATE:
746
+ startTagInTemplate(this, token);
747
+ break;
748
+ case InsertionMode.AFTER_BODY:
749
+ startTagAfterBody(this, token);
750
+ break;
751
+ case InsertionMode.IN_FRAMESET:
752
+ startTagInFrameset(this, token);
753
+ break;
754
+ case InsertionMode.AFTER_FRAMESET:
755
+ startTagAfterFrameset(this, token);
756
+ break;
757
+ case InsertionMode.AFTER_AFTER_BODY:
758
+ startTagAfterAfterBody(this, token);
759
+ break;
760
+ case InsertionMode.AFTER_AFTER_FRAMESET: startTagAfterAfterFrameset(this, token);
761
+ }
762
+ }
763
+ /** @internal */
764
+ onEndTag(token) {
765
+ this.skipNextNewLine = false;
766
+ this.currentToken = token;
767
+ if (this.currentNotInHTML) endTagInForeignContent(this, token);
768
+ else this._endTagOutsideForeignContent(token);
769
+ }
770
+ /** @protected */
771
+ _endTagOutsideForeignContent(token) {
772
+ switch (this.insertionMode) {
773
+ case InsertionMode.INITIAL:
774
+ tokenInInitialMode(this, token);
775
+ break;
776
+ case InsertionMode.BEFORE_HTML:
777
+ endTagBeforeHtml(this, token);
778
+ break;
779
+ case InsertionMode.BEFORE_HEAD:
780
+ endTagBeforeHead(this, token);
781
+ break;
782
+ case InsertionMode.IN_HEAD:
783
+ endTagInHead(this, token);
784
+ break;
785
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
786
+ endTagInHeadNoScript(this, token);
787
+ break;
788
+ case InsertionMode.AFTER_HEAD:
789
+ endTagAfterHead(this, token);
790
+ break;
791
+ case InsertionMode.IN_BODY:
792
+ endTagInBody(this, token);
793
+ break;
794
+ case InsertionMode.TEXT:
795
+ endTagInText(this, token);
796
+ break;
797
+ case InsertionMode.IN_TABLE:
798
+ endTagInTable(this, token);
799
+ break;
800
+ case InsertionMode.IN_TABLE_TEXT:
801
+ tokenInTableText(this, token);
802
+ break;
803
+ case InsertionMode.IN_CAPTION:
804
+ endTagInCaption(this, token);
805
+ break;
806
+ case InsertionMode.IN_COLUMN_GROUP:
807
+ endTagInColumnGroup(this, token);
808
+ break;
809
+ case InsertionMode.IN_TABLE_BODY:
810
+ endTagInTableBody(this, token);
811
+ break;
812
+ case InsertionMode.IN_ROW:
813
+ endTagInRow(this, token);
814
+ break;
815
+ case InsertionMode.IN_CELL:
816
+ endTagInCell(this, token);
817
+ break;
818
+ case InsertionMode.IN_SELECT:
819
+ endTagInSelect(this, token);
820
+ break;
821
+ case InsertionMode.IN_SELECT_IN_TABLE:
822
+ endTagInSelectInTable(this, token);
823
+ break;
824
+ case InsertionMode.IN_TEMPLATE:
825
+ endTagInTemplate(this, token);
826
+ break;
827
+ case InsertionMode.AFTER_BODY:
828
+ endTagAfterBody(this, token);
829
+ break;
830
+ case InsertionMode.IN_FRAMESET:
831
+ endTagInFrameset(this, token);
832
+ break;
833
+ case InsertionMode.AFTER_FRAMESET:
834
+ endTagAfterFrameset(this, token);
835
+ break;
836
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
837
+ }
838
+ }
839
+ /** @internal */
840
+ onEof(token) {
841
+ switch (this.insertionMode) {
842
+ case InsertionMode.INITIAL:
843
+ tokenInInitialMode(this, token);
844
+ break;
845
+ case InsertionMode.BEFORE_HTML:
846
+ tokenBeforeHtml(this, token);
847
+ break;
848
+ case InsertionMode.BEFORE_HEAD:
849
+ tokenBeforeHead(this, token);
850
+ break;
851
+ case InsertionMode.IN_HEAD:
852
+ tokenInHead(this, token);
853
+ break;
854
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
855
+ tokenInHeadNoScript(this, token);
856
+ break;
857
+ case InsertionMode.AFTER_HEAD:
858
+ tokenAfterHead(this, token);
859
+ break;
860
+ case InsertionMode.IN_BODY:
861
+ case InsertionMode.IN_TABLE:
862
+ case InsertionMode.IN_CAPTION:
863
+ case InsertionMode.IN_COLUMN_GROUP:
864
+ case InsertionMode.IN_TABLE_BODY:
865
+ case InsertionMode.IN_ROW:
866
+ case InsertionMode.IN_CELL:
867
+ case InsertionMode.IN_SELECT:
868
+ case InsertionMode.IN_SELECT_IN_TABLE:
869
+ eofInBody(this, token);
870
+ break;
871
+ case InsertionMode.TEXT:
872
+ eofInText(this, token);
873
+ break;
874
+ case InsertionMode.IN_TABLE_TEXT:
875
+ tokenInTableText(this, token);
876
+ break;
877
+ case InsertionMode.IN_TEMPLATE:
878
+ eofInTemplate(this, token);
879
+ break;
880
+ case InsertionMode.AFTER_BODY:
881
+ case InsertionMode.IN_FRAMESET:
882
+ case InsertionMode.AFTER_FRAMESET:
883
+ case InsertionMode.AFTER_AFTER_BODY:
884
+ case InsertionMode.AFTER_AFTER_FRAMESET: stopParsing(this, token);
885
+ }
886
+ }
887
+ /** @internal */
888
+ onWhitespaceCharacter(token) {
889
+ if (this.skipNextNewLine) {
890
+ this.skipNextNewLine = false;
891
+ if (token.chars.charCodeAt(0) === CODE_POINTS.LINE_FEED) {
892
+ if (token.chars.length === 1) return;
893
+ token.chars = token.chars.substr(1);
894
+ }
895
+ }
896
+ if (this.tokenizer.inForeignNode) {
897
+ this._insertCharacters(token);
898
+ return;
899
+ }
900
+ switch (this.insertionMode) {
901
+ case InsertionMode.IN_HEAD:
902
+ case InsertionMode.IN_HEAD_NO_SCRIPT:
903
+ case InsertionMode.AFTER_HEAD:
904
+ case InsertionMode.TEXT:
905
+ case InsertionMode.IN_COLUMN_GROUP:
906
+ case InsertionMode.IN_SELECT:
907
+ case InsertionMode.IN_SELECT_IN_TABLE:
908
+ case InsertionMode.IN_FRAMESET:
909
+ case InsertionMode.AFTER_FRAMESET:
910
+ this._insertCharacters(token);
911
+ break;
912
+ case InsertionMode.IN_BODY:
913
+ case InsertionMode.IN_CAPTION:
914
+ case InsertionMode.IN_CELL:
915
+ case InsertionMode.IN_TEMPLATE:
916
+ case InsertionMode.AFTER_BODY:
917
+ case InsertionMode.AFTER_AFTER_BODY:
918
+ case InsertionMode.AFTER_AFTER_FRAMESET:
919
+ whitespaceCharacterInBody(this, token);
920
+ break;
921
+ case InsertionMode.IN_TABLE:
922
+ case InsertionMode.IN_TABLE_BODY:
923
+ case InsertionMode.IN_ROW:
924
+ characterInTable(this, token);
925
+ break;
926
+ case InsertionMode.IN_TABLE_TEXT: whitespaceCharacterInTableText(this, token);
927
+ }
928
+ }
929
+ };
930
+ function aaObtainFormattingElementEntry(p, token) {
931
+ let formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName);
932
+ if (formattingElementEntry) {
933
+ if (!p.openElements.contains(formattingElementEntry.element)) {
934
+ p.activeFormattingElements.removeEntry(formattingElementEntry);
935
+ formattingElementEntry = null;
936
+ } else if (!p.openElements.hasInScope(token.tagID)) formattingElementEntry = null;
937
+ } else genericEndTagInBody(p, token);
938
+ return formattingElementEntry;
939
+ }
940
+ function aaObtainFurthestBlock(p, formattingElementEntry) {
941
+ let furthestBlock = null;
942
+ let idx = p.openElements.stackTop;
943
+ for (; idx >= 0; idx--) {
944
+ const element = p.openElements.items[idx];
945
+ if (element === formattingElementEntry.element) break;
946
+ if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) furthestBlock = element;
947
+ }
948
+ if (!furthestBlock) {
949
+ p.openElements.shortenToLength(Math.max(idx, 0));
950
+ p.activeFormattingElements.removeEntry(formattingElementEntry);
951
+ }
952
+ return furthestBlock;
953
+ }
954
+ function aaInnerLoop(p, furthestBlock, formattingElement) {
955
+ let lastElement = furthestBlock;
956
+ let nextElement = p.openElements.getCommonAncestor(furthestBlock);
957
+ for (let i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) {
958
+ nextElement = p.openElements.getCommonAncestor(element);
959
+ const elementEntry = p.activeFormattingElements.getElementEntry(element);
960
+ const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER;
961
+ if (!elementEntry || counterOverflow) {
962
+ if (counterOverflow) p.activeFormattingElements.removeEntry(elementEntry);
963
+ p.openElements.remove(element);
964
+ } else {
965
+ element = aaRecreateElementFromEntry(p, elementEntry);
966
+ if (lastElement === furthestBlock) p.activeFormattingElements.bookmark = elementEntry;
967
+ p.treeAdapter.detachNode(lastElement);
968
+ p.treeAdapter.appendChild(element, lastElement);
969
+ lastElement = element;
970
+ }
971
+ }
972
+ return lastElement;
973
+ }
974
+ function aaRecreateElementFromEntry(p, elementEntry) {
975
+ const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
976
+ const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
977
+ p.openElements.replace(elementEntry.element, newElement);
978
+ elementEntry.element = newElement;
979
+ return newElement;
980
+ }
981
+ function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
982
+ const tn = p.treeAdapter.getTagName(commonAncestor);
983
+ const tid = getTagID(tn);
984
+ if (p._isElementCausesFosterParenting(tid)) p._fosterParentElement(lastElement);
985
+ else {
986
+ const ns = p.treeAdapter.getNamespaceURI(commonAncestor);
987
+ if (tid === TAG_ID.TEMPLATE && ns === NS.HTML) commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor);
988
+ p.treeAdapter.appendChild(commonAncestor, lastElement);
989
+ }
990
+ }
991
+ function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
992
+ const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
993
+ const { token } = formattingElementEntry;
994
+ const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
995
+ p._adoptNodes(furthestBlock, newElement);
996
+ p.treeAdapter.appendChild(furthestBlock, newElement);
997
+ p.activeFormattingElements.insertElementAfterBookmark(newElement, token);
998
+ p.activeFormattingElements.removeEntry(formattingElementEntry);
999
+ p.openElements.remove(formattingElementEntry.element);
1000
+ p.openElements.insertAfter(furthestBlock, newElement, token.tagID);
1001
+ }
1002
+ function callAdoptionAgency(p, token) {
1003
+ for (let i = 0; i < AA_OUTER_LOOP_ITER; i++) {
1004
+ const formattingElementEntry = aaObtainFormattingElementEntry(p, token);
1005
+ if (!formattingElementEntry) break;
1006
+ const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
1007
+ if (!furthestBlock) break;
1008
+ p.activeFormattingElements.bookmark = formattingElementEntry;
1009
+ const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element);
1010
+ const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
1011
+ p.treeAdapter.detachNode(lastElement);
1012
+ if (commonAncestor) aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
1013
+ aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
1014
+ }
1015
+ }
1016
+ function appendComment(p, token) {
1017
+ p._appendCommentNode(token, p.openElements.currentTmplContentOrNode);
1018
+ }
1019
+ function appendCommentToRootHtmlElement(p, token) {
1020
+ p._appendCommentNode(token, p.openElements.items[0]);
1021
+ }
1022
+ function appendCommentToDocument(p, token) {
1023
+ p._appendCommentNode(token, p.document);
1024
+ }
1025
+ function stopParsing(p, token) {
1026
+ p.stopped = true;
1027
+ if (token.location) {
1028
+ const target = p.fragmentContext ? 0 : 2;
1029
+ for (let i = p.openElements.stackTop; i >= target; i--) p._setEndLocation(p.openElements.items[i], token);
1030
+ if (!p.fragmentContext && p.openElements.stackTop >= 0) {
1031
+ const htmlElement = p.openElements.items[0];
1032
+ const htmlLocation = p.treeAdapter.getNodeSourceCodeLocation(htmlElement);
1033
+ if (htmlLocation && !htmlLocation.endTag) {
1034
+ p._setEndLocation(htmlElement, token);
1035
+ if (p.openElements.stackTop >= 1) {
1036
+ const bodyElement = p.openElements.items[1];
1037
+ const bodyLocation = p.treeAdapter.getNodeSourceCodeLocation(bodyElement);
1038
+ if (bodyLocation && !bodyLocation.endTag) p._setEndLocation(bodyElement, token);
1039
+ }
1040
+ }
1041
+ }
1042
+ }
1043
+ }
1044
+ function doctypeInInitialMode(p, token) {
1045
+ p._setDocumentType(token);
1046
+ const mode = token.forceQuirks ? DOCUMENT_MODE.QUIRKS : getDocumentMode(token);
1047
+ if (!isConforming(token)) p._err(token, ERR.nonConformingDoctype);
1048
+ p.treeAdapter.setDocumentMode(p.document, mode);
1049
+ p.insertionMode = InsertionMode.BEFORE_HTML;
1050
+ }
1051
+ function tokenInInitialMode(p, token) {
1052
+ p._err(token, ERR.missingDoctype, true);
1053
+ p.treeAdapter.setDocumentMode(p.document, DOCUMENT_MODE.QUIRKS);
1054
+ p.insertionMode = InsertionMode.BEFORE_HTML;
1055
+ p._processToken(token);
1056
+ }
1057
+ function startTagBeforeHtml(p, token) {
1058
+ if (token.tagID === TAG_ID.HTML) {
1059
+ p._insertElement(token, NS.HTML);
1060
+ p.insertionMode = InsertionMode.BEFORE_HEAD;
1061
+ } else tokenBeforeHtml(p, token);
1062
+ }
1063
+ function endTagBeforeHtml(p, token) {
1064
+ const tn = token.tagID;
1065
+ if (tn === TAG_ID.HTML || tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.BR) tokenBeforeHtml(p, token);
1066
+ }
1067
+ function tokenBeforeHtml(p, token) {
1068
+ p._insertFakeRootElement();
1069
+ p.insertionMode = InsertionMode.BEFORE_HEAD;
1070
+ p._processToken(token);
1071
+ }
1072
+ function startTagBeforeHead(p, token) {
1073
+ switch (token.tagID) {
1074
+ case TAG_ID.HTML:
1075
+ startTagInBody(p, token);
1076
+ break;
1077
+ case TAG_ID.HEAD:
1078
+ p._insertElement(token, NS.HTML);
1079
+ p.headElement = p.openElements.current;
1080
+ p.insertionMode = InsertionMode.IN_HEAD;
1081
+ break;
1082
+ default: tokenBeforeHead(p, token);
1083
+ }
1084
+ }
1085
+ function endTagBeforeHead(p, token) {
1086
+ const tn = token.tagID;
1087
+ if (tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.HTML || tn === TAG_ID.BR) tokenBeforeHead(p, token);
1088
+ else p._err(token, ERR.endTagWithoutMatchingOpenElement);
1089
+ }
1090
+ function tokenBeforeHead(p, token) {
1091
+ p._insertFakeElement(TAG_NAMES.HEAD, TAG_ID.HEAD);
1092
+ p.headElement = p.openElements.current;
1093
+ p.insertionMode = InsertionMode.IN_HEAD;
1094
+ p._processToken(token);
1095
+ }
1096
+ function startTagInHead(p, token) {
1097
+ switch (token.tagID) {
1098
+ case TAG_ID.HTML:
1099
+ startTagInBody(p, token);
1100
+ break;
1101
+ case TAG_ID.BASE:
1102
+ case TAG_ID.BASEFONT:
1103
+ case TAG_ID.BGSOUND:
1104
+ case TAG_ID.LINK:
1105
+ case TAG_ID.META:
1106
+ p._appendElement(token, NS.HTML);
1107
+ token.ackSelfClosing = true;
1108
+ break;
1109
+ case TAG_ID.TITLE:
1110
+ p._switchToTextParsing(token, TokenizerMode.RCDATA);
1111
+ break;
1112
+ case TAG_ID.NOSCRIPT:
1113
+ if (p.options.scriptingEnabled) p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1114
+ else {
1115
+ p._insertElement(token, NS.HTML);
1116
+ p.insertionMode = InsertionMode.IN_HEAD_NO_SCRIPT;
1117
+ }
1118
+ break;
1119
+ case TAG_ID.NOFRAMES:
1120
+ case TAG_ID.STYLE:
1121
+ p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1122
+ break;
1123
+ case TAG_ID.SCRIPT:
1124
+ p._switchToTextParsing(token, TokenizerMode.SCRIPT_DATA);
1125
+ break;
1126
+ case TAG_ID.TEMPLATE:
1127
+ p._insertTemplate(token);
1128
+ p.activeFormattingElements.insertMarker();
1129
+ p.framesetOk = false;
1130
+ p.insertionMode = InsertionMode.IN_TEMPLATE;
1131
+ p.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
1132
+ break;
1133
+ case TAG_ID.HEAD:
1134
+ p._err(token, ERR.misplacedStartTagForHeadElement);
1135
+ break;
1136
+ default: tokenInHead(p, token);
1137
+ }
1138
+ }
1139
+ function endTagInHead(p, token) {
1140
+ switch (token.tagID) {
1141
+ case TAG_ID.HEAD:
1142
+ p.openElements.pop();
1143
+ p.insertionMode = InsertionMode.AFTER_HEAD;
1144
+ break;
1145
+ case TAG_ID.BODY:
1146
+ case TAG_ID.BR:
1147
+ case TAG_ID.HTML:
1148
+ tokenInHead(p, token);
1149
+ break;
1150
+ case TAG_ID.TEMPLATE:
1151
+ templateEndTagInHead(p, token);
1152
+ break;
1153
+ default: p._err(token, ERR.endTagWithoutMatchingOpenElement);
1154
+ }
1155
+ }
1156
+ function templateEndTagInHead(p, token) {
1157
+ if (p.openElements.tmplCount > 0) {
1158
+ p.openElements.generateImpliedEndTagsThoroughly();
1159
+ if (p.openElements.currentTagId !== TAG_ID.TEMPLATE) p._err(token, ERR.closingOfElementWithOpenChildElements);
1160
+ p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
1161
+ p.activeFormattingElements.clearToLastMarker();
1162
+ p.tmplInsertionModeStack.shift();
1163
+ p._resetInsertionMode();
1164
+ } else p._err(token, ERR.endTagWithoutMatchingOpenElement);
1165
+ }
1166
+ function tokenInHead(p, token) {
1167
+ p.openElements.pop();
1168
+ p.insertionMode = InsertionMode.AFTER_HEAD;
1169
+ p._processToken(token);
1170
+ }
1171
+ function startTagInHeadNoScript(p, token) {
1172
+ switch (token.tagID) {
1173
+ case TAG_ID.HTML:
1174
+ startTagInBody(p, token);
1175
+ break;
1176
+ case TAG_ID.BASEFONT:
1177
+ case TAG_ID.BGSOUND:
1178
+ case TAG_ID.HEAD:
1179
+ case TAG_ID.LINK:
1180
+ case TAG_ID.META:
1181
+ case TAG_ID.NOFRAMES:
1182
+ case TAG_ID.STYLE:
1183
+ startTagInHead(p, token);
1184
+ break;
1185
+ case TAG_ID.NOSCRIPT:
1186
+ p._err(token, ERR.nestedNoscriptInHead);
1187
+ break;
1188
+ default: tokenInHeadNoScript(p, token);
1189
+ }
1190
+ }
1191
+ function endTagInHeadNoScript(p, token) {
1192
+ switch (token.tagID) {
1193
+ case TAG_ID.NOSCRIPT:
1194
+ p.openElements.pop();
1195
+ p.insertionMode = InsertionMode.IN_HEAD;
1196
+ break;
1197
+ case TAG_ID.BR:
1198
+ tokenInHeadNoScript(p, token);
1199
+ break;
1200
+ default: p._err(token, ERR.endTagWithoutMatchingOpenElement);
1201
+ }
1202
+ }
1203
+ function tokenInHeadNoScript(p, token) {
1204
+ const errCode = token.type === TokenType.EOF ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead;
1205
+ p._err(token, errCode);
1206
+ p.openElements.pop();
1207
+ p.insertionMode = InsertionMode.IN_HEAD;
1208
+ p._processToken(token);
1209
+ }
1210
+ function startTagAfterHead(p, token) {
1211
+ switch (token.tagID) {
1212
+ case TAG_ID.HTML:
1213
+ startTagInBody(p, token);
1214
+ break;
1215
+ case TAG_ID.BODY:
1216
+ p._insertElement(token, NS.HTML);
1217
+ p.framesetOk = false;
1218
+ p.insertionMode = InsertionMode.IN_BODY;
1219
+ break;
1220
+ case TAG_ID.FRAMESET:
1221
+ p._insertElement(token, NS.HTML);
1222
+ p.insertionMode = InsertionMode.IN_FRAMESET;
1223
+ break;
1224
+ case TAG_ID.BASE:
1225
+ case TAG_ID.BASEFONT:
1226
+ case TAG_ID.BGSOUND:
1227
+ case TAG_ID.LINK:
1228
+ case TAG_ID.META:
1229
+ case TAG_ID.NOFRAMES:
1230
+ case TAG_ID.SCRIPT:
1231
+ case TAG_ID.STYLE:
1232
+ case TAG_ID.TEMPLATE:
1233
+ case TAG_ID.TITLE:
1234
+ p._err(token, ERR.abandonedHeadElementChild);
1235
+ p.openElements.push(p.headElement, TAG_ID.HEAD);
1236
+ startTagInHead(p, token);
1237
+ p.openElements.remove(p.headElement);
1238
+ break;
1239
+ case TAG_ID.HEAD:
1240
+ p._err(token, ERR.misplacedStartTagForHeadElement);
1241
+ break;
1242
+ default: tokenAfterHead(p, token);
1243
+ }
1244
+ }
1245
+ function endTagAfterHead(p, token) {
1246
+ switch (token.tagID) {
1247
+ case TAG_ID.BODY:
1248
+ case TAG_ID.HTML:
1249
+ case TAG_ID.BR:
1250
+ tokenAfterHead(p, token);
1251
+ break;
1252
+ case TAG_ID.TEMPLATE:
1253
+ templateEndTagInHead(p, token);
1254
+ break;
1255
+ default: p._err(token, ERR.endTagWithoutMatchingOpenElement);
1256
+ }
1257
+ }
1258
+ function tokenAfterHead(p, token) {
1259
+ p._insertFakeElement(TAG_NAMES.BODY, TAG_ID.BODY);
1260
+ p.insertionMode = InsertionMode.IN_BODY;
1261
+ modeInBody(p, token);
1262
+ }
1263
+ function modeInBody(p, token) {
1264
+ switch (token.type) {
1265
+ case TokenType.CHARACTER:
1266
+ characterInBody(p, token);
1267
+ break;
1268
+ case TokenType.WHITESPACE_CHARACTER:
1269
+ whitespaceCharacterInBody(p, token);
1270
+ break;
1271
+ case TokenType.COMMENT:
1272
+ appendComment(p, token);
1273
+ break;
1274
+ case TokenType.START_TAG:
1275
+ startTagInBody(p, token);
1276
+ break;
1277
+ case TokenType.END_TAG:
1278
+ endTagInBody(p, token);
1279
+ break;
1280
+ case TokenType.EOF: eofInBody(p, token);
1281
+ }
1282
+ }
1283
+ function whitespaceCharacterInBody(p, token) {
1284
+ p._reconstructActiveFormattingElements();
1285
+ p._insertCharacters(token);
1286
+ }
1287
+ function characterInBody(p, token) {
1288
+ p._reconstructActiveFormattingElements();
1289
+ p._insertCharacters(token);
1290
+ p.framesetOk = false;
1291
+ }
1292
+ function htmlStartTagInBody(p, token) {
1293
+ if (p.openElements.tmplCount === 0) p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs);
1294
+ }
1295
+ function bodyStartTagInBody(p, token) {
1296
+ const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
1297
+ if (bodyElement && p.openElements.tmplCount === 0) {
1298
+ p.framesetOk = false;
1299
+ p.treeAdapter.adoptAttributes(bodyElement, token.attrs);
1300
+ }
1301
+ }
1302
+ function framesetStartTagInBody(p, token) {
1303
+ const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
1304
+ if (p.framesetOk && bodyElement) {
1305
+ p.treeAdapter.detachNode(bodyElement);
1306
+ p.openElements.popAllUpToHtmlElement();
1307
+ p._insertElement(token, NS.HTML);
1308
+ p.insertionMode = InsertionMode.IN_FRAMESET;
1309
+ }
1310
+ }
1311
+ function addressStartTagInBody(p, token) {
1312
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1313
+ p._insertElement(token, NS.HTML);
1314
+ }
1315
+ function numberedHeaderStartTagInBody(p, token) {
1316
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1317
+ if (p.openElements.currentTagId !== void 0 && NUMBERED_HEADERS.has(p.openElements.currentTagId)) p.openElements.pop();
1318
+ p._insertElement(token, NS.HTML);
1319
+ }
1320
+ function preStartTagInBody(p, token) {
1321
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1322
+ p._insertElement(token, NS.HTML);
1323
+ p.skipNextNewLine = true;
1324
+ p.framesetOk = false;
1325
+ }
1326
+ function formStartTagInBody(p, token) {
1327
+ const inTemplate = p.openElements.tmplCount > 0;
1328
+ if (!p.formElement || inTemplate) {
1329
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1330
+ p._insertElement(token, NS.HTML);
1331
+ if (!inTemplate) p.formElement = p.openElements.current;
1332
+ }
1333
+ }
1334
+ function listItemStartTagInBody(p, token) {
1335
+ p.framesetOk = false;
1336
+ const tn = token.tagID;
1337
+ for (let i = p.openElements.stackTop; i >= 0; i--) {
1338
+ const elementId = p.openElements.tagIDs[i];
1339
+ if (tn === TAG_ID.LI && elementId === TAG_ID.LI || (tn === TAG_ID.DD || tn === TAG_ID.DT) && (elementId === TAG_ID.DD || elementId === TAG_ID.DT)) {
1340
+ p.openElements.generateImpliedEndTagsWithExclusion(elementId);
1341
+ p.openElements.popUntilTagNamePopped(elementId);
1342
+ break;
1343
+ }
1344
+ if (elementId !== TAG_ID.ADDRESS && elementId !== TAG_ID.DIV && elementId !== TAG_ID.P && p._isSpecialElement(p.openElements.items[i], elementId)) break;
1345
+ }
1346
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1347
+ p._insertElement(token, NS.HTML);
1348
+ }
1349
+ function plaintextStartTagInBody(p, token) {
1350
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1351
+ p._insertElement(token, NS.HTML);
1352
+ p.tokenizer.state = TokenizerMode.PLAINTEXT;
1353
+ }
1354
+ function buttonStartTagInBody(p, token) {
1355
+ if (p.openElements.hasInScope(TAG_ID.BUTTON)) {
1356
+ p.openElements.generateImpliedEndTags();
1357
+ p.openElements.popUntilTagNamePopped(TAG_ID.BUTTON);
1358
+ }
1359
+ p._reconstructActiveFormattingElements();
1360
+ p._insertElement(token, NS.HTML);
1361
+ p.framesetOk = false;
1362
+ }
1363
+ function aStartTagInBody(p, token) {
1364
+ const activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(TAG_NAMES.A);
1365
+ if (activeElementEntry) {
1366
+ callAdoptionAgency(p, token);
1367
+ p.openElements.remove(activeElementEntry.element);
1368
+ p.activeFormattingElements.removeEntry(activeElementEntry);
1369
+ }
1370
+ p._reconstructActiveFormattingElements();
1371
+ p._insertElement(token, NS.HTML);
1372
+ p.activeFormattingElements.pushElement(p.openElements.current, token);
1373
+ }
1374
+ function bStartTagInBody(p, token) {
1375
+ p._reconstructActiveFormattingElements();
1376
+ p._insertElement(token, NS.HTML);
1377
+ p.activeFormattingElements.pushElement(p.openElements.current, token);
1378
+ }
1379
+ function nobrStartTagInBody(p, token) {
1380
+ p._reconstructActiveFormattingElements();
1381
+ if (p.openElements.hasInScope(TAG_ID.NOBR)) {
1382
+ callAdoptionAgency(p, token);
1383
+ p._reconstructActiveFormattingElements();
1384
+ }
1385
+ p._insertElement(token, NS.HTML);
1386
+ p.activeFormattingElements.pushElement(p.openElements.current, token);
1387
+ }
1388
+ function appletStartTagInBody(p, token) {
1389
+ p._reconstructActiveFormattingElements();
1390
+ p._insertElement(token, NS.HTML);
1391
+ p.activeFormattingElements.insertMarker();
1392
+ p.framesetOk = false;
1393
+ }
1394
+ function tableStartTagInBody(p, token) {
1395
+ if (p.treeAdapter.getDocumentMode(p.document) !== DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1396
+ p._insertElement(token, NS.HTML);
1397
+ p.framesetOk = false;
1398
+ p.insertionMode = InsertionMode.IN_TABLE;
1399
+ }
1400
+ function areaStartTagInBody(p, token) {
1401
+ p._reconstructActiveFormattingElements();
1402
+ p._appendElement(token, NS.HTML);
1403
+ p.framesetOk = false;
1404
+ token.ackSelfClosing = true;
1405
+ }
1406
+ function isHiddenInput(token) {
1407
+ const inputType = getTokenAttr(token, ATTRS.TYPE);
1408
+ return inputType != null && inputType.toLowerCase() === HIDDEN_INPUT_TYPE;
1409
+ }
1410
+ function inputStartTagInBody(p, token) {
1411
+ p._reconstructActiveFormattingElements();
1412
+ p._appendElement(token, NS.HTML);
1413
+ if (!isHiddenInput(token)) p.framesetOk = false;
1414
+ token.ackSelfClosing = true;
1415
+ }
1416
+ function paramStartTagInBody(p, token) {
1417
+ p._appendElement(token, NS.HTML);
1418
+ token.ackSelfClosing = true;
1419
+ }
1420
+ function hrStartTagInBody(p, token) {
1421
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1422
+ p._appendElement(token, NS.HTML);
1423
+ p.framesetOk = false;
1424
+ token.ackSelfClosing = true;
1425
+ }
1426
+ function imageStartTagInBody(p, token) {
1427
+ token.tagName = TAG_NAMES.IMG;
1428
+ token.tagID = TAG_ID.IMG;
1429
+ areaStartTagInBody(p, token);
1430
+ }
1431
+ function textareaStartTagInBody(p, token) {
1432
+ p._insertElement(token, NS.HTML);
1433
+ p.skipNextNewLine = true;
1434
+ p.tokenizer.state = TokenizerMode.RCDATA;
1435
+ p.originalInsertionMode = p.insertionMode;
1436
+ p.framesetOk = false;
1437
+ p.insertionMode = InsertionMode.TEXT;
1438
+ }
1439
+ function xmpStartTagInBody(p, token) {
1440
+ if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
1441
+ p._reconstructActiveFormattingElements();
1442
+ p.framesetOk = false;
1443
+ p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1444
+ }
1445
+ function iframeStartTagInBody(p, token) {
1446
+ p.framesetOk = false;
1447
+ p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1448
+ }
1449
+ function rawTextStartTagInBody(p, token) {
1450
+ p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1451
+ }
1452
+ function selectStartTagInBody(p, token) {
1453
+ p._reconstructActiveFormattingElements();
1454
+ p._insertElement(token, NS.HTML);
1455
+ p.framesetOk = false;
1456
+ p.insertionMode = p.insertionMode === InsertionMode.IN_TABLE || p.insertionMode === InsertionMode.IN_CAPTION || p.insertionMode === InsertionMode.IN_TABLE_BODY || p.insertionMode === InsertionMode.IN_ROW || p.insertionMode === InsertionMode.IN_CELL ? InsertionMode.IN_SELECT_IN_TABLE : InsertionMode.IN_SELECT;
1457
+ }
1458
+ function optgroupStartTagInBody(p, token) {
1459
+ if (p.openElements.currentTagId === TAG_ID.OPTION) p.openElements.pop();
1460
+ p._reconstructActiveFormattingElements();
1461
+ p._insertElement(token, NS.HTML);
1462
+ }
1463
+ function rbStartTagInBody(p, token) {
1464
+ if (p.openElements.hasInScope(TAG_ID.RUBY)) p.openElements.generateImpliedEndTags();
1465
+ p._insertElement(token, NS.HTML);
1466
+ }
1467
+ function rtStartTagInBody(p, token) {
1468
+ if (p.openElements.hasInScope(TAG_ID.RUBY)) p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.RTC);
1469
+ p._insertElement(token, NS.HTML);
1470
+ }
1471
+ function mathStartTagInBody(p, token) {
1472
+ p._reconstructActiveFormattingElements();
1473
+ adjustTokenMathMLAttrs(token);
1474
+ adjustTokenXMLAttrs(token);
1475
+ if (token.selfClosing) p._appendElement(token, NS.MATHML);
1476
+ else p._insertElement(token, NS.MATHML);
1477
+ token.ackSelfClosing = true;
1478
+ }
1479
+ function svgStartTagInBody(p, token) {
1480
+ p._reconstructActiveFormattingElements();
1481
+ adjustTokenSVGAttrs(token);
1482
+ adjustTokenXMLAttrs(token);
1483
+ if (token.selfClosing) p._appendElement(token, NS.SVG);
1484
+ else p._insertElement(token, NS.SVG);
1485
+ token.ackSelfClosing = true;
1486
+ }
1487
+ function genericStartTagInBody(p, token) {
1488
+ p._reconstructActiveFormattingElements();
1489
+ p._insertElement(token, NS.HTML);
1490
+ }
1491
+ function startTagInBody(p, token) {
1492
+ switch (token.tagID) {
1493
+ case TAG_ID.I:
1494
+ case TAG_ID.S:
1495
+ case TAG_ID.B:
1496
+ case TAG_ID.U:
1497
+ case TAG_ID.EM:
1498
+ case TAG_ID.TT:
1499
+ case TAG_ID.BIG:
1500
+ case TAG_ID.CODE:
1501
+ case TAG_ID.FONT:
1502
+ case TAG_ID.SMALL:
1503
+ case TAG_ID.STRIKE:
1504
+ case TAG_ID.STRONG:
1505
+ bStartTagInBody(p, token);
1506
+ break;
1507
+ case TAG_ID.A:
1508
+ aStartTagInBody(p, token);
1509
+ break;
1510
+ case TAG_ID.H1:
1511
+ case TAG_ID.H2:
1512
+ case TAG_ID.H3:
1513
+ case TAG_ID.H4:
1514
+ case TAG_ID.H5:
1515
+ case TAG_ID.H6:
1516
+ numberedHeaderStartTagInBody(p, token);
1517
+ break;
1518
+ case TAG_ID.P:
1519
+ case TAG_ID.DL:
1520
+ case TAG_ID.OL:
1521
+ case TAG_ID.UL:
1522
+ case TAG_ID.DIV:
1523
+ case TAG_ID.DIR:
1524
+ case TAG_ID.NAV:
1525
+ case TAG_ID.MAIN:
1526
+ case TAG_ID.MENU:
1527
+ case TAG_ID.ASIDE:
1528
+ case TAG_ID.CENTER:
1529
+ case TAG_ID.FIGURE:
1530
+ case TAG_ID.FOOTER:
1531
+ case TAG_ID.HEADER:
1532
+ case TAG_ID.HGROUP:
1533
+ case TAG_ID.DIALOG:
1534
+ case TAG_ID.DETAILS:
1535
+ case TAG_ID.ADDRESS:
1536
+ case TAG_ID.ARTICLE:
1537
+ case TAG_ID.SEARCH:
1538
+ case TAG_ID.SECTION:
1539
+ case TAG_ID.SUMMARY:
1540
+ case TAG_ID.FIELDSET:
1541
+ case TAG_ID.BLOCKQUOTE:
1542
+ case TAG_ID.FIGCAPTION:
1543
+ addressStartTagInBody(p, token);
1544
+ break;
1545
+ case TAG_ID.LI:
1546
+ case TAG_ID.DD:
1547
+ case TAG_ID.DT:
1548
+ listItemStartTagInBody(p, token);
1549
+ break;
1550
+ case TAG_ID.BR:
1551
+ case TAG_ID.IMG:
1552
+ case TAG_ID.WBR:
1553
+ case TAG_ID.AREA:
1554
+ case TAG_ID.EMBED:
1555
+ case TAG_ID.KEYGEN:
1556
+ areaStartTagInBody(p, token);
1557
+ break;
1558
+ case TAG_ID.HR:
1559
+ hrStartTagInBody(p, token);
1560
+ break;
1561
+ case TAG_ID.RB:
1562
+ case TAG_ID.RTC:
1563
+ rbStartTagInBody(p, token);
1564
+ break;
1565
+ case TAG_ID.RT:
1566
+ case TAG_ID.RP:
1567
+ rtStartTagInBody(p, token);
1568
+ break;
1569
+ case TAG_ID.PRE:
1570
+ case TAG_ID.LISTING:
1571
+ preStartTagInBody(p, token);
1572
+ break;
1573
+ case TAG_ID.XMP:
1574
+ xmpStartTagInBody(p, token);
1575
+ break;
1576
+ case TAG_ID.SVG:
1577
+ svgStartTagInBody(p, token);
1578
+ break;
1579
+ case TAG_ID.HTML:
1580
+ htmlStartTagInBody(p, token);
1581
+ break;
1582
+ case TAG_ID.BASE:
1583
+ case TAG_ID.LINK:
1584
+ case TAG_ID.META:
1585
+ case TAG_ID.STYLE:
1586
+ case TAG_ID.TITLE:
1587
+ case TAG_ID.SCRIPT:
1588
+ case TAG_ID.BGSOUND:
1589
+ case TAG_ID.BASEFONT:
1590
+ case TAG_ID.TEMPLATE:
1591
+ startTagInHead(p, token);
1592
+ break;
1593
+ case TAG_ID.BODY:
1594
+ bodyStartTagInBody(p, token);
1595
+ break;
1596
+ case TAG_ID.FORM:
1597
+ formStartTagInBody(p, token);
1598
+ break;
1599
+ case TAG_ID.NOBR:
1600
+ nobrStartTagInBody(p, token);
1601
+ break;
1602
+ case TAG_ID.MATH:
1603
+ mathStartTagInBody(p, token);
1604
+ break;
1605
+ case TAG_ID.TABLE:
1606
+ tableStartTagInBody(p, token);
1607
+ break;
1608
+ case TAG_ID.INPUT:
1609
+ inputStartTagInBody(p, token);
1610
+ break;
1611
+ case TAG_ID.PARAM:
1612
+ case TAG_ID.TRACK:
1613
+ case TAG_ID.SOURCE:
1614
+ paramStartTagInBody(p, token);
1615
+ break;
1616
+ case TAG_ID.IMAGE:
1617
+ imageStartTagInBody(p, token);
1618
+ break;
1619
+ case TAG_ID.BUTTON:
1620
+ buttonStartTagInBody(p, token);
1621
+ break;
1622
+ case TAG_ID.APPLET:
1623
+ case TAG_ID.OBJECT:
1624
+ case TAG_ID.MARQUEE:
1625
+ appletStartTagInBody(p, token);
1626
+ break;
1627
+ case TAG_ID.IFRAME:
1628
+ iframeStartTagInBody(p, token);
1629
+ break;
1630
+ case TAG_ID.SELECT:
1631
+ selectStartTagInBody(p, token);
1632
+ break;
1633
+ case TAG_ID.OPTION:
1634
+ case TAG_ID.OPTGROUP:
1635
+ optgroupStartTagInBody(p, token);
1636
+ break;
1637
+ case TAG_ID.NOEMBED:
1638
+ case TAG_ID.NOFRAMES:
1639
+ rawTextStartTagInBody(p, token);
1640
+ break;
1641
+ case TAG_ID.FRAMESET:
1642
+ framesetStartTagInBody(p, token);
1643
+ break;
1644
+ case TAG_ID.TEXTAREA:
1645
+ textareaStartTagInBody(p, token);
1646
+ break;
1647
+ case TAG_ID.NOSCRIPT:
1648
+ if (p.options.scriptingEnabled) rawTextStartTagInBody(p, token);
1649
+ else genericStartTagInBody(p, token);
1650
+ break;
1651
+ case TAG_ID.PLAINTEXT:
1652
+ plaintextStartTagInBody(p, token);
1653
+ break;
1654
+ case TAG_ID.COL:
1655
+ case TAG_ID.TH:
1656
+ case TAG_ID.TD:
1657
+ case TAG_ID.TR:
1658
+ case TAG_ID.HEAD:
1659
+ case TAG_ID.FRAME:
1660
+ case TAG_ID.TBODY:
1661
+ case TAG_ID.TFOOT:
1662
+ case TAG_ID.THEAD:
1663
+ case TAG_ID.CAPTION:
1664
+ case TAG_ID.COLGROUP: break;
1665
+ default: genericStartTagInBody(p, token);
1666
+ }
1667
+ }
1668
+ function bodyEndTagInBody(p, token) {
1669
+ if (p.openElements.hasInScope(TAG_ID.BODY)) {
1670
+ p.insertionMode = InsertionMode.AFTER_BODY;
1671
+ if (p.options.sourceCodeLocationInfo) {
1672
+ const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
1673
+ if (bodyElement) p._setEndLocation(bodyElement, token);
1674
+ }
1675
+ }
1676
+ }
1677
+ function htmlEndTagInBody(p, token) {
1678
+ if (p.openElements.hasInScope(TAG_ID.BODY)) {
1679
+ p.insertionMode = InsertionMode.AFTER_BODY;
1680
+ endTagAfterBody(p, token);
1681
+ }
1682
+ }
1683
+ function addressEndTagInBody(p, token) {
1684
+ const tn = token.tagID;
1685
+ if (p.openElements.hasInScope(tn)) {
1686
+ p.openElements.generateImpliedEndTags();
1687
+ p.openElements.popUntilTagNamePopped(tn);
1688
+ }
1689
+ }
1690
+ function formEndTagInBody(p) {
1691
+ const inTemplate = p.openElements.tmplCount > 0;
1692
+ const { formElement } = p;
1693
+ if (!inTemplate) p.formElement = null;
1694
+ if ((formElement || inTemplate) && p.openElements.hasInScope(TAG_ID.FORM)) {
1695
+ p.openElements.generateImpliedEndTags();
1696
+ if (inTemplate) p.openElements.popUntilTagNamePopped(TAG_ID.FORM);
1697
+ else if (formElement) p.openElements.remove(formElement);
1698
+ }
1699
+ }
1700
+ function pEndTagInBody(p) {
1701
+ if (!p.openElements.hasInButtonScope(TAG_ID.P)) p._insertFakeElement(TAG_NAMES.P, TAG_ID.P);
1702
+ p._closePElement();
1703
+ }
1704
+ function liEndTagInBody(p) {
1705
+ if (p.openElements.hasInListItemScope(TAG_ID.LI)) {
1706
+ p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.LI);
1707
+ p.openElements.popUntilTagNamePopped(TAG_ID.LI);
1708
+ }
1709
+ }
1710
+ function ddEndTagInBody(p, token) {
1711
+ const tn = token.tagID;
1712
+ if (p.openElements.hasInScope(tn)) {
1713
+ p.openElements.generateImpliedEndTagsWithExclusion(tn);
1714
+ p.openElements.popUntilTagNamePopped(tn);
1715
+ }
1716
+ }
1717
+ function numberedHeaderEndTagInBody(p) {
1718
+ if (p.openElements.hasNumberedHeaderInScope()) {
1719
+ p.openElements.generateImpliedEndTags();
1720
+ p.openElements.popUntilNumberedHeaderPopped();
1721
+ }
1722
+ }
1723
+ function appletEndTagInBody(p, token) {
1724
+ const tn = token.tagID;
1725
+ if (p.openElements.hasInScope(tn)) {
1726
+ p.openElements.generateImpliedEndTags();
1727
+ p.openElements.popUntilTagNamePopped(tn);
1728
+ p.activeFormattingElements.clearToLastMarker();
1729
+ }
1730
+ }
1731
+ function brEndTagInBody(p) {
1732
+ p._reconstructActiveFormattingElements();
1733
+ p._insertFakeElement(TAG_NAMES.BR, TAG_ID.BR);
1734
+ p.openElements.pop();
1735
+ p.framesetOk = false;
1736
+ }
1737
+ function genericEndTagInBody(p, token) {
1738
+ const tn = token.tagName;
1739
+ const tid = token.tagID;
1740
+ for (let i = p.openElements.stackTop; i > 0; i--) {
1741
+ const element = p.openElements.items[i];
1742
+ const elementId = p.openElements.tagIDs[i];
1743
+ if (tid === elementId && (tid !== TAG_ID.UNKNOWN || p.treeAdapter.getTagName(element) === tn)) {
1744
+ p.openElements.generateImpliedEndTagsWithExclusion(tid);
1745
+ if (p.openElements.stackTop >= i) p.openElements.shortenToLength(i);
1746
+ break;
1747
+ }
1748
+ if (p._isSpecialElement(element, elementId)) break;
1749
+ }
1750
+ }
1751
+ function endTagInBody(p, token) {
1752
+ switch (token.tagID) {
1753
+ case TAG_ID.A:
1754
+ case TAG_ID.B:
1755
+ case TAG_ID.I:
1756
+ case TAG_ID.S:
1757
+ case TAG_ID.U:
1758
+ case TAG_ID.EM:
1759
+ case TAG_ID.TT:
1760
+ case TAG_ID.BIG:
1761
+ case TAG_ID.CODE:
1762
+ case TAG_ID.FONT:
1763
+ case TAG_ID.NOBR:
1764
+ case TAG_ID.SMALL:
1765
+ case TAG_ID.STRIKE:
1766
+ case TAG_ID.STRONG:
1767
+ callAdoptionAgency(p, token);
1768
+ break;
1769
+ case TAG_ID.P:
1770
+ pEndTagInBody(p);
1771
+ break;
1772
+ case TAG_ID.DL:
1773
+ case TAG_ID.UL:
1774
+ case TAG_ID.OL:
1775
+ case TAG_ID.DIR:
1776
+ case TAG_ID.DIV:
1777
+ case TAG_ID.NAV:
1778
+ case TAG_ID.PRE:
1779
+ case TAG_ID.MAIN:
1780
+ case TAG_ID.MENU:
1781
+ case TAG_ID.ASIDE:
1782
+ case TAG_ID.BUTTON:
1783
+ case TAG_ID.CENTER:
1784
+ case TAG_ID.FIGURE:
1785
+ case TAG_ID.FOOTER:
1786
+ case TAG_ID.HEADER:
1787
+ case TAG_ID.HGROUP:
1788
+ case TAG_ID.DIALOG:
1789
+ case TAG_ID.ADDRESS:
1790
+ case TAG_ID.ARTICLE:
1791
+ case TAG_ID.DETAILS:
1792
+ case TAG_ID.SEARCH:
1793
+ case TAG_ID.SECTION:
1794
+ case TAG_ID.SUMMARY:
1795
+ case TAG_ID.LISTING:
1796
+ case TAG_ID.FIELDSET:
1797
+ case TAG_ID.BLOCKQUOTE:
1798
+ case TAG_ID.FIGCAPTION:
1799
+ addressEndTagInBody(p, token);
1800
+ break;
1801
+ case TAG_ID.LI:
1802
+ liEndTagInBody(p);
1803
+ break;
1804
+ case TAG_ID.DD:
1805
+ case TAG_ID.DT:
1806
+ ddEndTagInBody(p, token);
1807
+ break;
1808
+ case TAG_ID.H1:
1809
+ case TAG_ID.H2:
1810
+ case TAG_ID.H3:
1811
+ case TAG_ID.H4:
1812
+ case TAG_ID.H5:
1813
+ case TAG_ID.H6:
1814
+ numberedHeaderEndTagInBody(p);
1815
+ break;
1816
+ case TAG_ID.BR:
1817
+ brEndTagInBody(p);
1818
+ break;
1819
+ case TAG_ID.BODY:
1820
+ bodyEndTagInBody(p, token);
1821
+ break;
1822
+ case TAG_ID.HTML:
1823
+ htmlEndTagInBody(p, token);
1824
+ break;
1825
+ case TAG_ID.FORM:
1826
+ formEndTagInBody(p);
1827
+ break;
1828
+ case TAG_ID.APPLET:
1829
+ case TAG_ID.OBJECT:
1830
+ case TAG_ID.MARQUEE:
1831
+ appletEndTagInBody(p, token);
1832
+ break;
1833
+ case TAG_ID.TEMPLATE:
1834
+ templateEndTagInHead(p, token);
1835
+ break;
1836
+ default: genericEndTagInBody(p, token);
1837
+ }
1838
+ }
1839
+ function eofInBody(p, token) {
1840
+ if (p.tmplInsertionModeStack.length > 0) eofInTemplate(p, token);
1841
+ else stopParsing(p, token);
1842
+ }
1843
+ function endTagInText(p, token) {
1844
+ var _a;
1845
+ if (token.tagID === TAG_ID.SCRIPT) (_a = p.scriptHandler) === null || _a === void 0 || _a.call(p, p.openElements.current);
1846
+ p.openElements.pop();
1847
+ p.insertionMode = p.originalInsertionMode;
1848
+ }
1849
+ function eofInText(p, token) {
1850
+ p._err(token, ERR.eofInElementThatCanContainOnlyText);
1851
+ p.openElements.pop();
1852
+ p.insertionMode = p.originalInsertionMode;
1853
+ p.onEof(token);
1854
+ }
1855
+ function characterInTable(p, token) {
1856
+ if (p.openElements.currentTagId !== void 0 && TABLE_STRUCTURE_TAGS.has(p.openElements.currentTagId)) {
1857
+ p.pendingCharacterTokens.length = 0;
1858
+ p.hasNonWhitespacePendingCharacterToken = false;
1859
+ p.originalInsertionMode = p.insertionMode;
1860
+ p.insertionMode = InsertionMode.IN_TABLE_TEXT;
1861
+ switch (token.type) {
1862
+ case TokenType.CHARACTER:
1863
+ characterInTableText(p, token);
1864
+ break;
1865
+ case TokenType.WHITESPACE_CHARACTER: whitespaceCharacterInTableText(p, token);
1866
+ }
1867
+ } else tokenInTable(p, token);
1868
+ }
1869
+ function captionStartTagInTable(p, token) {
1870
+ p.openElements.clearBackToTableContext();
1871
+ p.activeFormattingElements.insertMarker();
1872
+ p._insertElement(token, NS.HTML);
1873
+ p.insertionMode = InsertionMode.IN_CAPTION;
1874
+ }
1875
+ function colgroupStartTagInTable(p, token) {
1876
+ p.openElements.clearBackToTableContext();
1877
+ p._insertElement(token, NS.HTML);
1878
+ p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
1879
+ }
1880
+ function colStartTagInTable(p, token) {
1881
+ p.openElements.clearBackToTableContext();
1882
+ p._insertFakeElement(TAG_NAMES.COLGROUP, TAG_ID.COLGROUP);
1883
+ p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
1884
+ startTagInColumnGroup(p, token);
1885
+ }
1886
+ function tbodyStartTagInTable(p, token) {
1887
+ p.openElements.clearBackToTableContext();
1888
+ p._insertElement(token, NS.HTML);
1889
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
1890
+ }
1891
+ function tdStartTagInTable(p, token) {
1892
+ p.openElements.clearBackToTableContext();
1893
+ p._insertFakeElement(TAG_NAMES.TBODY, TAG_ID.TBODY);
1894
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
1895
+ startTagInTableBody(p, token);
1896
+ }
1897
+ function tableStartTagInTable(p, token) {
1898
+ if (p.openElements.hasInTableScope(TAG_ID.TABLE)) {
1899
+ p.openElements.popUntilTagNamePopped(TAG_ID.TABLE);
1900
+ p._resetInsertionMode();
1901
+ p._processStartTag(token);
1902
+ }
1903
+ }
1904
+ function inputStartTagInTable(p, token) {
1905
+ if (isHiddenInput(token)) p._appendElement(token, NS.HTML);
1906
+ else tokenInTable(p, token);
1907
+ token.ackSelfClosing = true;
1908
+ }
1909
+ function formStartTagInTable(p, token) {
1910
+ if (!p.formElement && p.openElements.tmplCount === 0) {
1911
+ p._insertElement(token, NS.HTML);
1912
+ p.formElement = p.openElements.current;
1913
+ p.openElements.pop();
1914
+ }
1915
+ }
1916
+ function startTagInTable(p, token) {
1917
+ switch (token.tagID) {
1918
+ case TAG_ID.TD:
1919
+ case TAG_ID.TH:
1920
+ case TAG_ID.TR:
1921
+ tdStartTagInTable(p, token);
1922
+ break;
1923
+ case TAG_ID.STYLE:
1924
+ case TAG_ID.SCRIPT:
1925
+ case TAG_ID.TEMPLATE:
1926
+ startTagInHead(p, token);
1927
+ break;
1928
+ case TAG_ID.COL:
1929
+ colStartTagInTable(p, token);
1930
+ break;
1931
+ case TAG_ID.FORM:
1932
+ formStartTagInTable(p, token);
1933
+ break;
1934
+ case TAG_ID.TABLE:
1935
+ tableStartTagInTable(p, token);
1936
+ break;
1937
+ case TAG_ID.TBODY:
1938
+ case TAG_ID.TFOOT:
1939
+ case TAG_ID.THEAD:
1940
+ tbodyStartTagInTable(p, token);
1941
+ break;
1942
+ case TAG_ID.INPUT:
1943
+ inputStartTagInTable(p, token);
1944
+ break;
1945
+ case TAG_ID.CAPTION:
1946
+ captionStartTagInTable(p, token);
1947
+ break;
1948
+ case TAG_ID.COLGROUP:
1949
+ colgroupStartTagInTable(p, token);
1950
+ break;
1951
+ default: tokenInTable(p, token);
1952
+ }
1953
+ }
1954
+ function endTagInTable(p, token) {
1955
+ switch (token.tagID) {
1956
+ case TAG_ID.TABLE:
1957
+ if (p.openElements.hasInTableScope(TAG_ID.TABLE)) {
1958
+ p.openElements.popUntilTagNamePopped(TAG_ID.TABLE);
1959
+ p._resetInsertionMode();
1960
+ }
1961
+ break;
1962
+ case TAG_ID.TEMPLATE:
1963
+ templateEndTagInHead(p, token);
1964
+ break;
1965
+ case TAG_ID.BODY:
1966
+ case TAG_ID.CAPTION:
1967
+ case TAG_ID.COL:
1968
+ case TAG_ID.COLGROUP:
1969
+ case TAG_ID.HTML:
1970
+ case TAG_ID.TBODY:
1971
+ case TAG_ID.TD:
1972
+ case TAG_ID.TFOOT:
1973
+ case TAG_ID.TH:
1974
+ case TAG_ID.THEAD:
1975
+ case TAG_ID.TR: break;
1976
+ default: tokenInTable(p, token);
1977
+ }
1978
+ }
1979
+ function tokenInTable(p, token) {
1980
+ const savedFosterParentingState = p.fosterParentingEnabled;
1981
+ p.fosterParentingEnabled = true;
1982
+ modeInBody(p, token);
1983
+ p.fosterParentingEnabled = savedFosterParentingState;
1984
+ }
1985
+ function whitespaceCharacterInTableText(p, token) {
1986
+ p.pendingCharacterTokens.push(token);
1987
+ }
1988
+ function characterInTableText(p, token) {
1989
+ p.pendingCharacterTokens.push(token);
1990
+ p.hasNonWhitespacePendingCharacterToken = true;
1991
+ }
1992
+ function tokenInTableText(p, token) {
1993
+ let i = 0;
1994
+ if (p.hasNonWhitespacePendingCharacterToken) for (; i < p.pendingCharacterTokens.length; i++) tokenInTable(p, p.pendingCharacterTokens[i]);
1995
+ else for (; i < p.pendingCharacterTokens.length; i++) p._insertCharacters(p.pendingCharacterTokens[i]);
1996
+ p.insertionMode = p.originalInsertionMode;
1997
+ p._processToken(token);
1998
+ }
1999
+ const TABLE_VOID_ELEMENTS = /* @__PURE__ */ new Set([
2000
+ TAG_ID.CAPTION,
2001
+ TAG_ID.COL,
2002
+ TAG_ID.COLGROUP,
2003
+ TAG_ID.TBODY,
2004
+ TAG_ID.TD,
2005
+ TAG_ID.TFOOT,
2006
+ TAG_ID.TH,
2007
+ TAG_ID.THEAD,
2008
+ TAG_ID.TR
2009
+ ]);
2010
+ function startTagInCaption(p, token) {
2011
+ const tn = token.tagID;
2012
+ if (TABLE_VOID_ELEMENTS.has(tn)) {
2013
+ if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) {
2014
+ p.openElements.generateImpliedEndTags();
2015
+ p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION);
2016
+ p.activeFormattingElements.clearToLastMarker();
2017
+ p.insertionMode = InsertionMode.IN_TABLE;
2018
+ startTagInTable(p, token);
2019
+ }
2020
+ } else startTagInBody(p, token);
2021
+ }
2022
+ function endTagInCaption(p, token) {
2023
+ const tn = token.tagID;
2024
+ switch (tn) {
2025
+ case TAG_ID.CAPTION:
2026
+ case TAG_ID.TABLE:
2027
+ if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) {
2028
+ p.openElements.generateImpliedEndTags();
2029
+ p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION);
2030
+ p.activeFormattingElements.clearToLastMarker();
2031
+ p.insertionMode = InsertionMode.IN_TABLE;
2032
+ if (tn === TAG_ID.TABLE) endTagInTable(p, token);
2033
+ }
2034
+ break;
2035
+ case TAG_ID.BODY:
2036
+ case TAG_ID.COL:
2037
+ case TAG_ID.COLGROUP:
2038
+ case TAG_ID.HTML:
2039
+ case TAG_ID.TBODY:
2040
+ case TAG_ID.TD:
2041
+ case TAG_ID.TFOOT:
2042
+ case TAG_ID.TH:
2043
+ case TAG_ID.THEAD:
2044
+ case TAG_ID.TR: break;
2045
+ default: endTagInBody(p, token);
2046
+ }
2047
+ }
2048
+ function startTagInColumnGroup(p, token) {
2049
+ switch (token.tagID) {
2050
+ case TAG_ID.HTML:
2051
+ startTagInBody(p, token);
2052
+ break;
2053
+ case TAG_ID.COL:
2054
+ p._appendElement(token, NS.HTML);
2055
+ token.ackSelfClosing = true;
2056
+ break;
2057
+ case TAG_ID.TEMPLATE:
2058
+ startTagInHead(p, token);
2059
+ break;
2060
+ default: tokenInColumnGroup(p, token);
2061
+ }
2062
+ }
2063
+ function endTagInColumnGroup(p, token) {
2064
+ switch (token.tagID) {
2065
+ case TAG_ID.COLGROUP:
2066
+ if (p.openElements.currentTagId === TAG_ID.COLGROUP) {
2067
+ p.openElements.pop();
2068
+ p.insertionMode = InsertionMode.IN_TABLE;
2069
+ }
2070
+ break;
2071
+ case TAG_ID.TEMPLATE:
2072
+ templateEndTagInHead(p, token);
2073
+ break;
2074
+ case TAG_ID.COL: break;
2075
+ default: tokenInColumnGroup(p, token);
2076
+ }
2077
+ }
2078
+ function tokenInColumnGroup(p, token) {
2079
+ if (p.openElements.currentTagId === TAG_ID.COLGROUP) {
2080
+ p.openElements.pop();
2081
+ p.insertionMode = InsertionMode.IN_TABLE;
2082
+ p._processToken(token);
2083
+ }
2084
+ }
2085
+ function startTagInTableBody(p, token) {
2086
+ switch (token.tagID) {
2087
+ case TAG_ID.TR:
2088
+ p.openElements.clearBackToTableBodyContext();
2089
+ p._insertElement(token, NS.HTML);
2090
+ p.insertionMode = InsertionMode.IN_ROW;
2091
+ break;
2092
+ case TAG_ID.TH:
2093
+ case TAG_ID.TD:
2094
+ p.openElements.clearBackToTableBodyContext();
2095
+ p._insertFakeElement(TAG_NAMES.TR, TAG_ID.TR);
2096
+ p.insertionMode = InsertionMode.IN_ROW;
2097
+ startTagInRow(p, token);
2098
+ break;
2099
+ case TAG_ID.CAPTION:
2100
+ case TAG_ID.COL:
2101
+ case TAG_ID.COLGROUP:
2102
+ case TAG_ID.TBODY:
2103
+ case TAG_ID.TFOOT:
2104
+ case TAG_ID.THEAD:
2105
+ if (p.openElements.hasTableBodyContextInTableScope()) {
2106
+ p.openElements.clearBackToTableBodyContext();
2107
+ p.openElements.pop();
2108
+ p.insertionMode = InsertionMode.IN_TABLE;
2109
+ startTagInTable(p, token);
2110
+ }
2111
+ break;
2112
+ default: startTagInTable(p, token);
2113
+ }
2114
+ }
2115
+ function endTagInTableBody(p, token) {
2116
+ const tn = token.tagID;
2117
+ switch (token.tagID) {
2118
+ case TAG_ID.TBODY:
2119
+ case TAG_ID.TFOOT:
2120
+ case TAG_ID.THEAD:
2121
+ if (p.openElements.hasInTableScope(tn)) {
2122
+ p.openElements.clearBackToTableBodyContext();
2123
+ p.openElements.pop();
2124
+ p.insertionMode = InsertionMode.IN_TABLE;
2125
+ }
2126
+ break;
2127
+ case TAG_ID.TABLE:
2128
+ if (p.openElements.hasTableBodyContextInTableScope()) {
2129
+ p.openElements.clearBackToTableBodyContext();
2130
+ p.openElements.pop();
2131
+ p.insertionMode = InsertionMode.IN_TABLE;
2132
+ endTagInTable(p, token);
2133
+ }
2134
+ break;
2135
+ case TAG_ID.BODY:
2136
+ case TAG_ID.CAPTION:
2137
+ case TAG_ID.COL:
2138
+ case TAG_ID.COLGROUP:
2139
+ case TAG_ID.HTML:
2140
+ case TAG_ID.TD:
2141
+ case TAG_ID.TH:
2142
+ case TAG_ID.TR: break;
2143
+ default: endTagInTable(p, token);
2144
+ }
2145
+ }
2146
+ function startTagInRow(p, token) {
2147
+ switch (token.tagID) {
2148
+ case TAG_ID.TH:
2149
+ case TAG_ID.TD:
2150
+ p.openElements.clearBackToTableRowContext();
2151
+ p._insertElement(token, NS.HTML);
2152
+ p.insertionMode = InsertionMode.IN_CELL;
2153
+ p.activeFormattingElements.insertMarker();
2154
+ break;
2155
+ case TAG_ID.CAPTION:
2156
+ case TAG_ID.COL:
2157
+ case TAG_ID.COLGROUP:
2158
+ case TAG_ID.TBODY:
2159
+ case TAG_ID.TFOOT:
2160
+ case TAG_ID.THEAD:
2161
+ case TAG_ID.TR:
2162
+ if (p.openElements.hasInTableScope(TAG_ID.TR)) {
2163
+ p.openElements.clearBackToTableRowContext();
2164
+ p.openElements.pop();
2165
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
2166
+ startTagInTableBody(p, token);
2167
+ }
2168
+ break;
2169
+ default: startTagInTable(p, token);
2170
+ }
2171
+ }
2172
+ function endTagInRow(p, token) {
2173
+ switch (token.tagID) {
2174
+ case TAG_ID.TR:
2175
+ if (p.openElements.hasInTableScope(TAG_ID.TR)) {
2176
+ p.openElements.clearBackToTableRowContext();
2177
+ p.openElements.pop();
2178
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
2179
+ }
2180
+ break;
2181
+ case TAG_ID.TABLE:
2182
+ if (p.openElements.hasInTableScope(TAG_ID.TR)) {
2183
+ p.openElements.clearBackToTableRowContext();
2184
+ p.openElements.pop();
2185
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
2186
+ endTagInTableBody(p, token);
2187
+ }
2188
+ break;
2189
+ case TAG_ID.TBODY:
2190
+ case TAG_ID.TFOOT:
2191
+ case TAG_ID.THEAD:
2192
+ if (p.openElements.hasInTableScope(token.tagID) || p.openElements.hasInTableScope(TAG_ID.TR)) {
2193
+ p.openElements.clearBackToTableRowContext();
2194
+ p.openElements.pop();
2195
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
2196
+ endTagInTableBody(p, token);
2197
+ }
2198
+ break;
2199
+ case TAG_ID.BODY:
2200
+ case TAG_ID.CAPTION:
2201
+ case TAG_ID.COL:
2202
+ case TAG_ID.COLGROUP:
2203
+ case TAG_ID.HTML:
2204
+ case TAG_ID.TD:
2205
+ case TAG_ID.TH: break;
2206
+ default: endTagInTable(p, token);
2207
+ }
2208
+ }
2209
+ function startTagInCell(p, token) {
2210
+ const tn = token.tagID;
2211
+ if (TABLE_VOID_ELEMENTS.has(tn)) {
2212
+ if (p.openElements.hasInTableScope(TAG_ID.TD) || p.openElements.hasInTableScope(TAG_ID.TH)) {
2213
+ p._closeTableCell();
2214
+ startTagInRow(p, token);
2215
+ }
2216
+ } else startTagInBody(p, token);
2217
+ }
2218
+ function endTagInCell(p, token) {
2219
+ const tn = token.tagID;
2220
+ switch (tn) {
2221
+ case TAG_ID.TD:
2222
+ case TAG_ID.TH:
2223
+ if (p.openElements.hasInTableScope(tn)) {
2224
+ p.openElements.generateImpliedEndTags();
2225
+ p.openElements.popUntilTagNamePopped(tn);
2226
+ p.activeFormattingElements.clearToLastMarker();
2227
+ p.insertionMode = InsertionMode.IN_ROW;
2228
+ }
2229
+ break;
2230
+ case TAG_ID.TABLE:
2231
+ case TAG_ID.TBODY:
2232
+ case TAG_ID.TFOOT:
2233
+ case TAG_ID.THEAD:
2234
+ case TAG_ID.TR:
2235
+ if (p.openElements.hasInTableScope(tn)) {
2236
+ p._closeTableCell();
2237
+ endTagInRow(p, token);
2238
+ }
2239
+ break;
2240
+ case TAG_ID.BODY:
2241
+ case TAG_ID.CAPTION:
2242
+ case TAG_ID.COL:
2243
+ case TAG_ID.COLGROUP:
2244
+ case TAG_ID.HTML: break;
2245
+ default: endTagInBody(p, token);
2246
+ }
2247
+ }
2248
+ function startTagInSelect(p, token) {
2249
+ switch (token.tagID) {
2250
+ case TAG_ID.HTML:
2251
+ startTagInBody(p, token);
2252
+ break;
2253
+ case TAG_ID.OPTION:
2254
+ if (p.openElements.currentTagId === TAG_ID.OPTION) p.openElements.pop();
2255
+ p._insertElement(token, NS.HTML);
2256
+ break;
2257
+ case TAG_ID.OPTGROUP:
2258
+ if (p.openElements.currentTagId === TAG_ID.OPTION) p.openElements.pop();
2259
+ if (p.openElements.currentTagId === TAG_ID.OPTGROUP) p.openElements.pop();
2260
+ p._insertElement(token, NS.HTML);
2261
+ break;
2262
+ case TAG_ID.HR:
2263
+ if (p.openElements.currentTagId === TAG_ID.OPTION) p.openElements.pop();
2264
+ if (p.openElements.currentTagId === TAG_ID.OPTGROUP) p.openElements.pop();
2265
+ p._appendElement(token, NS.HTML);
2266
+ token.ackSelfClosing = true;
2267
+ break;
2268
+ case TAG_ID.INPUT:
2269
+ case TAG_ID.KEYGEN:
2270
+ case TAG_ID.TEXTAREA:
2271
+ case TAG_ID.SELECT:
2272
+ if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) {
2273
+ p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
2274
+ p._resetInsertionMode();
2275
+ if (token.tagID !== TAG_ID.SELECT) p._processStartTag(token);
2276
+ }
2277
+ break;
2278
+ case TAG_ID.SCRIPT:
2279
+ case TAG_ID.TEMPLATE: startTagInHead(p, token);
2280
+ }
2281
+ }
2282
+ function endTagInSelect(p, token) {
2283
+ switch (token.tagID) {
2284
+ case TAG_ID.OPTGROUP:
2285
+ if (p.openElements.stackTop > 0 && p.openElements.currentTagId === TAG_ID.OPTION && p.openElements.tagIDs[p.openElements.stackTop - 1] === TAG_ID.OPTGROUP) p.openElements.pop();
2286
+ if (p.openElements.currentTagId === TAG_ID.OPTGROUP) p.openElements.pop();
2287
+ break;
2288
+ case TAG_ID.OPTION:
2289
+ if (p.openElements.currentTagId === TAG_ID.OPTION) p.openElements.pop();
2290
+ break;
2291
+ case TAG_ID.SELECT:
2292
+ if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) {
2293
+ p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
2294
+ p._resetInsertionMode();
2295
+ }
2296
+ break;
2297
+ case TAG_ID.TEMPLATE: templateEndTagInHead(p, token);
2298
+ }
2299
+ }
2300
+ function startTagInSelectInTable(p, token) {
2301
+ const tn = token.tagID;
2302
+ if (tn === TAG_ID.CAPTION || tn === TAG_ID.TABLE || tn === TAG_ID.TBODY || tn === TAG_ID.TFOOT || tn === TAG_ID.THEAD || tn === TAG_ID.TR || tn === TAG_ID.TD || tn === TAG_ID.TH) {
2303
+ p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
2304
+ p._resetInsertionMode();
2305
+ p._processStartTag(token);
2306
+ } else startTagInSelect(p, token);
2307
+ }
2308
+ function endTagInSelectInTable(p, token) {
2309
+ const tn = token.tagID;
2310
+ if (tn === TAG_ID.CAPTION || tn === TAG_ID.TABLE || tn === TAG_ID.TBODY || tn === TAG_ID.TFOOT || tn === TAG_ID.THEAD || tn === TAG_ID.TR || tn === TAG_ID.TD || tn === TAG_ID.TH) {
2311
+ if (p.openElements.hasInTableScope(tn)) {
2312
+ p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
2313
+ p._resetInsertionMode();
2314
+ p.onEndTag(token);
2315
+ }
2316
+ } else endTagInSelect(p, token);
2317
+ }
2318
+ function startTagInTemplate(p, token) {
2319
+ switch (token.tagID) {
2320
+ case TAG_ID.BASE:
2321
+ case TAG_ID.BASEFONT:
2322
+ case TAG_ID.BGSOUND:
2323
+ case TAG_ID.LINK:
2324
+ case TAG_ID.META:
2325
+ case TAG_ID.NOFRAMES:
2326
+ case TAG_ID.SCRIPT:
2327
+ case TAG_ID.STYLE:
2328
+ case TAG_ID.TEMPLATE:
2329
+ case TAG_ID.TITLE:
2330
+ startTagInHead(p, token);
2331
+ break;
2332
+ case TAG_ID.CAPTION:
2333
+ case TAG_ID.COLGROUP:
2334
+ case TAG_ID.TBODY:
2335
+ case TAG_ID.TFOOT:
2336
+ case TAG_ID.THEAD:
2337
+ p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE;
2338
+ p.insertionMode = InsertionMode.IN_TABLE;
2339
+ startTagInTable(p, token);
2340
+ break;
2341
+ case TAG_ID.COL:
2342
+ p.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP;
2343
+ p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
2344
+ startTagInColumnGroup(p, token);
2345
+ break;
2346
+ case TAG_ID.TR:
2347
+ p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY;
2348
+ p.insertionMode = InsertionMode.IN_TABLE_BODY;
2349
+ startTagInTableBody(p, token);
2350
+ break;
2351
+ case TAG_ID.TD:
2352
+ case TAG_ID.TH:
2353
+ p.tmplInsertionModeStack[0] = InsertionMode.IN_ROW;
2354
+ p.insertionMode = InsertionMode.IN_ROW;
2355
+ startTagInRow(p, token);
2356
+ break;
2357
+ default:
2358
+ p.tmplInsertionModeStack[0] = InsertionMode.IN_BODY;
2359
+ p.insertionMode = InsertionMode.IN_BODY;
2360
+ startTagInBody(p, token);
2361
+ }
2362
+ }
2363
+ function endTagInTemplate(p, token) {
2364
+ if (token.tagID === TAG_ID.TEMPLATE) templateEndTagInHead(p, token);
2365
+ }
2366
+ function eofInTemplate(p, token) {
2367
+ if (p.openElements.tmplCount > 0) {
2368
+ p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
2369
+ p.activeFormattingElements.clearToLastMarker();
2370
+ p.tmplInsertionModeStack.shift();
2371
+ p._resetInsertionMode();
2372
+ p.onEof(token);
2373
+ } else stopParsing(p, token);
2374
+ }
2375
+ function startTagAfterBody(p, token) {
2376
+ if (token.tagID === TAG_ID.HTML) startTagInBody(p, token);
2377
+ else tokenAfterBody(p, token);
2378
+ }
2379
+ function endTagAfterBody(p, token) {
2380
+ var _a;
2381
+ if (token.tagID === TAG_ID.HTML) {
2382
+ if (!p.fragmentContext) p.insertionMode = InsertionMode.AFTER_AFTER_BODY;
2383
+ if (p.options.sourceCodeLocationInfo && p.openElements.tagIDs[0] === TAG_ID.HTML) {
2384
+ p._setEndLocation(p.openElements.items[0], token);
2385
+ const bodyElement = p.openElements.items[1];
2386
+ if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === void 0 ? void 0 : _a.endTag)) p._setEndLocation(bodyElement, token);
2387
+ }
2388
+ } else tokenAfterBody(p, token);
2389
+ }
2390
+ function tokenAfterBody(p, token) {
2391
+ p.insertionMode = InsertionMode.IN_BODY;
2392
+ modeInBody(p, token);
2393
+ }
2394
+ function startTagInFrameset(p, token) {
2395
+ switch (token.tagID) {
2396
+ case TAG_ID.HTML:
2397
+ startTagInBody(p, token);
2398
+ break;
2399
+ case TAG_ID.FRAMESET:
2400
+ p._insertElement(token, NS.HTML);
2401
+ break;
2402
+ case TAG_ID.FRAME:
2403
+ p._appendElement(token, NS.HTML);
2404
+ token.ackSelfClosing = true;
2405
+ break;
2406
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
2407
+ }
2408
+ }
2409
+ function endTagInFrameset(p, token) {
2410
+ if (token.tagID === TAG_ID.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) {
2411
+ p.openElements.pop();
2412
+ if (!p.fragmentContext && p.openElements.currentTagId !== TAG_ID.FRAMESET) p.insertionMode = InsertionMode.AFTER_FRAMESET;
2413
+ }
2414
+ }
2415
+ function startTagAfterFrameset(p, token) {
2416
+ switch (token.tagID) {
2417
+ case TAG_ID.HTML:
2418
+ startTagInBody(p, token);
2419
+ break;
2420
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
2421
+ }
2422
+ }
2423
+ function endTagAfterFrameset(p, token) {
2424
+ if (token.tagID === TAG_ID.HTML) p.insertionMode = InsertionMode.AFTER_AFTER_FRAMESET;
2425
+ }
2426
+ function startTagAfterAfterBody(p, token) {
2427
+ if (token.tagID === TAG_ID.HTML) startTagInBody(p, token);
2428
+ else tokenAfterAfterBody(p, token);
2429
+ }
2430
+ function tokenAfterAfterBody(p, token) {
2431
+ p.insertionMode = InsertionMode.IN_BODY;
2432
+ modeInBody(p, token);
2433
+ }
2434
+ function startTagAfterAfterFrameset(p, token) {
2435
+ switch (token.tagID) {
2436
+ case TAG_ID.HTML:
2437
+ startTagInBody(p, token);
2438
+ break;
2439
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
2440
+ }
2441
+ }
2442
+ function nullCharacterInForeignContent(p, token) {
2443
+ token.chars = "�";
2444
+ p._insertCharacters(token);
2445
+ }
2446
+ function characterInForeignContent(p, token) {
2447
+ p._insertCharacters(token);
2448
+ p.framesetOk = false;
2449
+ }
2450
+ function popUntilHtmlOrIntegrationPoint(p) {
2451
+ while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && p.openElements.currentTagId !== void 0 && !p._isIntegrationPoint(p.openElements.currentTagId, p.openElements.current)) p.openElements.pop();
2452
+ }
2453
+ function startTagInForeignContent(p, token) {
2454
+ if (causesExit(token)) {
2455
+ popUntilHtmlOrIntegrationPoint(p);
2456
+ p._startTagOutsideForeignContent(token);
2457
+ } else {
2458
+ const current = p._getAdjustedCurrentElement();
2459
+ const currentNs = p.treeAdapter.getNamespaceURI(current);
2460
+ if (currentNs === NS.MATHML) adjustTokenMathMLAttrs(token);
2461
+ else if (currentNs === NS.SVG) {
2462
+ adjustTokenSVGTagName(token);
2463
+ adjustTokenSVGAttrs(token);
2464
+ }
2465
+ adjustTokenXMLAttrs(token);
2466
+ if (token.selfClosing) p._appendElement(token, currentNs);
2467
+ else p._insertElement(token, currentNs);
2468
+ token.ackSelfClosing = true;
2469
+ }
2470
+ }
2471
+ function endTagInForeignContent(p, token) {
2472
+ if (token.tagID === TAG_ID.P || token.tagID === TAG_ID.BR) {
2473
+ popUntilHtmlOrIntegrationPoint(p);
2474
+ p._endTagOutsideForeignContent(token);
2475
+ return;
2476
+ }
2477
+ for (let i = p.openElements.stackTop; i > 0; i--) {
2478
+ const element = p.openElements.items[i];
2479
+ if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) {
2480
+ p._endTagOutsideForeignContent(token);
2481
+ break;
2482
+ }
2483
+ const tagName = p.treeAdapter.getTagName(element);
2484
+ if (tagName.toLowerCase() === token.tagName) {
2485
+ token.tagName = tagName;
2486
+ p.openElements.shortenToLength(i);
2487
+ break;
2488
+ }
2489
+ }
2490
+ }
2491
+ //#endregion
2492
+ export { Parser };