@graphty/graph-io 0.3.48 → 0.3.49

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 (570) hide show
  1. package/dist/chunks/{approximations-C2riR4NT.js → approximations-Bzn3L-je.js} +2 -2
  2. package/dist/chunks/{approximations-C2riR4NT.js.map → approximations-Bzn3L-je.js.map} +1 -1
  3. package/dist/chunks/bends-BGXjv_U4.js +129 -0
  4. package/dist/chunks/bends-BGXjv_U4.js.map +1 -0
  5. package/dist/chunks/{block-Cu22ewuS.js → block-iptrlMBb.js} +906 -164
  6. package/dist/chunks/block-iptrlMBb.js.map +1 -0
  7. package/dist/chunks/choose-CczZJaX_.js +717 -0
  8. package/dist/chunks/choose-CczZJaX_.js.map +1 -0
  9. package/dist/chunks/{codes-CV_Bhcyi.js → codes-BE2xir2k.js} +6 -2
  10. package/dist/chunks/codes-BE2xir2k.js.map +1 -0
  11. package/dist/chunks/{constants-D0LqcsLJ.js → constants-CKkYLPtt.js} +2 -2
  12. package/dist/chunks/{constants-D0LqcsLJ.js.map → constants-CKkYLPtt.js.map} +1 -1
  13. package/dist/chunks/{context-cgmmOxZ2.js → context-C3p0RQxR.js} +5 -4
  14. package/dist/chunks/{context-cgmmOxZ2.js.map → context-C3p0RQxR.js.map} +1 -1
  15. package/dist/chunks/{convert-BcQ8_jMo.js → convert-Ct2zelbQ.js} +7 -2
  16. package/dist/chunks/convert-Ct2zelbQ.js.map +1 -0
  17. package/dist/chunks/{credentials-BiQsnMTb.js → credentials-DXHx7nwR.js} +16 -14
  18. package/dist/chunks/credentials-DXHx7nwR.js.map +1 -0
  19. package/dist/chunks/{cx-export-BEeF6ymo.js → cx-export-Bt6NoqTQ.js} +3 -3
  20. package/dist/chunks/{cx-export-BEeF6ymo.js.map → cx-export-Bt6NoqTQ.js.map} +1 -1
  21. package/dist/chunks/descriptor-B28U25x4.js +60 -0
  22. package/dist/chunks/descriptor-B28U25x4.js.map +1 -0
  23. package/dist/chunks/{descriptor-BJ-W0Jd-.js → descriptor-DLA5kINx.js} +7 -2
  24. package/dist/chunks/descriptor-DLA5kINx.js.map +1 -0
  25. package/dist/chunks/{emit-CD8xnY8s.js → emit-BwHQkZle.js} +1660 -133
  26. package/dist/chunks/emit-BwHQkZle.js.map +1 -0
  27. package/dist/chunks/{escape-DH2Egt-l.js → escape-CuCIzNMB.js} +8 -8
  28. package/dist/chunks/{escape-DH2Egt-l.js.map → escape-CuCIzNMB.js.map} +1 -1
  29. package/dist/chunks/{export-CZ7VRm4I.js → export-Cha4dRFz.js} +45 -387
  30. package/dist/chunks/export-Cha4dRFz.js.map +1 -0
  31. package/dist/chunks/{exporter-Dcw7Ldtq.js → exporter-BP6otMO6.js} +6 -6
  32. package/dist/chunks/{exporter-Dcw7Ldtq.js.map → exporter-BP6otMO6.js.map} +1 -1
  33. package/dist/chunks/{exporter-bxxjOrDZ.js → exporter-D2CETOMK.js} +1222 -156
  34. package/dist/chunks/exporter-D2CETOMK.js.map +1 -0
  35. package/dist/chunks/{exporter-BIdaoIgh.js → exporter-D9yMtocA.js} +7 -7
  36. package/dist/chunks/{exporter-BIdaoIgh.js.map → exporter-D9yMtocA.js.map} +1 -1
  37. package/dist/chunks/{exporter-DtVU80Fa.js → exporter-_jrBTnos.js} +9 -8
  38. package/dist/chunks/{exporter-DtVU80Fa.js.map → exporter-_jrBTnos.js.map} +1 -1
  39. package/dist/chunks/{exporter-ChjL5fmP.js → exporter-nDfxIK5D.js} +9 -8
  40. package/dist/chunks/{exporter-ChjL5fmP.js.map → exporter-nDfxIK5D.js.map} +1 -1
  41. package/dist/chunks/format-BXiAb-1h.js +408 -0
  42. package/dist/chunks/format-BXiAb-1h.js.map +1 -0
  43. package/dist/chunks/{generic-CP6YD34u.js → generic-ymWCETAJ.js} +387 -31
  44. package/dist/chunks/generic-ymWCETAJ.js.map +1 -0
  45. package/dist/chunks/{importer-e3huMZbm.js → importer-B92x1xY5.js} +14 -10
  46. package/dist/chunks/importer-B92x1xY5.js.map +1 -0
  47. package/dist/chunks/{importer-B87_fmVx.js → importer-CT9mJ1nn.js} +326 -84
  48. package/dist/chunks/importer-CT9mJ1nn.js.map +1 -0
  49. package/dist/chunks/{importer-CB_zV5_L.js → importer-DaLTjbds.js} +116 -1102
  50. package/dist/chunks/importer-DaLTjbds.js.map +1 -0
  51. package/dist/chunks/{importer-DPZDN40-.js → importer-GREKMdIf.js} +25 -17
  52. package/dist/chunks/importer-GREKMdIf.js.map +1 -0
  53. package/dist/chunks/{importer-Bji2MeWr.js → importer-PqaaKKnY.js} +13 -10
  54. package/dist/chunks/{importer-Bji2MeWr.js.map → importer-PqaaKKnY.js.map} +1 -1
  55. package/dist/chunks/{importer-Cyy6UseH.js → importer-Vn5QvmmJ.js} +66 -13
  56. package/dist/chunks/importer-Vn5QvmmJ.js.map +1 -0
  57. package/dist/chunks/{importer-CVT-JyDE.js → importer-vRq4h3j5.js} +1469 -356
  58. package/dist/chunks/importer-vRq4h3j5.js.map +1 -0
  59. package/dist/chunks/{input-Ccg9I22A.js → input-CAxt_aV-.js} +4 -4
  60. package/dist/chunks/{input-Ccg9I22A.js.map → input-CAxt_aV-.js.map} +1 -1
  61. package/dist/chunks/{json-elements-By172SVq.js → json-elements-Cq76WjnZ.js} +4 -4
  62. package/dist/chunks/{json-elements-By172SVq.js.map → json-elements-Cq76WjnZ.js.map} +1 -1
  63. package/dist/chunks/{lexicon-u2SI5xcx.js → lexicon-Clf4QIyl.js} +282 -74
  64. package/dist/chunks/lexicon-Clf4QIyl.js.map +1 -0
  65. package/dist/chunks/{ontology-export-BwgMyuF0.js → ontology-export-OMo91mb0.js} +4 -4
  66. package/dist/chunks/{ontology-export-BwgMyuF0.js.map → ontology-export-OMo91mb0.js.map} +1 -1
  67. package/dist/chunks/{records-Cgvxz-Vx.js → records-NJiYvekn.js} +2 -2
  68. package/dist/chunks/{records-Cgvxz-Vx.js.map → records-NJiYvekn.js.map} +1 -1
  69. package/dist/chunks/{report-CgdsL9Hb.js → report-CwMfYa9J.js} +23 -23
  70. package/dist/chunks/{report-CgdsL9Hb.js.map → report-CwMfYa9J.js.map} +1 -1
  71. package/dist/chunks/round-trip-Zm3_ivgq.js +79 -0
  72. package/dist/chunks/round-trip-Zm3_ivgq.js.map +1 -0
  73. package/dist/chunks/{sigv4-LkAzsLAu.js → sigv4-EokFic1V.js} +5 -5
  74. package/dist/chunks/sigv4-EokFic1V.js.map +1 -0
  75. package/dist/chunks/{styles-CaABMoO1.js → styles-CCs214_3.js} +1237 -138
  76. package/dist/chunks/styles-CCs214_3.js.map +1 -0
  77. package/dist/chunks/styles-Cm62yyQX.js +2812 -0
  78. package/dist/chunks/styles-Cm62yyQX.js.map +1 -0
  79. package/dist/chunks/styles-DPQQIig4.js +1928 -0
  80. package/dist/chunks/styles-DPQQIig4.js.map +1 -0
  81. package/dist/chunks/{styles-yed-Cs1nmrjn.js → styles-yed-UMFdNqze.js} +503 -172
  82. package/dist/chunks/styles-yed-UMFdNqze.js.map +1 -0
  83. package/dist/chunks/{text-BuKQVMz2.js → text-ystE2bYi.js} +2 -2
  84. package/dist/chunks/{text-BuKQVMz2.js.map → text-ystE2bYi.js.map} +1 -1
  85. package/dist/csv.js +7 -7
  86. package/dist/cx.js +2 -2
  87. package/dist/cx2.js +2 -2
  88. package/dist/cys.js +1 -1
  89. package/dist/dot.js +5 -4
  90. package/dist/dot.js.map +1 -1
  91. package/dist/gexf.js +42 -12
  92. package/dist/gexf.js.map +1 -1
  93. package/dist/gml.js +847 -193
  94. package/dist/gml.js.map +1 -1
  95. package/dist/graph-io.js +232 -220
  96. package/dist/graph-io.js.map +1 -1
  97. package/dist/graphml.js +3 -3
  98. package/dist/json.js +3 -2
  99. package/dist/neo4j.js +6 -6
  100. package/dist/obo.js +1 -1
  101. package/dist/pajek.js +1 -1
  102. package/dist/positions.js +45 -3
  103. package/dist/positions.js.map +1 -1
  104. package/dist/sources-cypher.js +138 -23
  105. package/dist/sources-cypher.js.map +1 -1
  106. package/dist/sources-ndex.js +2 -2
  107. package/dist/sources-rest.js +16 -6
  108. package/dist/sources-rest.js.map +1 -1
  109. package/dist/sources-sparql.d.ts +1 -0
  110. package/dist/sources-sparql.js +405 -0
  111. package/dist/sources-sparql.js.map +1 -0
  112. package/dist/src/formats/cx/importer.d.ts.map +1 -1
  113. package/dist/src/formats/cx/importer.js +5 -1
  114. package/dist/src/formats/cx/importer.js.map +1 -1
  115. package/dist/src/formats/cx/styles.d.ts +24 -1
  116. package/dist/src/formats/cx/styles.d.ts.map +1 -1
  117. package/dist/src/formats/cx/styles.js +117 -11
  118. package/dist/src/formats/cx/styles.js.map +1 -1
  119. package/dist/src/formats/cx2/importer.d.ts.map +1 -1
  120. package/dist/src/formats/cx2/importer.js +1 -0
  121. package/dist/src/formats/cx2/importer.js.map +1 -1
  122. package/dist/src/formats/cx2/styles.d.ts.map +1 -1
  123. package/dist/src/formats/cx2/styles.js +3 -1
  124. package/dist/src/formats/cx2/styles.js.map +1 -1
  125. package/dist/src/formats/cys/importer.d.ts.map +1 -1
  126. package/dist/src/formats/cys/importer.js +1 -0
  127. package/dist/src/formats/cys/importer.js.map +1 -1
  128. package/dist/src/formats/cys/styles.d.ts +2 -0
  129. package/dist/src/formats/cys/styles.d.ts.map +1 -1
  130. package/dist/src/formats/cys/styles.js +15 -7
  131. package/dist/src/formats/cys/styles.js.map +1 -1
  132. package/dist/src/formats/dot/drawing.d.ts +98 -0
  133. package/dist/src/formats/dot/drawing.d.ts.map +1 -0
  134. package/dist/src/formats/dot/drawing.js +734 -0
  135. package/dist/src/formats/dot/drawing.js.map +1 -0
  136. package/dist/src/formats/dot/importer.d.ts.map +1 -1
  137. package/dist/src/formats/dot/importer.js +108 -31
  138. package/dist/src/formats/dot/importer.js.map +1 -1
  139. package/dist/src/formats/dot/label-places.d.ts +34 -0
  140. package/dist/src/formats/dot/label-places.d.ts.map +1 -0
  141. package/dist/src/formats/dot/label-places.js +179 -0
  142. package/dist/src/formats/dot/label-places.js.map +1 -0
  143. package/dist/src/formats/dot/record.d.ts +50 -0
  144. package/dist/src/formats/dot/record.d.ts.map +1 -0
  145. package/dist/src/formats/dot/record.js +275 -0
  146. package/dist/src/formats/dot/record.js.map +1 -0
  147. package/dist/src/formats/dot/styles.d.ts +62 -2
  148. package/dist/src/formats/dot/styles.d.ts.map +1 -1
  149. package/dist/src/formats/dot/styles.js +1454 -119
  150. package/dist/src/formats/dot/styles.js.map +1 -1
  151. package/dist/src/formats/gexf/dialog-metrics.d.ts +15 -0
  152. package/dist/src/formats/gexf/dialog-metrics.d.ts.map +1 -0
  153. package/dist/src/formats/gexf/dialog-metrics.js +59 -0
  154. package/dist/src/formats/gexf/dialog-metrics.js.map +1 -0
  155. package/dist/src/formats/gexf/importer.d.ts +7 -0
  156. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  157. package/dist/src/formats/gexf/importer.js +41 -5
  158. package/dist/src/formats/gexf/importer.js.map +1 -1
  159. package/dist/src/formats/gexf/preview.d.ts +77 -0
  160. package/dist/src/formats/gexf/preview.d.ts.map +1 -0
  161. package/dist/src/formats/gexf/preview.js +191 -0
  162. package/dist/src/formats/gexf/preview.js.map +1 -0
  163. package/dist/src/formats/gexf/schema.d.ts.map +1 -1
  164. package/dist/src/formats/gexf/schema.js +2 -1
  165. package/dist/src/formats/gexf/schema.js.map +1 -1
  166. package/dist/src/formats/gexf/styles.d.ts +58 -31
  167. package/dist/src/formats/gexf/styles.d.ts.map +1 -1
  168. package/dist/src/formats/gexf/styles.js +848 -225
  169. package/dist/src/formats/gexf/styles.js.map +1 -1
  170. package/dist/src/formats/gml/importer.d.ts +5 -2
  171. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  172. package/dist/src/formats/gml/importer.js +258 -71
  173. package/dist/src/formats/gml/importer.js.map +1 -1
  174. package/dist/src/formats/gml/index.d.ts +1 -1
  175. package/dist/src/formats/gml/index.d.ts.map +1 -1
  176. package/dist/src/formats/gml/index.js +1 -1
  177. package/dist/src/formats/gml/index.js.map +1 -1
  178. package/dist/src/formats/gml/positions.d.ts +7 -0
  179. package/dist/src/formats/gml/positions.d.ts.map +1 -1
  180. package/dist/src/formats/gml/positions.js +29 -7
  181. package/dist/src/formats/gml/positions.js.map +1 -1
  182. package/dist/src/formats/gml/styles.d.ts.map +1 -1
  183. package/dist/src/formats/gml/styles.js +753 -101
  184. package/dist/src/formats/gml/styles.js.map +1 -1
  185. package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
  186. package/dist/src/formats/graphml/styles-plain.js +6 -10
  187. package/dist/src/formats/graphml/styles-plain.js.map +1 -1
  188. package/dist/src/formats/graphml/styles-yed.d.ts +21 -15
  189. package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
  190. package/dist/src/formats/graphml/styles-yed.js +692 -161
  191. package/dist/src/formats/graphml/styles-yed.js.map +1 -1
  192. package/dist/src/formats/graphml/styles-yfiles3.d.ts +1 -1
  193. package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
  194. package/dist/src/formats/graphml/styles-yfiles3.js +429 -64
  195. package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
  196. package/dist/src/formats/graphml/yfiles.d.ts +3 -3
  197. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  198. package/dist/src/formats/graphml/yfiles.js +16 -6
  199. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  200. package/dist/src/formats/json/dialect.d.ts +3 -2
  201. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  202. package/dist/src/formats/json/dialect.js +39 -5
  203. package/dist/src/formats/json/dialect.js.map +1 -1
  204. package/dist/src/formats/json/importer.d.ts +13 -2
  205. package/dist/src/formats/json/importer.d.ts.map +1 -1
  206. package/dist/src/formats/json/importer.js +42 -6
  207. package/dist/src/formats/json/importer.js.map +1 -1
  208. package/dist/src/formats/json/index.d.ts +1 -1
  209. package/dist/src/formats/json/index.d.ts.map +1 -1
  210. package/dist/src/formats/json/index.js +1 -1
  211. package/dist/src/formats/json/index.js.map +1 -1
  212. package/dist/src/formats/json/positions.d.ts +5 -2
  213. package/dist/src/formats/json/positions.d.ts.map +1 -1
  214. package/dist/src/formats/json/positions.js +20 -4
  215. package/dist/src/formats/json/positions.js.map +1 -1
  216. package/dist/src/formats/json/styles.d.ts +12 -1
  217. package/dist/src/formats/json/styles.d.ts.map +1 -1
  218. package/dist/src/formats/json/styles.js +1755 -136
  219. package/dist/src/formats/json/styles.js.map +1 -1
  220. package/dist/src/formats/pajek/draw.d.ts +96 -0
  221. package/dist/src/formats/pajek/draw.d.ts.map +1 -0
  222. package/dist/src/formats/pajek/draw.js +372 -0
  223. package/dist/src/formats/pajek/draw.js.map +1 -0
  224. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  225. package/dist/src/formats/pajek/exporter.js +70 -51
  226. package/dist/src/formats/pajek/exporter.js.map +1 -1
  227. package/dist/src/formats/pajek/importer.d.ts +9 -0
  228. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  229. package/dist/src/formats/pajek/importer.js +233 -102
  230. package/dist/src/formats/pajek/importer.js.map +1 -1
  231. package/dist/src/formats/pajek/index.d.ts +1 -0
  232. package/dist/src/formats/pajek/index.d.ts.map +1 -1
  233. package/dist/src/formats/pajek/index.js.map +1 -1
  234. package/dist/src/formats/pajek/styles.d.ts +15 -7
  235. package/dist/src/formats/pajek/styles.d.ts.map +1 -1
  236. package/dist/src/formats/pajek/styles.js +1278 -114
  237. package/dist/src/formats/pajek/styles.js.map +1 -1
  238. package/dist/src/formats/pajek/syntax.d.ts +10 -1
  239. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  240. package/dist/src/formats/pajek/syntax.js +26 -2
  241. package/dist/src/formats/pajek/syntax.js.map +1 -1
  242. package/dist/src/formats/xgmml/emit.d.ts +1 -0
  243. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  244. package/dist/src/formats/xgmml/emit.js +65 -5
  245. package/dist/src/formats/xgmml/emit.js.map +1 -1
  246. package/dist/src/formats/xgmml/styles.d.ts +23 -3
  247. package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
  248. package/dist/src/formats/xgmml/styles.js +277 -60
  249. package/dist/src/formats/xgmml/styles.js.map +1 -1
  250. package/dist/src/index.d.ts +4 -3
  251. package/dist/src/index.d.ts.map +1 -1
  252. package/dist/src/index.js +4 -3
  253. package/dist/src/index.js.map +1 -1
  254. package/dist/src/positions/convert.d.ts.map +1 -1
  255. package/dist/src/positions/convert.js +11 -1
  256. package/dist/src/positions/convert.js.map +1 -1
  257. package/dist/src/positions/extract.d.ts.map +1 -1
  258. package/dist/src/positions/extract.js +53 -1
  259. package/dist/src/positions/extract.js.map +1 -1
  260. package/dist/src/positions/index.d.ts +1 -1
  261. package/dist/src/positions/index.d.ts.map +1 -1
  262. package/dist/src/positions/types.d.ts +59 -0
  263. package/dist/src/positions/types.d.ts.map +1 -1
  264. package/dist/src/sources/builtins.d.ts +1 -1
  265. package/dist/src/sources/builtins.d.ts.map +1 -1
  266. package/dist/src/sources/builtins.js +8 -2
  267. package/dist/src/sources/builtins.js.map +1 -1
  268. package/dist/src/sources/context.d.ts.map +1 -1
  269. package/dist/src/sources/context.js +1 -0
  270. package/dist/src/sources/context.js.map +1 -1
  271. package/dist/src/sources/cypher/descriptor.d.ts.map +1 -1
  272. package/dist/src/sources/cypher/descriptor.js +5 -0
  273. package/dist/src/sources/cypher/descriptor.js.map +1 -1
  274. package/dist/src/sources/cypher/index.d.ts.map +1 -1
  275. package/dist/src/sources/cypher/index.js +124 -18
  276. package/dist/src/sources/cypher/index.js.map +1 -1
  277. package/dist/src/sources/cypher/params.d.ts +1 -1
  278. package/dist/src/sources/cypher/params.d.ts.map +1 -1
  279. package/dist/src/sources/cypher/query-builder.d.ts +17 -0
  280. package/dist/src/sources/cypher/query-builder.d.ts.map +1 -1
  281. package/dist/src/sources/cypher/query-builder.js +31 -0
  282. package/dist/src/sources/cypher/query-builder.js.map +1 -1
  283. package/dist/src/sources/ids.d.ts +5 -0
  284. package/dist/src/sources/ids.d.ts.map +1 -1
  285. package/dist/src/sources/ids.js +5 -0
  286. package/dist/src/sources/ids.js.map +1 -1
  287. package/dist/src/sources/params.d.ts +3 -0
  288. package/dist/src/sources/params.d.ts.map +1 -1
  289. package/dist/src/sources/rest/descriptor.d.ts.map +1 -1
  290. package/dist/src/sources/rest/descriptor.js +5 -0
  291. package/dist/src/sources/rest/descriptor.js.map +1 -1
  292. package/dist/src/sources/rest/source.d.ts.map +1 -1
  293. package/dist/src/sources/rest/source.js +15 -0
  294. package/dist/src/sources/rest/source.js.map +1 -1
  295. package/dist/src/sources/sigv4.d.ts +5 -3
  296. package/dist/src/sources/sigv4.d.ts.map +1 -1
  297. package/dist/src/sources/sigv4.js +6 -4
  298. package/dist/src/sources/sigv4.js.map +1 -1
  299. package/dist/src/sources/sparql/descriptor.d.ts +10 -0
  300. package/dist/src/sources/sparql/descriptor.d.ts.map +1 -0
  301. package/dist/src/sources/sparql/descriptor.js +64 -0
  302. package/dist/src/sources/sparql/descriptor.js.map +1 -0
  303. package/dist/src/sources/sparql/index.d.ts +28 -0
  304. package/dist/src/sources/sparql/index.d.ts.map +1 -0
  305. package/dist/src/sources/sparql/index.js +314 -0
  306. package/dist/src/sources/sparql/index.js.map +1 -0
  307. package/dist/src/sources/sparql/ntriples.d.ts +69 -0
  308. package/dist/src/sources/sparql/ntriples.d.ts.map +1 -0
  309. package/dist/src/sources/sparql/ntriples.js +180 -0
  310. package/dist/src/sources/sparql/ntriples.js.map +1 -0
  311. package/dist/src/sources/sparql/params.d.ts +27 -0
  312. package/dist/src/sources/sparql/params.d.ts.map +1 -0
  313. package/dist/src/sources/sparql/params.js +5 -0
  314. package/dist/src/sources/sparql/params.js.map +1 -0
  315. package/dist/src/sources/sparql/query.d.ts +72 -0
  316. package/dist/src/sources/sparql/query.d.ts.map +1 -0
  317. package/dist/src/sources/sparql/query.js +113 -0
  318. package/dist/src/sources/sparql/query.js.map +1 -0
  319. package/dist/src/sources/types.d.ts +31 -0
  320. package/dist/src/sources/types.d.ts.map +1 -1
  321. package/dist/src/styles/annotations.d.ts +61 -5
  322. package/dist/src/styles/annotations.d.ts.map +1 -1
  323. package/dist/src/styles/annotations.js +130 -22
  324. package/dist/src/styles/annotations.js.map +1 -1
  325. package/dist/src/styles/canon/bends.d.ts +46 -0
  326. package/dist/src/styles/canon/bends.d.ts.map +1 -1
  327. package/dist/src/styles/canon/bends.js +123 -0
  328. package/dist/src/styles/canon/bends.js.map +1 -1
  329. package/dist/src/styles/canon/color-tables.d.ts +6 -1
  330. package/dist/src/styles/canon/color-tables.d.ts.map +1 -1
  331. package/dist/src/styles/canon/color-tables.js +10 -4
  332. package/dist/src/styles/canon/color-tables.js.map +1 -1
  333. package/dist/src/styles/canon/color.d.ts +3 -1
  334. package/dist/src/styles/canon/color.d.ts.map +1 -1
  335. package/dist/src/styles/canon/color.js +103 -3
  336. package/dist/src/styles/canon/color.js.map +1 -1
  337. package/dist/src/styles/canon/enums.d.ts +2 -2
  338. package/dist/src/styles/canon/enums.d.ts.map +1 -1
  339. package/dist/src/styles/canon/enums.js +81 -7
  340. package/dist/src/styles/canon/enums.js.map +1 -1
  341. package/dist/src/styles/canon/graphviz.d.ts +12 -3
  342. package/dist/src/styles/canon/graphviz.d.ts.map +1 -1
  343. package/dist/src/styles/canon/graphviz.js +57 -9
  344. package/dist/src/styles/canon/graphviz.js.map +1 -1
  345. package/dist/src/styles/canon/number.d.ts +8 -0
  346. package/dist/src/styles/canon/number.d.ts.map +1 -1
  347. package/dist/src/styles/canon/number.js +18 -0
  348. package/dist/src/styles/canon/number.js.map +1 -1
  349. package/dist/src/styles/canon/text.d.ts +29 -2
  350. package/dist/src/styles/canon/text.d.ts.map +1 -1
  351. package/dist/src/styles/canon/text.js +156 -16
  352. package/dist/src/styles/canon/text.js.map +1 -1
  353. package/dist/src/styles/codes.d.ts +2 -0
  354. package/dist/src/styles/codes.d.ts.map +1 -1
  355. package/dist/src/styles/codes.js +2 -0
  356. package/dist/src/styles/codes.js.map +1 -1
  357. package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
  358. package/dist/src/styles/cyjs/cascade.js +1015 -79
  359. package/dist/src/styles/cyjs/cascade.js.map +1 -1
  360. package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
  361. package/dist/src/styles/cyjs/defaults-table.js +3 -0
  362. package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
  363. package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
  364. package/dist/src/styles/cyjs/emit.js +202 -9
  365. package/dist/src/styles/cyjs/emit.js.map +1 -1
  366. package/dist/src/styles/cyjs/face.d.ts +20 -0
  367. package/dist/src/styles/cyjs/face.d.ts.map +1 -0
  368. package/dist/src/styles/cyjs/face.js +332 -0
  369. package/dist/src/styles/cyjs/face.js.map +1 -0
  370. package/dist/src/styles/cyjs/mappers.d.ts +44 -1
  371. package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
  372. package/dist/src/styles/cyjs/mappers.js +461 -26
  373. package/dist/src/styles/cyjs/mappers.js.map +1 -1
  374. package/dist/src/styles/cyjs/routes.d.ts +53 -0
  375. package/dist/src/styles/cyjs/routes.d.ts.map +1 -0
  376. package/dist/src/styles/cyjs/routes.js +360 -0
  377. package/dist/src/styles/cyjs/routes.js.map +1 -0
  378. package/dist/src/styles/cytoscape/charts.d.ts +23 -0
  379. package/dist/src/styles/cytoscape/charts.d.ts.map +1 -0
  380. package/dist/src/styles/cytoscape/charts.js +560 -0
  381. package/dist/src/styles/cytoscape/charts.js.map +1 -0
  382. package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
  383. package/dist/src/styles/cytoscape/emit.js +156 -48
  384. package/dist/src/styles/cytoscape/emit.js.map +1 -1
  385. package/dist/src/styles/cytoscape/lexicon.d.ts +91 -3
  386. package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
  387. package/dist/src/styles/cytoscape/lexicon.js +387 -77
  388. package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
  389. package/dist/src/styles/cytoscape/mappings.d.ts +30 -0
  390. package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -1
  391. package/dist/src/styles/cytoscape/mappings.js +92 -0
  392. package/dist/src/styles/cytoscape/mappings.js.map +1 -1
  393. package/dist/src/styles/cytoscape/resolve.d.ts +42 -2
  394. package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
  395. package/dist/src/styles/cytoscape/resolve.js +623 -17
  396. package/dist/src/styles/cytoscape/resolve.js.map +1 -1
  397. package/dist/src/styles/defaults.d.ts +46 -26
  398. package/dist/src/styles/defaults.d.ts.map +1 -1
  399. package/dist/src/styles/defaults.js +308 -71
  400. package/dist/src/styles/defaults.js.map +1 -1
  401. package/dist/src/styles/index.d.ts +4 -3
  402. package/dist/src/styles/index.d.ts.map +1 -1
  403. package/dist/src/styles/index.js +3 -2
  404. package/dist/src/styles/index.js.map +1 -1
  405. package/dist/src/styles/internal.d.ts +1 -0
  406. package/dist/src/styles/internal.d.ts.map +1 -1
  407. package/dist/src/styles/internal.js +1 -0
  408. package/dist/src/styles/internal.js.map +1 -1
  409. package/dist/src/styles/io/generic.d.ts.map +1 -1
  410. package/dist/src/styles/io/generic.js +56 -16
  411. package/dist/src/styles/io/generic.js.map +1 -1
  412. package/dist/src/styles/io/round-trip.d.ts +56 -0
  413. package/dist/src/styles/io/round-trip.d.ts.map +1 -0
  414. package/dist/src/styles/io/round-trip.js +138 -0
  415. package/dist/src/styles/io/round-trip.js.map +1 -0
  416. package/dist/src/styles/io/writer.d.ts.map +1 -1
  417. package/dist/src/styles/io/writer.js +6 -1
  418. package/dist/src/styles/io/writer.js.map +1 -1
  419. package/dist/src/styles/notes.d.ts.map +1 -1
  420. package/dist/src/styles/notes.js +1 -0
  421. package/dist/src/styles/notes.js.map +1 -1
  422. package/dist/src/styles/plan/features.d.ts +1 -1
  423. package/dist/src/styles/plan/features.d.ts.map +1 -1
  424. package/dist/src/styles/plan/features.js +22 -2
  425. package/dist/src/styles/plan/features.js.map +1 -1
  426. package/dist/src/styles/plan/index.d.ts +1 -1
  427. package/dist/src/styles/plan/index.d.ts.map +1 -1
  428. package/dist/src/styles/plan/index.js +1 -1
  429. package/dist/src/styles/plan/index.js.map +1 -1
  430. package/dist/src/styles/plan/plan.d.ts.map +1 -1
  431. package/dist/src/styles/plan/plan.js +61 -4
  432. package/dist/src/styles/plan/plan.js.map +1 -1
  433. package/dist/src/styles/plan/resolve.d.ts +11 -0
  434. package/dist/src/styles/plan/resolve.d.ts.map +1 -1
  435. package/dist/src/styles/plan/resolve.js +40 -4
  436. package/dist/src/styles/plan/resolve.js.map +1 -1
  437. package/dist/src/styles/slots.d.ts +14 -0
  438. package/dist/src/styles/slots.d.ts.map +1 -0
  439. package/dist/src/styles/slots.js +20 -0
  440. package/dist/src/styles/slots.js.map +1 -0
  441. package/dist/src/styles/types.d.ts +622 -6
  442. package/dist/src/styles/types.d.ts.map +1 -1
  443. package/dist/src/styles/vocabulary.d.ts +3 -2
  444. package/dist/src/styles/vocabulary.d.ts.map +1 -1
  445. package/dist/src/styles/vocabulary.js +203 -0
  446. package/dist/src/styles/vocabulary.js.map +1 -1
  447. package/dist/styles.js +30 -239
  448. package/dist/styles.js.map +1 -1
  449. package/dist/xgmml.js +3 -3
  450. package/package.json +27 -7
  451. package/src/formats/cx/importer.ts +6 -1
  452. package/src/formats/cx/styles.ts +143 -9
  453. package/src/formats/cx2/importer.ts +1 -0
  454. package/src/formats/cx2/styles.ts +3 -1
  455. package/src/formats/cys/importer.ts +1 -0
  456. package/src/formats/cys/styles.ts +27 -5
  457. package/src/formats/dot/drawing.ts +799 -0
  458. package/src/formats/dot/importer.ts +120 -35
  459. package/src/formats/dot/label-places.ts +228 -0
  460. package/src/formats/dot/record.ts +336 -0
  461. package/src/formats/dot/styles.ts +1654 -153
  462. package/src/formats/gexf/dialog-metrics.ts +61 -0
  463. package/src/formats/gexf/importer.ts +50 -5
  464. package/src/formats/gexf/preview.ts +217 -0
  465. package/src/formats/gexf/schema.ts +2 -1
  466. package/src/formats/gexf/styles.ts +1099 -245
  467. package/src/formats/gml/importer.ts +291 -76
  468. package/src/formats/gml/index.ts +1 -1
  469. package/src/formats/gml/positions.ts +29 -7
  470. package/src/formats/gml/styles.ts +851 -109
  471. package/src/formats/graphml/styles-plain.ts +6 -15
  472. package/src/formats/graphml/styles-yed.ts +762 -173
  473. package/src/formats/graphml/styles-yfiles3.ts +485 -63
  474. package/src/formats/graphml/yfiles.ts +19 -6
  475. package/src/formats/json/dialect.ts +41 -5
  476. package/src/formats/json/importer.ts +59 -7
  477. package/src/formats/json/index.ts +1 -0
  478. package/src/formats/json/positions.ts +22 -5
  479. package/src/formats/json/styles.ts +2041 -185
  480. package/src/formats/pajek/draw.ts +458 -0
  481. package/src/formats/pajek/exporter.ts +81 -49
  482. package/src/formats/pajek/importer.ts +278 -103
  483. package/src/formats/pajek/index.ts +1 -0
  484. package/src/formats/pajek/styles.ts +1381 -133
  485. package/src/formats/pajek/syntax.ts +27 -2
  486. package/src/formats/xgmml/emit.ts +73 -5
  487. package/src/formats/xgmml/styles.ts +330 -71
  488. package/src/index.ts +5 -1
  489. package/src/positions/convert.ts +12 -1
  490. package/src/positions/extract.ts +55 -1
  491. package/src/positions/index.ts +1 -0
  492. package/src/positions/types.ts +60 -0
  493. package/src/sources/builtins.ts +8 -1
  494. package/src/sources/context.ts +1 -0
  495. package/src/sources/cypher/descriptor.ts +7 -1
  496. package/src/sources/cypher/index.ts +148 -18
  497. package/src/sources/cypher/params.ts +1 -1
  498. package/src/sources/cypher/query-builder.ts +33 -0
  499. package/src/sources/ids.ts +6 -0
  500. package/src/sources/params.ts +3 -0
  501. package/src/sources/rest/descriptor.ts +5 -0
  502. package/src/sources/rest/source.ts +16 -0
  503. package/src/sources/sigv4.ts +6 -4
  504. package/src/sources/sparql/descriptor.ts +67 -0
  505. package/src/sources/sparql/index.ts +356 -0
  506. package/src/sources/sparql/ntriples.ts +219 -0
  507. package/src/sources/sparql/params.ts +28 -0
  508. package/src/sources/sparql/query.ts +162 -0
  509. package/src/sources/types.ts +35 -0
  510. package/src/styles/annotations.ts +201 -27
  511. package/src/styles/canon/bends.ts +137 -0
  512. package/src/styles/canon/color-tables.ts +10 -4
  513. package/src/styles/canon/color.ts +105 -3
  514. package/src/styles/canon/enums.ts +98 -8
  515. package/src/styles/canon/graphviz.ts +71 -10
  516. package/src/styles/canon/number.ts +19 -0
  517. package/src/styles/canon/text.ts +187 -16
  518. package/src/styles/codes.ts +2 -0
  519. package/src/styles/cyjs/cascade.ts +1160 -84
  520. package/src/styles/cyjs/defaults-table.ts +3 -0
  521. package/src/styles/cyjs/emit.ts +233 -13
  522. package/src/styles/cyjs/face.ts +372 -0
  523. package/src/styles/cyjs/mappers.ts +492 -27
  524. package/src/styles/cyjs/routes.ts +432 -0
  525. package/src/styles/cytoscape/charts.ts +684 -0
  526. package/src/styles/cytoscape/emit.ts +170 -48
  527. package/src/styles/cytoscape/lexicon.ts +431 -78
  528. package/src/styles/cytoscape/mappings.ts +108 -0
  529. package/src/styles/cytoscape/resolve.ts +741 -17
  530. package/src/styles/defaults.ts +417 -108
  531. package/src/styles/index.ts +5 -0
  532. package/src/styles/internal.ts +1 -0
  533. package/src/styles/io/generic.ts +79 -23
  534. package/src/styles/io/round-trip.ts +202 -0
  535. package/src/styles/io/writer.ts +6 -1
  536. package/src/styles/notes.ts +1 -0
  537. package/src/styles/plan/features.ts +23 -2
  538. package/src/styles/plan/index.ts +1 -1
  539. package/src/styles/plan/plan.ts +69 -5
  540. package/src/styles/plan/resolve.ts +47 -4
  541. package/src/styles/slots.ts +25 -0
  542. package/src/styles/types.ts +633 -5
  543. package/src/styles/vocabulary.ts +211 -2
  544. package/dist/chunks/block-Cu22ewuS.js.map +0 -1
  545. package/dist/chunks/choose-Cdx6Enl2.js +0 -57
  546. package/dist/chunks/choose-Cdx6Enl2.js.map +0 -1
  547. package/dist/chunks/codes-CV_Bhcyi.js.map +0 -1
  548. package/dist/chunks/convert-BcQ8_jMo.js.map +0 -1
  549. package/dist/chunks/credentials-BiQsnMTb.js.map +0 -1
  550. package/dist/chunks/descriptor-BJ-W0Jd-.js.map +0 -1
  551. package/dist/chunks/emit-CD8xnY8s.js.map +0 -1
  552. package/dist/chunks/export-CZ7VRm4I.js.map +0 -1
  553. package/dist/chunks/exporter-bxxjOrDZ.js.map +0 -1
  554. package/dist/chunks/format-BMS-1Nxb.js +0 -64
  555. package/dist/chunks/format-BMS-1Nxb.js.map +0 -1
  556. package/dist/chunks/generic-CP6YD34u.js.map +0 -1
  557. package/dist/chunks/importer-B87_fmVx.js.map +0 -1
  558. package/dist/chunks/importer-CB_zV5_L.js.map +0 -1
  559. package/dist/chunks/importer-CVT-JyDE.js.map +0 -1
  560. package/dist/chunks/importer-Cyy6UseH.js.map +0 -1
  561. package/dist/chunks/importer-DPZDN40-.js.map +0 -1
  562. package/dist/chunks/importer-e3huMZbm.js.map +0 -1
  563. package/dist/chunks/lexicon-u2SI5xcx.js.map +0 -1
  564. package/dist/chunks/sigv4-LkAzsLAu.js.map +0 -1
  565. package/dist/chunks/styles-CaABMoO1.js.map +0 -1
  566. package/dist/chunks/styles-P_gmFAOi.js +0 -770
  567. package/dist/chunks/styles-P_gmFAOi.js.map +0 -1
  568. package/dist/chunks/styles-yed-Cs1nmrjn.js.map +0 -1
  569. package/dist/chunks/writer-DvHTl36J.js +0 -449
  570. package/dist/chunks/writer-DvHTl36J.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-Clf4QIyl.js","sources":["../../src/styles/cytoscape/lexicon.ts"],"sourcesContent":["/**\n * Cytoscape desktop's visual lexicon (CX, CX2, sessions, XGMML): which visual properties set each neutral\n * property, and how each value is read. Cytoscape states opacities two ways (`NODE_TRANSPARENCY` 0..255 in the\n * desktop and CX version 1, `NODE_BACKGROUND_OPACITY` 0..1 in CX2); both are read here.\n */\n\nimport { canonColor } from \"../canon/color.js\";\nimport { canonEnum } from \"../canon/enums.js\";\nimport { canonBoolean, canonNumber, canonOpacity, num6 } from \"../canon/number.js\";\nimport { type CanonSite, noteAt, scalarText } from \"../canon/site.js\";\nimport { canonText } from \"../canon/text.js\";\nimport { STYLE_ISSUE } from \"../codes.js\";\nimport type { StyleNotes } from \"../notes.js\";\nimport type { StyleTarget, StyleValue } from \"../types.js\";\nimport { isStyleValue } from \"../vocabulary.js\";\n\n/**\n * Reads one raw Cytoscape value as a neutral property's canonical value, noting a problem at the site.\n * @category Styles\n */\nexport type CytoscapeValueParser = (raw: unknown, site: CanonSite) => StyleValue | null;\n\n// A color; its alpha is dropped (Cytoscape keeps opacity in separate properties).\nconst color: CytoscapeValueParser = (raw, site) => canonColor(raw, \"cytoscape\", site)?.color ?? null;\n\n// Cytoscape desktop's 0..255 transparency.\nconst opacity255: CytoscapeValueParser = (raw, site) => {\n const v = canonNumber(raw, site);\n if (v === null) {\n return null;\n }\n if (v > 255) {\n noteAt(site, STYLE_ISSUE.BAD_VALUE, String(raw));\n return null;\n }\n return num6(Math.round(v) / 255);\n};\n\n// CX2's 0..1 opacity.\nconst opacity01: CytoscapeValueParser = (raw, site) => canonOpacity(raw, \"css\", site);\nconst length: CytoscapeValueParser = (raw, site) => canonNumber(raw, site);\n// An arrow size as the neutral factor: Cytoscape's normal arrow is size 6 (default_vizmap.xml).\nexport const arrowSizeParser: CytoscapeValueParser = (raw, site) => {\n const v = canonNumber(raw, site);\n return v === null ? null : num6(v / 6);\n};\n\n// Degrees, clockwise on screen as Cytoscape turns a label, folded into 0..360.\n// ponytail: a continuous mapping across 0 (from -30 to 30) folds to 330..30 and interpolates the long way round;\n// keep the sign when a file needs it.\nconst rotation: CytoscapeValueParser = (raw, site) => {\n const v = typeof raw === \"number\" ? raw : Number(scalarText(raw, site)?.trim() ?? Number.NaN);\n if (!Number.isFinite(v)) {\n noteAt(site, STYLE_ISSUE.BAD_VALUE, String(raw));\n return null;\n }\n return num6(((v % 360) + 360) % 360);\n};\n\n// Cytoscape desktop holds a font size as a whole number, so every value read for one is drawn rounded.\nconst fontSize: CytoscapeValueParser = (raw, site) => {\n const v = canonNumber(raw, site);\n return v === null ? null : Math.round(v);\n};\nconst text: CytoscapeValueParser = (raw, site) => canonText(raw, site);\nconst bool: CytoscapeValueParser = (raw, site) => canonBoolean(raw, site);\n\n// CX2's `element` / `none`, or a boolean.\nconst visibility: CytoscapeValueParser = (raw, site) => {\n if (typeof raw === \"string\") {\n const t = raw.trim().toLowerCase();\n if (t === \"element\" || t === \"visible\") {\n return true;\n }\n if (t === \"none\" || t === \"hidden\") {\n return false;\n }\n }\n return canonBoolean(raw, site);\n};\n\n/** Cytoscape spellings the common shape table does not hold. */\nconst CY_SHAPES: ReadonlyMap<string, string> = new Map([[\"rounded_rectangle\", \"round-rectangle\"]]);\n\n/**\n * Cytoscape reads its enumeration names whatever their case, so a name it does not know is kept lowercase and\n * hyphenated, the form of the names it knows: `Bogus` and the `BOGUS` a writer spells it as read the same.\n * @param v - a canonical value\n * @returns the value, an `other:` one in that form\n */\nconst caseless = (v: StyleValue | null): StyleValue | null =>\n typeof v === \"string\" && v.startsWith(\"other:\") ? `other:${v.slice(6).toLowerCase().replaceAll(\"_\", \"-\")}` : v;\n\nconst shape: CytoscapeValueParser = (raw, site) => {\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n return caseless(CY_SHAPES.get(s.trim().toLowerCase()) ?? canonEnum(\"shape\", s, \"cytoscape\", site));\n};\n\n/** Cytoscape's arrow names, desktop (`DELTA`) and CX2 (`triangle`), lowercase. */\nconst CY_ARROWS: ReadonlyMap<string, string> = new Map([\n [\"none\", \"none\"],\n [\"delta\", \"triangle\"],\n // a filled delta with a shallow notch in its back, as long and wide as DELTA (Cytoscape 3.10.5 SVG export)\n [\"arrow\", \"triangle\"],\n [\"diamond\", \"diamond\"],\n [\"circle\", \"circle\"],\n [\"t\", \"tee\"],\n [\"half_top\", \"half\"],\n // the half arrow on the line's other side from HALF_TOP's\n [\"half_bottom\", \"other:half-bottom\"],\n [\"square\", \"square\"],\n [\"delta_short_1\", \"triangle\"],\n [\"delta_short_2\", \"triangle\"],\n // a short arrow whose notch is too shallow to show: drawn as the triangle it reads as\n [\"arrow_short\", \"triangle\"],\n [\"diamond_short_1\", \"diamond\"],\n [\"diamond_short_2\", \"diamond\"],\n [\"open_delta\", \"triangle-open\"],\n [\"open_circle\", \"circle-open\"],\n [\"open_diamond\", \"diamond-open\"],\n [\"open_square\", \"other:open-square\"],\n // a delta with a bar across the line behind it\n [\"cross_delta\", \"other:cross-delta\"],\n [\"cross_open_delta\", \"other:cross-open-delta\"],\n [\"open_half_circle\", \"other:open-half-circle\"],\n [\"half_circle\", \"other:half-circle\"],\n [\"triangle\", \"triangle\"],\n [\"triangle-tee\", \"tee\"],\n // CX2's spelling of CROSS_DELTA\n [\"triangle-cross\", \"other:cross-delta\"],\n [\"triangle-backcurve\", \"triangle\"],\n [\"tee\", \"tee\"],\n [\"vee\", \"vee\"],\n [\"open-circle\", \"circle-open\"],\n [\"open-triangle\", \"triangle-open\"],\n [\"open-diamond\", \"diamond-open\"],\n [\"open-square\", \"other:open-square\"],\n [\"open-delta\", \"triangle-open\"],\n [\"half-top\", \"half\"],\n [\"half-bottom\", \"other:half-bottom\"],\n]);\n\n/**\n * How much longer and wider than the neutral shape it is read as each Cytoscape arrow is drawn: the short deltas and\n * diamonds, the short arrow and the crossed deltas (a bar behind the delta), from the unit glyphs Cytoscape 3.10.5's\n * SVG export draws (a DELTA is 2 long and 1 wide, DELTA_SHORT_1 1 by 1, ARROW_SHORT 1.2 by 0.8, CROSS_DELTA 3 by 1.5).\n * Every other arrow is drawn in its shape's own proportions.\n */\nconst CY_ARROW_PROPORTIONS: ReadonlyMap<string, { readonly length: number; readonly width: number }> = new Map([\n [\"delta_short_1\", { length: 0.5, width: 1 }],\n [\"delta_short_2\", { length: 0.25, width: 1 }],\n [\"arrow_short\", { length: 0.6, width: 0.8 }],\n [\"diamond_short_1\", { length: 0.5, width: 1 }],\n [\"diamond_short_2\", { length: 0.25, width: 1 }],\n [\"cross_delta\", { length: 1.5, width: 1.5 }],\n [\"cross_open_delta\", { length: 1.5, width: 1.5 }],\n [\"triangle-cross\", { length: 1.5, width: 1.5 }],\n]);\n\n/**\n * How far from its node Cytoscape draws each arrow that stands off the node's outline, as a multiple of the arrow's\n * own length along its line, from the unit glyphs Cytoscape 3.10.5's SVG export draws back from the outline: T's bar\n * from 0.8 to 1 (4 of its 0.2), a half circle from 0.5 to 1, HALF_TOP's barb from 0.3 to 1.435, a square from 0.25\n * to 1.25. Every other arrow touches the outline.\n */\nconst CY_ARROW_GAPS: ReadonlyMap<string, number> = new Map([\n [\"t\", 4],\n [\"tee\", 4],\n [\"half_circle\", 1],\n [\"open_half_circle\", 1],\n [\"half_top\", 0.3 / 1.135],\n [\"half_bottom\", 0.3 / 1.135],\n [\"half-top\", 0.3 / 1.135],\n [\"half-bottom\", 0.3 / 1.135],\n [\"square\", 0.25],\n [\"open_square\", 0.25],\n [\"open-square\", 0.25],\n]);\n\n/** Cytoscape 2.x numbered arrow codes. */\nconst LEGACY_ARROW: readonly string[] = [\n \"none\",\n \"delta\",\n \"delta\",\n \"delta\",\n \"arrow\",\n \"arrow\",\n \"arrow\",\n \"diamond\",\n \"diamond\",\n \"diamond\",\n \"circle\",\n \"circle\",\n \"circle\",\n \"t\",\n \"t\",\n \"t\",\n \"half_top\",\n \"half_bottom\",\n];\n\n/**\n * A Cytoscape arrow name, lowercase, with a 2.x numbered code read as its name.\n * @param s - the raw name\n * @returns the key\n */\nfunction arrowKey(s: string): string {\n const key = s.trim().toLowerCase();\n return /^\\d{1,2}$/.test(key) ? (LEGACY_ARROW.at(Number(key)) ?? key) : key;\n}\n\nconst arrow: CytoscapeValueParser = (raw, site) => {\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n return caseless(CY_ARROWS.get(arrowKey(s)) ?? canonEnum(\"arrow\", s, \"cytoscape\", site));\n};\n\n/**\n * The parser of an arrow's length or width as a fraction of its neutral shape's, from the arrow's name: 1 for every\n * arrow Cytoscape draws in its shape's proportions, so a bypass over a short default draws the full shape again.\n * @param side - which proportion\n * @returns the parser; null for a name it does not know (the shape's parser notes it)\n */\nexport function arrowProportion(side: \"length\" | \"width\"): CytoscapeValueParser {\n return (raw, site) => {\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n const key = arrowKey(s);\n return CY_ARROW_PROPORTIONS.get(key)?.[side] ?? (CY_ARROWS.has(key) ? 1 : null);\n };\n}\n\n/**\n * The parser of how far an arrow stands off its node, as a multiple of its own length (`CY_ARROW_GAPS`), from the\n * arrow's name: 0 for an arrow that touches the node.\n * @param raw - the arrow's name\n * @param site - where it was read\n * @returns the gap; null for a name it does not know (the shape's parser notes it)\n */\nexport const arrowGap: CytoscapeValueParser = (raw, site) => {\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n const key = arrowKey(s);\n return CY_ARROW_GAPS.get(key) ?? (CY_ARROWS.has(key) ? 0 : null);\n};\n\n/** Cytoscape's line types, lowercase. */\nconst CY_LINES: ReadonlyMap<string, string> = new Map([\n [\"solid\", \"solid\"],\n [\"dot\", \"dotted\"],\n [\"dots\", \"dotted\"],\n [\"equal_dash\", \"dashed\"],\n [\"long_dash\", \"dashed\"],\n [\"dash_dot\", \"dash-dot\"],\n [\"sinewave\", \"sinewave\"],\n [\"zigzag\", \"zigzag\"],\n [\"parallel_lines\", \"double\"],\n [\"marquee_dash\", \"dashed\"],\n [\"marquee_equal\", \"dashed\"],\n [\"marquee_dash_dot\", \"dash-dot\"],\n [\"backward_slash\", \"other:backward-slash\"],\n [\"forward_slash\", \"other:forward-slash\"],\n [\"vertical_slash\", \"other:vertical-slash\"],\n [\"separate_arrow\", \"other:separate-arrow\"],\n [\"contiguous_arrow\", \"other:contiguous-arrow\"],\n [\"double\", \"double\"],\n]);\n\n/**\n * A line type read for an edge line or a node border.\n * @param kind - which enumeration the value belongs to\n * @returns the parser\n */\nfunction lineOf(kind: \"lineStyle\" | \"borderStyle\"): CytoscapeValueParser {\n return (raw, site) => {\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n const key = s.trim().toLowerCase();\n let v: string | null;\n if (/^line_\\d{1,3}$/.test(key)) {\n v = \"solid\";\n } else if (/^dashed_\\d{1,3}$/.test(key)) {\n v = \"dashed\";\n } else {\n v = CY_LINES.get(key) ?? canonEnum(kind, s, \"cytoscape\", site);\n }\n if (v === null || isStyleValue(\"node\", kind, v) || kind === \"lineStyle\") {\n return v;\n }\n // a line type a border does not have is kept as other:, spelled as the line type's own (other:forward-slash)\n return v.startsWith(\"other:\") ? v : `other:${v}`;\n };\n}\n\n/** The parts of a Cytoscape font face. */\ninterface FontFace {\n readonly family: string;\n readonly weight: \"normal\" | \"bold\";\n readonly italic: boolean;\n}\n\n/**\n * A Java font name's own style: `Dialog.bolditalic` is the bold italic face of `Dialog`, and Java draws it bold and\n * italic whatever style the rest of the face states (`Dialog.bolditalic,plain,12` is drawn bold italic).\n * @param name - the font name\n * @returns the family without the suffix, and whether the suffix makes it bold or italic\n */\nfunction javaFace(name: string): FontFace {\n const m = /\\.(bold|italic|plain|bolditalic)$/i.exec(name);\n const suffix = m?.[1].toLowerCase() ?? \"\";\n return {\n family: m === null ? name : name.slice(0, m.index),\n weight: suffix.includes(\"bold\") ? \"bold\" : \"normal\",\n italic: suffix.includes(\"italic\"),\n };\n}\n\n/**\n * A face whose family may carry a Java style suffix, its suffix's style added to the stated one.\n * @param family - the family as written\n * @param bold - whether the face states bold\n * @param italic - whether the face states italic\n * @returns the face\n */\nfunction withSuffix(family: string, bold: boolean, italic: boolean): FontFace {\n const own = javaFace(family.trim());\n return {\n family: own.family,\n weight: bold || own.weight === \"bold\" ? \"bold\" : \"normal\",\n italic: italic || own.italic,\n };\n}\n\n/**\n * A font face: `SansSerif,plain,12`, `Dialog.bold,bold,12`, the legacy `SansSerif-0-12` (style bits 1 bold,\n * 2 italic) or CX2's `{ FONT_FAMILY, FONT_STYLE, FONT_WEIGHT }`, whose `FONT_NAME` (the font Cytoscape desktop\n * wrote it from, which its own import restores) wins over the CSS family when present. A Java style suffix on the\n * name (`SansSerif.bold`) is drawn as well.\n * @param raw - the value\n * @param site - where it was read\n * @returns the face, or null\n */\nfunction fontFace(raw: unknown, site: CanonSite): FontFace | null {\n if (raw !== null && typeof raw === \"object\" && !Array.isArray(raw)) {\n return cx2FontFace(raw as Record<string, unknown>, site);\n }\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n const parts = s.split(\",\");\n if (parts.length >= 2) {\n // desktop takes the face from the name alone (`FontVisualProperty.parseSerializableString`): its style word is\n // what it writes, not what it reads, so a passthrough of `Serif,bold,12` is drawn plain (Cytoscape 3.10.5's\n // SVG of specimen-mappings-bypass-p19, passthrough-font-face) and `SansSerif.bold,bold,10` bold by its suffix\n return withSuffix(parts[0], false, false);\n }\n return legacyFontFace(s) ?? withSuffix(s, false, false);\n}\n\n/**\n * CX2's font face object.\n * @param o - the object\n * @param site - where it was read\n * @returns the face, or null without a family\n */\nfunction cx2FontFace(o: Record<string, unknown>, site: CanonSite): FontFace | null {\n const name = Object.hasOwn(o, \"FONT_NAME\") ? scalarText(o.FONT_NAME, site) : null;\n let family = Object.hasOwn(o, \"FONT_FAMILY\") ? scalarText(o.FONT_FAMILY, site) : null;\n if (name !== null && name.trim() !== \"\") {\n family = name;\n }\n if (family === null) {\n return null;\n }\n const weight = Object.hasOwn(o, \"FONT_WEIGHT\") ? String(o.FONT_WEIGHT) : \"\";\n const style = Object.hasOwn(o, \"FONT_STYLE\") ? String(o.FONT_STYLE) : \"\";\n return withSuffix(family, /bold/i.test(weight.slice(0, 32)), /italic/i.test(style.slice(0, 32)));\n}\n\n/**\n * The legacy `Family-style-size` face: the last two dash parts are numbers, the style's bits 1 bold and 2 italic.\n * @param s - the value\n * @returns the face, or null when it is not one\n */\nfunction legacyFontFace(s: string): FontFace | null {\n const dash = s.split(\"-\");\n const numeric = (t: string | undefined): boolean => /^\\d+(?:\\.\\d+)?$/.test(t ?? \"\");\n if (dash.length < 3 || !numeric(dash.at(-1)) || !numeric(dash.at(-2))) {\n return null;\n }\n const bits = Math.trunc(Number(dash.at(-2)));\n let family = dash.slice(0, -2).join(\"-\");\n let bold = (bits & 1) !== 0;\n if (/-bold$/i.test(family)) {\n family = family.slice(0, -\"-bold\".length);\n bold = true;\n }\n return withSuffix(family, bold, (bits & 2) !== 0);\n}\n\n/**\n * The faces Java draws its logical fonts in on Linux, where the oracles were drawn (the JDK's fontconfig maps\n * SansSerif and Dialog to DejaVu Sans), each before the CSS generic family it stands for. A label wraps by its width\n * in that face: a browser's own sans-serif (Liberation Sans) is 14 percent narrower, so its lines break later.\n */\nexport const JAVA_SANS = \"DejaVu Sans, sans-serif\";\nexport const JAVA_SERIF = \"DejaVu Serif, serif\";\nexport const JAVA_MONO = \"DejaVu Sans Mono, monospace\";\n\n/** The family a Java logical font name is read as (`Dialog` is drawn as a sans-serif font). */\nconst JAVA_FONTS: ReadonlyMap<string, string> = new Map([\n // CX2's CSS generic families too: Cytoscape desktop hands them to Java, which draws them as these\n [\"sans-serif\", JAVA_SANS],\n [\"monospace\", JAVA_MONO],\n [\"sansserif\", JAVA_SANS],\n [\"dialog\", JAVA_SANS],\n [\"default\", JAVA_SANS],\n [\"dialoginput\", JAVA_MONO],\n [\"monospaced\", JAVA_MONO],\n [\"serif\", JAVA_SERIF],\n]);\n\nconst fontFamily: CytoscapeValueParser = (raw, site) => {\n const family = fontFace(raw, site)?.family ?? null;\n return family === null ? null : javaFamily(family);\n};\n\n/** The CSS generic families. */\nconst CSS_GENERIC: ReadonlySet<string> = new Set([\n \"sans-serif\",\n \"serif\",\n \"monospace\",\n \"cursive\",\n \"fantasy\",\n \"system-ui\",\n]);\n\n/**\n * A Java font name as the CSS family Cytoscape draws it with: a logical name as its generic family, and any other\n * with Dialog's face after it, because Java draws a font it does not have as Dialog\n * (`Calibri-Bold` on a machine without Calibri is drawn in Dialog's face and measured so when a label wraps).\n * @param family - the Java font name, without its style suffix\n * @returns the CSS family\n */\nexport function javaFamily(family: string): string {\n const logical = JAVA_FONTS.get(family.toLowerCase());\n if (logical !== undefined) {\n return logical;\n }\n // a CSS generic family or family list (CX2 writes them) already says what stands in for a missing font\n return family.includes(\",\") || CSS_GENERIC.has(family.toLowerCase()) ? family : `${family}, ${JAVA_SANS}`;\n}\nconst fontWeight: CytoscapeValueParser = (raw, site) => fontFace(raw, site)?.weight ?? null;\nconst fontItalic: CytoscapeValueParser = (raw, site) => fontFace(raw, site)?.italic ?? null;\n\n/** A desktop anchor letter as a point of a box, x right and y down, each -1, 0 or 1. */\nconst ANCHOR: ReadonlyMap<string, readonly [number, number]> = new Map([\n [\"C\", [0, 0]],\n [\"N\", [0, -1]],\n [\"S\", [0, 1]],\n [\"E\", [1, 0]],\n [\"W\", [-1, 0]],\n [\"NE\", [1, -1]],\n [\"NW\", [-1, -1]],\n [\"SE\", [1, 1]],\n [\"SW\", [-1, 1]],\n [\"NONE\", [0, 0]],\n]);\n\n/** CX2's anchor and align words as a point of a box on one axis. */\nconst CX2_SIDE: ReadonlyMap<string, number> = new Map([\n [\"center\", 0],\n [\"left\", -1],\n [\"right\", 1],\n [\"top\", -1],\n [\"bottom\", 1],\n]);\n\n/** A label justification as the neutral text alignment. */\nconst JUSTIFY: ReadonlyMap<string, string> = new Map([\n [\"l\", \"left\"],\n [\"left\", \"left\"],\n [\"c\", \"center\"],\n [\"center\", \"center\"],\n [\"r\", \"right\"],\n [\"right\", \"right\"],\n]);\n\n/**\n * A Cytoscape label position, read whole: the point of the node (or the edge's middle) `node` and the point of the\n * label's box `label` it is pinned to, each `[x, y]` with x right and y down as -1, 0 or 1, the justification of its\n * lines, and the offset `[x, y]` in px, y down.\n * @category Styles\n */\nexport interface CytoscapeLabelPlace {\n readonly node: readonly [number, number];\n readonly label: readonly [number, number];\n readonly justify: string;\n readonly offset: readonly [number, number];\n}\n\n/**\n * The anchors of CX2's edge label position `{ EDGE_ANCHOR, LABEL_ANCHOR, ... }`, each a desktop anchor letter, as\n * `[edge x, edge y, label x, label y]`; undefined where a letter is not one.\n * @param o - the position\n * @param site - where a bad value is noted\n * @returns the four sides\n */\nfunction cx2EdgeAnchors(o: Record<string, unknown>, site: CanonSite): (number | undefined)[] {\n const letter = (key: string): readonly [number, number] | undefined =>\n ANCHOR.get((scalarText(Object.hasOwn(o, key) ? o[key] : \"C\", site) ?? \"\").trim().toUpperCase());\n return [\n ...(letter(\"EDGE_ANCHOR\") ?? [undefined, undefined]),\n ...(letter(\"LABEL_ANCHOR\") ?? [undefined, undefined]),\n ];\n}\n\n/**\n * Reads a label position: desktop's `C,C,c,0.00,0.00` (node anchor, label anchor, justification, x and y offsets)\n * or CX2's `{ HORIZONTAL_ANCHOR, VERTICAL_ANCHOR, HORIZONTAL_ALIGN, VERTICAL_ALIGN, JUSTIFICATION, MARGIN_X,\n * MARGIN_Y }` (for an edge's label `{ EDGE_ANCHOR, LABEL_ANCHOR, JUSTIFICATION, MARGIN_X, MARGIN_Y }`, the anchors\n * as desktop's letters).\n * @param raw - the value\n * @param site - where a bad value is noted\n * @returns the place, or null\n * @category Styles\n */\nexport function cytoscapeLabelPlace(raw: unknown, site: CanonSite): CytoscapeLabelPlace | null {\n if (raw !== null && typeof raw === \"object\" && !Array.isArray(raw)) {\n const o = raw as Record<string, unknown>;\n const word = (key: string): string => {\n const v = Object.hasOwn(o, key) ? scalarText(o[key], site) : null;\n return (v ?? \"center\").trim().toLowerCase();\n };\n const num = (key: string): number => {\n const v = Object.hasOwn(o, key) ? Number(o[key]) : 0;\n return Number.isFinite(v) ? v : 0;\n };\n const sides = Object.hasOwn(o, \"EDGE_ANCHOR\")\n ? cx2EdgeAnchors(o, site)\n : [\"HORIZONTAL_ANCHOR\", \"VERTICAL_ANCHOR\", \"HORIZONTAL_ALIGN\", \"VERTICAL_ALIGN\"].map((k) =>\n CX2_SIDE.get(word(k)),\n );\n if (sides.includes(undefined)) {\n noteAt(site, STYLE_ISSUE.UNKNOWN_VALUE, JSON.stringify(raw).slice(0, 64));\n return null;\n }\n const [nx, ny, lx, ly] = sides as number[];\n return {\n node: [nx, ny],\n label: [lx, ly],\n justify: JUSTIFY.get(word(\"JUSTIFICATION\")) ?? \"center\",\n offset: [num(\"MARGIN_X\"), num(\"MARGIN_Y\")],\n };\n }\n const s = scalarText(raw, site);\n if (s === null) {\n return null;\n }\n const parts = s.split(\",\").map((p) => p.trim());\n const node = ANCHOR.get(parts[0].toUpperCase());\n // a position naming only the node's anchor pins the label's opposite point there, as Cytoscape 2.x did\n const label = parts.length > 1 ? ANCHOR.get(parts[1].toUpperCase()) : node?.map((v) => -v);\n if (node === undefined || label === undefined) {\n noteAt(site, STYLE_ISSUE.UNKNOWN_VALUE, s);\n return null;\n }\n const at = (i: number): number => {\n const v = Number(parts[i] ?? 0);\n return Number.isFinite(v) ? v : 0;\n };\n return {\n node,\n label: [label[0], label[1]],\n justify: JUSTIFY.get((parts[2] ?? \"c\").toLowerCase()) ?? \"center\",\n offset: [at(3), at(4)],\n };\n}\n\n/** The neutral position of a label inside its node against each side, by `[x, y]` of the side, y down. */\nconst INSIDE: ReadonlyMap<string, string> = new Map([\n [\"0,0\", \"center\"],\n [\"0,-1\", \"inside-top\"],\n [\"0,1\", \"inside-bottom\"],\n [\"-1,0\", \"inside-left\"],\n [\"1,0\", \"inside-right\"],\n [\"-1,-1\", \"inside-top-left\"],\n [\"1,-1\", \"inside-top-right\"],\n [\"-1,1\", \"inside-bottom-left\"],\n [\"1,1\", \"inside-bottom-right\"],\n]);\n\n/**\n * The neutral `labelPosition` a Cytoscape label position starts from: where the label's point is the node's own\n * point on both axes (its center, or inside against a side or a corner), that position; anywhere else `center`,\n * with the rest said by `labelOffsetX`/`Y` and `labelShiftX`/`Y` (see `cytoscapeLabelMove()`).\n * @param place - the label position\n * @returns the neutral position\n * @category Styles\n */\nexport function cytoscapeLabelBase(place: CytoscapeLabelPlace): string {\n const inside = place.node[0] === place.label[0] && place.node[1] === place.label[1];\n return inside ? (INSIDE.get(`${place.node[0]},${place.node[1]}`) ?? \"center\") : \"center\";\n}\n\n/**\n * How far a Cytoscape label is moved from its `cytoscapeLabelBase()` position: the offset in px (y down), with the\n * node's anchor point added when the base is `center` and the anchors differ, and the shift by the label's own\n * size that pins the label's anchor point there.\n * @param place - the label position\n * @param width - the node's width (0 for an edge's middle)\n * @param height - the node's height (0 for an edge's middle)\n * @returns the offset and the shift, each `[x, y]`\n * @category Styles\n */\nexport function cytoscapeLabelMove(\n place: CytoscapeLabelPlace,\n width: number,\n height: number,\n): { readonly offset: readonly [number, number]; readonly shift: readonly [number, number] } {\n if (\n cytoscapeLabelBase(place) !== \"center\" ||\n (place.node[0] === 0 && place.node[1] === 0 && place.label[0] === 0 && place.label[1] === 0)\n ) {\n return { offset: place.offset, shift: [0, 0] };\n }\n return {\n offset: [(place.node[0] * width) / 2 + place.offset[0], (place.node[1] * height) / 2 + place.offset[1]],\n shift: [halfBack(place.label[0]), halfBack(place.label[1])],\n };\n}\n\n/**\n * How far a label is shifted, as a fraction of its own size, to pin its point `side` (-1, 0 or 1) where its middle was.\n * @param side - the label's point on one axis\n * @returns the shift (0, never -0, for the middle)\n * @category Styles\n */\nexport function halfBack(side: number): number {\n return side === 0 ? 0 : -side / 2;\n}\n\nconst labelPosition: CytoscapeValueParser = (raw, site) => {\n const place = cytoscapeLabelPlace(raw, site);\n return place === null ? null : cytoscapeLabelBase(place);\n};\n\n/**\n * The visual properties that set each neutral property, in the order Cytoscape prefers them: the first one a style\n * or any bypass mentions is the one read. Cytoscape draws a node's fill from `NODE_FILL_COLOR`; `NODE_PAINT` is its\n * parent and only counts when the child is absent everywhere.\n * @category Styles\n */\nexport const CYTOSCAPE_LEXICON: Readonly<\n Record<StyleTarget, ReadonlyMap<string, readonly (readonly [vp: string, parse: CytoscapeValueParser])[]>>\n> = Object.freeze({\n node: new Map<string, readonly (readonly [string, CytoscapeValueParser])[]>([\n [\n \"fill\",\n [\n [\"NODE_FILL_COLOR\", color],\n [\"NODE_BACKGROUND_COLOR\", color],\n [\"NODE_PAINT\", color],\n ],\n ],\n [\n \"fillOpacity\",\n [\n [\"NODE_TRANSPARENCY\", opacity255],\n [\"NODE_BACKGROUND_OPACITY\", opacity01],\n ],\n ],\n [\n \"borderColor\",\n [\n [\"NODE_BORDER_PAINT\", color],\n [\"NODE_BORDER_COLOR\", color],\n ],\n ],\n [\n \"borderOpacity\",\n [\n [\"NODE_BORDER_TRANSPARENCY\", opacity255],\n [\"NODE_BORDER_OPACITY\", opacity01],\n ],\n ],\n [\"borderWidth\", [[\"NODE_BORDER_WIDTH\", length]]],\n [\n \"borderStyle\",\n [\n [\"NODE_BORDER_STROKE\", lineOf(\"borderStyle\")],\n [\"NODE_BORDER_LINE_TYPE\", lineOf(\"borderStyle\")],\n [\"NODE_BORDER_STYLE\", lineOf(\"borderStyle\")],\n ],\n ],\n [\"shape\", [[\"NODE_SHAPE\", shape]]],\n [\"width\", [[\"NODE_WIDTH\", length]]],\n [\"height\", [[\"NODE_HEIGHT\", length]]],\n [\"label\", [[\"NODE_LABEL\", text]]],\n [\"labelColor\", [[\"NODE_LABEL_COLOR\", color]]],\n [\"labelSize\", [[\"NODE_LABEL_FONT_SIZE\", fontSize]]],\n [\n \"labelWrapWidth\",\n [\n [\"NODE_LABEL_WIDTH\", length],\n [\"NODE_LABEL_MAX_WIDTH\", length],\n ],\n ],\n [\"labelFont\", [[\"NODE_LABEL_FONT_FACE\", fontFamily]]],\n [\"labelWeight\", [[\"NODE_LABEL_FONT_FACE\", fontWeight]]],\n [\"labelItalic\", [[\"NODE_LABEL_FONT_FACE\", fontItalic]]],\n [\"labelPosition\", [[\"NODE_LABEL_POSITION\", labelPosition]]],\n [\"labelRotation\", [[\"NODE_LABEL_ROTATION\", rotation]]],\n [\n \"labelOpacity\",\n [\n [\"NODE_LABEL_TRANSPARENCY\", opacity255],\n [\"NODE_LABEL_OPACITY\", opacity01],\n ],\n ],\n [\"tooltip\", [[\"NODE_TOOLTIP\", text]]],\n [\n \"visible\",\n [\n [\"NODE_VISIBLE\", bool],\n [\"NODE_VISIBILITY\", visibility],\n ],\n ],\n ]),\n edge: new Map<string, readonly (readonly [string, CytoscapeValueParser])[]>([\n [\n \"color\",\n [\n [\"EDGE_STROKE_UNSELECTED_PAINT\", color],\n [\"EDGE_LINE_COLOR\", color],\n [\"EDGE_UNSELECTED_PAINT\", color],\n [\"EDGE_PAINT\", color],\n ],\n ],\n [\n \"opacity\",\n [\n [\"EDGE_TRANSPARENCY\", opacity255],\n [\"EDGE_OPACITY\", opacity01],\n ],\n ],\n [\"width\", [[\"EDGE_WIDTH\", length]]],\n [\n \"lineStyle\",\n [\n [\"EDGE_LINE_TYPE\", lineOf(\"lineStyle\")],\n [\"EDGE_LINE_STYLE\", lineOf(\"lineStyle\")],\n ],\n ],\n [\"sourceArrow\", [[\"EDGE_SOURCE_ARROW_SHAPE\", arrow]]],\n [\"targetArrow\", [[\"EDGE_TARGET_ARROW_SHAPE\", arrow]]],\n // One neutral size for both ends: the target's, else the source's.\n [\n \"arrowSize\",\n [\n [\"EDGE_TARGET_ARROW_SIZE\", arrowSizeParser],\n [\"EDGE_SOURCE_ARROW_SIZE\", arrowSizeParser],\n ],\n ],\n [\n \"sourceArrowColor\",\n [\n [\"EDGE_SOURCE_ARROW_UNSELECTED_PAINT\", color],\n [\"EDGE_SOURCE_ARROW_COLOR\", color],\n ],\n ],\n [\n \"targetArrowColor\",\n [\n [\"EDGE_TARGET_ARROW_UNSELECTED_PAINT\", color],\n [\"EDGE_TARGET_ARROW_COLOR\", color],\n ],\n ],\n [\"curved\", [[\"EDGE_CURVED\", bool]]],\n [\"label\", [[\"EDGE_LABEL\", text]]],\n [\"labelColor\", [[\"EDGE_LABEL_COLOR\", color]]],\n [\"labelSize\", [[\"EDGE_LABEL_FONT_SIZE\", fontSize]]],\n [\"labelFont\", [[\"EDGE_LABEL_FONT_FACE\", fontFamily]]],\n [\"labelWeight\", [[\"EDGE_LABEL_FONT_FACE\", fontWeight]]],\n [\"labelItalic\", [[\"EDGE_LABEL_FONT_FACE\", fontItalic]]],\n [\n \"labelWrapWidth\",\n [\n [\"EDGE_LABEL_WIDTH\", length],\n [\"EDGE_LABEL_MAX_WIDTH\", length],\n ],\n ],\n [\"labelRotation\", [[\"EDGE_LABEL_ROTATION\", rotation]]],\n [\n \"labelOpacity\",\n [\n [\"EDGE_LABEL_TRANSPARENCY\", opacity255],\n [\"EDGE_LABEL_OPACITY\", opacity01],\n ],\n ],\n [\"tooltip\", [[\"EDGE_TOOLTIP\", text]]],\n [\n \"visible\",\n [\n [\"EDGE_VISIBLE\", bool],\n [\"EDGE_VISIBILITY\", visibility],\n ],\n ],\n ]),\n});\n\n/** A node's size when `nodeSizeLocked` makes `NODE_SIZE` drive width and height. */\nexport const NODE_SIZE_VP = \"NODE_SIZE\";\n\n/** The parser of node sizes, for `NODE_SIZE`. */\nexport const sizeParser: CytoscapeValueParser = length;\n\n/** The parser of colors, for the network background and `arrowColorMatchesEdge`. */\nexport const colorParser: CytoscapeValueParser = color;\n\n/**\n * The parser of 0..255 transparencies (desktop) and 0..1 opacities (CX2), by visual property.\n * @param vp - the visual property (`*_TRANSPARENCY` or `*_OPACITY`)\n * @returns its parser\n */\nexport const opacityParser = (vp: string): CytoscapeValueParser => (vp.endsWith(\"_OPACITY\") ? opacity01 : opacity255);\n\n/** Every visual property the lexicon reads. */\nconst KNOWN_VPS: ReadonlySet<string> = new Set([\n NODE_SIZE_VP,\n ...Object.values(CYTOSCAPE_LEXICON).flatMap((byProp) =>\n Array.from(byProp.values()).flatMap((list) => list.map(([vp]) => vp)),\n ),\n]);\n\n/** Geometry, selection state and paint that is not a style: dropped without a note. */\nconst IGNORED_VP =\n /^(?:NODE|EDGE|NETWORK)_[XYZ]_LOCATION$|_SELECTED|SELECTION|^NETWORK_(?!BACKGROUND)|_DEPTH$|^COMPOUND_|EDGE_BEND|EDGE_CONTROL_POINTS|NODE_NESTED_NETWORK|_Z_ORDER$|EDGE_STACKING|_LABEL_WIDTH$|_HEIGHT$|_WIDTH$/;\n\n/**\n * Whether a visual property is one no neutral property carries and that is worth a note.\n * @param vp - the visual property\n * @returns true when it is neither read nor ignored\n */\nexport function isUncarriedVp(vp: string): boolean {\n return !KNOWN_VPS.has(vp) && !IGNORED_VP.test(vp);\n}\n\n/** Cytoscape's old identifiers (2.x XGMML graphics attributes and session properties), lowercase. */\nconst IDENTIFIERS: Readonly<Record<StyleTarget, ReadonlyMap<string, string>>> = {\n node: new Map([\n [\"fill\", \"NODE_FILL_COLOR\"],\n [\"w\", \"NODE_WIDTH\"],\n [\"h\", \"NODE_HEIGHT\"],\n [\"size\", \"NODE_SIZE\"],\n [\"type\", \"NODE_SHAPE\"],\n [\"outline\", \"NODE_BORDER_PAINT\"],\n [\"width\", \"NODE_BORDER_WIDTH\"],\n [\"borderlinetype\", \"NODE_BORDER_LINE_TYPE\"],\n [\"nodelabelfont\", \"NODE_LABEL_FONT_FACE\"],\n [\"nodetransparency\", \"NODE_TRANSPARENCY_01\"],\n [\"nodelabelposition\", \"NODE_LABEL_POSITION\"],\n [\"nodefillcolor\", \"NODE_FILL_COLOR\"],\n [\"nodesize\", \"NODE_SIZE\"],\n [\"nodewidth\", \"NODE_WIDTH\"],\n [\"nodehight\", \"NODE_HEIGHT\"],\n [\"nodeheight\", \"NODE_HEIGHT\"],\n [\"nodeopacity\", \"NODE_TRANSPARENCY\"],\n [\"nodebordercolor\", \"NODE_BORDER_PAINT\"],\n [\"nodelinewidth\", \"NODE_BORDER_WIDTH\"],\n [\"nodelinestyle\", \"NODE_BORDER_LINE_TYPE\"],\n [\"nodeshape\", \"NODE_SHAPE\"],\n [\"nodefont\", \"NODE_LABEL_FONT_FACE\"],\n [\"nodefontsize\", \"NODE_LABEL_FONT_SIZE\"],\n [\"nodelabel\", \"NODE_LABEL\"],\n [\"nodelabelcolor\", \"NODE_LABEL_COLOR\"],\n [\"nodetooltip\", \"NODE_TOOLTIP\"],\n ]),\n edge: new Map([\n [\"width\", \"EDGE_WIDTH\"],\n [\"fill\", \"EDGE_STROKE_UNSELECTED_PAINT\"],\n [\"edgelinetype\", \"EDGE_LINE_TYPE\"],\n [\"edgelabelfont\", \"EDGE_LABEL_FONT_FACE\"],\n [\"sourcearrowcolor\", \"EDGE_SOURCE_ARROW_UNSELECTED_PAINT\"],\n [\"targetarrowcolor\", \"EDGE_TARGET_ARROW_UNSELECTED_PAINT\"],\n [\"edgesourcearrowcolor\", \"EDGE_SOURCE_ARROW_UNSELECTED_PAINT\"],\n [\"edgetargetarrowcolor\", \"EDGE_TARGET_ARROW_UNSELECTED_PAINT\"],\n [\"edgelinewidth\", \"EDGE_WIDTH\"],\n [\"edgecolor\", \"EDGE_STROKE_UNSELECTED_PAINT\"],\n [\"edgelinestyle\", \"EDGE_LINE_TYPE\"],\n [\"edgeopacity\", \"EDGE_TRANSPARENCY\"],\n [\"sourcearrow\", \"EDGE_SOURCE_ARROW_SHAPE\"],\n [\"targetarrow\", \"EDGE_TARGET_ARROW_SHAPE\"],\n [\"edgesourcearrowshape\", \"EDGE_SOURCE_ARROW_SHAPE\"],\n [\"edgetargetarrowshape\", \"EDGE_TARGET_ARROW_SHAPE\"],\n [\"edgelabel\", \"EDGE_LABEL\"],\n [\"edgefont\", \"EDGE_LABEL_FONT_FACE\"],\n [\"edgelabelcolor\", \"EDGE_LABEL_COLOR\"],\n [\"edgefontsize\", \"EDGE_LABEL_FONT_SIZE\"],\n [\"edgetooltip\", \"EDGE_TOOLTIP\"],\n [\"curved\", \"EDGE_CURVED_LEGACY\"],\n [\"edgecurved\", \"EDGE_CURVED\"],\n [\"edgebend\", \"EDGE_BEND\"],\n ]),\n};\n\n/** Objects nested deeper than this inside one element's graphics are not read. */\nconst MAX_VP_DEPTH = 8;\nconst VP_NAME = /^[A-Z][A-Z_0-9]+$/;\n\n/**\n * One graphics key as a visual property: its name (`?<key>` for one with none) and its value, a legacy encoding\n * converted.\n * @param target - nodes or edges\n * @param k - the key\n * @param v - its value\n * @returns the name and the value\n */\nfunction visualProperty(target: StyleTarget, k: string, v: unknown): [string, unknown] {\n const name = VP_NAME.test(k) ? k : IDENTIFIERS[target].get(k.toLowerCase().replace(/^cy:/, \"\"));\n if (name === undefined) {\n return [`?${k}`, v];\n }\n if (name === \"NODE_TRANSPARENCY_01\") {\n let f = Number.NaN;\n if (typeof v === \"number\") {\n f = v;\n } else if (typeof v === \"string\") {\n f = Number(v.trim());\n }\n return [\"NODE_TRANSPARENCY\", Number.isFinite(f) ? Math.round(f * 255) : null];\n }\n if (name === \"EDGE_CURVED_LEGACY\") {\n return [\"EDGE_CURVED\", typeof v === \"string\" && v.toUpperCase() === \"CURVED_LINES\"];\n }\n return [name, v];\n}\n\n/**\n * Normalizes the keys of one object of an element's graphics; a nested object is pushed onto the stack.\n * @param target - nodes or edges\n * @param top - the object and its depth\n * @param stack - the objects still to walk\n * @param out - visual property name to raw value, added to\n * @returns how many nested objects were too deep to walk\n */\nfunction normalizeObject(\n target: StyleTarget,\n top: [Record<string, unknown>, number],\n stack: [Record<string, unknown>, number][],\n out: Map<string, unknown>,\n): number {\n const [obj, depth] = top;\n let deep = 0;\n for (const k of Object.keys(obj)) {\n const v = obj[k];\n if (k === \"lockedVisualProperties\" || v === null || v === undefined) {\n continue;\n }\n // a 2.x edgeBend of one handle is a record: kept whole, as its handles\n if (typeof v === \"object\" && !Array.isArray(v) && !/^[A-Z_0-9]+$/.test(k) && k.toLowerCase() !== \"edgebend\") {\n if (depth + 1 > MAX_VP_DEPTH) {\n deep++;\n } else {\n stack.push([v as Record<string, unknown>, depth + 1]);\n }\n continue;\n }\n const [name, value] = visualProperty(target, k, v);\n // visual-property-named keys come first in 3.x graphics and win\n if (!out.has(name)) {\n out.set(name, value);\n }\n }\n return deep;\n}\n\n/**\n * One element's raw visual properties, normalized: Cytoscape's old identifiers renamed to visual property names and\n * the legacy encodings converted (`nodeTransparency` 0..1 to `NODE_TRANSPARENCY` 0..255, `curved` to\n * `EDGE_CURVED`). Nested objects (`cytoscapeNodeGraphicsAttributes` and the like) are walked with an explicit stack\n * and a depth limit, never by recursion on the file's nesting. A key with no visual property name is kept as\n * `?<key>`, so a caller can note it.\n * @param target - nodes or edges\n * @param raw - the element's graphics object\n * @param notes - where a too-deep nesting is noted\n * @returns visual property name to raw value\n * @category Styles\n */\nexport function normalizeVisualProperties(target: StyleTarget, raw: unknown, notes?: StyleNotes): Map<string, unknown> {\n if (raw === null || typeof raw !== \"object\") {\n return new Map();\n }\n const out = new Map<string, unknown>();\n const stack: [Record<string, unknown>, number][] = [[raw as Record<string, unknown>, 0]];\n let deep = 0;\n for (let top = stack.pop(); top !== undefined; top = stack.pop()) {\n deep += normalizeObject(target, top, stack, out);\n }\n if (deep > 0) {\n notes?.add(STYLE_ISSUE.NESTING, target, \"graphics\", { sample: `deeper than ${MAX_VP_DEPTH}`, count: deep });\n }\n return out;\n}\n\n/**\n * The step a continuous mapping's value is rounded to for the integer visual properties Cytoscape desktop rounds an\n * interpolated value of (cytoscape-api BasicVisualLexicon: the font sizes and the 0..255 transparencies; the latter\n * read as opacities, so 1/255).\n */\nconst INTEGER_VP_STEPS: ReadonlyMap<string, number> = new Map([\n [\"NODE_LABEL_FONT_SIZE\", 1],\n [\"EDGE_LABEL_FONT_SIZE\", 1],\n [\"NODE_TRANSPARENCY\", 1 / 255],\n [\"EDGE_TRANSPARENCY\", 1 / 255],\n]);\n\n/**\n * The step Cytoscape rounds an interpolated value of a visual property to.\n * @param vp - the visual property\n * @returns the step, or undefined for a property that holds fractions\n */\nexport function vpStep(vp: string): number | undefined {\n return INTEGER_VP_STEPS.get(vp);\n}\n"],"names":[],"mappings":";AAuBA,MAAM,QAA8B,CAAC,KAAK,SAAS,WAAW,KAAK,aAAa,IAAI,GAAG,SAAS;AAGhG,MAAM,aAAmC,CAAC,KAAK,SAAS;AACpD,QAAM,IAAI,YAAY,KAAK,IAAI;AAC/B,MAAI,MAAM,MAAM;AACZ,WAAO;AAAA,EACX;AACA,MAAI,IAAI,KAAK;AACT,WAAO,M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AK;AAAA,IACvB;AAAA,EACJ;AACA,SAAO;AACX;AAcO,SAAS,0BAA0B,QAAqB,KAAc,OAA0C;AACnH,MAAI,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AACzC,+BAAW,IAAA;AAAA,EACf;AACA,QAAM,0BAAU,IAAA;AAChB,QAAM,QAA6C,CAAC,CAAC,KAAgC,CAAC,CAAC;AACvF,MAAI,OAAO;AACX,WAAS,MAAM,MAAM,IAAA,GAAO,QAAQ,QAAW,MAAM,MAAM,OAAO;AAC9D,YAAQ,gBAAgB,QAAQ,KAAK,OAAO,GAAG;AAAA,EACnD;AACA,MAAI,OAAO,GAAG;AACV,WAAO,IAAI,YAAY,SAAS,QAAQ,YAAY,EAAE,QAAQ,eAAe,YAAY,IAAI,OAAO,KAAA,CAAM;AAAA,EAC9G;AACA,SAAO;AACX;AAOA,MAAM,uCAAoD,IAAI;AAAA,EAC1D,CAAC,wBAAwB,CAAC;AAAA,EAC1B,CAAC,wBAAwB,CAAC;AAAA,EAC1B,CAAC,qBAAqB,IAAI,GAAG;AAAA,EAC7B,CAAC,qBAAqB,IAAI,GAAG;AACjC,CAAC;AAOM,SAAS,OAAO,IAAgC;AACnD,SAAO,iBAAiB,IAAI,EAAE;AAClC;"}
@@ -1,7 +1,7 @@
1
1
  import { GraphFormatError } from "@graphty/graph-format";
2
- import { a8 as COLUMN_AS_PROPERTY_VALUE_CODE, a9 as ROLE_ASSUMED_CODE } from "./report-CgdsL9Hb.js";
3
- import { a as checkCapabilities, L as LOSS } from "./export-CZ7VRm4I.js";
4
- import { b as formatNumber } from "./format-BMS-1Nxb.js";
2
+ import { a8 as COLUMN_AS_PROPERTY_VALUE_CODE, a9 as ROLE_ASSUMED_CODE } from "./report-CwMfYa9J.js";
3
+ import { a as checkCapabilities, L as LOSS } from "./export-Cha4dRFz.js";
4
+ import { b as formatNumber } from "./format-BXiAb-1h.js";
5
5
  const OBO_NODE_COLUMNS = Object.freeze({
6
6
  type: { dtype: "dict" },
7
7
  name: { dtype: "string", role: "label" },
@@ -358,4 +358,4 @@ export {
358
358
  textOf as t,
359
359
  valuesOf as v
360
360
  };
361
- //# sourceMappingURL=ontology-export-BwgMyuF0.js.map
361
+ //# sourceMappingURL=ontology-export-OMo91mb0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ontology-export-BwgMyuF0.js","sources":["../../src/common/ontology.ts","../../src/common/ontology-export.ts"],"sourcesContent":["/**\n * What the OBO importer and the JSON importer's `obographs` dialect share (design section 1.0, the\n * `ontology.ts` building block): the OBO column vocabulary (names, dtypes, roles), so the `.obo` and\n * the `.json` of one ontology give the same columns, and the OBO 1.4 rule for turning the IRIs\n * OBO Graphs writes back into the identifiers the `.obo` file writes (section 4.6).\n */\n\nimport { type ColumnDecl } from \"@graphty/graph-format\";\n\n/** The dtypes the OBO vocabulary uses. */\ntype OboDtype = \"string\" | \"dict\" | \"bool\" | \"list\" | \"json\";\n\n/** One column of the OBO vocabulary. */\ninterface OboColumnSpec {\n /** The dtype. */\n readonly dtype: OboDtype;\n /** The role, when the column carries one. */\n readonly role?: \"label\" | \"kind\" | undefined;\n}\n\n/**\n * The node columns of the OBO vocabulary, keyed by column name (design section 4.2). The names are\n * the OBO tag names, so a Gene Ontology user finds `namespace`, `def` and `is_obsolete` under the\n * names the GO documentation uses.\n * @category Plugin helpers\n */\nexport const OBO_NODE_COLUMNS: Readonly<Record<string, OboColumnSpec>> = Object.freeze({\n type: { dtype: \"dict\" },\n name: { dtype: \"string\", role: \"label\" },\n namespace: { dtype: \"dict\" },\n def: { dtype: \"string\" },\n \"def.xrefs\": { dtype: \"list\" },\n comment: { dtype: \"string\" },\n synonym: { dtype: \"json\" },\n xref: { dtype: \"list\" },\n \"xref.descriptions\": { dtype: \"json\" },\n alt_id: { dtype: \"list\" },\n subset: { dtype: \"list\" },\n replaced_by: { dtype: \"list\" },\n consider: { dtype: \"list\" },\n is_obsolete: { dtype: \"bool\" },\n is_anonymous: { dtype: \"bool\" },\n builtin: { dtype: \"bool\" },\n created_by: { dtype: \"string\" },\n creation_date: { dtype: \"string\" },\n intersection_of: { dtype: \"json\" },\n union_of: { dtype: \"list\" },\n equivalent_to: { dtype: \"list\" },\n disjoint_from: { dtype: \"list\" },\n property_value: { dtype: \"json\" },\n // Typedef frames, under typedefs: \"nodes\"\n domain: { dtype: \"string\" },\n range: { dtype: \"string\" },\n inverse_of: { dtype: \"string\" },\n transitive_over: { dtype: \"list\" },\n disjoint_over: { dtype: \"list\" },\n holds_over_chain: { dtype: \"json\" },\n equivalent_to_chain: { dtype: \"json\" },\n expand_assertion_to: { dtype: \"json\" },\n expand_expression_to: { dtype: \"json\" },\n is_cyclic: { dtype: \"bool\" },\n is_reflexive: { dtype: \"bool\" },\n is_symmetric: { dtype: \"bool\" },\n is_anti_symmetric: { dtype: \"bool\" },\n is_asymmetric: { dtype: \"bool\" },\n is_transitive: { dtype: \"bool\" },\n is_functional: { dtype: \"bool\" },\n is_inverse_functional: { dtype: \"bool\" },\n is_metadata_tag: { dtype: \"bool\" },\n is_class_level: { dtype: \"bool\" },\n // OBO Graphs only\n propertyType: { dtype: \"dict\" },\n // what has no column of its own\n \"obo.qualifiers\": { dtype: \"json\" },\n \"obo.unrecognized\": { dtype: \"json\" },\n});\n\n/** The edge columns of the OBO vocabulary. */\nconst OBO_EDGE_COLUMNS: Readonly<Record<string, OboColumnSpec>> = Object.freeze({\n relation: { dtype: \"dict\", role: \"kind\" },\n qualifiers: { dtype: \"json\" },\n meta: { dtype: \"json\" },\n});\n\n/**\n * The node column that marks a node made for an undeclared reference (design section 4.2).\n * @category Plugin helpers\n */\nexport const PLACEHOLDER_COLUMN = \"graphty.placeholder\";\n\n/**\n * The declaration of an OBO vocabulary column.\n * @param domain - node or edge\n * @param name - the column name (a key of OBO_NODE_COLUMNS / OBO_EDGE_COLUMNS, or the placeholder column)\n * @returns the declaration, nullable, with origin `{ format: \"obo\", id: name }`\n * @category Plugin helpers\n */\nexport function oboColumnDecl(domain: \"node\" | \"edge\", name: string): ColumnDecl {\n if (name === PLACEHOLDER_COLUMN) {\n return { name, dtype: \"bool\", nullable: true, origin: { format: \"graphty\", id: \"placeholder\" } };\n }\n const spec = (domain === \"node\" ? OBO_NODE_COLUMNS : OBO_EDGE_COLUMNS)[name];\n const decl: ColumnDecl = { name, dtype: spec.dtype, nullable: true, origin: { format: \"obo\", id: name } };\n if (spec.dtype === \"list\") {\n decl.itemDtype = \"string\";\n }\n if (spec.role !== undefined) {\n decl.role = spec.role;\n }\n return decl;\n}\n\n/**\n * The OBO PURL base every OBO Foundry IRI starts with.\n * @category Plugin helpers\n */\nexport const OBO_PURL = \"http://purl.obolibrary.org/obo/\"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched\n\n/** The same base under https, which newer OBO Graphs writers use. */\nconst OBO_PURL_HTTPS = \"https://purl.obolibrary.org/obo/\";\n\n/**\n * The oboInOwl namespace of the OBO-to-OWL mapping's annotation properties.\n * @category Plugin helpers\n */\nexport const OBO_IN_OWL = \"http://www.geneontology.org/formats/oboInOwl#\"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched\n\n/**\n * An IRI as the identifier the `.obo` file writes (the OBO 1.4 mapping, section 5.9, read\n * backwards): `http://purl.obolibrary.org/obo/GO_0008150` is `GO:0008150` (the prefix is the text\n * before the first underscore), and `http://purl.obolibrary.org/obo/go#regulates` (how the OWL\n * translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates`; the\n * same under `https://purl.obolibrary.org/obo/`.\n * Every other IRI, and an OBO PURL that fits neither form (`.../obo/T/Female`), is kept.\n * @param iri - the IRI\n * @returns the CURIE or local id, or the IRI unchanged\n * @category Plugin helpers\n */\nexport function compactOboIri(iri: string): string {\n const base = [OBO_PURL, OBO_PURL_HTTPS].find((b) => iri.startsWith(b));\n if (base === undefined) {\n return iri;\n }\n const rest = iri.slice(base.length);\n const hash = rest.indexOf(\"#\");\n if (hash > 0) {\n const local = rest.slice(hash + 1);\n return local.length > 0 && !rest.slice(0, hash).includes(\"/\") ? local : iri;\n }\n const underscore = rest.indexOf(\"_\");\n if (underscore <= 0 || rest.includes(\"/\") || underscore === rest.length - 1) {\n return iri;\n }\n return `${rest.slice(0, underscore)}:${rest.slice(underscore + 1)}`;\n}\n\n/**\n * The OBO synonym scopes.\n * @category Plugin helpers\n */\nexport const SYNONYM_SCOPES: ReadonlySet<string> = new Set([\"EXACT\", \"BROAD\", \"NARROW\", \"RELATED\"]);\n\n/**\n * The OBO synonym scope of an OBO Graphs synonym predicate (`hasExactSynonym`, with or without the\n * oboInOwl namespace).\n * @param pred - the predicate\n * @returns the scope, or null for a predicate that is not one of the four\n * @category Plugin helpers\n */\nexport function synonymScopeOf(pred: string): string | null {\n const local = pred.startsWith(OBO_IN_OWL) ? pred.slice(OBO_IN_OWL.length) : pred;\n const match = /^has(Exact|Broad|Narrow|Related)Synonym$/.exec(local);\n return match === null ? null : match[1].toUpperCase();\n}\n\n/**\n * The OBO tag a `basicPropertyValues` predicate of OBO Graphs came from (the OBO-to-OWL mapping of\n * the tags that are annotations), so the `.json` of an ontology fills the same columns as its\n * `.obo`. `shorthand` is the relation's short name; every predicate not listed is a\n * `property_value`.\n * @category Plugin helpers\n */\nexport const OBOGRAPHS_PREDICATE_TAGS: ReadonlyMap<string, string> = new Map([\n [`${OBO_IN_OWL}hasOBONamespace`, \"namespace\"],\n [`${OBO_IN_OWL}hasAlternativeId`, \"alt_id\"],\n [`${OBO_IN_OWL}created_by`, \"created_by\"],\n [`${OBO_IN_OWL}creation_date`, \"creation_date\"],\n [`${OBO_PURL}IAO_0100001`, \"replaced_by\"],\n [`${OBO_IN_OWL}consider`, \"consider\"],\n [`${OBO_IN_OWL}shorthand`, \"shorthand\"],\n]);\n","/**\n * What the two ontology exporters share (the OBO flat file and the JSON exporter's `obographs`\n * dialect): the snapshot columns that fill the OBO slots (the label as `name`, the edge kind as\n * `relation`), the placeholder nodes a re-import makes again by itself, the order a re-import gives\n * the nodes, and the text of a cell. Both read the snapshot through the column vocabulary of\n * ontology.ts, so a column means the same thing in both files.\n */\n\nimport { type Column, GraphFormatError, type GraphSnapshot } from \"@graphty/graph-format\";\n\nimport { type ExportCapabilities } from \"../types.js\";\nimport { COLUMN_AS_PROPERTY_VALUE_CODE, ROLE_ASSUMED_CODE } from \"./codes.js\";\nimport { checkCapabilities, LOSS } from \"./export.js\";\nimport { formatNumber } from \"./format.js\";\nimport { PLACEHOLDER_COLUMN } from \"./ontology.js\";\nimport { type ResolvedExportOptions } from \"./options.js\";\n\n/**\n * A note recorder.\n * @category Plugin helpers\n */\nexport type NoteFn = (code: string, message: string, column?: string | null, count?: number | null) => void;\n\n/** The generic notes the ontology formats replace with their own (see capabilityNotes()). */\nconst SUPERSEDED: ReadonlySet<string> = new Set([\n LOSS.DTYPE,\n LOSS.LIST,\n LOSS.JSON,\n LOSS.COMPONENTS,\n LOSS.GRAPH_ATTRIBUTES,\n]);\n\n/** The roles the ontology formats have a slot for, and the column names their importers give them. */\nconst SLOT_ROLES: ReadonlySet<string> = new Set([\"label\", \"kind\"]);\nconst NODE_ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({ label: \"name\" });\nconst EDGE_ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({ kind: \"relation\" });\n\n/**\n * The roles whose columns are never written as values (their loss notes come from checkCapabilities()).\n * @category Plugin helpers\n */\nexport const UNWRITTEN_ROLES: ReadonlySet<string> = new Set([\n \"directed\",\n \"pair\",\n \"mutual\",\n \"weight\",\n \"timeText\",\n \"originalId\",\n \"parent\",\n \"parents\",\n \"start\",\n \"end\",\n \"timestamp\",\n \"timestamps\",\n \"spells\",\n \"open\",\n \"spellsOpen\",\n \"position\",\n \"color\",\n \"size\",\n \"shape\",\n \"thickness\",\n]);\n\n/**\n * The OBO frame types.\n * @category Plugin helpers\n */\nexport type FrameKind = \"Term\" | \"Instance\" | \"Typedef\";\n\n/**\n * The frame types as a set, for checking a `type` cell.\n * @category Plugin helpers\n */\nexport const FRAME_KINDS: ReadonlySet<string> = new Set([\"Term\", \"Instance\", \"Typedef\"]);\n\n/**\n * The value of a set cell (a multi-component value as a plain array), or undefined when unset; a\n * declared default is not a value here (the formats have no defaults and say so).\n * @param column - the column\n * @param row - the row\n * @returns the value or undefined\n * @category Plugin helpers\n */\nexport function cellOf(column: Column, row: number): unknown {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value: unknown = column.value(row);\n return ArrayBuffer.isView(value) ? Array.from(value as unknown as ArrayLike<number>) : value;\n}\n\n/**\n * The text of a scalar value: a number by its dtype's shortest round-tripping form (`-0` kept), a\n * boolean as `true` / `false`, a string as it is, anything else as its JSON text.\n * @param value - the value\n * @param dtype - the dtype it came from (the item dtype for a list item)\n * @returns the text\n * @category Plugin helpers\n */\nexport function textOf(value: unknown, dtype: string): string {\n switch (typeof value) {\n case \"string\":\n return value;\n case \"boolean\":\n return value ? \"true\" : \"false\";\n case \"number\":\n return formatNumber(\n value,\n dtype === \"f32\" || dtype === \"i32\" || dtype === \"u32\" || dtype === \"u8\" ? dtype : \"f64\",\n );\n default:\n return JSON.stringify(value) ?? \"null\";\n }\n}\n\n/**\n * Whether a column has the dtype of a vocabulary column (string and dict both fit a text column;\n * the other text dtype is reported, not refused).\n * @param want - the vocabulary dtype\n * @param column - the column\n * @returns true when the column can be written into the vocabulary slot\n * @category Plugin helpers\n */\nexport function fitsVocabulary(want: string, column: Column): boolean {\n switch (want) {\n case \"list\":\n case \"bool\":\n case \"json\":\n return column.dtype === want;\n default:\n return isText(column);\n }\n}\n\n/**\n * The values of a cell that may hold one value or a list of them.\n * @param value - the cell value, or undefined\n * @returns the values\n * @category Plugin helpers\n */\nexport function valuesOf(value: unknown): readonly unknown[] {\n if (value === undefined) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n\n/** A column chosen for an OBO slot. */\ninterface Slot {\n /** The column, or null when the snapshot has none for the slot. */\n readonly column: Column | null;\n /** Whether a role-less column was chosen by its name; it reads back with the role (W_ROLE_ASSUMED). */\n readonly assumed: boolean;\n}\n\n/**\n * The column of a slot: the column with the role when it holds text, else a role-less text column\n * of the slot's name (which the importer reads back with the role).\n * @param table - the node or edge table\n * @param role - the role (`label` for `name`, `kind` for `relation`)\n * @param name - the name the importer gives the slot\n * @returns the column and whether its role is assumed\n * @category Plugin helpers\n */\nexport function slotColumn(table: GraphSnapshot[\"nodes\"], role: \"label\" | \"kind\", name: string): Slot {\n const byRole = table.byRole(role);\n if (byRole !== null) {\n return { column: isText(byRole) ? byRole : null, assumed: false };\n }\n const byName = table.get(name);\n if (byName !== null && byName.meta.role === null && isText(byName)) {\n return { column: byName, assumed: true };\n }\n return { column: null, assumed: false };\n}\n\n/**\n * Whether a column holds text (string or dict).\n * @param column - the column\n * @returns true for string and dict\n */\nfunction isText(column: Column): boolean {\n return column.dtype === \"string\" || column.dtype === \"dict\";\n}\n\n/**\n * The placeholder column (`graphty.placeholder`, a bool), or null.\n * @param snapshot - the snapshot\n * @returns the column\n */\nfunction placeholderColumn(snapshot: GraphSnapshot): Column | null {\n const column = snapshot.nodes.get(PLACEHOLDER_COLUMN);\n return column !== null && column.dtype === \"bool\" ? column : null;\n}\n\n/**\n * The nodes written without a frame (OBO) or a node record (OBO Graphs) because the re-import makes\n * them again as placeholders: a `graphty.placeholder` true cell, no other set cell, an id written\n * as it is, an edge that references it, and (in the flat file, where an edge is written on its\n * source's frame) no edge of its own.\n * @param snapshot - the snapshot\n * @param written - the logical edges written\n * @param options - `outgoingAllowed`: whether a placeholder may be an edge's source; `changed`: whether a node's id is rewritten\n * @param options.outgoingAllowed - whether a placeholder may be an edge's source\n * @param options.changed - whether a node's id is rewritten\n * @returns one flag per node, 1 for a node written without a frame\n * @category Plugin helpers\n */\nexport function framelessNodes(\n snapshot: GraphSnapshot,\n written: readonly number[],\n options: { readonly outgoingAllowed: boolean; readonly changed: (i: number) => boolean },\n): Uint8Array {\n const flags = new Uint8Array(snapshot.nodeCount);\n const placeholder = placeholderColumn(snapshot);\n if (placeholder === null) {\n return flags;\n }\n const { src, dst } = snapshot.edgeList();\n const referenced = new Uint8Array(snapshot.nodeCount);\n const sources = new Uint8Array(snapshot.nodeCount);\n for (const e of written) {\n referenced[dst[e]] = 1;\n if (options.outgoingAllowed) {\n referenced[src[e]] = 1;\n } else {\n sources[src[e]] = 1;\n }\n }\n const others = [...snapshot.nodes].filter((c) => c !== placeholder);\n for (let i = 0; i < snapshot.nodeCount; i++) {\n if (\n placeholder.isSet(i) &&\n placeholder.value(i) === true &&\n referenced[i] === 1 &&\n sources[i] === 0 &&\n !options.changed(i) &&\n others.every((c) => !c.isSet(i))\n ) {\n flags[i] = 1;\n }\n }\n return flags;\n}\n\n/**\n * How many nodes a re-import puts at another index: the written nodes keep their order and the\n * placeholders follow in the order the edges first reference them.\n * @param frameless - the framelessNodes() flags\n * @param references - the node indices in the order the written edges reference them\n * @returns the number of nodes whose index changes\n * @category Plugin helpers\n */\nexport function movedNodes(frameless: Uint8Array, references: Iterable<number>): number {\n const order: number[] = [];\n for (let i = 0; i < frameless.length; i++) {\n if (frameless[i] === 0) {\n order.push(i);\n }\n }\n const seen = new Uint8Array(frameless.length);\n for (const i of references) {\n if (frameless[i] === 1 && seen[i] === 0) {\n seen[i] = 1;\n order.push(i);\n }\n }\n let moved = 0;\n for (let k = 0; k < order.length; k++) {\n if (order[k] !== k) {\n moved++;\n }\n }\n return moved;\n}\n\n/**\n * Whether a value is a qualifier record as the importers make it: a non-empty object of names to a\n * text or a list of two or more texts (a name given once reads back as a text, never as a\n * one-item list), every name passing `nameOk`.\n * @param value - the value\n * @param nameOk - the name rule\n * @returns true when the record is written and read back unchanged\n * @category Plugin helpers\n */\nexport function isQualifierRecord(value: unknown, nameOk: (name: string) => boolean): boolean {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const entries = Object.entries(value);\n return (\n entries.length > 0 &&\n entries.every(\n ([name, v]) =>\n nameOk(name) &&\n (typeof v === \"string\" ||\n (Array.isArray(v) && v.length >= 2 && v.every((item) => typeof item === \"string\"))),\n )\n );\n}\n\n/** What capabilityNotes() needs to know about the export. */\ninterface CapabilityNoteSpec {\n /** The format's capabilities. */\n readonly caps: ExportCapabilities;\n /** The label column written as the name, or null. */\n readonly label: Column | null;\n /** Whether the label is a role-less `name` column. */\n readonly labelAssumed: boolean;\n /** Where an edge column without a slot goes, for messages (\"a qualifier\"). */\n readonly edgeSlot: string;\n /** Records a note. */\n readonly note: NoteFn;\n}\n\n/**\n * The generic notes of checkCapabilities() as the ontology formats see them. No column of the\n * snapshot's own survives as a column (the formats keep only the OBO vocabulary), so the generic\n * dtype, list, json, strides and graph-attribute notes give way to the formats' own, which say\n * where each column goes (a vocabulary column written into its slot needs no note; any other\n * becomes property values, edge qualifiers or metadata). The name-change notes stand only for the\n * label and kind columns actually written into their slot. Added: the roles without a slot (a\n * node kind, an edge label) and a role-less `name` column taking the label role.\n * @param snapshot - the snapshot\n * @param common - the common options\n * @param spec - the export's facts\n * @returns the fatal error of a mixed graph under onMixedDirection \"error\", or null\n * @category Plugin helpers\n */\nexport function capabilityNotes(\n snapshot: GraphSnapshot,\n common: ResolvedExportOptions,\n spec: CapabilityNoteSpec,\n): GraphFormatError | null {\n const { label, note } = spec;\n let fatal: GraphFormatError | null = null;\n const kind = snapshot.edges.byRole(\"kind\");\n // a node label goes into the name slot and an edge kind into the relation slot, when written there;\n // an edge label has no slot (it becomes edge qualifiers or metadata), so it is never renamed\n const extras = {\n roles: SLOT_ROLES,\n nodeRoleNames: label === null ? {} : NODE_ROLE_NAMES,\n edgeRoleNames: kind !== null && isText(kind) ? EDGE_ROLE_NAMES : {},\n };\n for (const gen of checkCapabilities(snapshot, spec.caps, common, extras)) {\n if (SUPERSEDED.has(gen.code)) {\n continue;\n }\n if (gen.code === LOSS.MIXED_DIRECTION_ERROR && fatal === null) {\n fatal = new GraphFormatError(\"E_DIRECTED\", gen.message, { reason: \"mixed direction\" });\n }\n note(gen.code, gen.message, gen.column, gen.count);\n }\n slotlessRoleNotes(snapshot, spec);\n return fatal;\n}\n\n/**\n * Note the roles the ontology formats have no slot for (a node kind, an edge label), and a\n * role-less `name` column taking the label role.\n * @param snapshot - the snapshot\n * @param spec - the export's facts\n */\nfunction slotlessRoleNotes(snapshot: GraphSnapshot, spec: CapabilityNoteSpec): void {\n const { label, note } = spec;\n const nodeKind = snapshot.nodes.byRole(\"kind\");\n if (nodeKind !== null) {\n note(\n LOSS.ROLE,\n `node column \"${nodeKind.meta.name}\" (kind) is written as property values; the format has no node kind slot`,\n nodeKind.meta.name,\n nodeKind.length - nodeKind.nullCount,\n );\n }\n const edgeLabel = snapshot.edges.byRole(\"label\");\n if (edgeLabel !== null) {\n note(\n LOSS.ROLE,\n `edge column \"${edgeLabel.meta.name}\" (label) is written as ${spec.edgeSlot}; the format has no edge label slot`,\n edgeLabel.meta.name,\n edgeLabel.length - edgeLabel.nullCount,\n );\n }\n if (label !== null && spec.labelAssumed) {\n note(\n ROLE_ASSUMED_CODE,\n `node column \"name\" is written as each node's name and reads back as the label`,\n \"name\",\n label.length - label.nullCount,\n );\n }\n}\n\n/**\n * Record the columns that read back absent: a node or edge column without a set cell on a written\n * element (the importers declare a column when a value needs it).\n * @param snapshot - the snapshot\n * @param rows - the written nodes\n * @param frameless - the frameless flags (a placeholder column set only there reads back)\n * @param written - the written edges\n * @param note - records a note\n * @category Plugin helpers\n */\nexport function emptyColumnNotes(\n snapshot: GraphSnapshot,\n rows: readonly number[],\n frameless: Uint8Array,\n written: readonly number[],\n note: NoteFn,\n): void {\n const tables = [\n [\n \"node\",\n snapshot.nodes,\n (c: Column): boolean =>\n rows.some((i) => c.isSet(i)) ||\n (c.meta.name === PLACEHOLDER_COLUMN && frameless.some((f, i) => f === 1 && c.isSet(i))),\n ],\n [\"edge\", snapshot.edges, (c: Column): boolean => written.some((e) => c.isSet(e))],\n ] as const;\n for (const [domain, table, used] of tables) {\n for (const column of table) {\n const { role, name } = column.meta;\n if (\n (role !== null && (UNWRITTEN_ROLES.has(role) || (domain === \"edge\" && role === \"id\"))) ||\n used(column)\n ) {\n continue;\n }\n note(LOSS.EMPTY_COLUMN, `${domain} column \"${name}\" has no value to write; it reads back absent`, name, 0);\n }\n }\n}\n\n/**\n * Record the note of a node column written as property values.\n * @param note - the recorder\n * @param column - the column\n * @param rows - the written nodes\n * @param how - how the values are written, for the message\n * @category Plugin helpers\n */\nexport function notePropertyColumn(note: NoteFn, column: Column, rows: readonly number[], how: string): void {\n const count = rows.filter((i) => column.isSet(i)).length;\n if (count === 0) {\n return;\n }\n const role = column.meta.role === null ? \"\" : ` (its ${column.meta.role} role is lost)`;\n note(\n COLUMN_AS_PROPERTY_VALUE_CODE,\n `node column \"${column.meta.name}\" is written as ${how} and reads back inside the property_value column, not as its own column${role}`,\n column.meta.name,\n count,\n );\n}\n"],"names":[],"mappings":";;;;AA0BO,MAAM,mBAA4D,OAAO,OAAO;AAAA,EACnF,MAAM,EAAE,OAAO,OAAA;AAAA,EACf,MAAM,EAAE,OAAO,UAAU,MAAM,QAAA;AAAA,EAC/B,WAAW,EAAE,OAAO,OAAA;AAAA,EACpB,KAAK,EAAE,OAAO,SAAA;AAAA,EACd,aAAa,EAAE,OAAO,OAAA;AAAA,EACtB,SAAS,EAAE,OAAO,SAAA;AAAA,EAClB,SAAS,EAAE,OAAO,OAAA;AAAA,EAClB,MAAM,EAAE,OAAO,OAAA;AAAA,EACf,qBAAqB,EAAE,OAAO,OAAA;AAAA,EAC9B,QAAQ,EAAE,OAAO,OAAA;AAAA,EACjB,QAAQ,EAAE,OAAO,OAAA;AAAA,EACjB,aAAa,EAAE,OAAO,OAAA;AAAA,EACtB,UAAU,EAAE,OAAO,OAAA;AAAA,EACnB,aAAa,EAAE,OAAO,OAAA;AAAA,EACtB,cAAc,EAAE,OAAO,OAAA;AAAA,EACvB,SAAS,EAAE,OAAO,OAAA;AAAA,EAClB,YAAY,EAAE,OAAO,SAAA;AAAA,EACrB,eAAe,EAAE,OAAO,SAAA;AAAA,EACxB,iBAAiB,EAAE,OAAO,O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B,UACK,SAAS,SAAS,gBAAgB,IAAI,IAAI,KAAM,WAAW,UAAU,SAAS,SAC/E,KAAK,MAAM,GACb;AACE;AAAA,MACJ;AACA,WAAK,KAAK,cAAc,GAAG,MAAM,YAAY,IAAI,iDAAiD,MAAM,CAAC;AAAA,IAC7G;AAAA,EACJ;AACJ;AAUO,SAAS,mBAAmB,MAAc,QAAgB,MAAyB,KAAmB;AACzG,QAAM,QAAQ,KAAK,OAAO,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC,EAAE;AAClD,MAAI,UAAU,GAAG;AACb;AAAA,EACJ;AACA,QAAM,OAAO,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,IAAI;AACvE;AAAA,IACI;AAAA,IACA,gBAAgB,OAAO,KAAK,IAAI,mBAAmB,GAAG,0EAA0E,IAAI;AAAA,IACpI,OAAO,KAAK;AAAA,IACZ;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"ontology-export-OMo91mb0.js","sources":["../../src/common/ontology.ts","../../src/common/ontology-export.ts"],"sourcesContent":["/**\n * What the OBO importer and the JSON importer's `obographs` dialect share (design section 1.0, the\n * `ontology.ts` building block): the OBO column vocabulary (names, dtypes, roles), so the `.obo` and\n * the `.json` of one ontology give the same columns, and the OBO 1.4 rule for turning the IRIs\n * OBO Graphs writes back into the identifiers the `.obo` file writes (section 4.6).\n */\n\nimport { type ColumnDecl } from \"@graphty/graph-format\";\n\n/** The dtypes the OBO vocabulary uses. */\ntype OboDtype = \"string\" | \"dict\" | \"bool\" | \"list\" | \"json\";\n\n/** One column of the OBO vocabulary. */\ninterface OboColumnSpec {\n /** The dtype. */\n readonly dtype: OboDtype;\n /** The role, when the column carries one. */\n readonly role?: \"label\" | \"kind\" | undefined;\n}\n\n/**\n * The node columns of the OBO vocabulary, keyed by column name (design section 4.2). The names are\n * the OBO tag names, so a Gene Ontology user finds `namespace`, `def` and `is_obsolete` under the\n * names the GO documentation uses.\n * @category Plugin helpers\n */\nexport const OBO_NODE_COLUMNS: Readonly<Record<string, OboColumnSpec>> = Object.freeze({\n type: { dtype: \"dict\" },\n name: { dtype: \"string\", role: \"label\" },\n namespace: { dtype: \"dict\" },\n def: { dtype: \"string\" },\n \"def.xrefs\": { dtype: \"list\" },\n comment: { dtype: \"string\" },\n synonym: { dtype: \"json\" },\n xref: { dtype: \"list\" },\n \"xref.descriptions\": { dtype: \"json\" },\n alt_id: { dtype: \"list\" },\n subset: { dtype: \"list\" },\n replaced_by: { dtype: \"list\" },\n consider: { dtype: \"list\" },\n is_obsolete: { dtype: \"bool\" },\n is_anonymous: { dtype: \"bool\" },\n builtin: { dtype: \"bool\" },\n created_by: { dtype: \"string\" },\n creation_date: { dtype: \"string\" },\n intersection_of: { dtype: \"json\" },\n union_of: { dtype: \"list\" },\n equivalent_to: { dtype: \"list\" },\n disjoint_from: { dtype: \"list\" },\n property_value: { dtype: \"json\" },\n // Typedef frames, under typedefs: \"nodes\"\n domain: { dtype: \"string\" },\n range: { dtype: \"string\" },\n inverse_of: { dtype: \"string\" },\n transitive_over: { dtype: \"list\" },\n disjoint_over: { dtype: \"list\" },\n holds_over_chain: { dtype: \"json\" },\n equivalent_to_chain: { dtype: \"json\" },\n expand_assertion_to: { dtype: \"json\" },\n expand_expression_to: { dtype: \"json\" },\n is_cyclic: { dtype: \"bool\" },\n is_reflexive: { dtype: \"bool\" },\n is_symmetric: { dtype: \"bool\" },\n is_anti_symmetric: { dtype: \"bool\" },\n is_asymmetric: { dtype: \"bool\" },\n is_transitive: { dtype: \"bool\" },\n is_functional: { dtype: \"bool\" },\n is_inverse_functional: { dtype: \"bool\" },\n is_metadata_tag: { dtype: \"bool\" },\n is_class_level: { dtype: \"bool\" },\n // OBO Graphs only\n propertyType: { dtype: \"dict\" },\n // what has no column of its own\n \"obo.qualifiers\": { dtype: \"json\" },\n \"obo.unrecognized\": { dtype: \"json\" },\n});\n\n/** The edge columns of the OBO vocabulary. */\nconst OBO_EDGE_COLUMNS: Readonly<Record<string, OboColumnSpec>> = Object.freeze({\n relation: { dtype: \"dict\", role: \"kind\" },\n qualifiers: { dtype: \"json\" },\n meta: { dtype: \"json\" },\n});\n\n/**\n * The node column that marks a node made for an undeclared reference (design section 4.2).\n * @category Plugin helpers\n */\nexport const PLACEHOLDER_COLUMN = \"graphty.placeholder\";\n\n/**\n * The declaration of an OBO vocabulary column.\n * @param domain - node or edge\n * @param name - the column name (a key of OBO_NODE_COLUMNS / OBO_EDGE_COLUMNS, or the placeholder column)\n * @returns the declaration, nullable, with origin `{ format: \"obo\", id: name }`\n * @category Plugin helpers\n */\nexport function oboColumnDecl(domain: \"node\" | \"edge\", name: string): ColumnDecl {\n if (name === PLACEHOLDER_COLUMN) {\n return { name, dtype: \"bool\", nullable: true, origin: { format: \"graphty\", id: \"placeholder\" } };\n }\n const spec = (domain === \"node\" ? OBO_NODE_COLUMNS : OBO_EDGE_COLUMNS)[name];\n const decl: ColumnDecl = { name, dtype: spec.dtype, nullable: true, origin: { format: \"obo\", id: name } };\n if (spec.dtype === \"list\") {\n decl.itemDtype = \"string\";\n }\n if (spec.role !== undefined) {\n decl.role = spec.role;\n }\n return decl;\n}\n\n/**\n * The OBO PURL base every OBO Foundry IRI starts with.\n * @category Plugin helpers\n */\nexport const OBO_PURL = \"http://purl.obolibrary.org/obo/\"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched\n\n/** The same base under https, which newer OBO Graphs writers use. */\nconst OBO_PURL_HTTPS = \"https://purl.obolibrary.org/obo/\";\n\n/**\n * The oboInOwl namespace of the OBO-to-OWL mapping's annotation properties.\n * @category Plugin helpers\n */\nexport const OBO_IN_OWL = \"http://www.geneontology.org/formats/oboInOwl#\"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched\n\n/**\n * An IRI as the identifier the `.obo` file writes (the OBO 1.4 mapping, section 5.9, read\n * backwards): `http://purl.obolibrary.org/obo/GO_0008150` is `GO:0008150` (the prefix is the text\n * before the first underscore), and `http://purl.obolibrary.org/obo/go#regulates` (how the OWL\n * translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates`; the\n * same under `https://purl.obolibrary.org/obo/`.\n * Every other IRI, and an OBO PURL that fits neither form (`.../obo/T/Female`), is kept.\n * @param iri - the IRI\n * @returns the CURIE or local id, or the IRI unchanged\n * @category Plugin helpers\n */\nexport function compactOboIri(iri: string): string {\n const base = [OBO_PURL, OBO_PURL_HTTPS].find((b) => iri.startsWith(b));\n if (base === undefined) {\n return iri;\n }\n const rest = iri.slice(base.length);\n const hash = rest.indexOf(\"#\");\n if (hash > 0) {\n const local = rest.slice(hash + 1);\n return local.length > 0 && !rest.slice(0, hash).includes(\"/\") ? local : iri;\n }\n const underscore = rest.indexOf(\"_\");\n if (underscore <= 0 || rest.includes(\"/\") || underscore === rest.length - 1) {\n return iri;\n }\n return `${rest.slice(0, underscore)}:${rest.slice(underscore + 1)}`;\n}\n\n/**\n * The OBO synonym scopes.\n * @category Plugin helpers\n */\nexport const SYNONYM_SCOPES: ReadonlySet<string> = new Set([\"EXACT\", \"BROAD\", \"NARROW\", \"RELATED\"]);\n\n/**\n * The OBO synonym scope of an OBO Graphs synonym predicate (`hasExactSynonym`, with or without the\n * oboInOwl namespace).\n * @param pred - the predicate\n * @returns the scope, or null for a predicate that is not one of the four\n * @category Plugin helpers\n */\nexport function synonymScopeOf(pred: string): string | null {\n const local = pred.startsWith(OBO_IN_OWL) ? pred.slice(OBO_IN_OWL.length) : pred;\n const match = /^has(Exact|Broad|Narrow|Related)Synonym$/.exec(local);\n return match === null ? null : match[1].toUpperCase();\n}\n\n/**\n * The OBO tag a `basicPropertyValues` predicate of OBO Graphs came from (the OBO-to-OWL mapping of\n * the tags that are annotations), so the `.json` of an ontology fills the same columns as its\n * `.obo`. `shorthand` is the relation's short name; every predicate not listed is a\n * `property_value`.\n * @category Plugin helpers\n */\nexport const OBOGRAPHS_PREDICATE_TAGS: ReadonlyMap<string, string> = new Map([\n [`${OBO_IN_OWL}hasOBONamespace`, \"namespace\"],\n [`${OBO_IN_OWL}hasAlternativeId`, \"alt_id\"],\n [`${OBO_IN_OWL}created_by`, \"created_by\"],\n [`${OBO_IN_OWL}creation_date`, \"creation_date\"],\n [`${OBO_PURL}IAO_0100001`, \"replaced_by\"],\n [`${OBO_IN_OWL}consider`, \"consider\"],\n [`${OBO_IN_OWL}shorthand`, \"shorthand\"],\n]);\n","/**\n * What the two ontology exporters share (the OBO flat file and the JSON exporter's `obographs`\n * dialect): the snapshot columns that fill the OBO slots (the label as `name`, the edge kind as\n * `relation`), the placeholder nodes a re-import makes again by itself, the order a re-import gives\n * the nodes, and the text of a cell. Both read the snapshot through the column vocabulary of\n * ontology.ts, so a column means the same thing in both files.\n */\n\nimport { type Column, GraphFormatError, type GraphSnapshot } from \"@graphty/graph-format\";\n\nimport { type ExportCapabilities } from \"../types.js\";\nimport { COLUMN_AS_PROPERTY_VALUE_CODE, ROLE_ASSUMED_CODE } from \"./codes.js\";\nimport { checkCapabilities, LOSS } from \"./export.js\";\nimport { formatNumber } from \"./format.js\";\nimport { PLACEHOLDER_COLUMN } from \"./ontology.js\";\nimport { type ResolvedExportOptions } from \"./options.js\";\n\n/**\n * A note recorder.\n * @category Plugin helpers\n */\nexport type NoteFn = (code: string, message: string, column?: string | null, count?: number | null) => void;\n\n/** The generic notes the ontology formats replace with their own (see capabilityNotes()). */\nconst SUPERSEDED: ReadonlySet<string> = new Set([\n LOSS.DTYPE,\n LOSS.LIST,\n LOSS.JSON,\n LOSS.COMPONENTS,\n LOSS.GRAPH_ATTRIBUTES,\n]);\n\n/** The roles the ontology formats have a slot for, and the column names their importers give them. */\nconst SLOT_ROLES: ReadonlySet<string> = new Set([\"label\", \"kind\"]);\nconst NODE_ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({ label: \"name\" });\nconst EDGE_ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({ kind: \"relation\" });\n\n/**\n * The roles whose columns are never written as values (their loss notes come from checkCapabilities()).\n * @category Plugin helpers\n */\nexport const UNWRITTEN_ROLES: ReadonlySet<string> = new Set([\n \"directed\",\n \"pair\",\n \"mutual\",\n \"weight\",\n \"timeText\",\n \"originalId\",\n \"parent\",\n \"parents\",\n \"start\",\n \"end\",\n \"timestamp\",\n \"timestamps\",\n \"spells\",\n \"open\",\n \"spellsOpen\",\n \"position\",\n \"color\",\n \"size\",\n \"shape\",\n \"thickness\",\n]);\n\n/**\n * The OBO frame types.\n * @category Plugin helpers\n */\nexport type FrameKind = \"Term\" | \"Instance\" | \"Typedef\";\n\n/**\n * The frame types as a set, for checking a `type` cell.\n * @category Plugin helpers\n */\nexport const FRAME_KINDS: ReadonlySet<string> = new Set([\"Term\", \"Instance\", \"Typedef\"]);\n\n/**\n * The value of a set cell (a multi-component value as a plain array), or undefined when unset; a\n * declared default is not a value here (the formats have no defaults and say so).\n * @param column - the column\n * @param row - the row\n * @returns the value or undefined\n * @category Plugin helpers\n */\nexport function cellOf(column: Column, row: number): unknown {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value: unknown = column.value(row);\n return ArrayBuffer.isView(value) ? Array.from(value as unknown as ArrayLike<number>) : value;\n}\n\n/**\n * The text of a scalar value: a number by its dtype's shortest round-tripping form (`-0` kept), a\n * boolean as `true` / `false`, a string as it is, anything else as its JSON text.\n * @param value - the value\n * @param dtype - the dtype it came from (the item dtype for a list item)\n * @returns the text\n * @category Plugin helpers\n */\nexport function textOf(value: unknown, dtype: string): string {\n switch (typeof value) {\n case \"string\":\n return value;\n case \"boolean\":\n return value ? \"true\" : \"false\";\n case \"number\":\n return formatNumber(\n value,\n dtype === \"f32\" || dtype === \"i32\" || dtype === \"u32\" || dtype === \"u8\" ? dtype : \"f64\",\n );\n default:\n return JSON.stringify(value) ?? \"null\";\n }\n}\n\n/**\n * Whether a column has the dtype of a vocabulary column (string and dict both fit a text column;\n * the other text dtype is reported, not refused).\n * @param want - the vocabulary dtype\n * @param column - the column\n * @returns true when the column can be written into the vocabulary slot\n * @category Plugin helpers\n */\nexport function fitsVocabulary(want: string, column: Column): boolean {\n switch (want) {\n case \"list\":\n case \"bool\":\n case \"json\":\n return column.dtype === want;\n default:\n return isText(column);\n }\n}\n\n/**\n * The values of a cell that may hold one value or a list of them.\n * @param value - the cell value, or undefined\n * @returns the values\n * @category Plugin helpers\n */\nexport function valuesOf(value: unknown): readonly unknown[] {\n if (value === undefined) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n\n/** A column chosen for an OBO slot. */\ninterface Slot {\n /** The column, or null when the snapshot has none for the slot. */\n readonly column: Column | null;\n /** Whether a role-less column was chosen by its name; it reads back with the role (W_ROLE_ASSUMED). */\n readonly assumed: boolean;\n}\n\n/**\n * The column of a slot: the column with the role when it holds text, else a role-less text column\n * of the slot's name (which the importer reads back with the role).\n * @param table - the node or edge table\n * @param role - the role (`label` for `name`, `kind` for `relation`)\n * @param name - the name the importer gives the slot\n * @returns the column and whether its role is assumed\n * @category Plugin helpers\n */\nexport function slotColumn(table: GraphSnapshot[\"nodes\"], role: \"label\" | \"kind\", name: string): Slot {\n const byRole = table.byRole(role);\n if (byRole !== null) {\n return { column: isText(byRole) ? byRole : null, assumed: false };\n }\n const byName = table.get(name);\n if (byName !== null && byName.meta.role === null && isText(byName)) {\n return { column: byName, assumed: true };\n }\n return { column: null, assumed: false };\n}\n\n/**\n * Whether a column holds text (string or dict).\n * @param column - the column\n * @returns true for string and dict\n */\nfunction isText(column: Column): boolean {\n return column.dtype === \"string\" || column.dtype === \"dict\";\n}\n\n/**\n * The placeholder column (`graphty.placeholder`, a bool), or null.\n * @param snapshot - the snapshot\n * @returns the column\n */\nfunction placeholderColumn(snapshot: GraphSnapshot): Column | null {\n const column = snapshot.nodes.get(PLACEHOLDER_COLUMN);\n return column !== null && column.dtype === \"bool\" ? column : null;\n}\n\n/**\n * The nodes written without a frame (OBO) or a node record (OBO Graphs) because the re-import makes\n * them again as placeholders: a `graphty.placeholder` true cell, no other set cell, an id written\n * as it is, an edge that references it, and (in the flat file, where an edge is written on its\n * source's frame) no edge of its own.\n * @param snapshot - the snapshot\n * @param written - the logical edges written\n * @param options - `outgoingAllowed`: whether a placeholder may be an edge's source; `changed`: whether a node's id is rewritten\n * @param options.outgoingAllowed - whether a placeholder may be an edge's source\n * @param options.changed - whether a node's id is rewritten\n * @returns one flag per node, 1 for a node written without a frame\n * @category Plugin helpers\n */\nexport function framelessNodes(\n snapshot: GraphSnapshot,\n written: readonly number[],\n options: { readonly outgoingAllowed: boolean; readonly changed: (i: number) => boolean },\n): Uint8Array {\n const flags = new Uint8Array(snapshot.nodeCount);\n const placeholder = placeholderColumn(snapshot);\n if (placeholder === null) {\n return flags;\n }\n const { src, dst } = snapshot.edgeList();\n const referenced = new Uint8Array(snapshot.nodeCount);\n const sources = new Uint8Array(snapshot.nodeCount);\n for (const e of written) {\n referenced[dst[e]] = 1;\n if (options.outgoingAllowed) {\n referenced[src[e]] = 1;\n } else {\n sources[src[e]] = 1;\n }\n }\n const others = [...snapshot.nodes].filter((c) => c !== placeholder);\n for (let i = 0; i < snapshot.nodeCount; i++) {\n if (\n placeholder.isSet(i) &&\n placeholder.value(i) === true &&\n referenced[i] === 1 &&\n sources[i] === 0 &&\n !options.changed(i) &&\n others.every((c) => !c.isSet(i))\n ) {\n flags[i] = 1;\n }\n }\n return flags;\n}\n\n/**\n * How many nodes a re-import puts at another index: the written nodes keep their order and the\n * placeholders follow in the order the edges first reference them.\n * @param frameless - the framelessNodes() flags\n * @param references - the node indices in the order the written edges reference them\n * @returns the number of nodes whose index changes\n * @category Plugin helpers\n */\nexport function movedNodes(frameless: Uint8Array, references: Iterable<number>): number {\n const order: number[] = [];\n for (let i = 0; i < frameless.length; i++) {\n if (frameless[i] === 0) {\n order.push(i);\n }\n }\n const seen = new Uint8Array(frameless.length);\n for (const i of references) {\n if (frameless[i] === 1 && seen[i] === 0) {\n seen[i] = 1;\n order.push(i);\n }\n }\n let moved = 0;\n for (let k = 0; k < order.length; k++) {\n if (order[k] !== k) {\n moved++;\n }\n }\n return moved;\n}\n\n/**\n * Whether a value is a qualifier record as the importers make it: a non-empty object of names to a\n * text or a list of two or more texts (a name given once reads back as a text, never as a\n * one-item list), every name passing `nameOk`.\n * @param value - the value\n * @param nameOk - the name rule\n * @returns true when the record is written and read back unchanged\n * @category Plugin helpers\n */\nexport function isQualifierRecord(value: unknown, nameOk: (name: string) => boolean): boolean {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const entries = Object.entries(value);\n return (\n entries.length > 0 &&\n entries.every(\n ([name, v]) =>\n nameOk(name) &&\n (typeof v === \"string\" ||\n (Array.isArray(v) && v.length >= 2 && v.every((item) => typeof item === \"string\"))),\n )\n );\n}\n\n/** What capabilityNotes() needs to know about the export. */\ninterface CapabilityNoteSpec {\n /** The format's capabilities. */\n readonly caps: ExportCapabilities;\n /** The label column written as the name, or null. */\n readonly label: Column | null;\n /** Whether the label is a role-less `name` column. */\n readonly labelAssumed: boolean;\n /** Where an edge column without a slot goes, for messages (\"a qualifier\"). */\n readonly edgeSlot: string;\n /** Records a note. */\n readonly note: NoteFn;\n}\n\n/**\n * The generic notes of checkCapabilities() as the ontology formats see them. No column of the\n * snapshot's own survives as a column (the formats keep only the OBO vocabulary), so the generic\n * dtype, list, json, strides and graph-attribute notes give way to the formats' own, which say\n * where each column goes (a vocabulary column written into its slot needs no note; any other\n * becomes property values, edge qualifiers or metadata). The name-change notes stand only for the\n * label and kind columns actually written into their slot. Added: the roles without a slot (a\n * node kind, an edge label) and a role-less `name` column taking the label role.\n * @param snapshot - the snapshot\n * @param common - the common options\n * @param spec - the export's facts\n * @returns the fatal error of a mixed graph under onMixedDirection \"error\", or null\n * @category Plugin helpers\n */\nexport function capabilityNotes(\n snapshot: GraphSnapshot,\n common: ResolvedExportOptions,\n spec: CapabilityNoteSpec,\n): GraphFormatError | null {\n const { label, note } = spec;\n let fatal: GraphFormatError | null = null;\n const kind = snapshot.edges.byRole(\"kind\");\n // a node label goes into the name slot and an edge kind into the relation slot, when written there;\n // an edge label has no slot (it becomes edge qualifiers or metadata), so it is never renamed\n const extras = {\n roles: SLOT_ROLES,\n nodeRoleNames: label === null ? {} : NODE_ROLE_NAMES,\n edgeRoleNames: kind !== null && isText(kind) ? EDGE_ROLE_NAMES : {},\n };\n for (const gen of checkCapabilities(snapshot, spec.caps, common, extras)) {\n if (SUPERSEDED.has(gen.code)) {\n continue;\n }\n if (gen.code === LOSS.MIXED_DIRECTION_ERROR && fatal === null) {\n fatal = new GraphFormatError(\"E_DIRECTED\", gen.message, { reason: \"mixed direction\" });\n }\n note(gen.code, gen.message, gen.column, gen.count);\n }\n slotlessRoleNotes(snapshot, spec);\n return fatal;\n}\n\n/**\n * Note the roles the ontology formats have no slot for (a node kind, an edge label), and a\n * role-less `name` column taking the label role.\n * @param snapshot - the snapshot\n * @param spec - the export's facts\n */\nfunction slotlessRoleNotes(snapshot: GraphSnapshot, spec: CapabilityNoteSpec): void {\n const { label, note } = spec;\n const nodeKind = snapshot.nodes.byRole(\"kind\");\n if (nodeKind !== null) {\n note(\n LOSS.ROLE,\n `node column \"${nodeKind.meta.name}\" (kind) is written as property values; the format has no node kind slot`,\n nodeKind.meta.name,\n nodeKind.length - nodeKind.nullCount,\n );\n }\n const edgeLabel = snapshot.edges.byRole(\"label\");\n if (edgeLabel !== null) {\n note(\n LOSS.ROLE,\n `edge column \"${edgeLabel.meta.name}\" (label) is written as ${spec.edgeSlot}; the format has no edge label slot`,\n edgeLabel.meta.name,\n edgeLabel.length - edgeLabel.nullCount,\n );\n }\n if (label !== null && spec.labelAssumed) {\n note(\n ROLE_ASSUMED_CODE,\n `node column \"name\" is written as each node's name and reads back as the label`,\n \"name\",\n label.length - label.nullCount,\n );\n }\n}\n\n/**\n * Record the columns that read back absent: a node or edge column without a set cell on a written\n * element (the importers declare a column when a value needs it).\n * @param snapshot - the snapshot\n * @param rows - the written nodes\n * @param frameless - the frameless flags (a placeholder column set only there reads back)\n * @param written - the written edges\n * @param note - records a note\n * @category Plugin helpers\n */\nexport function emptyColumnNotes(\n snapshot: GraphSnapshot,\n rows: readonly number[],\n frameless: Uint8Array,\n written: readonly number[],\n note: NoteFn,\n): void {\n const tables = [\n [\n \"node\",\n snapshot.nodes,\n (c: Column): boolean =>\n rows.some((i) => c.isSet(i)) ||\n (c.meta.name === PLACEHOLDER_COLUMN && frameless.some((f, i) => f === 1 && c.isSet(i))),\n ],\n [\"edge\", snapshot.edges, (c: Column): boolean => written.some((e) => c.isSet(e))],\n ] as const;\n for (const [domain, table, used] of tables) {\n for (const column of table) {\n const { role, name } = column.meta;\n if (\n (role !== null && (UNWRITTEN_ROLES.has(role) || (domain === \"edge\" && role === \"id\"))) ||\n used(column)\n ) {\n continue;\n }\n note(LOSS.EMPTY_COLUMN, `${domain} column \"${name}\" has no value to write; it reads back absent`, name, 0);\n }\n }\n}\n\n/**\n * Record the note of a node column written as property values.\n * @param note - the recorder\n * @param column - the column\n * @param rows - the written nodes\n * @param how - how the values are written, for the message\n * @category Plugin helpers\n */\nexport function notePropertyColumn(note: NoteFn, column: Column, rows: readonly number[], how: string): void {\n const count = rows.filter((i) => column.isSet(i)).length;\n if (count === 0) {\n return;\n }\n const role = column.meta.role === null ? \"\" : ` (its ${column.meta.role} role is lost)`;\n note(\n COLUMN_AS_PROPERTY_VALUE_CODE,\n `node column \"${column.meta.name}\" is written as ${how} and reads back inside the property_value column, not as its own column${role}`,\n column.meta.name,\n count,\n );\n}\n"],"names":[],"mappings":";;;;AA0BO,MAAM,mBAA4D,OAAO,OAAO;AAAA,EACnF,MAAM,EAAE,OAAO,OAAA;AAAA,EACf,MAAM,EAAE,OAAO,UAAU,MAAM,QAAA;AAAA,EAC/B,WAAW,EAAE,OAAO,OAAA;AAAA,EACpB,KAAK,EAAE,OAAO,SAAA;AAAA,EACd,aAAa,EAAE,OAAO,OAAA;AAAA,EACtB,SAAS,EAAE,OAAO,SAAA;AAAA,EAClB,SAAS,EAAE,OAAO,OAAA;AAAA,EAClB,MAAM,EAAE,OAAO,OAAA;A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K,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAC1B,EAAE,KAAK,SAAS,sBAAsB,UAAU,KAAK,CAAC,GAAG,MAAM,MAAM,KAAK,EAAE,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,IAE7F,CAAC,QAAQ,SAAS,OAAO,CAAC,MAAuB,QAAQ,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAAA,EAAA;AAEpF,aAAW,CAAC,QAAQ,OAAO,IAAI,KAAK,QAAQ;AACxC,eAAW,UAAU,OAAO;AACxB,YAAM,EAAE,MAAM,KAAA,IAAS,OAAO;AAC9B,UACK,SAAS,SAAS,gBAAgB,IAAI,IAAI,KAAM,WAAW,UAAU,SAAS,SAC/E,KAAK,MAAM,GACb;AACE;AAAA,MACJ;AACA,WAAK,KAAK,cAAc,GAAG,MAAM,YAAY,IAAI,iDAAiD,MAAM,CAAC;AAAA,IAC7G;AAAA,EACJ;AACJ;AAUO,SAAS,mBAAmB,MAAc,QAAgB,MAAyB,KAAmB;AACzG,QAAM,QAAQ,KAAK,OAAO,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC,EAAE;AAClD,MAAI,UAAU,GAAG;AACb;AAAA,EACJ;AACA,QAAM,OAAO,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,IAAI;AACvE;AAAA,IACI;AAAA,IACA,gBAAgB,OAAO,KAAK,IAAI,mBAAmB,GAAG,0EAA0E,IAAI;AAAA,IACpI,OAAO,KAAK;AAAA,IACZ;AAAA,EAAA;AAER;"}
@@ -1,5 +1,5 @@
1
1
  import { GraphFormatError } from "@graphty/graph-format";
2
- import { t as textChunks, M as MAX_TEXT_LENGTH, a as tooLarge } from "./input-Ccg9I22A.js";
2
+ import { t as textChunks, M as MAX_TEXT_LENGTH, a as tooLarge } from "./input-CAxt_aV-.js";
3
3
  const UNCLOSED_QUOTE_CODE = "E_CSV_UNCLOSED_QUOTE";
4
4
  const BAD_QUOTE_CODE = "E_CSV_QUOTE";
5
5
  const DELIMITER_CANDIDATES = Object.freeze([",", " ", ";", "|", " "]);
@@ -873,4 +873,4 @@ export {
873
873
  splitRecords as d,
874
874
  stripLeadingComments as s
875
875
  };
876
- //# sourceMappingURL=records-Cgvxz-Vx.js.map
876
+ //# sourceMappingURL=records-NJiYvekn.js.map