@design-edito/tools 0.1.61 → 0.1.63

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 (564) hide show
  1. package/agnostic/arrays/index.js +5 -5
  2. package/agnostic/css/index.js +8 -8
  3. package/agnostic/html/hyper-json/cast/index.js +3 -3
  4. package/agnostic/html/hyper-json/index.js +4 -4
  5. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +3 -3
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +3 -3
  7. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +3 -3
  8. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +3 -3
  9. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +3 -3
  10. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +3 -3
  11. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +3 -3
  12. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +3 -3
  13. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +3 -3
  14. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +3 -3
  15. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +3 -3
  16. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +3 -3
  17. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +3 -3
  18. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +3 -3
  19. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +3 -3
  20. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +3 -3
  21. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +3 -3
  22. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +3 -3
  23. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +3 -3
  24. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +3 -3
  25. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +3 -3
  26. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +3 -3
  27. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +3 -3
  28. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +3 -3
  29. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +3 -3
  30. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +3 -3
  31. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -3
  32. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +3 -3
  33. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +3 -3
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +3 -3
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +3 -3
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +3 -3
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -3
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +3 -3
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +3 -3
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +3 -3
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +3 -3
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +3 -3
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +3 -3
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +3 -3
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -3
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +3 -3
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +3 -3
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +3 -3
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +3 -3
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +3 -3
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +3 -3
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +3 -3
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +3 -3
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +3 -3
  55. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +3 -3
  56. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +3 -3
  57. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +3 -3
  58. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +3 -3
  59. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -3
  60. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +3 -3
  61. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +3 -3
  62. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +3 -3
  63. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -3
  64. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +3 -3
  65. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -3
  66. package/agnostic/html/hyper-json/tree/index.js +3 -3
  67. package/agnostic/html/hyper-json/utils/index.js +3 -3
  68. package/agnostic/html/index.js +10 -10
  69. package/agnostic/misc/index.js +17 -17
  70. package/agnostic/misc/lorem-ipsum/index.js +8 -8
  71. package/agnostic/numbers/index.js +3 -3
  72. package/agnostic/objects/index.js +3 -3
  73. package/agnostic/strings/index.js +10 -10
  74. package/agnostic/time/index.js +4 -4
  75. package/chunks/{chunk-4OH2EX3D.js → chunk-2JKV6KXE.js} +1 -1
  76. package/chunks/{chunk-2OSLB3AC.js → chunk-4DNPGCIM.js} +3 -3
  77. package/chunks/{chunk-6A7GLDXD.js → chunk-4HLAM4RP.js} +3 -3
  78. package/chunks/{chunk-K6XEQOZU.js → chunk-6Y7RZ5WD.js} +4 -12
  79. package/chunks/{chunk-5UM7HYXS.js → chunk-7SZ3QPTM.js} +1 -1
  80. package/chunks/{chunk-344X5RHV.js → chunk-7WYDM5OX.js} +1 -1
  81. package/chunks/{chunk-NTZ7PTU3.js → chunk-EBVYO2TY.js} +4 -12
  82. package/chunks/{chunk-OOETQRTY.js → chunk-HGQGQLLC.js} +1 -1
  83. package/chunks/{chunk-RORBHBEN.js → chunk-I37MGRCT.js} +4 -4
  84. package/chunks/{chunk-5KEIMXTB.js → chunk-IH25CV3F.js} +1 -1
  85. package/chunks/{chunk-EHOZ6VCE.js → chunk-ISFXCV7D.js} +4 -4
  86. package/chunks/{chunk-4HPUOADZ.js → chunk-MZKZI6JL.js} +6 -6
  87. package/chunks/{chunk-BX6M7WBE.js → chunk-PDHAMES3.js} +1 -1
  88. package/chunks/{chunk-ITECXQUB.js → chunk-QPT6R6CL.js} +6 -6
  89. package/chunks/{chunk-ON4E4PLF.js → chunk-R7J7Q2UL.js} +2 -2
  90. package/chunks/{chunk-27HRTQ7Z.js → chunk-V4KSJHTU.js} +1 -1
  91. package/chunks/{chunk-XC2YGMNJ.js → chunk-YVEMIEOT.js} +1 -1
  92. package/node/@design-edito/index.js +3 -3
  93. package/node/@design-edito/thumbnails/index.js +7 -7
  94. package/node/@design-edito/thumbnails/layout/index.js +2 -2
  95. package/node/@google-cloud/index.js +4 -4
  96. package/node/@google-cloud/storage/file/index.js +7 -7
  97. package/node/@google-cloud/storage/index.js +4 -4
  98. package/node/cloud-storage/index.js +11 -11
  99. package/node/cloud-storage/operations/download/index.d.ts +2 -2
  100. package/node/cloud-storage/operations/download/index.js +2 -3
  101. package/node/cloud-storage/operations/index.js +5 -6
  102. package/node/cloud-storage/operations/upload/index.d.ts +1 -2
  103. package/node/cloud-storage/operations/upload/index.js +2 -3
  104. package/node/encryption/index.js +3 -3
  105. package/node/files/index.js +3 -3
  106. package/node/images/index.js +6 -6
  107. package/node/images/prepare/index.js +6 -6
  108. package/node/images/transform/area-composition/index.js +4 -4
  109. package/node/images/transform/index.js +5 -5
  110. package/package.json +1 -1
  111. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperties/index.d.ts +0 -4
  112. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperties/index.js +0 -21
  113. package/agnostic/html/hyper-json/transformers/append/index.d.ts +0 -2
  114. package/agnostic/html/hyper-json/transformers/append/index.js +0 -16
  115. package/agnostic/html/hyper-json/transformers/classList/index.d.ts +0 -2
  116. package/agnostic/html/hyper-json/transformers/classList/index.js +0 -16
  117. package/agnostic/html/hyper-json/transformers/index.d.ts +0 -4
  118. package/agnostic/html/hyper-json/transformers/index.js +0 -16
  119. package/agnostic/html/hyper-json/transformers/join/index.d.ts +0 -2
  120. package/agnostic/html/hyper-json/transformers/join/index.js +0 -16
  121. package/agnostic/html/hyper-json/transformers/length/index.d.ts +0 -2
  122. package/agnostic/html/hyper-json/transformers/length/index.js +0 -16
  123. package/agnostic/html/hyper-json/transformers/print/index.d.ts +0 -2
  124. package/agnostic/html/hyper-json/transformers/print/index.js +0 -16
  125. package/agnostic/html/hyper-json/transformers/push/index.d.ts +0 -2
  126. package/agnostic/html/hyper-json/transformers/push/index.js +0 -16
  127. package/agnostic/html/hyper-json/transformers/querySelector/index.d.ts +0 -2
  128. package/agnostic/html/hyper-json/transformers/querySelector/index.js +0 -16
  129. package/agnostic/html/hyper-json/transformers/ref/index.d.ts +0 -2
  130. package/agnostic/html/hyper-json/transformers/ref/index.js +0 -16
  131. package/agnostic/html/hyper-json/transformers/replace/index.d.ts +0 -2
  132. package/agnostic/html/hyper-json/transformers/replace/index.js +0 -16
  133. package/agnostic/html/hyper-json/transformers/split/index.d.ts +0 -2
  134. package/agnostic/html/hyper-json/transformers/split/index.js +0 -16
  135. package/agnostic/html/hyper-json/transformers/toArray/index.d.ts +0 -2
  136. package/agnostic/html/hyper-json/transformers/toArray/index.js +0 -16
  137. package/agnostic/html/hyper-json/transformers/toBoolean/index.d.ts +0 -2
  138. package/agnostic/html/hyper-json/transformers/toBoolean/index.js +0 -16
  139. package/agnostic/html/hyper-json/transformers/toElement/index.d.ts +0 -2
  140. package/agnostic/html/hyper-json/transformers/toElement/index.js +0 -16
  141. package/agnostic/html/hyper-json/transformers/toNodeList/index.d.ts +0 -2
  142. package/agnostic/html/hyper-json/transformers/toNodeList/index.js +0 -16
  143. package/agnostic/html/hyper-json/transformers/toNull/index.d.ts +0 -2
  144. package/agnostic/html/hyper-json/transformers/toNull/index.js +0 -16
  145. package/agnostic/html/hyper-json/transformers/toNumber/index.d.ts +0 -2
  146. package/agnostic/html/hyper-json/transformers/toNumber/index.js +0 -16
  147. package/agnostic/html/hyper-json/transformers/toRecord/index.d.ts +0 -2
  148. package/agnostic/html/hyper-json/transformers/toRecord/index.js +0 -16
  149. package/agnostic/html/hyper-json/transformers/toRef/index.d.ts +0 -2
  150. package/agnostic/html/hyper-json/transformers/toRef/index.js +0 -16
  151. package/agnostic/html/hyper-json/transformers/toString/index.d.ts +0 -2
  152. package/agnostic/html/hyper-json/transformers/toString/index.js +0 -16
  153. package/agnostic/html/hyper-json/transformers/toText/index.d.ts +0 -2
  154. package/agnostic/html/hyper-json/transformers/toText/index.js +0 -16
  155. package/agnostic/html/hyper-json/transformers/toTransformer/index.d.ts +0 -2
  156. package/agnostic/html/hyper-json/transformers/toTransformer/index.js +0 -16
  157. package/agnostic/html/hyper-json/transformers/transformSelected/index.d.ts +0 -2
  158. package/agnostic/html/hyper-json/transformers/transformSelected/index.js +0 -16
  159. package/agnostic/html/hyper-json/transformers/trim/index.d.ts +0 -2
  160. package/agnostic/html/hyper-json/transformers/trim/index.js +0 -16
  161. package/agnostic/objects/record-filter/index.d.ts +0 -1
  162. package/agnostic/objects/record-filter/index.js +0 -6
  163. package/chunks/chunk-2G5MFJ66.js +0 -2420
  164. package/chunks/chunk-2HU2AWWJ.js +0 -35
  165. package/chunks/chunk-2IV3O7FX.js +0 -27
  166. package/chunks/chunk-2KCKWG7R.js +0 -104
  167. package/chunks/chunk-2KT7AKRW.js +0 -17
  168. package/chunks/chunk-2U2J4P3O.js +0 -31
  169. package/chunks/chunk-2UJYUMTT.js +0 -37
  170. package/chunks/chunk-35W7XRC3.js +0 -173
  171. package/chunks/chunk-365LSZZ7.js +0 -37
  172. package/chunks/chunk-36CTYZYA.js +0 -28
  173. package/chunks/chunk-3C3MXKEW.js +0 -31
  174. package/chunks/chunk-3GTGE66Y.js +0 -32
  175. package/chunks/chunk-3N2LP2TN.js +0 -191
  176. package/chunks/chunk-3OMANUYH.js +0 -211
  177. package/chunks/chunk-3SSUHWUD.js +0 -56
  178. package/chunks/chunk-3TX6SJRO.js +0 -31
  179. package/chunks/chunk-3UAAYFXA.js +0 -56
  180. package/chunks/chunk-42ZKFWKF.js +0 -2369
  181. package/chunks/chunk-44XPTCIO.js +0 -49
  182. package/chunks/chunk-4FOK7DUZ.js +0 -35
  183. package/chunks/chunk-4LCL2RIC.js +0 -209
  184. package/chunks/chunk-4WOAFIVN.js +0 -31
  185. package/chunks/chunk-4WOYAD35.js +0 -31
  186. package/chunks/chunk-53MBV4TG.js +0 -6212
  187. package/chunks/chunk-55MT7BMY.js +0 -16
  188. package/chunks/chunk-57RPA6DU.js +0 -56
  189. package/chunks/chunk-57YCNOX7.js +0 -15
  190. package/chunks/chunk-5CYZ66VE.js +0 -31
  191. package/chunks/chunk-5E7N4BDI.js +0 -186
  192. package/chunks/chunk-5GI5G45R.js +0 -27
  193. package/chunks/chunk-5HWYTIYR.js +0 -211
  194. package/chunks/chunk-5JMTDJWX.js +0 -37
  195. package/chunks/chunk-5P7LHIDR.js +0 -37
  196. package/chunks/chunk-5QVKJGTN.js +0 -95
  197. package/chunks/chunk-5RSHXPTG.js +0 -21
  198. package/chunks/chunk-5VHXL242.js +0 -37
  199. package/chunks/chunk-5ZTW4PHE.js +0 -173
  200. package/chunks/chunk-64SYLWJ7.js +0 -37
  201. package/chunks/chunk-65YZMVWZ.js +0 -35
  202. package/chunks/chunk-66X6D4HF.js +0 -191
  203. package/chunks/chunk-6DA4S65P.js +0 -37
  204. package/chunks/chunk-6FRKSLBC.js +0 -2369
  205. package/chunks/chunk-6GZXU2Z3.js +0 -191
  206. package/chunks/chunk-6JRUZYTL.js +0 -211
  207. package/chunks/chunk-6KWNKTNI.js +0 -173
  208. package/chunks/chunk-6PNTQUTX.js +0 -20
  209. package/chunks/chunk-6Z6GDMOR.js +0 -28
  210. package/chunks/chunk-72NLUT3X.js +0 -29
  211. package/chunks/chunk-72U4TDEB.js +0 -127
  212. package/chunks/chunk-75DDEILC.js +0 -191
  213. package/chunks/chunk-7DNQ6RM2.js +0 -211
  214. package/chunks/chunk-7ICUR6QY.js +0 -31
  215. package/chunks/chunk-7K2EL46G.js +0 -2391
  216. package/chunks/chunk-7KHJKCA7.js +0 -2369
  217. package/chunks/chunk-7NO34XJI.js +0 -26
  218. package/chunks/chunk-7QIYI4CK.js +0 -209
  219. package/chunks/chunk-7VL2O6SQ.js +0 -211
  220. package/chunks/chunk-7VTVA56L.js +0 -37
  221. package/chunks/chunk-7W5LABV2.js +0 -37
  222. package/chunks/chunk-7YW5HL6N.js +0 -168
  223. package/chunks/chunk-A4FSJC46.js +0 -58
  224. package/chunks/chunk-AF2MI5O5.js +0 -29
  225. package/chunks/chunk-AM26FWT6.js +0 -31
  226. package/chunks/chunk-APRHU5KY.js +0 -31
  227. package/chunks/chunk-ARDAQZRR.js +0 -239
  228. package/chunks/chunk-AXMMBQRD.js +0 -191
  229. package/chunks/chunk-B446JIN3.js +0 -29
  230. package/chunks/chunk-BLAAWANI.js +0 -191
  231. package/chunks/chunk-BNNAZPI2.js +0 -191
  232. package/chunks/chunk-BPOJYE4X.js +0 -1108
  233. package/chunks/chunk-BQV4DOSE.js +0 -1108
  234. package/chunks/chunk-BV67SWXG.js +0 -20
  235. package/chunks/chunk-BVCWBTHQ.js +0 -35
  236. package/chunks/chunk-BW3XNPCJ.js +0 -191
  237. package/chunks/chunk-C2VF2MJV.js +0 -60
  238. package/chunks/chunk-C5753KUP.js +0 -127
  239. package/chunks/chunk-C5CIYEMD.js +0 -191
  240. package/chunks/chunk-C7SRAQMW.js +0 -29
  241. package/chunks/chunk-CAMYGA44.js +0 -22
  242. package/chunks/chunk-CB52KVOZ.js +0 -22
  243. package/chunks/chunk-CHUOCTRP.js +0 -26
  244. package/chunks/chunk-CIJQHLIW.js +0 -31
  245. package/chunks/chunk-CK73EBO5.js +0 -35
  246. package/chunks/chunk-CMKKX7WQ.js +0 -56
  247. package/chunks/chunk-CNPV4DFI.js +0 -20
  248. package/chunks/chunk-COLNKMBN.js +0 -35
  249. package/chunks/chunk-CQ3R7BEH.js +0 -173
  250. package/chunks/chunk-CQEDNACN.js +0 -28
  251. package/chunks/chunk-CRGU2EHQ.js +0 -31
  252. package/chunks/chunk-CRGUZBZX.js +0 -37
  253. package/chunks/chunk-CRZMH2K5.js +0 -2369
  254. package/chunks/chunk-CSYW7AAI.js +0 -191
  255. package/chunks/chunk-CWRRSS4V.js +0 -27
  256. package/chunks/chunk-D2JMITOU.js +0 -37
  257. package/chunks/chunk-D2NTUAFE.js +0 -4284
  258. package/chunks/chunk-D2V6SYYA.js +0 -191
  259. package/chunks/chunk-D5E2CIDK.js +0 -20
  260. package/chunks/chunk-D6VWX3D6.js +0 -186
  261. package/chunks/chunk-DCKTGQOX.js +0 -29
  262. package/chunks/chunk-DCSNQUVT.js +0 -56
  263. package/chunks/chunk-DHMARF6D.js +0 -62
  264. package/chunks/chunk-DHWHB53F.js +0 -191
  265. package/chunks/chunk-DLGA4UD5.js +0 -37
  266. package/chunks/chunk-DLSXW4NB.js +0 -2369
  267. package/chunks/chunk-DMR2WE3C.js +0 -62
  268. package/chunks/chunk-DZME4OQW.js +0 -2369
  269. package/chunks/chunk-E4FJHD5R.js +0 -67
  270. package/chunks/chunk-ECKOTCS4.js +0 -2369
  271. package/chunks/chunk-EEIJDUNV.js +0 -209
  272. package/chunks/chunk-EHVYR4OU.js +0 -56
  273. package/chunks/chunk-EI6W5HLB.js +0 -56
  274. package/chunks/chunk-EIU72AEZ.js +0 -31
  275. package/chunks/chunk-EJEG2LDE.js +0 -2427
  276. package/chunks/chunk-ERAFJXWH.js +0 -20
  277. package/chunks/chunk-ETRM76O3.js +0 -2369
  278. package/chunks/chunk-EUY4OBBI.js +0 -100
  279. package/chunks/chunk-EVOTJ7SU.js +0 -35
  280. package/chunks/chunk-EWM3VOPO.js +0 -191
  281. package/chunks/chunk-EX7FS6IR.js +0 -28
  282. package/chunks/chunk-F5DWWSOB.js +0 -31
  283. package/chunks/chunk-F5GXXF3A.js +0 -31
  284. package/chunks/chunk-FCU6IHKD.js +0 -15
  285. package/chunks/chunk-FDPPGRBY.js +0 -211
  286. package/chunks/chunk-FEFY3V6P.js +0 -31
  287. package/chunks/chunk-FG53JEP2.js +0 -31
  288. package/chunks/chunk-FHEUGVMU.js +0 -37
  289. package/chunks/chunk-FJTOFK3C.js +0 -203
  290. package/chunks/chunk-FOLCH72D.js +0 -211
  291. package/chunks/chunk-FONURDTX.js +0 -211
  292. package/chunks/chunk-FQD3VK47.js +0 -37
  293. package/chunks/chunk-FTIDPZZ5.js +0 -209
  294. package/chunks/chunk-FWZSMFVA.js +0 -211
  295. package/chunks/chunk-G3YL3WQJ.js +0 -56
  296. package/chunks/chunk-GARJTJ6V.js +0 -6
  297. package/chunks/chunk-GB4UQS6V.js +0 -35
  298. package/chunks/chunk-GBMHGF7P.js +0 -20
  299. package/chunks/chunk-GDFWDU4Q.js +0 -2369
  300. package/chunks/chunk-GGT2PUZH.js +0 -21
  301. package/chunks/chunk-GKG3UQH3.js +0 -191
  302. package/chunks/chunk-GL54CDM2.js +0 -20
  303. package/chunks/chunk-GNZY3ZTH.js +0 -14
  304. package/chunks/chunk-GP44TBRI.js +0 -39
  305. package/chunks/chunk-GPWFYPER.js +0 -211
  306. package/chunks/chunk-GQMFBT5T.js +0 -191
  307. package/chunks/chunk-GWXVHCAB.js +0 -31
  308. package/chunks/chunk-H7WUTMKQ.js +0 -31
  309. package/chunks/chunk-HDNYKGJM.js +0 -31
  310. package/chunks/chunk-HE6F5XJQ.js +0 -20
  311. package/chunks/chunk-HNB6B4FO.js +0 -37
  312. package/chunks/chunk-HP3OH2K7.js +0 -27
  313. package/chunks/chunk-HP722G2E.js +0 -211
  314. package/chunks/chunk-HQA7SCAD.js +0 -20
  315. package/chunks/chunk-HQACEDCF.js +0 -37
  316. package/chunks/chunk-HQGZVWBB.js +0 -56
  317. package/chunks/chunk-HTNLTDQT.js +0 -28
  318. package/chunks/chunk-I2ILSLBK.js +0 -32
  319. package/chunks/chunk-I4EBRCSJ.js +0 -20
  320. package/chunks/chunk-I66DPQN2.js +0 -31
  321. package/chunks/chunk-IECKIGM7.js +0 -2391
  322. package/chunks/chunk-IGHRNHVK.js +0 -16
  323. package/chunks/chunk-IJ7SOXLA.js +0 -107
  324. package/chunks/chunk-ILG6VQTL.js +0 -100
  325. package/chunks/chunk-IMR3ZNXR.js +0 -211
  326. package/chunks/chunk-IMZIWMCE.js +0 -191
  327. package/chunks/chunk-IOWZMFCU.js +0 -28
  328. package/chunks/chunk-IPON4W2H.js +0 -31
  329. package/chunks/chunk-IPOZQPNX.js +0 -37
  330. package/chunks/chunk-ISAIFQAY.js +0 -100
  331. package/chunks/chunk-IUFAHY2R.js +0 -38
  332. package/chunks/chunk-IYHWMMQE.js +0 -37
  333. package/chunks/chunk-J5A7YTMU.js +0 -56
  334. package/chunks/chunk-JBSS64SA.js +0 -6
  335. package/chunks/chunk-JIWZPVRS.js +0 -20
  336. package/chunks/chunk-JJ5ME3A2.js +0 -191
  337. package/chunks/chunk-JJK5733Z.js +0 -211
  338. package/chunks/chunk-JKWNIKHN.js +0 -37
  339. package/chunks/chunk-JNXO4QEM.js +0 -56
  340. package/chunks/chunk-JRXEHYIE.js +0 -37
  341. package/chunks/chunk-JRXTMXKV.js +0 -15967
  342. package/chunks/chunk-JSYVAPV6.js +0 -6
  343. package/chunks/chunk-JUIKU4XP.js +0 -191
  344. package/chunks/chunk-JWF5EKM2.js +0 -127
  345. package/chunks/chunk-JWKI6G6E.js +0 -102
  346. package/chunks/chunk-JXH3CLF4.js +0 -56
  347. package/chunks/chunk-JYW5L62E.js +0 -211
  348. package/chunks/chunk-KB4BPJBE.js +0 -2369
  349. package/chunks/chunk-KD627A47.js +0 -191
  350. package/chunks/chunk-KEYRP27F.js +0 -191
  351. package/chunks/chunk-KFW3ORPQ.js +0 -20
  352. package/chunks/chunk-KQZK54ZT.js +0 -2369
  353. package/chunks/chunk-KUIQRVIC.js +0 -100
  354. package/chunks/chunk-KYMCGWPM.js +0 -31
  355. package/chunks/chunk-L2L27BLX.js +0 -56
  356. package/chunks/chunk-L443MD77.js +0 -191
  357. package/chunks/chunk-L5JWJRZ7.js +0 -484
  358. package/chunks/chunk-LAA2DQDK.js +0 -31
  359. package/chunks/chunk-LATEK24U.js +0 -31
  360. package/chunks/chunk-LDLSU4OG.js +0 -191
  361. package/chunks/chunk-LLGU4W6F.js +0 -37
  362. package/chunks/chunk-LLSKBXT7.js +0 -14
  363. package/chunks/chunk-LOFELEU3.js +0 -1108
  364. package/chunks/chunk-LVXK54LL.js +0 -27
  365. package/chunks/chunk-LWWXPVXY.js +0 -25173
  366. package/chunks/chunk-LXPG32TV.js +0 -31
  367. package/chunks/chunk-M6WWIEQJ.js +0 -37
  368. package/chunks/chunk-M737IMZM.js +0 -37
  369. package/chunks/chunk-M7YNPJYY.js +0 -173
  370. package/chunks/chunk-MAP7OSVR.js +0 -37
  371. package/chunks/chunk-MBWRDYGE.js +0 -191
  372. package/chunks/chunk-MC5RLVK5.js +0 -4284
  373. package/chunks/chunk-MF56TTC5.js +0 -15
  374. package/chunks/chunk-MMNQZ2IM.js +0 -20
  375. package/chunks/chunk-MMPJODO2.js +0 -31
  376. package/chunks/chunk-MOA6JFUQ.js +0 -2369
  377. package/chunks/chunk-MQPY7A3O.js +0 -211
  378. package/chunks/chunk-MTT7TVR3.js +0 -127
  379. package/chunks/chunk-MUYZV5F3.js +0 -2369
  380. package/chunks/chunk-MUZGZ3ZF.js +0 -50
  381. package/chunks/chunk-MV7CCO4Y.js +0 -4430
  382. package/chunks/chunk-MW3KNVTG.js +0 -29
  383. package/chunks/chunk-MY4VMHSH.js +0 -191
  384. package/chunks/chunk-MZ2RAM5Y.js +0 -62
  385. package/chunks/chunk-MZSIKE3H.js +0 -211
  386. package/chunks/chunk-N2AOS7WW.js +0 -20
  387. package/chunks/chunk-N37FT2RW.js +0 -2391
  388. package/chunks/chunk-N4BZJOGW.js +0 -56
  389. package/chunks/chunk-N4LMP4UM.js +0 -31
  390. package/chunks/chunk-NGYJGQT3.js +0 -25002
  391. package/chunks/chunk-NHQVXC4Y.js +0 -2391
  392. package/chunks/chunk-NIOOIUSD.js +0 -104
  393. package/chunks/chunk-NLHFSJYR.js +0 -15
  394. package/chunks/chunk-NQ5ESZNO.js +0 -191
  395. package/chunks/chunk-NRRDPNOH.js +0 -100
  396. package/chunks/chunk-NWFX6TEY.js +0 -28
  397. package/chunks/chunk-O2WG3EMN.js +0 -2369
  398. package/chunks/chunk-O6NULFZI.js +0 -37
  399. package/chunks/chunk-OAQG5VAW.js +0 -211
  400. package/chunks/chunk-OJI6SN6F.js +0 -31
  401. package/chunks/chunk-OJXN5JW7.js +0 -37
  402. package/chunks/chunk-OVMNSJOW.js +0 -6
  403. package/chunks/chunk-P2H6PV4O.js +0 -26
  404. package/chunks/chunk-PEEPNNRS.js +0 -173
  405. package/chunks/chunk-PEOXR2Q6.js +0 -191
  406. package/chunks/chunk-PIIE3634.js +0 -37
  407. package/chunks/chunk-PJDZMLNG.js +0 -127
  408. package/chunks/chunk-PM7FWQYD.js +0 -20
  409. package/chunks/chunk-PMYUC6VD.js +0 -37
  410. package/chunks/chunk-PPHUIOHO.js +0 -28
  411. package/chunks/chunk-PPK2JEO6.js +0 -28
  412. package/chunks/chunk-PVHLWKA6.js +0 -31
  413. package/chunks/chunk-PYVUC6EN.js +0 -191
  414. package/chunks/chunk-Q7HA7IAA.js +0 -20
  415. package/chunks/chunk-QAJYFNPZ.js +0 -211
  416. package/chunks/chunk-QHGZBCFZ.js +0 -1108
  417. package/chunks/chunk-QI67BXO6.js +0 -2370
  418. package/chunks/chunk-QIXAGMCI.js +0 -211
  419. package/chunks/chunk-QLJBBAQ5.js +0 -37
  420. package/chunks/chunk-QMWX2A56.js +0 -56
  421. package/chunks/chunk-QPBY235R.js +0 -239
  422. package/chunks/chunk-QTTNO4T6.js +0 -37
  423. package/chunks/chunk-QUWGF5WZ.js +0 -191
  424. package/chunks/chunk-QZPBUDX2.js +0 -20
  425. package/chunks/chunk-R23B2MRN.js +0 -2405
  426. package/chunks/chunk-R57V5HA7.js +0 -211
  427. package/chunks/chunk-RDQJSWRC.js +0 -127
  428. package/chunks/chunk-REBANVPP.js +0 -104
  429. package/chunks/chunk-RHV7UOXD.js +0 -211
  430. package/chunks/chunk-RI37ZSKY.js +0 -2369
  431. package/chunks/chunk-ROJZUEYL.js +0 -37
  432. package/chunks/chunk-RRSHCFEP.js +0 -191
  433. package/chunks/chunk-RSMUYH5H.js +0 -31
  434. package/chunks/chunk-RTFKMYT7.js +0 -2369
  435. package/chunks/chunk-RVVJ4QD4.js +0 -173
  436. package/chunks/chunk-RWWYR54P.js +0 -31
  437. package/chunks/chunk-RX3BKRJU.js +0 -2407
  438. package/chunks/chunk-S7MJLTCR.js +0 -211
  439. package/chunks/chunk-SA2IY5LN.js +0 -35
  440. package/chunks/chunk-SBAY4ZKE.js +0 -211
  441. package/chunks/chunk-SEB7TFUB.js +0 -20
  442. package/chunks/chunk-SFYYQPAK.js +0 -37
  443. package/chunks/chunk-SJLH36CH.js +0 -26
  444. package/chunks/chunk-SJQNLCGS.js +0 -173
  445. package/chunks/chunk-SNITNUQ6.js +0 -20
  446. package/chunks/chunk-SOAU5CRO.js +0 -56
  447. package/chunks/chunk-SPMF4X5X.js +0 -31
  448. package/chunks/chunk-SR2YFPJZ.js +0 -2419
  449. package/chunks/chunk-SYD5FZEO.js +0 -20
  450. package/chunks/chunk-T5C73QJF.js +0 -56
  451. package/chunks/chunk-TAVCC26N.js +0 -37
  452. package/chunks/chunk-TEB7KZWB.js +0 -21
  453. package/chunks/chunk-TL3JMADI.js +0 -2391
  454. package/chunks/chunk-TLTLM47Y.js +0 -27
  455. package/chunks/chunk-TOZXS7ZY.js +0 -2369
  456. package/chunks/chunk-TSQVG7GA.js +0 -31
  457. package/chunks/chunk-TXOUGP37.js +0 -62
  458. package/chunks/chunk-TYJOCMG7.js +0 -37
  459. package/chunks/chunk-U32YPAPW.js +0 -2369
  460. package/chunks/chunk-U6W7BPH4.js +0 -2369
  461. package/chunks/chunk-U6YRINXJ.js +0 -22
  462. package/chunks/chunk-UBFLFJMH.js +0 -37
  463. package/chunks/chunk-UDY37VIJ.js +0 -22
  464. package/chunks/chunk-UFKH5WD2.js +0 -21
  465. package/chunks/chunk-UG36UPJK.js +0 -31
  466. package/chunks/chunk-UHH75BZP.js +0 -56
  467. package/chunks/chunk-UL6OZKRF.js +0 -20
  468. package/chunks/chunk-UMJX4S4M.js +0 -56
  469. package/chunks/chunk-UODICVLG.js +0 -173
  470. package/chunks/chunk-UT75PSLP.js +0 -20
  471. package/chunks/chunk-UXM54YBI.js +0 -68
  472. package/chunks/chunk-VDNIN3V5.js +0 -23
  473. package/chunks/chunk-VEKKX6Z5.js +0 -173
  474. package/chunks/chunk-VH4FK3TX.js +0 -31
  475. package/chunks/chunk-VHCD3Z4T.js +0 -20
  476. package/chunks/chunk-VHFMQI7Z.js +0 -20
  477. package/chunks/chunk-VKURVIRV.js +0 -28
  478. package/chunks/chunk-VLHSIIPO.js +0 -20
  479. package/chunks/chunk-VP3Y6EMX.js +0 -190
  480. package/chunks/chunk-VQEP2EQF.js +0 -100
  481. package/chunks/chunk-VV35APGM.js +0 -2369
  482. package/chunks/chunk-VV72XGJJ.js +0 -58
  483. package/chunks/chunk-VXSOUAUT.js +0 -100
  484. package/chunks/chunk-VZQ4WCBH.js +0 -2391
  485. package/chunks/chunk-W4OFHYWN.js +0 -1108
  486. package/chunks/chunk-W6BFU7Y5.js +0 -56
  487. package/chunks/chunk-W7YBGJ4H.js +0 -28
  488. package/chunks/chunk-WABWQCFE.js +0 -127
  489. package/chunks/chunk-WC2LQPQP.js +0 -26
  490. package/chunks/chunk-WDWDHE7I.js +0 -31
  491. package/chunks/chunk-WFED6NDN.js +0 -28
  492. package/chunks/chunk-WJMBLQRX.js +0 -29
  493. package/chunks/chunk-WKW34B3A.js +0 -2369
  494. package/chunks/chunk-WLHJM76F.js +0 -2369
  495. package/chunks/chunk-WNLP6R5Y.js +0 -191
  496. package/chunks/chunk-WO2R3QFK.js +0 -20
  497. package/chunks/chunk-WP7L5ZFP.js +0 -173
  498. package/chunks/chunk-WTAMA5WX.js +0 -37
  499. package/chunks/chunk-WTPUSGMJ.js +0 -104
  500. package/chunks/chunk-WXXW6YLW.js +0 -127
  501. package/chunks/chunk-WYY3N6PO.js +0 -2369
  502. package/chunks/chunk-WZC2HZ5W.js +0 -27
  503. package/chunks/chunk-X4XXZ44B.js +0 -37
  504. package/chunks/chunk-X5HMM3LD.js +0 -35
  505. package/chunks/chunk-XCBH6NLF.js +0 -42
  506. package/chunks/chunk-XDYRPW7Q.js +0 -37
  507. package/chunks/chunk-XDZD6C76.js +0 -37
  508. package/chunks/chunk-XETVQW6S.js +0 -56
  509. package/chunks/chunk-XGOWRHVM.js +0 -37
  510. package/chunks/chunk-XH6TZMNR.js +0 -211
  511. package/chunks/chunk-XI2XIH6L.js +0 -2391
  512. package/chunks/chunk-XK2PI5WI.js +0 -31
  513. package/chunks/chunk-XL7AQDAE.js +0 -31
  514. package/chunks/chunk-XPRBKRSB.js +0 -37
  515. package/chunks/chunk-XRUSQWPJ.js +0 -173
  516. package/chunks/chunk-XSOBXDGQ.js +0 -191
  517. package/chunks/chunk-XT6XKGKK.js +0 -20
  518. package/chunks/chunk-XWLQR4UY.js +0 -25
  519. package/chunks/chunk-XWU7O5KD.js +0 -211
  520. package/chunks/chunk-XXDQWJP3.js +0 -56
  521. package/chunks/chunk-YBYXIDGC.js +0 -20
  522. package/chunks/chunk-YCZQAM7E.js +0 -2407
  523. package/chunks/chunk-YDNQHZRS.js +0 -31
  524. package/chunks/chunk-YGJHHWBJ.js +0 -37
  525. package/chunks/chunk-YHT73ULP.js +0 -2369
  526. package/chunks/chunk-YKECGAIJ.js +0 -37
  527. package/chunks/chunk-YMNBUQVR.js +0 -2420
  528. package/chunks/chunk-YO5KOEJF.js +0 -27
  529. package/chunks/chunk-YRKWVEWA.js +0 -20
  530. package/chunks/chunk-YRSNU7IX.js +0 -49
  531. package/chunks/chunk-YTS4JME6.js +0 -2369
  532. package/chunks/chunk-YVHJ7TUJ.js +0 -211
  533. package/chunks/chunk-YVSS4IT2.js +0 -37
  534. package/chunks/chunk-YYE7TVB6.js +0 -2420
  535. package/chunks/chunk-YYYRFMNZ.js +0 -191
  536. package/chunks/chunk-YZDZQ7AZ.js +0 -37
  537. package/chunks/chunk-Z352MSRL.js +0 -127
  538. package/chunks/chunk-Z4SQDCFG.js +0 -37
  539. package/chunks/chunk-ZCPGE7H7.js +0 -64
  540. package/chunks/chunk-ZGYU6F7Q.js +0 -13
  541. package/chunks/chunk-ZLQUBC5B.js +0 -31
  542. package/chunks/chunk-ZNPRJEP5.js +0 -28
  543. package/chunks/chunk-ZS5OHINP.js +0 -31
  544. package/index.d.ts +0 -3
  545. package/node/encryption/buffer/index.d.ts +0 -56
  546. package/node/encryption/buffer/index.js +0 -16
  547. package/node/encryption/generate-key/index.d.ts +0 -16
  548. package/node/encryption/generate-key/index.js +0 -7
  549. package/node/encryption/uint8-array/index.d.ts +0 -57
  550. package/node/encryption/uint8-array/index.js +0 -15
  551. package/chunks/{chunk-3DJI3JTM.js → chunk-3CQON3DO.js} +9 -9
  552. package/chunks/{chunk-EZFHN4ST.js → chunk-6V7VQ32U.js} +6 -6
  553. package/chunks/{chunk-OPO25SDO.js → chunk-DW4ILX77.js} +3 -3
  554. package/chunks/{chunk-VKNWPV5T.js → chunk-FIVB3FON.js} +3 -3
  555. package/chunks/{chunk-4EFX53Y4.js → chunk-FVFYLT5T.js} +5 -5
  556. package/chunks/{chunk-222367I5.js → chunk-HUT6SDJH.js} +14 -14
  557. package/chunks/{chunk-22Q6VKLR.js → chunk-HZGGYNZ5.js} +11 -11
  558. package/chunks/{chunk-GBBM5DLR.js → chunk-JSKVNOTW.js} +3 -3
  559. package/chunks/{chunk-AE6L2HYA.js → chunk-K4Q2MG65.js} +3 -3
  560. package/chunks/{chunk-EDI5T3GL.js → chunk-KDTKA3SG.js} +6 -6
  561. package/chunks/{chunk-GPAZDWEQ.js → chunk-KTK3BMX2.js} +8 -8
  562. package/chunks/{chunk-EFLJJ5VF.js → chunk-VWLJ5IEE.js} +3 -3
  563. package/chunks/{chunk-44BKJR2T.js → chunk-X24BLY5H.js} +9 -9
  564. package/chunks/{chunk-KTB7NX4Q.js → chunk-XAZT2MME.js} +3 -3
@@ -1,1108 +0,0 @@
1
- import {
2
- replaceInElement
3
- } from "./chunk-XWLQR4UY.js";
4
- import {
5
- Serialize
6
- } from "./chunk-ZCPGE7H7.js";
7
- import {
8
- Types
9
- } from "./chunk-5GI5G45R.js";
10
- import {
11
- isRecord
12
- } from "./chunk-YDIBNEGA.js";
13
- import {
14
- isInEnum
15
- } from "./chunk-E6MSDKON.js";
16
- import {
17
- replaceAll
18
- } from "./chunk-ZTDVUXPR.js";
19
- import {
20
- Window
21
- } from "./chunk-RLJOYG64.js";
22
- import {
23
- isFalsy
24
- } from "./chunk-QXAJXTXV.js";
25
-
26
- // src/agnostic/html/hyper-json/cast/index.ts
27
- var getWindow = Window.get;
28
- var Cast;
29
- ((Cast2) => {
30
- Cast2.toNull = () => null;
31
- Cast2.toBoolean = (input) => !isFalsy(input);
32
- Cast2.toNumber = (input) => {
33
- const { Text } = getWindow();
34
- if (typeof input === "number") return input;
35
- if (typeof input === "string") return parseFloat(`${input}`);
36
- if (input instanceof Text) return parseFloat(`${input.textContent}`);
37
- return 0;
38
- };
39
- Cast2.toString = (input) => {
40
- if (typeof input === "string") return input;
41
- if (typeof input === "number" || typeof input === "boolean" || input === null) return `${input}`;
42
- const { Element, Text, NodeList } = getWindow();
43
- if (input instanceof Element) return input.outerHTML;
44
- if (input instanceof Text) return input.textContent ?? "";
45
- if (input instanceof NodeList) return Array.from(input).map((e) => {
46
- if (e instanceof Element) return e.outerHTML;
47
- return e.textContent;
48
- }).join("");
49
- return input.toString();
50
- };
51
- Cast2.toText = (input) => {
52
- const { Text, document } = getWindow();
53
- if (input instanceof Text) return input.cloneNode(true);
54
- return document.createTextNode((0, Cast2.toString)(input));
55
- };
56
- Cast2.toElement = (input) => {
57
- const { Element, Text, NodeList, document } = getWindow();
58
- if (input instanceof Element) return input.cloneNode(true);
59
- const elt = document.createElement("div");
60
- if (input instanceof Text) {
61
- elt.append(input.cloneNode(true));
62
- return elt;
63
- }
64
- if (input instanceof NodeList) {
65
- elt.append(...Array.from(input).map((e) => e.cloneNode(true)));
66
- return elt;
67
- }
68
- if (Array.isArray(input)) return elt;
69
- if (isRecord(input)) return elt;
70
- elt.append(`${input}`);
71
- return elt;
72
- };
73
- Cast2.toNodeList = (input) => {
74
- const { Element, Text, NodeList, document } = getWindow();
75
- const elt = document.createElement("div");
76
- if (input instanceof NodeList) {
77
- elt.append(...Array.from(input).map((i) => i.cloneNode(true)));
78
- return elt.childNodes;
79
- }
80
- if (input instanceof Element || input instanceof Text) {
81
- elt.append(input.cloneNode(true));
82
- return elt.childNodes;
83
- }
84
- if (Array.isArray(input)) return elt.childNodes;
85
- if (isRecord(input)) return elt.childNodes;
86
- elt.innerHTML = `${input}`;
87
- return elt.childNodes;
88
- };
89
- Cast2.toArray = (input) => {
90
- const { NodeList } = getWindow();
91
- if (Array.isArray(input)) return [...input];
92
- if (input instanceof NodeList) return Array.from(input);
93
- return [input];
94
- };
95
- Cast2.toRecord = (input) => {
96
- if (isRecord(input)) return { ...input };
97
- return {};
98
- };
99
- Cast2.toTransformer = (input) => {
100
- return Utils.toNamedTransformer("utils/Cast.toTransformer", [], () => ({
101
- action: "REPLACE",
102
- value: input
103
- }));
104
- };
105
- })(Cast || (Cast = {}));
106
-
107
- // src/agnostic/html/hyper-json/transformers/classList/index.ts
108
- var classList = (callerTagName, ...args) => {
109
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
110
- const { Element } = Window.get();
111
- if (!(currentValue instanceof Element)) return Utils.makeTransformerError("Current value must be an Element");
112
- const [actionArg, classNameArg] = args;
113
- if (actionArg === void 0 || classNameArg === void 0) return Utils.makeTransformerError(`Expecting 2 arguments: (action: 'add' | 'remove' | 'toggle', classList: string)`);
114
- const action = Cast.toString(actionArg);
115
- const className = Cast.toString(actionArg).trim();
116
- if (action === "add" /* ADD */) {
117
- const outputValue = currentValue.cloneNode(true);
118
- outputValue.classList.add(className);
119
- return { action: "REPLACE", value: outputValue };
120
- } else if (action === "remove" /* REMOVE */) {
121
- const outputValue = currentValue.cloneNode(true);
122
- outputValue.classList.remove(className);
123
- return { action: "REPLACE", value: outputValue };
124
- } else if (action === "toggle" /* TOGGLE */) {
125
- const outputValue = currentValue.cloneNode(true);
126
- outputValue.classList.toggle(className);
127
- return { action: "REPLACE", value: outputValue };
128
- }
129
- return Utils.makeTransformerError(`Unknown action: ${action}`);
130
- });
131
- };
132
-
133
- // src/agnostic/html/hyper-json/transformers/join/index.ts
134
- var join = (callerTagName, ...args) => {
135
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
136
- const joiner = Cast.toString(args.at(0) ?? ",");
137
- if (!Array.isArray(currentValue)) return Utils.makeTransformerError({
138
- message: `Current value must be an array`,
139
- input: currentValue
140
- });
141
- return {
142
- action: "REPLACE",
143
- value: currentValue.join(joiner)
144
- };
145
- });
146
- };
147
-
148
- // src/agnostic/html/hyper-json/transformers/length/index.ts
149
- var length = (callerTagName, ...args) => {
150
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
151
- const { Element, NodeList, Text } = Window.get();
152
- if (typeof currentValue === "string" || Array.isArray(currentValue) || currentValue instanceof NodeList) return {
153
- action: "REPLACE",
154
- value: currentValue.length
155
- };
156
- if (currentValue instanceof Element) return {
157
- action: "REPLACE",
158
- value: Array.from(currentValue.childNodes).length
159
- };
160
- if (currentValue instanceof Text) return {
161
- action: "REPLACE",
162
- value: currentValue.data.length
163
- };
164
- return Utils.makeTransformerError(`Current value must be of type string, Array, NodeList, Element or Text`);
165
- });
166
- };
167
-
168
- // src/agnostic/html/hyper-json/transformers/print/index.ts
169
- var print = (callerTagName, ...args) => {
170
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
171
- if (args.length === 0) console.log(currentValue);
172
- else console.log(...args);
173
- return { action: null };
174
- });
175
- };
176
-
177
- // src/agnostic/html/hyper-json/transformers/push/index.ts
178
- var push = (callerTagName, ...args) => {
179
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
180
- if (!Array.isArray(currentValue)) return Utils.makeTransformerError({
181
- message: "Current value must be an array",
182
- input: currentValue
183
- });
184
- const outputValue = [...currentValue, ...args];
185
- return {
186
- action: "REPLACE",
187
- value: outputValue
188
- };
189
- });
190
- };
191
-
192
- // src/agnostic/html/hyper-json/transformers/querySelector/index.ts
193
- var querySelector = (callerTagName, ...args) => {
194
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
195
- const { document, Element, NodeList } = Window.get();
196
- const [selectorRaw] = args;
197
- if (selectorRaw === void 0) return Utils.makeTransformerError("Selector argument expected.");
198
- const selector = Cast.toString(selectorRaw);
199
- let toQuery;
200
- if (currentValue instanceof Element) {
201
- toQuery = currentValue.cloneNode(true);
202
- } else if (currentValue instanceof NodeList) {
203
- toQuery = document.createElement("div");
204
- toQuery.append(...Array.from(currentValue).map((e) => e.cloneNode(true)));
205
- } else return Utils.makeTransformerError("Current value must be an Element or a NodeList");
206
- const found = toQuery.querySelectorAll(selector);
207
- return {
208
- action: "REPLACE",
209
- value: found
210
- };
211
- });
212
- };
213
-
214
- // src/agnostic/html/hyper-json/transformers/ref/index.ts
215
- var ref = (callerTagName, ...args) => {
216
- return Utils.toNamedTransformer(callerTagName, args, (_, callerTree) => {
217
- const [refPathStrRaw] = args;
218
- const { Text } = Window.get();
219
- if (typeof refPathStrRaw !== "string" && !(refPathStrRaw instanceof Text)) return Utils.makeTransformerError({
220
- message: "PathString must be of type string or Text",
221
- input: refPathStrRaw !== void 0 ? refPathStrRaw : "<undefined>"
222
- });
223
- const refPathStr = Cast.toString(refPathStrRaw);
224
- const refPath = Utils.pathStringToPath(Cast.toString(refPathStrRaw));
225
- const foundTree = callerTree.resolve(refPath);
226
- if (foundTree === void 0) return Utils.makeTransformerError({
227
- message: "Referenced value has not been found",
228
- input: refPathStr
229
- });
230
- const evaluated = foundTree.evaluate();
231
- return {
232
- action: "MERGE",
233
- value: evaluated
234
- };
235
- });
236
- };
237
-
238
- // src/agnostic/html/hyper-json/transformers/replace/index.ts
239
- var replace = (callerTagName, ...args) => {
240
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
241
- const { Text, NodeList, Element } = Window.get();
242
- if (typeof currentValue !== "string" && !(currentValue instanceof Text) && !(currentValue instanceof Element) && !(currentValue instanceof NodeList)) return Utils.makeTransformerError("Current value must be string, Text, Element or NodeList");
243
- if (args.some((arg) => typeof arg !== "string" && !(arg instanceof Text) && !(arg instanceof Element) && !(arg instanceof NodeList))) return Utils.makeTransformerError("Arguments must be of type string, Text, Element or NodeList");
244
- const [first, second] = args;
245
- if (first === void 0 || second === void 0) return Utils.makeTransformerError(`Expecting at least 2 arguments. Found only ${args.length}`);
246
- const replacer = args.at(-1);
247
- const strReplacer = Cast.toString(replacer);
248
- const toReplace = args.slice(0, -1);
249
- const strToReplace = toReplace.map(Cast.toString);
250
- const strInput = Cast.toString(currentValue);
251
- const strOutput = strToReplace.reduce((str, torpl) => replaceAll(str, torpl, strReplacer), strInput);
252
- if (typeof currentValue === "string") return { action: "REPLACE", value: strOutput };
253
- if (currentValue instanceof Text) return { action: "REPLACE", value: Cast.toText(strOutput) };
254
- if (currentValue instanceof Element) return { action: "REPLACE", value: Cast.toElement(strOutput) };
255
- if (currentValue instanceof NodeList) return { action: "REPLACE", value: Cast.toNodeList(strOutput) };
256
- return { action: null };
257
- });
258
- };
259
-
260
- // src/agnostic/html/hyper-json/transformers/split/index.ts
261
- var split = (callerTagName, ...args) => {
262
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
263
- const { Text } = Window.get();
264
- const [splitter] = args;
265
- if (typeof currentValue !== "string" && !(currentValue instanceof Text)) return Utils.makeTransformerError({
266
- message: "Current value must be string or Text",
267
- input: currentValue
268
- });
269
- if (typeof splitter !== "string") return Utils.makeTransformerError({
270
- message: "Splitter argument must be string",
271
- input: splitter !== void 0 ? splitter : "<undefined>"
272
- });
273
- const strCurrentValue = Cast.toString(currentValue);
274
- const splitted = strCurrentValue.split(splitter).map((e) => typeof currentValue === "string" ? Cast.toString(e) : Cast.toText(e));
275
- return {
276
- action: "REPLACE",
277
- value: splitted
278
- };
279
- });
280
- };
281
-
282
- // src/agnostic/html/hyper-json/transformers/toArray/index.ts
283
- var toArray = (callerTagName, ...args) => {
284
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
285
- action: "REPLACE",
286
- value: Cast.toArray(currentValue)
287
- }));
288
- };
289
-
290
- // src/agnostic/html/hyper-json/transformers/toBoolean/index.ts
291
- var toBoolean = (callerTagName, ...args) => {
292
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
293
- action: "REPLACE",
294
- value: Cast.toBoolean(currentValue)
295
- }));
296
- };
297
-
298
- // src/agnostic/html/hyper-json/transformers/toElement/index.ts
299
- var toElement = (callerTagName, ...args) => {
300
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
301
- action: "REPLACE",
302
- value: Cast.toElement(currentValue)
303
- }));
304
- };
305
-
306
- // src/agnostic/html/hyper-json/transformers/toNodeList/index.ts
307
- var toNodeList = (callerTagName, ...args) => {
308
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
309
- action: "REPLACE",
310
- value: Cast.toNodeList(currentValue)
311
- }));
312
- };
313
-
314
- // src/agnostic/html/hyper-json/transformers/toNull/index.ts
315
- var toNull = (callerTagName, ...args) => {
316
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
317
- action: "REPLACE",
318
- value: null
319
- }));
320
- };
321
-
322
- // src/agnostic/html/hyper-json/transformers/toNumber/index.ts
323
- var toNumber = (callerTagName, ...args) => {
324
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
325
- action: "REPLACE",
326
- value: Cast.toNumber(currentValue)
327
- }));
328
- };
329
-
330
- // src/agnostic/html/hyper-json/transformers/toRecord/index.ts
331
- var toRecord = (callerTagName, ...args) => {
332
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
333
- action: "REPLACE",
334
- value: Cast.toRecord(currentValue)
335
- }));
336
- };
337
-
338
- // src/agnostic/html/hyper-json/transformers/toRef/index.ts
339
- var toRef = (callerTagName, ...args) => {
340
- return Utils.toNamedTransformer(callerTagName, args, (currentValue, callerTree) => {
341
- const { Text } = Window.get();
342
- if (typeof currentValue !== "string" && !(currentValue instanceof Text)) return Utils.makeTransformerError({
343
- message: "Current value must be string or Text",
344
- input: currentValue
345
- });
346
- const refPathStr = Cast.toString(currentValue);
347
- const refPath = Utils.pathStringToPath(refPathStr);
348
- const foundTree = callerTree.resolve(refPath);
349
- if (foundTree === void 0) return Utils.makeTransformerError({
350
- message: "Referenced value has not been found",
351
- input: refPathStr
352
- });
353
- const evaluated = foundTree.evaluate();
354
- return {
355
- action: "REPLACE",
356
- value: evaluated
357
- };
358
- });
359
- };
360
-
361
- // src/agnostic/html/hyper-json/transformers/toString/index.ts
362
- var toString = (callerTagName, ...args) => {
363
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
364
- action: "REPLACE",
365
- value: Cast.toString(currentValue)
366
- }));
367
- };
368
-
369
- // src/agnostic/html/hyper-json/transformers/toText/index.ts
370
- var toText = (callerTagName, ...args) => {
371
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
372
- action: "REPLACE",
373
- value: Cast.toText(currentValue)
374
- }));
375
- };
376
-
377
- // src/agnostic/html/hyper-json/transformers/toTransformer/index.ts
378
- var toTransformer = (callerTagName, ...args) => {
379
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => ({
380
- action: "REPLACE",
381
- value: Cast.toTransformer(currentValue)
382
- }));
383
- };
384
-
385
- // src/agnostic/html/hyper-json/transformers/transformSelected/index.ts
386
- var transformSelected = (callerTagName, ...args) => {
387
- return Utils.toNamedTransformer(callerTagName, args, (currentValue, callerTree) => {
388
- const { NodeList, Element, Text } = Window.get();
389
- if (!(currentValue instanceof Element) && !(currentValue instanceof NodeList)) return Utils.makeTransformerError({
390
- message: "Current value must be Element or NodeList",
391
- input: currentValue
392
- });
393
- const [selector, ...transformerDescriptors] = args;
394
- if (typeof selector !== "string" && !(selector instanceof Text)) return Utils.makeTransformerError({
395
- message: "Selector argument must be string or text",
396
- input: selector !== void 0 ? selector : "<undefined>"
397
- });
398
- if (transformerDescriptors.length === 0) return Utils.makeTransformerError("No transformer descriptor provided");
399
- let transformers = [];
400
- for (const descriptor of transformerDescriptors) {
401
- const errorResponse = Utils.makeTransformerError({
402
- message: "Transformer descriptors must be of shape { name: string, arguments: Value[] }",
403
- input: descriptor
404
- });
405
- if (!isRecord(descriptor)) return errorResponse;
406
- if (!("name" in descriptor) || typeof descriptor.name !== "string") return errorResponse;
407
- if (!("arguments" in descriptor) || !Array.isArray(descriptor.arguments)) return errorResponse;
408
- const { name, arguments: args2 } = descriptor;
409
- const generator = callerTree.getGenerator(name);
410
- if (generator === void 0) return Utils.makeTransformerError(`No transformer found under the name ${name}`);
411
- transformers.push(generator(name, ...args2));
412
- }
413
- const elementInput = Cast.toElement(currentValue);
414
- const strSelector = Cast.toString(selector);
415
- const selected = Array.from(elementInput.querySelectorAll(strSelector));
416
- const transformationErrors = [];
417
- const transformed = selected.map((input) => {
418
- const output = transformers.reduce((reduced, transformer, transformerPos) => {
419
- const result = transformer(reduced, callerTree);
420
- if (result.action === "REPLACE") return result.value;
421
- else if (result.action === "MERGE") {
422
- const merged = Tree.mergeValues(
423
- reduced,
424
- result.value,
425
- transformerPos,
426
- callerTree
427
- );
428
- return merged;
429
- }
430
- if (result.action === "ERROR") transformationErrors.push({
431
- message: result.value,
432
- transformerName: transformer.transformerName,
433
- transformerPos,
434
- transforming: reduced
435
- });
436
- return reduced;
437
- }, input);
438
- return { input, output };
439
- });
440
- if (transformationErrors.length !== 0) return Utils.makeTransformerError({
441
- message: "Some nested transformers returned an error",
442
- errors: transformationErrors
443
- });
444
- const nonElementTransformResult = transformed.find((item) => !(item.output instanceof Element));
445
- if (nonElementTransformResult !== void 0) return Utils.makeTransformerError({
446
- message: "Some transformations resulted in a non Element output",
447
- inputElement: nonElementTransformResult.input,
448
- outputValue: nonElementTransformResult.output
449
- });
450
- const transformMap = new Map(transformed.map((e) => [e.input, e.output]));
451
- const elementOutput = replaceInElement(elementInput, transformMap);
452
- return {
453
- action: "REPLACE",
454
- value: elementOutput
455
- };
456
- });
457
- };
458
-
459
- // src/agnostic/html/hyper-json/transformers/trim/index.ts
460
- var trim = (callerTagName, ...args) => {
461
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
462
- const { Text } = Window.get();
463
- if (typeof currentValue !== "string" && !(currentValue instanceof Text)) return Utils.makeTransformerError({
464
- message: "Current value must be of type string or Text",
465
- input: currentValue
466
- });
467
- const inputStr = Cast.toString(currentValue);
468
- const trimmed = inputStr.trim();
469
- return {
470
- action: "REPLACE",
471
- value: currentValue instanceof Text ? Cast.toText(trimmed) : trimmed
472
- };
473
- });
474
- };
475
-
476
- // src/agnostic/html/hyper-json/transformers/index.ts
477
- var Transformers;
478
- ((Transformers2) => {
479
- Transformers2.defaultGeneratorsMap = /* @__PURE__ */ new Map([
480
- ["append".toLowerCase(), append],
481
- ["classList".toLowerCase(), classList],
482
- ["join".toLowerCase(), join],
483
- ["length".toLowerCase(), length],
484
- ["print".toLowerCase(), print],
485
- ["push".toLowerCase(), push],
486
- ["querySelector".toLowerCase(), querySelector],
487
- ["ref".toLowerCase(), ref],
488
- ["replace".toLowerCase(), replace],
489
- ["split".toLowerCase(), split],
490
- ["toArray".toLowerCase(), toArray],
491
- ["toBoolean".toLowerCase(), toBoolean],
492
- ["toElement".toLowerCase(), toElement],
493
- ["toNodeList".toLowerCase(), toNodeList],
494
- ["toNull".toLowerCase(), toNull],
495
- ["toNumber".toLowerCase(), toNumber],
496
- ["toRecord".toLowerCase(), toRecord],
497
- ["toRef".toLowerCase(), toRef],
498
- ["toString".toLowerCase(), toString],
499
- ["toText".toLowerCase(), toText],
500
- ["toTransformer".toLowerCase(), toTransformer],
501
- ["transformSelected".toLowerCase(), transformSelected],
502
- ["trim".toLowerCase(), trim]
503
- ]);
504
- })(Transformers || (Transformers = {}));
505
-
506
- // src/agnostic/html/hyper-json/tree/index.ts
507
- var getWindow2 = Window.get;
508
- var isElement = (node) => node.nodeType === getWindow2().Node.ELEMENT_NODE;
509
- var isText = (node) => node.nodeType === getWindow2().Node.TEXT_NODE;
510
- var Tree;
511
- ((_Tree) => {
512
- _Tree.defaultKeyAttribute = "_key";
513
- _Tree.defaultActionAttribute = "_action";
514
- _Tree.defaultRootKey = "_ROOT_";
515
- function mergeValues(currentValue, incomingValue, mergeKey, initiatorTree) {
516
- const { Element, Text, NodeList, document } = getWindow2();
517
- if (typeof incomingValue === "function") {
518
- const evaluated = incomingValue(currentValue, initiatorTree);
519
- if (evaluated.action === null) return currentValue;
520
- if (evaluated.action === "REPLACE") return evaluated.value;
521
- if (evaluated.action === "ERROR") {
522
- const errorMessage = `Tranformer error:
523
- from: ${incomingValue.transformerName}
524
- at: ${initiatorTree.pathString.slice(1)}/${mergeKey}
525
- message:`;
526
- console.warn(errorMessage, evaluated.value);
527
- return currentValue;
528
- }
529
- return mergeValues(
530
- currentValue,
531
- evaluated.value,
532
- mergeKey,
533
- initiatorTree
534
- );
535
- }
536
- if (Array.isArray(currentValue)) {
537
- if (typeof mergeKey === "string") return currentValue;
538
- return [...currentValue, incomingValue];
539
- }
540
- if (currentValue === null || typeof currentValue === "boolean" || typeof currentValue === "number" || typeof currentValue === "string" || typeof currentValue === "function" || currentValue instanceof Text || currentValue instanceof Element) {
541
- if (incomingValue === null || typeof incomingValue === "boolean" || typeof incomingValue === "number" || typeof incomingValue === "string" || Array.isArray(incomingValue) || isRecord(incomingValue)) {
542
- return incomingValue;
543
- }
544
- const frag = document.createDocumentFragment();
545
- if (currentValue instanceof Element || currentValue instanceof Text) frag.append(currentValue.cloneNode(true));
546
- else frag.append(`${currentValue}`);
547
- if (incomingValue instanceof Element || incomingValue instanceof Text) {
548
- frag.append(incomingValue.cloneNode(true));
549
- return frag.childNodes;
550
- }
551
- frag.append(...Array.from(incomingValue).map((e) => e.cloneNode(true)));
552
- return frag.childNodes;
553
- }
554
- if (currentValue instanceof NodeList) {
555
- if (incomingValue instanceof Element || incomingValue instanceof Text) {
556
- const frag = document.createDocumentFragment();
557
- frag.append(...Array.from(currentValue).map((e) => e.cloneNode(true)), incomingValue);
558
- return frag.childNodes;
559
- }
560
- if (incomingValue instanceof NodeList) {
561
- const frag = document.createDocumentFragment();
562
- frag.append(
563
- ...Array.from(currentValue).map((e) => e.cloneNode(true)),
564
- ...Array.from(incomingValue).map((e) => e.cloneNode(true))
565
- );
566
- return frag.childNodes;
567
- }
568
- if (incomingValue === null || typeof incomingValue === "string" || typeof incomingValue === "number" || typeof incomingValue === "boolean") {
569
- const frag = document.createDocumentFragment();
570
- frag.append(...Array.from(currentValue).map((e) => e.cloneNode(true)), `${incomingValue}`);
571
- return frag.childNodes;
572
- }
573
- if (Array.isArray(incomingValue)) return [
574
- ...Array.from(currentValue),
575
- ...incomingValue
576
- ];
577
- return { ...incomingValue };
578
- }
579
- if (typeof mergeKey === "number") return currentValue;
580
- return {
581
- ...currentValue,
582
- [mergeKey]: incomingValue
583
- };
584
- }
585
- _Tree.mergeValues = mergeValues;
586
- function mergeNodes(nodes, options = {}) {
587
- const [first, ...rest] = nodes;
588
- const actionAttribute = options?.actionAttribute ?? _Tree.defaultActionAttribute;
589
- const keyAttribute = options?.keyAttribute ?? _Tree.defaultKeyAttribute;
590
- if (first === void 0) throw new Error("Expecting at least one node");
591
- const { Text, Element, document } = getWindow2();
592
- function isTextOrElement(node) {
593
- return node instanceof Text || node instanceof Element;
594
- }
595
- let CURRENT = first;
596
- rest.forEach((node) => {
597
- if (node instanceof Text) {
598
- CURRENT.remove();
599
- CURRENT = node;
600
- return;
601
- }
602
- const actionRaw = node.getAttribute(actionAttribute);
603
- const action = isInEnum(Types.ReductionAction, actionRaw) ? actionRaw : Types.ReductionAction.REPLACE;
604
- if (action === Types.ReductionAction.REPLACE) {
605
- CURRENT.remove();
606
- CURRENT = node;
607
- return;
608
- }
609
- if (CURRENT instanceof Text) {
610
- if (node instanceof Text) {
611
- const appended = action === Types.ReductionAction.APPEND ? document.createTextNode(`${CURRENT.textContent}${node.textContent}`) : document.createTextNode(`${node.textContent}${CURRENT.textContent}`);
612
- CURRENT.remove();
613
- node.remove();
614
- CURRENT = appended;
615
- return;
616
- }
617
- CURRENT.remove();
618
- CURRENT = node;
619
- return;
620
- }
621
- if (node instanceof Text) {
622
- CURRENT.remove();
623
- CURRENT = node;
624
- return;
625
- }
626
- const currentAttributes = Array.from(CURRENT.attributes);
627
- const nodeAttributes = Array.from(node.attributes);
628
- const nodeChildren = Array.from(node.childNodes).filter(isTextOrElement);
629
- const outputAttributes = action === Types.ReductionAction.APPEND ? [...currentAttributes, ...nodeAttributes] : [...nodeAttributes, ...currentAttributes];
630
- if (action === Types.ReductionAction.APPEND) CURRENT.append(...nodeChildren);
631
- else CURRENT.prepend(...nodeChildren);
632
- outputAttributes.forEach((attr) => CURRENT.setAttribute(attr.name, attr.value));
633
- node.remove();
634
- return;
635
- });
636
- const wrapperChildren = Array.from(CURRENT.childNodes).filter(isTextOrElement);
637
- const subpaths = /* @__PURE__ */ new Map();
638
- let positionnedChildrenCount = 0;
639
- wrapperChildren.forEach((child) => {
640
- if (child instanceof Text) {
641
- const childKey = positionnedChildrenCount;
642
- const found = subpaths.get(childKey) ?? [];
643
- found.push(child);
644
- subpaths.set(childKey, found);
645
- positionnedChildrenCount += 1;
646
- } else {
647
- const rawChildKey = child.getAttribute(keyAttribute);
648
- const childKey = rawChildKey ?? positionnedChildrenCount;
649
- const found = subpaths.get(childKey) ?? [];
650
- found.push(child);
651
- subpaths.set(childKey, found);
652
- if (rawChildKey === null) {
653
- positionnedChildrenCount += 1;
654
- }
655
- }
656
- });
657
- subpaths.forEach((nodes2, subpath) => {
658
- if (nodes2.length < 2) return;
659
- return mergeNodes(nodes2, {
660
- actionAttribute,
661
- keyAttribute
662
- });
663
- });
664
- return CURRENT;
665
- }
666
- _Tree.mergeNodes = mergeNodes;
667
- function mergeRootNodes(...args) {
668
- const [nodes, options] = args;
669
- const actionAttribute = options?.actionAttribute ?? _Tree.defaultActionAttribute;
670
- const keyAttribute = options?.keyAttribute ?? _Tree.defaultKeyAttribute;
671
- const rootKey = options?.rootKey ?? _Tree.defaultRootKey;
672
- const { Element } = getWindow2();
673
- const elements = nodes.filter((e) => e instanceof Element);
674
- elements.forEach((element) => {
675
- element.setAttribute(keyAttribute, rootKey);
676
- const elementAction = element.getAttribute(actionAttribute) ?? Types.ReductionAction.APPEND;
677
- element.setAttribute(actionAttribute, elementAction);
678
- });
679
- const merged = mergeNodes(elements, options);
680
- return merged;
681
- }
682
- _Tree.mergeRootNodes = mergeRootNodes;
683
- function from(nodes, options) {
684
- const merged = mergeRootNodes(nodes, options);
685
- return new Tree2(merged, options);
686
- }
687
- _Tree.from = from;
688
- class Tree2 {
689
- node;
690
- name;
691
- parent;
692
- root;
693
- isRoot;
694
- path;
695
- pathString;
696
- tagName;
697
- attributes;
698
- subtrees = /* @__PURE__ */ new Map();
699
- children;
700
- type;
701
- generators;
702
- keyAttribute;
703
- actionAttribute;
704
- static fillOptions(options) {
705
- const defaultOptions = {
706
- generatorsMap: Transformers.defaultGeneratorsMap,
707
- keyAttribute: _Tree.defaultKeyAttribute,
708
- actionAttribute: _Tree.defaultActionAttribute
709
- };
710
- return {
711
- ...defaultOptions,
712
- ...options
713
- };
714
- }
715
- constructor(node, parentOrOptions, pathFromParent, options) {
716
- this.resolve = this.resolve.bind(this);
717
- this.getGenerator = this.getGenerator.bind(this);
718
- this.initValue = this.initValue.bind(this);
719
- this.getInnerValue = this.getInnerValue.bind(this);
720
- this.wrapInnerValue = this.wrapInnerValue.bind(this);
721
- this.setCache = this.setCache.bind(this);
722
- this.getPerfCounters = this.getPerfCounters.bind(this);
723
- this.printPerfCounters = this.printPerfCounters.bind(this);
724
- this.pushToEvalCallStack = this.pushToEvalCallStack.bind(this);
725
- this.flushEvalCallStack = this.flushEvalCallStack.bind(this);
726
- this.evaluate = this.evaluate.bind(this);
727
- const { Element, Text, document } = getWindow2();
728
- const _node = node;
729
- const _parent = parentOrOptions instanceof Tree2 ? parentOrOptions : void 0;
730
- this.node = _node;
731
- this.parent = _parent ?? null;
732
- this.root = this.parent === null ? this : this.parent.root;
733
- this.isRoot = this.root === this;
734
- let _options;
735
- if (options !== void 0) {
736
- _options = Tree2.fillOptions(options);
737
- } else if (parentOrOptions instanceof Tree2 || parentOrOptions === void 0) {
738
- _options = Tree2.fillOptions({});
739
- } else {
740
- _options = Tree2.fillOptions(parentOrOptions);
741
- }
742
- this.keyAttribute = _options.keyAttribute;
743
- this.actionAttribute = _options.actionAttribute;
744
- this.generators = this.isRoot ? _options.generatorsMap : this.root.generators;
745
- this.name = this.node instanceof Element ? this.node.getAttribute(this.keyAttribute) : null;
746
- const _pathFromParent = pathFromParent !== void 0 ? pathFromParent : void 0;
747
- if (this.parent === null) this.path = [];
748
- else if (_pathFromParent === void 0) {
749
- this.path = [...this.parent.path, 0];
750
- } else {
751
- this.path = [...this.parent.path, _pathFromParent];
752
- }
753
- this.pathString = `/${this.path.join("/")}`;
754
- this.tagName = node instanceof Element ? node.tagName.toLowerCase() : null;
755
- this.attributes = isElement(node) ? Array.from(node.attributes) : null;
756
- if (this.tagName === null) {
757
- this.type = "text";
758
- } else if (this.tagName === Types.TyperTagName.ANY) {
759
- this.type = "any";
760
- } else if (this.tagName === Types.TyperTagName.NULL) {
761
- this.type = "null";
762
- } else if (this.tagName === Types.TyperTagName.BOOLEAN) {
763
- this.type = "boolean";
764
- } else if (this.tagName === Types.TyperTagName.NUMBER) {
765
- this.type = "number";
766
- } else if (this.tagName === Types.TyperTagName.STRING) {
767
- this.type = "string";
768
- } else if (this.tagName === Types.TyperTagName.TEXT) {
769
- this.type = "text";
770
- } else if (this.tagName === Types.TyperTagName.NODELIST) {
771
- this.type = "nodelist";
772
- } else if (this.tagName === Types.TyperTagName.ARRAY) {
773
- this.type = "array";
774
- } else if (this.tagName === Types.TyperTagName.RECORD) {
775
- this.type = "record";
776
- } else if (this.tagName === Types.TyperTagName.LITERAL) {
777
- this.type = "literal";
778
- } else if (this.generators.get(this.tagName) !== void 0) {
779
- this.type = "transformer";
780
- } else {
781
- this.type = "element";
782
- }
783
- const { childNodes } = node;
784
- let positionnedChildrenCount = 0;
785
- const mutableSubtrees = /* @__PURE__ */ new Map();
786
- Array.from(childNodes).map((e) => {
787
- if (!(e instanceof Text)) return e;
788
- const trimmedTextNode = document.createTextNode(e.textContent?.trim() ?? "");
789
- return trimmedTextNode;
790
- }).filter((node2, _, nodes) => {
791
- if (isElement(node2)) return true;
792
- if (isText(node2)) {
793
- const hasContent = (node2.textContent ?? "").trim() !== "";
794
- if (hasContent) return true;
795
- if (nodes.some((n) => n instanceof Element)) return false;
796
- return true;
797
- }
798
- return false;
799
- }).forEach((childNode) => {
800
- if (childNode instanceof Text) {
801
- childNode.textContent = childNode.textContent?.trim() ?? "";
802
- mutableSubtrees.set(
803
- positionnedChildrenCount,
804
- new Tree2(childNode, this, positionnedChildrenCount, _options)
805
- );
806
- positionnedChildrenCount += 1;
807
- } else {
808
- const propertyName = childNode.getAttribute(this.keyAttribute);
809
- if (propertyName === null) {
810
- mutableSubtrees.set(
811
- positionnedChildrenCount,
812
- new Tree2(childNode, this, positionnedChildrenCount, _options)
813
- );
814
- positionnedChildrenCount += 1;
815
- } else {
816
- mutableSubtrees.set(
817
- propertyName,
818
- new Tree2(childNode, this, propertyName, _options)
819
- );
820
- }
821
- }
822
- });
823
- this.subtrees = mutableSubtrees;
824
- this.children = Array.from(this.subtrees.values());
825
- }
826
- resolve = function(path) {
827
- let currentTree = this.root;
828
- for (const chunk of path) {
829
- const { subtrees } = currentTree;
830
- const foundSubtree = subtrees.get(chunk);
831
- if (foundSubtree === void 0) return void 0;
832
- currentTree = foundSubtree;
833
- }
834
- return currentTree;
835
- };
836
- getGenerator(name) {
837
- return this.generators.get(name);
838
- }
839
- initValue() {
840
- const { type } = this;
841
- let initialValue;
842
- const { document } = getWindow2();
843
- if (type === "any") {
844
- initialValue = "";
845
- } else if (type === "null") {
846
- initialValue = null;
847
- } else if (type === "boolean") {
848
- initialValue = false;
849
- } else if (type === "number") {
850
- initialValue = 0;
851
- } else if (type === "string") {
852
- initialValue = "";
853
- } else if (type === "text") {
854
- initialValue = this.node.textContent;
855
- } else if (type === "element") {
856
- initialValue = document.createDocumentFragment().childNodes;
857
- } else if (type === "nodelist") {
858
- initialValue = document.createDocumentFragment().childNodes;
859
- } else if (type === "array") {
860
- initialValue = [];
861
- } else if (type === "record") {
862
- initialValue = {};
863
- } else if (type === "transformer") {
864
- initialValue = [];
865
- } else if (type === "literal") {
866
- initialValue = {};
867
- } else {
868
- initialValue = null;
869
- }
870
- return initialValue;
871
- }
872
- getInnerValue(initialValue) {
873
- const { subtrees } = this;
874
- const innerValue = Array.from(subtrees.entries()).reduce((currentValue, [subpath, subtree]) => mergeValues(
875
- currentValue,
876
- subtree.evaluate(),
877
- subpath,
878
- this
879
- ), initialValue);
880
- return innerValue;
881
- }
882
- wrapInnerValue(innerValue) {
883
- const { type } = this;
884
- const { document } = getWindow2();
885
- if (type === "transformer") {
886
- const transformerName = this.tagName;
887
- if (transformerName === null) return innerValue;
888
- const generator = this.getGenerator(transformerName);
889
- if (generator === void 0) return innerValue;
890
- const transformer = Array.isArray(innerValue) ? generator(transformerName, ...innerValue) : generator(transformerName, innerValue);
891
- return transformer;
892
- }
893
- if (type === "any") return innerValue;
894
- if (type === "null") return null;
895
- if (type === "boolean") return Cast.toBoolean(innerValue);
896
- if (type === "number") return Cast.toNumber(innerValue);
897
- if (type === "string") return Cast.toString(innerValue);
898
- if (type === "array") return Cast.toArray(innerValue);
899
- if (type === "record") return Cast.toRecord(innerValue);
900
- if (type === "text") return Cast.toText(innerValue);
901
- if (type === "element") {
902
- const returnedElt = this.node.cloneNode();
903
- const innerNodelist = Cast.toNodeList(innerValue);
904
- returnedElt.append(...Array.from(innerNodelist));
905
- return returnedElt;
906
- }
907
- if (type === "nodelist") return Cast.toNodeList(innerValue);
908
- if (type === "literal") {
909
- const val = Utils.toHyperJson(innerValue, this.keyAttribute);
910
- const valChildren = val.childNodes;
911
- const literal = document.createElement("literal");
912
- literal.append(...Array.from(valChildren));
913
- const thisElement = this.node;
914
- Array.from(thisElement.attributes).forEach((attr) => literal.setAttribute(attr.name, attr.value));
915
- return literal;
916
- }
917
- return null;
918
- }
919
- cache = void 0;
920
- setCache(value) {
921
- this.cache = Serialize.serialize(value);
922
- }
923
- perfCounters = {
924
- computed: 0,
925
- computeTime: 0,
926
- computeTimeAvg: 0,
927
- cached: 0,
928
- cacheTime: 0,
929
- cacheTimeAvg: 0,
930
- totalTime: 0
931
- };
932
- getPerfCounters() {
933
- const { subtrees } = this;
934
- const subCounters = [];
935
- subCounters.push([this.pathString, this.perfCounters]);
936
- subtrees.forEach((subtree) => subCounters.push(...subtree.getPerfCounters()));
937
- return subCounters;
938
- }
939
- printPerfCounters() {
940
- const perfCounters = this.getPerfCounters().sort((a, b) => b[1].totalTime - a[1].totalTime).map((e) => ({
941
- path: e[0],
942
- totalMs: e[1].totalTime,
943
- computeMs: e[1].computeTime,
944
- cacheMs: e[1].cacheTime,
945
- ops: `${e[1].computed}/${e[1].cached}`
946
- }));
947
- console.table(perfCounters);
948
- }
949
- callstack = [];
950
- pushToEvalCallStack(path) {
951
- this.callstack.push(path);
952
- this.parent?.pushToEvalCallStack(path);
953
- }
954
- flushEvalCallStack() {
955
- this.callstack.length = 0;
956
- }
957
- evaluate() {
958
- const start = Date.now();
959
- const circularPatternDetected = this.callstack.some((p) => p.startsWith(this.pathString));
960
- if (circularPatternDetected) throw new Error(`Circular reference pattern detected @ ${this.pathString}`);
961
- this.pushToEvalCallStack(this.pathString);
962
- const { perfCounters, cache } = this;
963
- if (cache !== void 0) {
964
- const deserialized = Serialize.deserialize(cache);
965
- const end2 = Date.now();
966
- const time2 = end2 - start;
967
- perfCounters.cached++;
968
- perfCounters.cacheTime += time2;
969
- perfCounters.cacheTimeAvg = perfCounters.cacheTime / perfCounters.cached;
970
- perfCounters.totalTime = perfCounters.computeTime + perfCounters.cacheTime;
971
- return deserialized;
972
- }
973
- const init = this.initValue();
974
- const inner = this.getInnerValue(init);
975
- const wrapped = this.wrapInnerValue(inner);
976
- this.setCache(wrapped);
977
- const end = Date.now();
978
- const time = end - start;
979
- perfCounters.computed++;
980
- perfCounters.computeTime += time;
981
- perfCounters.computeTimeAvg = perfCounters.computeTime / perfCounters.computed;
982
- perfCounters.totalTime = perfCounters.computeTime + perfCounters.cacheTime;
983
- this.flushEvalCallStack();
984
- return wrapped;
985
- }
986
- }
987
- _Tree.Tree = Tree2;
988
- })(Tree || (Tree = {}));
989
-
990
- // src/agnostic/html/hyper-json/utils/index.ts
991
- var Utils;
992
- ((Utils2) => {
993
- Utils2.pathStringToPath = (pathString) => {
994
- let cleanPathString = pathString;
995
- while (cleanPathString.startsWith("/")) {
996
- cleanPathString = cleanPathString.slice(1);
997
- }
998
- while (cleanPathString.endsWith("/")) {
999
- cleanPathString = cleanPathString.slice(0, -1);
1000
- }
1001
- return cleanPathString.split("/").map((e) => {
1002
- const parsed = parseInt(e);
1003
- if (Number.isNaN(parsed)) return e;
1004
- return parsed;
1005
- });
1006
- };
1007
- Utils2.pathToPathString = (path) => `/${path.map((e) => `${e}`).join("/")}`;
1008
- Utils2.makeTransformerError = (value) => ({
1009
- action: "ERROR",
1010
- value
1011
- });
1012
- Utils2.toNamedTransformer = (name, args, anonymous) => {
1013
- const named = anonymous;
1014
- named.transformerName = name;
1015
- named.args = args;
1016
- return named;
1017
- };
1018
- Utils2.toHyperJson = (value, keyAttribute = Tree.defaultKeyAttribute) => {
1019
- const { document, Element, Text, NodeList } = Window.get();
1020
- if (value instanceof Text) {
1021
- const elt2 = document.createElement("text");
1022
- elt2.innerHTML = value.textContent ?? "";
1023
- return elt2;
1024
- }
1025
- if (value instanceof Element) return value.cloneNode(true);
1026
- if (value instanceof NodeList) {
1027
- const elt2 = document.createElement("nodelist");
1028
- elt2.append(...Array.from(value).map((e) => e.cloneNode(true)));
1029
- return elt2;
1030
- }
1031
- if (value === null) return document.createElement("null");
1032
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1033
- const elt2 = document.createElement(typeof value);
1034
- elt2.innerHTML = `${value}`;
1035
- return elt2;
1036
- }
1037
- if (typeof value === "function") {
1038
- const name = value.transformerName;
1039
- const args = value.args;
1040
- const elt2 = document.createElement(name);
1041
- const hyperJsonArgs = args.map((arg) => (0, Utils2.toHyperJson)(arg, keyAttribute));
1042
- elt2.append(...hyperJsonArgs);
1043
- return elt2;
1044
- }
1045
- if (Array.isArray(value)) {
1046
- const elt2 = document.createElement("array");
1047
- elt2.append(...value.map((e) => (0, Utils2.toHyperJson)(e, keyAttribute)));
1048
- return elt2;
1049
- }
1050
- const elt = document.createElement("record");
1051
- Object.entries(value).forEach(([key, val]) => {
1052
- const hjVal = (0, Utils2.toHyperJson)(val);
1053
- hjVal.setAttribute(keyAttribute, key);
1054
- elt.append(hjVal);
1055
- });
1056
- return elt;
1057
- };
1058
- })(Utils || (Utils = {}));
1059
-
1060
- // src/agnostic/html/hyper-json/transformers/append/index.ts
1061
- var append = (callerTagName, ...args) => {
1062
- return Utils.toNamedTransformer(callerTagName, args, (currentValue) => {
1063
- const { document, Element, Text, NodeList } = Window.get();
1064
- const [...toAppend] = args;
1065
- const frag = document.createDocumentFragment();
1066
- frag.append(...Array.from(Cast.toNodeList(currentValue)).map((e) => e.cloneNode(true)));
1067
- toAppend.forEach((item) => {
1068
- if (item instanceof Element) frag.append(item.cloneNode(true));
1069
- else if (item instanceof Text) frag.append(item.cloneNode(true));
1070
- else if (item instanceof NodeList) frag.append(...Array.from(item).map((e) => e.cloneNode(true)));
1071
- else frag.append(Cast.toString(item));
1072
- });
1073
- return {
1074
- action: "REPLACE",
1075
- value: frag.childNodes
1076
- };
1077
- });
1078
- };
1079
-
1080
- export {
1081
- append,
1082
- classList,
1083
- join,
1084
- length,
1085
- print,
1086
- push,
1087
- querySelector,
1088
- ref,
1089
- replace,
1090
- split,
1091
- toArray,
1092
- toBoolean,
1093
- toElement,
1094
- toNodeList,
1095
- toNull,
1096
- toNumber,
1097
- toRecord,
1098
- toRef,
1099
- toString,
1100
- toText,
1101
- toTransformer,
1102
- transformSelected,
1103
- trim,
1104
- Transformers,
1105
- Tree,
1106
- Utils,
1107
- Cast
1108
- };