@dooboostore/dom-parser 1.0.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 (519) hide show
  1. package/README.MD +280 -0
  2. package/dist/cjs/DomParser.js +360 -0
  3. package/dist/cjs/DomParser.js.map +7 -0
  4. package/dist/cjs/factory/ElementFactory.js +76 -0
  5. package/dist/cjs/factory/ElementFactory.js.map +7 -0
  6. package/dist/cjs/factory/index.js +24 -0
  7. package/dist/cjs/factory/index.js.map +7 -0
  8. package/dist/cjs/index.js +34 -0
  9. package/dist/cjs/index.js.map +7 -0
  10. package/dist/cjs/node/CharacterData.js +16 -0
  11. package/dist/cjs/node/CharacterData.js.map +7 -0
  12. package/dist/cjs/node/ChildNode.js +16 -0
  13. package/dist/cjs/node/ChildNode.js.map +7 -0
  14. package/dist/cjs/node/ChildNodeBase.js +62 -0
  15. package/dist/cjs/node/ChildNodeBase.js.map +7 -0
  16. package/dist/cjs/node/Comment.js +86 -0
  17. package/dist/cjs/node/Comment.js.map +7 -0
  18. package/dist/cjs/node/Document.js +28 -0
  19. package/dist/cjs/node/Document.js.map +7 -0
  20. package/dist/cjs/node/DocumentBase.js +378 -0
  21. package/dist/cjs/node/DocumentBase.js.map +7 -0
  22. package/dist/cjs/node/DocumentFragment.js +16 -0
  23. package/dist/cjs/node/DocumentFragment.js.map +7 -0
  24. package/dist/cjs/node/DocumentFragmentBase.js +88 -0
  25. package/dist/cjs/node/DocumentFragmentBase.js.map +7 -0
  26. package/dist/cjs/node/GetRootNodeOptions.js +16 -0
  27. package/dist/cjs/node/GetRootNodeOptions.js.map +7 -0
  28. package/dist/cjs/node/Node.js +58 -0
  29. package/dist/cjs/node/Node.js.map +7 -0
  30. package/dist/cjs/node/NodeBase.js +380 -0
  31. package/dist/cjs/node/NodeBase.js.map +7 -0
  32. package/dist/cjs/node/NodeIterator.js +163 -0
  33. package/dist/cjs/node/NodeIterator.js.map +7 -0
  34. package/dist/cjs/node/ParentNode.js +16 -0
  35. package/dist/cjs/node/ParentNode.js.map +7 -0
  36. package/dist/cjs/node/ParentNodeBase.js +134 -0
  37. package/dist/cjs/node/ParentNodeBase.js.map +7 -0
  38. package/dist/cjs/node/Text.js +16 -0
  39. package/dist/cjs/node/Text.js.map +7 -0
  40. package/dist/cjs/node/TextBase.js +106 -0
  41. package/dist/cjs/node/TextBase.js.map +7 -0
  42. package/dist/cjs/node/collection/HTMLCollection.js +105 -0
  43. package/dist/cjs/node/collection/HTMLCollection.js.map +7 -0
  44. package/dist/cjs/node/collection/HTMLCollectionOf.js +36 -0
  45. package/dist/cjs/node/collection/HTMLCollectionOf.js.map +7 -0
  46. package/dist/cjs/node/collection/NodeList.js +135 -0
  47. package/dist/cjs/node/collection/NodeList.js.map +7 -0
  48. package/dist/cjs/node/collection/NodeListOf.js +38 -0
  49. package/dist/cjs/node/collection/NodeListOf.js.map +7 -0
  50. package/dist/cjs/node/collection/index.js +30 -0
  51. package/dist/cjs/node/collection/index.js.map +7 -0
  52. package/dist/cjs/node/elements/Element.js +16 -0
  53. package/dist/cjs/node/elements/Element.js.map +7 -0
  54. package/dist/cjs/node/elements/ElementBase.js +936 -0
  55. package/dist/cjs/node/elements/ElementBase.js.map +7 -0
  56. package/dist/cjs/node/elements/HTMLAnchorElement.js +71 -0
  57. package/dist/cjs/node/elements/HTMLAnchorElement.js.map +7 -0
  58. package/dist/cjs/node/elements/HTMLAreaElement.js +77 -0
  59. package/dist/cjs/node/elements/HTMLAreaElement.js.map +7 -0
  60. package/dist/cjs/node/elements/HTMLBaseElement.js +77 -0
  61. package/dist/cjs/node/elements/HTMLBaseElement.js.map +7 -0
  62. package/dist/cjs/node/elements/HTMLBodyElement.js +29 -0
  63. package/dist/cjs/node/elements/HTMLBodyElement.js.map +7 -0
  64. package/dist/cjs/node/elements/HTMLButtonElement.js +89 -0
  65. package/dist/cjs/node/elements/HTMLButtonElement.js.map +7 -0
  66. package/dist/cjs/node/elements/HTMLCanvasElement.js +79 -0
  67. package/dist/cjs/node/elements/HTMLCanvasElement.js.map +7 -0
  68. package/dist/cjs/node/elements/HTMLCaptionElement.js +41 -0
  69. package/dist/cjs/node/elements/HTMLCaptionElement.js.map +7 -0
  70. package/dist/cjs/node/elements/HTMLDivElement.js +29 -0
  71. package/dist/cjs/node/elements/HTMLDivElement.js.map +7 -0
  72. package/dist/cjs/node/elements/HTMLElement.js +16 -0
  73. package/dist/cjs/node/elements/HTMLElement.js.map +7 -0
  74. package/dist/cjs/node/elements/HTMLElementBase.js +182 -0
  75. package/dist/cjs/node/elements/HTMLElementBase.js.map +7 -0
  76. package/dist/cjs/node/elements/HTMLEmbedElement.js +45 -0
  77. package/dist/cjs/node/elements/HTMLEmbedElement.js.map +7 -0
  78. package/dist/cjs/node/elements/HTMLFormElement.js +127 -0
  79. package/dist/cjs/node/elements/HTMLFormElement.js.map +7 -0
  80. package/dist/cjs/node/elements/HTMLGenericElement.js +32 -0
  81. package/dist/cjs/node/elements/HTMLGenericElement.js.map +7 -0
  82. package/dist/cjs/node/elements/HTMLH1Element.js +29 -0
  83. package/dist/cjs/node/elements/HTMLH1Element.js.map +7 -0
  84. package/dist/cjs/node/elements/HTMLHeadElement.js +29 -0
  85. package/dist/cjs/node/elements/HTMLHeadElement.js.map +7 -0
  86. package/dist/cjs/node/elements/HTMLHtmlElement.js +92 -0
  87. package/dist/cjs/node/elements/HTMLHtmlElement.js.map +7 -0
  88. package/dist/cjs/node/elements/HTMLImgElement.js +99 -0
  89. package/dist/cjs/node/elements/HTMLImgElement.js.map +7 -0
  90. package/dist/cjs/node/elements/HTMLInputElement.js +157 -0
  91. package/dist/cjs/node/elements/HTMLInputElement.js.map +7 -0
  92. package/dist/cjs/node/elements/HTMLLIElement.js +57 -0
  93. package/dist/cjs/node/elements/HTMLLIElement.js.map +7 -0
  94. package/dist/cjs/node/elements/HTMLLinkElement.js +99 -0
  95. package/dist/cjs/node/elements/HTMLLinkElement.js.map +7 -0
  96. package/dist/cjs/node/elements/HTMLMetaElement.js +29 -0
  97. package/dist/cjs/node/elements/HTMLMetaElement.js.map +7 -0
  98. package/dist/cjs/node/elements/HTMLOListElement.js +89 -0
  99. package/dist/cjs/node/elements/HTMLOListElement.js.map +7 -0
  100. package/dist/cjs/node/elements/HTMLPElement.js +29 -0
  101. package/dist/cjs/node/elements/HTMLPElement.js.map +7 -0
  102. package/dist/cjs/node/elements/HTMLScriptElement.js +127 -0
  103. package/dist/cjs/node/elements/HTMLScriptElement.js.map +7 -0
  104. package/dist/cjs/node/elements/HTMLSpanElement.js +29 -0
  105. package/dist/cjs/node/elements/HTMLSpanElement.js.map +7 -0
  106. package/dist/cjs/node/elements/HTMLStyleElement.js +71 -0
  107. package/dist/cjs/node/elements/HTMLStyleElement.js.map +7 -0
  108. package/dist/cjs/node/elements/HTMLTableElement.js +112 -0
  109. package/dist/cjs/node/elements/HTMLTableElement.js.map +7 -0
  110. package/dist/cjs/node/elements/HTMLTbodyElement.js +54 -0
  111. package/dist/cjs/node/elements/HTMLTbodyElement.js.map +7 -0
  112. package/dist/cjs/node/elements/HTMLTdElement.js +72 -0
  113. package/dist/cjs/node/elements/HTMLTdElement.js.map +7 -0
  114. package/dist/cjs/node/elements/HTMLTemplateElement.js +97 -0
  115. package/dist/cjs/node/elements/HTMLTemplateElement.js.map +7 -0
  116. package/dist/cjs/node/elements/HTMLTfootElement.js +56 -0
  117. package/dist/cjs/node/elements/HTMLTfootElement.js.map +7 -0
  118. package/dist/cjs/node/elements/HTMLThElement.js +72 -0
  119. package/dist/cjs/node/elements/HTMLThElement.js.map +7 -0
  120. package/dist/cjs/node/elements/HTMLTheadElement.js +54 -0
  121. package/dist/cjs/node/elements/HTMLTheadElement.js.map +7 -0
  122. package/dist/cjs/node/elements/HTMLTitleElement.js +38 -0
  123. package/dist/cjs/node/elements/HTMLTitleElement.js.map +7 -0
  124. package/dist/cjs/node/elements/HTMLTrElement.js +77 -0
  125. package/dist/cjs/node/elements/HTMLTrElement.js.map +7 -0
  126. package/dist/cjs/node/elements/HTMLUListElement.js +29 -0
  127. package/dist/cjs/node/elements/HTMLUListElement.js.map +7 -0
  128. package/dist/cjs/node/elements/MathMLElement.js +32 -0
  129. package/dist/cjs/node/elements/MathMLElement.js.map +7 -0
  130. package/dist/cjs/node/elements/SVGCircleElement.js +69 -0
  131. package/dist/cjs/node/elements/SVGCircleElement.js.map +7 -0
  132. package/dist/cjs/node/elements/SVGElement.js +32 -0
  133. package/dist/cjs/node/elements/SVGElement.js.map +7 -0
  134. package/dist/cjs/node/elements/SVGRectElement.js +80 -0
  135. package/dist/cjs/node/elements/SVGRectElement.js.map +7 -0
  136. package/dist/cjs/node/elements/index.js +183 -0
  137. package/dist/cjs/node/elements/index.js.map +7 -0
  138. package/dist/cjs/node/index.js +73 -0
  139. package/dist/cjs/node/index.js.map +7 -0
  140. package/dist/cjs/package.json +5 -0
  141. package/dist/cjs/utils/CSSSelector.js +271 -0
  142. package/dist/cjs/utils/CSSSelector.js.map +7 -0
  143. package/dist/cjs/window/Window.js +16 -0
  144. package/dist/cjs/window/Window.js.map +7 -0
  145. package/dist/cjs/window/WindowBase.js +847 -0
  146. package/dist/cjs/window/WindowBase.js.map +7 -0
  147. package/dist/cjs/window/index.js +29 -0
  148. package/dist/cjs/window/index.js.map +7 -0
  149. package/dist/esm/DomParser.js +341 -0
  150. package/dist/esm/DomParser.js.map +7 -0
  151. package/dist/esm/factory/ElementFactory.js +57 -0
  152. package/dist/esm/factory/ElementFactory.js.map +7 -0
  153. package/dist/esm/factory/index.js +5 -0
  154. package/dist/esm/factory/index.js.map +7 -0
  155. package/dist/esm/index.js +15 -0
  156. package/dist/esm/index.js.map +7 -0
  157. package/dist/esm/node/CharacterData.js +1 -0
  158. package/dist/esm/node/CharacterData.js.map +7 -0
  159. package/dist/esm/node/ChildNode.js +1 -0
  160. package/dist/esm/node/ChildNode.js.map +7 -0
  161. package/dist/esm/node/ChildNodeBase.js +43 -0
  162. package/dist/esm/node/ChildNodeBase.js.map +7 -0
  163. package/dist/esm/node/Comment.js +67 -0
  164. package/dist/esm/node/Comment.js.map +7 -0
  165. package/dist/esm/node/Document.js +9 -0
  166. package/dist/esm/node/Document.js.map +7 -0
  167. package/dist/esm/node/DocumentBase.js +359 -0
  168. package/dist/esm/node/DocumentBase.js.map +7 -0
  169. package/dist/esm/node/DocumentFragment.js +1 -0
  170. package/dist/esm/node/DocumentFragment.js.map +7 -0
  171. package/dist/esm/node/DocumentFragmentBase.js +69 -0
  172. package/dist/esm/node/DocumentFragmentBase.js.map +7 -0
  173. package/dist/esm/node/GetRootNodeOptions.js +1 -0
  174. package/dist/esm/node/GetRootNodeOptions.js.map +7 -0
  175. package/dist/esm/node/Node.js +39 -0
  176. package/dist/esm/node/Node.js.map +7 -0
  177. package/dist/esm/node/NodeBase.js +380 -0
  178. package/dist/esm/node/NodeBase.js.map +7 -0
  179. package/dist/esm/node/NodeIterator.js +144 -0
  180. package/dist/esm/node/NodeIterator.js.map +7 -0
  181. package/dist/esm/node/ParentNode.js +1 -0
  182. package/dist/esm/node/ParentNode.js.map +7 -0
  183. package/dist/esm/node/ParentNodeBase.js +115 -0
  184. package/dist/esm/node/ParentNodeBase.js.map +7 -0
  185. package/dist/esm/node/Text.js +1 -0
  186. package/dist/esm/node/Text.js.map +7 -0
  187. package/dist/esm/node/TextBase.js +87 -0
  188. package/dist/esm/node/TextBase.js.map +7 -0
  189. package/dist/esm/node/collection/HTMLCollection.js +86 -0
  190. package/dist/esm/node/collection/HTMLCollection.js.map +7 -0
  191. package/dist/esm/node/collection/HTMLCollectionOf.js +17 -0
  192. package/dist/esm/node/collection/HTMLCollectionOf.js.map +7 -0
  193. package/dist/esm/node/collection/NodeList.js +116 -0
  194. package/dist/esm/node/collection/NodeList.js.map +7 -0
  195. package/dist/esm/node/collection/NodeListOf.js +19 -0
  196. package/dist/esm/node/collection/NodeListOf.js.map +7 -0
  197. package/dist/esm/node/collection/index.js +11 -0
  198. package/dist/esm/node/collection/index.js.map +7 -0
  199. package/dist/esm/node/elements/Element.js +1 -0
  200. package/dist/esm/node/elements/Element.js.map +7 -0
  201. package/dist/esm/node/elements/ElementBase.js +917 -0
  202. package/dist/esm/node/elements/ElementBase.js.map +7 -0
  203. package/dist/esm/node/elements/HTMLAnchorElement.js +52 -0
  204. package/dist/esm/node/elements/HTMLAnchorElement.js.map +7 -0
  205. package/dist/esm/node/elements/HTMLAreaElement.js +58 -0
  206. package/dist/esm/node/elements/HTMLAreaElement.js.map +7 -0
  207. package/dist/esm/node/elements/HTMLBaseElement.js +58 -0
  208. package/dist/esm/node/elements/HTMLBaseElement.js.map +7 -0
  209. package/dist/esm/node/elements/HTMLBodyElement.js +10 -0
  210. package/dist/esm/node/elements/HTMLBodyElement.js.map +7 -0
  211. package/dist/esm/node/elements/HTMLButtonElement.js +70 -0
  212. package/dist/esm/node/elements/HTMLButtonElement.js.map +7 -0
  213. package/dist/esm/node/elements/HTMLCanvasElement.js +60 -0
  214. package/dist/esm/node/elements/HTMLCanvasElement.js.map +7 -0
  215. package/dist/esm/node/elements/HTMLCaptionElement.js +22 -0
  216. package/dist/esm/node/elements/HTMLCaptionElement.js.map +7 -0
  217. package/dist/esm/node/elements/HTMLDivElement.js +10 -0
  218. package/dist/esm/node/elements/HTMLDivElement.js.map +7 -0
  219. package/dist/esm/node/elements/HTMLElement.js +1 -0
  220. package/dist/esm/node/elements/HTMLElement.js.map +7 -0
  221. package/dist/esm/node/elements/HTMLElementBase.js +163 -0
  222. package/dist/esm/node/elements/HTMLElementBase.js.map +7 -0
  223. package/dist/esm/node/elements/HTMLEmbedElement.js +26 -0
  224. package/dist/esm/node/elements/HTMLEmbedElement.js.map +7 -0
  225. package/dist/esm/node/elements/HTMLFormElement.js +108 -0
  226. package/dist/esm/node/elements/HTMLFormElement.js.map +7 -0
  227. package/dist/esm/node/elements/HTMLGenericElement.js +13 -0
  228. package/dist/esm/node/elements/HTMLGenericElement.js.map +7 -0
  229. package/dist/esm/node/elements/HTMLH1Element.js +10 -0
  230. package/dist/esm/node/elements/HTMLH1Element.js.map +7 -0
  231. package/dist/esm/node/elements/HTMLHeadElement.js +10 -0
  232. package/dist/esm/node/elements/HTMLHeadElement.js.map +7 -0
  233. package/dist/esm/node/elements/HTMLHtmlElement.js +73 -0
  234. package/dist/esm/node/elements/HTMLHtmlElement.js.map +7 -0
  235. package/dist/esm/node/elements/HTMLImgElement.js +80 -0
  236. package/dist/esm/node/elements/HTMLImgElement.js.map +7 -0
  237. package/dist/esm/node/elements/HTMLInputElement.js +138 -0
  238. package/dist/esm/node/elements/HTMLInputElement.js.map +7 -0
  239. package/dist/esm/node/elements/HTMLLIElement.js +38 -0
  240. package/dist/esm/node/elements/HTMLLIElement.js.map +7 -0
  241. package/dist/esm/node/elements/HTMLLinkElement.js +80 -0
  242. package/dist/esm/node/elements/HTMLLinkElement.js.map +7 -0
  243. package/dist/esm/node/elements/HTMLMetaElement.js +10 -0
  244. package/dist/esm/node/elements/HTMLMetaElement.js.map +7 -0
  245. package/dist/esm/node/elements/HTMLOListElement.js +70 -0
  246. package/dist/esm/node/elements/HTMLOListElement.js.map +7 -0
  247. package/dist/esm/node/elements/HTMLPElement.js +10 -0
  248. package/dist/esm/node/elements/HTMLPElement.js.map +7 -0
  249. package/dist/esm/node/elements/HTMLScriptElement.js +108 -0
  250. package/dist/esm/node/elements/HTMLScriptElement.js.map +7 -0
  251. package/dist/esm/node/elements/HTMLSpanElement.js +10 -0
  252. package/dist/esm/node/elements/HTMLSpanElement.js.map +7 -0
  253. package/dist/esm/node/elements/HTMLStyleElement.js +52 -0
  254. package/dist/esm/node/elements/HTMLStyleElement.js.map +7 -0
  255. package/dist/esm/node/elements/HTMLTableElement.js +93 -0
  256. package/dist/esm/node/elements/HTMLTableElement.js.map +7 -0
  257. package/dist/esm/node/elements/HTMLTbodyElement.js +35 -0
  258. package/dist/esm/node/elements/HTMLTbodyElement.js.map +7 -0
  259. package/dist/esm/node/elements/HTMLTdElement.js +53 -0
  260. package/dist/esm/node/elements/HTMLTdElement.js.map +7 -0
  261. package/dist/esm/node/elements/HTMLTemplateElement.js +78 -0
  262. package/dist/esm/node/elements/HTMLTemplateElement.js.map +7 -0
  263. package/dist/esm/node/elements/HTMLTfootElement.js +37 -0
  264. package/dist/esm/node/elements/HTMLTfootElement.js.map +7 -0
  265. package/dist/esm/node/elements/HTMLThElement.js +53 -0
  266. package/dist/esm/node/elements/HTMLThElement.js.map +7 -0
  267. package/dist/esm/node/elements/HTMLTheadElement.js +35 -0
  268. package/dist/esm/node/elements/HTMLTheadElement.js.map +7 -0
  269. package/dist/esm/node/elements/HTMLTitleElement.js +19 -0
  270. package/dist/esm/node/elements/HTMLTitleElement.js.map +7 -0
  271. package/dist/esm/node/elements/HTMLTrElement.js +58 -0
  272. package/dist/esm/node/elements/HTMLTrElement.js.map +7 -0
  273. package/dist/esm/node/elements/HTMLUListElement.js +10 -0
  274. package/dist/esm/node/elements/HTMLUListElement.js.map +7 -0
  275. package/dist/esm/node/elements/MathMLElement.js +13 -0
  276. package/dist/esm/node/elements/MathMLElement.js.map +7 -0
  277. package/dist/esm/node/elements/SVGCircleElement.js +50 -0
  278. package/dist/esm/node/elements/SVGCircleElement.js.map +7 -0
  279. package/dist/esm/node/elements/SVGElement.js +13 -0
  280. package/dist/esm/node/elements/SVGElement.js.map +7 -0
  281. package/dist/esm/node/elements/SVGRectElement.js +61 -0
  282. package/dist/esm/node/elements/SVGRectElement.js.map +7 -0
  283. package/dist/esm/node/elements/index.js +164 -0
  284. package/dist/esm/node/elements/index.js.map +7 -0
  285. package/dist/esm/node/index.js +53 -0
  286. package/dist/esm/node/index.js.map +7 -0
  287. package/dist/esm/utils/CSSSelector.js +252 -0
  288. package/dist/esm/utils/CSSSelector.js.map +7 -0
  289. package/dist/esm/window/Window.js +1 -0
  290. package/dist/esm/window/Window.js.map +7 -0
  291. package/dist/esm/window/WindowBase.js +828 -0
  292. package/dist/esm/window/WindowBase.js.map +7 -0
  293. package/dist/esm/window/index.js +10 -0
  294. package/dist/esm/window/index.js.map +7 -0
  295. package/dist/esm-bundle/dooboostore-dom-parser.esm.js +6176 -0
  296. package/dist/esm-bundle/dooboostore-dom-parser.esm.js.map +7 -0
  297. package/dist/types/DomParser.d.ts +30 -0
  298. package/dist/types/DomParser.d.ts.map +1 -0
  299. package/dist/types/factory/ElementFactory.d.ts +27 -0
  300. package/dist/types/factory/ElementFactory.d.ts.map +1 -0
  301. package/dist/types/factory/index.d.ts +2 -0
  302. package/dist/types/factory/index.d.ts.map +1 -0
  303. package/dist/types/index.d.ts +9 -0
  304. package/dist/types/index.d.ts.map +1 -0
  305. package/dist/types/node/CharacterData.d.ts +52 -0
  306. package/dist/types/node/CharacterData.d.ts.map +1 -0
  307. package/dist/types/node/ChildNode.d.ts +39 -0
  308. package/dist/types/node/ChildNode.d.ts.map +1 -0
  309. package/dist/types/node/ChildNodeBase.d.ts +12 -0
  310. package/dist/types/node/ChildNodeBase.d.ts.map +1 -0
  311. package/dist/types/node/Comment.d.ts +26 -0
  312. package/dist/types/node/Comment.d.ts.map +1 -0
  313. package/dist/types/node/Document.d.ts +857 -0
  314. package/dist/types/node/Document.d.ts.map +1 -0
  315. package/dist/types/node/DocumentBase.d.ts +153 -0
  316. package/dist/types/node/DocumentBase.d.ts.map +1 -0
  317. package/dist/types/node/DocumentFragment.d.ts +39 -0
  318. package/dist/types/node/DocumentFragment.d.ts.map +1 -0
  319. package/dist/types/node/DocumentFragmentBase.d.ts +51 -0
  320. package/dist/types/node/DocumentFragmentBase.d.ts.map +1 -0
  321. package/dist/types/node/GetRootNodeOptions.d.ts +14 -0
  322. package/dist/types/node/GetRootNodeOptions.d.ts.map +1 -0
  323. package/dist/types/node/Node.d.ts +232 -0
  324. package/dist/types/node/Node.d.ts.map +1 -0
  325. package/dist/types/node/NodeBase.d.ts +98 -0
  326. package/dist/types/node/NodeBase.d.ts.map +1 -0
  327. package/dist/types/node/NodeIterator.d.ts +61 -0
  328. package/dist/types/node/NodeIterator.d.ts.map +1 -0
  329. package/dist/types/node/ParentNode.d.ts +85 -0
  330. package/dist/types/node/ParentNode.d.ts.map +1 -0
  331. package/dist/types/node/ParentNodeBase.d.ts +22 -0
  332. package/dist/types/node/ParentNodeBase.d.ts.map +1 -0
  333. package/dist/types/node/Text.d.ts +25 -0
  334. package/dist/types/node/Text.d.ts.map +1 -0
  335. package/dist/types/node/TextBase.d.ts +26 -0
  336. package/dist/types/node/TextBase.d.ts.map +1 -0
  337. package/dist/types/node/collection/HTMLCollection.d.ts +37 -0
  338. package/dist/types/node/collection/HTMLCollection.d.ts.map +1 -0
  339. package/dist/types/node/collection/HTMLCollectionOf.d.ts +14 -0
  340. package/dist/types/node/collection/HTMLCollectionOf.d.ts.map +1 -0
  341. package/dist/types/node/collection/NodeList.d.ts +55 -0
  342. package/dist/types/node/collection/NodeList.d.ts.map +1 -0
  343. package/dist/types/node/collection/NodeListOf.d.ts +14 -0
  344. package/dist/types/node/collection/NodeListOf.d.ts.map +1 -0
  345. package/dist/types/node/collection/index.d.ts +5 -0
  346. package/dist/types/node/collection/index.d.ts.map +1 -0
  347. package/dist/types/node/elements/Element.d.ts +687 -0
  348. package/dist/types/node/elements/Element.d.ts.map +1 -0
  349. package/dist/types/node/elements/ElementBase.d.ts +143 -0
  350. package/dist/types/node/elements/ElementBase.d.ts.map +1 -0
  351. package/dist/types/node/elements/HTMLAnchorElement.d.ts +18 -0
  352. package/dist/types/node/elements/HTMLAnchorElement.d.ts.map +1 -0
  353. package/dist/types/node/elements/HTMLAreaElement.d.ts +59 -0
  354. package/dist/types/node/elements/HTMLAreaElement.d.ts.map +1 -0
  355. package/dist/types/node/elements/HTMLBaseElement.d.ts +25 -0
  356. package/dist/types/node/elements/HTMLBaseElement.d.ts.map +1 -0
  357. package/dist/types/node/elements/HTMLBodyElement.d.ts +10 -0
  358. package/dist/types/node/elements/HTMLBodyElement.d.ts.map +1 -0
  359. package/dist/types/node/elements/HTMLButtonElement.d.ts +21 -0
  360. package/dist/types/node/elements/HTMLButtonElement.d.ts.map +1 -0
  361. package/dist/types/node/elements/HTMLCanvasElement.d.ts +15 -0
  362. package/dist/types/node/elements/HTMLCanvasElement.d.ts.map +1 -0
  363. package/dist/types/node/elements/HTMLCaptionElement.d.ts +18 -0
  364. package/dist/types/node/elements/HTMLCaptionElement.d.ts.map +1 -0
  365. package/dist/types/node/elements/HTMLDivElement.d.ts +10 -0
  366. package/dist/types/node/elements/HTMLDivElement.d.ts.map +1 -0
  367. package/dist/types/node/elements/HTMLElement.d.ts +90 -0
  368. package/dist/types/node/elements/HTMLElement.d.ts.map +1 -0
  369. package/dist/types/node/elements/HTMLElementBase.d.ts +42 -0
  370. package/dist/types/node/elements/HTMLElementBase.d.ts.map +1 -0
  371. package/dist/types/node/elements/HTMLEmbedElement.d.ts +27 -0
  372. package/dist/types/node/elements/HTMLEmbedElement.d.ts.map +1 -0
  373. package/dist/types/node/elements/HTMLFormElement.d.ts +30 -0
  374. package/dist/types/node/elements/HTMLFormElement.d.ts.map +1 -0
  375. package/dist/types/node/elements/HTMLGenericElement.d.ts +6 -0
  376. package/dist/types/node/elements/HTMLGenericElement.d.ts.map +1 -0
  377. package/dist/types/node/elements/HTMLH1Element.d.ts +10 -0
  378. package/dist/types/node/elements/HTMLH1Element.d.ts.map +1 -0
  379. package/dist/types/node/elements/HTMLHeadElement.d.ts +10 -0
  380. package/dist/types/node/elements/HTMLHeadElement.d.ts.map +1 -0
  381. package/dist/types/node/elements/HTMLHtmlElement.d.ts +17 -0
  382. package/dist/types/node/elements/HTMLHtmlElement.d.ts.map +1 -0
  383. package/dist/types/node/elements/HTMLImgElement.d.ts +24 -0
  384. package/dist/types/node/elements/HTMLImgElement.d.ts.map +1 -0
  385. package/dist/types/node/elements/HTMLInputElement.d.ts +33 -0
  386. package/dist/types/node/elements/HTMLInputElement.d.ts.map +1 -0
  387. package/dist/types/node/elements/HTMLLIElement.d.ts +15 -0
  388. package/dist/types/node/elements/HTMLLIElement.d.ts.map +1 -0
  389. package/dist/types/node/elements/HTMLLinkElement.d.ts +24 -0
  390. package/dist/types/node/elements/HTMLLinkElement.d.ts.map +1 -0
  391. package/dist/types/node/elements/HTMLMetaElement.d.ts +10 -0
  392. package/dist/types/node/elements/HTMLMetaElement.d.ts.map +1 -0
  393. package/dist/types/node/elements/HTMLOListElement.d.ts +21 -0
  394. package/dist/types/node/elements/HTMLOListElement.d.ts.map +1 -0
  395. package/dist/types/node/elements/HTMLPElement.d.ts +10 -0
  396. package/dist/types/node/elements/HTMLPElement.d.ts.map +1 -0
  397. package/dist/types/node/elements/HTMLScriptElement.d.ts +29 -0
  398. package/dist/types/node/elements/HTMLScriptElement.d.ts.map +1 -0
  399. package/dist/types/node/elements/HTMLSpanElement.d.ts +10 -0
  400. package/dist/types/node/elements/HTMLSpanElement.d.ts.map +1 -0
  401. package/dist/types/node/elements/HTMLStyleElement.d.ts +18 -0
  402. package/dist/types/node/elements/HTMLStyleElement.d.ts.map +1 -0
  403. package/dist/types/node/elements/HTMLTableElement.d.ts +25 -0
  404. package/dist/types/node/elements/HTMLTableElement.d.ts.map +1 -0
  405. package/dist/types/node/elements/HTMLTbodyElement.d.ts +15 -0
  406. package/dist/types/node/elements/HTMLTbodyElement.d.ts.map +1 -0
  407. package/dist/types/node/elements/HTMLTdElement.d.ts +21 -0
  408. package/dist/types/node/elements/HTMLTdElement.d.ts.map +1 -0
  409. package/dist/types/node/elements/HTMLTemplateElement.d.ts +32 -0
  410. package/dist/types/node/elements/HTMLTemplateElement.d.ts.map +1 -0
  411. package/dist/types/node/elements/HTMLTfootElement.d.ts +16 -0
  412. package/dist/types/node/elements/HTMLTfootElement.d.ts.map +1 -0
  413. package/dist/types/node/elements/HTMLThElement.d.ts +21 -0
  414. package/dist/types/node/elements/HTMLThElement.d.ts.map +1 -0
  415. package/dist/types/node/elements/HTMLTheadElement.d.ts +15 -0
  416. package/dist/types/node/elements/HTMLTheadElement.d.ts.map +1 -0
  417. package/dist/types/node/elements/HTMLTitleElement.d.ts +15 -0
  418. package/dist/types/node/elements/HTMLTitleElement.d.ts.map +1 -0
  419. package/dist/types/node/elements/HTMLTrElement.d.ts +17 -0
  420. package/dist/types/node/elements/HTMLTrElement.d.ts.map +1 -0
  421. package/dist/types/node/elements/HTMLUListElement.d.ts +10 -0
  422. package/dist/types/node/elements/HTMLUListElement.d.ts.map +1 -0
  423. package/dist/types/node/elements/MathMLElement.d.ts +11 -0
  424. package/dist/types/node/elements/MathMLElement.d.ts.map +1 -0
  425. package/dist/types/node/elements/SVGCircleElement.d.ts +20 -0
  426. package/dist/types/node/elements/SVGCircleElement.d.ts.map +1 -0
  427. package/dist/types/node/elements/SVGElement.d.ts +11 -0
  428. package/dist/types/node/elements/SVGElement.d.ts.map +1 -0
  429. package/dist/types/node/elements/SVGRectElement.d.ts +23 -0
  430. package/dist/types/node/elements/SVGRectElement.d.ts.map +1 -0
  431. package/dist/types/node/elements/index.d.ts +128 -0
  432. package/dist/types/node/elements/index.d.ts.map +1 -0
  433. package/dist/types/node/index.d.ts +16 -0
  434. package/dist/types/node/index.d.ts.map +1 -0
  435. package/dist/types/utils/CSSSelector.d.ts +36 -0
  436. package/dist/types/utils/CSSSelector.d.ts.map +1 -0
  437. package/dist/types/window/Window.d.ts +620 -0
  438. package/dist/types/window/Window.d.ts.map +1 -0
  439. package/dist/types/window/WindowBase.d.ts +342 -0
  440. package/dist/types/window/WindowBase.d.ts.map +1 -0
  441. package/dist/types/window/index.d.ts +3 -0
  442. package/dist/types/window/index.d.ts.map +1 -0
  443. package/dist/umd-bundle/dooboostore-dom-parser.umd.js +6182 -0
  444. package/dist/umd-bundle/dooboostore-dom-parser.umd.js.map +7 -0
  445. package/package.json +120 -0
  446. package/src/DomParser.ts +491 -0
  447. package/src/factory/ElementFactory.ts +69 -0
  448. package/src/factory/index.ts +1 -0
  449. package/src/index.ts +28 -0
  450. package/src/node/CharacterData.ts +58 -0
  451. package/src/node/ChildNode.ts +42 -0
  452. package/src/node/ChildNodeBase.ts +54 -0
  453. package/src/node/Comment.ts +98 -0
  454. package/src/node/Document.ts +882 -0
  455. package/src/node/DocumentBase.ts +465 -0
  456. package/src/node/DocumentFragment.ts +44 -0
  457. package/src/node/DocumentFragmentBase.ts +109 -0
  458. package/src/node/GetRootNodeOptions.ts +13 -0
  459. package/src/node/Node.ts +245 -0
  460. package/src/node/NodeBase.ts +506 -0
  461. package/src/node/NodeIterator.ts +200 -0
  462. package/src/node/ParentNode.ts +93 -0
  463. package/src/node/ParentNodeBase.ts +145 -0
  464. package/src/node/Text.ts +30 -0
  465. package/src/node/TextBase.ts +113 -0
  466. package/src/node/collection/HTMLCollection.ts +107 -0
  467. package/src/node/collection/HTMLCollectionOf.ts +26 -0
  468. package/src/node/collection/NodeList.ts +140 -0
  469. package/src/node/collection/NodeListOf.ts +28 -0
  470. package/src/node/collection/index.ts +4 -0
  471. package/src/node/elements/Element.ts +771 -0
  472. package/src/node/elements/ElementBase.ts +1239 -0
  473. package/src/node/elements/HTMLAnchorElement.ts +63 -0
  474. package/src/node/elements/HTMLAreaElement.ts +73 -0
  475. package/src/node/elements/HTMLBaseElement.ts +70 -0
  476. package/src/node/elements/HTMLBodyElement.ts +12 -0
  477. package/src/node/elements/HTMLButtonElement.ts +83 -0
  478. package/src/node/elements/HTMLCanvasElement.ts +71 -0
  479. package/src/node/elements/HTMLCaptionElement.ts +26 -0
  480. package/src/node/elements/HTMLDivElement.ts +12 -0
  481. package/src/node/elements/HTMLElement.ts +105 -0
  482. package/src/node/elements/HTMLElementBase.ts +198 -0
  483. package/src/node/elements/HTMLEmbedElement.ts +33 -0
  484. package/src/node/elements/HTMLFormElement.ts +131 -0
  485. package/src/node/elements/HTMLGenericElement.ts +13 -0
  486. package/src/node/elements/HTMLH1Element.ts +12 -0
  487. package/src/node/elements/HTMLHeadElement.ts +12 -0
  488. package/src/node/elements/HTMLHtmlElement.ts +82 -0
  489. package/src/node/elements/HTMLImgElement.ts +96 -0
  490. package/src/node/elements/HTMLInputElement.ts +160 -0
  491. package/src/node/elements/HTMLLIElement.ts +47 -0
  492. package/src/node/elements/HTMLLinkElement.ts +95 -0
  493. package/src/node/elements/HTMLMetaElement.ts +12 -0
  494. package/src/node/elements/HTMLOListElement.ts +83 -0
  495. package/src/node/elements/HTMLPElement.ts +12 -0
  496. package/src/node/elements/HTMLScriptElement.ts +127 -0
  497. package/src/node/elements/HTMLSpanElement.ts +12 -0
  498. package/src/node/elements/HTMLStyleElement.ts +63 -0
  499. package/src/node/elements/HTMLTableElement.ts +117 -0
  500. package/src/node/elements/HTMLTbodyElement.ts +46 -0
  501. package/src/node/elements/HTMLTdElement.ts +67 -0
  502. package/src/node/elements/HTMLTemplateElement.ts +112 -0
  503. package/src/node/elements/HTMLTfootElement.ts +47 -0
  504. package/src/node/elements/HTMLThElement.ts +67 -0
  505. package/src/node/elements/HTMLTheadElement.ts +46 -0
  506. package/src/node/elements/HTMLTitleElement.ts +23 -0
  507. package/src/node/elements/HTMLTrElement.ts +72 -0
  508. package/src/node/elements/HTMLUListElement.ts +12 -0
  509. package/src/node/elements/MathMLElement.ts +16 -0
  510. package/src/node/elements/SVGCircleElement.ts +61 -0
  511. package/src/node/elements/SVGElement.ts +16 -0
  512. package/src/node/elements/SVGRectElement.ts +74 -0
  513. package/src/node/elements/index.ts +186 -0
  514. package/src/node/index.ts +28 -0
  515. package/src/utils/CSSSelector.ts +360 -0
  516. package/src/window/Window.ts +715 -0
  517. package/src/window/WindowBase.ts +1018 -0
  518. package/src/window/index.ts +2 -0
  519. package/tsconfig.json +24 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/node/Node.ts"],
4
+ "sourcesContent": ["import { type NodeListOf } from './collection/NodeListOf';\nimport { NodeList } from './collection/NodeList';\nimport { type ChildNode } from './ChildNode';\nimport { type ParentNode } from './ParentNode';\nimport { type Document } from './Document';\nimport { type HTMLElement } from './elements/HTMLElement';\nimport { type GetRootNodeOptions } from './GetRootNodeOptions';\n// Node \uC0C1\uC218\uB4E4\uC744 \uBCC4\uB3C4\uB85C export\nexport const ELEMENT_NODE = 1 as const;\nexport const ATTRIBUTE_NODE = 2 as const;\nexport const TEXT_NODE = 3 as const;\nexport const CDATA_SECTION_NODE = 4 as const;\nexport const ENTITY_REFERENCE_NODE = 5 as const;\nexport const ENTITY_NODE = 6 as const;\nexport const PROCESSING_INSTRUCTION_NODE = 7 as const;\nexport const COMMENT_NODE = 8 as const;\nexport const DOCUMENT_NODE = 9 as const;\nexport const DOCUMENT_TYPE_NODE = 10 as const;\nexport const DOCUMENT_FRAGMENT_NODE = 11 as const;\nexport const NOTATION_NODE = 12 as const;\nexport const DOCUMENT_POSITION_DISCONNECTED = 0x01 as const;\nexport const DOCUMENT_POSITION_PRECEDING = 0x02 as const;\nexport const DOCUMENT_POSITION_FOLLOWING = 0x04 as const;\nexport const DOCUMENT_POSITION_CONTAINS = 0x08 as const;\nexport const DOCUMENT_POSITION_CONTAINED_BY = 0x10 as const;\nexport const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20 as const;\n\n// Forward declarations for circular dependencies\n// interface ChildNode extends Node {}\n// interface ParentNode extends Node {}\n// interface Document extends Node {}\n// interface HTMLElement {}\n// interface GetRootNodeOptions {\n// composed?: boolean;\n// }\n\nexport interface Node {\n /** node is an element. */\n readonly ELEMENT_NODE: 1;\n readonly ATTRIBUTE_NODE: 2;\n /** node is a Text node. */\n readonly TEXT_NODE: 3;\n /** node is a CDATASection node. */\n readonly CDATA_SECTION_NODE: 4;\n readonly ENTITY_REFERENCE_NODE: 5;\n readonly ENTITY_NODE: 6;\n /** node is a ProcessingInstruction node. */\n readonly PROCESSING_INSTRUCTION_NODE: 7;\n /** node is a Comment node. */\n readonly COMMENT_NODE: 8;\n /** node is a document. */\n readonly DOCUMENT_NODE: 9;\n /** node is a doctype. */\n readonly DOCUMENT_TYPE_NODE: 10;\n /** node is a DocumentFragment node. */\n readonly DOCUMENT_FRAGMENT_NODE: 11;\n readonly NOTATION_NODE: 12;\n /** Set when node and other are not in the same tree. */\n readonly DOCUMENT_POSITION_DISCONNECTED: 0x01;\n /** Set when other is preceding node. */\n readonly DOCUMENT_POSITION_PRECEDING: 0x02;\n /** Set when other is following node. */\n readonly DOCUMENT_POSITION_FOLLOWING: 0x04;\n /** Set when other is an ancestor of node. */\n readonly DOCUMENT_POSITION_CONTAINS: 0x08;\n /** Set when other is a descendant of node. */\n readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20;\n\n\n /**\n * The read-only **`baseURI`** property of the Node interface returns the absolute base URL of the document containing the node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/baseURI)\n */\n readonly baseURI: string;\n /**\n * The read-only **`childNodes`** property of the Node interface returns a live the first child node is assigned index `0`.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/childNodes)\n */\n readonly childNodes: NodeListOf<ChildNode>;\n /**\n * The read-only **`firstChild`** property of the Node interface returns the node's first child in the tree, or `null` if the node has no children.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/firstChild)\n */\n readonly firstChild: ChildNode | null;\n /**\n * The read-only **`isConnected`** property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isConnected)\n */\n readonly isConnected: boolean;\n /**\n * The read-only **`lastChild`** property of the Node interface returns the last child of the node, or `null` if there are no child nodes.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lastChild)\n */\n readonly lastChild: ChildNode | null;\n /**\n * The read-only **`nextSibling`** property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns `null` if the specified node is the last child in the parent element.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)\n */\n readonly nextSibling: ChildNode | null;\n /**\n * The read-only **`nodeName`** property of Node returns the name of the current node as a string.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)\n */\n readonly nodeName: string;\n /**\n * The read-only **`nodeType`** property of a Node interface is an integer that identifies what the node is.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeType)\n */\n readonly nodeType: number;\n /**\n * The **`nodeValue`** property of the Node interface returns or sets the value of the current node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)\n */\n nodeValue: string | null;\n /**\n * The read-only **`ownerDocument`** property of the Node interface returns the top-level document object of the node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)\n */\n readonly ownerDocument: Document | null;\n /**\n * The read-only **`parentElement`** property of Node interface returns the DOM node's parent Element, or `null` if the node either has no parent, or its parent isn't a DOM Element.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentElement)\n */\n readonly parentElement: HTMLElement | null;\n /**\n * The read-only **`parentNode`** property of the Node interface returns the parent of the specified node in the DOM tree.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentNode)\n */\n readonly parentNode: ParentNode | null;\n /**\n * The read-only **`previousSibling`** property of the Node interface returns the node immediately preceding the specified one in its parent's or `null` if the specified node is the first in that list.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)\n */\n readonly previousSibling: ChildNode | null;\n /**\n * The **`textContent`** property of the Node interface represents the text content of the node and its descendants.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/textContent)\n */\n textContent: string | null;\n /**\n * The **`appendChild()`** method of the Node interface adds a node to the end of the list of children of a specified parent node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/appendChild)\n */\n appendChild<T extends Node>(node: T): T;\n /**\n * The **`cloneNode()`** method of the Node interface returns a duplicate of the node on which this method was called.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)\n */\n cloneNode(subtree?: boolean): Node;\n /**\n * The **`compareDocumentPosition()`** method of the Node interface reports the position of its argument node relative to the node on which it is called.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)\n */\n compareDocumentPosition(other: Node): number;\n /**\n * The **`contains()`** method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (Node.childNodes), one of the children's direct children, and so on.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/contains)\n */\n contains(other: Node | null): boolean;\n /**\n * The **`getRootNode()`** method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)\n */\n getRootNode(options?: GetRootNodeOptions): Node;\n /**\n * The **`hasChildNodes()`** method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)\n */\n hasChildNodes(): boolean;\n /**\n * The **`insertBefore()`** method of the Node interface inserts a node before a _reference node_ as a child of a specified _parent node_.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)\n */\n insertBefore<T extends Node>(node: T, child: Node | null): T;\n /**\n * The **`isDefaultNamespace()`** method of the Node interface accepts a namespace URI as an argument.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)\n */\n isDefaultNamespace(namespace: string | null): boolean;\n /**\n * The **`isEqualNode()`** method of the Node interface tests whether two nodes are equal.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)\n */\n isEqualNode(otherNode: Node | null): boolean;\n /**\n * The **`isSameNode()`** method of the Node interface is a legacy alias the for the `===` strict equality operator.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)\n */\n isSameNode(otherNode: Node | null): boolean;\n /**\n * The **`lookupNamespaceURI()`** method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and `null` if not).\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)\n */\n lookupNamespaceURI(prefix: string | null): string | null;\n /**\n * The **`lookupPrefix()`** method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and `null` if not.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)\n */\n lookupPrefix(namespace: string | null): string | null;\n /**\n * The **`normalize()`** method of the Node interface puts the specified node and all of its sub-tree into a _normalized_ form.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/normalize)\n */\n normalize(): void;\n /**\n * The **`removeChild()`** method of the Node interface removes a child node from the DOM and returns the removed node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/removeChild)\n */\n removeChild<T extends Node>(child: T): T;\n /**\n * The **`replaceChild()`** method of the Node interface replaces a child node within the given (parent) node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)\n */\n replaceChild<T extends Node>(node: Node, child: T): T;\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAClB,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,cAAc;AACpB,MAAM,8BAA8B;AACpC,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAC/B,MAAM,gBAAgB;AACtB,MAAM,iCAAiC;AACvC,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,6BAA6B;AACnC,MAAM,iCAAiC;AACvC,MAAM,4CAA4C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,380 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var NodeBase_exports = {};
19
+ __export(NodeBase_exports, {
20
+ NodeBase: () => NodeBase
21
+ });
22
+ module.exports = __toCommonJS(NodeBase_exports);
23
+ var import_Node = require("./Node");
24
+ var import_NodeListOf = require("./collection/NodeListOf");
25
+ class NodeBase {
26
+ constructor(nodeType, nodeName, ownerDocument) {
27
+ this.nodeType = nodeType;
28
+ this.nodeName = nodeName;
29
+ // Internal properties (for Base class implementations)
30
+ this._childNodesInternal = [];
31
+ this._parentNodeInternal = null;
32
+ // Internal parent reference
33
+ this._ownerDocument = null;
34
+ // Made public for ChildNodeBase access
35
+ this._nodeValue = null;
36
+ this._textContent = null;
37
+ this._ownerDocument = ownerDocument || null;
38
+ }
39
+ // Node interface implementation
40
+ get baseURI() {
41
+ return this._ownerDocument?.URL || "";
42
+ }
43
+ // External interface - returns proper Node interface types
44
+ get childNodes() {
45
+ return new import_NodeListOf.NodeListOf(this._childNodesInternal);
46
+ }
47
+ get firstChild() {
48
+ return this._childNodesInternal.length > 0 ? this._childNodesInternal[0] : null;
49
+ }
50
+ get lastChild() {
51
+ const length = this._childNodesInternal.length;
52
+ return length > 0 ? this._childNodesInternal[length - 1] : null;
53
+ }
54
+ get nextSibling() {
55
+ if (!this._parentNodeInternal) return null;
56
+ const siblings = this._parentNodeInternal._childNodesInternal;
57
+ const index = this._findIndexInParent();
58
+ return index !== -1 && index < siblings.length - 1 ? siblings[index + 1] : null;
59
+ }
60
+ get previousSibling() {
61
+ if (!this._parentNodeInternal) return null;
62
+ const siblings = this._parentNodeInternal._childNodesInternal;
63
+ const index = this._findIndexInParent();
64
+ return index > 0 ? siblings[index - 1] : null;
65
+ }
66
+ get parentNode() {
67
+ return this._parentNodeInternal;
68
+ }
69
+ get parentElement() {
70
+ return this._parentNodeInternal && this._parentNodeInternal.nodeType === import_Node.ELEMENT_NODE ? this._parentNodeInternal : null;
71
+ }
72
+ get ownerDocument() {
73
+ return this._ownerDocument;
74
+ }
75
+ get isConnected() {
76
+ let node = this;
77
+ while (node) {
78
+ if (node.nodeType === import_Node.DOCUMENT_NODE) return true;
79
+ node = node.parentNode;
80
+ }
81
+ return false;
82
+ }
83
+ get nodeValue() {
84
+ return this._nodeValue;
85
+ }
86
+ set nodeValue(value) {
87
+ this._nodeValue = value;
88
+ }
89
+ get textContent() {
90
+ if (this.nodeType === import_Node.TEXT_NODE || this.nodeType === import_Node.COMMENT_NODE) {
91
+ return this._nodeValue ? this.decodeHTMLEntities(this._nodeValue) : this._nodeValue;
92
+ }
93
+ if (this._textContent !== void 0 && this._textContent !== null) {
94
+ return this._textContent;
95
+ }
96
+ let text = "";
97
+ for (const child of this._childNodesInternal) {
98
+ const childText = child.textContent;
99
+ if (childText !== null && childText !== void 0) {
100
+ text += childText;
101
+ }
102
+ }
103
+ return text.length > 0 ? text : null;
104
+ }
105
+ set textContent(value) {
106
+ const stringValue = String(value);
107
+ this._textContent = stringValue;
108
+ this._childNodesInternal = [];
109
+ if (stringValue) {
110
+ const escapedValue = this.escapeHTMLEntities(stringValue);
111
+ const { TextBase } = require("./TextBase");
112
+ const textNode = new TextBase(escapedValue, this._ownerDocument);
113
+ this._childNodesInternal.push(textNode);
114
+ textNode._parentNodeInternal = this;
115
+ }
116
+ }
117
+ /**
118
+ * Escape HTML entities in a string to prevent XSS
119
+ */
120
+ escapeHTMLEntities(str) {
121
+ const entityMap = {
122
+ "&": "&amp;",
123
+ "<": "&lt;",
124
+ ">": "&gt;",
125
+ '"': "&quot;",
126
+ "'": "&#39;"
127
+ };
128
+ return str.replace(/[&<>"']/g, (char) => {
129
+ return entityMap[char] || char;
130
+ });
131
+ }
132
+ /**
133
+ * Decode HTML entities in a string
134
+ */
135
+ decodeHTMLEntities(str) {
136
+ const entityMap = {
137
+ "&amp;": "&",
138
+ "&lt;": "<",
139
+ "&gt;": ">",
140
+ "&quot;": '"',
141
+ "&#39;": "'",
142
+ "&#34;": '"',
143
+ "&apos;": "'",
144
+ "&copy;": "\xA9",
145
+ "&reg;": "\xAE",
146
+ "&trade;": "\u2122",
147
+ "&nbsp;": " ",
148
+ "&hellip;": "\u2026",
149
+ "&mdash;": "\u2014",
150
+ "&ndash;": "\u2013",
151
+ "&lsquo;": "\u2018",
152
+ "&rsquo;": "\u2019",
153
+ "&ldquo;": '"',
154
+ "&rdquo;": '"'
155
+ };
156
+ return str.replace(/&[a-zA-Z0-9#]+;/g, (entity) => {
157
+ if (entityMap[entity]) {
158
+ return entityMap[entity];
159
+ }
160
+ if (entity.startsWith("&#") && entity.endsWith(";")) {
161
+ const numStr = entity.slice(2, -1);
162
+ const num = parseInt(numStr, 10);
163
+ if (!isNaN(num)) {
164
+ return String.fromCharCode(num);
165
+ }
166
+ }
167
+ if (entity.startsWith("&#x") && entity.endsWith(";")) {
168
+ const hexStr = entity.slice(3, -1);
169
+ const num = parseInt(hexStr, 16);
170
+ if (!isNaN(num)) {
171
+ return String.fromCharCode(num);
172
+ }
173
+ }
174
+ return entity;
175
+ });
176
+ }
177
+ // Node methods - external interface uses Node types, internal uses NodeBase
178
+ appendChild(node) {
179
+ const nodeBase = node;
180
+ if (nodeBase.nodeType === import_Node.DOCUMENT_FRAGMENT_NODE) {
181
+ const fragment = nodeBase;
182
+ while (fragment._childNodesInternal.length > 0) {
183
+ const child = fragment._childNodesInternal[0];
184
+ if (child) {
185
+ fragment.removeChild(child);
186
+ this.appendChild(child);
187
+ }
188
+ }
189
+ return node;
190
+ }
191
+ if (nodeBase._parentNodeInternal) {
192
+ nodeBase._parentNodeInternal.removeChild(nodeBase);
193
+ }
194
+ this._childNodesInternal.push(nodeBase);
195
+ nodeBase._parentNodeInternal = this;
196
+ nodeBase._ownerDocument = this._ownerDocument;
197
+ return node;
198
+ }
199
+ removeChild(child) {
200
+ const childBase = child;
201
+ const index = this._findChildIndex(childBase);
202
+ if (index === -1) {
203
+ throw new Error("Node not found");
204
+ }
205
+ this._childNodesInternal.splice(index, 1);
206
+ childBase._parentNodeInternal = null;
207
+ return child;
208
+ }
209
+ insertBefore(node, child) {
210
+ if (child === null) {
211
+ return this.appendChild(node);
212
+ }
213
+ const nodeBase = node;
214
+ const childBase = child;
215
+ const index = this._findChildIndex(childBase);
216
+ if (index === -1) {
217
+ throw new Error("Reference node not found");
218
+ }
219
+ if (nodeBase.nodeType === import_Node.DOCUMENT_FRAGMENT_NODE) {
220
+ const fragment = nodeBase;
221
+ const children = [...fragment._childNodesInternal];
222
+ let insertIndex = index;
223
+ for (const fragmentChild of children) {
224
+ fragment.removeChild(fragmentChild);
225
+ this._childNodesInternal.splice(insertIndex, 0, fragmentChild);
226
+ fragmentChild._parentNodeInternal = this;
227
+ fragmentChild._ownerDocument = this._ownerDocument;
228
+ insertIndex++;
229
+ }
230
+ return node;
231
+ }
232
+ if (nodeBase._parentNodeInternal) {
233
+ nodeBase._parentNodeInternal.removeChild(nodeBase);
234
+ }
235
+ this._childNodesInternal.splice(index, 0, nodeBase);
236
+ nodeBase._parentNodeInternal = this;
237
+ nodeBase._ownerDocument = this._ownerDocument;
238
+ return node;
239
+ }
240
+ replaceChild(node, child) {
241
+ this.insertBefore(node, child);
242
+ this.removeChild(child);
243
+ return child;
244
+ }
245
+ cloneNode(deep) {
246
+ throw new Error("cloneNode must be implemented by subclasses");
247
+ }
248
+ hasChildNodes() {
249
+ return this._childNodesInternal.length > 0;
250
+ }
251
+ contains(other) {
252
+ if (!other || other === this) return other === this;
253
+ let node = other;
254
+ while (node) {
255
+ if (node.parentNode === this) return true;
256
+ node = node.parentNode;
257
+ }
258
+ return false;
259
+ }
260
+ compareDocumentPosition(other) {
261
+ if (this === other) return 0;
262
+ const otherBase = other;
263
+ const thisRoot = this.getRootNode();
264
+ const otherRoot = otherBase.getRootNode();
265
+ if (thisRoot !== otherRoot) {
266
+ return import_Node.DOCUMENT_POSITION_DISCONNECTED;
267
+ }
268
+ if (this.contains(other)) return import_Node.DOCUMENT_POSITION_CONTAINED_BY;
269
+ if (other.contains(this)) return import_Node.DOCUMENT_POSITION_CONTAINS;
270
+ const thisAncestors = this._getAncestors();
271
+ const otherAncestors = otherBase._getAncestors();
272
+ let commonAncestor = null;
273
+ for (let i = 0; i < thisAncestors.length; i++) {
274
+ if (otherAncestors.includes(thisAncestors[i])) {
275
+ commonAncestor = thisAncestors[i];
276
+ break;
277
+ }
278
+ }
279
+ if (!commonAncestor) {
280
+ return import_Node.DOCUMENT_POSITION_DISCONNECTED;
281
+ }
282
+ const thisChild = this._getChildInAncestor(commonAncestor);
283
+ const otherChild = otherBase._getChildInAncestor(commonAncestor);
284
+ if (thisChild && otherChild && commonAncestor._childNodesInternal) {
285
+ const thisIndex = commonAncestor._childNodesInternal.indexOf(thisChild);
286
+ const otherIndex = commonAncestor._childNodesInternal.indexOf(otherChild);
287
+ if (thisIndex < otherIndex) {
288
+ return import_Node.DOCUMENT_POSITION_FOLLOWING;
289
+ } else if (thisIndex > otherIndex) {
290
+ return import_Node.DOCUMENT_POSITION_PRECEDING;
291
+ }
292
+ }
293
+ return import_Node.DOCUMENT_POSITION_DISCONNECTED;
294
+ }
295
+ getRootNode(options) {
296
+ let root = this;
297
+ while (root.parentNode) {
298
+ root = root.parentNode;
299
+ }
300
+ return root;
301
+ }
302
+ isEqualNode(otherNode) {
303
+ if (!otherNode) return false;
304
+ if (this === otherNode) return true;
305
+ if (this.nodeType !== otherNode.nodeType) return false;
306
+ if (this.nodeName !== otherNode.nodeName) return false;
307
+ return true;
308
+ }
309
+ isSameNode(otherNode) {
310
+ return this === otherNode;
311
+ }
312
+ isDefaultNamespace(namespace) {
313
+ return namespace === null || namespace === "http://www.w3.org/1999/xhtml";
314
+ }
315
+ lookupNamespaceURI(prefix) {
316
+ if (prefix === null || prefix === "") {
317
+ return "http://www.w3.org/1999/xhtml";
318
+ }
319
+ return null;
320
+ }
321
+ lookupPrefix(namespace) {
322
+ return null;
323
+ }
324
+ normalize() {
325
+ for (let i = this._childNodesInternal.length - 1; i >= 0; i--) {
326
+ const child = this._childNodesInternal[i];
327
+ if (child && child.nodeType === import_Node.TEXT_NODE) {
328
+ const nextSibling = child.nextSibling;
329
+ if (nextSibling && nextSibling.nodeType === import_Node.TEXT_NODE) {
330
+ child.nodeValue = (child.nodeValue || "") + (nextSibling.nodeValue || "");
331
+ this.removeChild(nextSibling);
332
+ }
333
+ }
334
+ }
335
+ }
336
+ // Helper methods
337
+ _findIndexInParent() {
338
+ if (!this._parentNodeInternal) return -1;
339
+ return this._parentNodeInternal._childNodesInternal.indexOf(this);
340
+ }
341
+ _findChildIndex(child) {
342
+ return this._childNodesInternal.indexOf(child);
343
+ }
344
+ _getAncestors() {
345
+ const ancestors = [];
346
+ let current = this._parentNodeInternal;
347
+ while (current) {
348
+ ancestors.push(current);
349
+ current = current._parentNodeInternal;
350
+ }
351
+ return ancestors;
352
+ }
353
+ _getChildInAncestor(ancestor) {
354
+ let current = this;
355
+ while (current._parentNodeInternal && current._parentNodeInternal !== ancestor) {
356
+ current = current._parentNodeInternal;
357
+ }
358
+ return current._parentNodeInternal === ancestor ? current : null;
359
+ }
360
+ }
361
+ // Node constants as instance properties
362
+ NodeBase.ELEMENT_NODE = import_Node.ELEMENT_NODE;
363
+ NodeBase.ATTRIBUTE_NODE = import_Node.ATTRIBUTE_NODE;
364
+ NodeBase.TEXT_NODE = import_Node.TEXT_NODE;
365
+ NodeBase.CDATA_SECTION_NODE = import_Node.CDATA_SECTION_NODE;
366
+ NodeBase.ENTITY_REFERENCE_NODE = import_Node.ENTITY_REFERENCE_NODE;
367
+ NodeBase.ENTITY_NODE = import_Node.ENTITY_NODE;
368
+ NodeBase.PROCESSING_INSTRUCTION_NODE = import_Node.PROCESSING_INSTRUCTION_NODE;
369
+ NodeBase.COMMENT_NODE = import_Node.COMMENT_NODE;
370
+ NodeBase.DOCUMENT_NODE = import_Node.DOCUMENT_NODE;
371
+ NodeBase.DOCUMENT_TYPE_NODE = import_Node.DOCUMENT_TYPE_NODE;
372
+ NodeBase.DOCUMENT_FRAGMENT_NODE = import_Node.DOCUMENT_FRAGMENT_NODE;
373
+ NodeBase.NOTATION_NODE = import_Node.NOTATION_NODE;
374
+ NodeBase.DOCUMENT_POSITION_DISCONNECTED = import_Node.DOCUMENT_POSITION_DISCONNECTED;
375
+ NodeBase.DOCUMENT_POSITION_PRECEDING = import_Node.DOCUMENT_POSITION_PRECEDING;
376
+ NodeBase.DOCUMENT_POSITION_FOLLOWING = import_Node.DOCUMENT_POSITION_FOLLOWING;
377
+ NodeBase.DOCUMENT_POSITION_CONTAINS = import_Node.DOCUMENT_POSITION_CONTAINS;
378
+ NodeBase.DOCUMENT_POSITION_CONTAINED_BY = import_Node.DOCUMENT_POSITION_CONTAINED_BY;
379
+ NodeBase.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = import_Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
380
+ //# sourceMappingURL=NodeBase.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/node/NodeBase.ts"],
4
+ "sourcesContent": ["import { Node,\n ELEMENT_NODE ,\n ATTRIBUTE_NODE ,\n TEXT_NODE ,\n CDATA_SECTION_NODE ,\n ENTITY_REFERENCE_NODE ,\n ENTITY_NODE ,\n PROCESSING_INSTRUCTION_NODE ,\n COMMENT_NODE ,\n DOCUMENT_NODE ,\n DOCUMENT_TYPE_NODE ,\n DOCUMENT_FRAGMENT_NODE ,\n NOTATION_NODE ,\n DOCUMENT_POSITION_DISCONNECTED ,\n DOCUMENT_POSITION_PRECEDING ,\n DOCUMENT_POSITION_FOLLOWING ,\n DOCUMENT_POSITION_CONTAINS ,\n DOCUMENT_POSITION_CONTAINED_BY ,\n DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\n} from './Node';\nimport { ChildNode } from './ChildNode';\nimport { ParentNode } from './ParentNode';\nimport { NodeListOf } from './collection/NodeListOf';\nimport { GetRootNodeOptions } from './GetRootNodeOptions';\nimport { HTMLElement } from './elements/HTMLElement';\nimport { Document } from './Document';\nimport { Text } from './Text';\n\n/**\n * Base implementation of the Node interface\n */\nexport abstract class NodeBase implements Node {\n // Node constants as instance properties\n static readonly ELEMENT_NODE = ELEMENT_NODE;\n static readonly ATTRIBUTE_NODE = ATTRIBUTE_NODE;\n static readonly TEXT_NODE = TEXT_NODE;\n static readonly CDATA_SECTION_NODE = CDATA_SECTION_NODE;\n static readonly ENTITY_REFERENCE_NODE = ENTITY_REFERENCE_NODE;\n static readonly ENTITY_NODE = ENTITY_NODE;\n static readonly PROCESSING_INSTRUCTION_NODE = PROCESSING_INSTRUCTION_NODE;\n static readonly COMMENT_NODE = COMMENT_NODE;\n static readonly DOCUMENT_NODE = DOCUMENT_NODE;\n static readonly DOCUMENT_TYPE_NODE = DOCUMENT_TYPE_NODE;\n static readonly DOCUMENT_FRAGMENT_NODE = DOCUMENT_FRAGMENT_NODE;\n static readonly NOTATION_NODE = NOTATION_NODE;\n static readonly DOCUMENT_POSITION_DISCONNECTED = DOCUMENT_POSITION_DISCONNECTED;\n static readonly DOCUMENT_POSITION_PRECEDING = DOCUMENT_POSITION_PRECEDING;\n static readonly DOCUMENT_POSITION_FOLLOWING = DOCUMENT_POSITION_FOLLOWING;\n static readonly DOCUMENT_POSITION_CONTAINS = DOCUMENT_POSITION_CONTAINS;\n static readonly DOCUMENT_POSITION_CONTAINED_BY = DOCUMENT_POSITION_CONTAINED_BY;\n static readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n\n ELEMENT_NODE: typeof ELEMENT_NODE;\n ATTRIBUTE_NODE: typeof ATTRIBUTE_NODE;\n TEXT_NODE: typeof TEXT_NODE;\n CDATA_SECTION_NODE: typeof CDATA_SECTION_NODE;\n ENTITY_REFERENCE_NODE: typeof ENTITY_REFERENCE_NODE;\n ENTITY_NODE: typeof ENTITY_NODE;\n PROCESSING_INSTRUCTION_NODE: typeof PROCESSING_INSTRUCTION_NODE;\n COMMENT_NODE: typeof COMMENT_NODE;\n DOCUMENT_NODE: typeof DOCUMENT_NODE;\n DOCUMENT_TYPE_NODE: typeof DOCUMENT_TYPE_NODE;\n DOCUMENT_FRAGMENT_NODE: typeof DOCUMENT_FRAGMENT_NODE;\n NOTATION_NODE: typeof NOTATION_NODE;\n DOCUMENT_POSITION_DISCONNECTED: typeof DOCUMENT_POSITION_DISCONNECTED;\n DOCUMENT_POSITION_PRECEDING: typeof DOCUMENT_POSITION_PRECEDING;\n DOCUMENT_POSITION_FOLLOWING: typeof DOCUMENT_POSITION_FOLLOWING;\n DOCUMENT_POSITION_CONTAINS: typeof DOCUMENT_POSITION_CONTAINS;\n DOCUMENT_POSITION_CONTAINED_BY: typeof DOCUMENT_POSITION_CONTAINED_BY;\n DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: typeof DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n // Internal properties (for Base class implementations)\n protected _childNodesInternal: NodeBase[] = [];\n public _parentNodeInternal: NodeBase | null = null; // Internal parent reference\n public _ownerDocument: Document | null = null; // Made public for ChildNodeBase access\n protected _nodeValue: string | null = null;\n protected _textContent: string | null = null;\n\n constructor(\n public readonly nodeType: number,\n public readonly nodeName: string,\n ownerDocument?: Document | null\n ) {\n this._ownerDocument = ownerDocument || null;\n }\n\n\n\n // Node interface implementation\n get baseURI(): string {\n return this._ownerDocument?.URL || '';\n }\n\n // External interface - returns proper Node interface types\n get childNodes(): NodeListOf<ChildNode> {\n return new NodeListOf<ChildNode>(this._childNodesInternal as unknown as ChildNode[]);\n }\n\n get firstChild(): ChildNode | null {\n return this._childNodesInternal.length > 0 ? this._childNodesInternal[0] as unknown as ChildNode : null;\n }\n\n get lastChild(): ChildNode | null {\n const length = this._childNodesInternal.length;\n return length > 0 ? this._childNodesInternal[length - 1] as unknown as ChildNode : null;\n }\n\n get nextSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index !== -1 && index < siblings.length - 1 ? siblings[index + 1] as unknown as ChildNode : null;\n }\n\n get previousSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index > 0 ? siblings[index - 1] as unknown as ChildNode : null;\n }\n\n get parentNode(): ParentNode | null {\n return this._parentNodeInternal as unknown as ParentNode | null;\n }\n\n get parentElement(): HTMLElement | null {\n return this._parentNodeInternal && this._parentNodeInternal.nodeType === ELEMENT_NODE\n ? this._parentNodeInternal as unknown as HTMLElement\n : null;\n }\n\n get ownerDocument(): Document | null {\n return this._ownerDocument;\n }\n\n get isConnected(): boolean {\n let node: Node | null = this;\n while (node) {\n if (node.nodeType === DOCUMENT_NODE) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n get nodeValue(): string | null {\n return this._nodeValue;\n }\n\n set nodeValue(value: string | null) {\n this._nodeValue = value;\n }\n\n get textContent(): string | null {\n if (this.nodeType === TEXT_NODE || this.nodeType === COMMENT_NODE) {\n // For text nodes, decode HTML entities to return original text\n return this._nodeValue ? this.decodeHTMLEntities(this._nodeValue) : this._nodeValue;\n }\n\n // For elements, return the stored original text content if available\n if (this._textContent !== undefined && this._textContent !== null) {\n return this._textContent;\n }\n\n // Fallback: collect from children (for HTML parsed content)\n let text = '';\n for (const child of this._childNodesInternal) {\n const childText = child.textContent;\n if (childText !== null && childText !== undefined) {\n text += childText;\n }\n }\n return text.length > 0 ? text : null;\n }\n\n set textContent(value: string | null) {\n // Convert to string (including null and undefined)\n const stringValue = String(value);\n // Store original text content\n this._textContent = stringValue;\n // Clear all children and add a single text node\n this._childNodesInternal = [];\n if (stringValue) {\n // Create text node implementation with escaped value for innerHTML\n const escapedValue = this.escapeHTMLEntities(stringValue);\n const { TextBase } = require('./TextBase');\n const textNode = new TextBase(escapedValue, this._ownerDocument);\n this._childNodesInternal.push(textNode);\n textNode._parentNodeInternal = this;\n }\n }\n\n /**\n * Escape HTML entities in a string to prevent XSS\n */\n protected escapeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;'\n };\n\n return str.replace(/[&<>\"']/g, (char) => {\n return entityMap[char] || char;\n });\n }\n\n /**\n * Decode HTML entities in a string\n */\n protected decodeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&#34;': '\"',\n '&apos;': \"'\",\n '&copy;': '\u00A9',\n '&reg;': '\u00AE',\n '&trade;': '\u2122',\n '&nbsp;': ' ',\n '&hellip;': '\u2026',\n '&mdash;': '\u2014',\n '&ndash;': '\u2013',\n '&lsquo;': '\\u2018',\n '&rsquo;': '\\u2019',\n '&ldquo;': '\"',\n '&rdquo;': '\"'\n };\n\n return str.replace(/&[a-zA-Z0-9#]+;/g, (entity) => {\n // Handle named entities\n if (entityMap[entity]) {\n return entityMap[entity];\n }\n \n // Handle numeric entities like &#39; &#34;\n if (entity.startsWith('&#') && entity.endsWith(';')) {\n const numStr = entity.slice(2, -1);\n const num = parseInt(numStr, 10);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n \n // Handle hex entities like &#x27;\n if (entity.startsWith('&#x') && entity.endsWith(';')) {\n const hexStr = entity.slice(3, -1);\n const num = parseInt(hexStr, 16);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n \n // Return original if not recognized\n return entity;\n });\n }\n\n // Node methods - external interface uses Node types, internal uses NodeBase\n appendChild<T extends Node>(node: T): T {\n const nodeBase = node as any as NodeBase; // Internal cast\n\n // Special handling for DocumentFragment\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n // When appending a DocumentFragment, move its children instead\n const fragment = nodeBase;\n \n // Move all children from fragment to this node\n while (fragment._childNodesInternal.length > 0) {\n const child = fragment._childNodesInternal[0];\n if (child) {\n fragment.removeChild(child);\n this.appendChild(child);\n }\n }\n \n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.push(nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n return node;\n }\n\n removeChild<T extends Node>(child: T): T {\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Node not found');\n }\n\n this._childNodesInternal.splice(index, 1);\n childBase._parentNodeInternal = null;\n\n return child;\n }\n\n insertBefore<T extends Node>(node: T, child: Node | null): T {\n if (child === null) {\n return this.appendChild(node);\n }\n\n const nodeBase = node as any as NodeBase; // Internal cast\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Reference node not found');\n }\n\n // Handle DocumentFragment - move all its children\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n const fragment = nodeBase as any;\n const children = [...fragment._childNodesInternal]; // Copy array to avoid modification during iteration\n \n let insertIndex = index;\n for (const fragmentChild of children) {\n // Remove from fragment\n fragment.removeChild(fragmentChild);\n // Insert at the current insert position\n this._childNodesInternal.splice(insertIndex, 0, fragmentChild);\n fragmentChild._parentNodeInternal = this;\n fragmentChild._ownerDocument = this._ownerDocument;\n // Increment insert index for next child to maintain order\n insertIndex++;\n }\n \n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.splice(index, 0, nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n return node;\n }\n\n replaceChild<T extends Node>(node: Node, child: T): T {\n this.insertBefore(node, child);\n this.removeChild(child);\n return child;\n }\n\n cloneNode(deep?: boolean): Node {\n // Basic clone implementation - would need to be overridden by specific node types\n throw new Error('cloneNode must be implemented by subclasses');\n }\n\n hasChildNodes(): boolean {\n return this._childNodesInternal.length > 0;\n }\n\n contains(other: Node | null): boolean {\n if (!other || other === this) return other === this;\n\n let node: Node | null = other;\n while (node) {\n if (node.parentNode === this as unknown as ParentNode) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n compareDocumentPosition(other: Node): number {\n if (this === other) return 0;\n \n const otherBase = other as any as NodeBase;\n \n // Check if nodes are disconnected (not in same tree)\n const thisRoot = this.getRootNode();\n const otherRoot = otherBase.getRootNode();\n if (thisRoot !== otherRoot) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n \n // Check containment relationships\n if (this.contains(other)) return DOCUMENT_POSITION_CONTAINED_BY;\n if (other.contains(this)) return DOCUMENT_POSITION_CONTAINS;\n \n // Find document order by traversing up to common ancestor\n const thisAncestors = this._getAncestors();\n const otherAncestors = otherBase._getAncestors();\n \n // Find common ancestor\n let commonAncestor: NodeBase | null = null;\n for (let i = 0; i < thisAncestors.length; i++) {\n if (otherAncestors.includes(thisAncestors[i])) {\n commonAncestor = thisAncestors[i];\n break;\n }\n }\n \n if (!commonAncestor) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n \n // Compare positions within common ancestor\n const thisChild = this._getChildInAncestor(commonAncestor);\n const otherChild = otherBase._getChildInAncestor(commonAncestor);\n \n if (thisChild && otherChild && commonAncestor._childNodesInternal) {\n const thisIndex = commonAncestor._childNodesInternal.indexOf(thisChild);\n const otherIndex = commonAncestor._childNodesInternal.indexOf(otherChild);\n \n if (thisIndex < otherIndex) {\n return DOCUMENT_POSITION_FOLLOWING;\n } else if (thisIndex > otherIndex) {\n return DOCUMENT_POSITION_PRECEDING;\n }\n }\n \n return DOCUMENT_POSITION_DISCONNECTED;\n }\n\n getRootNode(options?: GetRootNodeOptions): Node {\n let root: Node = this;\n while (root.parentNode) {\n root = root.parentNode;\n }\n return root;\n }\n\n isEqualNode(otherNode: Node | null): boolean {\n if (!otherNode) return false;\n if (this === otherNode) return true;\n if (this.nodeType !== otherNode.nodeType) return false;\n if (this.nodeName !== otherNode.nodeName) return false;\n return true; // Simplified comparison\n }\n\n isSameNode(otherNode: Node | null): boolean {\n return this === otherNode;\n }\n\n isDefaultNamespace(namespace: string | null): boolean {\n // Simplified implementation\n return namespace === null || namespace === 'http://www.w3.org/1999/xhtml';\n }\n\n lookupNamespaceURI(prefix: string | null): string | null {\n // Simplified implementation\n if (prefix === null || prefix === '') {\n return 'http://www.w3.org/1999/xhtml';\n }\n return null;\n }\n\n lookupPrefix(namespace: string | null): string | null {\n // Simplified implementation\n return null;\n }\n\n normalize(): void {\n // Merge adjacent text nodes\n for (let i = this._childNodesInternal.length - 1; i >= 0; i--) {\n const child = this._childNodesInternal[i];\n if (child && child.nodeType === TEXT_NODE) {\n const nextSibling = child.nextSibling;\n if (nextSibling && nextSibling.nodeType === TEXT_NODE) {\n child.nodeValue = (child.nodeValue || '') + (nextSibling.nodeValue || '');\n this.removeChild(nextSibling);\n }\n }\n }\n }\n\n // Helper methods\n private _findIndexInParent(): number {\n if (!this._parentNodeInternal) return -1;\n return this._parentNodeInternal._childNodesInternal.indexOf(this);\n }\n\n private _findChildIndex(child: NodeBase): number {\n return this._childNodesInternal.indexOf(child);\n }\n\n private _getAncestors(): NodeBase[] {\n const ancestors: NodeBase[] = [];\n let current: NodeBase | null = this._parentNodeInternal;\n while (current) {\n ancestors.push(current);\n current = current._parentNodeInternal;\n }\n return ancestors;\n }\n\n private _getChildInAncestor(ancestor: NodeBase): NodeBase | null {\n let current: NodeBase = this;\n while (current._parentNodeInternal && current._parentNodeInternal !== ancestor) {\n current = current._parentNodeInternal;\n }\n return current._parentNodeInternal === ancestor ? current : null;\n }\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAmBO;AAGP,wBAA2B;AASpB,MAAe,SAAyB;AAAA,EA8C3C,YACoB,UACA,UAChB,eACF;AAHkB;AACA;AARpB;AAAA,SAAU,sBAAkC,CAAC;AAC7C,SAAO,sBAAuC;AAC9C;AAAA,SAAO,iBAAkC;AACzC;AAAA,SAAU,aAA4B;AACtC,SAAU,eAA8B;AAOpC,SAAK,iBAAiB,iBAAiB;AAAA,EAC3C;AAAA;AAAA,EAKA,IAAI,UAAkB;AAClB,WAAO,KAAK,gBAAgB,OAAO;AAAA,EACvC;AAAA;AAAA,EAGA,IAAI,aAAoC;AACpC,WAAO,IAAI,6BAAsB,KAAK,mBAA6C;AAAA,EACvF;AAAA,EAEA,IAAI,aAA+B;AAC/B,WAAO,KAAK,oBAAoB,SAAS,IAAI,KAAK,oBAAoB,CAAC,IAA4B;AAAA,EACvG;AAAA,EAEA,IAAI,YAA8B;AAC9B,UAAM,SAAS,KAAK,oBAAoB;AACxC,WAAO,SAAS,IAAI,KAAK,oBAAoB,SAAS,CAAC,IAA4B;AAAA,EACvF;AAAA,EAEA,IAAI,cAAgC;AAChC,QAAI,CAAC,KAAK,oBAAqB,QAAO;AACtC,UAAM,WAAW,KAAK,oBAAoB;AAC1C,UAAM,QAAQ,KAAK,mBAAmB;AACtC,WAAO,UAAU,MAAM,QAAQ,SAAS,SAAS,IAAI,SAAS,QAAQ,CAAC,IAA4B;AAAA,EACvG;AAAA,EAEA,IAAI,kBAAoC;AACpC,QAAI,CAAC,KAAK,oBAAqB,QAAO;AACtC,UAAM,WAAW,KAAK,oBAAoB;AAC1C,UAAM,QAAQ,KAAK,mBA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3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var NodeIterator_exports = {};
19
+ __export(NodeIterator_exports, {
20
+ NodeFilter: () => NodeFilter,
21
+ NodeIterator: () => NodeIterator
22
+ });
23
+ module.exports = __toCommonJS(NodeIterator_exports);
24
+ const NodeFilter = {
25
+ // Constants for acceptNode return values
26
+ FILTER_ACCEPT: 1,
27
+ FILTER_REJECT: 2,
28
+ FILTER_SKIP: 3,
29
+ // Constants for whatToShow
30
+ SHOW_ALL: 4294967295,
31
+ SHOW_ELEMENT: 1,
32
+ SHOW_ATTRIBUTE: 2,
33
+ SHOW_TEXT: 4,
34
+ SHOW_CDATA_SECTION: 8,
35
+ SHOW_ENTITY_REFERENCE: 16,
36
+ SHOW_ENTITY: 32,
37
+ SHOW_PROCESSING_INSTRUCTION: 64,
38
+ SHOW_COMMENT: 128,
39
+ SHOW_DOCUMENT: 256,
40
+ SHOW_DOCUMENT_TYPE: 512,
41
+ SHOW_DOCUMENT_FRAGMENT: 1024,
42
+ SHOW_NOTATION: 2048
43
+ };
44
+ class NodeIterator {
45
+ constructor(root, whatToShow = NodeFilter.SHOW_ALL, filter = null) {
46
+ this._beforeReferenceNode = true;
47
+ this._root = root;
48
+ this._whatToShow = whatToShow;
49
+ this._filter = filter;
50
+ this._currentNode = root;
51
+ }
52
+ get root() {
53
+ return this._root;
54
+ }
55
+ get whatToShow() {
56
+ return this._whatToShow;
57
+ }
58
+ get filter() {
59
+ return this._filter;
60
+ }
61
+ get referenceNode() {
62
+ return this._currentNode;
63
+ }
64
+ get pointerBeforeReferenceNode() {
65
+ return this._beforeReferenceNode;
66
+ }
67
+ /**
68
+ * Move to the next node in document order
69
+ */
70
+ nextNode() {
71
+ let node = this._currentNode;
72
+ if (this._beforeReferenceNode) {
73
+ this._beforeReferenceNode = false;
74
+ if (this._acceptNode(node)) {
75
+ return node;
76
+ }
77
+ }
78
+ while (node) {
79
+ const firstChild = node.firstChild;
80
+ if (firstChild) {
81
+ node = firstChild;
82
+ if (this._acceptNode(node)) {
83
+ this._currentNode = node;
84
+ return node;
85
+ }
86
+ continue;
87
+ }
88
+ while (node && !node.nextSibling) {
89
+ node = node.parentNode;
90
+ if (!node || node === this._root.parentNode) {
91
+ return null;
92
+ }
93
+ }
94
+ if (!node) {
95
+ return null;
96
+ }
97
+ node = node.nextSibling;
98
+ if (this._acceptNode(node)) {
99
+ this._currentNode = node;
100
+ return node;
101
+ }
102
+ }
103
+ return null;
104
+ }
105
+ /**
106
+ * Move to the previous node in document order
107
+ */
108
+ previousNode() {
109
+ let node = this._currentNode;
110
+ if (!this._beforeReferenceNode) {
111
+ this._beforeReferenceNode = true;
112
+ if (this._acceptNode(node)) {
113
+ return node;
114
+ }
115
+ }
116
+ while (node && node !== this._root) {
117
+ const prevSibling = node.previousSibling;
118
+ if (prevSibling) {
119
+ node = prevSibling;
120
+ while (node.lastChild) {
121
+ node = node.lastChild;
122
+ }
123
+ if (this._acceptNode(node)) {
124
+ this._currentNode = node;
125
+ return node;
126
+ }
127
+ continue;
128
+ }
129
+ node = node.parentNode;
130
+ if (!node || node === this._root.parentNode) {
131
+ return null;
132
+ }
133
+ if (this._acceptNode(node)) {
134
+ this._currentNode = node;
135
+ return node;
136
+ }
137
+ }
138
+ return null;
139
+ }
140
+ /**
141
+ * Detach the iterator (no-op in this implementation)
142
+ */
143
+ detach() {
144
+ }
145
+ /**
146
+ * Check if a node should be accepted based on whatToShow and filter
147
+ */
148
+ _acceptNode(node) {
149
+ if (!node) {
150
+ return false;
151
+ }
152
+ const nodeTypeMask = 1 << node.nodeType - 1;
153
+ if (!(this._whatToShow & nodeTypeMask)) {
154
+ return false;
155
+ }
156
+ if (this._filter) {
157
+ const result = this._filter.acceptNode(node);
158
+ return result === NodeFilter.FILTER_ACCEPT;
159
+ }
160
+ return true;
161
+ }
162
+ }
163
+ //# sourceMappingURL=NodeIterator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/node/NodeIterator.ts"],
4
+ "sourcesContent": ["import { Node } from './Node';\nimport { NodeBase } from './NodeBase';\n\n/**\n * NodeFilter interface for filtering nodes in NodeIterator\n */\nexport interface NodeFilter {\n acceptNode(node: Node): number;\n}\n\n/**\n * NodeFilter constants\n */\nexport const NodeFilter = {\n // Constants for acceptNode return values\n FILTER_ACCEPT: 1,\n FILTER_REJECT: 2,\n FILTER_SKIP: 3,\n \n // Constants for whatToShow\n SHOW_ALL: 0xFFFFFFFF,\n SHOW_ELEMENT: 0x1,\n SHOW_ATTRIBUTE: 0x2,\n SHOW_TEXT: 0x4,\n SHOW_CDATA_SECTION: 0x8,\n SHOW_ENTITY_REFERENCE: 0x10,\n SHOW_ENTITY: 0x20,\n SHOW_PROCESSING_INSTRUCTION: 0x40,\n SHOW_COMMENT: 0x80,\n SHOW_DOCUMENT: 0x100,\n SHOW_DOCUMENT_TYPE: 0x200,\n SHOW_DOCUMENT_FRAGMENT: 0x400,\n SHOW_NOTATION: 0x800\n};\n\n/**\n * NodeIterator implementation for traversing DOM nodes\n */\nexport class NodeIterator {\n private _root: Node;\n private _whatToShow: number;\n private _filter: NodeFilter | null;\n private _currentNode: Node;\n private _beforeReferenceNode: boolean = true;\n\n constructor(root: Node, whatToShow: number = NodeFilter.SHOW_ALL, filter: NodeFilter | null = null) {\n this._root = root;\n this._whatToShow = whatToShow;\n this._filter = filter;\n this._currentNode = root;\n }\n\n get root(): Node {\n return this._root;\n }\n\n get whatToShow(): number {\n return this._whatToShow;\n }\n\n get filter(): NodeFilter | null {\n return this._filter;\n }\n\n get referenceNode(): Node {\n return this._currentNode;\n }\n\n get pointerBeforeReferenceNode(): boolean {\n return this._beforeReferenceNode;\n }\n\n /**\n * Move to the next node in document order\n */\n nextNode(): Node | null {\n let node = this._currentNode;\n \n // If we're before the reference node, start from the reference node\n if (this._beforeReferenceNode) {\n this._beforeReferenceNode = false;\n if (this._acceptNode(node)) {\n return node;\n }\n }\n\n // Traverse in document order\n while (node) {\n // First, try to go to first child\n const firstChild = (node as any).firstChild;\n if (firstChild) {\n node = firstChild;\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n continue;\n }\n\n // If no children, try next sibling\n while (node && !(node as any).nextSibling) {\n node = (node as any).parentNode;\n // Don't go beyond root\n if (!node || node === (this._root as any).parentNode) {\n return null;\n }\n }\n\n if (!node) {\n return null;\n }\n\n node = (node as any).nextSibling;\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n }\n\n return null;\n }\n\n /**\n * Move to the previous node in document order\n */\n previousNode(): Node | null {\n let node = this._currentNode;\n\n // If we're after the reference node, start from the reference node\n if (!this._beforeReferenceNode) {\n this._beforeReferenceNode = true;\n if (this._acceptNode(node)) {\n return node;\n }\n }\n\n // Traverse in reverse document order\n while (node && node !== this._root) {\n // Try previous sibling\n const prevSibling = (node as any).previousSibling;\n if (prevSibling) {\n node = prevSibling;\n \n // Go to the deepest last child\n while ((node as any).lastChild) {\n node = (node as any).lastChild;\n }\n \n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n continue;\n }\n\n // Go to parent\n node = (node as any).parentNode;\n if (!node || node === (this._root as any).parentNode) {\n return null;\n }\n\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n }\n\n return null;\n }\n\n /**\n * Detach the iterator (no-op in this implementation)\n */\n detach(): void {\n // Modern browsers don't require this, but we implement for compatibility\n }\n\n /**\n * Check if a node should be accepted based on whatToShow and filter\n */\n private _acceptNode(node: Node | null): boolean {\n if (!node) {\n return false;\n }\n\n // Check whatToShow filter\n const nodeTypeMask = 1 << (node.nodeType - 1);\n if (!(this._whatToShow & nodeTypeMask)) {\n return false;\n }\n\n // Check custom filter\n if (this._filter) {\n const result = this._filter.acceptNode(node);\n return result === NodeFilter.FILTER_ACCEPT;\n }\n\n return true;\n }\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,MAAM,aAAa;AAAA;AAAA,EAEtB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA;AAAA,EAGb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,6BAA6B;AAAA,EAC7B,cAAc;AAAA,EACd,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,eAAe;AACnB;AAKO,MAAM,aAAa;AAAA,EAOtB,YAAY,MAAY,aAAqB,WAAW,UAAU,SAA4B,MAAM;AAFpG,SAAQ,uBAAgC;AAGpC,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,UAAU;AACf,SAAK,eAAe;AAAA,EACxB;AAAA,EAEA,IAAI,OAAa;AACb,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,aAAqB;AACrB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,SAA4B;AAC5B,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,gBAAsB;AACtB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,6BAAsC;AACtC,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,WAAwB;AACpB,QAAI,OAAO,KAAK;AAGhB,QAAI,KAAK,s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