lakutata 2.0.81 → 2.0.82

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 (369) hide show
  1. package/orm.cjs +731 -731
  2. package/orm.mjs +835 -835
  3. package/package.json +1 -1
  4. package/src/components/Database.cjs +2 -2
  5. package/src/components/Database.mjs +6 -6
  6. package/src/components/cacher/Cacher.cjs +129 -129
  7. package/src/components/cacher/Cacher.mjs +117 -117
  8. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +94 -94
  9. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +100 -100
  10. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +12 -12
  11. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +11 -11
  12. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +16 -16
  13. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +14 -14
  14. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +11 -11
  15. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +11 -11
  16. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +12 -12
  17. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +13 -13
  18. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
  19. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
  20. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +10 -10
  21. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +10 -10
  22. package/src/components/cacher/lib/IsDriverPackageInstalled.cjs +2 -2
  23. package/src/components/cacher/lib/IsDriverPackageInstalled.mjs +5 -5
  24. package/src/components/docker/ConnectionOptionsBuilder.cjs +10 -10
  25. package/src/components/docker/ConnectionOptionsBuilder.mjs +6 -6
  26. package/src/components/docker/Docker.cjs +1687 -1687
  27. package/src/components/docker/Docker.mjs +1563 -1563
  28. package/src/components/docker/lib/ParseEnvToRecord.cjs +2 -2
  29. package/src/components/docker/lib/ParseEnvToRecord.mjs +12 -12
  30. package/src/components/docker/lib/ParseRepositoryTag.cjs +9 -9
  31. package/src/components/docker/lib/ParseRepositoryTag.mjs +11 -11
  32. package/src/components/entrypoint/Entrypoint.cjs +1789 -1789
  33. package/src/components/entrypoint/Entrypoint.mjs +1632 -1632
  34. package/src/components/monitor/AliveMonitor.cjs +2 -2
  35. package/src/components/monitor/AliveMonitor.mjs +2 -2
  36. package/src/components/monitor/MemoryMonitor.cjs +3 -3
  37. package/src/decorators/asst/After.cjs +3 -3
  38. package/src/decorators/asst/After.mjs +2 -2
  39. package/src/decorators/asst/Before.cjs +2 -2
  40. package/src/decorators/asst/Before.mjs +4 -4
  41. package/src/decorators/ctrl/CLIAction.cjs +2 -2
  42. package/src/decorators/ctrl/CLIAction.mjs +7 -7
  43. package/src/decorators/ctrl/HTTPAction.cjs +6 -6
  44. package/src/decorators/ctrl/HTTPAction.mjs +4 -4
  45. package/src/decorators/ctrl/ServiceAction.cjs +3 -3
  46. package/src/decorators/ctrl/ServiceAction.mjs +4 -4
  47. package/src/decorators/ctrl/http/DELETE.cjs +2 -2
  48. package/src/decorators/ctrl/http/DELETE.mjs +2 -2
  49. package/src/decorators/ctrl/http/GET.cjs +2 -2
  50. package/src/decorators/ctrl/http/GET.mjs +2 -2
  51. package/src/decorators/ctrl/http/HEAD.cjs +2 -2
  52. package/src/decorators/ctrl/http/HEAD.mjs +2 -2
  53. package/src/decorators/ctrl/http/OPTIONS.cjs +2 -2
  54. package/src/decorators/ctrl/http/OPTIONS.mjs +2 -2
  55. package/src/decorators/ctrl/http/PATCH.cjs +2 -2
  56. package/src/decorators/ctrl/http/PATCH.mjs +2 -2
  57. package/src/decorators/ctrl/http/POST.cjs +2 -2
  58. package/src/decorators/ctrl/http/POST.mjs +2 -2
  59. package/src/decorators/ctrl/http/PUT.cjs +2 -2
  60. package/src/decorators/ctrl/http/PUT.mjs +2 -2
  61. package/src/decorators/di/Autoload.cjs +2 -2
  62. package/src/decorators/di/Autoload.mjs +2 -2
  63. package/src/decorators/di/Configurable.cjs +3 -3
  64. package/src/decorators/di/Configurable.mjs +2 -2
  65. package/src/decorators/di/Inject.cjs +6 -6
  66. package/src/decorators/di/Inject.mjs +11 -11
  67. package/src/decorators/di/Lifetime.cjs +18 -18
  68. package/src/decorators/di/Lifetime.mjs +13 -13
  69. package/src/decorators/dto/Accept.cjs +3 -3
  70. package/src/decorators/dto/Accept.mjs +2 -2
  71. package/src/decorators/dto/Expect.cjs +2 -2
  72. package/src/decorators/dto/Expect.mjs +3 -3
  73. package/src/decorators/dto/IndexSignature.cjs +2 -2
  74. package/src/decorators/dto/IndexSignature.mjs +3 -3
  75. package/src/decorators/dto/Return.cjs +3 -3
  76. package/src/decorators/dto/Return.mjs +2 -2
  77. package/src/lib/base/EventEmitter.cjs +238 -238
  78. package/src/lib/base/EventEmitter.mjs +221 -221
  79. package/src/lib/base/async-constructor/Append.cjs +11 -11
  80. package/src/lib/base/async-constructor/Append.mjs +7 -7
  81. package/src/lib/base/internal/BasicInfo.cjs +10 -10
  82. package/src/lib/base/internal/BasicInfo.mjs +9 -9
  83. package/src/lib/base/internal/CamelCase.cjs +4 -4
  84. package/src/lib/base/internal/CamelCase.mjs +11 -11
  85. package/src/lib/base/internal/ConfigurableRecordsInjection.cjs +19 -19
  86. package/src/lib/base/internal/ConfigurableRecordsInjection.mjs +18 -18
  87. package/src/lib/base/internal/ConstructorSymbol.cjs +10 -10
  88. package/src/lib/base/internal/ConstructorSymbol.mjs +8 -8
  89. package/src/lib/base/internal/ControllerEntrypoint.cjs +65 -65
  90. package/src/lib/base/internal/ControllerEntrypoint.mjs +36 -36
  91. package/src/lib/base/internal/DataValidator.cjs +70 -70
  92. package/src/lib/base/internal/DataValidator.mjs +137 -137
  93. package/src/lib/base/internal/GetActionDTOAndOptions.cjs +9 -9
  94. package/src/lib/base/internal/GetActionDTOAndOptions.mjs +10 -10
  95. package/src/lib/base/internal/IEEE754.cjs +74 -74
  96. package/src/lib/base/internal/IEEE754.mjs +70 -70
  97. package/src/lib/base/internal/MethodAssistantFunction.cjs +28 -28
  98. package/src/lib/base/internal/MethodAssistantFunction.mjs +38 -38
  99. package/src/lib/base/internal/MethodValidation.cjs +25 -25
  100. package/src/lib/base/internal/MethodValidation.mjs +20 -20
  101. package/src/lib/base/internal/ObjectConfiguration.cjs +10 -10
  102. package/src/lib/base/internal/ObjectConfiguration.mjs +15 -15
  103. package/src/lib/base/internal/ObjectContainer.cjs +7 -7
  104. package/src/lib/base/internal/ObjectContainer.mjs +6 -6
  105. package/src/lib/base/internal/ObjectInjection.cjs +16 -16
  106. package/src/lib/base/internal/ObjectInjection.mjs +13 -13
  107. package/src/lib/base/internal/ObjectLifetime.cjs +10 -10
  108. package/src/lib/base/internal/ObjectLifetime.mjs +9 -9
  109. package/src/lib/base/internal/ObjectWeakRefs.cjs +11 -11
  110. package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
  111. package/src/lib/base/internal/PatternManager.cjs +235 -235
  112. package/src/lib/base/internal/PatternManager.mjs +233 -233
  113. package/src/lib/base/internal/StringifyPattern.cjs +26 -26
  114. package/src/lib/base/internal/StringifyPattern.mjs +26 -26
  115. package/src/lib/base/internal/ThrowWarning.cjs +2 -2
  116. package/src/lib/base/internal/ThrowWarning.mjs +2 -2
  117. package/src/lib/core/Alias.cjs +5 -5
  118. package/src/lib/core/Application.cjs +57 -57
  119. package/src/lib/core/Application.mjs +63 -63
  120. package/src/lib/helpers/ArrayToSet.cjs +2 -2
  121. package/src/lib/helpers/ArrayToSet.mjs +3 -3
  122. package/src/lib/helpers/As.cjs +2 -2
  123. package/src/lib/helpers/As.mjs +2 -2
  124. package/src/lib/helpers/ConvertArrayLikeToIterable.cjs +3 -3
  125. package/src/lib/helpers/ConvertArrayLikeToIterable.mjs +3 -3
  126. package/src/lib/helpers/ConvertArrayLikeToStream.cjs +2 -2
  127. package/src/lib/helpers/ConvertArrayLikeToStream.mjs +2 -2
  128. package/src/lib/helpers/Delay.cjs +2 -2
  129. package/src/lib/helpers/Delay.mjs +2 -2
  130. package/src/lib/helpers/DevNull.cjs +2 -2
  131. package/src/lib/helpers/DevNull.mjs +2 -2
  132. package/src/lib/helpers/GetObjectNestingDepth.cjs +12 -12
  133. package/src/lib/helpers/GetObjectNestingDepth.mjs +11 -11
  134. package/src/lib/helpers/GetObjectPropertyPaths.cjs +7 -7
  135. package/src/lib/helpers/GetObjectPropertyPaths.mjs +9 -9
  136. package/src/lib/helpers/Glob.cjs +890 -890
  137. package/src/lib/helpers/Glob.mjs +889 -889
  138. package/src/lib/helpers/GraceExit.cjs +3 -3
  139. package/src/lib/helpers/GraceExit.mjs +7 -7
  140. package/src/lib/helpers/HexToIEEE754.cjs +4 -4
  141. package/src/lib/helpers/HexToIEEE754.mjs +2 -2
  142. package/src/lib/helpers/HexToSigned.cjs +5 -5
  143. package/src/lib/helpers/HexToSigned.mjs +4 -4
  144. package/src/lib/helpers/HexToUnsigned.cjs +2 -2
  145. package/src/lib/helpers/HexToUnsigned.mjs +2 -2
  146. package/src/lib/helpers/IEEE754ToHex.cjs +5 -5
  147. package/src/lib/helpers/IEEE754ToHex.mjs +5 -5
  148. package/src/lib/helpers/IsAbortError.cjs +2 -2
  149. package/src/lib/helpers/IsAbortError.mjs +3 -3
  150. package/src/lib/helpers/IsEmptyObject.cjs +3 -3
  151. package/src/lib/helpers/IsEmptyObject.mjs +3 -3
  152. package/src/lib/helpers/IsExists.cjs +5 -5
  153. package/src/lib/helpers/IsExists.mjs +4 -4
  154. package/src/lib/helpers/IsHtml.cjs +23 -7
  155. package/src/lib/helpers/IsHtml.mjs +23 -7
  156. package/src/lib/helpers/IsNativeFunction.cjs +2 -2
  157. package/src/lib/helpers/IsNativeFunction.mjs +2 -2
  158. package/src/lib/helpers/IsPath.cjs +2 -2
  159. package/src/lib/helpers/IsPath.mjs +5 -5
  160. package/src/lib/helpers/IsPromise.cjs +2 -2
  161. package/src/lib/helpers/IsPromise.mjs +2 -2
  162. package/src/lib/helpers/IsPromiseLike.cjs +5 -5
  163. package/src/lib/helpers/IsPromiseLike.mjs +6 -6
  164. package/src/lib/helpers/IsXML.cjs +1502 -1650
  165. package/src/lib/helpers/IsXML.mjs +1500 -1648
  166. package/src/lib/helpers/MD5.cjs +2 -2
  167. package/src/lib/helpers/MD5.mjs +2 -2
  168. package/src/lib/helpers/MergeArray.cjs +3 -3
  169. package/src/lib/helpers/MergeArray.mjs +3 -3
  170. package/src/lib/helpers/MergeMap.cjs +3 -3
  171. package/src/lib/helpers/MergeMap.mjs +3 -3
  172. package/src/lib/helpers/MergeSet.cjs +2 -2
  173. package/src/lib/helpers/MergeSet.mjs +3 -3
  174. package/src/lib/helpers/NoCase.cjs +27 -27
  175. package/src/lib/helpers/NoCase.mjs +24 -24
  176. package/src/lib/helpers/NonceStr.cjs +2 -2
  177. package/src/lib/helpers/NonceStr.mjs +2 -2
  178. package/src/lib/helpers/ObjectConstructor.cjs +2 -2
  179. package/src/lib/helpers/ObjectConstructor.mjs +4 -4
  180. package/src/lib/helpers/ObjectHash.cjs +234 -234
  181. package/src/lib/helpers/ObjectHash.mjs +227 -227
  182. package/src/lib/helpers/ObjectParentConstructor.cjs +2 -2
  183. package/src/lib/helpers/ObjectParentConstructor.mjs +5 -5
  184. package/src/lib/helpers/ObjectParentConstructors.cjs +6 -6
  185. package/src/lib/helpers/ObjectParentConstructors.mjs +2 -2
  186. package/src/lib/helpers/ObjectPrototype.cjs +2 -2
  187. package/src/lib/helpers/ObjectPrototype.mjs +2 -2
  188. package/src/lib/helpers/ObjectToMap.cjs +2 -2
  189. package/src/lib/helpers/ObjectToMap.mjs +3 -3
  190. package/src/lib/helpers/Paginator.cjs +2 -2
  191. package/src/lib/helpers/Paginator.mjs +6 -6
  192. package/src/lib/helpers/RandomString.cjs +82 -82
  193. package/src/lib/helpers/RandomString.mjs +67 -67
  194. package/src/lib/helpers/SHA1.cjs +2 -2
  195. package/src/lib/helpers/SHA1.mjs +2 -2
  196. package/src/lib/helpers/SHA256.cjs +2 -2
  197. package/src/lib/helpers/SHA256.mjs +2 -2
  198. package/src/lib/helpers/SetToArray.cjs +2 -2
  199. package/src/lib/helpers/SetToArray.mjs +2 -2
  200. package/src/lib/helpers/SignedToHex.cjs +4 -4
  201. package/src/lib/helpers/SignedToHex.mjs +4 -4
  202. package/src/lib/helpers/SortArray.cjs +16 -16
  203. package/src/lib/helpers/SortArray.mjs +15 -15
  204. package/src/lib/helpers/SortKeys.cjs +41 -41
  205. package/src/lib/helpers/SortKeys.mjs +41 -41
  206. package/src/lib/helpers/SortObject.cjs +2 -2
  207. package/src/lib/helpers/SortObject.mjs +2 -2
  208. package/src/lib/helpers/Templating.cjs +25 -25
  209. package/src/lib/helpers/Templating.mjs +25 -25
  210. package/src/lib/helpers/URLBuilder.cjs +234 -234
  211. package/src/lib/helpers/URLBuilder.mjs +231 -231
  212. package/src/lib/helpers/UniqueArray.cjs +3 -3
  213. package/src/lib/helpers/UniqueArray.mjs +2 -2
  214. package/src/lib/helpers/UnsignedToHex.cjs +3 -3
  215. package/src/lib/helpers/UnsignedToHex.mjs +3 -3
  216. package/src/lib/ioc/DependencyInjectionContainer.cjs +106 -106
  217. package/src/lib/ioc/DependencyInjectionContainer.mjs +122 -122
  218. package/src/lib/ioc/FunctionTokenizer.cjs +115 -115
  219. package/src/lib/ioc/FunctionTokenizer.mjs +102 -102
  220. package/src/lib/ioc/Lifetime.cjs +5 -5
  221. package/src/lib/ioc/Lifetime.mjs +5 -5
  222. package/src/lib/ioc/ListModules.cjs +3359 -3359
  223. package/src/lib/ioc/ListModules.mjs +2274 -2274
  224. package/src/lib/ioc/LoadModules.cjs +56 -56
  225. package/src/lib/ioc/LoadModules.mjs +69 -69
  226. package/src/lib/ioc/ParamParser.cjs +30 -30
  227. package/src/lib/ioc/ParamParser.mjs +41 -41
  228. package/src/lib/ioc/Resolvers.cjs +87 -87
  229. package/src/lib/ioc/Resolvers.mjs +109 -109
  230. package/src/lib/ioc/Utils.cjs +12 -12
  231. package/src/lib/ioc/Utils.mjs +18 -18
  232. package/src/lib/validation/VLD.cjs +1124 -1124
  233. package/src/lib/validation/VLD.mjs +1113 -1113
  234. package/src/providers/Database.cjs +2 -2
  235. package/src/providers/Database.mjs +7 -7
  236. package/src/providers/PasswordHash.cjs +330 -330
  237. package/src/providers/PasswordHash.mjs +397 -397
  238. package/vendor/Package.1.cjs +256 -256
  239. package/vendor/Package.1.mjs +254 -254
  240. package/vendor/Package.112.cjs +32208 -32208
  241. package/vendor/Package.112.mjs +32111 -32111
  242. package/vendor/Package.13.cjs +36 -36
  243. package/vendor/Package.13.mjs +24 -24
  244. package/vendor/Package.16.cjs +10312 -10312
  245. package/vendor/Package.16.mjs +10309 -10309
  246. package/vendor/Package.17.cjs +924 -924
  247. package/vendor/Package.17.mjs +943 -943
  248. package/vendor/Package.18.cjs +19 -19
  249. package/vendor/Package.18.mjs +21 -21
  250. package/vendor/Package.19.cjs +19 -19
  251. package/vendor/Package.19.mjs +20 -20
  252. package/vendor/Package.2.cjs +3913 -3913
  253. package/vendor/Package.2.mjs +3931 -3931
  254. package/vendor/Package.20.cjs +16 -16
  255. package/vendor/Package.20.mjs +12 -12
  256. package/vendor/Package.21.cjs +19 -19
  257. package/vendor/Package.21.mjs +17 -17
  258. package/vendor/Package.22.cjs +11 -11
  259. package/vendor/Package.22.mjs +12 -12
  260. package/vendor/Package.23.cjs +8 -8
  261. package/vendor/Package.23.mjs +12 -12
  262. package/vendor/Package.24.cjs +16 -16
  263. package/vendor/Package.24.mjs +14 -14
  264. package/vendor/Package.25.cjs +11 -11
  265. package/vendor/Package.25.mjs +12 -12
  266. package/vendor/Package.26.cjs +19 -19
  267. package/vendor/Package.26.mjs +12 -12
  268. package/vendor/Package.27.cjs +16 -16
  269. package/vendor/Package.27.mjs +6 -6
  270. package/vendor/Package.28.cjs +19 -19
  271. package/vendor/Package.28.mjs +17 -17
  272. package/vendor/Package.29.cjs +15 -15
  273. package/vendor/Package.29.mjs +13 -13
  274. package/vendor/Package.3.cjs +60 -60
  275. package/vendor/Package.3.mjs +85 -85
  276. package/vendor/Package.30.cjs +9 -9
  277. package/vendor/Package.30.mjs +9 -9
  278. package/vendor/Package.31.cjs +14 -14
  279. package/vendor/Package.31.mjs +27 -27
  280. package/vendor/Package.32.cjs +11 -11
  281. package/vendor/Package.32.mjs +11 -11
  282. package/vendor/Package.33.cjs +4 -4
  283. package/vendor/Package.33.mjs +6 -6
  284. package/vendor/Package.34.cjs +10 -10
  285. package/vendor/Package.34.mjs +23 -23
  286. package/vendor/Package.35.cjs +6 -6
  287. package/vendor/Package.35.mjs +16 -16
  288. package/vendor/Package.36.cjs +17 -17
  289. package/vendor/Package.36.mjs +21 -21
  290. package/vendor/Package.37.cjs +15 -15
  291. package/vendor/Package.37.mjs +17 -17
  292. package/vendor/Package.38.cjs +12 -12
  293. package/vendor/Package.38.mjs +16 -16
  294. package/vendor/Package.39.cjs +17 -17
  295. package/vendor/Package.39.mjs +13 -13
  296. package/vendor/Package.4.cjs +412 -412
  297. package/vendor/Package.4.mjs +537 -537
  298. package/vendor/Package.40.cjs +5 -5
  299. package/vendor/Package.40.mjs +6 -6
  300. package/vendor/Package.41.cjs +18 -18
  301. package/vendor/Package.41.mjs +17 -17
  302. package/vendor/Package.42.cjs +24 -24
  303. package/vendor/Package.42.mjs +17 -17
  304. package/vendor/Package.43.cjs +5 -5
  305. package/vendor/Package.43.mjs +19 -19
  306. package/vendor/Package.44.cjs +16 -16
  307. package/vendor/Package.44.mjs +13 -13
  308. package/vendor/Package.45.cjs +21 -21
  309. package/vendor/Package.45.mjs +22 -22
  310. package/vendor/Package.46.cjs +6 -6
  311. package/vendor/Package.46.mjs +22 -22
  312. package/vendor/Package.47.cjs +16 -16
  313. package/vendor/Package.47.mjs +29 -29
  314. package/vendor/Package.48.cjs +8 -8
  315. package/vendor/Package.48.mjs +16 -16
  316. package/vendor/Package.49.cjs +6 -6
  317. package/vendor/Package.49.mjs +20 -20
  318. package/vendor/Package.5.cjs +10 -10
  319. package/vendor/Package.5.mjs +9 -9
  320. package/vendor/Package.50.cjs +13 -13
  321. package/vendor/Package.50.mjs +14 -14
  322. package/vendor/Package.51.cjs +18 -18
  323. package/vendor/Package.51.mjs +23 -23
  324. package/vendor/Package.52.cjs +4 -4
  325. package/vendor/Package.52.mjs +5 -5
  326. package/vendor/Package.53.cjs +6 -6
  327. package/vendor/Package.53.mjs +8 -8
  328. package/vendor/Package.54.cjs +30 -30
  329. package/vendor/Package.54.mjs +29 -29
  330. package/vendor/Package.55.cjs +16 -16
  331. package/vendor/Package.55.mjs +20 -20
  332. package/vendor/Package.56.cjs +14 -14
  333. package/vendor/Package.56.mjs +18 -18
  334. package/vendor/Package.57.cjs +6 -6
  335. package/vendor/Package.57.mjs +17 -17
  336. package/vendor/Package.58.cjs +22 -22
  337. package/vendor/Package.58.mjs +19 -19
  338. package/vendor/Package.59.cjs +18 -18
  339. package/vendor/Package.59.mjs +13 -13
  340. package/vendor/Package.6.cjs +1739 -1739
  341. package/vendor/Package.6.mjs +1739 -1739
  342. package/vendor/Package.60.cjs +13553 -13553
  343. package/vendor/Package.60.mjs +13562 -13562
  344. package/vendor/Package.610.cjs +9 -9
  345. package/vendor/Package.611.cjs +39 -39
  346. package/vendor/Package.611.mjs +22 -22
  347. package/vendor/Package.612.cjs +33 -33
  348. package/vendor/Package.612.mjs +17 -17
  349. package/vendor/Package.613.cjs +62 -62
  350. package/vendor/Package.613.mjs +29 -29
  351. package/vendor/Package.62.cjs +292 -292
  352. package/vendor/Package.62.mjs +312 -312
  353. package/vendor/Package.63.cjs +354 -354
  354. package/vendor/Package.63.mjs +229 -229
  355. package/vendor/Package.64.cjs +74 -74
  356. package/vendor/Package.64.mjs +74 -74
  357. package/vendor/Package.65.cjs +1833 -1833
  358. package/vendor/Package.65.mjs +1656 -1656
  359. package/vendor/Package.66.cjs +16 -16
  360. package/vendor/Package.66.mjs +16 -16
  361. package/vendor/Package.67.cjs +87 -87
  362. package/vendor/Package.67.mjs +85 -85
  363. package/vendor/Package.68.cjs +115 -256
  364. package/vendor/Package.68.mjs +134 -268
  365. package/vendor/Package.69.cjs +8 -8
  366. package/vendor/Package.7.cjs +3 -3
  367. package/vendor/Package.7.mjs +3 -3
  368. package/vendor/Package.9.cjs +45 -45
  369. package/vendor/Package.9.mjs +79 -79
@@ -4,524 +4,519 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- "use strict";
8
-
9
- const e = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
10
-
11
- const t = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
12
-
13
- const i = "[" + e + "][" + t + "]*";
14
-
15
- const n = new RegExp("^" + i + "$");
16
-
17
- function s(e, t) {
18
- const i = [];
19
- let n = t.exec(e);
20
- while (n) {
21
- const s = [];
22
- s.startIndex = t.lastIndex - n[0].length;
23
- const r = n.length;
24
- for (let e = 0; e < r; e++) {
25
- s.push(n[e]);
26
- }
27
- i.push(s);
28
- n = t.exec(e);
29
- }
30
- return i;
31
- }
32
-
33
- const r = function(e) {
34
- const t = n.exec(e);
35
- return !(t === null || typeof t === "undefined");
36
- };
37
-
38
- function o(e) {
39
- return typeof e !== "undefined";
40
- }
41
-
42
- function a(e) {
43
- return Object.keys(e).length === 0;
44
- }
45
-
46
- function l(e, t, i) {
47
- if (t) {
48
- const n = Object.keys(t);
49
- const s = n.length;
50
- for (let r = 0; r < s; r++) {
51
- if (i === "strict") {
52
- e[n[r]] = [ t[n[r]] ];
7
+ const e = require("../../../vendor/Package.5.cjs");
8
+
9
+ var t = {};
10
+
11
+ var i = {};
12
+
13
+ var r;
14
+
15
+ function requireUtil() {
16
+ if (r) return i;
17
+ r = 1;
18
+ (function(e) {
19
+ "use strict";
20
+ const t = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
21
+ const i = t + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
22
+ const r = "[" + t + "][" + i + "]*";
23
+ const n = new RegExp("^" + r + "$");
24
+ const getAllMatches = function(e, t) {
25
+ const i = [];
26
+ let r = t.exec(e);
27
+ while (r) {
28
+ const n = [];
29
+ n.startIndex = t.lastIndex - r[0].length;
30
+ const s = r.length;
31
+ for (let e = 0; e < s; e++) {
32
+ n.push(r[e]);
33
+ }
34
+ i.push(n);
35
+ r = t.exec(e);
36
+ }
37
+ return i;
38
+ };
39
+ const isName = function(e) {
40
+ const t = n.exec(e);
41
+ return !(t === null || typeof t === "undefined");
42
+ };
43
+ e.isExist = function(e) {
44
+ return typeof e !== "undefined";
45
+ };
46
+ e.isEmptyObject = function(e) {
47
+ return Object.keys(e).length === 0;
48
+ };
49
+ e.merge = function(e, t, i) {
50
+ if (t) {
51
+ const r = Object.keys(t);
52
+ const n = r.length;
53
+ for (let s = 0; s < n; s++) {
54
+ if (i === "strict") {
55
+ e[r[s]] = [ t[r[s]] ];
56
+ } else {
57
+ e[r[s]] = t[r[s]];
58
+ }
59
+ }
60
+ }
61
+ };
62
+ e.getValue = function(t) {
63
+ if (e.isExist(t)) {
64
+ return t;
53
65
  } else {
54
- e[n[r]] = t[n[r]];
66
+ return "";
55
67
  }
56
- }
57
- }
58
- }
59
-
60
- function u(e) {
61
- if (exports.isExist(e)) {
62
- return e;
63
- } else {
64
- return "";
65
- }
68
+ };
69
+ e.isName = isName;
70
+ e.getAllMatches = getAllMatches;
71
+ e.nameRegexp = r;
72
+ })(i);
73
+ return i;
66
74
  }
67
75
 
68
- "use strict";
69
-
70
- const f = {
71
- allowBooleanAttributes: false,
72
- unpairedTags: []
73
- };
76
+ var n;
74
77
 
75
- function d(e, t) {
76
- t = Object.assign({}, f, t);
77
- const i = [];
78
- let n = false;
79
- let s = false;
80
- if (e[0] === "\ufeff") {
81
- e = e.substr(1);
82
- }
83
- for (let r = 0; r < e.length; r++) {
84
- if (e[r] === "<" && e[r + 1] === "?") {
85
- r += 2;
86
- r = c(e, r);
87
- if (r.err) return r;
88
- } else if (e[r] === "<") {
89
- let o = r;
90
- r++;
91
- if (e[r] === "!") {
92
- r = p(e, r);
93
- continue;
94
- } else {
95
- let a = false;
96
- if (e[r] === "/") {
97
- a = true;
98
- r++;
99
- }
100
- let l = "";
101
- for (;r < e.length && e[r] !== ">" && e[r] !== " " && e[r] !== "\t" && e[r] !== "\n" && e[r] !== "\r"; r++) {
102
- l += e[r];
103
- }
104
- l = l.trim();
105
- if (l[l.length - 1] === "/") {
106
- l = l.substring(0, l.length - 1);
107
- r--;
108
- }
109
- if (!I(l)) {
110
- let t;
111
- if (l.trim().length === 0) {
112
- t = "Invalid space after '<'.";
113
- } else {
114
- t = "Tag '" + l + "' is an invalid name.";
78
+ function requireValidator() {
79
+ if (n) return t;
80
+ n = 1;
81
+ "use strict";
82
+ const e = requireUtil();
83
+ const i = {
84
+ allowBooleanAttributes: false,
85
+ unpairedTags: []
86
+ };
87
+ t.validate = function(e, t) {
88
+ t = Object.assign({}, i, t);
89
+ const r = [];
90
+ let n = false;
91
+ let s = false;
92
+ if (e[0] === "\ufeff") {
93
+ e = e.substr(1);
94
+ }
95
+ for (let i = 0; i < e.length; i++) {
96
+ if (e[i] === "<" && e[i + 1] === "?") {
97
+ i += 2;
98
+ i = readPI(e, i);
99
+ if (i.err) return i;
100
+ } else if (e[i] === "<") {
101
+ let o = i;
102
+ i++;
103
+ if (e[i] === "!") {
104
+ i = readCommentAndCDATA(e, i);
105
+ continue;
106
+ } else {
107
+ let a = false;
108
+ if (e[i] === "/") {
109
+ a = true;
110
+ i++;
115
111
  }
116
- return T("InvalidTag", t, v(e, r));
117
- }
118
- const u = x(e, r);
119
- if (u === false) {
120
- return T("InvalidAttr", "Attributes for '" + l + "' have open quote.", v(e, r));
121
- }
122
- let f = u.value;
123
- r = u.index;
124
- if (f[f.length - 1] === "/") {
125
- const i = r - f.length;
126
- f = f.substring(0, f.length - 1);
127
- const s = b(f, t);
128
- if (s === true) {
129
- n = true;
130
- } else {
131
- return T(s.err.code, s.err.msg, v(e, i + s.err.line));
112
+ let l = "";
113
+ for (;i < e.length && e[i] !== ">" && e[i] !== " " && e[i] !== "\t" && e[i] !== "\n" && e[i] !== "\r"; i++) {
114
+ l += e[i];
132
115
  }
133
- } else if (a) {
134
- if (!u.tagClosed) {
135
- return T("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", v(e, r));
136
- } else if (f.trim().length > 0) {
137
- return T("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", v(e, o));
138
- } else if (i.length === 0) {
139
- return T("InvalidTag", "Closing tag '" + l + "' has not been opened.", v(e, o));
140
- } else {
141
- const t = i.pop();
142
- if (l !== t.tagName) {
143
- let i = v(e, t.tagStartPos);
144
- return T("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + i.line + ", col " + i.col + ") instead of closing tag '" + l + "'.", v(e, o));
145
- }
146
- if (i.length == 0) {
147
- s = true;
148
- }
116
+ l = l.trim();
117
+ if (l[l.length - 1] === "/") {
118
+ l = l.substring(0, l.length - 1);
119
+ i--;
149
120
  }
150
- } else {
151
- const a = b(f, t);
152
- if (a !== true) {
153
- return T(a.err.code, a.err.msg, v(e, r - f.length + a.err.line));
121
+ if (!validateTagName(l)) {
122
+ let t;
123
+ if (l.trim().length === 0) {
124
+ t = "Invalid space after '<'.";
125
+ } else {
126
+ t = "Tag '" + l + "' is an invalid name.";
127
+ }
128
+ return getErrorObject("InvalidTag", t, getLineNumberForPosition(e, i));
154
129
  }
155
- if (s === true) {
156
- return T("InvalidXml", "Multiple possible root nodes found.", v(e, r));
157
- } else if (t.unpairedTags.indexOf(l) !== -1) {} else {
158
- i.push({
159
- tagName: l,
160
- tagStartPos: o
161
- });
130
+ const u = readAttributeStr(e, i);
131
+ if (u === false) {
132
+ return getErrorObject("InvalidAttr", "Attributes for '" + l + "' have open quote.", getLineNumberForPosition(e, i));
162
133
  }
163
- n = true;
164
- }
165
- for (r++; r < e.length; r++) {
166
- if (e[r] === "<") {
167
- if (e[r + 1] === "!") {
168
- r++;
169
- r = p(e, r);
170
- continue;
171
- } else if (e[r + 1] === "?") {
172
- r = c(e, ++r);
173
- if (r.err) return r;
134
+ let f = u.value;
135
+ i = u.index;
136
+ if (f[f.length - 1] === "/") {
137
+ const r = i - f.length;
138
+ f = f.substring(0, f.length - 1);
139
+ const s = validateAttributeString(f, t);
140
+ if (s === true) {
141
+ n = true;
174
142
  } else {
175
- break;
143
+ return getErrorObject(s.err.code, s.err.msg, getLineNumberForPosition(e, r + s.err.line));
144
+ }
145
+ } else if (a) {
146
+ if (!u.tagClosed) {
147
+ return getErrorObject("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", getLineNumberForPosition(e, i));
148
+ } else if (f.trim().length > 0) {
149
+ return getErrorObject("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", getLineNumberForPosition(e, o));
150
+ } else if (r.length === 0) {
151
+ return getErrorObject("InvalidTag", "Closing tag '" + l + "' has not been opened.", getLineNumberForPosition(e, o));
152
+ } else {
153
+ const t = r.pop();
154
+ if (l !== t.tagName) {
155
+ let i = getLineNumberForPosition(e, t.tagStartPos);
156
+ return getErrorObject("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + i.line + ", col " + i.col + ") instead of closing tag '" + l + "'.", getLineNumberForPosition(e, o));
157
+ }
158
+ if (r.length == 0) {
159
+ s = true;
160
+ }
176
161
  }
177
- } else if (e[r] === "&") {
178
- const t = w(e, r);
179
- if (t == -1) return T("InvalidChar", "char '&' is not expected.", v(e, r));
180
- r = t;
181
162
  } else {
182
- if (s === true && !h(e[r])) {
183
- return T("InvalidXml", "Extra text at the end", v(e, r));
163
+ const a = validateAttributeString(f, t);
164
+ if (a !== true) {
165
+ return getErrorObject(a.err.code, a.err.msg, getLineNumberForPosition(e, i - f.length + a.err.line));
166
+ }
167
+ if (s === true) {
168
+ return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(e, i));
169
+ } else if (t.unpairedTags.indexOf(l) !== -1) {} else {
170
+ r.push({
171
+ tagName: l,
172
+ tagStartPos: o
173
+ });
184
174
  }
175
+ n = true;
176
+ }
177
+ for (i++; i < e.length; i++) {
178
+ if (e[i] === "<") {
179
+ if (e[i + 1] === "!") {
180
+ i++;
181
+ i = readCommentAndCDATA(e, i);
182
+ continue;
183
+ } else if (e[i + 1] === "?") {
184
+ i = readPI(e, ++i);
185
+ if (i.err) return i;
186
+ } else {
187
+ break;
188
+ }
189
+ } else if (e[i] === "&") {
190
+ const t = validateAmpersand(e, i);
191
+ if (t == -1) return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(e, i));
192
+ i = t;
193
+ } else {
194
+ if (s === true && !isWhiteSpace(e[i])) {
195
+ return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(e, i));
196
+ }
197
+ }
198
+ }
199
+ if (e[i] === "<") {
200
+ i--;
185
201
  }
186
202
  }
187
- if (e[r] === "<") {
188
- r--;
203
+ } else {
204
+ if (isWhiteSpace(e[i])) {
205
+ continue;
189
206
  }
207
+ return getErrorObject("InvalidChar", "char '" + e[i] + "' is not expected.", getLineNumberForPosition(e, i));
190
208
  }
191
- } else {
192
- if (h(e[r])) {
193
- continue;
194
- }
195
- return T("InvalidChar", "char '" + e[r] + "' is not expected.", v(e, r));
196
209
  }
197
- }
198
- if (!n) {
199
- return T("InvalidXml", "Start tag expected.", 1);
200
- } else if (i.length == 1) {
201
- return T("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", v(e, i[0].tagStartPos));
202
- } else if (i.length > 0) {
203
- return T("InvalidXml", "Invalid '" + JSON.stringify(i.map((e => e.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
204
- line: 1,
205
- col: 1
206
- });
207
- }
208
- return true;
209
- }
210
-
211
- function h(e) {
212
- return e === " " || e === "\t" || e === "\n" || e === "\r";
213
- }
214
-
215
- function c(e, t) {
216
- const i = t;
217
- for (;t < e.length; t++) {
218
- if (e[t] == "?" || e[t] == " ") {
219
- const n = e.substr(i, t - i);
220
- if (t > 5 && n === "xml") {
221
- return T("InvalidXml", "XML declaration allowed only at the start of the document.", v(e, t));
222
- } else if (e[t] == "?" && e[t + 1] == ">") {
223
- t++;
224
- break;
225
- } else {
226
- continue;
210
+ if (!n) {
211
+ return getErrorObject("InvalidXml", "Start tag expected.", 1);
212
+ } else if (r.length == 1) {
213
+ return getErrorObject("InvalidTag", "Unclosed tag '" + r[0].tagName + "'.", getLineNumberForPosition(e, r[0].tagStartPos));
214
+ } else if (r.length > 0) {
215
+ return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(r.map((e => e.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
216
+ line: 1,
217
+ col: 1
218
+ });
219
+ }
220
+ return true;
221
+ };
222
+ function isWhiteSpace(e) {
223
+ return e === " " || e === "\t" || e === "\n" || e === "\r";
224
+ }
225
+ function readPI(e, t) {
226
+ const i = t;
227
+ for (;t < e.length; t++) {
228
+ if (e[t] == "?" || e[t] == " ") {
229
+ const r = e.substr(i, t - i);
230
+ if (t > 5 && r === "xml") {
231
+ return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(e, t));
232
+ } else if (e[t] == "?" && e[t + 1] == ">") {
233
+ t++;
234
+ break;
235
+ } else {
236
+ continue;
237
+ }
227
238
  }
228
239
  }
240
+ return t;
229
241
  }
230
- return t;
231
- }
232
-
233
- function p(e, t) {
234
- if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
235
- for (t += 3; t < e.length; t++) {
236
- if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
237
- t += 2;
238
- break;
242
+ function readCommentAndCDATA(e, t) {
243
+ if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
244
+ for (t += 3; t < e.length; t++) {
245
+ if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
246
+ t += 2;
247
+ break;
248
+ }
249
+ }
250
+ } else if (e.length > t + 8 && e[t + 1] === "D" && e[t + 2] === "O" && e[t + 3] === "C" && e[t + 4] === "T" && e[t + 5] === "Y" && e[t + 6] === "P" && e[t + 7] === "E") {
251
+ let i = 1;
252
+ for (t += 8; t < e.length; t++) {
253
+ if (e[t] === "<") {
254
+ i++;
255
+ } else if (e[t] === ">") {
256
+ i--;
257
+ if (i === 0) {
258
+ break;
259
+ }
260
+ }
261
+ }
262
+ } else if (e.length > t + 9 && e[t + 1] === "[" && e[t + 2] === "C" && e[t + 3] === "D" && e[t + 4] === "A" && e[t + 5] === "T" && e[t + 6] === "A" && e[t + 7] === "[") {
263
+ for (t += 8; t < e.length; t++) {
264
+ if (e[t] === "]" && e[t + 1] === "]" && e[t + 2] === ">") {
265
+ t += 2;
266
+ break;
267
+ }
239
268
  }
240
269
  }
241
- } else if (e.length > t + 8 && e[t + 1] === "D" && e[t + 2] === "O" && e[t + 3] === "C" && e[t + 4] === "T" && e[t + 5] === "Y" && e[t + 6] === "P" && e[t + 7] === "E") {
242
- let i = 1;
243
- for (t += 8; t < e.length; t++) {
244
- if (e[t] === "<") {
245
- i++;
270
+ return t;
271
+ }
272
+ const r = '"';
273
+ const s = "'";
274
+ function readAttributeStr(e, t) {
275
+ let i = "";
276
+ let n = "";
277
+ let o = false;
278
+ for (;t < e.length; t++) {
279
+ if (e[t] === r || e[t] === s) {
280
+ if (n === "") {
281
+ n = e[t];
282
+ } else if (n !== e[t]) {} else {
283
+ n = "";
284
+ }
246
285
  } else if (e[t] === ">") {
247
- i--;
248
- if (i === 0) {
286
+ if (n === "") {
287
+ o = true;
249
288
  break;
250
289
  }
251
290
  }
291
+ i += e[t];
252
292
  }
253
- } else if (e.length > t + 9 && e[t + 1] === "[" && e[t + 2] === "C" && e[t + 3] === "D" && e[t + 4] === "A" && e[t + 5] === "T" && e[t + 6] === "A" && e[t + 7] === "[") {
254
- for (t += 8; t < e.length; t++) {
255
- if (e[t] === "]" && e[t + 1] === "]" && e[t + 2] === ">") {
256
- t += 2;
257
- break;
258
- }
293
+ if (n !== "") {
294
+ return false;
259
295
  }
296
+ return {
297
+ value: i,
298
+ index: t,
299
+ tagClosed: o
300
+ };
260
301
  }
261
- return t;
262
- }
263
-
264
- const g = '"';
265
-
266
- const m = "'";
267
-
268
- function x(e, t) {
269
- let i = "";
270
- let n = "";
271
- let s = false;
272
- for (;t < e.length; t++) {
273
- if (e[t] === g || e[t] === m) {
274
- if (n === "") {
275
- n = e[t];
276
- } else if (n !== e[t]) {} else {
277
- n = "";
302
+ const o = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
303
+ function validateAttributeString(t, i) {
304
+ const r = e.getAllMatches(t, o);
305
+ const n = {};
306
+ for (let e = 0; e < r.length; e++) {
307
+ if (r[e][1].length === 0) {
308
+ return getErrorObject("InvalidAttr", "Attribute '" + r[e][2] + "' has no space in starting.", getPositionFromMatch(r[e]));
309
+ } else if (r[e][3] !== undefined && r[e][4] === undefined) {
310
+ return getErrorObject("InvalidAttr", "Attribute '" + r[e][2] + "' is without value.", getPositionFromMatch(r[e]));
311
+ } else if (r[e][3] === undefined && !i.allowBooleanAttributes) {
312
+ return getErrorObject("InvalidAttr", "boolean attribute '" + r[e][2] + "' is not allowed.", getPositionFromMatch(r[e]));
278
313
  }
279
- } else if (e[t] === ">") {
280
- if (n === "") {
281
- s = true;
282
- break;
314
+ const t = r[e][2];
315
+ if (!validateAttrName(t)) {
316
+ return getErrorObject("InvalidAttr", "Attribute '" + t + "' is an invalid name.", getPositionFromMatch(r[e]));
317
+ }
318
+ if (!n.hasOwnProperty(t)) {
319
+ n[t] = 1;
320
+ } else {
321
+ return getErrorObject("InvalidAttr", "Attribute '" + t + "' is repeated.", getPositionFromMatch(r[e]));
283
322
  }
284
323
  }
285
- i += e[t];
286
- }
287
- if (n !== "") {
288
- return false;
324
+ return true;
289
325
  }
290
- return {
291
- value: i,
292
- index: t,
293
- tagClosed: s
294
- };
295
- }
296
-
297
- const N = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
298
-
299
- function b(e, t) {
300
- const i = s(e, N);
301
- const n = {};
302
- for (let e = 0; e < i.length; e++) {
303
- if (i[e][1].length === 0) {
304
- return T("InvalidAttr", "Attribute '" + i[e][2] + "' has no space in starting.", O(i[e]));
305
- } else if (i[e][3] !== undefined && i[e][4] === undefined) {
306
- return T("InvalidAttr", "Attribute '" + i[e][2] + "' is without value.", O(i[e]));
307
- } else if (i[e][3] === undefined && !t.allowBooleanAttributes) {
308
- return T("InvalidAttr", "boolean attribute '" + i[e][2] + "' is not allowed.", O(i[e]));
309
- }
310
- const s = i[e][2];
311
- if (!y(s)) {
312
- return T("InvalidAttr", "Attribute '" + s + "' is an invalid name.", O(i[e]));
313
- }
314
- if (!n.hasOwnProperty(s)) {
315
- n[s] = 1;
316
- } else {
317
- return T("InvalidAttr", "Attribute '" + s + "' is repeated.", O(i[e]));
326
+ function validateNumberAmpersand(e, t) {
327
+ let i = /\d/;
328
+ if (e[t] === "x") {
329
+ t++;
330
+ i = /[\da-fA-F]/;
318
331
  }
332
+ for (;t < e.length; t++) {
333
+ if (e[t] === ";") return t;
334
+ if (!e[t].match(i)) break;
335
+ }
336
+ return -1;
319
337
  }
320
- return true;
321
- }
322
-
323
- function E(e, t) {
324
- let i = /\d/;
325
- if (e[t] === "x") {
338
+ function validateAmpersand(e, t) {
326
339
  t++;
327
- i = /[\da-fA-F]/;
340
+ if (e[t] === ";") return -1;
341
+ if (e[t] === "#") {
342
+ t++;
343
+ return validateNumberAmpersand(e, t);
344
+ }
345
+ let i = 0;
346
+ for (;t < e.length; t++, i++) {
347
+ if (e[t].match(/\w/) && i < 20) continue;
348
+ if (e[t] === ";") break;
349
+ return -1;
350
+ }
351
+ return t;
352
+ }
353
+ function getErrorObject(e, t, i) {
354
+ return {
355
+ err: {
356
+ code: e,
357
+ msg: t,
358
+ line: i.line || i,
359
+ col: i.col
360
+ }
361
+ };
328
362
  }
329
- for (;t < e.length; t++) {
330
- if (e[t] === ";") return t;
331
- if (!e[t].match(i)) break;
363
+ function validateAttrName(t) {
364
+ return e.isName(t);
332
365
  }
333
- return -1;
334
- }
335
-
336
- function w(e, t) {
337
- t++;
338
- if (e[t] === ";") return -1;
339
- if (e[t] === "#") {
340
- t++;
341
- return E(e, t);
366
+ function validateTagName(t) {
367
+ return e.isName(t);
342
368
  }
343
- let i = 0;
344
- for (;t < e.length; t++, i++) {
345
- if (e[t].match(/\w/) && i < 20) continue;
346
- if (e[t] === ";") break;
347
- return -1;
369
+ function getLineNumberForPosition(e, t) {
370
+ const i = e.substring(0, t).split(/\r?\n/);
371
+ return {
372
+ line: i.length,
373
+ col: i[i.length - 1].length + 1
374
+ };
375
+ }
376
+ function getPositionFromMatch(e) {
377
+ return e.startIndex + e[1].length;
348
378
  }
349
379
  return t;
350
380
  }
351
381
 
352
- function T(e, t, i) {
353
- return {
354
- err: {
355
- code: e,
356
- msg: t,
357
- line: i.line || i,
358
- col: i.col
382
+ var s = {};
383
+
384
+ var o;
385
+
386
+ function requireOptionsBuilder() {
387
+ if (o) return s;
388
+ o = 1;
389
+ const e = {
390
+ preserveOrder: false,
391
+ attributeNamePrefix: "@_",
392
+ attributesGroupName: false,
393
+ textNodeName: "#text",
394
+ ignoreAttributes: true,
395
+ removeNSPrefix: false,
396
+ allowBooleanAttributes: false,
397
+ parseTagValue: true,
398
+ parseAttributeValue: false,
399
+ trimValues: true,
400
+ cdataPropName: false,
401
+ numberParseOptions: {
402
+ hex: true,
403
+ leadingZeros: true,
404
+ eNotation: true
405
+ },
406
+ tagValueProcessor: function(e, t) {
407
+ return t;
408
+ },
409
+ attributeValueProcessor: function(e, t) {
410
+ return t;
411
+ },
412
+ stopNodes: [],
413
+ alwaysCreateTextNode: false,
414
+ isArray: () => false,
415
+ commentPropName: false,
416
+ unpairedTags: [],
417
+ processEntities: true,
418
+ htmlEntities: false,
419
+ ignoreDeclaration: false,
420
+ ignorePiTags: false,
421
+ transformTagName: false,
422
+ transformAttributeName: false,
423
+ updateTag: function(e, t, i) {
424
+ return e;
359
425
  }
360
426
  };
361
- }
362
-
363
- function y(e) {
364
- return r(e);
365
- }
366
-
367
- function I(e) {
368
- return r(e);
369
- }
370
-
371
- function v(e, t) {
372
- const i = e.substring(0, t).split(/\r?\n/);
373
- return {
374
- line: i.length,
375
- col: i[i.length - 1].length + 1
427
+ const buildOptions = function(t) {
428
+ return Object.assign({}, e, t);
376
429
  };
430
+ s.buildOptions = buildOptions;
431
+ s.defaultOptions = e;
432
+ return s;
377
433
  }
378
434
 
379
- function O(e) {
380
- return e.startIndex + e[1].length;
381
- }
382
-
383
- const P = {
384
- preserveOrder: false,
385
- attributeNamePrefix: "@_",
386
- attributesGroupName: false,
387
- textNodeName: "#text",
388
- ignoreAttributes: true,
389
- removeNSPrefix: false,
390
- allowBooleanAttributes: false,
391
- parseTagValue: true,
392
- parseAttributeValue: false,
393
- trimValues: true,
394
- cdataPropName: false,
395
- numberParseOptions: {
396
- hex: true,
397
- leadingZeros: true,
398
- eNotation: true
399
- },
400
- tagValueProcessor: function(e, t) {
401
- return t;
402
- },
403
- attributeValueProcessor: function(e, t) {
404
- return t;
405
- },
406
- stopNodes: [],
407
- alwaysCreateTextNode: false,
408
- isArray: () => false,
409
- commentPropName: false,
410
- unpairedTags: [],
411
- processEntities: true,
412
- htmlEntities: false,
413
- ignoreDeclaration: false,
414
- ignorePiTags: false,
415
- transformTagName: false,
416
- transformAttributeName: false,
417
- updateTag: function(e, t, i) {
418
- return e;
419
- },
420
- captureMetaData: false
421
- };
422
-
423
- const A = function(e) {
424
- return Object.assign({}, P, e);
425
- };
435
+ var a;
426
436
 
427
- "use strict";
428
-
429
- let S;
437
+ var l;
430
438
 
431
- if (typeof Symbol !== "function") {
432
- S = "@@xmlMetadata";
433
- } else {
434
- S = Symbol("XML Node Metadata");
435
- }
436
-
437
- class XmlNode {
438
- constructor(e) {
439
- this.tagname = e;
440
- this.child = [];
441
- this[":@"] = {};
442
- }
443
- add(e, t) {
444
- if (e === "__proto__") e = "#__proto__";
445
- this.child.push({
446
- [e]: t
447
- });
448
- }
449
- addChild(e, t) {
450
- if (e.tagname === "__proto__") e.tagname = "#__proto__";
451
- if (e[":@"] && Object.keys(e[":@"]).length > 0) {
452
- this.child.push({
453
- [e.tagname]: e.child,
454
- [":@"]: e[":@"]
455
- });
456
- } else {
439
+ function requireXmlNode() {
440
+ if (l) return a;
441
+ l = 1;
442
+ "use strict";
443
+ class XmlNode {
444
+ constructor(e) {
445
+ this.tagname = e;
446
+ this.child = [];
447
+ this[":@"] = {};
448
+ }
449
+ add(e, t) {
450
+ if (e === "__proto__") e = "#__proto__";
457
451
  this.child.push({
458
- [e.tagname]: e.child
452
+ [e]: t
459
453
  });
460
454
  }
461
- if (t !== undefined) {
462
- this.child[this.child.length - 1][S] = {
463
- startIndex: t
464
- };
455
+ addChild(e) {
456
+ if (e.tagname === "__proto__") e.tagname = "#__proto__";
457
+ if (e[":@"] && Object.keys(e[":@"]).length > 0) {
458
+ this.child.push({
459
+ [e.tagname]: e.child,
460
+ [":@"]: e[":@"]
461
+ });
462
+ } else {
463
+ this.child.push({
464
+ [e.tagname]: e.child
465
+ });
466
+ }
465
467
  }
466
468
  }
467
- static getMetaDataSymbol() {
468
- return S;
469
- }
469
+ a = XmlNode;
470
+ return a;
470
471
  }
471
472
 
472
- class DocTypeReader {
473
- constructor(e) {
474
- this.suppressValidationErr = !e;
475
- }
476
- readDocType(e, t) {
473
+ var u;
474
+
475
+ var f;
476
+
477
+ function requireDocTypeReader() {
478
+ if (f) return u;
479
+ f = 1;
480
+ const e = requireUtil();
481
+ function readDocType(e, t) {
477
482
  const i = {};
478
483
  if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
479
484
  t = t + 9;
480
- let n = 1;
481
- let s = false, r = false;
485
+ let r = 1;
486
+ let n = false, s = false;
482
487
  let o = "";
483
488
  for (;t < e.length; t++) {
484
- if (e[t] === "<" && !r) {
485
- if (s && V(e, "!ENTITY", t)) {
489
+ if (e[t] === "<" && !s) {
490
+ if (n && isEntity(e, t)) {
486
491
  t += 7;
487
- let n, s;
488
- [n, s, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr);
489
- if (s.indexOf("&") === -1) i[n] = {
490
- regx: RegExp(`&${n};`, "g"),
491
- val: s
492
+ let r, n;
493
+ [r, n, t] = readEntityExp(e, t + 1);
494
+ if (n.indexOf("&") === -1) i[validateEntityName(r)] = {
495
+ regx: RegExp(`&${r};`, "g"),
496
+ val: n
492
497
  };
493
- } else if (s && V(e, "!ELEMENT", t)) {
494
- t += 8;
495
- const {index: i} = this.readElementExp(e, t + 1);
496
- t = i;
497
- } else if (s && V(e, "!ATTLIST", t)) {
498
- t += 8;
499
- } else if (s && V(e, "!NOTATION", t)) {
500
- t += 9;
501
- const {index: i} = this.readNotationExp(e, t + 1, this.suppressValidationErr);
502
- t = i;
503
- } else if (V(e, "!--", t)) r = true; else throw new Error(`Invalid DOCTYPE`);
504
- n++;
498
+ } else if (n && isElement(e, t)) t += 8; else if (n && isAttlist(e, t)) t += 8; else if (n && isNotation(e, t)) t += 9; else if (isComment) s = true; else throw new Error("Invalid DOCTYPE");
499
+ r++;
505
500
  o = "";
506
501
  } else if (e[t] === ">") {
507
- if (r) {
502
+ if (s) {
508
503
  if (e[t - 1] === "-" && e[t - 2] === "-") {
509
- r = false;
510
- n--;
504
+ s = false;
505
+ r--;
511
506
  }
512
507
  } else {
513
- n--;
508
+ r--;
514
509
  }
515
- if (n === 0) {
510
+ if (r === 0) {
516
511
  break;
517
512
  }
518
513
  } else if (e[t] === "[") {
519
- s = true;
514
+ n = true;
520
515
  } else {
521
516
  o += e[t];
522
517
  }
523
518
  }
524
- if (n !== 0) {
519
+ if (r !== 0) {
525
520
  throw new Error(`Unclosed DOCTYPE`);
526
521
  }
527
522
  } else {
@@ -532,1377 +527,1234 @@ class DocTypeReader {
532
527
  i: t
533
528
  };
534
529
  }
535
- readEntityExp(e, t) {
536
- t = C(e, t);
530
+ function readEntityExp(e, t) {
537
531
  let i = "";
538
- while (t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'") {
532
+ for (;t < e.length && (e[t] !== "'" && e[t] !== '"'); t++) {
539
533
  i += e[t];
540
- t++;
541
- }
542
- D(i);
543
- t = C(e, t);
544
- if (!this.suppressValidationErr) {
545
- if (e.substring(t, t + 6).toUpperCase() === "SYSTEM") {
546
- throw new Error("External entities are not supported");
547
- } else if (e[t] === "%") {
548
- throw new Error("Parameter entities are not supported");
549
- }
550
534
  }
535
+ i = i.trim();
536
+ if (i.indexOf(" ") !== -1) throw new Error("External entites are not supported");
537
+ const r = e[t++];
551
538
  let n = "";
552
- [t, n] = this.readIdentifierVal(e, t, "entity");
553
- t--;
539
+ for (;t < e.length && e[t] !== r; t++) {
540
+ n += e[t];
541
+ }
554
542
  return [ i, n, t ];
555
543
  }
556
- readNotationExp(e, t) {
557
- t = C(e, t);
558
- let i = "";
559
- while (t < e.length && !/\s/.test(e[t])) {
560
- i += e[t];
561
- t++;
562
- }
563
- !this.suppressValidationErr && D(i);
564
- t = C(e, t);
565
- const n = e.substring(t, t + 6).toUpperCase();
566
- if (!this.suppressValidationErr && n !== "SYSTEM" && n !== "PUBLIC") {
567
- throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);
568
- }
569
- t += n.length;
570
- t = C(e, t);
571
- let s = null;
572
- let r = null;
573
- if (n === "PUBLIC") {
574
- [t, s] = this.readIdentifierVal(e, t, "publicIdentifier");
575
- t = C(e, t);
576
- if (e[t] === '"' || e[t] === "'") {
577
- [t, r] = this.readIdentifierVal(e, t, "systemIdentifier");
578
- }
579
- } else if (n === "SYSTEM") {
580
- [t, r] = this.readIdentifierVal(e, t, "systemIdentifier");
581
- if (!this.suppressValidationErr && !r) {
582
- throw new Error("Missing mandatory system identifier for SYSTEM notation");
583
- }
584
- }
585
- return {
586
- notationName: i,
587
- publicIdentifier: s,
588
- systemIdentifier: r,
589
- index: --t
590
- };
544
+ function isComment(e, t) {
545
+ if (e[t + 1] === "!" && e[t + 2] === "-" && e[t + 3] === "-") return true;
546
+ return false;
591
547
  }
592
- readIdentifierVal(e, t, i) {
593
- let n = "";
594
- const s = e[t];
595
- if (s !== '"' && s !== "'") {
596
- throw new Error(`Expected quoted string, found "${s}"`);
597
- }
598
- t++;
599
- while (t < e.length && e[t] !== s) {
600
- n += e[t];
601
- t++;
602
- }
603
- if (e[t] !== s) {
604
- throw new Error(`Unterminated ${i} value`);
605
- }
606
- t++;
607
- return [ t, n ];
548
+ function isEntity(e, t) {
549
+ if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "N" && e[t + 4] === "T" && e[t + 5] === "I" && e[t + 6] === "T" && e[t + 7] === "Y") return true;
550
+ return false;
608
551
  }
609
- readElementExp(e, t) {
610
- t = C(e, t);
611
- let i = "";
612
- while (t < e.length && !/\s/.test(e[t])) {
613
- i += e[t];
614
- t++;
615
- }
616
- if (!this.suppressValidationErr && !r(i)) {
617
- throw new Error(`Invalid element name: "${i}"`);
618
- }
619
- t = C(e, t);
620
- let n = "";
621
- if (e[t] === "E" && V(e, "MPTY", t)) t += 4; else if (e[t] === "A" && V(e, "NY", t)) t += 2; else if (e[t] === "(") {
622
- t++;
623
- while (t < e.length && e[t] !== ")") {
624
- n += e[t];
625
- t++;
626
- }
627
- if (e[t] !== ")") {
628
- throw new Error("Unterminated content model");
629
- }
630
- } else if (!this.suppressValidationErr) {
631
- throw new Error(`Invalid Element Expression, found "${e[t]}"`);
632
- }
633
- return {
634
- elementName: i,
635
- contentModel: n.trim(),
636
- index: t
637
- };
552
+ function isElement(e, t) {
553
+ if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "L" && e[t + 4] === "E" && e[t + 5] === "M" && e[t + 6] === "E" && e[t + 7] === "N" && e[t + 8] === "T") return true;
554
+ return false;
638
555
  }
639
- readAttlistExp(e, t) {
640
- t = C(e, t);
641
- let i = "";
642
- while (t < e.length && !/\s/.test(e[t])) {
643
- i += e[t];
644
- t++;
645
- }
646
- D(i);
647
- t = C(e, t);
648
- let n = "";
649
- while (t < e.length && !/\s/.test(e[t])) {
650
- n += e[t];
651
- t++;
652
- }
653
- if (!D(n)) {
654
- throw new Error(`Invalid attribute name: "${n}"`);
655
- }
656
- t = C(e, t);
657
- let s = "";
658
- if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
659
- s = "NOTATION";
660
- t += 8;
661
- t = C(e, t);
662
- if (e[t] !== "(") {
663
- throw new Error(`Expected '(', found "${e[t]}"`);
664
- }
665
- t++;
666
- let i = [];
667
- while (t < e.length && e[t] !== ")") {
668
- let n = "";
669
- while (t < e.length && e[t] !== "|" && e[t] !== ")") {
670
- n += e[t];
671
- t++;
672
- }
673
- n = n.trim();
674
- if (!D(n)) {
675
- throw new Error(`Invalid notation name: "${n}"`);
676
- }
677
- i.push(n);
678
- if (e[t] === "|") {
679
- t++;
680
- t = C(e, t);
681
- }
682
- }
683
- if (e[t] !== ")") {
684
- throw new Error("Unterminated list of notations");
685
- }
686
- t++;
687
- s += " (" + i.join("|") + ")";
688
- } else {
689
- while (t < e.length && !/\s/.test(e[t])) {
690
- s += e[t];
691
- t++;
692
- }
693
- const i = [ "CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS" ];
694
- if (!this.suppressValidationErr && !i.includes(s.toUpperCase())) {
695
- throw new Error(`Invalid attribute type: "${s}"`);
696
- }
697
- }
698
- t = C(e, t);
699
- let r = "";
700
- if (e.substring(t, t + 8).toUpperCase() === "#REQUIRED") {
701
- r = "#REQUIRED";
702
- t += 8;
703
- } else if (e.substring(t, t + 7).toUpperCase() === "#IMPLIED") {
704
- r = "#IMPLIED";
705
- t += 7;
706
- } else {
707
- [t, r] = this.readIdentifierVal(e, t, "ATTLIST");
708
- }
709
- return {
710
- elementName: i,
711
- attributeName: n,
712
- attributeType: s,
713
- defaultValue: r,
714
- index: t
715
- };
556
+ function isAttlist(e, t) {
557
+ if (e[t + 1] === "!" && e[t + 2] === "A" && e[t + 3] === "T" && e[t + 4] === "T" && e[t + 5] === "L" && e[t + 6] === "I" && e[t + 7] === "S" && e[t + 8] === "T") return true;
558
+ return false;
716
559
  }
717
- }
718
-
719
- const C = (e, t) => {
720
- while (t < e.length && /\s/.test(e[t])) {
721
- t++;
560
+ function isNotation(e, t) {
561
+ if (e[t + 1] === "!" && e[t + 2] === "N" && e[t + 3] === "O" && e[t + 4] === "T" && e[t + 5] === "A" && e[t + 6] === "T" && e[t + 7] === "I" && e[t + 8] === "O" && e[t + 9] === "N") return true;
562
+ return false;
722
563
  }
723
- return t;
724
- };
725
-
726
- function V(e, t, i) {
727
- for (let n = 0; n < t.length; n++) {
728
- if (t[n] !== e[i + n + 1]) return false;
564
+ function validateEntityName(t) {
565
+ if (e.isName(t)) return t; else throw new Error(`Invalid entity name ${t}`);
729
566
  }
730
- return true;
731
- }
732
-
733
- function D(e) {
734
- if (r(e)) return e; else throw new Error(`Invalid entity name ${e}`);
567
+ u = readDocType;
568
+ return u;
735
569
  }
736
570
 
737
- const $ = /^[-+]?0x[a-fA-F0-9]+$/;
571
+ var d;
738
572
 
739
- const j = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
573
+ var c;
740
574
 
741
- const M = {
742
- hex: true,
743
- leadingZeros: true,
744
- decimalPoint: ".",
745
- eNotation: true
746
- };
747
-
748
- function k(e, t = {}) {
749
- t = Object.assign({}, M, t);
750
- if (!e || typeof e !== "string") return e;
751
- let i = e.trim();
752
- if (t.skipLike !== undefined && t.skipLike.test(i)) return e; else if (e === "0") return 0; else if (t.hex && $.test(i)) {
753
- return U(i, 16);
754
- } else if (i.search(/.+[eE].+/) !== -1) {
755
- return _(e, i, t);
756
- } else {
757
- const n = j.exec(i);
758
- if (n) {
759
- const s = n[1] || "";
760
- const r = n[2];
761
- let o = L(n[3]);
762
- const a = s ? e[r.length + 1] === "." : e[r.length] === ".";
763
- if (!t.leadingZeros && (r.length > 1 || r.length === 1 && !a)) {
764
- return e;
765
- } else {
766
- const n = Number(i);
767
- const a = String(n);
768
- if (n === 0) return n;
769
- if (a.search(/[eE]/) !== -1) {
770
- if (t.eNotation) return n; else return e;
771
- } else if (i.indexOf(".") !== -1) {
772
- if (a === "0") return n; else if (a === o) return n; else if (a === `${s}${o}`) return n; else return e;
773
- }
774
- let l = r ? o : i;
775
- if (r) {
776
- return l === a || s + l === a ? n : e;
575
+ function requireStrnum() {
576
+ if (c) return d;
577
+ c = 1;
578
+ const e = /^[-+]?0x[a-fA-F0-9]+$/;
579
+ const t = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
580
+ const i = {
581
+ hex: true,
582
+ leadingZeros: true,
583
+ decimalPoint: ".",
584
+ eNotation: true
585
+ };
586
+ function toNumber(r, n = {}) {
587
+ n = Object.assign({}, i, n);
588
+ if (!r || typeof r !== "string") return r;
589
+ let s = r.trim();
590
+ if (n.skipLike !== undefined && n.skipLike.test(s)) return r; else if (r === "0") return 0; else if (n.hex && e.test(s)) {
591
+ return parse_int(s, 16);
592
+ } else if (s.search(/[eE]/) !== -1) {
593
+ const e = s.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
594
+ if (e) {
595
+ if (n.leadingZeros) {
596
+ s = (e[1] || "") + e[3];
777
597
  } else {
778
- return l === a || l === s + a ? n : e;
598
+ if (e[2] === "0" && e[3][0] === ".") {} else {
599
+ return r;
600
+ }
779
601
  }
602
+ return n.eNotation ? Number(s) : r;
603
+ } else {
604
+ return r;
780
605
  }
781
606
  } else {
607
+ const e = t.exec(s);
608
+ if (e) {
609
+ const t = e[1];
610
+ const i = e[2];
611
+ let o = trimZeros(e[3]);
612
+ if (!n.leadingZeros && i.length > 0 && t && s[2] !== ".") return r; else if (!n.leadingZeros && i.length > 0 && !t && s[1] !== ".") return r; else if (n.leadingZeros && i === r) return 0; else {
613
+ const e = Number(s);
614
+ const a = "" + e;
615
+ if (a.search(/[eE]/) !== -1) {
616
+ if (n.eNotation) return e; else return r;
617
+ } else if (s.indexOf(".") !== -1) {
618
+ if (a === "0" && o === "") return e; else if (a === o) return e; else if (t && a === "-" + o) return e; else return r;
619
+ }
620
+ if (i) {
621
+ return o === a || t + o === a ? e : r;
622
+ } else {
623
+ return s === a || s === t + a ? e : r;
624
+ }
625
+ }
626
+ } else {
627
+ return r;
628
+ }
629
+ }
630
+ }
631
+ function trimZeros(e) {
632
+ if (e && e.indexOf(".") !== -1) {
633
+ e = e.replace(/0+$/, "");
634
+ if (e === ".") e = "0"; else if (e[0] === ".") e = "0" + e; else if (e[e.length - 1] === ".") e = e.substr(0, e.length - 1);
782
635
  return e;
783
636
  }
637
+ return e;
638
+ }
639
+ function parse_int(e, t) {
640
+ if (parseInt) return parseInt(e, t); else if (Number.parseInt) return Number.parseInt(e, t); else if (window && window.parseInt) return window.parseInt(e, t); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
784
641
  }
642
+ d = toNumber;
643
+ return d;
785
644
  }
786
645
 
787
- const F = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
646
+ var g;
788
647
 
789
- function _(e, t, i) {
790
- if (!i.eNotation) return e;
791
- const n = t.match(F);
792
- if (n) {
793
- let s = n[1] || "";
794
- const r = n[3].indexOf("e") === -1 ? "E" : "e";
795
- const o = n[2];
796
- const a = s ? e[o.length + 1] === r : e[o.length] === r;
797
- if (o.length > 1 && a) return e; else if (o.length === 1 && (n[3].startsWith(`.${r}`) || n[3][0] === r)) {
798
- return Number(t);
799
- } else if (i.leadingZeros && !a) {
800
- t = (n[1] || "") + n[3];
801
- return Number(t);
802
- } else return e;
803
- } else {
804
- return e;
805
- }
806
- }
648
+ var p;
807
649
 
808
- function L(e) {
809
- if (e && e.indexOf(".") !== -1) {
810
- e = e.replace(/0+$/, "");
811
- if (e === ".") e = "0"; else if (e[0] === ".") e = "0" + e; else if (e[e.length - 1] === ".") e = e.substring(0, e.length - 1);
812
- return e;
650
+ function requireIgnoreAttributes() {
651
+ if (p) return g;
652
+ p = 1;
653
+ function getIgnoreAttributesFn(e) {
654
+ if (typeof e === "function") {
655
+ return e;
656
+ }
657
+ if (Array.isArray(e)) {
658
+ return t => {
659
+ for (const i of e) {
660
+ if (typeof i === "string" && t === i) {
661
+ return true;
662
+ }
663
+ if (i instanceof RegExp && i.test(t)) {
664
+ return true;
665
+ }
666
+ }
667
+ };
668
+ }
669
+ return () => false;
813
670
  }
814
- return e;
671
+ g = getIgnoreAttributesFn;
672
+ return g;
815
673
  }
816
674
 
817
- function U(e, t) {
818
- if (parseInt) return parseInt(e, t); else if (Number.parseInt) return Number.parseInt(e, t); else if (window && window.parseInt) return window.parseInt(e, t); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
819
- }
820
-
821
- function X(e) {
822
- if (typeof e === "function") {
823
- return e;
824
- }
825
- if (Array.isArray(e)) {
826
- return t => {
827
- for (const i of e) {
828
- if (typeof i === "string" && t === i) {
829
- return true;
675
+ var h;
676
+
677
+ var m;
678
+
679
+ function requireOrderedObjParser() {
680
+ if (m) return h;
681
+ m = 1;
682
+ "use strict";
683
+ const e = requireUtil();
684
+ const t = requireXmlNode();
685
+ const i = requireDocTypeReader();
686
+ const r = requireStrnum();
687
+ const n = requireIgnoreAttributes();
688
+ class OrderedObjParser {
689
+ constructor(e) {
690
+ this.options = e;
691
+ this.currentNode = null;
692
+ this.tagsNodeStack = [];
693
+ this.docTypeEntities = {};
694
+ this.lastEntities = {
695
+ apos: {
696
+ regex: /&(apos|#39|#x27);/g,
697
+ val: "'"
698
+ },
699
+ gt: {
700
+ regex: /&(gt|#62|#x3E);/g,
701
+ val: ">"
702
+ },
703
+ lt: {
704
+ regex: /&(lt|#60|#x3C);/g,
705
+ val: "<"
706
+ },
707
+ quot: {
708
+ regex: /&(quot|#34|#x22);/g,
709
+ val: '"'
830
710
  }
831
- if (i instanceof RegExp && i.test(t)) {
832
- return true;
711
+ };
712
+ this.ampEntity = {
713
+ regex: /&(amp|#38|#x26);/g,
714
+ val: "&"
715
+ };
716
+ this.htmlEntities = {
717
+ space: {
718
+ regex: /&(nbsp|#160);/g,
719
+ val: " "
720
+ },
721
+ cent: {
722
+ regex: /&(cent|#162);/g,
723
+ val: "¢"
724
+ },
725
+ pound: {
726
+ regex: /&(pound|#163);/g,
727
+ val: "£"
728
+ },
729
+ yen: {
730
+ regex: /&(yen|#165);/g,
731
+ val: "¥"
732
+ },
733
+ euro: {
734
+ regex: /&(euro|#8364);/g,
735
+ val: "€"
736
+ },
737
+ copyright: {
738
+ regex: /&(copy|#169);/g,
739
+ val: "©"
740
+ },
741
+ reg: {
742
+ regex: /&(reg|#174);/g,
743
+ val: "®"
744
+ },
745
+ inr: {
746
+ regex: /&(inr|#8377);/g,
747
+ val: "₹"
748
+ },
749
+ num_dec: {
750
+ regex: /&#([0-9]{1,7});/g,
751
+ val: (e, t) => String.fromCharCode(Number.parseInt(t, 10))
752
+ },
753
+ num_hex: {
754
+ regex: /&#x([0-9a-fA-F]{1,6});/g,
755
+ val: (e, t) => String.fromCharCode(Number.parseInt(t, 16))
833
756
  }
834
- }
835
- };
757
+ };
758
+ this.addExternalEntities = addExternalEntities;
759
+ this.parseXml = parseXml;
760
+ this.parseTextData = parseTextData;
761
+ this.resolveNameSpace = resolveNameSpace;
762
+ this.buildAttributesMap = buildAttributesMap;
763
+ this.isItStopNode = isItStopNode;
764
+ this.replaceEntitiesValue = replaceEntitiesValue;
765
+ this.readStopNodeData = readStopNodeData;
766
+ this.saveTextToParentTag = saveTextToParentTag;
767
+ this.addChild = addChild;
768
+ this.ignoreAttributesFn = n(this.options.ignoreAttributes);
769
+ }
770
+ }
771
+ function addExternalEntities(e) {
772
+ const t = Object.keys(e);
773
+ for (let i = 0; i < t.length; i++) {
774
+ const r = t[i];
775
+ this.lastEntities[r] = {
776
+ regex: new RegExp("&" + r + ";", "g"),
777
+ val: e[r]
778
+ };
779
+ }
836
780
  }
837
- return () => false;
838
- }
839
-
840
- "use strict";
841
-
842
- class OrderedObjParser {
843
- constructor(e) {
844
- this.options = e;
845
- this.currentNode = null;
846
- this.tagsNodeStack = [];
847
- this.docTypeEntities = {};
848
- this.lastEntities = {
849
- apos: {
850
- regex: /&(apos|#39|#x27);/g,
851
- val: "'"
852
- },
853
- gt: {
854
- regex: /&(gt|#62|#x3E);/g,
855
- val: ">"
856
- },
857
- lt: {
858
- regex: /&(lt|#60|#x3C);/g,
859
- val: "<"
860
- },
861
- quot: {
862
- regex: /&(quot|#34|#x22);/g,
863
- val: '"'
864
- }
865
- };
866
- this.ampEntity = {
867
- regex: /&(amp|#38|#x26);/g,
868
- val: "&"
869
- };
870
- this.htmlEntities = {
871
- space: {
872
- regex: /&(nbsp|#160);/g,
873
- val: " "
874
- },
875
- cent: {
876
- regex: /&(cent|#162);/g,
877
- val: "¢"
878
- },
879
- pound: {
880
- regex: /&(pound|#163);/g,
881
- val: "£"
882
- },
883
- yen: {
884
- regex: /&(yen|#165);/g,
885
- val: "¥"
886
- },
887
- euro: {
888
- regex: /&(euro|#8364);/g,
889
- val: "€"
890
- },
891
- copyright: {
892
- regex: /&(copy|#169);/g,
893
- val: "©"
894
- },
895
- reg: {
896
- regex: /&(reg|#174);/g,
897
- val: "®"
898
- },
899
- inr: {
900
- regex: /&(inr|#8377);/g,
901
- val: "₹"
902
- },
903
- num_dec: {
904
- regex: /&#([0-9]{1,7});/g,
905
- val: (e, t) => String.fromCodePoint(Number.parseInt(t, 10))
906
- },
907
- num_hex: {
908
- regex: /&#x([0-9a-fA-F]{1,6});/g,
909
- val: (e, t) => String.fromCodePoint(Number.parseInt(t, 16))
781
+ function parseTextData(e, t, i, r, n, s, o) {
782
+ if (e !== undefined) {
783
+ if (this.options.trimValues && !r) {
784
+ e = e.trim();
910
785
  }
911
- };
912
- this.addExternalEntities = R;
913
- this.parseXml = q;
914
- this.parseTextData = B;
915
- this.resolveNameSpace = Y;
916
- this.buildAttributesMap = W;
917
- this.isItStopNode = z;
918
- this.replaceEntitiesValue = K;
919
- this.readStopNodeData = te;
920
- this.saveTextToParentTag = Q;
921
- this.addChild = Z;
922
- this.ignoreAttributesFn = X(this.options.ignoreAttributes);
923
- if (this.options.stopNodes && this.options.stopNodes.length > 0) {
924
- this.stopNodesExact = new Set;
925
- this.stopNodesWildcard = new Set;
926
- for (let e = 0; e < this.options.stopNodes.length; e++) {
927
- const t = this.options.stopNodes[e];
928
- if (typeof t !== "string") continue;
929
- if (t.startsWith("*.")) {
930
- this.stopNodesWildcard.add(t.substring(2));
786
+ if (e.length > 0) {
787
+ if (!o) e = this.replaceEntitiesValue(e);
788
+ const r = this.options.tagValueProcessor(t, e, i, n, s);
789
+ if (r === null || r === undefined) {
790
+ return e;
791
+ } else if (typeof r !== typeof e || r !== e) {
792
+ return r;
793
+ } else if (this.options.trimValues) {
794
+ return parseValue(e, this.options.parseTagValue, this.options.numberParseOptions);
931
795
  } else {
932
- this.stopNodesExact.add(t);
796
+ const t = e.trim();
797
+ if (t === e) {
798
+ return parseValue(e, this.options.parseTagValue, this.options.numberParseOptions);
799
+ } else {
800
+ return e;
801
+ }
933
802
  }
934
803
  }
935
804
  }
936
805
  }
937
- }
938
-
939
- function R(e) {
940
- const t = Object.keys(e);
941
- for (let i = 0; i < t.length; i++) {
942
- const n = t[i];
943
- this.lastEntities[n] = {
944
- regex: new RegExp("&" + n + ";", "g"),
945
- val: e[n]
946
- };
947
- }
948
- }
949
-
950
- function B(e, t, i, n, s, r, o) {
951
- if (e !== undefined) {
952
- if (this.options.trimValues && !n) {
953
- e = e.trim();
954
- }
955
- if (e.length > 0) {
956
- if (!o) e = this.replaceEntitiesValue(e);
957
- const n = this.options.tagValueProcessor(t, e, i, s, r);
958
- if (n === null || n === undefined) {
959
- return e;
960
- } else if (typeof n !== typeof e || n !== e) {
961
- return n;
962
- } else if (this.options.trimValues) {
963
- return ie(e, this.options.parseTagValue, this.options.numberParseOptions);
964
- } else {
965
- const t = e.trim();
966
- if (t === e) {
967
- return ie(e, this.options.parseTagValue, this.options.numberParseOptions);
968
- } else {
969
- return e;
970
- }
806
+ function resolveNameSpace(e) {
807
+ if (this.options.removeNSPrefix) {
808
+ const t = e.split(":");
809
+ const i = e.charAt(0) === "/" ? "/" : "";
810
+ if (t[0] === "xmlns") {
811
+ return "";
812
+ }
813
+ if (t.length === 2) {
814
+ e = i + t[1];
971
815
  }
972
816
  }
817
+ return e;
973
818
  }
974
- }
975
-
976
- function Y(e) {
977
- if (this.options.removeNSPrefix) {
978
- const t = e.split(":");
979
- const i = e.charAt(0) === "/" ? "/" : "";
980
- if (t[0] === "xmlns") {
981
- return "";
982
- }
983
- if (t.length === 2) {
984
- e = i + t[1];
819
+ const s = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
820
+ function buildAttributesMap(t, i, r) {
821
+ if (this.options.ignoreAttributes !== true && typeof t === "string") {
822
+ const r = e.getAllMatches(t, s);
823
+ const n = r.length;
824
+ const o = {};
825
+ for (let e = 0; e < n; e++) {
826
+ const t = this.resolveNameSpace(r[e][1]);
827
+ if (this.ignoreAttributesFn(t, i)) {
828
+ continue;
829
+ }
830
+ let n = r[e][4];
831
+ let s = this.options.attributeNamePrefix + t;
832
+ if (t.length) {
833
+ if (this.options.transformAttributeName) {
834
+ s = this.options.transformAttributeName(s);
835
+ }
836
+ if (s === "__proto__") s = "#__proto__";
837
+ if (n !== undefined) {
838
+ if (this.options.trimValues) {
839
+ n = n.trim();
840
+ }
841
+ n = this.replaceEntitiesValue(n);
842
+ const e = this.options.attributeValueProcessor(t, n, i);
843
+ if (e === null || e === undefined) {
844
+ o[s] = n;
845
+ } else if (typeof e !== typeof n || e !== n) {
846
+ o[s] = e;
847
+ } else {
848
+ o[s] = parseValue(n, this.options.parseAttributeValue, this.options.numberParseOptions);
849
+ }
850
+ } else if (this.options.allowBooleanAttributes) {
851
+ o[s] = true;
852
+ }
853
+ }
854
+ }
855
+ if (!Object.keys(o).length) {
856
+ return;
857
+ }
858
+ if (this.options.attributesGroupName) {
859
+ const e = {};
860
+ e[this.options.attributesGroupName] = o;
861
+ return e;
862
+ }
863
+ return o;
985
864
  }
986
865
  }
987
- return e;
988
- }
989
-
990
- const G = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
991
-
992
- function W(e, t, i) {
993
- if (this.options.ignoreAttributes !== true && typeof e === "string") {
994
- const i = s(e, G);
995
- const n = i.length;
996
- const r = {};
997
- for (let e = 0; e < n; e++) {
998
- const n = this.resolveNameSpace(i[e][1]);
999
- if (this.ignoreAttributesFn(n, t)) {
1000
- continue;
1001
- }
1002
- let s = i[e][4];
1003
- let o = this.options.attributeNamePrefix + n;
1004
- if (n.length) {
1005
- if (this.options.transformAttributeName) {
1006
- o = this.options.transformAttributeName(o);
1007
- }
1008
- if (o === "__proto__") o = "#__proto__";
1009
- if (s !== undefined) {
1010
- if (this.options.trimValues) {
1011
- s = s.trim();
866
+ const parseXml = function(e) {
867
+ e = e.replace(/\r\n?/g, "\n");
868
+ const r = new t("!xml");
869
+ let n = r;
870
+ let s = "";
871
+ let o = "";
872
+ for (let a = 0; a < e.length; a++) {
873
+ const l = e[a];
874
+ if (l === "<") {
875
+ if (e[a + 1] === "/") {
876
+ const t = findClosingIndex(e, ">", a, "Closing Tag is not closed.");
877
+ let i = e.substring(a + 2, t).trim();
878
+ if (this.options.removeNSPrefix) {
879
+ const e = i.indexOf(":");
880
+ if (e !== -1) {
881
+ i = i.substr(e + 1);
882
+ }
883
+ }
884
+ if (this.options.transformTagName) {
885
+ i = this.options.transformTagName(i);
1012
886
  }
1013
- s = this.replaceEntitiesValue(s);
1014
- const e = this.options.attributeValueProcessor(n, s, t);
1015
- if (e === null || e === undefined) {
1016
- r[o] = s;
1017
- } else if (typeof e !== typeof s || e !== s) {
1018
- r[o] = e;
887
+ if (n) {
888
+ s = this.saveTextToParentTag(s, n, o);
889
+ }
890
+ const r = o.substring(o.lastIndexOf(".") + 1);
891
+ if (i && this.options.unpairedTags.indexOf(i) !== -1) {
892
+ throw new Error(`Unpaired tag can not be used as closing tag: </${i}>`);
893
+ }
894
+ let l = 0;
895
+ if (r && this.options.unpairedTags.indexOf(r) !== -1) {
896
+ l = o.lastIndexOf(".", o.lastIndexOf(".") - 1);
897
+ this.tagsNodeStack.pop();
1019
898
  } else {
1020
- r[o] = ie(s, this.options.parseAttributeValue, this.options.numberParseOptions);
899
+ l = o.lastIndexOf(".");
1021
900
  }
1022
- } else if (this.options.allowBooleanAttributes) {
1023
- r[o] = true;
1024
- }
1025
- }
1026
- }
1027
- if (!Object.keys(r).length) {
1028
- return;
1029
- }
1030
- if (this.options.attributesGroupName) {
1031
- const e = {};
1032
- e[this.options.attributesGroupName] = r;
1033
- return e;
1034
- }
1035
- return r;
1036
- }
1037
- }
1038
-
1039
- const q = function(e) {
1040
- e = e.replace(/\r\n?/g, "\n");
1041
- const t = new XmlNode("!xml");
1042
- let i = t;
1043
- let n = "";
1044
- let s = "";
1045
- const r = new DocTypeReader(this.options.processEntities);
1046
- for (let o = 0; o < e.length; o++) {
1047
- const a = e[o];
1048
- if (a === "<") {
1049
- if (e[o + 1] === "/") {
1050
- const t = H(e, ">", o, "Closing Tag is not closed.");
1051
- let r = e.substring(o + 2, t).trim();
1052
- if (this.options.removeNSPrefix) {
1053
- const e = r.indexOf(":");
1054
- if (e !== -1) {
1055
- r = r.substr(e + 1);
901
+ o = o.substring(0, l);
902
+ n = this.tagsNodeStack.pop();
903
+ s = "";
904
+ a = t;
905
+ } else if (e[a + 1] === "?") {
906
+ let i = readTagExp(e, a, false, "?>");
907
+ if (!i) throw new Error("Pi Tag is not closed.");
908
+ s = this.saveTextToParentTag(s, n, o);
909
+ if (this.options.ignoreDeclaration && i.tagName === "?xml" || this.options.ignorePiTags) {} else {
910
+ const e = new t(i.tagName);
911
+ e.add(this.options.textNodeName, "");
912
+ if (i.tagName !== i.tagExp && i.attrExpPresent) {
913
+ e[":@"] = this.buildAttributesMap(i.tagExp, o, i.tagName);
914
+ }
915
+ this.addChild(n, e, o);
1056
916
  }
1057
- }
1058
- if (this.options.transformTagName) {
1059
- r = this.options.transformTagName(r);
1060
- }
1061
- if (i) {
1062
- n = this.saveTextToParentTag(n, i, s);
1063
- }
1064
- const a = s.substring(s.lastIndexOf(".") + 1);
1065
- if (r && this.options.unpairedTags.indexOf(r) !== -1) {
1066
- throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);
1067
- }
1068
- let l = 0;
1069
- if (a && this.options.unpairedTags.indexOf(a) !== -1) {
1070
- l = s.lastIndexOf(".", s.lastIndexOf(".") - 1);
1071
- this.tagsNodeStack.pop();
1072
- } else {
1073
- l = s.lastIndexOf(".");
1074
- }
1075
- s = s.substring(0, l);
1076
- i = this.tagsNodeStack.pop();
1077
- n = "";
1078
- o = t;
1079
- } else if (e[o + 1] === "?") {
1080
- let t = ee(e, o, false, "?>");
1081
- if (!t) throw new Error("Pi Tag is not closed.");
1082
- n = this.saveTextToParentTag(n, i, s);
1083
- if (this.options.ignoreDeclaration && t.tagName === "?xml" || this.options.ignorePiTags) {} else {
1084
- const e = new XmlNode(t.tagName);
1085
- e.add(this.options.textNodeName, "");
1086
- if (t.tagName !== t.tagExp && t.attrExpPresent) {
1087
- e[":@"] = this.buildAttributesMap(t.tagExp, s, t.tagName);
917
+ a = i.closeIndex + 1;
918
+ } else if (e.substr(a + 1, 3) === "!--") {
919
+ const t = findClosingIndex(e, "--\x3e", a + 4, "Comment is not closed.");
920
+ if (this.options.commentPropName) {
921
+ const i = e.substring(a + 4, t - 2);
922
+ s = this.saveTextToParentTag(s, n, o);
923
+ n.add(this.options.commentPropName, [ {
924
+ [this.options.textNodeName]: i
925
+ } ]);
1088
926
  }
1089
- this.addChild(i, e, s, o);
1090
- }
1091
- o = t.closeIndex + 1;
1092
- } else if (e.substr(o + 1, 3) === "!--") {
1093
- const t = H(e, "--\x3e", o + 4, "Comment is not closed.");
1094
- if (this.options.commentPropName) {
1095
- const r = e.substring(o + 4, t - 2);
1096
- n = this.saveTextToParentTag(n, i, s);
1097
- i.add(this.options.commentPropName, [ {
1098
- [this.options.textNodeName]: r
1099
- } ]);
1100
- }
1101
- o = t;
1102
- } else if (e.substr(o + 1, 2) === "!D") {
1103
- const t = r.readDocType(e, o);
1104
- this.docTypeEntities = t.entities;
1105
- o = t.i;
1106
- } else if (e.substr(o + 1, 2) === "![") {
1107
- const t = H(e, "]]>", o, "CDATA is not closed.") - 2;
1108
- const r = e.substring(o + 9, t);
1109
- n = this.saveTextToParentTag(n, i, s);
1110
- let a = this.parseTextData(r, i.tagname, s, true, false, true, true);
1111
- if (a == undefined) a = "";
1112
- if (this.options.cdataPropName) {
1113
- i.add(this.options.cdataPropName, [ {
1114
- [this.options.textNodeName]: r
1115
- } ]);
927
+ a = t;
928
+ } else if (e.substr(a + 1, 2) === "!D") {
929
+ const t = i(e, a);
930
+ this.docTypeEntities = t.entities;
931
+ a = t.i;
932
+ } else if (e.substr(a + 1, 2) === "![") {
933
+ const t = findClosingIndex(e, "]]>", a, "CDATA is not closed.") - 2;
934
+ const i = e.substring(a + 9, t);
935
+ s = this.saveTextToParentTag(s, n, o);
936
+ let r = this.parseTextData(i, n.tagname, o, true, false, true, true);
937
+ if (r == undefined) r = "";
938
+ if (this.options.cdataPropName) {
939
+ n.add(this.options.cdataPropName, [ {
940
+ [this.options.textNodeName]: i
941
+ } ]);
942
+ } else {
943
+ n.add(this.options.textNodeName, r);
944
+ }
945
+ a = t + 2;
1116
946
  } else {
1117
- i.add(this.options.textNodeName, a);
1118
- }
1119
- o = t + 2;
1120
- } else {
1121
- let r = ee(e, o, this.options.removeNSPrefix);
1122
- let a = r.tagName;
1123
- const l = r.rawTagName;
1124
- let u = r.tagExp;
1125
- let f = r.attrExpPresent;
1126
- let d = r.closeIndex;
1127
- if (this.options.transformTagName) {
1128
- a = this.options.transformTagName(a);
1129
- }
1130
- if (i && n) {
1131
- if (i.tagname !== "!xml") {
1132
- n = this.saveTextToParentTag(n, i, s, false);
947
+ let i = readTagExp(e, a, this.options.removeNSPrefix);
948
+ let l = i.tagName;
949
+ const u = i.rawTagName;
950
+ let f = i.tagExp;
951
+ let d = i.attrExpPresent;
952
+ let c = i.closeIndex;
953
+ if (this.options.transformTagName) {
954
+ l = this.options.transformTagName(l);
1133
955
  }
1134
- }
1135
- const h = i;
1136
- if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1) {
1137
- i = this.tagsNodeStack.pop();
1138
- s = s.substring(0, s.lastIndexOf("."));
1139
- }
1140
- if (a !== t.tagname) {
1141
- s += s ? "." + a : a;
1142
- }
1143
- const c = o;
1144
- if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s, a)) {
1145
- let t = "";
1146
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
1147
- if (a[a.length - 1] === "/") {
1148
- a = a.substr(0, a.length - 1);
1149
- s = s.substr(0, s.length - 1);
1150
- u = a;
1151
- } else {
1152
- u = u.substr(0, u.length - 1);
956
+ if (n && s) {
957
+ if (n.tagname !== "!xml") {
958
+ s = this.saveTextToParentTag(s, n, o, false);
1153
959
  }
1154
- o = r.closeIndex;
1155
- } else if (this.options.unpairedTags.indexOf(a) !== -1) {
1156
- o = r.closeIndex;
1157
- } else {
1158
- const i = this.readStopNodeData(e, l, d + 1);
1159
- if (!i) throw new Error(`Unexpected end of ${l}`);
1160
- o = i.i;
1161
- t = i.tagContent;
1162
960
  }
1163
- const n = new XmlNode(a);
1164
- if (a !== u && f) {
1165
- n[":@"] = this.buildAttributesMap(u, s, a);
961
+ const g = n;
962
+ if (g && this.options.unpairedTags.indexOf(g.tagname) !== -1) {
963
+ n = this.tagsNodeStack.pop();
964
+ o = o.substring(0, o.lastIndexOf("."));
1166
965
  }
1167
- if (t) {
1168
- t = this.parseTextData(t, a, s, true, f, true, true);
966
+ if (l !== r.tagname) {
967
+ o += o ? "." + l : l;
1169
968
  }
1170
- s = s.substr(0, s.lastIndexOf("."));
1171
- n.add(this.options.textNodeName, t);
1172
- this.addChild(i, n, s, c);
1173
- } else {
1174
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
1175
- if (a[a.length - 1] === "/") {
1176
- a = a.substr(0, a.length - 1);
1177
- s = s.substr(0, s.length - 1);
1178
- u = a;
969
+ if (this.isItStopNode(this.options.stopNodes, o, l)) {
970
+ let r = "";
971
+ if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
972
+ if (l[l.length - 1] === "/") {
973
+ l = l.substr(0, l.length - 1);
974
+ o = o.substr(0, o.length - 1);
975
+ f = l;
976
+ } else {
977
+ f = f.substr(0, f.length - 1);
978
+ }
979
+ a = i.closeIndex;
980
+ } else if (this.options.unpairedTags.indexOf(l) !== -1) {
981
+ a = i.closeIndex;
1179
982
  } else {
1180
- u = u.substr(0, u.length - 1);
983
+ const t = this.readStopNodeData(e, u, c + 1);
984
+ if (!t) throw new Error(`Unexpected end of ${u}`);
985
+ a = t.i;
986
+ r = t.tagContent;
1181
987
  }
1182
- if (this.options.transformTagName) {
1183
- a = this.options.transformTagName(a);
988
+ const s = new t(l);
989
+ if (l !== f && d) {
990
+ s[":@"] = this.buildAttributesMap(f, o, l);
1184
991
  }
1185
- const e = new XmlNode(a);
1186
- if (a !== u && f) {
1187
- e[":@"] = this.buildAttributesMap(u, s, a);
992
+ if (r) {
993
+ r = this.parseTextData(r, l, o, true, d, true, true);
1188
994
  }
1189
- this.addChild(i, e, s, c);
1190
- s = s.substr(0, s.lastIndexOf("."));
995
+ o = o.substr(0, o.lastIndexOf("."));
996
+ s.add(this.options.textNodeName, r);
997
+ this.addChild(n, s, o);
1191
998
  } else {
1192
- const e = new XmlNode(a);
1193
- this.tagsNodeStack.push(i);
1194
- if (a !== u && f) {
1195
- e[":@"] = this.buildAttributesMap(u, s, a);
999
+ if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
1000
+ if (l[l.length - 1] === "/") {
1001
+ l = l.substr(0, l.length - 1);
1002
+ o = o.substr(0, o.length - 1);
1003
+ f = l;
1004
+ } else {
1005
+ f = f.substr(0, f.length - 1);
1006
+ }
1007
+ if (this.options.transformTagName) {
1008
+ l = this.options.transformTagName(l);
1009
+ }
1010
+ const e = new t(l);
1011
+ if (l !== f && d) {
1012
+ e[":@"] = this.buildAttributesMap(f, o, l);
1013
+ }
1014
+ this.addChild(n, e, o);
1015
+ o = o.substr(0, o.lastIndexOf("."));
1016
+ } else {
1017
+ const e = new t(l);
1018
+ this.tagsNodeStack.push(n);
1019
+ if (l !== f && d) {
1020
+ e[":@"] = this.buildAttributesMap(f, o, l);
1021
+ }
1022
+ this.addChild(n, e, o);
1023
+ n = e;
1196
1024
  }
1197
- this.addChild(i, e, s, c);
1198
- i = e;
1025
+ s = "";
1026
+ a = c;
1199
1027
  }
1200
- n = "";
1201
- o = d;
1202
1028
  }
1029
+ } else {
1030
+ s += e[a];
1203
1031
  }
1032
+ }
1033
+ return r.child;
1034
+ };
1035
+ function addChild(e, t, i) {
1036
+ const r = this.options.updateTag(t.tagname, i, t[":@"]);
1037
+ if (r === false) {} else if (typeof r === "string") {
1038
+ t.tagname = r;
1039
+ e.addChild(t);
1204
1040
  } else {
1205
- n += e[o];
1041
+ e.addChild(t);
1206
1042
  }
1207
1043
  }
1208
- return t.child;
1209
- };
1210
-
1211
- function Z(e, t, i, n) {
1212
- if (!this.options.captureMetaData) n = undefined;
1213
- const s = this.options.updateTag(t.tagname, i, t[":@"]);
1214
- if (s === false) {} else if (typeof s === "string") {
1215
- t.tagname = s;
1216
- e.addChild(t, n);
1217
- } else {
1218
- e.addChild(t, n);
1219
- }
1220
- }
1221
-
1222
- const K = function(e) {
1223
- if (this.options.processEntities) {
1224
- for (let t in this.docTypeEntities) {
1225
- const i = this.docTypeEntities[t];
1226
- e = e.replace(i.regx, i.val);
1227
- }
1228
- for (let t in this.lastEntities) {
1229
- const i = this.lastEntities[t];
1230
- e = e.replace(i.regex, i.val);
1231
- }
1232
- if (this.options.htmlEntities) {
1233
- for (let t in this.htmlEntities) {
1234
- const i = this.htmlEntities[t];
1044
+ const replaceEntitiesValue = function(e) {
1045
+ if (this.options.processEntities) {
1046
+ for (let t in this.docTypeEntities) {
1047
+ const i = this.docTypeEntities[t];
1048
+ e = e.replace(i.regx, i.val);
1049
+ }
1050
+ for (let t in this.lastEntities) {
1051
+ const i = this.lastEntities[t];
1235
1052
  e = e.replace(i.regex, i.val);
1236
1053
  }
1054
+ if (this.options.htmlEntities) {
1055
+ for (let t in this.htmlEntities) {
1056
+ const i = this.htmlEntities[t];
1057
+ e = e.replace(i.regex, i.val);
1058
+ }
1059
+ }
1060
+ e = e.replace(this.ampEntity.regex, this.ampEntity.val);
1237
1061
  }
1238
- e = e.replace(this.ampEntity.regex, this.ampEntity.val);
1062
+ return e;
1063
+ };
1064
+ function saveTextToParentTag(e, t, i, r) {
1065
+ if (e) {
1066
+ if (r === undefined) r = t.child.length === 0;
1067
+ e = this.parseTextData(e, t.tagname, i, false, t[":@"] ? Object.keys(t[":@"]).length !== 0 : false, r);
1068
+ if (e !== undefined && e !== "") t.add(this.options.textNodeName, e);
1069
+ e = "";
1070
+ }
1071
+ return e;
1239
1072
  }
1240
- return e;
1241
- };
1242
-
1243
- function Q(e, t, i, n) {
1244
- if (e) {
1245
- if (n === undefined) n = t.child.length === 0;
1246
- e = this.parseTextData(e, t.tagname, i, false, t[":@"] ? Object.keys(t[":@"]).length !== 0 : false, n);
1247
- if (e !== undefined && e !== "") t.add(this.options.textNodeName, e);
1248
- e = "";
1073
+ function isItStopNode(e, t, i) {
1074
+ const r = "*." + i;
1075
+ for (const i in e) {
1076
+ const n = e[i];
1077
+ if (r === n || t === n) return true;
1078
+ }
1079
+ return false;
1249
1080
  }
1250
- return e;
1251
- }
1252
-
1253
- function z(e, t, i, n) {
1254
- if (t && t.has(n)) return true;
1255
- if (e && e.has(i)) return true;
1256
- return false;
1257
- }
1258
-
1259
- function J(e, t, i = ">") {
1260
- let n;
1261
- let s = "";
1262
- for (let r = t; r < e.length; r++) {
1263
- let t = e[r];
1264
- if (n) {
1265
- if (t === n) n = "";
1266
- } else if (t === '"' || t === "'") {
1267
- n = t;
1268
- } else if (t === i[0]) {
1269
- if (i[1]) {
1270
- if (e[r + 1] === i[1]) {
1081
+ function tagExpWithClosingIndex(e, t, i = ">") {
1082
+ let r;
1083
+ let n = "";
1084
+ for (let s = t; s < e.length; s++) {
1085
+ let t = e[s];
1086
+ if (r) {
1087
+ if (t === r) r = "";
1088
+ } else if (t === '"' || t === "'") {
1089
+ r = t;
1090
+ } else if (t === i[0]) {
1091
+ if (i[1]) {
1092
+ if (e[s + 1] === i[1]) {
1093
+ return {
1094
+ data: n,
1095
+ index: s
1096
+ };
1097
+ }
1098
+ } else {
1271
1099
  return {
1272
- data: s,
1273
- index: r
1100
+ data: n,
1101
+ index: s
1274
1102
  };
1275
1103
  }
1276
- } else {
1277
- return {
1278
- data: s,
1279
- index: r
1280
- };
1104
+ } else if (t === "\t") {
1105
+ t = " ";
1281
1106
  }
1282
- } else if (t === "\t") {
1283
- t = " ";
1107
+ n += t;
1284
1108
  }
1285
- s += t;
1286
- }
1287
- }
1288
-
1289
- function H(e, t, i, n) {
1290
- const s = e.indexOf(t, i);
1291
- if (s === -1) {
1292
- throw new Error(n);
1293
- } else {
1294
- return s + t.length - 1;
1295
- }
1296
- }
1297
-
1298
- function ee(e, t, i, n = ">") {
1299
- const s = J(e, t + 1, n);
1300
- if (!s) return;
1301
- let r = s.data;
1302
- const o = s.index;
1303
- const a = r.search(/\s/);
1304
- let l = r;
1305
- let u = true;
1306
- if (a !== -1) {
1307
- l = r.substring(0, a);
1308
- r = r.substring(a + 1).trimStart();
1309
1109
  }
1310
- const f = l;
1311
- if (i) {
1312
- const e = l.indexOf(":");
1313
- if (e !== -1) {
1314
- l = l.substr(e + 1);
1315
- u = l !== s.data.substr(e + 1);
1110
+ function findClosingIndex(e, t, i, r) {
1111
+ const n = e.indexOf(t, i);
1112
+ if (n === -1) {
1113
+ throw new Error(r);
1114
+ } else {
1115
+ return n + t.length - 1;
1116
+ }
1117
+ }
1118
+ function readTagExp(e, t, i, r = ">") {
1119
+ const n = tagExpWithClosingIndex(e, t + 1, r);
1120
+ if (!n) return;
1121
+ let s = n.data;
1122
+ const o = n.index;
1123
+ const a = s.search(/\s/);
1124
+ let l = s;
1125
+ let u = true;
1126
+ if (a !== -1) {
1127
+ l = s.substring(0, a);
1128
+ s = s.substring(a + 1).trimStart();
1129
+ }
1130
+ const f = l;
1131
+ if (i) {
1132
+ const e = l.indexOf(":");
1133
+ if (e !== -1) {
1134
+ l = l.substr(e + 1);
1135
+ u = l !== n.data.substr(e + 1);
1136
+ }
1316
1137
  }
1138
+ return {
1139
+ tagName: l,
1140
+ tagExp: s,
1141
+ closeIndex: o,
1142
+ attrExpPresent: u,
1143
+ rawTagName: f
1144
+ };
1317
1145
  }
1318
- return {
1319
- tagName: l,
1320
- tagExp: r,
1321
- closeIndex: o,
1322
- attrExpPresent: u,
1323
- rawTagName: f
1324
- };
1325
- }
1326
-
1327
- function te(e, t, i) {
1328
- const n = i;
1329
- let s = 1;
1330
- for (;i < e.length; i++) {
1331
- if (e[i] === "<") {
1332
- if (e[i + 1] === "/") {
1333
- const r = H(e, ">", i, `${t} is not closed`);
1334
- let o = e.substring(i + 2, r).trim();
1335
- if (o === t) {
1336
- s--;
1337
- if (s === 0) {
1338
- return {
1339
- tagContent: e.substring(n, i),
1340
- i: r
1341
- };
1146
+ function readStopNodeData(e, t, i) {
1147
+ const r = i;
1148
+ let n = 1;
1149
+ for (;i < e.length; i++) {
1150
+ if (e[i] === "<") {
1151
+ if (e[i + 1] === "/") {
1152
+ const s = findClosingIndex(e, ">", i, `${t} is not closed`);
1153
+ let o = e.substring(i + 2, s).trim();
1154
+ if (o === t) {
1155
+ n--;
1156
+ if (n === 0) {
1157
+ return {
1158
+ tagContent: e.substring(r, i),
1159
+ i: s
1160
+ };
1161
+ }
1342
1162
  }
1343
- }
1344
- i = r;
1345
- } else if (e[i + 1] === "?") {
1346
- const t = H(e, "?>", i + 1, "StopNode is not closed.");
1347
- i = t;
1348
- } else if (e.substr(i + 1, 3) === "!--") {
1349
- const t = H(e, "--\x3e", i + 3, "StopNode is not closed.");
1350
- i = t;
1351
- } else if (e.substr(i + 1, 2) === "![") {
1352
- const t = H(e, "]]>", i, "StopNode is not closed.") - 2;
1353
- i = t;
1354
- } else {
1355
- const n = ee(e, i, ">");
1356
- if (n) {
1357
- const e = n && n.tagName;
1358
- if (e === t && n.tagExp[n.tagExp.length - 1] !== "/") {
1359
- s++;
1163
+ i = s;
1164
+ } else if (e[i + 1] === "?") {
1165
+ const t = findClosingIndex(e, "?>", i + 1, "StopNode is not closed.");
1166
+ i = t;
1167
+ } else if (e.substr(i + 1, 3) === "!--") {
1168
+ const t = findClosingIndex(e, "--\x3e", i + 3, "StopNode is not closed.");
1169
+ i = t;
1170
+ } else if (e.substr(i + 1, 2) === "![") {
1171
+ const t = findClosingIndex(e, "]]>", i, "StopNode is not closed.") - 2;
1172
+ i = t;
1173
+ } else {
1174
+ const r = readTagExp(e, i, ">");
1175
+ if (r) {
1176
+ const e = r && r.tagName;
1177
+ if (e === t && r.tagExp[r.tagExp.length - 1] !== "/") {
1178
+ n++;
1179
+ }
1180
+ i = r.closeIndex;
1360
1181
  }
1361
- i = n.closeIndex;
1362
1182
  }
1363
1183
  }
1364
1184
  }
1365
1185
  }
1366
- }
1367
-
1368
- function ie(e, t, i) {
1369
- if (t && typeof e === "string") {
1370
- const t = e.trim();
1371
- if (t === "true") return true; else if (t === "false") return false; else return k(e, i);
1372
- } else {
1373
- if (o(e)) {
1374
- return e;
1186
+ function parseValue(t, i, n) {
1187
+ if (i && typeof t === "string") {
1188
+ const e = t.trim();
1189
+ if (e === "true") return true; else if (e === "false") return false; else return r(t, n);
1375
1190
  } else {
1376
- return "";
1191
+ if (e.isExist(t)) {
1192
+ return t;
1193
+ } else {
1194
+ return "";
1195
+ }
1377
1196
  }
1378
1197
  }
1198
+ h = OrderedObjParser;
1199
+ return h;
1379
1200
  }
1380
1201
 
1381
- "use strict";
1382
-
1383
- const ne = XmlNode.getMetaDataSymbol();
1384
-
1385
- function se(e, t) {
1386
- return re(e, t);
1387
- }
1388
-
1389
- function re(e, t, i) {
1390
- let n;
1391
- const s = {};
1392
- for (let r = 0; r < e.length; r++) {
1393
- const o = e[r];
1394
- const a = oe(o);
1395
- let l = "";
1396
- if (i === undefined) l = a; else l = i + "." + a;
1397
- if (a === t.textNodeName) {
1398
- if (n === undefined) n = o[a]; else n += "" + o[a];
1399
- } else if (a === undefined) {
1400
- continue;
1401
- } else if (o[a]) {
1402
- let e = re(o[a], t, l);
1403
- const i = le(e, t);
1404
- if (o[ne] !== undefined) {
1405
- e[ne] = o[ne];
1406
- }
1407
- if (o[":@"]) {
1408
- ae(e, o[":@"], l, t);
1409
- } else if (Object.keys(e).length === 1 && e[t.textNodeName] !== undefined && !t.alwaysCreateTextNode) {
1410
- e = e[t.textNodeName];
1411
- } else if (Object.keys(e).length === 0) {
1412
- if (t.alwaysCreateTextNode) e[t.textNodeName] = ""; else e = "";
1413
- }
1414
- if (s[a] !== undefined && s.hasOwnProperty(a)) {
1415
- if (!Array.isArray(s[a])) {
1416
- s[a] = [ s[a] ];
1202
+ var b = {};
1203
+
1204
+ var x;
1205
+
1206
+ function requireNode2json() {
1207
+ if (x) return b;
1208
+ x = 1;
1209
+ "use strict";
1210
+ function prettify(e, t) {
1211
+ return compress(e, t);
1212
+ }
1213
+ function compress(e, t, i) {
1214
+ let r;
1215
+ const n = {};
1216
+ for (let s = 0; s < e.length; s++) {
1217
+ const o = e[s];
1218
+ const a = propName(o);
1219
+ let l = "";
1220
+ if (i === undefined) l = a; else l = i + "." + a;
1221
+ if (a === t.textNodeName) {
1222
+ if (r === undefined) r = o[a]; else r += "" + o[a];
1223
+ } else if (a === undefined) {
1224
+ continue;
1225
+ } else if (o[a]) {
1226
+ let e = compress(o[a], t, l);
1227
+ const i = isLeafTag(e, t);
1228
+ if (o[":@"]) {
1229
+ assignAttributes(e, o[":@"], l, t);
1230
+ } else if (Object.keys(e).length === 1 && e[t.textNodeName] !== undefined && !t.alwaysCreateTextNode) {
1231
+ e = e[t.textNodeName];
1232
+ } else if (Object.keys(e).length === 0) {
1233
+ if (t.alwaysCreateTextNode) e[t.textNodeName] = ""; else e = "";
1417
1234
  }
1418
- s[a].push(e);
1419
- } else {
1420
- if (t.isArray(a, l, i)) {
1421
- s[a] = [ e ];
1235
+ if (n[a] !== undefined && n.hasOwnProperty(a)) {
1236
+ if (!Array.isArray(n[a])) {
1237
+ n[a] = [ n[a] ];
1238
+ }
1239
+ n[a].push(e);
1422
1240
  } else {
1423
- s[a] = e;
1241
+ if (t.isArray(a, l, i)) {
1242
+ n[a] = [ e ];
1243
+ } else {
1244
+ n[a] = e;
1245
+ }
1424
1246
  }
1425
1247
  }
1426
1248
  }
1249
+ if (typeof r === "string") {
1250
+ if (r.length > 0) n[t.textNodeName] = r;
1251
+ } else if (r !== undefined) n[t.textNodeName] = r;
1252
+ return n;
1427
1253
  }
1428
- if (typeof n === "string") {
1429
- if (n.length > 0) s[t.textNodeName] = n;
1430
- } else if (n !== undefined) s[t.textNodeName] = n;
1431
- return s;
1432
- }
1433
-
1434
- function oe(e) {
1435
- const t = Object.keys(e);
1436
- for (let e = 0; e < t.length; e++) {
1437
- const i = t[e];
1438
- if (i !== ":@") return i;
1439
- }
1440
- }
1441
-
1442
- function ae(e, t, i, n) {
1443
- if (t) {
1444
- const s = Object.keys(t);
1445
- const r = s.length;
1446
- for (let o = 0; o < r; o++) {
1447
- const r = s[o];
1448
- if (n.isArray(r, i + "." + r, true, true)) {
1449
- e[r] = [ t[r] ];
1450
- } else {
1451
- e[r] = t[r];
1452
- }
1254
+ function propName(e) {
1255
+ const t = Object.keys(e);
1256
+ for (let e = 0; e < t.length; e++) {
1257
+ const i = t[e];
1258
+ if (i !== ":@") return i;
1453
1259
  }
1454
1260
  }
1455
- }
1456
-
1457
- function le(e, t) {
1458
- const {textNodeName: i} = t;
1459
- const n = Object.keys(e).length;
1460
- if (n === 0) {
1461
- return true;
1462
- }
1463
- if (n === 1 && (e[i] || typeof e[i] === "boolean" || e[i] === 0)) {
1464
- return true;
1465
- }
1466
- return false;
1467
- }
1468
-
1469
- class XMLParser {
1470
- constructor(e) {
1471
- this.externalEntities = {};
1472
- this.options = A(e);
1473
- }
1474
- parse(e, t) {
1475
- if (typeof e !== "string" && e.toString) {
1476
- e = e.toString();
1477
- } else if (typeof e !== "string") {
1478
- throw new Error("XML data is accepted in String or Bytes[] form.");
1479
- }
1261
+ function assignAttributes(e, t, i, r) {
1480
1262
  if (t) {
1481
- if (t === true) t = {};
1482
- const i = d(e, t);
1483
- if (i !== true) {
1484
- throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
1263
+ const n = Object.keys(t);
1264
+ const s = n.length;
1265
+ for (let o = 0; o < s; o++) {
1266
+ const s = n[o];
1267
+ if (r.isArray(s, i + "." + s, true, true)) {
1268
+ e[s] = [ t[s] ];
1269
+ } else {
1270
+ e[s] = t[s];
1271
+ }
1485
1272
  }
1486
1273
  }
1487
- const i = new OrderedObjParser(this.options);
1488
- i.addExternalEntities(this.externalEntities);
1489
- const n = i.parseXml(e);
1490
- if (this.options.preserveOrder || n === undefined) return n; else return se(n, this.options);
1491
1274
  }
1492
- addEntity(e, t) {
1493
- if (t.indexOf("&") !== -1) {
1494
- throw new Error("Entity value can't have '&'");
1495
- } else if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1) {
1496
- throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1497
- } else if (t === "&") {
1498
- throw new Error("An entity with value '&' is not permitted");
1499
- } else {
1500
- this.externalEntities[e] = t;
1275
+ function isLeafTag(e, t) {
1276
+ const {textNodeName: i} = t;
1277
+ const r = Object.keys(e).length;
1278
+ if (r === 0) {
1279
+ return true;
1501
1280
  }
1281
+ if (r === 1 && (e[i] || typeof e[i] === "boolean" || e[i] === 0)) {
1282
+ return true;
1283
+ }
1284
+ return false;
1502
1285
  }
1503
- static getMetaDataSymbol() {
1504
- return XmlNode.getMetaDataSymbol();
1505
- }
1506
- }
1507
-
1508
- const ue = "\n";
1509
-
1510
- function fe(e, t) {
1511
- let i = "";
1512
- if (t.format && t.indentBy.length > 0) {
1513
- i = ue;
1514
- }
1515
- return de(e, t, "", i);
1286
+ b.prettify = prettify;
1287
+ return b;
1516
1288
  }
1517
1289
 
1518
- function de(e, t, i, n) {
1519
- let s = "";
1520
- let r = false;
1521
- for (let o = 0; o < e.length; o++) {
1522
- const a = e[o];
1523
- const l = he(a);
1524
- if (l === undefined) continue;
1525
- let u = "";
1526
- if (i.length === 0) u = l; else u = `${i}.${l}`;
1527
- if (l === t.textNodeName) {
1528
- let e = a[l];
1529
- if (!pe(u, t)) {
1530
- e = t.tagValueProcessor(l, e);
1531
- e = ge(e, t);
1532
- }
1533
- if (r) {
1534
- s += n;
1290
+ var N;
1291
+
1292
+ var E;
1293
+
1294
+ function requireXMLParser() {
1295
+ if (E) return N;
1296
+ E = 1;
1297
+ const {buildOptions: e} = requireOptionsBuilder();
1298
+ const t = requireOrderedObjParser();
1299
+ const {prettify: i} = requireNode2json();
1300
+ const r = requireValidator();
1301
+ class XMLParser {
1302
+ constructor(t) {
1303
+ this.externalEntities = {};
1304
+ this.options = e(t);
1305
+ }
1306
+ parse(e, n) {
1307
+ if (typeof e === "string") {} else if (e.toString) {
1308
+ e = e.toString();
1309
+ } else {
1310
+ throw new Error("XML data is accepted in String or Bytes[] form.");
1535
1311
  }
1536
- s += e;
1537
- r = false;
1538
- continue;
1539
- } else if (l === t.cdataPropName) {
1540
- if (r) {
1541
- s += n;
1312
+ if (n) {
1313
+ if (n === true) n = {};
1314
+ const t = r.validate(e, n);
1315
+ if (t !== true) {
1316
+ throw Error(`${t.err.msg}:${t.err.line}:${t.err.col}`);
1317
+ }
1542
1318
  }
1543
- s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`;
1544
- r = false;
1545
- continue;
1546
- } else if (l === t.commentPropName) {
1547
- s += n + `\x3c!--${a[l][0][t.textNodeName]}--\x3e`;
1548
- r = true;
1549
- continue;
1550
- } else if (l[0] === "?") {
1551
- const e = ce(a[":@"], t);
1552
- const i = l === "?xml" ? "" : n;
1553
- let o = a[l][0][t.textNodeName];
1554
- o = o.length !== 0 ? " " + o : "";
1555
- s += i + `<${l}${o}${e}?>`;
1556
- r = true;
1557
- continue;
1558
- }
1559
- let f = n;
1560
- if (f !== "") {
1561
- f += t.indentBy;
1562
- }
1563
- const d = ce(a[":@"], t);
1564
- const h = n + `<${l}${d}`;
1565
- const c = de(a[l], t, u, f);
1566
- if (t.unpairedTags.indexOf(l) !== -1) {
1567
- if (t.suppressUnpairedNode) s += h + ">"; else s += h + "/>";
1568
- } else if ((!c || c.length === 0) && t.suppressEmptyNode) {
1569
- s += h + "/>";
1570
- } else if (c && c.endsWith(">")) {
1571
- s += h + `>${c}${n}</${l}>`;
1572
- } else {
1573
- s += h + ">";
1574
- if (c && n !== "" && (c.includes("/>") || c.includes("</"))) {
1575
- s += n + t.indentBy + c + n;
1319
+ const s = new t(this.options);
1320
+ s.addExternalEntities(this.externalEntities);
1321
+ const o = s.parseXml(e);
1322
+ if (this.options.preserveOrder || o === undefined) return o; else return i(o, this.options);
1323
+ }
1324
+ addEntity(e, t) {
1325
+ if (t.indexOf("&") !== -1) {
1326
+ throw new Error("Entity value can't have '&'");
1327
+ } else if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1) {
1328
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1329
+ } else if (t === "&") {
1330
+ throw new Error("An entity with value '&' is not permitted");
1576
1331
  } else {
1577
- s += c;
1332
+ this.externalEntities[e] = t;
1578
1333
  }
1579
- s += `</${l}>`;
1580
1334
  }
1581
- r = true;
1582
1335
  }
1583
- return s;
1336
+ N = XMLParser;
1337
+ return N;
1584
1338
  }
1585
1339
 
1586
- function he(e) {
1587
- const t = Object.keys(e);
1588
- for (let i = 0; i < t.length; i++) {
1589
- const n = t[i];
1590
- if (!e.hasOwnProperty(n)) continue;
1591
- if (n !== ":@") return n;
1592
- }
1593
- }
1340
+ var v;
1341
+
1342
+ var O;
1594
1343
 
1595
- function ce(e, t) {
1596
- let i = "";
1597
- if (e && !t.ignoreAttributes) {
1598
- for (let n in e) {
1599
- if (!e.hasOwnProperty(n)) continue;
1600
- let s = t.attributeValueProcessor(n, e[n]);
1601
- s = ge(s, t);
1602
- if (s === true && t.suppressBooleanAttributes) {
1603
- i += ` ${n.substr(t.attributeNamePrefix.length)}`;
1344
+ function requireOrderedJs2Xml() {
1345
+ if (O) return v;
1346
+ O = 1;
1347
+ const e = "\n";
1348
+ function toXml(t, i) {
1349
+ let r = "";
1350
+ if (i.format && i.indentBy.length > 0) {
1351
+ r = e;
1352
+ }
1353
+ return arrToStr(t, i, "", r);
1354
+ }
1355
+ function arrToStr(e, t, i, r) {
1356
+ let n = "";
1357
+ let s = false;
1358
+ for (let o = 0; o < e.length; o++) {
1359
+ const a = e[o];
1360
+ const l = propName(a);
1361
+ if (l === undefined) continue;
1362
+ let u = "";
1363
+ if (i.length === 0) u = l; else u = `${i}.${l}`;
1364
+ if (l === t.textNodeName) {
1365
+ let e = a[l];
1366
+ if (!isStopNode(u, t)) {
1367
+ e = t.tagValueProcessor(l, e);
1368
+ e = replaceEntitiesValue(e, t);
1369
+ }
1370
+ if (s) {
1371
+ n += r;
1372
+ }
1373
+ n += e;
1374
+ s = false;
1375
+ continue;
1376
+ } else if (l === t.cdataPropName) {
1377
+ if (s) {
1378
+ n += r;
1379
+ }
1380
+ n += `<![CDATA[${a[l][0][t.textNodeName]}]]>`;
1381
+ s = false;
1382
+ continue;
1383
+ } else if (l === t.commentPropName) {
1384
+ n += r + `\x3c!--${a[l][0][t.textNodeName]}--\x3e`;
1385
+ s = true;
1386
+ continue;
1387
+ } else if (l[0] === "?") {
1388
+ const e = attr_to_str(a[":@"], t);
1389
+ const i = l === "?xml" ? "" : r;
1390
+ let o = a[l][0][t.textNodeName];
1391
+ o = o.length !== 0 ? " " + o : "";
1392
+ n += i + `<${l}${o}${e}?>`;
1393
+ s = true;
1394
+ continue;
1395
+ }
1396
+ let f = r;
1397
+ if (f !== "") {
1398
+ f += t.indentBy;
1399
+ }
1400
+ const d = attr_to_str(a[":@"], t);
1401
+ const c = r + `<${l}${d}`;
1402
+ const g = arrToStr(a[l], t, u, f);
1403
+ if (t.unpairedTags.indexOf(l) !== -1) {
1404
+ if (t.suppressUnpairedNode) n += c + ">"; else n += c + "/>";
1405
+ } else if ((!g || g.length === 0) && t.suppressEmptyNode) {
1406
+ n += c + "/>";
1407
+ } else if (g && g.endsWith(">")) {
1408
+ n += c + `>${g}${r}</${l}>`;
1604
1409
  } else {
1605
- i += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
1410
+ n += c + ">";
1411
+ if (g && r !== "" && (g.includes("/>") || g.includes("</"))) {
1412
+ n += r + t.indentBy + g + r;
1413
+ } else {
1414
+ n += g;
1415
+ }
1416
+ n += `</${l}>`;
1606
1417
  }
1418
+ s = true;
1607
1419
  }
1420
+ return n;
1608
1421
  }
1609
- return i;
1610
- }
1611
-
1612
- function pe(e, t) {
1613
- e = e.substr(0, e.length - t.textNodeName.length - 1);
1614
- let i = e.substr(e.lastIndexOf(".") + 1);
1615
- for (let n in t.stopNodes) {
1616
- if (t.stopNodes[n] === e || t.stopNodes[n] === "*." + i) return true;
1422
+ function propName(e) {
1423
+ const t = Object.keys(e);
1424
+ for (let i = 0; i < t.length; i++) {
1425
+ const r = t[i];
1426
+ if (!e.hasOwnProperty(r)) continue;
1427
+ if (r !== ":@") return r;
1428
+ }
1617
1429
  }
1618
- return false;
1619
- }
1620
-
1621
- function ge(e, t) {
1622
- if (e && e.length > 0 && t.processEntities) {
1623
- for (let i = 0; i < t.entities.length; i++) {
1624
- const n = t.entities[i];
1625
- e = e.replace(n.regex, n.val);
1430
+ function attr_to_str(e, t) {
1431
+ let i = "";
1432
+ if (e && !t.ignoreAttributes) {
1433
+ for (let r in e) {
1434
+ if (!e.hasOwnProperty(r)) continue;
1435
+ let n = t.attributeValueProcessor(r, e[r]);
1436
+ n = replaceEntitiesValue(n, t);
1437
+ if (n === true && t.suppressBooleanAttributes) {
1438
+ i += ` ${r.substr(t.attributeNamePrefix.length)}`;
1439
+ } else {
1440
+ i += ` ${r.substr(t.attributeNamePrefix.length)}="${n}"`;
1441
+ }
1442
+ }
1626
1443
  }
1444
+ return i;
1627
1445
  }
1628
- return e;
1629
- }
1630
-
1631
- "use strict";
1632
-
1633
- const me = {
1634
- attributeNamePrefix: "@_",
1635
- attributesGroupName: false,
1636
- textNodeName: "#text",
1637
- ignoreAttributes: true,
1638
- cdataPropName: false,
1639
- format: false,
1640
- indentBy: " ",
1641
- suppressEmptyNode: false,
1642
- suppressUnpairedNode: true,
1643
- suppressBooleanAttributes: true,
1644
- tagValueProcessor: function(e, t) {
1645
- return t;
1646
- },
1647
- attributeValueProcessor: function(e, t) {
1648
- return t;
1649
- },
1650
- preserveOrder: false,
1651
- commentPropName: false,
1652
- unpairedTags: [],
1653
- entities: [ {
1654
- regex: new RegExp("&", "g"),
1655
- val: "&amp;"
1656
- }, {
1657
- regex: new RegExp(">", "g"),
1658
- val: "&gt;"
1659
- }, {
1660
- regex: new RegExp("<", "g"),
1661
- val: "&lt;"
1662
- }, {
1663
- regex: new RegExp("'", "g"),
1664
- val: "&apos;"
1665
- }, {
1666
- regex: new RegExp('"', "g"),
1667
- val: "&quot;"
1668
- } ],
1669
- processEntities: true,
1670
- stopNodes: [],
1671
- oneListGroup: false
1672
- };
1673
-
1674
- function xe(e) {
1675
- this.options = Object.assign({}, me, e);
1676
- if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1677
- this.isAttribute = function() {
1678
- return false;
1679
- };
1680
- } else {
1681
- this.ignoreAttributesFn = X(this.options.ignoreAttributes);
1682
- this.attrPrefixLen = this.options.attributeNamePrefix.length;
1683
- this.isAttribute = we;
1446
+ function isStopNode(e, t) {
1447
+ e = e.substr(0, e.length - t.textNodeName.length - 1);
1448
+ let i = e.substr(e.lastIndexOf(".") + 1);
1449
+ for (let r in t.stopNodes) {
1450
+ if (t.stopNodes[r] === e || t.stopNodes[r] === "*." + i) return true;
1451
+ }
1452
+ return false;
1684
1453
  }
1685
- this.processTextOrObjNode = Ne;
1686
- if (this.options.format) {
1687
- this.indentate = Ee;
1688
- this.tagEndChar = ">\n";
1689
- this.newLine = "\n";
1690
- } else {
1691
- this.indentate = function() {
1692
- return "";
1693
- };
1694
- this.tagEndChar = ">";
1695
- this.newLine = "";
1454
+ function replaceEntitiesValue(e, t) {
1455
+ if (e && e.length > 0 && t.processEntities) {
1456
+ for (let i = 0; i < t.entities.length; i++) {
1457
+ const r = t.entities[i];
1458
+ e = e.replace(r.regex, r.val);
1459
+ }
1460
+ }
1461
+ return e;
1696
1462
  }
1463
+ v = toXml;
1464
+ return v;
1697
1465
  }
1698
1466
 
1699
- xe.prototype.build = function(e) {
1700
- if (this.options.preserveOrder) {
1701
- return fe(e, this.options);
1702
- } else {
1703
- if (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1704
- e = {
1705
- [this.options.arrayNodeName]: e
1467
+ var T;
1468
+
1469
+ var P;
1470
+
1471
+ function requireJson2xml() {
1472
+ if (P) return T;
1473
+ P = 1;
1474
+ "use strict";
1475
+ const e = requireOrderedJs2Xml();
1476
+ const t = requireIgnoreAttributes();
1477
+ const i = {
1478
+ attributeNamePrefix: "@_",
1479
+ attributesGroupName: false,
1480
+ textNodeName: "#text",
1481
+ ignoreAttributes: true,
1482
+ cdataPropName: false,
1483
+ format: false,
1484
+ indentBy: " ",
1485
+ suppressEmptyNode: false,
1486
+ suppressUnpairedNode: true,
1487
+ suppressBooleanAttributes: true,
1488
+ tagValueProcessor: function(e, t) {
1489
+ return t;
1490
+ },
1491
+ attributeValueProcessor: function(e, t) {
1492
+ return t;
1493
+ },
1494
+ preserveOrder: false,
1495
+ commentPropName: false,
1496
+ unpairedTags: [],
1497
+ entities: [ {
1498
+ regex: new RegExp("&", "g"),
1499
+ val: "&amp;"
1500
+ }, {
1501
+ regex: new RegExp(">", "g"),
1502
+ val: "&gt;"
1503
+ }, {
1504
+ regex: new RegExp("<", "g"),
1505
+ val: "&lt;"
1506
+ }, {
1507
+ regex: new RegExp("'", "g"),
1508
+ val: "&apos;"
1509
+ }, {
1510
+ regex: new RegExp('"', "g"),
1511
+ val: "&quot;"
1512
+ } ],
1513
+ processEntities: true,
1514
+ stopNodes: [],
1515
+ oneListGroup: false
1516
+ };
1517
+ function Builder(e) {
1518
+ this.options = Object.assign({}, i, e);
1519
+ if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1520
+ this.isAttribute = function() {
1521
+ return false;
1522
+ };
1523
+ } else {
1524
+ this.ignoreAttributesFn = t(this.options.ignoreAttributes);
1525
+ this.attrPrefixLen = this.options.attributeNamePrefix.length;
1526
+ this.isAttribute = isAttribute;
1527
+ }
1528
+ this.processTextOrObjNode = processTextOrObjNode;
1529
+ if (this.options.format) {
1530
+ this.indentate = indentate;
1531
+ this.tagEndChar = ">\n";
1532
+ this.newLine = "\n";
1533
+ } else {
1534
+ this.indentate = function() {
1535
+ return "";
1706
1536
  };
1537
+ this.tagEndChar = ">";
1538
+ this.newLine = "";
1707
1539
  }
1708
- return this.j2x(e, 0, []).val;
1709
1540
  }
1710
- };
1711
-
1712
- xe.prototype.j2x = function(e, t, i) {
1713
- let n = "";
1714
- let s = "";
1715
- const r = i.join(".");
1716
- for (let o in e) {
1717
- if (!Object.prototype.hasOwnProperty.call(e, o)) continue;
1718
- if (typeof e[o] === "undefined") {
1719
- if (this.isAttribute(o)) {
1720
- s += "";
1721
- }
1722
- } else if (e[o] === null) {
1723
- if (this.isAttribute(o)) {
1724
- s += "";
1725
- } else if (o === this.options.cdataPropName) {
1726
- s += "";
1727
- } else if (o[0] === "?") {
1728
- s += this.indentate(t) + "<" + o + "?" + this.tagEndChar;
1729
- } else {
1730
- s += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1541
+ Builder.prototype.build = function(t) {
1542
+ if (this.options.preserveOrder) {
1543
+ return e(t, this.options);
1544
+ } else {
1545
+ if (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1546
+ t = {
1547
+ [this.options.arrayNodeName]: t
1548
+ };
1731
1549
  }
1732
- } else if (e[o] instanceof Date) {
1733
- s += this.buildTextValNode(e[o], o, "", t);
1734
- } else if (typeof e[o] !== "object") {
1735
- const i = this.isAttribute(o);
1736
- if (i && !this.ignoreAttributesFn(i, r)) {
1737
- n += this.buildAttrPairStr(i, "" + e[o]);
1738
- } else if (!i) {
1739
- if (o === this.options.textNodeName) {
1740
- let t = this.options.tagValueProcessor(o, "" + e[o]);
1741
- s += this.replaceEntitiesValue(t);
1550
+ return this.j2x(t, 0, []).val;
1551
+ }
1552
+ };
1553
+ Builder.prototype.j2x = function(e, t, i) {
1554
+ let r = "";
1555
+ let n = "";
1556
+ const s = i.join(".");
1557
+ for (let o in e) {
1558
+ if (!Object.prototype.hasOwnProperty.call(e, o)) continue;
1559
+ if (typeof e[o] === "undefined") {
1560
+ if (this.isAttribute(o)) {
1561
+ n += "";
1562
+ }
1563
+ } else if (e[o] === null) {
1564
+ if (this.isAttribute(o)) {
1565
+ n += "";
1566
+ } else if (o === this.options.cdataPropName) {
1567
+ n += "";
1568
+ } else if (o[0] === "?") {
1569
+ n += this.indentate(t) + "<" + o + "?" + this.tagEndChar;
1742
1570
  } else {
1743
- s += this.buildTextValNode(e[o], o, "", t);
1571
+ n += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1744
1572
  }
1745
- }
1746
- } else if (Array.isArray(e[o])) {
1747
- const n = e[o].length;
1748
- let r = "";
1749
- let a = "";
1750
- for (let l = 0; l < n; l++) {
1751
- const n = e[o][l];
1752
- if (typeof n === "undefined") {} else if (n === null) {
1753
- if (o[0] === "?") s += this.indentate(t) + "<" + o + "?" + this.tagEndChar; else s += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1754
- } else if (typeof n === "object") {
1755
- if (this.options.oneListGroup) {
1756
- const e = this.j2x(n, t + 1, i.concat(o));
1757
- r += e.val;
1758
- if (this.options.attributesGroupName && n.hasOwnProperty(this.options.attributesGroupName)) {
1759
- a += e.attrStr;
1760
- }
1573
+ } else if (e[o] instanceof Date) {
1574
+ n += this.buildTextValNode(e[o], o, "", t);
1575
+ } else if (typeof e[o] !== "object") {
1576
+ const i = this.isAttribute(o);
1577
+ if (i && !this.ignoreAttributesFn(i, s)) {
1578
+ r += this.buildAttrPairStr(i, "" + e[o]);
1579
+ } else if (!i) {
1580
+ if (o === this.options.textNodeName) {
1581
+ let t = this.options.tagValueProcessor(o, "" + e[o]);
1582
+ n += this.replaceEntitiesValue(t);
1761
1583
  } else {
1762
- r += this.processTextOrObjNode(n, o, t, i);
1584
+ n += this.buildTextValNode(e[o], o, "", t);
1763
1585
  }
1764
- } else {
1765
- if (this.options.oneListGroup) {
1766
- let e = this.options.tagValueProcessor(o, n);
1767
- e = this.replaceEntitiesValue(e);
1768
- r += e;
1586
+ }
1587
+ } else if (Array.isArray(e[o])) {
1588
+ const r = e[o].length;
1589
+ let s = "";
1590
+ let a = "";
1591
+ for (let l = 0; l < r; l++) {
1592
+ const r = e[o][l];
1593
+ if (typeof r === "undefined") {} else if (r === null) {
1594
+ if (o[0] === "?") n += this.indentate(t) + "<" + o + "?" + this.tagEndChar; else n += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1595
+ } else if (typeof r === "object") {
1596
+ if (this.options.oneListGroup) {
1597
+ const e = this.j2x(r, t + 1, i.concat(o));
1598
+ s += e.val;
1599
+ if (this.options.attributesGroupName && r.hasOwnProperty(this.options.attributesGroupName)) {
1600
+ a += e.attrStr;
1601
+ }
1602
+ } else {
1603
+ s += this.processTextOrObjNode(r, o, t, i);
1604
+ }
1769
1605
  } else {
1770
- r += this.buildTextValNode(n, o, "", t);
1606
+ if (this.options.oneListGroup) {
1607
+ let e = this.options.tagValueProcessor(o, r);
1608
+ e = this.replaceEntitiesValue(e);
1609
+ s += e;
1610
+ } else {
1611
+ s += this.buildTextValNode(r, o, "", t);
1612
+ }
1771
1613
  }
1772
1614
  }
1773
- }
1774
- if (this.options.oneListGroup) {
1775
- r = this.buildObjectNode(r, o, a, t);
1776
- }
1777
- s += r;
1778
- } else {
1779
- if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1780
- const t = Object.keys(e[o]);
1781
- const i = t.length;
1782
- for (let s = 0; s < i; s++) {
1783
- n += this.buildAttrPairStr(t[s], "" + e[o][t[s]]);
1615
+ if (this.options.oneListGroup) {
1616
+ s = this.buildObjectNode(s, o, a, t);
1784
1617
  }
1618
+ n += s;
1785
1619
  } else {
1786
- s += this.processTextOrObjNode(e[o], o, t, i);
1620
+ if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1621
+ const t = Object.keys(e[o]);
1622
+ const i = t.length;
1623
+ for (let n = 0; n < i; n++) {
1624
+ r += this.buildAttrPairStr(t[n], "" + e[o][t[n]]);
1625
+ }
1626
+ } else {
1627
+ n += this.processTextOrObjNode(e[o], o, t, i);
1628
+ }
1787
1629
  }
1788
1630
  }
1789
- }
1790
- return {
1791
- attrStr: n,
1792
- val: s
1631
+ return {
1632
+ attrStr: r,
1633
+ val: n
1634
+ };
1793
1635
  };
1794
- };
1795
-
1796
- xe.prototype.buildAttrPairStr = function(e, t) {
1797
- t = this.options.attributeValueProcessor(e, "" + t);
1798
- t = this.replaceEntitiesValue(t);
1799
- if (this.options.suppressBooleanAttributes && t === "true") {
1800
- return " " + e;
1801
- } else return " " + e + '="' + t + '"';
1802
- };
1803
-
1804
- function Ne(e, t, i, n) {
1805
- const s = this.j2x(e, i + 1, n.concat(t));
1806
- if (e[this.options.textNodeName] !== undefined && Object.keys(e).length === 1) {
1807
- return this.buildTextValNode(e[this.options.textNodeName], t, s.attrStr, i);
1808
- } else {
1809
- return this.buildObjectNode(s.val, t, s.attrStr, i);
1636
+ Builder.prototype.buildAttrPairStr = function(e, t) {
1637
+ t = this.options.attributeValueProcessor(e, "" + t);
1638
+ t = this.replaceEntitiesValue(t);
1639
+ if (this.options.suppressBooleanAttributes && t === "true") {
1640
+ return " " + e;
1641
+ } else return " " + e + '="' + t + '"';
1642
+ };
1643
+ function processTextOrObjNode(e, t, i, r) {
1644
+ const n = this.j2x(e, i + 1, r.concat(t));
1645
+ if (e[this.options.textNodeName] !== undefined && Object.keys(e).length === 1) {
1646
+ return this.buildTextValNode(e[this.options.textNodeName], t, n.attrStr, i);
1647
+ } else {
1648
+ return this.buildObjectNode(n.val, t, n.attrStr, i);
1649
+ }
1810
1650
  }
1811
- }
1812
-
1813
- xe.prototype.buildObjectNode = function(e, t, i, n) {
1814
- if (e === "") {
1815
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1816
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1651
+ Builder.prototype.buildObjectNode = function(e, t, i, r) {
1652
+ if (e === "") {
1653
+ if (t[0] === "?") return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar; else {
1654
+ return this.indentate(r) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1655
+ }
1656
+ } else {
1657
+ let n = "</" + t + this.tagEndChar;
1658
+ let s = "";
1659
+ if (t[0] === "?") {
1660
+ s = "?";
1661
+ n = "";
1662
+ }
1663
+ if ((i || i === "") && e.indexOf("<") === -1) {
1664
+ return this.indentate(r) + "<" + t + i + s + ">" + e + n;
1665
+ } else if (this.options.commentPropName !== false && t === this.options.commentPropName && s.length === 0) {
1666
+ return this.indentate(r) + `\x3c!--${e}--\x3e` + this.newLine;
1667
+ } else {
1668
+ return this.indentate(r) + "<" + t + i + s + this.tagEndChar + e + this.indentate(r) + n;
1669
+ }
1817
1670
  }
1818
- } else {
1819
- let s = "</" + t + this.tagEndChar;
1820
- let r = "";
1821
- if (t[0] === "?") {
1822
- r = "?";
1823
- s = "";
1824
- }
1825
- if ((i || i === "") && e.indexOf("<") === -1) {
1826
- return this.indentate(n) + "<" + t + i + r + ">" + e + s;
1827
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName && r.length === 0) {
1828
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1671
+ };
1672
+ Builder.prototype.closeTag = function(e) {
1673
+ let t = "";
1674
+ if (this.options.unpairedTags.indexOf(e) !== -1) {
1675
+ if (!this.options.suppressUnpairedNode) t = "/";
1676
+ } else if (this.options.suppressEmptyNode) {
1677
+ t = "/";
1829
1678
  } else {
1830
- return this.indentate(n) + "<" + t + i + r + this.tagEndChar + e + this.indentate(n) + s;
1679
+ t = `></${e}`;
1831
1680
  }
1832
- }
1833
- };
1834
-
1835
- xe.prototype.closeTag = function(e) {
1836
- let t = "";
1837
- if (this.options.unpairedTags.indexOf(e) !== -1) {
1838
- if (!this.options.suppressUnpairedNode) t = "/";
1839
- } else if (this.options.suppressEmptyNode) {
1840
- t = "/";
1841
- } else {
1842
- t = `></${e}`;
1843
- }
1844
- return t;
1845
- };
1846
-
1847
- function be(e, t, i, n) {
1848
- if (e !== "") {
1849
- return this.buildObjectNode(e, t, i, n);
1850
- } else {
1851
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1852
- return this.indentate(n) + "<" + t + i + "/" + this.tagEndChar;
1681
+ return t;
1682
+ };
1683
+ function buildEmptyObjNode(e, t, i, r) {
1684
+ if (e !== "") {
1685
+ return this.buildObjectNode(e, t, i, r);
1686
+ } else {
1687
+ if (t[0] === "?") return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar; else {
1688
+ return this.indentate(r) + "<" + t + i + "/" + this.tagEndChar;
1689
+ }
1853
1690
  }
1854
1691
  }
1855
- }
1856
-
1857
- xe.prototype.buildTextValNode = function(e, t, i, n) {
1858
- if (this.options.cdataPropName !== false && t === this.options.cdataPropName) {
1859
- return this.indentate(n) + `<![CDATA[${e}]]>` + this.newLine;
1860
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName) {
1861
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1862
- } else if (t[0] === "?") {
1863
- return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar;
1864
- } else {
1865
- let s = this.options.tagValueProcessor(t, e);
1866
- s = this.replaceEntitiesValue(s);
1867
- if (s === "") {
1868
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1692
+ Builder.prototype.buildTextValNode = function(e, t, i, r) {
1693
+ if (this.options.cdataPropName !== false && t === this.options.cdataPropName) {
1694
+ return this.indentate(r) + `<![CDATA[${e}]]>` + this.newLine;
1695
+ } else if (this.options.commentPropName !== false && t === this.options.commentPropName) {
1696
+ return this.indentate(r) + `\x3c!--${e}--\x3e` + this.newLine;
1697
+ } else if (t[0] === "?") {
1698
+ return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar;
1869
1699
  } else {
1870
- return this.indentate(n) + "<" + t + i + ">" + s + "</" + t + this.tagEndChar;
1700
+ let n = this.options.tagValueProcessor(t, e);
1701
+ n = this.replaceEntitiesValue(n);
1702
+ if (n === "") {
1703
+ return this.indentate(r) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1704
+ } else {
1705
+ return this.indentate(r) + "<" + t + i + ">" + n + "</" + t + this.tagEndChar;
1706
+ }
1707
+ }
1708
+ };
1709
+ Builder.prototype.replaceEntitiesValue = function(e) {
1710
+ if (e && e.length > 0 && this.options.processEntities) {
1711
+ for (let t = 0; t < this.options.entities.length; t++) {
1712
+ const i = this.options.entities[t];
1713
+ e = e.replace(i.regex, i.val);
1714
+ }
1871
1715
  }
1716
+ return e;
1717
+ };
1718
+ function indentate(e) {
1719
+ return this.options.indentBy.repeat(e);
1872
1720
  }
1873
- };
1874
-
1875
- xe.prototype.replaceEntitiesValue = function(e) {
1876
- if (e && e.length > 0 && this.options.processEntities) {
1877
- for (let t = 0; t < this.options.entities.length; t++) {
1878
- const i = this.options.entities[t];
1879
- e = e.replace(i.regex, i.val);
1721
+ function isAttribute(e) {
1722
+ if (e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName) {
1723
+ return e.substr(this.attrPrefixLen);
1724
+ } else {
1725
+ return false;
1880
1726
  }
1881
1727
  }
1882
- return e;
1883
- };
1884
-
1885
- function Ee(e) {
1886
- return this.options.indentBy.repeat(e);
1728
+ T = Builder;
1729
+ return T;
1887
1730
  }
1888
1731
 
1889
- function we(e) {
1890
- if (e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName) {
1891
- return e.substr(this.attrPrefixLen);
1892
- } else {
1893
- return false;
1894
- }
1732
+ var A;
1733
+
1734
+ var y;
1735
+
1736
+ function requireFxp() {
1737
+ if (y) return A;
1738
+ y = 1;
1739
+ "use strict";
1740
+ const e = requireValidator();
1741
+ const t = requireXMLParser();
1742
+ const i = requireJson2xml();
1743
+ A = {
1744
+ XMLParser: t,
1745
+ XMLValidator: e,
1746
+ XMLBuilder: i
1747
+ };
1748
+ return A;
1895
1749
  }
1896
1750
 
1897
- "use strict";
1751
+ var I = requireFxp();
1898
1752
 
1899
- const Te = {
1900
- validate: d
1901
- };
1753
+ const w = e.getDefaultExportFromCjs(I);
1902
1754
 
1903
- function ye(e) {
1755
+ function IsXML(e) {
1904
1756
  try {
1905
- Te.validate(e, {
1757
+ I.XMLValidator.validate(e, {
1906
1758
  allowBooleanAttributes: true
1907
1759
  });
1908
1760
  return true;
@@ -1911,4 +1763,4 @@ function ye(e) {
1911
1763
  }
1912
1764
  }
1913
1765
 
1914
- exports.IsXML = ye;
1766
+ exports.IsXML = IsXML;