@pokash/n8n-nodes-ksef 0.2.15 → 0.2.16

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 (645) hide show
  1. package/node_modules/@oozcitak/dom/LICENSE +21 -0
  2. package/node_modules/@oozcitak/dom/README.md +32 -0
  3. package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.d.ts +21 -0
  4. package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js +79 -0
  5. package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js.map +1 -0
  6. package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.d.ts +8 -0
  7. package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js +23 -0
  8. package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js.map +1 -0
  9. package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.d.ts +8 -0
  10. package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js +76 -0
  11. package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js.map +1 -0
  12. package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.d.ts +19 -0
  13. package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js +140 -0
  14. package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js.map +1 -0
  15. package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.d.ts +192 -0
  16. package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js +303 -0
  17. package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js.map +1 -0
  18. package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.d.ts +61 -0
  19. package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js +108 -0
  20. package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js.map +1 -0
  21. package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.d.ts +72 -0
  22. package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js +288 -0
  23. package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js.map +1 -0
  24. package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.d.ts +21 -0
  25. package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js +61 -0
  26. package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js.map +1 -0
  27. package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.d.ts +29 -0
  28. package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js +161 -0
  29. package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js.map +1 -0
  30. package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.d.ts +121 -0
  31. package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js +608 -0
  32. package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js.map +1 -0
  33. package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.d.ts +146 -0
  34. package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js +995 -0
  35. package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js.map +1 -0
  36. package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.d.ts +33 -0
  37. package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js +142 -0
  38. package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js.map +1 -0
  39. package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.d.ts +66 -0
  40. package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js +1173 -0
  41. package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js.map +1 -0
  42. package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.d.ts +43 -0
  43. package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js +276 -0
  44. package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js.map +1 -0
  45. package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.d.ts +25 -0
  46. package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js +85 -0
  47. package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js.map +1 -0
  48. package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.d.ts +68 -0
  49. package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js +543 -0
  50. package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js.map +1 -0
  51. package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.d.ts +15 -0
  52. package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js +105 -0
  53. package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js.map +1 -0
  54. package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.d.ts +27 -0
  55. package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js +125 -0
  56. package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js.map +1 -0
  57. package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.d.ts +9 -0
  58. package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js +69 -0
  59. package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js.map +1 -0
  60. package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.d.ts +82 -0
  61. package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js +829 -0
  62. package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js.map +1 -0
  63. package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.d.ts +8 -0
  64. package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js +21 -0
  65. package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js.map +1 -0
  66. package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.d.ts +57 -0
  67. package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js +316 -0
  68. package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js.map +1 -0
  69. package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.d.ts +30 -0
  70. package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js +226 -0
  71. package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js.map +1 -0
  72. package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.d.ts +8 -0
  73. package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js +62 -0
  74. package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js.map +1 -0
  75. package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.d.ts +268 -0
  76. package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js +853 -0
  77. package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js.map +1 -0
  78. package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.d.ts +17 -0
  79. package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js +147 -0
  80. package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js.map +1 -0
  81. package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.d.ts +8 -0
  82. package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js +14 -0
  83. package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js.map +1 -0
  84. package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.d.ts +25 -0
  85. package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js +164 -0
  86. package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js.map +1 -0
  87. package/node_modules/@oozcitak/dom/lib/algorithm/index.d.ts +28 -0
  88. package/node_modules/@oozcitak/dom/lib/algorithm/index.js +34 -0
  89. package/node_modules/@oozcitak/dom/lib/algorithm/index.js.map +1 -0
  90. package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.d.ts +15 -0
  91. package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js +32 -0
  92. package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js.map +1 -0
  93. package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.d.ts +23 -0
  94. package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js +59 -0
  95. package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js.map +1 -0
  96. package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.d.ts +23 -0
  97. package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js +70 -0
  98. package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js.map +1 -0
  99. package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.d.ts +45 -0
  100. package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js +118 -0
  101. package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js.map +1 -0
  102. package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.d.ts +21 -0
  103. package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js +51 -0
  104. package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js.map +1 -0
  105. package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.d.ts +35 -0
  106. package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js +132 -0
  107. package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js.map +1 -0
  108. package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.d.ts +16 -0
  109. package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js +165 -0
  110. package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js.map +1 -0
  111. package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.d.ts +21 -0
  112. package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js +52 -0
  113. package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js.map +1 -0
  114. package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.d.ts +16 -0
  115. package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js +60 -0
  116. package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js.map +1 -0
  117. package/node_modules/@oozcitak/dom/lib/dom/DOMException.d.ts +171 -0
  118. package/node_modules/@oozcitak/dom/lib/dom/DOMException.js +347 -0
  119. package/node_modules/@oozcitak/dom/lib/dom/DOMException.js.map +1 -0
  120. package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.d.ts +48 -0
  121. package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js +100 -0
  122. package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js.map +1 -0
  123. package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.d.ts +29 -0
  124. package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js +149 -0
  125. package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js.map +1 -0
  126. package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.d.ts +46 -0
  127. package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js +312 -0
  128. package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js.map +1 -0
  129. package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.d.ts +32 -0
  130. package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js +103 -0
  131. package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js.map +1 -0
  132. package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.d.ts +116 -0
  133. package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js +545 -0
  134. package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js.map +1 -0
  135. package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.d.ts +11 -0
  136. package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js +17 -0
  137. package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js.map +1 -0
  138. package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.d.ts +39 -0
  139. package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js +109 -0
  140. package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js.map +1 -0
  141. package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.d.ts +132 -0
  142. package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js +714 -0
  143. package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js.map +1 -0
  144. package/node_modules/@oozcitak/dom/lib/dom/EventImpl.d.ts +74 -0
  145. package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js +313 -0
  146. package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js.map +1 -0
  147. package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.d.ts +30 -0
  148. package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js +133 -0
  149. package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js.map +1 -0
  150. package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.d.ts +44 -0
  151. package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js +157 -0
  152. package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js.map +1 -0
  153. package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.d.ts +22 -0
  154. package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js +184 -0
  155. package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js.map +1 -0
  156. package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.d.ts +73 -0
  157. package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js +116 -0
  158. package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js.map +1 -0
  159. package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.d.ts +34 -0
  160. package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js +112 -0
  161. package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js.map +1 -0
  162. package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.d.ts +50 -0
  163. package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js +64 -0
  164. package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js.map +1 -0
  165. package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.d.ts +252 -0
  166. package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js +891 -0
  167. package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js.map +1 -0
  168. package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.d.ts +34 -0
  169. package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js +86 -0
  170. package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js.map +1 -0
  171. package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.d.ts +46 -0
  172. package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js +198 -0
  173. package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js.map +1 -0
  174. package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.d.ts +49 -0
  175. package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js +188 -0
  176. package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js.map +1 -0
  177. package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.d.ts +12 -0
  178. package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js +53 -0
  179. package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js.map +1 -0
  180. package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.d.ts +9 -0
  181. package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js +31 -0
  182. package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js.map +1 -0
  183. package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.d.ts +24 -0
  184. package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js +158 -0
  185. package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js.map +1 -0
  186. package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.d.ts +25 -0
  187. package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js +59 -0
  188. package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js.map +1 -0
  189. package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.d.ts +71 -0
  190. package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js +649 -0
  191. package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js.map +1 -0
  192. package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.d.ts +33 -0
  193. package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js +82 -0
  194. package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js.map +1 -0
  195. package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.d.ts +16 -0
  196. package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js +35 -0
  197. package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js.map +1 -0
  198. package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.d.ts +13 -0
  199. package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js +48 -0
  200. package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js.map +1 -0
  201. package/node_modules/@oozcitak/dom/lib/dom/TextImpl.d.ts +28 -0
  202. package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js +109 -0
  203. package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js.map +1 -0
  204. package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.d.ts +23 -0
  205. package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js +41 -0
  206. package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js.map +1 -0
  207. package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.d.ts +36 -0
  208. package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js +249 -0
  209. package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js.map +1 -0
  210. package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.d.ts +26 -0
  211. package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js +57 -0
  212. package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js.map +1 -0
  213. package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.d.ts +11 -0
  214. package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js +31 -0
  215. package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js.map +1 -0
  216. package/node_modules/@oozcitak/dom/lib/dom/index.d.ts +36 -0
  217. package/node_modules/@oozcitak/dom/lib/dom/index.js +102 -0
  218. package/node_modules/@oozcitak/dom/lib/dom/index.js.map +1 -0
  219. package/node_modules/@oozcitak/dom/lib/dom/interfaces.d.ts +2218 -0
  220. package/node_modules/@oozcitak/dom/lib/dom/interfaces.js +91 -0
  221. package/node_modules/@oozcitak/dom/lib/dom/interfaces.js.map +1 -0
  222. package/node_modules/@oozcitak/dom/lib/index.d.ts +3 -0
  223. package/node_modules/@oozcitak/dom/lib/index.js +11 -0
  224. package/node_modules/@oozcitak/dom/lib/index.js.map +1 -0
  225. package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.d.ts +11 -0
  226. package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js +37 -0
  227. package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js.map +1 -0
  228. package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.d.ts +26 -0
  229. package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js +240 -0
  230. package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js.map +1 -0
  231. package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.d.ts +159 -0
  232. package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js +512 -0
  233. package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js.map +1 -0
  234. package/node_modules/@oozcitak/dom/lib/parser/index.d.ts +1 -0
  235. package/node_modules/@oozcitak/dom/lib/parser/index.js +6 -0
  236. package/node_modules/@oozcitak/dom/lib/parser/index.js.map +1 -0
  237. package/node_modules/@oozcitak/dom/lib/parser/interfaces.d.ts +131 -0
  238. package/node_modules/@oozcitak/dom/lib/parser/interfaces.js +18 -0
  239. package/node_modules/@oozcitak/dom/lib/parser/interfaces.js.map +1 -0
  240. package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.d.ts +27 -0
  241. package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js +56 -0
  242. package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js.map +1 -0
  243. package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.d.ts +52 -0
  244. package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js +151 -0
  245. package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js.map +1 -0
  246. package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.d.ts +166 -0
  247. package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js +1479 -0
  248. package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js.map +1 -0
  249. package/node_modules/@oozcitak/dom/lib/serializer/index.d.ts +1 -0
  250. package/node_modules/@oozcitak/dom/lib/serializer/index.js +6 -0
  251. package/node_modules/@oozcitak/dom/lib/serializer/index.js.map +1 -0
  252. package/node_modules/@oozcitak/dom/lib/serializer/interfaces.d.ts +15 -0
  253. package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js +3 -0
  254. package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js.map +1 -0
  255. package/node_modules/@oozcitak/dom/lib/util/Cast.d.ts +12 -0
  256. package/node_modules/@oozcitak/dom/lib/util/Cast.js +26 -0
  257. package/node_modules/@oozcitak/dom/lib/util/Cast.js.map +1 -0
  258. package/node_modules/@oozcitak/dom/lib/util/EmptySet.d.ts +13 -0
  259. package/node_modules/@oozcitak/dom/lib/util/EmptySet.js +61 -0
  260. package/node_modules/@oozcitak/dom/lib/util/EmptySet.js.map +1 -0
  261. package/node_modules/@oozcitak/dom/lib/util/Guard.d.ts +135 -0
  262. package/node_modules/@oozcitak/dom/lib/util/Guard.js +192 -0
  263. package/node_modules/@oozcitak/dom/lib/util/Guard.js.map +1 -0
  264. package/node_modules/@oozcitak/dom/lib/util/index.d.ts +3 -0
  265. package/node_modules/@oozcitak/dom/lib/util/index.js +9 -0
  266. package/node_modules/@oozcitak/dom/lib/util/index.js.map +1 -0
  267. package/node_modules/@oozcitak/dom/package.json +72 -0
  268. package/node_modules/@oozcitak/infra/LICENSE +21 -0
  269. package/node_modules/@oozcitak/infra/README.md +13 -0
  270. package/node_modules/@oozcitak/infra/lib/Base64.d.ts +12 -0
  271. package/node_modules/@oozcitak/infra/lib/Base64.js +82 -0
  272. package/node_modules/@oozcitak/infra/lib/Base64.js.map +1 -0
  273. package/node_modules/@oozcitak/infra/lib/Byte.d.ts +6 -0
  274. package/node_modules/@oozcitak/infra/lib/Byte.js +15 -0
  275. package/node_modules/@oozcitak/infra/lib/Byte.js.map +1 -0
  276. package/node_modules/@oozcitak/infra/lib/ByteSequence.d.ts +45 -0
  277. package/node_modules/@oozcitak/infra/lib/ByteSequence.js +171 -0
  278. package/node_modules/@oozcitak/infra/lib/ByteSequence.js.map +1 -0
  279. package/node_modules/@oozcitak/infra/lib/CodePoints.d.ts +82 -0
  280. package/node_modules/@oozcitak/infra/lib/CodePoints.js +85 -0
  281. package/node_modules/@oozcitak/infra/lib/CodePoints.js.map +1 -0
  282. package/node_modules/@oozcitak/infra/lib/JSON.d.ts +24 -0
  283. package/node_modules/@oozcitak/infra/lib/JSON.js +123 -0
  284. package/node_modules/@oozcitak/infra/lib/JSON.js.map +1 -0
  285. package/node_modules/@oozcitak/infra/lib/List.d.ts +101 -0
  286. package/node_modules/@oozcitak/infra/lib/List.js +325 -0
  287. package/node_modules/@oozcitak/infra/lib/List.js.map +1 -0
  288. package/node_modules/@oozcitak/infra/lib/Map.d.ts +87 -0
  289. package/node_modules/@oozcitak/infra/lib/Map.js +308 -0
  290. package/node_modules/@oozcitak/infra/lib/Map.js.map +1 -0
  291. package/node_modules/@oozcitak/infra/lib/Namespace.d.ts +6 -0
  292. package/node_modules/@oozcitak/infra/lib/Namespace.js +9 -0
  293. package/node_modules/@oozcitak/infra/lib/Namespace.js.map +1 -0
  294. package/node_modules/@oozcitak/infra/lib/Queue.d.ts +13 -0
  295. package/node_modules/@oozcitak/infra/lib/Queue.js +22 -0
  296. package/node_modules/@oozcitak/infra/lib/Queue.js.map +1 -0
  297. package/node_modules/@oozcitak/infra/lib/Set.d.ts +136 -0
  298. package/node_modules/@oozcitak/infra/lib/Set.js +467 -0
  299. package/node_modules/@oozcitak/infra/lib/Set.js.map +1 -0
  300. package/node_modules/@oozcitak/infra/lib/Stack.d.ts +13 -0
  301. package/node_modules/@oozcitak/infra/lib/Stack.js +22 -0
  302. package/node_modules/@oozcitak/infra/lib/Stack.js.map +1 -0
  303. package/node_modules/@oozcitak/infra/lib/String.d.ts +129 -0
  304. package/node_modules/@oozcitak/infra/lib/String.js +472 -0
  305. package/node_modules/@oozcitak/infra/lib/String.js.map +1 -0
  306. package/node_modules/@oozcitak/infra/lib/index.d.ts +13 -0
  307. package/node_modules/@oozcitak/infra/lib/index.js +34 -0
  308. package/node_modules/@oozcitak/infra/lib/index.js.map +1 -0
  309. package/node_modules/@oozcitak/infra/package.json +54 -0
  310. package/node_modules/@oozcitak/url/LICENSE +21 -0
  311. package/node_modules/@oozcitak/url/README.md +27 -0
  312. package/node_modules/@oozcitak/url/lib/URLAlgorithm.d.ts +267 -0
  313. package/node_modules/@oozcitak/url/lib/URLAlgorithm.js +2758 -0
  314. package/node_modules/@oozcitak/url/lib/URLAlgorithm.js.map +1 -0
  315. package/node_modules/@oozcitak/url/lib/URLImpl.d.ts +53 -0
  316. package/node_modules/@oozcitak/url/lib/URLImpl.js +377 -0
  317. package/node_modules/@oozcitak/url/lib/URLImpl.js.map +1 -0
  318. package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.d.ts +38 -0
  319. package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js +303 -0
  320. package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js.map +1 -0
  321. package/node_modules/@oozcitak/url/lib/index.d.ts +2 -0
  322. package/node_modules/@oozcitak/url/lib/index.js +7 -0
  323. package/node_modules/@oozcitak/url/lib/index.js.map +1 -0
  324. package/node_modules/@oozcitak/url/lib/interfaces.d.ts +195 -0
  325. package/node_modules/@oozcitak/url/lib/interfaces.js +31 -0
  326. package/node_modules/@oozcitak/url/lib/interfaces.js.map +1 -0
  327. package/node_modules/@oozcitak/url/package.json +55 -0
  328. package/node_modules/@oozcitak/util/LICENSE +21 -0
  329. package/node_modules/@oozcitak/util/README.md +10 -0
  330. package/node_modules/@oozcitak/util/lib/CompareCache.d.ts +32 -0
  331. package/node_modules/@oozcitak/util/lib/CompareCache.js +59 -0
  332. package/node_modules/@oozcitak/util/lib/CompareCache.js.map +1 -0
  333. package/node_modules/@oozcitak/util/lib/FixedSizeSet.d.ts +64 -0
  334. package/node_modules/@oozcitak/util/lib/FixedSizeSet.js +174 -0
  335. package/node_modules/@oozcitak/util/lib/FixedSizeSet.js.map +1 -0
  336. package/node_modules/@oozcitak/util/lib/Lazy.d.ts +18 -0
  337. package/node_modules/@oozcitak/util/lib/Lazy.js +34 -0
  338. package/node_modules/@oozcitak/util/lib/Lazy.js.map +1 -0
  339. package/node_modules/@oozcitak/util/lib/ObjectCache.d.ts +71 -0
  340. package/node_modules/@oozcitak/util/lib/ObjectCache.js +181 -0
  341. package/node_modules/@oozcitak/util/lib/ObjectCache.js.map +1 -0
  342. package/node_modules/@oozcitak/util/lib/StringWalker.d.ts +49 -0
  343. package/node_modules/@oozcitak/util/lib/StringWalker.js +105 -0
  344. package/node_modules/@oozcitak/util/lib/StringWalker.js.map +1 -0
  345. package/node_modules/@oozcitak/util/lib/index.d.ts +178 -0
  346. package/node_modules/@oozcitak/util/lib/index.js +439 -0
  347. package/node_modules/@oozcitak/util/lib/index.js.map +1 -0
  348. package/node_modules/@oozcitak/util/package.json +50 -0
  349. package/node_modules/@xmldom/is-dom-node/LICENSE.md +21 -0
  350. package/node_modules/@xmldom/is-dom-node/README.md +91 -0
  351. package/node_modules/@xmldom/is-dom-node/dist/index.d.ts +33 -0
  352. package/node_modules/@xmldom/is-dom-node/dist/index.js +91 -0
  353. package/node_modules/@xmldom/is-dom-node/dist/index.js.map +1 -0
  354. package/node_modules/@xmldom/is-dom-node/package.json +69 -0
  355. package/node_modules/@xmldom/xmldom/CHANGELOG.md +468 -0
  356. package/node_modules/@xmldom/xmldom/LICENSE +8 -0
  357. package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
  358. package/node_modules/@xmldom/xmldom/index.d.ts +43 -0
  359. package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
  360. package/node_modules/@xmldom/xmldom/lib/conventions.js +203 -0
  361. package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
  362. package/node_modules/@xmldom/xmldom/lib/dom.js +1879 -0
  363. package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
  364. package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
  365. package/node_modules/@xmldom/xmldom/lib/sax.js +662 -0
  366. package/node_modules/@xmldom/xmldom/package.json +71 -0
  367. package/node_modules/@xmldom/xmldom/readme.md +356 -0
  368. package/node_modules/esprima/ChangeLog +235 -0
  369. package/node_modules/esprima/LICENSE.BSD +21 -0
  370. package/node_modules/esprima/README.md +46 -0
  371. package/node_modules/esprima/bin/esparse.js +139 -0
  372. package/node_modules/esprima/bin/esvalidate.js +236 -0
  373. package/node_modules/esprima/dist/esprima.js +6709 -0
  374. package/node_modules/esprima/package.json +112 -0
  375. package/node_modules/node-forge/LICENSE +331 -0
  376. package/node_modules/node-forge/README.md +2071 -0
  377. package/node_modules/node-forge/dist/forge.all.min.js +2 -0
  378. package/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
  379. package/node_modules/node-forge/dist/forge.min.js +2 -0
  380. package/node_modules/node-forge/dist/forge.min.js.map +1 -0
  381. package/node_modules/node-forge/dist/prime.worker.min.js +2 -0
  382. package/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
  383. package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
  384. package/node_modules/node-forge/lib/aes.js +1091 -0
  385. package/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
  386. package/node_modules/node-forge/lib/asn1-validator.js +91 -0
  387. package/node_modules/node-forge/lib/asn1.js +1503 -0
  388. package/node_modules/node-forge/lib/baseN.js +186 -0
  389. package/node_modules/node-forge/lib/cipher.js +230 -0
  390. package/node_modules/node-forge/lib/cipherModes.js +999 -0
  391. package/node_modules/node-forge/lib/des.js +496 -0
  392. package/node_modules/node-forge/lib/ed25519.js +1072 -0
  393. package/node_modules/node-forge/lib/forge.js +13 -0
  394. package/node_modules/node-forge/lib/form.js +149 -0
  395. package/node_modules/node-forge/lib/hmac.js +146 -0
  396. package/node_modules/node-forge/lib/http.js +1346 -0
  397. package/node_modules/node-forge/lib/index.all.js +16 -0
  398. package/node_modules/node-forge/lib/index.js +33 -0
  399. package/node_modules/node-forge/lib/jsbn.js +1264 -0
  400. package/node_modules/node-forge/lib/kem.js +168 -0
  401. package/node_modules/node-forge/lib/log.js +319 -0
  402. package/node_modules/node-forge/lib/md.all.js +13 -0
  403. package/node_modules/node-forge/lib/md.js +11 -0
  404. package/node_modules/node-forge/lib/md5.js +289 -0
  405. package/node_modules/node-forge/lib/mgf.js +12 -0
  406. package/node_modules/node-forge/lib/mgf1.js +57 -0
  407. package/node_modules/node-forge/lib/oids.js +179 -0
  408. package/node_modules/node-forge/lib/pbe.js +1023 -0
  409. package/node_modules/node-forge/lib/pbkdf2.js +211 -0
  410. package/node_modules/node-forge/lib/pem.js +237 -0
  411. package/node_modules/node-forge/lib/pkcs1.js +276 -0
  412. package/node_modules/node-forge/lib/pkcs12.js +1078 -0
  413. package/node_modules/node-forge/lib/pkcs7.js +1260 -0
  414. package/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
  415. package/node_modules/node-forge/lib/pki.js +102 -0
  416. package/node_modules/node-forge/lib/prime.js +297 -0
  417. package/node_modules/node-forge/lib/prime.worker.js +168 -0
  418. package/node_modules/node-forge/lib/prng.js +419 -0
  419. package/node_modules/node-forge/lib/pss.js +241 -0
  420. package/node_modules/node-forge/lib/random.js +191 -0
  421. package/node_modules/node-forge/lib/rc2.js +410 -0
  422. package/node_modules/node-forge/lib/rsa.js +1949 -0
  423. package/node_modules/node-forge/lib/sha1.js +319 -0
  424. package/node_modules/node-forge/lib/sha256.js +327 -0
  425. package/node_modules/node-forge/lib/sha512.js +561 -0
  426. package/node_modules/node-forge/lib/socket.js +287 -0
  427. package/node_modules/node-forge/lib/ssh.js +236 -0
  428. package/node_modules/node-forge/lib/tls.js +4282 -0
  429. package/node_modules/node-forge/lib/tlssocket.js +249 -0
  430. package/node_modules/node-forge/lib/util.js +2652 -0
  431. package/node_modules/node-forge/lib/x509.js +3242 -0
  432. package/node_modules/node-forge/lib/xhr.js +738 -0
  433. package/node_modules/node-forge/package.json +123 -0
  434. package/node_modules/sprintf-js/.npmignore +1 -0
  435. package/node_modules/sprintf-js/LICENSE +24 -0
  436. package/node_modules/sprintf-js/README.md +88 -0
  437. package/node_modules/sprintf-js/bower.json +14 -0
  438. package/node_modules/sprintf-js/demo/angular.html +20 -0
  439. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
  440. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
  441. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
  442. package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
  443. package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
  444. package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
  445. package/node_modules/sprintf-js/gruntfile.js +36 -0
  446. package/node_modules/sprintf-js/package.json +22 -0
  447. package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
  448. package/node_modules/sprintf-js/src/sprintf.js +208 -0
  449. package/node_modules/sprintf-js/test/test.js +82 -0
  450. package/node_modules/xml-crypto/LICENSE +22 -0
  451. package/node_modules/xml-crypto/README.md +557 -0
  452. package/node_modules/xml-crypto/lib/c14n-canonicalization.d.ts +39 -0
  453. package/node_modules/xml-crypto/lib/c14n-canonicalization.js +230 -0
  454. package/node_modules/xml-crypto/lib/c14n-canonicalization.js.map +1 -0
  455. package/node_modules/xml-crypto/lib/enveloped-signature.d.ts +7 -0
  456. package/node_modules/xml-crypto/lib/enveloped-signature.js +43 -0
  457. package/node_modules/xml-crypto/lib/enveloped-signature.js.map +1 -0
  458. package/node_modules/xml-crypto/lib/exclusive-canonicalization.d.ts +38 -0
  459. package/node_modules/xml-crypto/lib/exclusive-canonicalization.js +246 -0
  460. package/node_modules/xml-crypto/lib/exclusive-canonicalization.js.map +1 -0
  461. package/node_modules/xml-crypto/lib/hash-algorithms.d.ts +13 -0
  462. package/node_modules/xml-crypto/lib/hash-algorithms.js +47 -0
  463. package/node_modules/xml-crypto/lib/hash-algorithms.js.map +1 -0
  464. package/node_modules/xml-crypto/lib/index.d.ts +5 -0
  465. package/node_modules/xml-crypto/lib/index.js +28 -0
  466. package/node_modules/xml-crypto/lib/index.js.map +1 -0
  467. package/node_modules/xml-crypto/lib/signature-algorithms.d.ts +47 -0
  468. package/node_modules/xml-crypto/lib/signature-algorithms.js +86 -0
  469. package/node_modules/xml-crypto/lib/signature-algorithms.js.map +1 -0
  470. package/node_modules/xml-crypto/lib/signed-xml.d.ts +225 -0
  471. package/node_modules/xml-crypto/lib/signed-xml.js +960 -0
  472. package/node_modules/xml-crypto/lib/signed-xml.js.map +1 -0
  473. package/node_modules/xml-crypto/lib/types.d.ts +125 -0
  474. package/node_modules/xml-crypto/lib/types.js +57 -0
  475. package/node_modules/xml-crypto/lib/types.js.map +1 -0
  476. package/node_modules/xml-crypto/lib/utils.d.ts +65 -0
  477. package/node_modules/xml-crypto/lib/utils.js +256 -0
  478. package/node_modules/xml-crypto/lib/utils.js.map +1 -0
  479. package/node_modules/xml-crypto/node_modules/xpath/LICENSE +22 -0
  480. package/node_modules/xml-crypto/node_modules/xpath/README.md +133 -0
  481. package/node_modules/xml-crypto/node_modules/xpath/docs/XPathEvaluator.md +62 -0
  482. package/node_modules/xml-crypto/node_modules/xpath/docs/XPathResult.md +47 -0
  483. package/node_modules/xml-crypto/node_modules/xpath/docs/function resolvers.md +88 -0
  484. package/node_modules/xml-crypto/node_modules/xpath/docs/namespace resolvers.md +69 -0
  485. package/node_modules/xml-crypto/node_modules/xpath/docs/parsed expressions.md +21 -0
  486. package/node_modules/xml-crypto/node_modules/xpath/docs/variable resolvers.md +89 -0
  487. package/node_modules/xml-crypto/node_modules/xpath/docs/xpath methods.md +39 -0
  488. package/node_modules/xml-crypto/node_modules/xpath/package.json +39 -0
  489. package/node_modules/xml-crypto/node_modules/xpath/test.js +1186 -0
  490. package/node_modules/xml-crypto/node_modules/xpath/xpath.d.ts +51 -0
  491. package/node_modules/xml-crypto/node_modules/xpath/xpath.js +4938 -0
  492. package/node_modules/xml-crypto/package.json +73 -0
  493. package/node_modules/xmlbuilder2/CHANGELOG.md +309 -0
  494. package/node_modules/xmlbuilder2/LICENSE +21 -0
  495. package/node_modules/xmlbuilder2/README.md +183 -0
  496. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.d.ts +236 -0
  497. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js +108 -0
  498. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js.map +1 -0
  499. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.d.ts +17 -0
  500. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js +26 -0
  501. package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js.map +1 -0
  502. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.d.ts +124 -0
  503. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js +782 -0
  504. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js.map +1 -0
  505. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.d.ts +143 -0
  506. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js +841 -0
  507. package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js.map +1 -0
  508. package/node_modules/xmlbuilder2/lib/builder/dom.d.ts +8 -0
  509. package/node_modules/xmlbuilder2/lib/builder/dom.js +67 -0
  510. package/node_modules/xmlbuilder2/lib/builder/dom.js.map +1 -0
  511. package/node_modules/xmlbuilder2/lib/builder/index.d.ts +4 -0
  512. package/node_modules/xmlbuilder2/lib/builder/index.js +15 -0
  513. package/node_modules/xmlbuilder2/lib/builder/index.js.map +1 -0
  514. package/node_modules/xmlbuilder2/lib/constants.d.ts +1 -0
  515. package/node_modules/xmlbuilder2/lib/constants.js +4 -0
  516. package/node_modules/xmlbuilder2/lib/constants.js.map +1 -0
  517. package/node_modules/xmlbuilder2/lib/index.d.ts +1 -0
  518. package/node_modules/xmlbuilder2/lib/index.js +10 -0
  519. package/node_modules/xmlbuilder2/lib/index.js.map +1 -0
  520. package/node_modules/xmlbuilder2/lib/interfaces.d.ts +1355 -0
  521. package/node_modules/xmlbuilder2/lib/interfaces.js +76 -0
  522. package/node_modules/xmlbuilder2/lib/interfaces.js.map +1 -0
  523. package/node_modules/xmlbuilder2/lib/readers/BaseReader.d.ts +109 -0
  524. package/node_modules/xmlbuilder2/lib/readers/BaseReader.js +167 -0
  525. package/node_modules/xmlbuilder2/lib/readers/BaseReader.js.map +1 -0
  526. package/node_modules/xmlbuilder2/lib/readers/JSONReader.d.ts +14 -0
  527. package/node_modules/xmlbuilder2/lib/readers/JSONReader.js +38 -0
  528. package/node_modules/xmlbuilder2/lib/readers/JSONReader.js.map +1 -0
  529. package/node_modules/xmlbuilder2/lib/readers/ObjectReader.d.ts +15 -0
  530. package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js +168 -0
  531. package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js.map +1 -0
  532. package/node_modules/xmlbuilder2/lib/readers/XMLReader.d.ts +14 -0
  533. package/node_modules/xmlbuilder2/lib/readers/XMLReader.js +206 -0
  534. package/node_modules/xmlbuilder2/lib/readers/XMLReader.js.map +1 -0
  535. package/node_modules/xmlbuilder2/lib/readers/YAMLReader.d.ts +14 -0
  536. package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js +44 -0
  537. package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js.map +1 -0
  538. package/node_modules/xmlbuilder2/lib/readers/index.d.ts +4 -0
  539. package/node_modules/xmlbuilder2/lib/readers/index.js +11 -0
  540. package/node_modules/xmlbuilder2/lib/readers/index.js.map +1 -0
  541. package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.d.ts +110 -0
  542. package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js +23 -0
  543. package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js.map +1 -0
  544. package/node_modules/xmlbuilder2/lib/writers/BaseWriter.d.ts +276 -0
  545. package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js +1603 -0
  546. package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js.map +1 -0
  547. package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.d.ts +68 -0
  548. package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js +172 -0
  549. package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js.map +1 -0
  550. package/node_modules/xmlbuilder2/lib/writers/JSONWriter.d.ts +67 -0
  551. package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js +222 -0
  552. package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js.map +1 -0
  553. package/node_modules/xmlbuilder2/lib/writers/MapWriter.d.ts +27 -0
  554. package/node_modules/xmlbuilder2/lib/writers/MapWriter.js +84 -0
  555. package/node_modules/xmlbuilder2/lib/writers/MapWriter.js.map +1 -0
  556. package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.d.ts +56 -0
  557. package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js +483 -0
  558. package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js.map +1 -0
  559. package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.d.ts +51 -0
  560. package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js +165 -0
  561. package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js.map +1 -0
  562. package/node_modules/xmlbuilder2/lib/writers/XMLWriter.d.ts +60 -0
  563. package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js +236 -0
  564. package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js.map +1 -0
  565. package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.d.ts +61 -0
  566. package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js +161 -0
  567. package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js.map +1 -0
  568. package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.d.ts +55 -0
  569. package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js +186 -0
  570. package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js.map +1 -0
  571. package/node_modules/xmlbuilder2/lib/writers/index.d.ts +5 -0
  572. package/node_modules/xmlbuilder2/lib/writers/index.js +13 -0
  573. package/node_modules/xmlbuilder2/lib/writers/index.js.map +1 -0
  574. package/node_modules/xmlbuilder2/lib/xmlbuilder2.min.js +8 -0
  575. package/node_modules/xmlbuilder2/node_modules/argparse/CHANGELOG.md +185 -0
  576. package/node_modules/xmlbuilder2/node_modules/argparse/LICENSE +21 -0
  577. package/node_modules/xmlbuilder2/node_modules/argparse/README.md +257 -0
  578. package/node_modules/xmlbuilder2/node_modules/argparse/index.js +3 -0
  579. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append/constant.js +47 -0
  580. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append.js +53 -0
  581. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/count.js +40 -0
  582. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/help.js +47 -0
  583. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/constant.js +43 -0
  584. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/false.js +27 -0
  585. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/true.js +26 -0
  586. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store.js +50 -0
  587. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/subparsers.js +149 -0
  588. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/version.js +47 -0
  589. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action.js +146 -0
  590. package/node_modules/xmlbuilder2/node_modules/argparse/lib/action_container.js +482 -0
  591. package/node_modules/xmlbuilder2/node_modules/argparse/lib/argparse.js +14 -0
  592. package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/error.js +50 -0
  593. package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/exclusive.js +54 -0
  594. package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/group.js +75 -0
  595. package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument_parser.js +1161 -0
  596. package/node_modules/xmlbuilder2/node_modules/argparse/lib/const.js +21 -0
  597. package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/added_formatters.js +87 -0
  598. package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/formatter.js +795 -0
  599. package/node_modules/xmlbuilder2/node_modules/argparse/lib/namespace.js +76 -0
  600. package/node_modules/xmlbuilder2/node_modules/argparse/lib/utils.js +57 -0
  601. package/node_modules/xmlbuilder2/node_modules/argparse/package.json +34 -0
  602. package/node_modules/xmlbuilder2/node_modules/js-yaml/CHANGELOG.md +557 -0
  603. package/node_modules/xmlbuilder2/node_modules/js-yaml/LICENSE +21 -0
  604. package/node_modules/xmlbuilder2/node_modules/js-yaml/README.md +299 -0
  605. package/node_modules/xmlbuilder2/node_modules/js-yaml/bin/js-yaml.js +132 -0
  606. package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.js +3989 -0
  607. package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
  608. package/node_modules/xmlbuilder2/node_modules/js-yaml/index.js +7 -0
  609. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
  610. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
  611. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
  612. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
  613. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
  614. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  615. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  616. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  617. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  618. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  619. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
  620. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
  621. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
  622. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
  623. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
  624. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
  625. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
  626. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  627. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  628. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  629. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
  630. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
  631. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
  632. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  633. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
  634. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  635. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
  636. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  637. package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml.js +39 -0
  638. package/node_modules/xmlbuilder2/node_modules/js-yaml/package.json +49 -0
  639. package/node_modules/xmlbuilder2/package.json +82 -0
  640. package/node_modules/xpath/LICENSE +22 -0
  641. package/node_modules/xpath/README.md +133 -0
  642. package/node_modules/xpath/package.json +43 -0
  643. package/node_modules/xpath/xpath.d.ts +51 -0
  644. package/node_modules/xpath/xpath.js +5041 -0
  645. package/package.json +9 -2
@@ -0,0 +1,1879 @@
1
+ var conventions = require("./conventions");
2
+
3
+ var find = conventions.find;
4
+ var NAMESPACE = conventions.NAMESPACE;
5
+
6
+ /**
7
+ * A prerequisite for `[].filter`, to drop elements that are empty
8
+ * @param {string} input
9
+ * @returns {boolean}
10
+ */
11
+ function notEmptyString (input) {
12
+ return input !== ''
13
+ }
14
+ /**
15
+ * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
16
+ * @see https://infra.spec.whatwg.org/#ascii-whitespace
17
+ *
18
+ * @param {string} input
19
+ * @returns {string[]} (can be empty)
20
+ */
21
+ function splitOnASCIIWhitespace(input) {
22
+ // U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE
23
+ return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []
24
+ }
25
+
26
+ /**
27
+ * Adds element as a key to current if it is not already present.
28
+ *
29
+ * @param {Record<string, boolean | undefined>} current
30
+ * @param {string} element
31
+ * @returns {Record<string, boolean | undefined>}
32
+ */
33
+ function orderedSetReducer (current, element) {
34
+ if (!current.hasOwnProperty(element)) {
35
+ current[element] = true;
36
+ }
37
+ return current;
38
+ }
39
+
40
+ /**
41
+ * @see https://infra.spec.whatwg.org/#ordered-set
42
+ * @param {string} input
43
+ * @returns {string[]}
44
+ */
45
+ function toOrderedSet(input) {
46
+ if (!input) return [];
47
+ var list = splitOnASCIIWhitespace(input);
48
+ return Object.keys(list.reduce(orderedSetReducer, {}))
49
+ }
50
+
51
+ /**
52
+ * Uses `list.indexOf` to implement something like `Array.prototype.includes`,
53
+ * which we can not rely on being available.
54
+ *
55
+ * @param {any[]} list
56
+ * @returns {function(any): boolean}
57
+ */
58
+ function arrayIncludes (list) {
59
+ return function(element) {
60
+ return list && list.indexOf(element) !== -1;
61
+ }
62
+ }
63
+
64
+ function copy(src,dest){
65
+ for(var p in src){
66
+ if (Object.prototype.hasOwnProperty.call(src, p)) {
67
+ dest[p] = src[p];
68
+ }
69
+ }
70
+ }
71
+
72
+ /**
73
+ ^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
74
+ ^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
75
+ */
76
+ function _extends(Class,Super){
77
+ var pt = Class.prototype;
78
+ if(!(pt instanceof Super)){
79
+ function t(){};
80
+ t.prototype = Super.prototype;
81
+ t = new t();
82
+ copy(pt,t);
83
+ Class.prototype = pt = t;
84
+ }
85
+ if(pt.constructor != Class){
86
+ if(typeof Class != 'function'){
87
+ console.error("unknown Class:"+Class)
88
+ }
89
+ pt.constructor = Class
90
+ }
91
+ }
92
+
93
+ // Node Types
94
+ var NodeType = {}
95
+ var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
96
+ var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
97
+ var TEXT_NODE = NodeType.TEXT_NODE = 3;
98
+ var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
99
+ var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
100
+ var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
101
+ var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
102
+ var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
103
+ var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
104
+ var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
105
+ var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
106
+ var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
107
+
108
+ // ExceptionCode
109
+ var ExceptionCode = {}
110
+ var ExceptionMessage = {};
111
+ var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
112
+ var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
113
+ var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
114
+ var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
115
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
116
+ var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
117
+ var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
118
+ var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
119
+ var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
120
+ var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
121
+ //level2
122
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
123
+ var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
124
+ var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
125
+ var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
126
+ var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
127
+
128
+ /**
129
+ * DOM Level 2
130
+ * Object DOMException
131
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
132
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
133
+ */
134
+ function DOMException(code, message) {
135
+ if(message instanceof Error){
136
+ var error = message;
137
+ }else{
138
+ error = this;
139
+ Error.call(this, ExceptionMessage[code]);
140
+ this.message = ExceptionMessage[code];
141
+ if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
142
+ }
143
+ error.code = code;
144
+ if(message) this.message = this.message + ": " + message;
145
+ return error;
146
+ };
147
+ DOMException.prototype = Error.prototype;
148
+ copy(ExceptionCode,DOMException)
149
+
150
+ /**
151
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
152
+ * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
153
+ * The items in the NodeList are accessible via an integral index, starting from 0.
154
+ */
155
+ function NodeList() {
156
+ };
157
+ NodeList.prototype = {
158
+ /**
159
+ * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
160
+ * @standard level1
161
+ */
162
+ length:0,
163
+ /**
164
+ * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
165
+ * @standard level1
166
+ * @param index unsigned long
167
+ * Index into the collection.
168
+ * @return Node
169
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
170
+ */
171
+ item: function(index) {
172
+ return index >= 0 && index < this.length ? this[index] : null;
173
+ },
174
+ toString:function(isHTML,nodeFilter){
175
+ for(var buf = [], i = 0;i<this.length;i++){
176
+ serializeToString(this[i],buf,isHTML,nodeFilter);
177
+ }
178
+ return buf.join('');
179
+ },
180
+ /**
181
+ * @private
182
+ * @param {function (Node):boolean} predicate
183
+ * @returns {Node[]}
184
+ */
185
+ filter: function (predicate) {
186
+ return Array.prototype.filter.call(this, predicate);
187
+ },
188
+ /**
189
+ * @private
190
+ * @param {Node} item
191
+ * @returns {number}
192
+ */
193
+ indexOf: function (item) {
194
+ return Array.prototype.indexOf.call(this, item);
195
+ },
196
+ };
197
+
198
+ function LiveNodeList(node,refresh){
199
+ this._node = node;
200
+ this._refresh = refresh
201
+ _updateLiveList(this);
202
+ }
203
+ function _updateLiveList(list){
204
+ var inc = list._node._inc || list._node.ownerDocument._inc;
205
+ if (list._inc !== inc) {
206
+ var ls = list._refresh(list._node);
207
+ __set__(list,'length',ls.length);
208
+ if (!list.$$length || ls.length < list.$$length) {
209
+ for (var i = ls.length; i in list; i++) {
210
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
211
+ delete list[i];
212
+ }
213
+ }
214
+ }
215
+ copy(ls,list);
216
+ list._inc = inc;
217
+ }
218
+ }
219
+ LiveNodeList.prototype.item = function(i){
220
+ _updateLiveList(this);
221
+ return this[i] || null;
222
+ }
223
+
224
+ _extends(LiveNodeList,NodeList);
225
+
226
+ /**
227
+ * Objects implementing the NamedNodeMap interface are used
228
+ * to represent collections of nodes that can be accessed by name.
229
+ * Note that NamedNodeMap does not inherit from NodeList;
230
+ * NamedNodeMaps are not maintained in any particular order.
231
+ * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,
232
+ * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,
233
+ * and does not imply that the DOM specifies an order to these Nodes.
234
+ * NamedNodeMap objects in the DOM are live.
235
+ * used for attributes or DocumentType entities
236
+ */
237
+ function NamedNodeMap() {
238
+ };
239
+
240
+ function _findNodeIndex(list,node){
241
+ var i = list.length;
242
+ while(i--){
243
+ if(list[i] === node){return i}
244
+ }
245
+ }
246
+
247
+ function _addNamedNode(el,list,newAttr,oldAttr){
248
+ if(oldAttr){
249
+ list[_findNodeIndex(list,oldAttr)] = newAttr;
250
+ }else{
251
+ list[list.length++] = newAttr;
252
+ }
253
+ if(el){
254
+ newAttr.ownerElement = el;
255
+ var doc = el.ownerDocument;
256
+ if(doc){
257
+ oldAttr && _onRemoveAttribute(doc,el,oldAttr);
258
+ _onAddAttribute(doc,el,newAttr);
259
+ }
260
+ }
261
+ }
262
+ function _removeNamedNode(el,list,attr){
263
+ //console.log('remove attr:'+attr)
264
+ var i = _findNodeIndex(list,attr);
265
+ if(i>=0){
266
+ var lastIndex = list.length-1
267
+ while(i<lastIndex){
268
+ list[i] = list[++i]
269
+ }
270
+ list.length = lastIndex;
271
+ if(el){
272
+ var doc = el.ownerDocument;
273
+ if(doc){
274
+ _onRemoveAttribute(doc,el,attr);
275
+ attr.ownerElement = null;
276
+ }
277
+ }
278
+ }else{
279
+ throw new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
280
+ }
281
+ }
282
+ NamedNodeMap.prototype = {
283
+ length:0,
284
+ item:NodeList.prototype.item,
285
+ getNamedItem: function(key) {
286
+ // if(key.indexOf(':')>0 || key == 'xmlns'){
287
+ // return null;
288
+ // }
289
+ //console.log()
290
+ var i = this.length;
291
+ while(i--){
292
+ var attr = this[i];
293
+ //console.log(attr.nodeName,key)
294
+ if(attr.nodeName == key){
295
+ return attr;
296
+ }
297
+ }
298
+ },
299
+ setNamedItem: function(attr) {
300
+ var el = attr.ownerElement;
301
+ if(el && el!=this._ownerElement){
302
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
303
+ }
304
+ var oldAttr = this.getNamedItem(attr.nodeName);
305
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
306
+ return oldAttr;
307
+ },
308
+ /* returns Node */
309
+ setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
310
+ var el = attr.ownerElement, oldAttr;
311
+ if(el && el!=this._ownerElement){
312
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
313
+ }
314
+ oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
315
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
316
+ return oldAttr;
317
+ },
318
+
319
+ /* returns Node */
320
+ removeNamedItem: function(key) {
321
+ var attr = this.getNamedItem(key);
322
+ _removeNamedNode(this._ownerElement,this,attr);
323
+ return attr;
324
+
325
+
326
+ },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
327
+
328
+ //for level2
329
+ removeNamedItemNS:function(namespaceURI,localName){
330
+ var attr = this.getNamedItemNS(namespaceURI,localName);
331
+ _removeNamedNode(this._ownerElement,this,attr);
332
+ return attr;
333
+ },
334
+ getNamedItemNS: function(namespaceURI, localName) {
335
+ var i = this.length;
336
+ while(i--){
337
+ var node = this[i];
338
+ if(node.localName == localName && node.namespaceURI == namespaceURI){
339
+ return node;
340
+ }
341
+ }
342
+ return null;
343
+ }
344
+ };
345
+
346
+ /**
347
+ * The DOMImplementation interface represents an object providing methods
348
+ * which are not dependent on any particular document.
349
+ * Such an object is returned by the `Document.implementation` property.
350
+ *
351
+ * __The individual methods describe the differences compared to the specs.__
352
+ *
353
+ * @constructor
354
+ *
355
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN
356
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)
357
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core
358
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core
359
+ * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard
360
+ */
361
+ function DOMImplementation() {
362
+ }
363
+
364
+ DOMImplementation.prototype = {
365
+ /**
366
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.
367
+ * The different implementations fairly diverged in what kind of features were reported.
368
+ * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
369
+ *
370
+ * @deprecated It is deprecated and modern browsers return true in all cases.
371
+ *
372
+ * @param {string} feature
373
+ * @param {string} [version]
374
+ * @returns {boolean} always true
375
+ *
376
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
377
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core
378
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
379
+ */
380
+ hasFeature: function(feature, version) {
381
+ return true;
382
+ },
383
+ /**
384
+ * Creates an XML Document object of the specified type with its document element.
385
+ *
386
+ * __It behaves slightly different from the description in the living standard__:
387
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance.
388
+ * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.
389
+ * - this implementation is not validating names or qualified names
390
+ * (when parsing XML strings, the SAX parser takes care of that)
391
+ *
392
+ * @param {string|null} namespaceURI
393
+ * @param {string} qualifiedName
394
+ * @param {DocumentType=null} doctype
395
+ * @returns {Document}
396
+ *
397
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
398
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)
399
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
400
+ *
401
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
402
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
403
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
404
+ */
405
+ createDocument: function(namespaceURI, qualifiedName, doctype){
406
+ var doc = new Document();
407
+ doc.implementation = this;
408
+ doc.childNodes = new NodeList();
409
+ doc.doctype = doctype || null;
410
+ if (doctype){
411
+ doc.appendChild(doctype);
412
+ }
413
+ if (qualifiedName){
414
+ var root = doc.createElementNS(namespaceURI, qualifiedName);
415
+ doc.appendChild(root);
416
+ }
417
+ return doc;
418
+ },
419
+ /**
420
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
421
+ *
422
+ * __This behavior is slightly different from the in the specs__:
423
+ * - this implementation is not validating names or qualified names
424
+ * (when parsing XML strings, the SAX parser takes care of that)
425
+ *
426
+ * @param {string} qualifiedName
427
+ * @param {string} [publicId]
428
+ * @param {string} [systemId]
429
+ * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
430
+ * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
431
+ *
432
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN
433
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core
434
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard
435
+ *
436
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
437
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
438
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
439
+ */
440
+ createDocumentType: function(qualifiedName, publicId, systemId){
441
+ var node = new DocumentType();
442
+ node.name = qualifiedName;
443
+ node.nodeName = qualifiedName;
444
+ node.publicId = publicId || '';
445
+ node.systemId = systemId || '';
446
+
447
+ return node;
448
+ }
449
+ };
450
+
451
+
452
+ /**
453
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
454
+ */
455
+
456
+ function Node() {
457
+ };
458
+
459
+ Node.prototype = {
460
+ firstChild : null,
461
+ lastChild : null,
462
+ previousSibling : null,
463
+ nextSibling : null,
464
+ attributes : null,
465
+ parentNode : null,
466
+ childNodes : null,
467
+ ownerDocument : null,
468
+ nodeValue : null,
469
+ namespaceURI : null,
470
+ prefix : null,
471
+ localName : null,
472
+ // Modified in DOM Level 2:
473
+ insertBefore:function(newChild, refChild){//raises
474
+ return _insertBefore(this,newChild,refChild);
475
+ },
476
+ replaceChild:function(newChild, oldChild){//raises
477
+ _insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);
478
+ if(oldChild){
479
+ this.removeChild(oldChild);
480
+ }
481
+ },
482
+ removeChild:function(oldChild){
483
+ return _removeChild(this,oldChild);
484
+ },
485
+ appendChild:function(newChild){
486
+ return this.insertBefore(newChild,null);
487
+ },
488
+ hasChildNodes:function(){
489
+ return this.firstChild != null;
490
+ },
491
+ cloneNode:function(deep){
492
+ return cloneNode(this.ownerDocument||this,this,deep);
493
+ },
494
+ // Modified in DOM Level 2:
495
+ normalize:function(){
496
+ var child = this.firstChild;
497
+ while(child){
498
+ var next = child.nextSibling;
499
+ if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
500
+ this.removeChild(next);
501
+ child.appendData(next.data);
502
+ }else{
503
+ child.normalize();
504
+ child = next;
505
+ }
506
+ }
507
+ },
508
+ // Introduced in DOM Level 2:
509
+ isSupported:function(feature, version){
510
+ return this.ownerDocument.implementation.hasFeature(feature,version);
511
+ },
512
+ // Introduced in DOM Level 2:
513
+ hasAttributes:function(){
514
+ return this.attributes.length>0;
515
+ },
516
+ /**
517
+ * Look up the prefix associated to the given namespace URI, starting from this node.
518
+ * **The default namespace declarations are ignored by this method.**
519
+ * See Namespace Prefix Lookup for details on the algorithm used by this method.
520
+ *
521
+ * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._
522
+ *
523
+ * @param {string | null} namespaceURI
524
+ * @returns {string | null}
525
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
526
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo
527
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
528
+ * @see https://github.com/xmldom/xmldom/issues/322
529
+ */
530
+ lookupPrefix:function(namespaceURI){
531
+ var el = this;
532
+ while(el){
533
+ var map = el._nsMap;
534
+ //console.dir(map)
535
+ if(map){
536
+ for(var n in map){
537
+ if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
538
+ return n;
539
+ }
540
+ }
541
+ }
542
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
543
+ }
544
+ return null;
545
+ },
546
+ // Introduced in DOM Level 3:
547
+ lookupNamespaceURI:function(prefix){
548
+ var el = this;
549
+ while(el){
550
+ var map = el._nsMap;
551
+ //console.dir(map)
552
+ if(map){
553
+ if(Object.prototype.hasOwnProperty.call(map, prefix)){
554
+ return map[prefix] ;
555
+ }
556
+ }
557
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
558
+ }
559
+ return null;
560
+ },
561
+ // Introduced in DOM Level 3:
562
+ isDefaultNamespace:function(namespaceURI){
563
+ var prefix = this.lookupPrefix(namespaceURI);
564
+ return prefix == null;
565
+ }
566
+ };
567
+
568
+
569
+ function _xmlEncoder(c){
570
+ return c == '<' && '&lt;' ||
571
+ c == '>' && '&gt;' ||
572
+ c == '&' && '&amp;' ||
573
+ c == '"' && '&quot;' ||
574
+ '&#'+c.charCodeAt()+';'
575
+ }
576
+
577
+
578
+ copy(NodeType,Node);
579
+ copy(NodeType,Node.prototype);
580
+
581
+ /**
582
+ * @param callback return true for continue,false for break
583
+ * @return boolean true: break visit;
584
+ */
585
+ function _visitNode(node,callback){
586
+ if(callback(node)){
587
+ return true;
588
+ }
589
+ if(node = node.firstChild){
590
+ do{
591
+ if(_visitNode(node,callback)){return true}
592
+ }while(node=node.nextSibling)
593
+ }
594
+ }
595
+
596
+
597
+
598
+ function Document(){
599
+ this.ownerDocument = this;
600
+ }
601
+
602
+ function _onAddAttribute(doc,el,newAttr){
603
+ doc && doc._inc++;
604
+ var ns = newAttr.namespaceURI ;
605
+ if(ns === NAMESPACE.XMLNS){
606
+ //update namespace
607
+ el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
608
+ }
609
+ }
610
+
611
+ function _onRemoveAttribute(doc,el,newAttr,remove){
612
+ doc && doc._inc++;
613
+ var ns = newAttr.namespaceURI ;
614
+ if(ns === NAMESPACE.XMLNS){
615
+ //update namespace
616
+ delete el._nsMap[newAttr.prefix?newAttr.localName:'']
617
+ }
618
+ }
619
+
620
+ /**
621
+ * Updates `el.childNodes`, updating the indexed items and it's `length`.
622
+ * Passing `newChild` means it will be appended.
623
+ * Otherwise it's assumed that an item has been removed,
624
+ * and `el.firstNode` and it's `.nextSibling` are used
625
+ * to walk the current list of child nodes.
626
+ *
627
+ * @param {Document} doc
628
+ * @param {Node} el
629
+ * @param {Node} [newChild]
630
+ * @private
631
+ */
632
+ function _onUpdateChild (doc, el, newChild) {
633
+ if(doc && doc._inc){
634
+ doc._inc++;
635
+ //update childNodes
636
+ var cs = el.childNodes;
637
+ if (newChild) {
638
+ cs[cs.length++] = newChild;
639
+ } else {
640
+ var child = el.firstChild;
641
+ var i = 0;
642
+ while (child) {
643
+ cs[i++] = child;
644
+ child = child.nextSibling;
645
+ }
646
+ cs.length = i;
647
+ delete cs[cs.length];
648
+ }
649
+ }
650
+ }
651
+
652
+ /**
653
+ * Removes the connections between `parentNode` and `child`
654
+ * and any existing `child.previousSibling` or `child.nextSibling`.
655
+ *
656
+ * @see https://github.com/xmldom/xmldom/issues/135
657
+ * @see https://github.com/xmldom/xmldom/issues/145
658
+ *
659
+ * @param {Node} parentNode
660
+ * @param {Node} child
661
+ * @returns {Node} the child that was removed.
662
+ * @private
663
+ */
664
+ function _removeChild (parentNode, child) {
665
+ var previous = child.previousSibling;
666
+ var next = child.nextSibling;
667
+ if (previous) {
668
+ previous.nextSibling = next;
669
+ } else {
670
+ parentNode.firstChild = next;
671
+ }
672
+ if (next) {
673
+ next.previousSibling = previous;
674
+ } else {
675
+ parentNode.lastChild = previous;
676
+ }
677
+ child.parentNode = null;
678
+ child.previousSibling = null;
679
+ child.nextSibling = null;
680
+ _onUpdateChild(parentNode.ownerDocument, parentNode);
681
+ return child;
682
+ }
683
+
684
+ /**
685
+ * Returns `true` if `node` can be a parent for insertion.
686
+ * @param {Node} node
687
+ * @returns {boolean}
688
+ */
689
+ function hasValidParentNodeType(node) {
690
+ return (
691
+ node &&
692
+ (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)
693
+ );
694
+ }
695
+
696
+ /**
697
+ * Returns `true` if `node` can be inserted according to it's `nodeType`.
698
+ * @param {Node} node
699
+ * @returns {boolean}
700
+ */
701
+ function hasInsertableNodeType(node) {
702
+ return (
703
+ node &&
704
+ (isElementNode(node) ||
705
+ isTextNode(node) ||
706
+ isDocTypeNode(node) ||
707
+ node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||
708
+ node.nodeType === Node.COMMENT_NODE ||
709
+ node.nodeType === Node.PROCESSING_INSTRUCTION_NODE)
710
+ );
711
+ }
712
+
713
+ /**
714
+ * Returns true if `node` is a DOCTYPE node
715
+ * @param {Node} node
716
+ * @returns {boolean}
717
+ */
718
+ function isDocTypeNode(node) {
719
+ return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
720
+ }
721
+
722
+ /**
723
+ * Returns true if the node is an element
724
+ * @param {Node} node
725
+ * @returns {boolean}
726
+ */
727
+ function isElementNode(node) {
728
+ return node && node.nodeType === Node.ELEMENT_NODE;
729
+ }
730
+ /**
731
+ * Returns true if `node` is a text node
732
+ * @param {Node} node
733
+ * @returns {boolean}
734
+ */
735
+ function isTextNode(node) {
736
+ return node && node.nodeType === Node.TEXT_NODE;
737
+ }
738
+
739
+ /**
740
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
741
+ * according to the presence and position of a doctype node on the same level.
742
+ *
743
+ * @param {Document} doc The document node
744
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
745
+ * @returns {boolean} `true` if an element can be inserted before child
746
+ * @private
747
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
748
+ */
749
+ function isElementInsertionPossible(doc, child) {
750
+ var parentChildNodes = doc.childNodes || [];
751
+ if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
752
+ return false;
753
+ }
754
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
755
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
756
+ }
757
+
758
+ /**
759
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
760
+ * according to the presence and position of a doctype node on the same level.
761
+ *
762
+ * @param {Node} doc The document node
763
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
764
+ * @returns {boolean} `true` if an element can be inserted before child
765
+ * @private
766
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
767
+ */
768
+ function isElementReplacementPossible(doc, child) {
769
+ var parentChildNodes = doc.childNodes || [];
770
+
771
+ function hasElementChildThatIsNotChild(node) {
772
+ return isElementNode(node) && node !== child;
773
+ }
774
+
775
+ if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
776
+ return false;
777
+ }
778
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
779
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
780
+ }
781
+
782
+ /**
783
+ * @private
784
+ * Steps 1-5 of the checks before inserting and before replacing a child are the same.
785
+ *
786
+ * @param {Node} parent the parent node to insert `node` into
787
+ * @param {Node} node the node to insert
788
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
789
+ * @returns {Node}
790
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
791
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
792
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
793
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
794
+ */
795
+ function assertPreInsertionValidity1to5(parent, node, child) {
796
+ // 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException.
797
+ if (!hasValidParentNodeType(parent)) {
798
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);
799
+ }
800
+ // 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException.
801
+ // not implemented!
802
+ // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException.
803
+ if (child && child.parentNode !== parent) {
804
+ throw new DOMException(NOT_FOUND_ERR, 'child not in parent');
805
+ }
806
+ if (
807
+ // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
808
+ !hasInsertableNodeType(node) ||
809
+ // 5. If either `node` is a Text node and `parent` is a document,
810
+ // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0
811
+ // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)
812
+ // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException.
813
+ (isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)
814
+ ) {
815
+ throw new DOMException(
816
+ HIERARCHY_REQUEST_ERR,
817
+ 'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType
818
+ );
819
+ }
820
+ }
821
+
822
+ /**
823
+ * @private
824
+ * Step 6 of the checks before inserting and before replacing a child are different.
825
+ *
826
+ * @param {Document} parent the parent node to insert `node` into
827
+ * @param {Node} node the node to insert
828
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
829
+ * @returns {Node}
830
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
831
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
832
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
833
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
834
+ */
835
+ function assertPreInsertionValidityInDocument(parent, node, child) {
836
+ var parentChildNodes = parent.childNodes || [];
837
+ var nodeChildNodes = node.childNodes || [];
838
+
839
+ // DocumentFragment
840
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
841
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
842
+ // If node has more than one element child or has a Text node child.
843
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
844
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
845
+ }
846
+ // Otherwise, if `node` has one element child and either `parent` has an element child,
847
+ // `child` is a doctype, or `child` is non-null and a doctype is following `child`.
848
+ if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
849
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
850
+ }
851
+ }
852
+ // Element
853
+ if (isElementNode(node)) {
854
+ // `parent` has an element child, `child` is a doctype,
855
+ // or `child` is non-null and a doctype is following `child`.
856
+ if (!isElementInsertionPossible(parent, child)) {
857
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
858
+ }
859
+ }
860
+ // DocumentType
861
+ if (isDocTypeNode(node)) {
862
+ // `parent` has a doctype child,
863
+ if (find(parentChildNodes, isDocTypeNode)) {
864
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
865
+ }
866
+ var parentElementChild = find(parentChildNodes, isElementNode);
867
+ // `child` is non-null and an element is preceding `child`,
868
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
869
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
870
+ }
871
+ // or `child` is null and `parent` has an element child.
872
+ if (!child && parentElementChild) {
873
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');
874
+ }
875
+ }
876
+ }
877
+
878
+ /**
879
+ * @private
880
+ * Step 6 of the checks before inserting and before replacing a child are different.
881
+ *
882
+ * @param {Document} parent the parent node to insert `node` into
883
+ * @param {Node} node the node to insert
884
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
885
+ * @returns {Node}
886
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
887
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
888
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
889
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
890
+ */
891
+ function assertPreReplacementValidityInDocument(parent, node, child) {
892
+ var parentChildNodes = parent.childNodes || [];
893
+ var nodeChildNodes = node.childNodes || [];
894
+
895
+ // DocumentFragment
896
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
897
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
898
+ // If `node` has more than one element child or has a Text node child.
899
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
900
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
901
+ }
902
+ // Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.
903
+ if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
904
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
905
+ }
906
+ }
907
+ // Element
908
+ if (isElementNode(node)) {
909
+ // `parent` has an element child that is not `child` or a doctype is following `child`.
910
+ if (!isElementReplacementPossible(parent, child)) {
911
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
912
+ }
913
+ }
914
+ // DocumentType
915
+ if (isDocTypeNode(node)) {
916
+ function hasDoctypeChildThatIsNotChild(node) {
917
+ return isDocTypeNode(node) && node !== child;
918
+ }
919
+
920
+ // `parent` has a doctype child that is not `child`,
921
+ if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
922
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
923
+ }
924
+ var parentElementChild = find(parentChildNodes, isElementNode);
925
+ // or an element is preceding `child`.
926
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
927
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
928
+ }
929
+ }
930
+ }
931
+
932
+ /**
933
+ * @private
934
+ * @param {Node} parent the parent node to insert `node` into
935
+ * @param {Node} node the node to insert
936
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
937
+ * @returns {Node}
938
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
939
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
940
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
941
+ */
942
+ function _insertBefore(parent, node, child, _inDocumentAssertion) {
943
+ // To ensure pre-insertion validity of a node into a parent before a child, run these steps:
944
+ assertPreInsertionValidity1to5(parent, node, child);
945
+
946
+ // If parent is a document, and any of the statements below, switched on the interface node implements,
947
+ // are true, then throw a "HierarchyRequestError" DOMException.
948
+ if (parent.nodeType === Node.DOCUMENT_NODE) {
949
+ (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
950
+ }
951
+
952
+ var cp = node.parentNode;
953
+ if(cp){
954
+ cp.removeChild(node);//remove and update
955
+ }
956
+ if(node.nodeType === DOCUMENT_FRAGMENT_NODE){
957
+ var newFirst = node.firstChild;
958
+ if (newFirst == null) {
959
+ return node;
960
+ }
961
+ var newLast = node.lastChild;
962
+ }else{
963
+ newFirst = newLast = node;
964
+ }
965
+ var pre = child ? child.previousSibling : parent.lastChild;
966
+
967
+ newFirst.previousSibling = pre;
968
+ newLast.nextSibling = child;
969
+
970
+
971
+ if(pre){
972
+ pre.nextSibling = newFirst;
973
+ }else{
974
+ parent.firstChild = newFirst;
975
+ }
976
+ if(child == null){
977
+ parent.lastChild = newLast;
978
+ }else{
979
+ child.previousSibling = newLast;
980
+ }
981
+ do{
982
+ newFirst.parentNode = parent;
983
+ // Update ownerDocument for each node being inserted
984
+ var targetDoc = parent.ownerDocument || parent;
985
+ _updateOwnerDocument(newFirst, targetDoc);
986
+ }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
987
+ _onUpdateChild(parent.ownerDocument||parent, parent);
988
+ //console.log(parent.lastChild.nextSibling == null)
989
+ if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
990
+ node.firstChild = node.lastChild = null;
991
+ }
992
+ return node;
993
+ }
994
+
995
+ /**
996
+ * Recursively updates the ownerDocument property for a node and all its descendants
997
+ * @param {Node} node
998
+ * @param {Document} newOwnerDocument
999
+ * @private
1000
+ */
1001
+ function _updateOwnerDocument(node, newOwnerDocument) {
1002
+ if (node.ownerDocument === newOwnerDocument) {
1003
+ return;
1004
+ }
1005
+
1006
+ node.ownerDocument = newOwnerDocument;
1007
+
1008
+ // Update attributes if this is an element
1009
+ if (node.nodeType === ELEMENT_NODE && node.attributes) {
1010
+ for (var i = 0; i < node.attributes.length; i++) {
1011
+ var attr = node.attributes.item(i);
1012
+ if (attr) {
1013
+ attr.ownerDocument = newOwnerDocument;
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ // Recursively update child nodes
1019
+ var child = node.firstChild;
1020
+ while (child) {
1021
+ _updateOwnerDocument(child, newOwnerDocument);
1022
+ child = child.nextSibling;
1023
+ }
1024
+ }
1025
+
1026
+ /**
1027
+ * Appends `newChild` to `parentNode`.
1028
+ * If `newChild` is already connected to a `parentNode` it is first removed from it.
1029
+ *
1030
+ * @see https://github.com/xmldom/xmldom/issues/135
1031
+ * @see https://github.com/xmldom/xmldom/issues/145
1032
+ * @param {Node} parentNode
1033
+ * @param {Node} newChild
1034
+ * @returns {Node}
1035
+ * @private
1036
+ */
1037
+ function _appendSingleChild (parentNode, newChild) {
1038
+ if (newChild.parentNode) {
1039
+ newChild.parentNode.removeChild(newChild);
1040
+ }
1041
+ newChild.parentNode = parentNode;
1042
+ newChild.previousSibling = parentNode.lastChild;
1043
+ newChild.nextSibling = null;
1044
+ if (newChild.previousSibling) {
1045
+ newChild.previousSibling.nextSibling = newChild;
1046
+ } else {
1047
+ parentNode.firstChild = newChild;
1048
+ }
1049
+ parentNode.lastChild = newChild;
1050
+ _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
1051
+
1052
+ // Update ownerDocument for the new child and all its descendants
1053
+ var targetDoc = parentNode.ownerDocument || parentNode;
1054
+ _updateOwnerDocument(newChild, targetDoc);
1055
+
1056
+ return newChild;
1057
+ }
1058
+
1059
+ Document.prototype = {
1060
+ //implementation : null,
1061
+ nodeName : '#document',
1062
+ nodeType : DOCUMENT_NODE,
1063
+ /**
1064
+ * The DocumentType node of the document.
1065
+ *
1066
+ * @readonly
1067
+ * @type DocumentType
1068
+ */
1069
+ doctype : null,
1070
+ documentElement : null,
1071
+ _inc : 1,
1072
+
1073
+ insertBefore : function(newChild, refChild){//raises
1074
+ if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
1075
+ var child = newChild.firstChild;
1076
+ while(child){
1077
+ var next = child.nextSibling;
1078
+ this.insertBefore(child,refChild);
1079
+ child = next;
1080
+ }
1081
+ return newChild;
1082
+ }
1083
+ _insertBefore(this, newChild, refChild);
1084
+ _updateOwnerDocument(newChild, this);
1085
+ if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
1086
+ this.documentElement = newChild;
1087
+ }
1088
+
1089
+ return newChild;
1090
+ },
1091
+ removeChild : function(oldChild){
1092
+ if(this.documentElement == oldChild){
1093
+ this.documentElement = null;
1094
+ }
1095
+ return _removeChild(this,oldChild);
1096
+ },
1097
+ replaceChild: function (newChild, oldChild) {
1098
+ //raises
1099
+ _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
1100
+ _updateOwnerDocument(newChild, this);
1101
+ if (oldChild) {
1102
+ this.removeChild(oldChild);
1103
+ }
1104
+ if (isElementNode(newChild)) {
1105
+ this.documentElement = newChild;
1106
+ }
1107
+ },
1108
+ // Introduced in DOM Level 2:
1109
+ importNode : function(importedNode,deep){
1110
+ return importNode(this,importedNode,deep);
1111
+ },
1112
+ // Introduced in DOM Level 2:
1113
+ getElementById : function(id){
1114
+ var rtv = null;
1115
+ _visitNode(this.documentElement,function(node){
1116
+ if(node.nodeType == ELEMENT_NODE){
1117
+ if(node.getAttribute('id') == id){
1118
+ rtv = node;
1119
+ return true;
1120
+ }
1121
+ }
1122
+ })
1123
+ return rtv;
1124
+ },
1125
+
1126
+ /**
1127
+ * The `getElementsByClassName` method of `Document` interface returns an array-like object
1128
+ * of all child elements which have **all** of the given class name(s).
1129
+ *
1130
+ * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.
1131
+ *
1132
+ *
1133
+ * Warning: This is a live LiveNodeList.
1134
+ * Changes in the DOM will reflect in the array as the changes occur.
1135
+ * If an element selected by this array no longer qualifies for the selector,
1136
+ * it will automatically be removed. Be aware of this for iteration purposes.
1137
+ *
1138
+ * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace
1139
+ *
1140
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
1141
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
1142
+ */
1143
+ getElementsByClassName: function(classNames) {
1144
+ var classNamesSet = toOrderedSet(classNames)
1145
+ return new LiveNodeList(this, function(base) {
1146
+ var ls = [];
1147
+ if (classNamesSet.length > 0) {
1148
+ _visitNode(base.documentElement, function(node) {
1149
+ if(node !== base && node.nodeType === ELEMENT_NODE) {
1150
+ var nodeClassNames = node.getAttribute('class')
1151
+ // can be null if the attribute does not exist
1152
+ if (nodeClassNames) {
1153
+ // before splitting and iterating just compare them for the most common case
1154
+ var matches = classNames === nodeClassNames;
1155
+ if (!matches) {
1156
+ var nodeClassNamesSet = toOrderedSet(nodeClassNames)
1157
+ matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))
1158
+ }
1159
+ if(matches) {
1160
+ ls.push(node);
1161
+ }
1162
+ }
1163
+ }
1164
+ });
1165
+ }
1166
+ return ls;
1167
+ });
1168
+ },
1169
+
1170
+ //document factory method:
1171
+ createElement : function(tagName){
1172
+ var node = new Element();
1173
+ node.ownerDocument = this;
1174
+ node.nodeName = tagName;
1175
+ node.tagName = tagName;
1176
+ node.localName = tagName;
1177
+ node.childNodes = new NodeList();
1178
+ var attrs = node.attributes = new NamedNodeMap();
1179
+ attrs._ownerElement = node;
1180
+ return node;
1181
+ },
1182
+ createDocumentFragment : function(){
1183
+ var node = new DocumentFragment();
1184
+ node.ownerDocument = this;
1185
+ node.childNodes = new NodeList();
1186
+ return node;
1187
+ },
1188
+ createTextNode : function(data){
1189
+ var node = new Text();
1190
+ node.ownerDocument = this;
1191
+ node.appendData(data)
1192
+ return node;
1193
+ },
1194
+ createComment : function(data){
1195
+ var node = new Comment();
1196
+ node.ownerDocument = this;
1197
+ node.appendData(data)
1198
+ return node;
1199
+ },
1200
+ createCDATASection : function(data){
1201
+ var node = new CDATASection();
1202
+ node.ownerDocument = this;
1203
+ node.appendData(data)
1204
+ return node;
1205
+ },
1206
+ createProcessingInstruction : function(target,data){
1207
+ var node = new ProcessingInstruction();
1208
+ node.ownerDocument = this;
1209
+ node.tagName = node.nodeName = node.target = target;
1210
+ node.nodeValue = node.data = data;
1211
+ return node;
1212
+ },
1213
+ createAttribute : function(name){
1214
+ var node = new Attr();
1215
+ node.ownerDocument = this;
1216
+ node.name = name;
1217
+ node.nodeName = name;
1218
+ node.localName = name;
1219
+ node.specified = true;
1220
+ return node;
1221
+ },
1222
+ createEntityReference : function(name){
1223
+ var node = new EntityReference();
1224
+ node.ownerDocument = this;
1225
+ node.nodeName = name;
1226
+ return node;
1227
+ },
1228
+ // Introduced in DOM Level 2:
1229
+ createElementNS : function(namespaceURI,qualifiedName){
1230
+ var node = new Element();
1231
+ var pl = qualifiedName.split(':');
1232
+ var attrs = node.attributes = new NamedNodeMap();
1233
+ node.childNodes = new NodeList();
1234
+ node.ownerDocument = this;
1235
+ node.nodeName = qualifiedName;
1236
+ node.tagName = qualifiedName;
1237
+ node.namespaceURI = namespaceURI;
1238
+ if(pl.length == 2){
1239
+ node.prefix = pl[0];
1240
+ node.localName = pl[1];
1241
+ }else{
1242
+ //el.prefix = null;
1243
+ node.localName = qualifiedName;
1244
+ }
1245
+ attrs._ownerElement = node;
1246
+ return node;
1247
+ },
1248
+ // Introduced in DOM Level 2:
1249
+ createAttributeNS : function(namespaceURI,qualifiedName){
1250
+ var node = new Attr();
1251
+ var pl = qualifiedName.split(':');
1252
+ node.ownerDocument = this;
1253
+ node.nodeName = qualifiedName;
1254
+ node.name = qualifiedName;
1255
+ node.namespaceURI = namespaceURI;
1256
+ node.specified = true;
1257
+ if(pl.length == 2){
1258
+ node.prefix = pl[0];
1259
+ node.localName = pl[1];
1260
+ }else{
1261
+ //el.prefix = null;
1262
+ node.localName = qualifiedName;
1263
+ }
1264
+ return node;
1265
+ }
1266
+ };
1267
+ _extends(Document,Node);
1268
+
1269
+
1270
+ function Element() {
1271
+ this._nsMap = {};
1272
+ };
1273
+ Element.prototype = {
1274
+ nodeType : ELEMENT_NODE,
1275
+ hasAttribute : function(name){
1276
+ return this.getAttributeNode(name)!=null;
1277
+ },
1278
+ getAttribute : function(name){
1279
+ var attr = this.getAttributeNode(name);
1280
+ return attr && attr.value || '';
1281
+ },
1282
+ getAttributeNode : function(name){
1283
+ return this.attributes.getNamedItem(name);
1284
+ },
1285
+ setAttribute : function(name, value){
1286
+ var attr = this.ownerDocument.createAttribute(name);
1287
+ attr.value = attr.nodeValue = "" + value;
1288
+ this.setAttributeNode(attr)
1289
+ },
1290
+ removeAttribute : function(name){
1291
+ var attr = this.getAttributeNode(name)
1292
+ attr && this.removeAttributeNode(attr);
1293
+ },
1294
+
1295
+ //four real opeartion method
1296
+ appendChild:function(newChild){
1297
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
1298
+ return this.insertBefore(newChild,null);
1299
+ }else{
1300
+ return _appendSingleChild(this,newChild);
1301
+ }
1302
+ },
1303
+ setAttributeNode : function(newAttr){
1304
+ return this.attributes.setNamedItem(newAttr);
1305
+ },
1306
+ setAttributeNodeNS : function(newAttr){
1307
+ return this.attributes.setNamedItemNS(newAttr);
1308
+ },
1309
+ removeAttributeNode : function(oldAttr){
1310
+ //console.log(this == oldAttr.ownerElement)
1311
+ return this.attributes.removeNamedItem(oldAttr.nodeName);
1312
+ },
1313
+ //get real attribute name,and remove it by removeAttributeNode
1314
+ removeAttributeNS : function(namespaceURI, localName){
1315
+ var old = this.getAttributeNodeNS(namespaceURI, localName);
1316
+ old && this.removeAttributeNode(old);
1317
+ },
1318
+
1319
+ hasAttributeNS : function(namespaceURI, localName){
1320
+ return this.getAttributeNodeNS(namespaceURI, localName)!=null;
1321
+ },
1322
+ getAttributeNS : function(namespaceURI, localName){
1323
+ var attr = this.getAttributeNodeNS(namespaceURI, localName);
1324
+ return attr && attr.value || '';
1325
+ },
1326
+ setAttributeNS : function(namespaceURI, qualifiedName, value){
1327
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
1328
+ attr.value = attr.nodeValue = "" + value;
1329
+ this.setAttributeNode(attr)
1330
+ },
1331
+ getAttributeNodeNS : function(namespaceURI, localName){
1332
+ return this.attributes.getNamedItemNS(namespaceURI, localName);
1333
+ },
1334
+
1335
+ getElementsByTagName : function(tagName){
1336
+ return new LiveNodeList(this,function(base){
1337
+ var ls = [];
1338
+ _visitNode(base,function(node){
1339
+ if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
1340
+ ls.push(node);
1341
+ }
1342
+ });
1343
+ return ls;
1344
+ });
1345
+ },
1346
+ getElementsByTagNameNS : function(namespaceURI, localName){
1347
+ return new LiveNodeList(this,function(base){
1348
+ var ls = [];
1349
+ _visitNode(base,function(node){
1350
+ if(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){
1351
+ ls.push(node);
1352
+ }
1353
+ });
1354
+ return ls;
1355
+
1356
+ });
1357
+ }
1358
+ };
1359
+ Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
1360
+ Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
1361
+
1362
+
1363
+ _extends(Element,Node);
1364
+ function Attr() {
1365
+ };
1366
+ Attr.prototype.nodeType = ATTRIBUTE_NODE;
1367
+ _extends(Attr,Node);
1368
+
1369
+
1370
+ function CharacterData() {
1371
+ };
1372
+ CharacterData.prototype = {
1373
+ data : '',
1374
+ substringData : function(offset, count) {
1375
+ return this.data.substring(offset, offset+count);
1376
+ },
1377
+ appendData: function(text) {
1378
+ text = this.data+text;
1379
+ this.nodeValue = this.data = text;
1380
+ this.length = text.length;
1381
+ },
1382
+ insertData: function(offset,text) {
1383
+ this.replaceData(offset,0,text);
1384
+
1385
+ },
1386
+ appendChild:function(newChild){
1387
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
1388
+ },
1389
+ deleteData: function(offset, count) {
1390
+ this.replaceData(offset,count,"");
1391
+ },
1392
+ replaceData: function(offset, count, text) {
1393
+ var start = this.data.substring(0,offset);
1394
+ var end = this.data.substring(offset+count);
1395
+ text = start + text + end;
1396
+ this.nodeValue = this.data = text;
1397
+ this.length = text.length;
1398
+ }
1399
+ }
1400
+ _extends(CharacterData,Node);
1401
+ function Text() {
1402
+ };
1403
+ Text.prototype = {
1404
+ nodeName : "#text",
1405
+ nodeType : TEXT_NODE,
1406
+ splitText : function(offset) {
1407
+ var text = this.data;
1408
+ var newText = text.substring(offset);
1409
+ text = text.substring(0, offset);
1410
+ this.data = this.nodeValue = text;
1411
+ this.length = text.length;
1412
+ var newNode = this.ownerDocument.createTextNode(newText);
1413
+ if(this.parentNode){
1414
+ this.parentNode.insertBefore(newNode, this.nextSibling);
1415
+ }
1416
+ return newNode;
1417
+ }
1418
+ }
1419
+ _extends(Text,CharacterData);
1420
+ function Comment() {
1421
+ };
1422
+ Comment.prototype = {
1423
+ nodeName : "#comment",
1424
+ nodeType : COMMENT_NODE
1425
+ }
1426
+ _extends(Comment,CharacterData);
1427
+
1428
+ function CDATASection() {
1429
+ };
1430
+ CDATASection.prototype = {
1431
+ nodeName : "#cdata-section",
1432
+ nodeType : CDATA_SECTION_NODE
1433
+ }
1434
+ _extends(CDATASection,CharacterData);
1435
+
1436
+
1437
+ function DocumentType() {
1438
+ };
1439
+ DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
1440
+ _extends(DocumentType,Node);
1441
+
1442
+ function Notation() {
1443
+ };
1444
+ Notation.prototype.nodeType = NOTATION_NODE;
1445
+ _extends(Notation,Node);
1446
+
1447
+ function Entity() {
1448
+ };
1449
+ Entity.prototype.nodeType = ENTITY_NODE;
1450
+ _extends(Entity,Node);
1451
+
1452
+ function EntityReference() {
1453
+ };
1454
+ EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
1455
+ _extends(EntityReference,Node);
1456
+
1457
+ function DocumentFragment() {
1458
+ };
1459
+ DocumentFragment.prototype.nodeName = "#document-fragment";
1460
+ DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
1461
+ _extends(DocumentFragment,Node);
1462
+
1463
+
1464
+ function ProcessingInstruction() {
1465
+ }
1466
+ ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
1467
+ _extends(ProcessingInstruction,Node);
1468
+ function XMLSerializer(){}
1469
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
1470
+ return nodeSerializeToString.call(node,isHtml,nodeFilter);
1471
+ }
1472
+ Node.prototype.toString = nodeSerializeToString;
1473
+ function nodeSerializeToString(isHtml,nodeFilter){
1474
+ var buf = [];
1475
+ var refNode = this.nodeType == 9 && this.documentElement || this;
1476
+ var prefix = refNode.prefix;
1477
+ var uri = refNode.namespaceURI;
1478
+
1479
+ if(uri && prefix == null){
1480
+ //console.log(prefix)
1481
+ var prefix = refNode.lookupPrefix(uri);
1482
+ if(prefix == null){
1483
+ //isHTML = true;
1484
+ var visibleNamespaces=[
1485
+ {namespace:uri,prefix:null}
1486
+ //{namespace:uri,prefix:''}
1487
+ ]
1488
+ }
1489
+ }
1490
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
1491
+ //console.log('###',this.nodeType,uri,prefix,buf.join(''))
1492
+ return buf.join('');
1493
+ }
1494
+
1495
+ function needNamespaceDefine(node, isHTML, visibleNamespaces) {
1496
+ var prefix = node.prefix || '';
1497
+ var uri = node.namespaceURI;
1498
+ // According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,
1499
+ // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :
1500
+ // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.
1501
+ // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)
1502
+ // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :
1503
+ // > [...] Furthermore, the attribute value [...] must not be an empty string.
1504
+ // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document.
1505
+ if (!uri) {
1506
+ return false;
1507
+ }
1508
+ if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {
1509
+ return false;
1510
+ }
1511
+
1512
+ var i = visibleNamespaces.length
1513
+ while (i--) {
1514
+ var ns = visibleNamespaces[i];
1515
+ // get namespace prefix
1516
+ if (ns.prefix === prefix) {
1517
+ return ns.namespace !== uri;
1518
+ }
1519
+ }
1520
+ return true;
1521
+ }
1522
+ /**
1523
+ * Well-formed constraint: No < in Attribute Values
1524
+ * > The replacement text of any entity referred to directly or indirectly
1525
+ * > in an attribute value must not contain a <.
1526
+ * @see https://www.w3.org/TR/xml11/#CleanAttrVals
1527
+ * @see https://www.w3.org/TR/xml11/#NT-AttValue
1528
+ *
1529
+ * Literal whitespace other than space that appear in attribute values
1530
+ * are serialized as their entity references, so they will be preserved.
1531
+ * (In contrast to whitespace literals in the input which are normalized to spaces)
1532
+ * @see https://www.w3.org/TR/xml11/#AVNormalize
1533
+ * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
1534
+ */
1535
+ function addSerializedAttribute(buf, qualifiedName, value) {
1536
+ buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"')
1537
+ }
1538
+
1539
+ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1540
+ if (!visibleNamespaces) {
1541
+ visibleNamespaces = [];
1542
+ }
1543
+
1544
+ if(nodeFilter){
1545
+ node = nodeFilter(node);
1546
+ if(node){
1547
+ if(typeof node == 'string'){
1548
+ buf.push(node);
1549
+ return;
1550
+ }
1551
+ }else{
1552
+ return;
1553
+ }
1554
+ //buf.sort.apply(attrs, attributeSorter);
1555
+ }
1556
+
1557
+ switch(node.nodeType){
1558
+ case ELEMENT_NODE:
1559
+ var attrs = node.attributes;
1560
+ var len = attrs.length;
1561
+ var child = node.firstChild;
1562
+ var nodeName = node.tagName;
1563
+
1564
+ isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML
1565
+
1566
+ var prefixedNodeName = nodeName
1567
+ if (!isHTML && !node.prefix && node.namespaceURI) {
1568
+ var defaultNS
1569
+ // lookup current default ns from `xmlns` attribute
1570
+ for (var ai = 0; ai < attrs.length; ai++) {
1571
+ if (attrs.item(ai).name === 'xmlns') {
1572
+ defaultNS = attrs.item(ai).value
1573
+ break
1574
+ }
1575
+ }
1576
+ if (!defaultNS) {
1577
+ // lookup current default ns in visibleNamespaces
1578
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
1579
+ var namespace = visibleNamespaces[nsi]
1580
+ if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
1581
+ defaultNS = namespace.namespace
1582
+ break
1583
+ }
1584
+ }
1585
+ }
1586
+ if (defaultNS !== node.namespaceURI) {
1587
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
1588
+ var namespace = visibleNamespaces[nsi]
1589
+ if (namespace.namespace === node.namespaceURI) {
1590
+ if (namespace.prefix) {
1591
+ prefixedNodeName = namespace.prefix + ':' + nodeName
1592
+ }
1593
+ break
1594
+ }
1595
+ }
1596
+ }
1597
+ }
1598
+
1599
+ buf.push('<', prefixedNodeName);
1600
+
1601
+ for(var i=0;i<len;i++){
1602
+ // add namespaces for attributes
1603
+ var attr = attrs.item(i);
1604
+ if (attr.prefix == 'xmlns') {
1605
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
1606
+ }else if(attr.nodeName == 'xmlns'){
1607
+ visibleNamespaces.push({ prefix: '', namespace: attr.value });
1608
+ }
1609
+ }
1610
+
1611
+ for(var i=0;i<len;i++){
1612
+ var attr = attrs.item(i);
1613
+ if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
1614
+ var prefix = attr.prefix||'';
1615
+ var uri = attr.namespaceURI;
1616
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
1617
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
1618
+ }
1619
+ serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
1620
+ }
1621
+
1622
+ // add namespace for current node
1623
+ if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
1624
+ var prefix = node.prefix||'';
1625
+ var uri = node.namespaceURI;
1626
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
1627
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
1628
+ }
1629
+
1630
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
1631
+ buf.push('>');
1632
+ //if is cdata child node
1633
+ if(isHTML && /^script$/i.test(nodeName)){
1634
+ while(child){
1635
+ if(child.data){
1636
+ buf.push(child.data);
1637
+ }else{
1638
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1639
+ }
1640
+ child = child.nextSibling;
1641
+ }
1642
+ }else
1643
+ {
1644
+ while(child){
1645
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1646
+ child = child.nextSibling;
1647
+ }
1648
+ }
1649
+ buf.push('</',prefixedNodeName,'>');
1650
+ }else{
1651
+ buf.push('/>');
1652
+ }
1653
+ // remove added visible namespaces
1654
+ //visibleNamespaces.length = startVisibleNamespaces;
1655
+ return;
1656
+ case DOCUMENT_NODE:
1657
+ case DOCUMENT_FRAGMENT_NODE:
1658
+ var child = node.firstChild;
1659
+ while(child){
1660
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1661
+ child = child.nextSibling;
1662
+ }
1663
+ return;
1664
+ case ATTRIBUTE_NODE:
1665
+ return addSerializedAttribute(buf, node.name, node.value);
1666
+ case TEXT_NODE:
1667
+ /**
1668
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
1669
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
1670
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
1671
+ * `&amp;` and `&lt;` respectively.
1672
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
1673
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
1674
+ * when that string is not marking the end of a CDATA section.
1675
+ *
1676
+ * In the content of elements, character data is any string of characters
1677
+ * which does not contain the start-delimiter of any markup
1678
+ * and does not include the CDATA-section-close delimiter, `]]>`.
1679
+ *
1680
+ * @see https://www.w3.org/TR/xml/#NT-CharData
1681
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
1682
+ */
1683
+ return buf.push(node.data
1684
+ .replace(/[<&>]/g,_xmlEncoder)
1685
+ );
1686
+ case CDATA_SECTION_NODE:
1687
+ return buf.push( '<![CDATA[',node.data,']]>');
1688
+ case COMMENT_NODE:
1689
+ return buf.push( "<!--",node.data,"-->");
1690
+ case DOCUMENT_TYPE_NODE:
1691
+ var pubid = node.publicId;
1692
+ var sysid = node.systemId;
1693
+ buf.push('<!DOCTYPE ',node.name);
1694
+ if(pubid){
1695
+ buf.push(' PUBLIC ', pubid);
1696
+ if (sysid && sysid!='.') {
1697
+ buf.push(' ', sysid);
1698
+ }
1699
+ buf.push('>');
1700
+ }else if(sysid && sysid!='.'){
1701
+ buf.push(' SYSTEM ', sysid, '>');
1702
+ }else{
1703
+ var sub = node.internalSubset;
1704
+ if(sub){
1705
+ buf.push(" [",sub,"]");
1706
+ }
1707
+ buf.push(">");
1708
+ }
1709
+ return;
1710
+ case PROCESSING_INSTRUCTION_NODE:
1711
+ return buf.push( "<?",node.target," ",node.data,"?>");
1712
+ case ENTITY_REFERENCE_NODE:
1713
+ return buf.push( '&',node.nodeName,';');
1714
+ //case ENTITY_NODE:
1715
+ //case NOTATION_NODE:
1716
+ default:
1717
+ buf.push('??',node.nodeName);
1718
+ }
1719
+ }
1720
+ function importNode(doc,node,deep){
1721
+ var node2;
1722
+ switch (node.nodeType) {
1723
+ case ELEMENT_NODE:
1724
+ node2 = node.cloneNode(false);
1725
+ node2.ownerDocument = doc;
1726
+ //var attrs = node2.attributes;
1727
+ //var len = attrs.length;
1728
+ //for(var i=0;i<len;i++){
1729
+ //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
1730
+ //}
1731
+ case DOCUMENT_FRAGMENT_NODE:
1732
+ break;
1733
+ case ATTRIBUTE_NODE:
1734
+ deep = true;
1735
+ break;
1736
+ //case ENTITY_REFERENCE_NODE:
1737
+ //case PROCESSING_INSTRUCTION_NODE:
1738
+ ////case TEXT_NODE:
1739
+ //case CDATA_SECTION_NODE:
1740
+ //case COMMENT_NODE:
1741
+ // deep = false;
1742
+ // break;
1743
+ //case DOCUMENT_NODE:
1744
+ //case DOCUMENT_TYPE_NODE:
1745
+ //cannot be imported.
1746
+ //case ENTITY_NODE:
1747
+ //case NOTATION_NODE:
1748
+ //can not hit in level3
1749
+ //default:throw e;
1750
+ }
1751
+ if(!node2){
1752
+ node2 = node.cloneNode(false);//false
1753
+ }
1754
+ node2.ownerDocument = doc;
1755
+ node2.parentNode = null;
1756
+ if(deep){
1757
+ var child = node.firstChild;
1758
+ while(child){
1759
+ node2.appendChild(importNode(doc,child,deep));
1760
+ child = child.nextSibling;
1761
+ }
1762
+ }
1763
+ return node2;
1764
+ }
1765
+ //
1766
+ //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
1767
+ // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
1768
+ function cloneNode(doc,node,deep){
1769
+ var node2 = new node.constructor();
1770
+ for (var n in node) {
1771
+ if (Object.prototype.hasOwnProperty.call(node, n)) {
1772
+ var v = node[n];
1773
+ if (typeof v != "object") {
1774
+ if (v != node2[n]) {
1775
+ node2[n] = v;
1776
+ }
1777
+ }
1778
+ }
1779
+ }
1780
+ if(node.childNodes){
1781
+ node2.childNodes = new NodeList();
1782
+ }
1783
+ node2.ownerDocument = doc;
1784
+ switch (node2.nodeType) {
1785
+ case ELEMENT_NODE:
1786
+ var attrs = node.attributes;
1787
+ var attrs2 = node2.attributes = new NamedNodeMap();
1788
+ var len = attrs.length
1789
+ attrs2._ownerElement = node2;
1790
+ for(var i=0;i<len;i++){
1791
+ node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
1792
+ }
1793
+ break;;
1794
+ case ATTRIBUTE_NODE:
1795
+ deep = true;
1796
+ }
1797
+ if(deep){
1798
+ var child = node.firstChild;
1799
+ while(child){
1800
+ node2.appendChild(cloneNode(doc,child,deep));
1801
+ child = child.nextSibling;
1802
+ }
1803
+ }
1804
+ return node2;
1805
+ }
1806
+
1807
+ function __set__(object,key,value){
1808
+ object[key] = value
1809
+ }
1810
+ //do dynamic
1811
+ try{
1812
+ if(Object.defineProperty){
1813
+ Object.defineProperty(LiveNodeList.prototype,'length',{
1814
+ get:function(){
1815
+ _updateLiveList(this);
1816
+ return this.$$length;
1817
+ }
1818
+ });
1819
+
1820
+ Object.defineProperty(Node.prototype,'textContent',{
1821
+ get:function(){
1822
+ return getTextContent(this);
1823
+ },
1824
+
1825
+ set:function(data){
1826
+ switch(this.nodeType){
1827
+ case ELEMENT_NODE:
1828
+ case DOCUMENT_FRAGMENT_NODE:
1829
+ while(this.firstChild){
1830
+ this.removeChild(this.firstChild);
1831
+ }
1832
+ if(data || String(data)){
1833
+ this.appendChild(this.ownerDocument.createTextNode(data));
1834
+ }
1835
+ break;
1836
+
1837
+ default:
1838
+ this.data = data;
1839
+ this.value = data;
1840
+ this.nodeValue = data;
1841
+ }
1842
+ }
1843
+ })
1844
+
1845
+ function getTextContent(node){
1846
+ switch(node.nodeType){
1847
+ case ELEMENT_NODE:
1848
+ case DOCUMENT_FRAGMENT_NODE:
1849
+ var buf = [];
1850
+ node = node.firstChild;
1851
+ while(node){
1852
+ if(node.nodeType!==7 && node.nodeType !==8){
1853
+ buf.push(getTextContent(node));
1854
+ }
1855
+ node = node.nextSibling;
1856
+ }
1857
+ return buf.join('');
1858
+ default:
1859
+ return node.nodeValue;
1860
+ }
1861
+ }
1862
+
1863
+ __set__ = function(object,key,value){
1864
+ //console.log(value)
1865
+ object['$$'+key] = value
1866
+ }
1867
+ }
1868
+ }catch(e){//ie8
1869
+ }
1870
+
1871
+ //if(typeof require == 'function'){
1872
+ exports.DocumentType = DocumentType;
1873
+ exports.DOMException = DOMException;
1874
+ exports.DOMImplementation = DOMImplementation;
1875
+ exports.Element = Element;
1876
+ exports.Node = Node;
1877
+ exports.NodeList = NodeList;
1878
+ exports.XMLSerializer = XMLSerializer;
1879
+ //}