@nfdi4plants/arctrl 1.0.0-alpha10

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 (296) hide show
  1. package/ARC.js +262 -0
  2. package/Contract/Contract.js +95 -0
  3. package/Contracts/Contracts.ARCtrl.js +35 -0
  4. package/Contracts/Contracts.ArcAssay.js +65 -0
  5. package/Contracts/Contracts.ArcInvestigation.js +58 -0
  6. package/Contracts/Contracts.ArcStudy.js +65 -0
  7. package/Contracts/Contracts.Git.js +91 -0
  8. package/FileSystem/Commit.js +18 -0
  9. package/FileSystem/DefaultGitignore.js +3 -0
  10. package/FileSystem/FileSystem.js +53 -0
  11. package/FileSystem/FileSystemTree.js +223 -0
  12. package/FileSystem/Path.js +38 -0
  13. package/FileSystemTree.js +51 -0
  14. package/ISA/ISA/ArcTypes/ArcTable.js +848 -0
  15. package/ISA/ISA/ArcTypes/ArcTableAux.js +1105 -0
  16. package/ISA/ISA/ArcTypes/ArcTables.js +479 -0
  17. package/ISA/ISA/ArcTypes/ArcTypes.js +2281 -0
  18. package/ISA/ISA/ArcTypes/CompositeCell.js +180 -0
  19. package/ISA/ISA/ArcTypes/CompositeColumn.js +48 -0
  20. package/ISA/ISA/ArcTypes/CompositeHeader.js +668 -0
  21. package/ISA/ISA/ArcTypes/CompositeRow.js +111 -0
  22. package/ISA/ISA/ArcTypes/IdentifierSetters.js +26 -0
  23. package/ISA/ISA/Builder/Types.js +243 -0
  24. package/ISA/ISA/Fable.js +50 -0
  25. package/ISA/ISA/Helper.js +338 -0
  26. package/ISA/ISA/Identifier.js +76 -0
  27. package/ISA/ISA/JsonTypes/AnnotationValue.js +56 -0
  28. package/ISA/ISA/JsonTypes/Assay.js +620 -0
  29. package/ISA/ISA/JsonTypes/AssayMaterials.js +39 -0
  30. package/ISA/ISA/JsonTypes/ColumnIndex.js +246 -0
  31. package/ISA/ISA/JsonTypes/Comment.js +58 -0
  32. package/ISA/ISA/JsonTypes/CommentList.js +139 -0
  33. package/ISA/ISA/JsonTypes/Component.js +158 -0
  34. package/ISA/ISA/JsonTypes/Data.js +55 -0
  35. package/ISA/ISA/JsonTypes/DataFile.js +68 -0
  36. package/ISA/ISA/JsonTypes/Factor.js +128 -0
  37. package/ISA/ISA/JsonTypes/FactorValue.js +109 -0
  38. package/ISA/ISA/JsonTypes/Investigation.js +204 -0
  39. package/ISA/ISA/JsonTypes/Material.js +66 -0
  40. package/ISA/ISA/JsonTypes/MaterialAttribute.js +101 -0
  41. package/ISA/ISA/JsonTypes/MaterialAttributeValue.js +126 -0
  42. package/ISA/ISA/JsonTypes/MaterialType.js +41 -0
  43. package/ISA/ISA/JsonTypes/OntologyAnnotation.js +219 -0
  44. package/ISA/ISA/JsonTypes/OntologySourceReference.js +85 -0
  45. package/ISA/ISA/JsonTypes/Person.js +137 -0
  46. package/ISA/ISA/JsonTypes/Process.js +401 -0
  47. package/ISA/ISA/JsonTypes/ProcessInput.js +297 -0
  48. package/ISA/ISA/JsonTypes/ProcessOutput.js +263 -0
  49. package/ISA/ISA/JsonTypes/ProcessParameterValue.js +129 -0
  50. package/ISA/ISA/JsonTypes/ProcessSequence.js +255 -0
  51. package/ISA/ISA/JsonTypes/Protocol.js +277 -0
  52. package/ISA/ISA/JsonTypes/ProtocolParameter.js +101 -0
  53. package/ISA/ISA/JsonTypes/Publication.js +105 -0
  54. package/ISA/ISA/JsonTypes/Sample.js +71 -0
  55. package/ISA/ISA/JsonTypes/Source.js +54 -0
  56. package/ISA/ISA/JsonTypes/Study.js +942 -0
  57. package/ISA/ISA/JsonTypes/StudyMaterials.js +45 -0
  58. package/ISA/ISA/JsonTypes/URI.js +19 -0
  59. package/ISA/ISA/JsonTypes/Value.js +210 -0
  60. package/ISA/ISA/Regex.js +588 -0
  61. package/ISA/ISA.Json/Assay.js +123 -0
  62. package/ISA/ISA.Json/Comment.js +84 -0
  63. package/ISA/ISA.Json/ConverterOptions.js +33 -0
  64. package/ISA/ISA.Json/Data.js +271 -0
  65. package/ISA/ISA.Json/Decode.js +46 -0
  66. package/ISA/ISA.Json/Factor.js +194 -0
  67. package/ISA/ISA.Json/GEncode.js +15 -0
  68. package/ISA/ISA.Json/Investigation.js +132 -0
  69. package/ISA/ISA.Json/Material.js +233 -0
  70. package/ISA/ISA.Json/Ontology.js +204 -0
  71. package/ISA/ISA.Json/Person.js +204 -0
  72. package/ISA/ISA.Json/Process.js +291 -0
  73. package/ISA/ISA.Json/Protocol.js +242 -0
  74. package/ISA/ISA.Json/Publication.js +92 -0
  75. package/ISA/ISA.Json/Study.js +230 -0
  76. package/ISA/ISA.Json/Validation/Fable.js +69 -0
  77. package/ISA/ISA.Json/Validation/JsonSchemaValidation.js +88 -0
  78. package/ISA/ISA.Json/Validation/ValidationResult.js +45 -0
  79. package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +137 -0
  80. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +78 -0
  81. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +59 -0
  82. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +478 -0
  83. package/ISA/ISA.Spreadsheet/ArcAssay.js +150 -0
  84. package/ISA/ISA.Spreadsheet/ArcInvestigation.js +314 -0
  85. package/ISA/ISA.Spreadsheet/ArcStudy.js +67 -0
  86. package/ISA/ISA.Spreadsheet/CollectionAux.js +128 -0
  87. package/ISA/ISA.Spreadsheet/Metadata/Assays.js +81 -0
  88. package/ISA/ISA.Spreadsheet/Metadata/Comment.js +60 -0
  89. package/ISA/ISA.Spreadsheet/Metadata/Contacts.js +104 -0
  90. package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +180 -0
  91. package/ISA/ISA.Spreadsheet/Metadata/DesignDescriptors.js +27 -0
  92. package/ISA/ISA.Spreadsheet/Metadata/Factors.js +85 -0
  93. package/ISA/ISA.Spreadsheet/Metadata/OntologyAnnotation.js +65 -0
  94. package/ISA/ISA.Spreadsheet/Metadata/OntologySourceReference.js +73 -0
  95. package/ISA/ISA.Spreadsheet/Metadata/Protocols.js +116 -0
  96. package/ISA/ISA.Spreadsheet/Metadata/Publication.js +96 -0
  97. package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +451 -0
  98. package/ISA/ISA.Spreadsheet/Metadata/Study.js +260 -0
  99. package/README.md +277 -0
  100. package/SemVer.js +60 -0
  101. package/Templates/Template.Json.js +85 -0
  102. package/Templates/Template.Spreadsheet.js +315 -0
  103. package/Templates/Template.Web.js +27 -0
  104. package/Templates/Template.js +179 -0
  105. package/Templates/Templates.js +82 -0
  106. package/WebRequest/WebRequest.js +38 -0
  107. package/fable_modules/Fable.Fetch.2.6.0/Fable.Fetch.fableproj +21 -0
  108. package/fable_modules/Fable.Fetch.2.6.0/Fetch.fs +469 -0
  109. package/fable_modules/Fable.Fetch.2.6.0/Fetch.fs.js +111 -0
  110. package/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
  111. package/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +104 -0
  112. package/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
  113. package/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
  114. package/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +217 -0
  115. package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
  116. package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +19 -0
  117. package/fable_modules/Fable.SimpleHttp.3.5.0/Fable.SimpleHttp.fableproj +23 -0
  118. package/fable_modules/Fable.SimpleHttp.3.5.0/Http.fs +357 -0
  119. package/fable_modules/Fable.SimpleHttp.3.5.0/Http.fs.js +429 -0
  120. package/fable_modules/Fable.SimpleHttp.3.5.0/Types.fs +52 -0
  121. package/fable_modules/Fable.SimpleHttp.3.5.0/Types.fs.js +112 -0
  122. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs +387 -0
  123. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +240 -0
  124. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs +725 -0
  125. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs.js +522 -0
  126. package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs +195 -0
  127. package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs.js +208 -0
  128. package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs +209 -0
  129. package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs.js +137 -0
  130. package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs +61 -0
  131. package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs.js +62 -0
  132. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs +24 -0
  133. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs.js +56 -0
  134. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs +102 -0
  135. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs.js +6 -0
  136. package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs +200 -0
  137. package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs.js +137 -0
  138. package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs +139 -0
  139. package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs.js +116 -0
  140. package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs +120 -0
  141. package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs.js +120 -0
  142. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs +229 -0
  143. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs.js +421 -0
  144. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs +151 -0
  145. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs.js +277 -0
  146. package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs +114 -0
  147. package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs.js +104 -0
  148. package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs +177 -0
  149. package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs.js +249 -0
  150. package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs +200 -0
  151. package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs.js +125 -0
  152. package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs +202 -0
  153. package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs.js +135 -0
  154. package/fable_modules/FsSpreadsheet.4.1.0/FsSpreadsheet.fableproj +58 -0
  155. package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs +183 -0
  156. package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs.js +138 -0
  157. package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs +628 -0
  158. package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs.js +398 -0
  159. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs +19 -0
  160. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs.js +41 -0
  161. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs +222 -0
  162. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs.js +235 -0
  163. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs +93 -0
  164. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs.js +91 -0
  165. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs +65 -0
  166. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs.js +74 -0
  167. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs +22 -0
  168. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs.js +40 -0
  169. package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs +249 -0
  170. package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs.js +325 -0
  171. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs +455 -0
  172. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs.js +310 -0
  173. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs +140 -0
  174. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs.js +173 -0
  175. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs +6 -0
  176. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs.js +17 -0
  177. package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
  178. package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
  179. package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
  180. package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
  181. package/fable_modules/Thoth.Json.10.1.0/Decode.fs +1366 -0
  182. package/fable_modules/Thoth.Json.10.1.0/Decode.fs.js +1798 -0
  183. package/fable_modules/Thoth.Json.10.1.0/Encode.fs +621 -0
  184. package/fable_modules/Thoth.Json.10.1.0/Encode.fs.js +472 -0
  185. package/fable_modules/Thoth.Json.10.1.0/Extra.fs +31 -0
  186. package/fable_modules/Thoth.Json.10.1.0/Extra.fs.js +8 -0
  187. package/fable_modules/Thoth.Json.10.1.0/Thoth.Json.fableproj +30 -0
  188. package/fable_modules/Thoth.Json.10.1.0/Types.fs +59 -0
  189. package/fable_modules/Thoth.Json.10.1.0/Types.fs.js +98 -0
  190. package/fable_modules/Thoth.Json.10.1.0/obj/Release/netstandard2.0/Thoth.Json.AssemblyInfo.fs +19 -0
  191. package/fable_modules/Thoth.Json.10.1.0/package.json +5 -0
  192. package/fable_modules/fable-library.4.1.4/Array.d.ts +120 -0
  193. package/fable_modules/fable-library.4.1.4/Array.js +1204 -0
  194. package/fable_modules/fable-library.4.1.4/Async.d.ts +32 -0
  195. package/fable_modules/fable-library.4.1.4/Async.js +158 -0
  196. package/fable_modules/fable-library.4.1.4/AsyncBuilder.d.ts +59 -0
  197. package/fable_modules/fable-library.4.1.4/AsyncBuilder.js +183 -0
  198. package/fable_modules/fable-library.4.1.4/BigInt.d.ts +115 -0
  199. package/fable_modules/fable-library.4.1.4/BigInt.js +282 -0
  200. package/fable_modules/fable-library.4.1.4/BitConverter.d.ts +27 -0
  201. package/fable_modules/fable-library.4.1.4/BitConverter.js +138 -0
  202. package/fable_modules/fable-library.4.1.4/Boolean.d.ts +3 -0
  203. package/fable_modules/fable-library.4.1.4/Boolean.js +21 -0
  204. package/fable_modules/fable-library.4.1.4/Char.d.ts +65 -0
  205. package/fable_modules/fable-library.4.1.4/Char.js +169 -0
  206. package/fable_modules/fable-library.4.1.4/Choice.d.ts +138 -0
  207. package/fable_modules/fable-library.4.1.4/Choice.js +227 -0
  208. package/fable_modules/fable-library.4.1.4/Date.d.ts +70 -0
  209. package/fable_modules/fable-library.4.1.4/Date.js +451 -0
  210. package/fable_modules/fable-library.4.1.4/DateOffset.d.ts +63 -0
  211. package/fable_modules/fable-library.4.1.4/DateOffset.js +268 -0
  212. package/fable_modules/fable-library.4.1.4/DateOnly.d.ts +18 -0
  213. package/fable_modules/fable-library.4.1.4/DateOnly.js +124 -0
  214. package/fable_modules/fable-library.4.1.4/Decimal.d.ts +45 -0
  215. package/fable_modules/fable-library.4.1.4/Decimal.js +212 -0
  216. package/fable_modules/fable-library.4.1.4/Double.d.ts +11 -0
  217. package/fable_modules/fable-library.4.1.4/Double.js +46 -0
  218. package/fable_modules/fable-library.4.1.4/Encoding.d.ts +12 -0
  219. package/fable_modules/fable-library.4.1.4/Encoding.js +173 -0
  220. package/fable_modules/fable-library.4.1.4/Event.d.ts +31 -0
  221. package/fable_modules/fable-library.4.1.4/Event.js +93 -0
  222. package/fable_modules/fable-library.4.1.4/FSharp.Collections.d.ts +7 -0
  223. package/fable_modules/fable-library.4.1.4/FSharp.Collections.js +27 -0
  224. package/fable_modules/fable-library.4.1.4/FSharp.Core.d.ts +17 -0
  225. package/fable_modules/fable-library.4.1.4/FSharp.Core.js +69 -0
  226. package/fable_modules/fable-library.4.1.4/Global.d.ts +24 -0
  227. package/fable_modules/fable-library.4.1.4/Global.js +8 -0
  228. package/fable_modules/fable-library.4.1.4/Guid.d.ts +10 -0
  229. package/fable_modules/fable-library.4.1.4/Guid.js +142 -0
  230. package/fable_modules/fable-library.4.1.4/Int32.d.ts +28 -0
  231. package/fable_modules/fable-library.4.1.4/Int32.js +135 -0
  232. package/fable_modules/fable-library.4.1.4/List.d.ts +143 -0
  233. package/fable_modules/fable-library.4.1.4/List.js +1273 -0
  234. package/fable_modules/fable-library.4.1.4/Long.d.ts +3 -0
  235. package/fable_modules/fable-library.4.1.4/Long.js +46 -0
  236. package/fable_modules/fable-library.4.1.4/MailboxProcessor.d.ts +25 -0
  237. package/fable_modules/fable-library.4.1.4/MailboxProcessor.js +93 -0
  238. package/fable_modules/fable-library.4.1.4/Map.d.ts +178 -0
  239. package/fable_modules/fable-library.4.1.4/Map.js +1396 -0
  240. package/fable_modules/fable-library.4.1.4/MapUtil.d.ts +10 -0
  241. package/fable_modules/fable-library.4.1.4/MapUtil.js +112 -0
  242. package/fable_modules/fable-library.4.1.4/MutableMap.d.ts +52 -0
  243. package/fable_modules/fable-library.4.1.4/MutableMap.js +326 -0
  244. package/fable_modules/fable-library.4.1.4/MutableSet.d.ts +39 -0
  245. package/fable_modules/fable-library.4.1.4/MutableSet.js +232 -0
  246. package/fable_modules/fable-library.4.1.4/Native.d.ts +2 -0
  247. package/fable_modules/fable-library.4.1.4/Native.js +8 -0
  248. package/fable_modules/fable-library.4.1.4/Numeric.d.ts +19 -0
  249. package/fable_modules/fable-library.4.1.4/Numeric.js +71 -0
  250. package/fable_modules/fable-library.4.1.4/Observable.d.ts +32 -0
  251. package/fable_modules/fable-library.4.1.4/Observable.js +113 -0
  252. package/fable_modules/fable-library.4.1.4/Option.d.ts +28 -0
  253. package/fable_modules/fable-library.4.1.4/Option.js +96 -0
  254. package/fable_modules/fable-library.4.1.4/README.md +3 -0
  255. package/fable_modules/fable-library.4.1.4/Random.d.ts +37 -0
  256. package/fable_modules/fable-library.4.1.4/Random.js +170 -0
  257. package/fable_modules/fable-library.4.1.4/Range.d.ts +12 -0
  258. package/fable_modules/fable-library.4.1.4/Range.js +45 -0
  259. package/fable_modules/fable-library.4.1.4/Reflection.d.ts +119 -0
  260. package/fable_modules/fable-library.4.1.4/Reflection.js +461 -0
  261. package/fable_modules/fable-library.4.1.4/RegExp.d.ts +10 -0
  262. package/fable_modules/fable-library.4.1.4/RegExp.js +132 -0
  263. package/fable_modules/fable-library.4.1.4/Seq.d.ts +165 -0
  264. package/fable_modules/fable-library.4.1.4/Seq.js +1379 -0
  265. package/fable_modules/fable-library.4.1.4/Seq2.d.ts +18 -0
  266. package/fable_modules/fable-library.4.1.4/Seq2.js +111 -0
  267. package/fable_modules/fable-library.4.1.4/Set.d.ts +190 -0
  268. package/fable_modules/fable-library.4.1.4/Set.js +1789 -0
  269. package/fable_modules/fable-library.4.1.4/String.d.ts +49 -0
  270. package/fable_modules/fable-library.4.1.4/String.js +540 -0
  271. package/fable_modules/fable-library.4.1.4/System.Collections.Generic.d.ts +71 -0
  272. package/fable_modules/fable-library.4.1.4/System.Collections.Generic.js +307 -0
  273. package/fable_modules/fable-library.4.1.4/System.Text.d.ts +30 -0
  274. package/fable_modules/fable-library.4.1.4/System.Text.js +110 -0
  275. package/fable_modules/fable-library.4.1.4/SystemException.d.ts +5 -0
  276. package/fable_modules/fable-library.4.1.4/SystemException.js +5 -0
  277. package/fable_modules/fable-library.4.1.4/TimeOnly.d.ts +15 -0
  278. package/fable_modules/fable-library.4.1.4/TimeOnly.js +122 -0
  279. package/fable_modules/fable-library.4.1.4/TimeSpan.d.ts +34 -0
  280. package/fable_modules/fable-library.4.1.4/TimeSpan.js +177 -0
  281. package/fable_modules/fable-library.4.1.4/Timer.d.ts +19 -0
  282. package/fable_modules/fable-library.4.1.4/Timer.js +67 -0
  283. package/fable_modules/fable-library.4.1.4/Types.d.ts +58 -0
  284. package/fable_modules/fable-library.4.1.4/Types.js +208 -0
  285. package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.d.ts +2 -0
  286. package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.js +4 -0
  287. package/fable_modules/fable-library.4.1.4/Uri.d.ts +29 -0
  288. package/fable_modules/fable-library.4.1.4/Uri.js +142 -0
  289. package/fable_modules/fable-library.4.1.4/Util.d.ts +187 -0
  290. package/fable_modules/fable-library.4.1.4/Util.js +662 -0
  291. package/fable_modules/fable-library.4.1.4/lib/big.d.ts +338 -0
  292. package/fable_modules/fable-library.4.1.4/lib/big.js +826 -0
  293. package/fable_modules/fable-library.4.1.4/package.json +23 -0
  294. package/fable_modules/project_cracked.json +1 -0
  295. package/index.js +13 -0
  296. package/package.json +24 -0
@@ -0,0 +1,1798 @@
1
+ import { toFail, printf, toText, join } from "../fable-library.4.1.4/String.js";
2
+ import { Result_Bind, Result_Map, FSharpResult$2 } from "../fable-library.4.1.4/Choice.js";
3
+ import { Util_CachedDecoders, Util_Cache$1__GetOrAdd_43981464, CaseStrategy, Util_Casing_convert, ErrorReason } from "./Types.fs.js";
4
+ import { tryParse as tryParse_2 } from "../fable-library.4.1.4/Guid.js";
5
+ import { toString as toString_12, FSharpRef } from "../fable-library.4.1.4/Types.js";
6
+ import { tryParse as tryParse_3 } from "../fable-library.4.1.4/Int32.js";
7
+ import { parse, fromInt32, toUInt64, fromFloat64, toInt64, toFloat64 } from "../fable-library.4.1.4/BigInt.js";
8
+ import { tryParse as tryParse_4 } from "../fable-library.4.1.4/Long.js";
9
+ import { tryParse as tryParse_5 } from "../fable-library.4.1.4/Decimal.js";
10
+ import Decimal from "../fable-library.4.1.4/Decimal.js";
11
+ import { toUniversalTime, tryParse as tryParse_6, minValue } from "../fable-library.4.1.4/Date.js";
12
+ import { tryParse as tryParse_7, minValue as minValue_1 } from "../fable-library.4.1.4/DateOffset.js";
13
+ import { tryParse as tryParse_8 } from "../fable-library.4.1.4/TimeSpan.js";
14
+ import { map as map_4, defaultArg, some } from "../fable-library.4.1.4/Option.js";
15
+ import { ofArray, toArray, map as map_1, length, singleton, append as append_1, tail as tail_1, head as head_1, isEmpty, ofSeq, empty, reverse, fold, tryLast, cons } from "../fable-library.4.1.4/List.js";
16
+ import { int16ToString, numberHash, compare, comparePrimitives, uncurry3, defaultOf, uncurry2, int32ToString } from "../fable-library.4.1.4/Util.js";
17
+ import { map as map_2, tryFind, foldBack, fill, fold as fold_1 } from "../fable-library.4.1.4/Array.js";
18
+ import { contains, fold as fold_2, toList, append, reverse as reverse_1 } from "../fable-library.4.1.4/Seq.js";
19
+ import { getGenerics, getGenericTypeDefinition, makeTuple, getTupleElements, isTuple, isGenericType, parseEnum, getEnumValues, getEnumUnderlyingType, isEnum, getElementType, isArray, isUnion, makeRecord, getRecordElements, isRecord, fullName as fullName_1, makeUnion as makeUnion_1, getUnionCaseFields, getUnionCases, name as name_3, class_type } from "../fable-library.4.1.4/Reflection.js";
20
+ import { empty as empty_1, map as map_3, tryFind as tryFind_1, add, ofSeq as ofSeq_1, ofList } from "../fable-library.4.1.4/Map.js";
21
+ import { ofSeq as ofSeq_2 } from "../fable-library.4.1.4/Set.js";
22
+
23
+ export function Helpers_isUndefined(o) {
24
+ return (typeof o) === "undefined";
25
+ }
26
+
27
+ function genericMsg(msg, value_1, newLine) {
28
+ try {
29
+ return ((("Expecting " + msg) + " but instead got:") + (newLine ? "\n" : " ")) + (JSON.stringify(value_1, null, 4) + '');
30
+ }
31
+ catch (matchValue) {
32
+ return (("Expecting " + msg) + " but decoder failed. Couldn\'t report given value due to circular structure.") + (newLine ? "\n" : " ");
33
+ }
34
+ }
35
+
36
+ function errorToString(path, error) {
37
+ const reason_1 = (error.tag === 2) ? genericMsg(error.fields[0], error.fields[1], true) : ((error.tag === 1) ? ((genericMsg(error.fields[0], error.fields[1], false) + "\nReason: ") + error.fields[2]) : ((error.tag === 3) ? genericMsg(error.fields[0], error.fields[1], true) : ((error.tag === 4) ? (genericMsg(error.fields[0], error.fields[1], true) + (("\nNode `" + error.fields[2]) + "` is unkown.")) : ((error.tag === 5) ? ((("Expecting " + error.fields[0]) + ".\n") + (JSON.stringify(error.fields[1], null, 4) + '')) : ((error.tag === 7) ? ("The following errors were found:\n\n" + join("\n\n", error.fields[0])) : ((error.tag === 6) ? ("The following `failure` occurred with the decoder: " + error.fields[0]) : genericMsg(error.fields[0], error.fields[1], false)))))));
38
+ if (error.tag === 7) {
39
+ return reason_1;
40
+ }
41
+ else {
42
+ return (("Error at: `" + path) + "`\n") + reason_1;
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Runs the decoder against the given JSON value.
48
+ *
49
+ * If the decoder fails, it reports the error prefixed with the given path.
50
+ */
51
+ export function fromValue(path, decoder, value_1) {
52
+ const matchValue = decoder(path, value_1);
53
+ if (matchValue.tag === 1) {
54
+ const error = matchValue.fields[0];
55
+ return new FSharpResult$2(1, [errorToString(error[0], error[1])]);
56
+ }
57
+ else {
58
+ return new FSharpResult$2(0, [matchValue.fields[0]]);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Parse the provided string in as JSON and then run the decoder against it.
64
+ */
65
+ export function fromString(decoder, value_1) {
66
+ try {
67
+ return fromValue("$", decoder, JSON.parse(value_1));
68
+ }
69
+ catch (matchValue) {
70
+ if (matchValue instanceof SyntaxError) {
71
+ return new FSharpResult$2(1, ["Given an invalid JSON: " + matchValue.message]);
72
+ }
73
+ else {
74
+ throw matchValue;
75
+ }
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Parse the provided string in as JSON and then run the decoder against it.
81
+ */
82
+ export function unsafeFromString(decoder, value_1) {
83
+ const matchValue = fromString(decoder, value_1);
84
+ if (matchValue.tag === 1) {
85
+ throw new Error(matchValue.fields[0]);
86
+ }
87
+ else {
88
+ return matchValue.fields[0];
89
+ }
90
+ }
91
+
92
+ export function decodeValue(path, decoder) {
93
+ const decoder_1 = decoder;
94
+ return (value_1) => fromValue(path, decoder_1, value_1);
95
+ }
96
+
97
+ export function decodeString(decoder) {
98
+ const decoder_1 = decoder;
99
+ return (value_1) => fromString(decoder_1, value_1);
100
+ }
101
+
102
+ export function string(path, value_1) {
103
+ if (typeof value_1 === "string") {
104
+ return new FSharpResult$2(0, [value_1]);
105
+ }
106
+ else {
107
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a string", value_1])]]);
108
+ }
109
+ }
110
+
111
+ export function char(path, value_1) {
112
+ if (typeof value_1 === "string") {
113
+ const str = value_1;
114
+ if (str.length === 1) {
115
+ return new FSharpResult$2(0, [str[0]]);
116
+ }
117
+ else {
118
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a single character string", value_1])]]);
119
+ }
120
+ }
121
+ else {
122
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a char", value_1])]]);
123
+ }
124
+ }
125
+
126
+ export function guid(path, value_1) {
127
+ if (typeof value_1 === "string") {
128
+ let matchValue;
129
+ let outArg = "00000000-0000-0000-0000-000000000000";
130
+ matchValue = [tryParse_2(value_1, new FSharpRef(() => outArg, (v) => {
131
+ outArg = v;
132
+ })), outArg];
133
+ if (matchValue[0]) {
134
+ return new FSharpResult$2(0, [matchValue[1]]);
135
+ }
136
+ else {
137
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a guid", value_1])]]);
138
+ }
139
+ }
140
+ else {
141
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a guid", value_1])]]);
142
+ }
143
+ }
144
+
145
+ export function unit(path, value_1) {
146
+ if (value_1 == null) {
147
+ return new FSharpResult$2(0, [void 0]);
148
+ }
149
+ else {
150
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["null", value_1])]]);
151
+ }
152
+ }
153
+
154
+ export const sbyte = (path) => ((value_2) => {
155
+ const path_1 = path;
156
+ const value_3 = value_2;
157
+ if ((typeof value_3) === "number") {
158
+ const value_1_1 = value_3;
159
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((-128 <= value_1_1) && (value_1_1 <= 127)) ? (new FSharpResult$2(0, [(value_1_1 + 0x80 & 0xFF) - 0x80])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["a sbyte", value_1_1, "Value was either too large or too small for a sbyte"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["a sbyte", value_1_1, "Value is not an integral value"])]]));
160
+ }
161
+ else if (typeof value_3 === "string") {
162
+ let matchValue;
163
+ let outArg = 0;
164
+ matchValue = [tryParse_3(value_3, 511, false, 8, new FSharpRef(() => outArg, (v) => {
165
+ outArg = (v | 0);
166
+ })), outArg];
167
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["a sbyte", value_3])]]));
168
+ }
169
+ else {
170
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["a sbyte", value_3])]]);
171
+ }
172
+ });
173
+
174
+ export const byte = (path) => ((value_2) => {
175
+ const path_1 = path;
176
+ const value_3 = value_2;
177
+ if ((typeof value_3) === "number") {
178
+ const value_1_1 = value_3;
179
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((0 <= value_1_1) && (value_1_1 <= 255)) ? (new FSharpResult$2(0, [value_1_1 & 0xFF])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["a byte", value_1_1, "Value was either too large or too small for a byte"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["a byte", value_1_1, "Value is not an integral value"])]]));
180
+ }
181
+ else if (typeof value_3 === "string") {
182
+ let matchValue;
183
+ let outArg = 0;
184
+ matchValue = [tryParse_3(value_3, 511, true, 8, new FSharpRef(() => outArg, (v) => {
185
+ outArg = v;
186
+ })), outArg];
187
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["a byte", value_3])]]));
188
+ }
189
+ else {
190
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["a byte", value_3])]]);
191
+ }
192
+ });
193
+
194
+ export const int16 = (path) => ((value_2) => {
195
+ const path_1 = path;
196
+ const value_3 = value_2;
197
+ if ((typeof value_3) === "number") {
198
+ const value_1_1 = value_3;
199
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((-32768 <= value_1_1) && (value_1_1 <= 32767)) ? (new FSharpResult$2(0, [(value_1_1 + 0x8000 & 0xFFFF) - 0x8000])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int16", value_1_1, "Value was either too large or too small for an int16"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int16", value_1_1, "Value is not an integral value"])]]));
200
+ }
201
+ else if (typeof value_3 === "string") {
202
+ let matchValue;
203
+ let outArg = 0;
204
+ matchValue = [tryParse_3(value_3, 511, false, 16, new FSharpRef(() => outArg, (v) => {
205
+ outArg = (v | 0);
206
+ })), outArg];
207
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int16", value_3])]]));
208
+ }
209
+ else {
210
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int16", value_3])]]);
211
+ }
212
+ });
213
+
214
+ export const uint16 = (path) => ((value_2) => {
215
+ const path_1 = path;
216
+ const value_3 = value_2;
217
+ if ((typeof value_3) === "number") {
218
+ const value_1_1 = value_3;
219
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((0 <= value_1_1) && (value_1_1 <= 65535)) ? (new FSharpResult$2(0, [value_1_1 & 0xFFFF])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint16", value_1_1, "Value was either too large or too small for an uint16"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint16", value_1_1, "Value is not an integral value"])]]));
220
+ }
221
+ else if (typeof value_3 === "string") {
222
+ let matchValue;
223
+ let outArg = 0;
224
+ matchValue = [tryParse_3(value_3, 511, true, 16, new FSharpRef(() => outArg, (v) => {
225
+ outArg = v;
226
+ })), outArg];
227
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint16", value_3])]]));
228
+ }
229
+ else {
230
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint16", value_3])]]);
231
+ }
232
+ });
233
+
234
+ export const int = (path) => ((value_2) => {
235
+ const path_1 = path;
236
+ const value_3 = value_2;
237
+ if ((typeof value_3) === "number") {
238
+ const value_1_1 = value_3;
239
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((-2147483648 <= value_1_1) && (value_1_1 <= 2147483647)) ? (new FSharpResult$2(0, [~~value_1_1])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int", value_1_1, "Value was either too large or too small for an int"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int", value_1_1, "Value is not an integral value"])]]));
240
+ }
241
+ else if (typeof value_3 === "string") {
242
+ let matchValue;
243
+ let outArg = 0;
244
+ matchValue = [tryParse_3(value_3, 511, false, 32, new FSharpRef(() => outArg, (v) => {
245
+ outArg = (v | 0);
246
+ })), outArg];
247
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int", value_3])]]));
248
+ }
249
+ else {
250
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int", value_3])]]);
251
+ }
252
+ });
253
+
254
+ export const uint32 = (path) => ((value_2) => {
255
+ const path_1 = path;
256
+ const value_3 = value_2;
257
+ if ((typeof value_3) === "number") {
258
+ const value_1_1 = value_3;
259
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((0 <= value_1_1) && (value_1_1 <= 4294967295)) ? (new FSharpResult$2(0, [value_1_1 >>> 0])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint32", value_1_1, "Value was either too large or too small for an uint32"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint32", value_1_1, "Value is not an integral value"])]]));
260
+ }
261
+ else if (typeof value_3 === "string") {
262
+ let matchValue;
263
+ let outArg = 0;
264
+ matchValue = [tryParse_3(value_3, 511, true, 32, new FSharpRef(() => outArg, (v) => {
265
+ outArg = v;
266
+ })), outArg];
267
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint32", value_3])]]));
268
+ }
269
+ else {
270
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint32", value_3])]]);
271
+ }
272
+ });
273
+
274
+ export const int64 = (path) => ((value_2) => {
275
+ const path_1 = path;
276
+ const value_3 = value_2;
277
+ if ((typeof value_3) === "number") {
278
+ const value_1_1 = value_3;
279
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((toFloat64(-9223372036854775808n) <= value_1_1) && (value_1_1 <= toFloat64(9223372036854775807n))) ? (new FSharpResult$2(0, [toInt64(fromFloat64(value_1_1))])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int64", value_1_1, "Value was either too large or too small for an int64"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an int64", value_1_1, "Value is not an integral value"])]]));
280
+ }
281
+ else if (typeof value_3 === "string") {
282
+ let matchValue;
283
+ let outArg = 0n;
284
+ matchValue = [tryParse_4(value_3, 511, false, 64, new FSharpRef(() => outArg, (v) => {
285
+ outArg = v;
286
+ })), outArg];
287
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int64", value_3])]]));
288
+ }
289
+ else {
290
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an int64", value_3])]]);
291
+ }
292
+ });
293
+
294
+ export const uint64 = (path) => ((value_2) => {
295
+ const path_1 = path;
296
+ const value_3 = value_2;
297
+ if ((typeof value_3) === "number") {
298
+ const value_1_1 = value_3;
299
+ return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((toFloat64(0n) <= value_1_1) && (value_1_1 <= toFloat64(18446744073709551615n))) ? (new FSharpResult$2(0, [toUInt64(fromFloat64(value_1_1))])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint64", value_1_1, "Value was either too large or too small for an uint64"])]]))) : (new FSharpResult$2(1, [[path_1, new ErrorReason(1, ["an uint64", value_1_1, "Value is not an integral value"])]]));
300
+ }
301
+ else if (typeof value_3 === "string") {
302
+ let matchValue;
303
+ let outArg = 0n;
304
+ matchValue = [tryParse_4(value_3, 511, true, 64, new FSharpRef(() => outArg, (v) => {
305
+ outArg = v;
306
+ })), outArg];
307
+ return matchValue[0] ? (new FSharpResult$2(0, [matchValue[1]])) : (new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint64", value_3])]]));
308
+ }
309
+ else {
310
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["an uint64", value_3])]]);
311
+ }
312
+ });
313
+
314
+ export function bigint(path, value_1) {
315
+ if ((typeof value_1) === "number") {
316
+ return new FSharpResult$2(0, [fromInt32(value_1)]);
317
+ }
318
+ else if (typeof value_1 === "string") {
319
+ try {
320
+ return new FSharpResult$2(0, [parse(value_1)]);
321
+ }
322
+ catch (matchValue) {
323
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a bigint", value_1])]]);
324
+ }
325
+ }
326
+ else {
327
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a bigint", value_1])]]);
328
+ }
329
+ }
330
+
331
+ export function bool(path, value_1) {
332
+ if (typeof value_1 === "boolean") {
333
+ return new FSharpResult$2(0, [value_1]);
334
+ }
335
+ else {
336
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a boolean", value_1])]]);
337
+ }
338
+ }
339
+
340
+ export function float(path, value_1) {
341
+ if ((typeof value_1) === "number") {
342
+ return new FSharpResult$2(0, [value_1]);
343
+ }
344
+ else {
345
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a float", value_1])]]);
346
+ }
347
+ }
348
+
349
+ export function float32(path, value_1) {
350
+ if ((typeof value_1) === "number") {
351
+ return new FSharpResult$2(0, [value_1]);
352
+ }
353
+ else {
354
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a float32", value_1])]]);
355
+ }
356
+ }
357
+
358
+ export function decimal(path, value_1) {
359
+ if ((typeof value_1) === "number") {
360
+ return new FSharpResult$2(0, [new Decimal(value_1)]);
361
+ }
362
+ else if (typeof value_1 === "string") {
363
+ let matchValue;
364
+ let outArg = new Decimal("0");
365
+ matchValue = [tryParse_5(value_1, new FSharpRef(() => outArg, (v) => {
366
+ outArg = v;
367
+ })), outArg];
368
+ if (matchValue[0]) {
369
+ return new FSharpResult$2(0, [matchValue[1]]);
370
+ }
371
+ else {
372
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a decimal", value_1])]]);
373
+ }
374
+ }
375
+ else {
376
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a decimal", value_1])]]);
377
+ }
378
+ }
379
+
380
+ export function datetime(path, value_1) {
381
+ if (typeof value_1 === "string") {
382
+ let matchValue;
383
+ let outArg = minValue();
384
+ matchValue = [tryParse_6(value_1, new FSharpRef(() => outArg, (v) => {
385
+ outArg = v;
386
+ })), outArg];
387
+ if (matchValue[0]) {
388
+ return new FSharpResult$2(0, [toUniversalTime(matchValue[1])]);
389
+ }
390
+ else {
391
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
392
+ }
393
+ }
394
+ else {
395
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
396
+ }
397
+ }
398
+
399
+ /**
400
+ * Decode a System.DateTime value using Sytem.DateTime.TryParse, then convert it to UTC.
401
+ */
402
+ export function datetimeUtc(path, value_1) {
403
+ if (typeof value_1 === "string") {
404
+ let matchValue;
405
+ let outArg = minValue();
406
+ matchValue = [tryParse_6(value_1, new FSharpRef(() => outArg, (v) => {
407
+ outArg = v;
408
+ })), outArg];
409
+ if (matchValue[0]) {
410
+ return new FSharpResult$2(0, [toUniversalTime(matchValue[1])]);
411
+ }
412
+ else {
413
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
414
+ }
415
+ }
416
+ else {
417
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
418
+ }
419
+ }
420
+
421
+ /**
422
+ * Decode a System.DateTime with DateTime.TryParse; uses default System.DateTimeStyles.
423
+ */
424
+ export function datetimeLocal(path, value_1) {
425
+ if (typeof value_1 === "string") {
426
+ let matchValue;
427
+ let outArg = minValue();
428
+ matchValue = [tryParse_6(value_1, new FSharpRef(() => outArg, (v) => {
429
+ outArg = v;
430
+ })), outArg];
431
+ if (matchValue[0]) {
432
+ return new FSharpResult$2(0, [matchValue[1]]);
433
+ }
434
+ else {
435
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
436
+ }
437
+ }
438
+ else {
439
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
440
+ }
441
+ }
442
+
443
+ export function datetimeOffset(path, value_1) {
444
+ if (typeof value_1 === "string") {
445
+ let matchValue;
446
+ let outArg = minValue_1();
447
+ matchValue = [tryParse_7(value_1, new FSharpRef(() => outArg, (v) => {
448
+ outArg = v;
449
+ })), outArg];
450
+ if (matchValue[0]) {
451
+ return new FSharpResult$2(0, [matchValue[1]]);
452
+ }
453
+ else {
454
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetimeoffset", value_1])]]);
455
+ }
456
+ }
457
+ else {
458
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a datetime", value_1])]]);
459
+ }
460
+ }
461
+
462
+ export function timespan(path, value_1) {
463
+ if (typeof value_1 === "string") {
464
+ let matchValue;
465
+ let outArg = 0;
466
+ matchValue = [tryParse_8(value_1, new FSharpRef(() => outArg, (v) => {
467
+ outArg = v;
468
+ })), outArg];
469
+ if (matchValue[0]) {
470
+ return new FSharpResult$2(0, [matchValue[1]]);
471
+ }
472
+ else {
473
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a timespan", value_1])]]);
474
+ }
475
+ }
476
+ else {
477
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a timespan", value_1])]]);
478
+ }
479
+ }
480
+
481
+ function decodeMaybeNull(path, decoder, value_1) {
482
+ if (value_1 == null) {
483
+ return new FSharpResult$2(0, [void 0]);
484
+ }
485
+ else {
486
+ const matchValue = decoder(path, value_1);
487
+ if (matchValue.tag === 1) {
488
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
489
+ }
490
+ else {
491
+ return new FSharpResult$2(0, [some(matchValue.fields[0])]);
492
+ }
493
+ }
494
+ }
495
+
496
+ export function optional(fieldName, decoder, path, value_1) {
497
+ if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {
498
+ const fieldValue = value_1[fieldName];
499
+ if (Helpers_isUndefined(fieldValue)) {
500
+ return new FSharpResult$2(0, [void 0]);
501
+ }
502
+ else {
503
+ return decodeMaybeNull((path + ".") + fieldName, decoder, fieldValue);
504
+ }
505
+ }
506
+ else {
507
+ return new FSharpResult$2(1, [[path, new ErrorReason(2, ["an object", value_1])]]);
508
+ }
509
+ }
510
+
511
+ function badPathError(fieldNames, currentPath, value_1) {
512
+ return new FSharpResult$2(1, [[defaultArg(currentPath, join(".", cons("$", fieldNames))), new ErrorReason(4, [("an object with path `" + join(".", fieldNames)) + "`", value_1, defaultArg(tryLast(fieldNames), "")])]]);
513
+ }
514
+
515
+ export function optionalAt(fieldNames, decoder, firstPath, firstValue) {
516
+ const _arg = fold((tupledArg, field_1) => {
517
+ const curPath = tupledArg[0];
518
+ const curValue = tupledArg[1];
519
+ const res = tupledArg[2];
520
+ if (res == null) {
521
+ if (curValue == null) {
522
+ return [curPath, curValue, new FSharpResult$2(0, [void 0])];
523
+ }
524
+ else if (curValue === null ? false : (Object.getPrototypeOf(curValue || false) === Object.prototype)) {
525
+ return [(curPath + ".") + field_1, curValue[field_1], void 0];
526
+ }
527
+ else {
528
+ return [curPath, curValue, new FSharpResult$2(1, [[curPath, new ErrorReason(2, ["an object", curValue])]])];
529
+ }
530
+ }
531
+ else {
532
+ return [curPath, curValue, res];
533
+ }
534
+ }, [firstPath, firstValue, void 0], fieldNames);
535
+ if (_arg[2] == null) {
536
+ const lastValue = _arg[1];
537
+ if (Helpers_isUndefined(lastValue)) {
538
+ return new FSharpResult$2(0, [void 0]);
539
+ }
540
+ else {
541
+ return decodeMaybeNull(_arg[0], decoder, lastValue);
542
+ }
543
+ }
544
+ else {
545
+ return _arg[2];
546
+ }
547
+ }
548
+
549
+ export function field(fieldName, decoder, path, value_1) {
550
+ if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {
551
+ const fieldValue = value_1[fieldName];
552
+ if (Helpers_isUndefined(fieldValue)) {
553
+ return new FSharpResult$2(1, [[path, new ErrorReason(3, [("an object with a field named `" + fieldName) + "`", value_1])]]);
554
+ }
555
+ else {
556
+ return decoder((path + ".") + fieldName, fieldValue);
557
+ }
558
+ }
559
+ else {
560
+ return new FSharpResult$2(1, [[path, new ErrorReason(2, ["an object", value_1])]]);
561
+ }
562
+ }
563
+
564
+ export function at(fieldNames, decoder, firstPath, firstValue) {
565
+ const _arg = fold((tupledArg, field_1) => {
566
+ const curPath = tupledArg[0];
567
+ const curValue = tupledArg[1];
568
+ const res = tupledArg[2];
569
+ if (res == null) {
570
+ if (curValue == null) {
571
+ return [curPath, curValue, badPathError(fieldNames, curPath, firstValue)];
572
+ }
573
+ else if (curValue === null ? false : (Object.getPrototypeOf(curValue || false) === Object.prototype)) {
574
+ const curValue_1 = curValue[field_1];
575
+ if (Helpers_isUndefined(curValue_1)) {
576
+ return [curPath, curValue_1, badPathError(fieldNames, void 0, firstValue)];
577
+ }
578
+ else {
579
+ return [(curPath + ".") + field_1, curValue_1, void 0];
580
+ }
581
+ }
582
+ else {
583
+ return [curPath, curValue, new FSharpResult$2(1, [[curPath, new ErrorReason(2, ["an object", curValue])]])];
584
+ }
585
+ }
586
+ else {
587
+ return [curPath, curValue, res];
588
+ }
589
+ }, [firstPath, firstValue, void 0], fieldNames);
590
+ if (_arg[2] == null) {
591
+ return decoder(_arg[0], _arg[1]);
592
+ }
593
+ else {
594
+ return _arg[2];
595
+ }
596
+ }
597
+
598
+ export function index(requestedIndex, decoder, path, value_1) {
599
+ let copyOfStruct;
600
+ const currentPath = ((path + ".[") + int32ToString(requestedIndex)) + "]";
601
+ if (Array.isArray(value_1)) {
602
+ const vArray = value_1;
603
+ if (requestedIndex < vArray.length) {
604
+ return decoder(currentPath, vArray[requestedIndex]);
605
+ }
606
+ else {
607
+ return new FSharpResult$2(1, [[currentPath, new ErrorReason(5, [((("a longer array. Need index `" + int32ToString(requestedIndex)) + "` but there are only `") + ((copyOfStruct = vArray.length, int32ToString(copyOfStruct)))) + "` entries", value_1])]]);
608
+ }
609
+ }
610
+ else {
611
+ return new FSharpResult$2(1, [[currentPath, new ErrorReason(0, ["an array", value_1])]]);
612
+ }
613
+ }
614
+
615
+ export function option(decoder, path, value_1) {
616
+ if (value_1 == null) {
617
+ return new FSharpResult$2(0, [void 0]);
618
+ }
619
+ else {
620
+ return Result_Map(some, decoder(path, value_1));
621
+ }
622
+ }
623
+
624
+ export function list(decoder, path, value_1) {
625
+ if (Array.isArray(value_1)) {
626
+ let i = -1;
627
+ return Result_Map(reverse, fold_1((acc, value_2) => {
628
+ i = ((i + 1) | 0);
629
+ if (acc.tag === 0) {
630
+ const matchValue = decoder(((path + ".[") + int32ToString(i)) + "]", value_2);
631
+ if (matchValue.tag === 0) {
632
+ return new FSharpResult$2(0, [cons(matchValue.fields[0], acc.fields[0])]);
633
+ }
634
+ else {
635
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
636
+ }
637
+ }
638
+ else {
639
+ return acc;
640
+ }
641
+ }, new FSharpResult$2(0, [empty()]), value_1));
642
+ }
643
+ else {
644
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a list", value_1])]]);
645
+ }
646
+ }
647
+
648
+ export function seq(decoder, path, value_1) {
649
+ if (Array.isArray(value_1)) {
650
+ let i = -1;
651
+ return Result_Map(reverse_1, fold_1((acc, value_2) => {
652
+ i = ((i + 1) | 0);
653
+ if (acc.tag === 0) {
654
+ const matchValue = decoder(((path + ".[") + int32ToString(i)) + "]", value_2);
655
+ if (matchValue.tag === 0) {
656
+ return new FSharpResult$2(0, [append([matchValue.fields[0]], acc.fields[0])]);
657
+ }
658
+ else {
659
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
660
+ }
661
+ }
662
+ else {
663
+ return acc;
664
+ }
665
+ }, new FSharpResult$2(0, [[]]), value_1));
666
+ }
667
+ else {
668
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["a seq", value_1])]]);
669
+ }
670
+ }
671
+
672
+ export function array(decoder, path, value_1) {
673
+ if (Array.isArray(value_1)) {
674
+ let i = -1;
675
+ const tokens = value_1;
676
+ return fold_1((acc, value_2) => {
677
+ i = ((i + 1) | 0);
678
+ if (acc.tag === 0) {
679
+ const acc_1 = acc.fields[0];
680
+ const matchValue = decoder(((path + ".[") + int32ToString(i)) + "]", value_2);
681
+ if (matchValue.tag === 0) {
682
+ acc_1[i] = matchValue.fields[0];
683
+ return new FSharpResult$2(0, [acc_1]);
684
+ }
685
+ else {
686
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
687
+ }
688
+ }
689
+ else {
690
+ return acc;
691
+ }
692
+ }, new FSharpResult$2(0, [fill(new Array(tokens.length), 0, tokens.length, null)]), tokens);
693
+ }
694
+ else {
695
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["an array", value_1])]]);
696
+ }
697
+ }
698
+
699
+ export function keys(path, value_1) {
700
+ if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {
701
+ return new FSharpResult$2(0, [ofSeq(Object.keys(value_1))]);
702
+ }
703
+ else {
704
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["an object", value_1])]]);
705
+ }
706
+ }
707
+
708
+ export function keyValuePairs(decoder, path, value_1) {
709
+ const matchValue = keys(path, value_1);
710
+ if (matchValue.tag === 1) {
711
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
712
+ }
713
+ else {
714
+ return Result_Map(reverse, fold((acc, prop) => {
715
+ if (acc.tag === 0) {
716
+ const matchValue_1 = decoder(path, value_1[prop]);
717
+ if (matchValue_1.tag === 0) {
718
+ return new FSharpResult$2(0, [cons([prop, matchValue_1.fields[0]], acc.fields[0])]);
719
+ }
720
+ else {
721
+ return new FSharpResult$2(1, [matchValue_1.fields[0]]);
722
+ }
723
+ }
724
+ else {
725
+ return acc;
726
+ }
727
+ }, new FSharpResult$2(0, [empty()]), matchValue.fields[0]));
728
+ }
729
+ }
730
+
731
+ export function oneOf(decoders, path, value_1) {
732
+ const runner = (decoders_1_mut, errors_mut) => {
733
+ runner:
734
+ while (true) {
735
+ const decoders_1 = decoders_1_mut, errors = errors_mut;
736
+ if (isEmpty(decoders_1)) {
737
+ return new FSharpResult$2(1, [[path, new ErrorReason(7, [errors])]]);
738
+ }
739
+ else {
740
+ const matchValue = fromValue(path, uncurry2(head_1(decoders_1)), value_1);
741
+ if (matchValue.tag === 1) {
742
+ decoders_1_mut = tail_1(decoders_1);
743
+ errors_mut = append_1(errors, singleton(matchValue.fields[0]));
744
+ continue runner;
745
+ }
746
+ else {
747
+ return new FSharpResult$2(0, [matchValue.fields[0]]);
748
+ }
749
+ }
750
+ break;
751
+ }
752
+ };
753
+ return runner(decoders, empty());
754
+ }
755
+
756
+ export function nil(output, path, value_1) {
757
+ if (value_1 == null) {
758
+ return new FSharpResult$2(0, [output]);
759
+ }
760
+ else {
761
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["null", value_1])]]);
762
+ }
763
+ }
764
+
765
+ export function value(_arg, v) {
766
+ return new FSharpResult$2(0, [v]);
767
+ }
768
+
769
+ export function succeed(output, _arg, _arg_1) {
770
+ return new FSharpResult$2(0, [output]);
771
+ }
772
+
773
+ export function fail(msg, path, _arg) {
774
+ return new FSharpResult$2(1, [[path, new ErrorReason(6, [msg])]]);
775
+ }
776
+
777
+ export function andThen(cb, decoder, path, value_1) {
778
+ const matchValue = decoder(path, value_1);
779
+ if (matchValue.tag === 0) {
780
+ return cb(matchValue.fields[0], path, value_1);
781
+ }
782
+ else {
783
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
784
+ }
785
+ }
786
+
787
+ export function all(decoders, path, value_1) {
788
+ const runner = (decoders_1_mut, values_mut) => {
789
+ runner:
790
+ while (true) {
791
+ const decoders_1 = decoders_1_mut, values = values_mut;
792
+ if (isEmpty(decoders_1)) {
793
+ return new FSharpResult$2(0, [values]);
794
+ }
795
+ else {
796
+ const matchValue = head_1(decoders_1)(path)(value_1);
797
+ if (matchValue.tag === 1) {
798
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
799
+ }
800
+ else {
801
+ decoders_1_mut = tail_1(decoders_1);
802
+ values_mut = append_1(values, singleton(matchValue.fields[0]));
803
+ continue runner;
804
+ }
805
+ }
806
+ break;
807
+ }
808
+ };
809
+ return runner(decoders, empty());
810
+ }
811
+
812
+ export function map(ctor, d1, path, value_1) {
813
+ const matchValue = d1(path, value_1);
814
+ if (matchValue.tag === 1) {
815
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
816
+ }
817
+ else {
818
+ return new FSharpResult$2(0, [ctor(matchValue.fields[0])]);
819
+ }
820
+ }
821
+
822
+ export function map2(ctor, d1, d2, path, value_1) {
823
+ const matchValue = d1(path, value_1);
824
+ const matchValue_1 = d2(path, value_1);
825
+ const copyOfStruct = matchValue;
826
+ if (copyOfStruct.tag === 1) {
827
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
828
+ }
829
+ else {
830
+ const copyOfStruct_1 = matchValue_1;
831
+ if (copyOfStruct_1.tag === 1) {
832
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
833
+ }
834
+ else {
835
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0])]);
836
+ }
837
+ }
838
+ }
839
+
840
+ export function map3(ctor, d1, d2, d3, path, value_1) {
841
+ const matchValue = d1(path, value_1);
842
+ const matchValue_1 = d2(path, value_1);
843
+ const matchValue_2 = d3(path, value_1);
844
+ const copyOfStruct = matchValue;
845
+ if (copyOfStruct.tag === 1) {
846
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
847
+ }
848
+ else {
849
+ const copyOfStruct_1 = matchValue_1;
850
+ if (copyOfStruct_1.tag === 1) {
851
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
852
+ }
853
+ else {
854
+ const copyOfStruct_2 = matchValue_2;
855
+ if (copyOfStruct_2.tag === 1) {
856
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
857
+ }
858
+ else {
859
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0])]);
860
+ }
861
+ }
862
+ }
863
+ }
864
+
865
+ export function map4(ctor, d1, d2, d3, d4, path, value_1) {
866
+ const matchValue = d1(path, value_1);
867
+ const matchValue_1 = d2(path, value_1);
868
+ const matchValue_2 = d3(path, value_1);
869
+ const matchValue_3 = d4(path, value_1);
870
+ const copyOfStruct = matchValue;
871
+ if (copyOfStruct.tag === 1) {
872
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
873
+ }
874
+ else {
875
+ const copyOfStruct_1 = matchValue_1;
876
+ if (copyOfStruct_1.tag === 1) {
877
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
878
+ }
879
+ else {
880
+ const copyOfStruct_2 = matchValue_2;
881
+ if (copyOfStruct_2.tag === 1) {
882
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
883
+ }
884
+ else {
885
+ const copyOfStruct_3 = matchValue_3;
886
+ if (copyOfStruct_3.tag === 1) {
887
+ return new FSharpResult$2(1, [copyOfStruct_3.fields[0]]);
888
+ }
889
+ else {
890
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0])]);
891
+ }
892
+ }
893
+ }
894
+ }
895
+ }
896
+
897
+ export function map5(ctor, d1, d2, d3, d4, d5, path, value_1) {
898
+ const matchValue = d1(path, value_1);
899
+ const matchValue_1 = d2(path, value_1);
900
+ const matchValue_2 = d3(path, value_1);
901
+ const matchValue_3 = d4(path, value_1);
902
+ const matchValue_4 = d5(path, value_1);
903
+ const copyOfStruct = matchValue;
904
+ if (copyOfStruct.tag === 1) {
905
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
906
+ }
907
+ else {
908
+ const copyOfStruct_1 = matchValue_1;
909
+ if (copyOfStruct_1.tag === 1) {
910
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
911
+ }
912
+ else {
913
+ const copyOfStruct_2 = matchValue_2;
914
+ if (copyOfStruct_2.tag === 1) {
915
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
916
+ }
917
+ else {
918
+ const copyOfStruct_3 = matchValue_3;
919
+ if (copyOfStruct_3.tag === 1) {
920
+ return new FSharpResult$2(1, [copyOfStruct_3.fields[0]]);
921
+ }
922
+ else {
923
+ const copyOfStruct_4 = matchValue_4;
924
+ if (copyOfStruct_4.tag === 1) {
925
+ return new FSharpResult$2(1, [copyOfStruct_4.fields[0]]);
926
+ }
927
+ else {
928
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0])]);
929
+ }
930
+ }
931
+ }
932
+ }
933
+ }
934
+ }
935
+
936
+ export function map6(ctor, d1, d2, d3, d4, d5, d6, path, value_1) {
937
+ const matchValue = d1(path, value_1);
938
+ const matchValue_1 = d2(path, value_1);
939
+ const matchValue_2 = d3(path, value_1);
940
+ const matchValue_3 = d4(path, value_1);
941
+ const matchValue_4 = d5(path, value_1);
942
+ const matchValue_5 = d6(path, value_1);
943
+ const copyOfStruct = matchValue;
944
+ if (copyOfStruct.tag === 1) {
945
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
946
+ }
947
+ else {
948
+ const copyOfStruct_1 = matchValue_1;
949
+ if (copyOfStruct_1.tag === 1) {
950
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
951
+ }
952
+ else {
953
+ const copyOfStruct_2 = matchValue_2;
954
+ if (copyOfStruct_2.tag === 1) {
955
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
956
+ }
957
+ else {
958
+ const copyOfStruct_3 = matchValue_3;
959
+ if (copyOfStruct_3.tag === 1) {
960
+ return new FSharpResult$2(1, [copyOfStruct_3.fields[0]]);
961
+ }
962
+ else {
963
+ const copyOfStruct_4 = matchValue_4;
964
+ if (copyOfStruct_4.tag === 1) {
965
+ return new FSharpResult$2(1, [copyOfStruct_4.fields[0]]);
966
+ }
967
+ else {
968
+ const copyOfStruct_5 = matchValue_5;
969
+ if (copyOfStruct_5.tag === 1) {
970
+ return new FSharpResult$2(1, [copyOfStruct_5.fields[0]]);
971
+ }
972
+ else {
973
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0])]);
974
+ }
975
+ }
976
+ }
977
+ }
978
+ }
979
+ }
980
+ }
981
+
982
+ export function map7(ctor, d1, d2, d3, d4, d5, d6, d7, path, value_1) {
983
+ const matchValue = d1(path, value_1);
984
+ const matchValue_1 = d2(path, value_1);
985
+ const matchValue_2 = d3(path, value_1);
986
+ const matchValue_3 = d4(path, value_1);
987
+ const matchValue_4 = d5(path, value_1);
988
+ const matchValue_5 = d6(path, value_1);
989
+ const matchValue_6 = d7(path, value_1);
990
+ const copyOfStruct = matchValue;
991
+ if (copyOfStruct.tag === 1) {
992
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
993
+ }
994
+ else {
995
+ const copyOfStruct_1 = matchValue_1;
996
+ if (copyOfStruct_1.tag === 1) {
997
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
998
+ }
999
+ else {
1000
+ const copyOfStruct_2 = matchValue_2;
1001
+ if (copyOfStruct_2.tag === 1) {
1002
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
1003
+ }
1004
+ else {
1005
+ const copyOfStruct_3 = matchValue_3;
1006
+ if (copyOfStruct_3.tag === 1) {
1007
+ return new FSharpResult$2(1, [copyOfStruct_3.fields[0]]);
1008
+ }
1009
+ else {
1010
+ const copyOfStruct_4 = matchValue_4;
1011
+ if (copyOfStruct_4.tag === 1) {
1012
+ return new FSharpResult$2(1, [copyOfStruct_4.fields[0]]);
1013
+ }
1014
+ else {
1015
+ const copyOfStruct_5 = matchValue_5;
1016
+ if (copyOfStruct_5.tag === 1) {
1017
+ return new FSharpResult$2(1, [copyOfStruct_5.fields[0]]);
1018
+ }
1019
+ else {
1020
+ const copyOfStruct_6 = matchValue_6;
1021
+ if (copyOfStruct_6.tag === 1) {
1022
+ return new FSharpResult$2(1, [copyOfStruct_6.fields[0]]);
1023
+ }
1024
+ else {
1025
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0], copyOfStruct_6.fields[0])]);
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ }
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ export function map8(ctor, d1, d2, d3, d4, d5, d6, d7, d8, path, value_1) {
1036
+ const matchValue = d1(path, value_1);
1037
+ const matchValue_1 = d2(path, value_1);
1038
+ const matchValue_2 = d3(path, value_1);
1039
+ const matchValue_3 = d4(path, value_1);
1040
+ const matchValue_4 = d5(path, value_1);
1041
+ const matchValue_5 = d6(path, value_1);
1042
+ const matchValue_6 = d7(path, value_1);
1043
+ const matchValue_7 = d8(path, value_1);
1044
+ const copyOfStruct = matchValue;
1045
+ if (copyOfStruct.tag === 1) {
1046
+ return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
1047
+ }
1048
+ else {
1049
+ const copyOfStruct_1 = matchValue_1;
1050
+ if (copyOfStruct_1.tag === 1) {
1051
+ return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
1052
+ }
1053
+ else {
1054
+ const copyOfStruct_2 = matchValue_2;
1055
+ if (copyOfStruct_2.tag === 1) {
1056
+ return new FSharpResult$2(1, [copyOfStruct_2.fields[0]]);
1057
+ }
1058
+ else {
1059
+ const copyOfStruct_3 = matchValue_3;
1060
+ if (copyOfStruct_3.tag === 1) {
1061
+ return new FSharpResult$2(1, [copyOfStruct_3.fields[0]]);
1062
+ }
1063
+ else {
1064
+ const copyOfStruct_4 = matchValue_4;
1065
+ if (copyOfStruct_4.tag === 1) {
1066
+ return new FSharpResult$2(1, [copyOfStruct_4.fields[0]]);
1067
+ }
1068
+ else {
1069
+ const copyOfStruct_5 = matchValue_5;
1070
+ if (copyOfStruct_5.tag === 1) {
1071
+ return new FSharpResult$2(1, [copyOfStruct_5.fields[0]]);
1072
+ }
1073
+ else {
1074
+ const copyOfStruct_6 = matchValue_6;
1075
+ if (copyOfStruct_6.tag === 1) {
1076
+ return new FSharpResult$2(1, [copyOfStruct_6.fields[0]]);
1077
+ }
1078
+ else {
1079
+ const copyOfStruct_7 = matchValue_7;
1080
+ if (copyOfStruct_7.tag === 1) {
1081
+ return new FSharpResult$2(1, [copyOfStruct_7.fields[0]]);
1082
+ }
1083
+ else {
1084
+ return new FSharpResult$2(0, [ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0], copyOfStruct_6.fields[0], copyOfStruct_7.fields[0])]);
1085
+ }
1086
+ }
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ }
1093
+ }
1094
+
1095
+ /**
1096
+ * Allow to incrementally apply a decoder, for building large objects.
1097
+ */
1098
+ export function andMap() {
1099
+ return (d) => ((d_1) => ((path) => ((value_1) => map2((arg, func) => func(arg), uncurry2(d), uncurry2(d_1), path, value_1))));
1100
+ }
1101
+
1102
+ function unwrapWith(errors, path, decoder, value_1) {
1103
+ const matchValue = decoder(path, value_1);
1104
+ if (matchValue.tag === 1) {
1105
+ void (errors.push(matchValue.fields[0]));
1106
+ return defaultOf();
1107
+ }
1108
+ else {
1109
+ return matchValue.fields[0];
1110
+ }
1111
+ }
1112
+
1113
+ export class Getters$1 {
1114
+ constructor(path, v) {
1115
+ let _this, _this_1;
1116
+ this.errors = [];
1117
+ this.required = ((_this = this, {
1118
+ Field(fieldName, decoder) {
1119
+ return unwrapWith(_this.errors, path, (path_1, value_1) => field(fieldName, decoder, path_1, value_1), v);
1120
+ },
1121
+ At(fieldNames, decoder_2) {
1122
+ return unwrapWith(_this.errors, path, (firstPath, firstValue) => at(fieldNames, decoder_2, firstPath, firstValue), v);
1123
+ },
1124
+ Raw(decoder_4) {
1125
+ return unwrapWith(_this.errors, path, decoder_4, v);
1126
+ },
1127
+ }));
1128
+ this.optional = ((_this_1 = this, {
1129
+ Field(fieldName_1, decoder_5) {
1130
+ return unwrapWith(_this_1.errors, path, (path_2, value_2) => optional(fieldName_1, decoder_5, path_2, value_2), v);
1131
+ },
1132
+ At(fieldNames_1, decoder_7) {
1133
+ return unwrapWith(_this_1.errors, path, (firstPath_1, firstValue_1) => optionalAt(fieldNames_1, decoder_7, firstPath_1, firstValue_1), v);
1134
+ },
1135
+ Raw(decoder_9) {
1136
+ const matchValue = decoder_9(path, v);
1137
+ if (matchValue.tag === 1) {
1138
+ const reason = matchValue.fields[0][1];
1139
+ const error = matchValue.fields[0];
1140
+ let matchResult, v_2;
1141
+ switch (reason.tag) {
1142
+ case 3:
1143
+ case 4: {
1144
+ matchResult = 1;
1145
+ break;
1146
+ }
1147
+ case 5:
1148
+ case 6:
1149
+ case 7: {
1150
+ matchResult = 2;
1151
+ break;
1152
+ }
1153
+ case 1: {
1154
+ matchResult = 0;
1155
+ v_2 = reason.fields[1];
1156
+ break;
1157
+ }
1158
+ case 2: {
1159
+ matchResult = 0;
1160
+ v_2 = reason.fields[1];
1161
+ break;
1162
+ }
1163
+ default: {
1164
+ matchResult = 0;
1165
+ v_2 = reason.fields[1];
1166
+ }
1167
+ }
1168
+ switch (matchResult) {
1169
+ case 0:
1170
+ if (v_2 == null) {
1171
+ return void 0;
1172
+ }
1173
+ else {
1174
+ void (_this_1.errors.push(error));
1175
+ return defaultOf();
1176
+ }
1177
+ case 1:
1178
+ return void 0;
1179
+ default: {
1180
+ void (_this_1.errors.push(error));
1181
+ return defaultOf();
1182
+ }
1183
+ }
1184
+ }
1185
+ else {
1186
+ return some(matchValue.fields[0]);
1187
+ }
1188
+ },
1189
+ }));
1190
+ }
1191
+ get Required() {
1192
+ const __ = this;
1193
+ return __.required;
1194
+ }
1195
+ get Optional() {
1196
+ const __ = this;
1197
+ return __.optional;
1198
+ }
1199
+ }
1200
+
1201
+ export function Getters$1_$reflection(gen0) {
1202
+ return class_type("Thoth.Json.Decode.Getters`1", [gen0], Getters$1);
1203
+ }
1204
+
1205
+ export function Getters$1_$ctor_4A51B60E(path, v) {
1206
+ return new Getters$1(path, v);
1207
+ }
1208
+
1209
+ export function Getters$1__get_Errors(__) {
1210
+ return toList(__.errors);
1211
+ }
1212
+
1213
+ export function object(builder, path, v) {
1214
+ const getters = Getters$1_$ctor_4A51B60E(path, v);
1215
+ const result = builder(getters);
1216
+ const matchValue = Getters$1__get_Errors(getters);
1217
+ if (!isEmpty(matchValue)) {
1218
+ const errors = matchValue;
1219
+ if (length(errors) > 1) {
1220
+ return new FSharpResult$2(1, [[path, new ErrorReason(7, [map_1((tupledArg) => errorToString(tupledArg[0], tupledArg[1]), errors)])]]);
1221
+ }
1222
+ else {
1223
+ return new FSharpResult$2(1, [head_1(matchValue)]);
1224
+ }
1225
+ }
1226
+ else {
1227
+ return new FSharpResult$2(0, [result]);
1228
+ }
1229
+ }
1230
+
1231
+ export function tuple2(decoder1, decoder2) {
1232
+ let decoder_3;
1233
+ const decoder = decoder1;
1234
+ decoder_3 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1235
+ return (path_3) => ((value_4) => andThen(uncurry3((v1) => {
1236
+ let decoder_2;
1237
+ const decoder_1 = decoder2;
1238
+ decoder_2 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1239
+ return (path_2) => ((value_3) => andThen((v2, arg10$0040, arg20$0040) => succeed([v1, v2], arg10$0040, arg20$0040), uncurry2(decoder_2), path_2, value_3));
1240
+ }), uncurry2(decoder_3), path_3, value_4));
1241
+ }
1242
+
1243
+ export function tuple3(decoder1, decoder2, decoder3) {
1244
+ let decoder_5;
1245
+ const decoder = decoder1;
1246
+ decoder_5 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1247
+ return (path_5) => ((value_6) => andThen(uncurry3((v1) => {
1248
+ let decoder_4;
1249
+ const decoder_1 = decoder2;
1250
+ decoder_4 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1251
+ return (path_4) => ((value_5) => andThen(uncurry3((v2) => {
1252
+ let decoder_3;
1253
+ const decoder_2 = decoder3;
1254
+ decoder_3 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1255
+ return (path_3) => ((value_4) => andThen((v3, arg10$0040, arg20$0040) => succeed([v1, v2, v3], arg10$0040, arg20$0040), uncurry2(decoder_3), path_3, value_4));
1256
+ }), uncurry2(decoder_4), path_4, value_5));
1257
+ }), uncurry2(decoder_5), path_5, value_6));
1258
+ }
1259
+
1260
+ export function tuple4(decoder1, decoder2, decoder3, decoder4) {
1261
+ let decoder_7;
1262
+ const decoder = decoder1;
1263
+ decoder_7 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1264
+ return (path_7) => ((value_8) => andThen(uncurry3((v1) => {
1265
+ let decoder_6;
1266
+ const decoder_1 = decoder2;
1267
+ decoder_6 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1268
+ return (path_6) => ((value_7) => andThen(uncurry3((v2) => {
1269
+ let decoder_5;
1270
+ const decoder_2 = decoder3;
1271
+ decoder_5 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1272
+ return (path_5) => ((value_6) => andThen(uncurry3((v3) => {
1273
+ let decoder_4;
1274
+ const decoder_3 = decoder4;
1275
+ decoder_4 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));
1276
+ return (path_4) => ((value_5) => andThen((v4, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4], arg10$0040, arg20$0040), uncurry2(decoder_4), path_4, value_5));
1277
+ }), uncurry2(decoder_5), path_5, value_6));
1278
+ }), uncurry2(decoder_6), path_6, value_7));
1279
+ }), uncurry2(decoder_7), path_7, value_8));
1280
+ }
1281
+
1282
+ export function tuple5(decoder1, decoder2, decoder3, decoder4, decoder5) {
1283
+ let decoder_9;
1284
+ const decoder = decoder1;
1285
+ decoder_9 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1286
+ return (path_9) => ((value_10) => andThen(uncurry3((v1) => {
1287
+ let decoder_8;
1288
+ const decoder_1 = decoder2;
1289
+ decoder_8 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1290
+ return (path_8) => ((value_9) => andThen(uncurry3((v2) => {
1291
+ let decoder_7;
1292
+ const decoder_2 = decoder3;
1293
+ decoder_7 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1294
+ return (path_7) => ((value_8) => andThen(uncurry3((v3) => {
1295
+ let decoder_6;
1296
+ const decoder_3 = decoder4;
1297
+ decoder_6 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));
1298
+ return (path_6) => ((value_7) => andThen(uncurry3((v4) => {
1299
+ let decoder_5;
1300
+ const decoder_4 = decoder5;
1301
+ decoder_5 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));
1302
+ return (path_5) => ((value_6) => andThen((v5, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5], arg10$0040, arg20$0040), uncurry2(decoder_5), path_5, value_6));
1303
+ }), uncurry2(decoder_6), path_6, value_7));
1304
+ }), uncurry2(decoder_7), path_7, value_8));
1305
+ }), uncurry2(decoder_8), path_8, value_9));
1306
+ }), uncurry2(decoder_9), path_9, value_10));
1307
+ }
1308
+
1309
+ export function tuple6(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6) {
1310
+ let decoder_11;
1311
+ const decoder = decoder1;
1312
+ decoder_11 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1313
+ return (path_11) => ((value_12) => andThen(uncurry3((v1) => {
1314
+ let decoder_10;
1315
+ const decoder_1 = decoder2;
1316
+ decoder_10 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1317
+ return (path_10) => ((value_11) => andThen(uncurry3((v2) => {
1318
+ let decoder_9;
1319
+ const decoder_2 = decoder3;
1320
+ decoder_9 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1321
+ return (path_9) => ((value_10) => andThen(uncurry3((v3) => {
1322
+ let decoder_8;
1323
+ const decoder_3 = decoder4;
1324
+ decoder_8 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));
1325
+ return (path_8) => ((value_9) => andThen(uncurry3((v4) => {
1326
+ let decoder_7;
1327
+ const decoder_4 = decoder5;
1328
+ decoder_7 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));
1329
+ return (path_7) => ((value_8) => andThen(uncurry3((v5) => {
1330
+ let decoder_6;
1331
+ const decoder_5 = decoder6;
1332
+ decoder_6 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));
1333
+ return (path_6) => ((value_7) => andThen((v6, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6], arg10$0040, arg20$0040), uncurry2(decoder_6), path_6, value_7));
1334
+ }), uncurry2(decoder_7), path_7, value_8));
1335
+ }), uncurry2(decoder_8), path_8, value_9));
1336
+ }), uncurry2(decoder_9), path_9, value_10));
1337
+ }), uncurry2(decoder_10), path_10, value_11));
1338
+ }), uncurry2(decoder_11), path_11, value_12));
1339
+ }
1340
+
1341
+ export function tuple7(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6, decoder7) {
1342
+ let decoder_13;
1343
+ const decoder = decoder1;
1344
+ decoder_13 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1345
+ return (path_13) => ((value_14) => andThen(uncurry3((v1) => {
1346
+ let decoder_12;
1347
+ const decoder_1 = decoder2;
1348
+ decoder_12 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1349
+ return (path_12) => ((value_13) => andThen(uncurry3((v2) => {
1350
+ let decoder_11;
1351
+ const decoder_2 = decoder3;
1352
+ decoder_11 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1353
+ return (path_11) => ((value_12) => andThen(uncurry3((v3) => {
1354
+ let decoder_10;
1355
+ const decoder_3 = decoder4;
1356
+ decoder_10 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));
1357
+ return (path_10) => ((value_11) => andThen(uncurry3((v4) => {
1358
+ let decoder_9;
1359
+ const decoder_4 = decoder5;
1360
+ decoder_9 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));
1361
+ return (path_9) => ((value_10) => andThen(uncurry3((v5) => {
1362
+ let decoder_8;
1363
+ const decoder_5 = decoder6;
1364
+ decoder_8 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));
1365
+ return (path_8) => ((value_9) => andThen(uncurry3((v6) => {
1366
+ let decoder_7;
1367
+ const decoder_6 = decoder7;
1368
+ decoder_7 = ((path_6) => ((value_7) => index(6, decoder_6, path_6, value_7)));
1369
+ return (path_7) => ((value_8) => andThen((v7, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6, v7], arg10$0040, arg20$0040), uncurry2(decoder_7), path_7, value_8));
1370
+ }), uncurry2(decoder_8), path_8, value_9));
1371
+ }), uncurry2(decoder_9), path_9, value_10));
1372
+ }), uncurry2(decoder_10), path_10, value_11));
1373
+ }), uncurry2(decoder_11), path_11, value_12));
1374
+ }), uncurry2(decoder_12), path_12, value_13));
1375
+ }), uncurry2(decoder_13), path_13, value_14));
1376
+ }
1377
+
1378
+ export function tuple8(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6, decoder7, decoder8) {
1379
+ let decoder_15;
1380
+ const decoder = decoder1;
1381
+ decoder_15 = ((path) => ((value_1) => index(0, decoder, path, value_1)));
1382
+ return (path_15) => ((value_16) => andThen(uncurry3((v1) => {
1383
+ let decoder_14;
1384
+ const decoder_1 = decoder2;
1385
+ decoder_14 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));
1386
+ return (path_14) => ((value_15) => andThen(uncurry3((v2) => {
1387
+ let decoder_13;
1388
+ const decoder_2 = decoder3;
1389
+ decoder_13 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));
1390
+ return (path_13) => ((value_14) => andThen(uncurry3((v3) => {
1391
+ let decoder_12;
1392
+ const decoder_3 = decoder4;
1393
+ decoder_12 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));
1394
+ return (path_12) => ((value_13) => andThen(uncurry3((v4) => {
1395
+ let decoder_11;
1396
+ const decoder_4 = decoder5;
1397
+ decoder_11 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));
1398
+ return (path_11) => ((value_12) => andThen(uncurry3((v5) => {
1399
+ let decoder_10;
1400
+ const decoder_5 = decoder6;
1401
+ decoder_10 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));
1402
+ return (path_10) => ((value_11) => andThen(uncurry3((v6) => {
1403
+ let decoder_9;
1404
+ const decoder_6 = decoder7;
1405
+ decoder_9 = ((path_6) => ((value_7) => index(6, decoder_6, path_6, value_7)));
1406
+ return (path_9) => ((value_10) => andThen(uncurry3((v7) => {
1407
+ let decoder_8;
1408
+ const decoder_7 = decoder8;
1409
+ decoder_8 = ((path_7) => ((value_8) => index(7, decoder_7, path_7, value_8)));
1410
+ return (path_8) => ((value_9) => andThen((v8, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6, v7, v8], arg10$0040, arg20$0040), uncurry2(decoder_8), path_8, value_9));
1411
+ }), uncurry2(decoder_9), path_9, value_10));
1412
+ }), uncurry2(decoder_10), path_10, value_11));
1413
+ }), uncurry2(decoder_11), path_11, value_12));
1414
+ }), uncurry2(decoder_12), path_12, value_13));
1415
+ }), uncurry2(decoder_13), path_13, value_14));
1416
+ }), uncurry2(decoder_14), path_14, value_15));
1417
+ }), uncurry2(decoder_15), path_15, value_16));
1418
+ }
1419
+
1420
+ export function dict(decoder) {
1421
+ let d;
1422
+ const decoder_1 = decoder;
1423
+ d = ((path) => ((value_1) => keyValuePairs(decoder_1, path, value_1)));
1424
+ return (path_1) => ((value_2) => map((elements) => ofList(elements, {
1425
+ Compare: comparePrimitives,
1426
+ }), uncurry2(d), path_1, value_2));
1427
+ }
1428
+
1429
+ export function map$0027(keyDecoder, valueDecoder) {
1430
+ let d;
1431
+ const decoder = tuple2(keyDecoder, valueDecoder);
1432
+ d = ((path) => ((value_1) => array(uncurry2(decoder), path, value_1)));
1433
+ return (path_1) => ((value_2) => map((elements) => ofSeq_1(elements, {
1434
+ Compare: compare,
1435
+ }), uncurry2(d), path_1, value_2));
1436
+ }
1437
+
1438
+ function toMap(xs) {
1439
+ return ofSeq_1(xs, {
1440
+ Compare: compare,
1441
+ });
1442
+ }
1443
+
1444
+ function toSet(xs) {
1445
+ return ofSeq_2(xs, {
1446
+ Compare: compare,
1447
+ });
1448
+ }
1449
+
1450
+ function autoObject(decoderInfos, path, value_1) {
1451
+ if (!(value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype))) {
1452
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["an object", value_1])]]);
1453
+ }
1454
+ else {
1455
+ return foldBack((tupledArg, acc) => {
1456
+ const name = tupledArg[0];
1457
+ if (acc.tag === 0) {
1458
+ return Result_Map((v) => cons(v, acc.fields[0]), tupledArg[1]((path + ".") + name)(value_1[name]));
1459
+ }
1460
+ else {
1461
+ return acc;
1462
+ }
1463
+ }, decoderInfos, new FSharpResult$2(0, [empty()]));
1464
+ }
1465
+ }
1466
+
1467
+ function autoObject2(keyDecoder, valueDecoder, path, value_1) {
1468
+ if (!(value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype))) {
1469
+ return new FSharpResult$2(1, [[path, new ErrorReason(0, ["an object", value_1])]]);
1470
+ }
1471
+ else {
1472
+ return fold_2((acc, name) => {
1473
+ if (acc.tag === 0) {
1474
+ const matchValue = keyDecoder(path, name);
1475
+ if (matchValue.tag === 0) {
1476
+ const _arg = valueDecoder((path + ".") + name, value_1[name]);
1477
+ if (_arg.tag === 0) {
1478
+ return new FSharpResult$2(0, [cons([matchValue.fields[0], _arg.fields[0]], acc.fields[0])]);
1479
+ }
1480
+ else {
1481
+ return new FSharpResult$2(1, [_arg.fields[0]]);
1482
+ }
1483
+ }
1484
+ else {
1485
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
1486
+ }
1487
+ }
1488
+ else {
1489
+ return acc;
1490
+ }
1491
+ }, new FSharpResult$2(0, [empty()]), Object.keys(value_1));
1492
+ }
1493
+ }
1494
+
1495
+ function mixedArray(offset, decoders, path, values) {
1496
+ let arg_1;
1497
+ const expectedLength = (decoders.length + offset) | 0;
1498
+ if (expectedLength !== values.length) {
1499
+ return new FSharpResult$2(1, [[path, new ErrorReason(6, [(arg_1 = (values.length | 0), toText(printf("Expected array of length %i but got %i"))(expectedLength)(arg_1))])]]);
1500
+ }
1501
+ else {
1502
+ let result = new FSharpResult$2(0, [empty()]);
1503
+ for (let i = offset; i <= (values.length - 1); i++) {
1504
+ if (result.tag === 0) {
1505
+ const acc = result.fields[0];
1506
+ const path_1 = toText(printf("%s[%i]"))(path)(i);
1507
+ const decoder = decoders[i - offset];
1508
+ const value_1 = values[i];
1509
+ result = Result_Map((v) => cons(v, acc), decoder(path_1)(value_1));
1510
+ }
1511
+ }
1512
+ return Result_Map(reverse, result);
1513
+ }
1514
+ }
1515
+
1516
+ function makeUnion(extra, caseStrategy, t, name, path, values) {
1517
+ const uci = tryFind((x) => (name_3(x) === name), getUnionCases(t, true));
1518
+ if (uci != null) {
1519
+ const uci_1 = uci;
1520
+ const decoders = map_2((fi) => autoDecoder(extra, caseStrategy, false, fi[1]), getUnionCaseFields(uci_1));
1521
+ return Result_Map((values_2) => makeUnion_1(uci_1, toArray(values_2), true), ((decoders.length === 0) && (values.length <= 1)) ? (new FSharpResult$2(0, [empty()])) : mixedArray(1, decoders, path, values));
1522
+ }
1523
+ else {
1524
+ return new FSharpResult$2(1, [[path, new ErrorReason(6, [(("Cannot find case " + name) + " in ") + fullName_1(t)])]]);
1525
+ }
1526
+ }
1527
+
1528
+ function autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t) {
1529
+ let arg_1;
1530
+ const decoderRef = new FSharpRef(defaultOf());
1531
+ let extra_1;
1532
+ const matchValue = fullName_1(t);
1533
+ extra_1 = ((matchValue === "") ? extra : add(matchValue, decoderRef, extra));
1534
+ let decoder;
1535
+ if (isRecord(t, true)) {
1536
+ const decoders = map_2((fi) => [Util_Casing_convert(caseStrategy, name_3(fi)), autoDecoder(extra_1, caseStrategy, false, fi[1])], getRecordElements(t, true));
1537
+ decoder = ((path) => ((value_1) => Result_Map((xs) => makeRecord(t, toArray(xs), true), autoObject(decoders, path, value_1))));
1538
+ }
1539
+ else if (isUnion(t, true)) {
1540
+ decoder = ((path_1) => ((value_2) => {
1541
+ if (typeof value_2 === "string") {
1542
+ return makeUnion(extra_1, caseStrategy, t, value_2, path_1, []);
1543
+ }
1544
+ else if (Array.isArray(value_2)) {
1545
+ const values = value_2;
1546
+ return Result_Bind((name_2) => makeUnion(extra_1, caseStrategy, t, name_2, path_1, values), string(path_1 + "[0]", values[0]));
1547
+ }
1548
+ else {
1549
+ return new FSharpResult$2(1, [[path_1, new ErrorReason(0, ["a string or array", value_2])]]);
1550
+ }
1551
+ }));
1552
+ }
1553
+ else if (isOptional) {
1554
+ decoder = ((path_2) => ((value_3) => (new FSharpResult$2(1, [[path_2, new ErrorReason(2, ["an extra coder for " + fullName_1(t), value_3])]]))));
1555
+ }
1556
+ else {
1557
+ throw new Error((arg_1 = fullName_1(t), toText(printf("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(arg_1)));
1558
+ }
1559
+ decoderRef.contents = decoder;
1560
+ return decoder;
1561
+ }
1562
+
1563
+ function autoDecoder(extra, caseStrategy, isOptional, t) {
1564
+ let decoder_13, decoder_14, decoder_15, decoder_16;
1565
+ const fullname = fullName_1(t);
1566
+ const matchValue = tryFind_1(fullname, extra);
1567
+ if (matchValue == null) {
1568
+ if (isArray(t)) {
1569
+ const decoder = autoDecoder(extra, caseStrategy, false, getElementType(t));
1570
+ return (path_1) => ((value_2) => array(uncurry2(decoder), path_1, value_2));
1571
+ }
1572
+ else if (isEnum(t)) {
1573
+ const enumType = fullName_1(getEnumUnderlyingType(t));
1574
+ switch (enumType) {
1575
+ case "System.SByte":
1576
+ return (path_2) => ((value_4) => {
1577
+ const t_2 = t;
1578
+ const path_3 = path_2;
1579
+ const value_5 = value_4;
1580
+ const matchValue_1 = sbyte(path_3)(value_5);
1581
+ if (matchValue_1.tag === 1) {
1582
+ return new FSharpResult$2(1, [matchValue_1.fields[0]]);
1583
+ }
1584
+ else {
1585
+ const enumValue = matchValue_1.fields[0] | 0;
1586
+ return contains(enumValue, getEnumValues(t_2), {
1587
+ Equals: (x, y) => (x === y),
1588
+ GetHashCode: numberHash,
1589
+ }) ? (new FSharpResult$2(0, [parseEnum(t_2, enumValue.toString())])) : (new FSharpResult$2(1, [[path_3, new ErrorReason(1, [fullName_1(t_2), value_5, "Unkown value provided for the enum"])]]));
1590
+ }
1591
+ });
1592
+ case "System.Byte":
1593
+ return (path_4) => ((value_7) => {
1594
+ const t_3 = t;
1595
+ const path_5 = path_4;
1596
+ const value_8 = value_7;
1597
+ const matchValue_2 = byte(path_5)(value_8);
1598
+ if (matchValue_2.tag === 1) {
1599
+ return new FSharpResult$2(1, [matchValue_2.fields[0]]);
1600
+ }
1601
+ else {
1602
+ const enumValue_1 = matchValue_2.fields[0];
1603
+ return contains(enumValue_1, getEnumValues(t_3), {
1604
+ Equals: (x_1, y_1) => (x_1 === y_1),
1605
+ GetHashCode: numberHash,
1606
+ }) ? (new FSharpResult$2(0, [parseEnum(t_3, enumValue_1.toString())])) : (new FSharpResult$2(1, [[path_5, new ErrorReason(1, [fullName_1(t_3), value_8, "Unkown value provided for the enum"])]]));
1607
+ }
1608
+ });
1609
+ case "System.Int16":
1610
+ return (path_6) => ((value_10) => {
1611
+ const t_4 = t;
1612
+ const path_7 = path_6;
1613
+ const value_11 = value_10;
1614
+ const matchValue_3 = int16(path_7)(value_11);
1615
+ if (matchValue_3.tag === 1) {
1616
+ return new FSharpResult$2(1, [matchValue_3.fields[0]]);
1617
+ }
1618
+ else {
1619
+ const enumValue_2 = matchValue_3.fields[0] | 0;
1620
+ return contains(enumValue_2, getEnumValues(t_4), {
1621
+ Equals: (x_2, y_2) => (x_2 === y_2),
1622
+ GetHashCode: numberHash,
1623
+ }) ? (new FSharpResult$2(0, [parseEnum(t_4, int16ToString(enumValue_2))])) : (new FSharpResult$2(1, [[path_7, new ErrorReason(1, [fullName_1(t_4), value_11, "Unkown value provided for the enum"])]]));
1624
+ }
1625
+ });
1626
+ case "System.UInt16":
1627
+ return (path_8) => ((value_13) => {
1628
+ const t_5 = t;
1629
+ const path_9 = path_8;
1630
+ const value_14 = value_13;
1631
+ const matchValue_4 = uint16(path_9)(value_14);
1632
+ if (matchValue_4.tag === 1) {
1633
+ return new FSharpResult$2(1, [matchValue_4.fields[0]]);
1634
+ }
1635
+ else {
1636
+ const enumValue_3 = matchValue_4.fields[0];
1637
+ return contains(enumValue_3, getEnumValues(t_5), {
1638
+ Equals: (x_3, y_3) => (x_3 === y_3),
1639
+ GetHashCode: numberHash,
1640
+ }) ? (new FSharpResult$2(0, [parseEnum(t_5, enumValue_3.toString())])) : (new FSharpResult$2(1, [[path_9, new ErrorReason(1, [fullName_1(t_5), value_14, "Unkown value provided for the enum"])]]));
1641
+ }
1642
+ });
1643
+ case "System.Int32":
1644
+ return (path_10) => ((value_16) => {
1645
+ const t_6 = t;
1646
+ const path_11 = path_10;
1647
+ const value_17 = value_16;
1648
+ const matchValue_5 = int(path_11)(value_17);
1649
+ if (matchValue_5.tag === 1) {
1650
+ return new FSharpResult$2(1, [matchValue_5.fields[0]]);
1651
+ }
1652
+ else {
1653
+ const enumValue_4 = matchValue_5.fields[0] | 0;
1654
+ return contains(enumValue_4, getEnumValues(t_6), {
1655
+ Equals: (x_4, y_4) => (x_4 === y_4),
1656
+ GetHashCode: numberHash,
1657
+ }) ? (new FSharpResult$2(0, [parseEnum(t_6, int32ToString(enumValue_4))])) : (new FSharpResult$2(1, [[path_11, new ErrorReason(1, [fullName_1(t_6), value_17, "Unkown value provided for the enum"])]]));
1658
+ }
1659
+ });
1660
+ case "System.UInt32":
1661
+ return (path_12) => ((value_19) => {
1662
+ const t_7 = t;
1663
+ const path_13 = path_12;
1664
+ const value_20 = value_19;
1665
+ const matchValue_6 = uint32(path_13)(value_20);
1666
+ if (matchValue_6.tag === 1) {
1667
+ return new FSharpResult$2(1, [matchValue_6.fields[0]]);
1668
+ }
1669
+ else {
1670
+ const enumValue_5 = matchValue_6.fields[0];
1671
+ return contains(enumValue_5, getEnumValues(t_7), {
1672
+ Equals: (x_5, y_5) => (x_5 === y_5),
1673
+ GetHashCode: numberHash,
1674
+ }) ? (new FSharpResult$2(0, [parseEnum(t_7, enumValue_5.toString())])) : (new FSharpResult$2(1, [[path_13, new ErrorReason(1, [fullName_1(t_7), value_20, "Unkown value provided for the enum"])]]));
1675
+ }
1676
+ });
1677
+ default: {
1678
+ const arg_7 = fullName_1(t);
1679
+ const clo_1 = toFail(printf("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can\'t use one of these types, please pass an extra decoder.\n "))(arg_7);
1680
+ return (arg_8) => {
1681
+ const clo_2 = clo_1(arg_8);
1682
+ return clo_2;
1683
+ };
1684
+ }
1685
+ }
1686
+ }
1687
+ else if (isGenericType(t)) {
1688
+ if (isTuple(t)) {
1689
+ const decoders = map_2((t_8) => autoDecoder(extra, caseStrategy, false, t_8), getTupleElements(t));
1690
+ return (path_14) => ((value_21) => (Array.isArray(value_21) ? Result_Map((xs) => makeTuple(toArray(xs), t), mixedArray(0, decoders, path_14, value_21)) : (new FSharpResult$2(1, [[path_14, new ErrorReason(0, ["an array", value_21])]]))));
1691
+ }
1692
+ else {
1693
+ const fullname_1 = fullName_1(getGenericTypeDefinition(t));
1694
+ switch (fullname_1) {
1695
+ case "Microsoft.FSharp.Core.FSharpOption`1[System.Object]":
1696
+ return (decoder_13 = autoDecoder(extra, caseStrategy, true, getGenerics(t)[0]), (path_15) => ((value_22) => option(uncurry2(decoder_13), path_15, value_22)));
1697
+ case "Microsoft.FSharp.Collections.FSharpList`1[System.Object]":
1698
+ return (decoder_14 = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]), (path_16) => ((value_23) => list(uncurry2(decoder_14), path_16, value_23)));
1699
+ case "System.Collections.Generic.IEnumerable`1[System.Object]":
1700
+ return (decoder_15 = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]), (path_17) => ((value_24) => seq(uncurry2(decoder_15), path_17, value_24)));
1701
+ case "Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]": {
1702
+ const keyDecoder = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]);
1703
+ const valueDecoder = autoDecoder(extra, caseStrategy, false, getGenerics(t)[1]);
1704
+ let d_20;
1705
+ const decoders_1 = ofArray([(path_18) => ((value_25) => autoObject2(uncurry2(keyDecoder), uncurry2(valueDecoder), path_18, value_25)), (decoder_16 = tuple2(uncurry2(keyDecoder), uncurry2(valueDecoder)), (path_19) => ((value_26) => list(uncurry2(decoder_16), path_19, value_26)))]);
1706
+ d_20 = ((path_20) => ((value_27) => oneOf(decoders_1, path_20, value_27)));
1707
+ return (path_21) => ((value_29) => map(toMap, uncurry2(d_20), path_21, value_29));
1708
+ }
1709
+ case "Microsoft.FSharp.Collections.FSharpSet`1[System.Object]": {
1710
+ const decoder_17 = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]);
1711
+ return (path_22) => ((value_30) => {
1712
+ const matchValue_7 = array(uncurry2(decoder_17), path_22, value_30);
1713
+ return (matchValue_7.tag === 0) ? (new FSharpResult$2(0, [toSet(matchValue_7.fields[0])])) : (new FSharpResult$2(1, [matchValue_7.fields[0]]));
1714
+ });
1715
+ }
1716
+ default:
1717
+ return autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t);
1718
+ }
1719
+ }
1720
+ }
1721
+ else {
1722
+ switch (fullname) {
1723
+ case "System.Boolean":
1724
+ return (path_23) => ((value_32) => bool(path_23, value_32));
1725
+ case "Microsoft.FSharp.Core.Unit":
1726
+ return (path_24) => ((value_33) => unit(path_24, value_33));
1727
+ case "System.String":
1728
+ return (path_25) => ((value_34) => string(path_25, value_34));
1729
+ case "System.Char":
1730
+ return (path_26) => ((value_35) => char(path_26, value_35));
1731
+ case "System.SByte":
1732
+ return sbyte;
1733
+ case "System.Byte":
1734
+ return byte;
1735
+ case "System.Int16":
1736
+ return int16;
1737
+ case "System.UInt16":
1738
+ return uint16;
1739
+ case "System.Int32":
1740
+ return int;
1741
+ case "System.UInt32":
1742
+ return uint32;
1743
+ case "System.Double":
1744
+ return (path_27) => ((value_36) => float(path_27, value_36));
1745
+ case "System.Single":
1746
+ return (path_28) => ((value_37) => float32(path_28, value_37));
1747
+ case "System.DateTime":
1748
+ return (path_29) => ((value_38) => datetimeUtc(path_29, value_38));
1749
+ case "System.DateTimeOffset":
1750
+ return (path_30) => ((value_39) => datetimeOffset(path_30, value_39));
1751
+ case "System.TimeSpan":
1752
+ return (path_31) => ((value_40) => timespan(path_31, value_40));
1753
+ case "System.Guid":
1754
+ return (path_32) => ((value_41) => guid(path_32, value_41));
1755
+ case "System.Object":
1756
+ return (_arg_6) => ((v) => (new FSharpResult$2(0, [v])));
1757
+ default:
1758
+ return autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t);
1759
+ }
1760
+ }
1761
+ }
1762
+ else {
1763
+ const decoderRef = matchValue;
1764
+ return (path) => ((value_1) => decoderRef.contents(path)(value_1));
1765
+ }
1766
+ }
1767
+
1768
+ function makeExtra(extra) {
1769
+ if (extra != null) {
1770
+ return map_3((_arg, tupledArg) => (new FSharpRef(tupledArg[1])), extra.Coders);
1771
+ }
1772
+ else {
1773
+ return empty_1({
1774
+ Compare: comparePrimitives,
1775
+ });
1776
+ }
1777
+ }
1778
+
1779
+ export class Auto {
1780
+ constructor() {
1781
+ }
1782
+ }
1783
+
1784
+ export function Auto_$reflection() {
1785
+ return class_type("Thoth.Json.Decode.Auto", void 0, Auto);
1786
+ }
1787
+
1788
+ export function Auto_generateBoxedDecoderCached_Z6670B51(t, caseStrategy, extra) {
1789
+ let y_1, y;
1790
+ const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0, []));
1791
+ return Util_Cache$1__GetOrAdd_43981464(Util_CachedDecoders, (y_1 = ((y = fullName_1(t), toString_12(caseStrategy_1) + y)), defaultArg(map_4((e) => e.Hash, extra), "") + y_1), () => autoDecoder(makeExtra(extra), caseStrategy_1, false, t));
1792
+ }
1793
+
1794
+ export function Auto_generateBoxedDecoder_Z6670B51(t, caseStrategy, extra) {
1795
+ const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0, []));
1796
+ return autoDecoder(makeExtra(extra), caseStrategy_1, false, t);
1797
+ }
1798
+