volview 4.0.0 → 4.0.1

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 (404) hide show
  1. package/dist/css/app.925b979f.css +1 -0
  2. package/dist/css/chunk-vendors.43a6a19a.css +5 -0
  3. package/{public → dist}/favicon.ico +0 -0
  4. package/{public → dist}/global.css +0 -0
  5. package/{src/assets/KitwareHeadAndNeck.jpg → dist/img/KitwareHeadAndNeck.11db5ffb.jpg} +0 -0
  6. package/dist/index.html +1 -0
  7. package/dist/itk/image-io/BMPImageIOReadImage.js +1 -0
  8. package/dist/itk/image-io/BMPImageIOReadImage.umd.js +1 -0
  9. package/dist/itk/image-io/BMPImageIOReadImage.wasm +0 -0
  10. package/dist/itk/image-io/BMPImageIOWriteImage.js +1 -0
  11. package/dist/itk/image-io/BMPImageIOWriteImage.umd.js +1 -0
  12. package/dist/itk/image-io/BMPImageIOWriteImage.wasm +0 -0
  13. package/dist/itk/image-io/GDCMImageIOReadImage.js +1 -0
  14. package/dist/itk/image-io/GDCMImageIOReadImage.umd.js +1 -0
  15. package/dist/itk/image-io/GDCMImageIOReadImage.wasm +0 -0
  16. package/dist/itk/image-io/GDCMImageIOWriteImage.js +1 -0
  17. package/dist/itk/image-io/GDCMImageIOWriteImage.umd.js +1 -0
  18. package/dist/itk/image-io/GDCMImageIOWriteImage.wasm +0 -0
  19. package/dist/itk/image-io/JPEGImageIOReadImage.js +1 -0
  20. package/dist/itk/image-io/JPEGImageIOReadImage.umd.js +1 -0
  21. package/dist/itk/image-io/JPEGImageIOReadImage.wasm +0 -0
  22. package/dist/itk/image-io/JPEGImageIOWriteImage.js +1 -0
  23. package/dist/itk/image-io/JPEGImageIOWriteImage.umd.js +1 -0
  24. package/dist/itk/image-io/JPEGImageIOWriteImage.wasm +0 -0
  25. package/dist/itk/image-io/MetaImageIOReadImage.js +1 -0
  26. package/dist/itk/image-io/MetaImageIOReadImage.umd.js +1 -0
  27. package/dist/itk/image-io/MetaImageIOReadImage.wasm +0 -0
  28. package/dist/itk/image-io/MetaImageIOWriteImage.js +1 -0
  29. package/dist/itk/image-io/MetaImageIOWriteImage.umd.js +1 -0
  30. package/dist/itk/image-io/MetaImageIOWriteImage.wasm +0 -0
  31. package/dist/itk/image-io/NiftiImageIOReadImage.js +1 -0
  32. package/dist/itk/image-io/NiftiImageIOReadImage.umd.js +1 -0
  33. package/dist/itk/image-io/NiftiImageIOReadImage.wasm +0 -0
  34. package/dist/itk/image-io/NiftiImageIOWriteImage.js +1 -0
  35. package/dist/itk/image-io/NiftiImageIOWriteImage.umd.js +1 -0
  36. package/dist/itk/image-io/NiftiImageIOWriteImage.wasm +0 -0
  37. package/dist/itk/image-io/NrrdImageIOReadImage.js +1 -0
  38. package/dist/itk/image-io/NrrdImageIOReadImage.umd.js +1 -0
  39. package/dist/itk/image-io/NrrdImageIOReadImage.wasm +0 -0
  40. package/dist/itk/image-io/NrrdImageIOWriteImage.js +1 -0
  41. package/dist/itk/image-io/NrrdImageIOWriteImage.umd.js +1 -0
  42. package/dist/itk/image-io/NrrdImageIOWriteImage.wasm +0 -0
  43. package/dist/itk/image-io/PNGImageIOReadImage.js +1 -0
  44. package/dist/itk/image-io/PNGImageIOReadImage.umd.js +1 -0
  45. package/dist/itk/image-io/PNGImageIOReadImage.wasm +0 -0
  46. package/dist/itk/image-io/PNGImageIOWriteImage.js +1 -0
  47. package/dist/itk/image-io/PNGImageIOWriteImage.umd.js +1 -0
  48. package/dist/itk/image-io/PNGImageIOWriteImage.wasm +0 -0
  49. package/dist/itk/image-io/ReadDICOMTags.js +1 -0
  50. package/dist/itk/image-io/ReadDICOMTags.umd.js +1 -0
  51. package/dist/itk/image-io/ReadDICOMTags.wasm +0 -0
  52. package/dist/itk/image-io/ReadImageDICOMFileSeries.js +1 -0
  53. package/dist/itk/image-io/ReadImageDICOMFileSeries.umd.js +1 -0
  54. package/dist/itk/image-io/ReadImageDICOMFileSeries.wasm +0 -0
  55. package/dist/itk/image-io/VTKImageIOReadImage.js +1 -0
  56. package/dist/itk/image-io/VTKImageIOReadImage.umd.js +1 -0
  57. package/dist/itk/image-io/VTKImageIOReadImage.wasm +0 -0
  58. package/dist/itk/image-io/VTKImageIOWriteImage.js +1 -0
  59. package/dist/itk/image-io/VTKImageIOWriteImage.umd.js +1 -0
  60. package/dist/itk/image-io/VTKImageIOWriteImage.wasm +0 -0
  61. package/dist/itk/pipelines/dicom.js +1 -0
  62. package/dist/itk/pipelines/dicom.umd.js +1 -0
  63. package/{src/io/itk-dicom/web-build → dist/itk/pipelines}/dicom.umd.wasm +0 -0
  64. package/{src/io/itk-dicom/web-build → dist/itk/pipelines}/dicom.wasm +0 -0
  65. package/dist/itk/web-workers/IOInput.d.ts +6 -0
  66. package/dist/itk/web-workers/IOInput.js +1 -0
  67. package/dist/itk/web-workers/ITKConfig.d.ts +8 -0
  68. package/dist/itk/web-workers/ITKConfig.js +1 -0
  69. package/dist/itk/web-workers/RunPipelineInput.d.ts +10 -0
  70. package/dist/itk/web-workers/RunPipelineInput.js +1 -0
  71. package/dist/itk/web-workers/WebWorkerInput.d.ts +6 -0
  72. package/dist/itk/web-workers/WebWorkerInput.js +1 -0
  73. package/dist/itk/web-workers/bundles/pipeline.worker.js +1 -0
  74. package/dist/itk/web-workers/loadImageIOPipelineModule.d.ts +4 -0
  75. package/dist/itk/web-workers/loadImageIOPipelineModule.js +1 -0
  76. package/dist/itk/web-workers/loadMeshIOPipelineModule.d.ts +4 -0
  77. package/dist/itk/web-workers/loadMeshIOPipelineModule.js +1 -0
  78. package/dist/itk/web-workers/loadPipelineModule.d.ts +3 -0
  79. package/dist/itk/web-workers/loadPipelineModule.js +1 -0
  80. package/dist/itk/web-workers/min-bundles/pipeline.worker.js +3 -0
  81. package/dist/itk/web-workers/pipeline.worker.d.ts +1 -0
  82. package/dist/itk/web-workers/pipeline.worker.js +1 -0
  83. package/dist/itk/web-workers/runPipeline.d.ts +5 -0
  84. package/dist/itk/web-workers/runPipeline.js +1 -0
  85. package/dist/js/23.be4d694e.js +21 -0
  86. package/dist/js/23.be4d694e.js.map +1 -0
  87. package/dist/js/385.51ca48a2.js +2 -0
  88. package/dist/js/385.51ca48a2.js.map +1 -0
  89. package/dist/js/422.c64a6aa7.js +2 -0
  90. package/dist/js/422.c64a6aa7.js.map +1 -0
  91. package/dist/js/979.c4823352.js +2 -0
  92. package/dist/js/979.c4823352.js.map +1 -0
  93. package/dist/js/app.81e49d9a.js +2 -0
  94. package/dist/js/app.81e49d9a.js.map +1 -0
  95. package/dist/js/chunk-vendors.0ab48f8d.js +33 -0
  96. package/dist/js/chunk-vendors.0ab48f8d.js.map +1 -0
  97. package/{public → dist}/pvm-sample.png +0 -0
  98. package/package.json +3 -2
  99. package/.browserslistrc +0 -4
  100. package/.editorconfig +0 -6
  101. package/.env +0 -6
  102. package/.eslintrc.js +0 -109
  103. package/.gitattributes +0 -1
  104. package/.github/workflows/checks.yml +0 -16
  105. package/.github/workflows/publish.yml +0 -52
  106. package/.prettierignore +0 -5
  107. package/CONTRIBUTING.md +0 -29
  108. package/babel.config.js +0 -3
  109. package/documentation/config.js +0 -15
  110. package/documentation/content/KWVolViewLogo.png +0 -0
  111. package/documentation/content/KWVolViewLogo.svg +0 -35
  112. package/documentation/content/VolViewLogo.png +0 -0
  113. package/documentation/content/VolViewLogo.svg +0 -22
  114. package/documentation/content/doc/index.md +0 -64
  115. package/documentation/content/doc/loading_data.md +0 -30
  116. package/documentation/content/doc/mouse_controls.md +0 -34
  117. package/documentation/content/doc/quick_start_guide.md +0 -75
  118. package/documentation/content/doc/rendering.md +0 -27
  119. package/documentation/content/doc/state_files.md +0 -18
  120. package/documentation/content/doc/toolbar.md +0 -20
  121. package/documentation/content/doc/welcome_screen.md +0 -23
  122. package/documentation/content/gallery/01-volview-welcome-notes.jpg +0 -0
  123. package/documentation/content/gallery/01-volview-welcome.jpg +0 -0
  124. package/documentation/content/gallery/02-volview-about.jpg +0 -0
  125. package/documentation/content/gallery/02-volview-notifications.jpg +0 -0
  126. package/documentation/content/gallery/02-volview-settings.jpg +0 -0
  127. package/documentation/content/gallery/03-volview-sample-datasets.jpg +0 -0
  128. package/documentation/content/gallery/04-volview-active-data.jpg +0 -0
  129. package/documentation/content/gallery/05-volview-select-data-to-delete.jpg +0 -0
  130. package/documentation/content/gallery/06-volview-corner-annotation.jpg +0 -0
  131. package/documentation/content/gallery/07-volview-layout-notes.jpg +0 -0
  132. package/documentation/content/gallery/07-volview-layout.jpg +0 -0
  133. package/documentation/content/gallery/09-volview-layout-3DPrimary.jpg +0 -0
  134. package/documentation/content/gallery/10-volview-wl-pan-zoom-notes.jpg +0 -0
  135. package/documentation/content/gallery/10-volview-wl-pan-zoom.jpg +0 -0
  136. package/documentation/content/gallery/11-volview-paint-notes.jpg +0 -0
  137. package/documentation/content/gallery/11-volview-paint.jpg +0 -0
  138. package/documentation/content/gallery/12-volview-paint-options.jpg +0 -0
  139. package/documentation/content/gallery/13-volview-crop-notes.jpg +0 -0
  140. package/documentation/content/gallery/13-volview-crop.jpg +0 -0
  141. package/documentation/content/gallery/14-volview-ruler.jpg +0 -0
  142. package/documentation/content/gallery/15-volview-crosshairs.jpg +0 -0
  143. package/documentation/content/gallery/16-volview-rendering.jpg +0 -0
  144. package/documentation/content/gallery/17-volview-colormap-notes.jpg +0 -0
  145. package/documentation/content/gallery/17-volview-colormap.jpg +0 -0
  146. package/documentation/content/gallery/17-volview-opacity-notes.jpg +0 -0
  147. package/documentation/content/gallery/17-volview-opacity.jpg +0 -0
  148. package/documentation/content/gallery/17-volview-opacity2.jpg +0 -0
  149. package/documentation/content/gallery/18-volview-presets.jpg +0 -0
  150. package/documentation/content/gallery/19-volview-color.jpg +0 -0
  151. package/documentation/content/gallery/19-volview-color2.jpg +0 -0
  152. package/documentation/content/gallery/20-volview-lightfollowcamera0.jpg +0 -0
  153. package/documentation/content/gallery/20-volview-lightfollowcamera1.jpg +0 -0
  154. package/documentation/content/gallery/20-volview-lightfollowcamera2.jpg +0 -0
  155. package/documentation/content/gallery/20-volview-lightfollowcamera3.jpg +0 -0
  156. package/documentation/content/gallery/21-volview-hybrid-final.jpg +0 -0
  157. package/documentation/content/gallery/21-volview-hybrid0.0.jpg +0 -0
  158. package/documentation/content/gallery/21-volview-hybrid0.5.jpg +0 -0
  159. package/documentation/content/gallery/21-volview-hybrid1.0.jpg +0 -0
  160. package/documentation/content/gallery/LocalAmbientOcclusion.jpg +0 -0
  161. package/documentation/content/gallery/Notes.pptx +0 -0
  162. package/documentation/content/gallery/VolView-Overview.jpg +0 -0
  163. package/documentation/content/gallery/index.md +0 -53
  164. package/documentation/content/icon/favicon-16x16.png +0 -0
  165. package/documentation/content/icon/favicon-196x196.png +0 -0
  166. package/documentation/content/icon/favicon-32x32.png +0 -0
  167. package/documentation/content/icon/favicon-96x96.png +0 -0
  168. package/documentation/content/index.pug +0 -43
  169. package/documentation/content/logo.png +0 -0
  170. package/documentation/content/logo.svg +0 -20
  171. package/documentation/data/menu.yml +0 -3
  172. package/documentation/themes/navy/layout/partial/footer.swig +0 -22
  173. package/documentation/tpl/__en__ +0 -31
  174. package/documentation/tpl/__sidebar__ +0 -11
  175. package/patches/jsdom-global+3.0.2.patch +0 -12
  176. package/patches/vue-toastification+1.7.14.patch +0 -41
  177. package/patches/vuetify+2.6.10.patch +0 -13
  178. package/prettier.config.js +0 -9
  179. package/public/index.html +0 -28
  180. package/server/helper.py +0 -147
  181. package/server/host.js +0 -134
  182. package/server/serialize.js +0 -111
  183. package/server/serialize.py +0 -203
  184. package/server/server.py +0 -84
  185. package/server/test.py +0 -17
  186. package/src/assets/logo.png +0 -0
  187. package/src/assets/logo.svg +0 -20
  188. package/src/assets/samples/3DUS-Fetus.jpg +0 -0
  189. package/src/assets/samples/CTA-Head_and_Neck.jpg +0 -0
  190. package/src/assets/samples/MRA-Head_and_Neck.jpg +0 -0
  191. package/src/assets/samples/MRI-Cardiac.jpg +0 -0
  192. package/src/assets/samples/MRI-PROSTATEx.jpg +0 -0
  193. package/src/components/AboutBox.vue +0 -157
  194. package/src/components/AiModule.vue +0 -60
  195. package/src/components/AnnotationsModule.vue +0 -37
  196. package/src/components/App.vue +0 -539
  197. package/src/components/ColorFunctionSlider.vue +0 -181
  198. package/src/components/DataBrowser.vue +0 -173
  199. package/src/components/DragAndDrop.vue +0 -107
  200. package/src/components/GroupableItem.vue +0 -30
  201. package/src/components/ImageDataBrowser.vue +0 -186
  202. package/src/components/ImageListCard.vue +0 -114
  203. package/src/components/ItemGroup.vue +0 -74
  204. package/src/components/LabelmapList.vue +0 -36
  205. package/src/components/LayoutGrid.vue +0 -96
  206. package/src/components/MeasurementsList.vue +0 -134
  207. package/src/components/MessageCenter.vue +0 -189
  208. package/src/components/MessageItem.vue +0 -83
  209. package/src/components/MessageNotificationContent.vue +0 -20
  210. package/src/components/MessageNotifications.vue +0 -84
  211. package/src/components/ModelBrowser.vue +0 -83
  212. package/src/components/ModulePanel.vue +0 -137
  213. package/src/components/PaintControls.vue +0 -174
  214. package/src/components/PatientBrowser.vue +0 -280
  215. package/src/components/PatientStudyVolumeBrowser.vue +0 -325
  216. package/src/components/RenderingModule.vue +0 -49
  217. package/src/components/ResizableNavDrawer.vue +0 -158
  218. package/src/components/SampleDataBrowser.vue +0 -198
  219. package/src/components/SaveSession.vue +0 -57
  220. package/src/components/Settings.vue +0 -35
  221. package/src/components/SliceSlider.vue +0 -182
  222. package/src/components/SpleenModule.vue +0 -101
  223. package/src/components/ToolButton.vue +0 -58
  224. package/src/components/ToolStrip.vue +0 -186
  225. package/src/components/ViewOverlayGrid.vue +0 -84
  226. package/src/components/VolumePresets.vue +0 -165
  227. package/src/components/VolumeProperties.vue +0 -171
  228. package/src/components/VolumeRendering.vue +0 -365
  229. package/src/components/VtkThreeView.vue +0 -512
  230. package/src/components/VtkTwoView.vue +0 -665
  231. package/src/components/__tests__/ResizableNavDrawer.spec.js +0 -32
  232. package/src/components/__tests__/ToolButton.spec.js +0 -46
  233. package/src/components/icons/KitwareLogoIcon.vue +0 -54
  234. package/src/components/icons/VolViewFullLogo.vue +0 -139
  235. package/src/components/icons/VolViewLogo.vue +0 -78
  236. package/src/components/styles/utils.css +0 -16
  237. package/src/components/styles/vtk-view.css +0 -116
  238. package/src/components/tools/CropTool.vue +0 -61
  239. package/src/components/tools/CrosshairsTool.vue +0 -93
  240. package/src/components/tools/MouseManipulatorTool.vue +0 -108
  241. package/src/components/tools/PaintTool.vue +0 -54
  242. package/src/components/tools/PanTool.vue +0 -35
  243. package/src/components/tools/RulerTool.vue +0 -202
  244. package/src/components/tools/SliceScrollTool.vue +0 -123
  245. package/src/components/tools/WindowLevelTool.vue +0 -191
  246. package/src/components/tools/ZoomTool.vue +0 -35
  247. package/src/components/tools/crop/Crop2D.vue +0 -367
  248. package/src/components/tools/crop/Crop2DLineHandle.vue +0 -103
  249. package/src/components/tools/crop/Crop3D.vue +0 -192
  250. package/src/components/tools/crop/CropControls.vue +0 -38
  251. package/src/components/tools/crop/types.ts +0 -12
  252. package/src/components/tools/crosshairs/CrosshairSVG2D.vue +0 -125
  253. package/src/components/tools/crosshairs/CrosshairsWidget2D.vue +0 -100
  254. package/src/components/tools/paint/PaintWidget2D.vue +0 -192
  255. package/src/components/tools/ruler/RulerSVG2D.vue +0 -181
  256. package/src/components/tools/ruler/RulerWidget2D.vue +0 -154
  257. package/src/composables/__tests__/useDoubleRecord.spec.ts +0 -57
  258. package/src/composables/__tests__/useOrientationLabels.spec.ts +0 -29
  259. package/src/composables/isViewAnimating.ts +0 -25
  260. package/src/composables/manageVTKSubscription.ts +0 -6
  261. package/src/composables/onProxyManagerEvent.ts +0 -50
  262. package/src/composables/proxyManager.ts +0 -13
  263. package/src/composables/sync/__tests__/createPrimitiveSyncContext.spec.ts +0 -41
  264. package/src/composables/sync/__tests__/useWindowingSync.spec.ts +0 -51
  265. package/src/composables/sync/createPrimitiveSyncContext.ts +0 -83
  266. package/src/composables/sync/useWindowingSync.ts +0 -48
  267. package/src/composables/useAppLoadingNotifications.ts +0 -73
  268. package/src/composables/useCameraOrientation.ts +0 -34
  269. package/src/composables/useCurrentImage.ts +0 -74
  270. package/src/composables/useCurrentSlice.ts +0 -43
  271. package/src/composables/useDoubleRecord.ts +0 -77
  272. package/src/composables/useEventListener.ts +0 -26
  273. package/src/composables/useGlobalErrorHook.ts +0 -18
  274. package/src/composables/useMultiSelection.ts +0 -29
  275. package/src/composables/useOrientationLabels.ts +0 -62
  276. package/src/composables/usePanels.ts +0 -42
  277. package/src/composables/usePersistCameraConfig.ts +0 -138
  278. package/src/composables/useResizeObserver.ts +0 -37
  279. package/src/composables/useResizeToFit.ts +0 -50
  280. package/src/composables/useSceneBuilder.ts +0 -96
  281. package/src/composables/useToast.js +0 -11
  282. package/src/composables/useVTKCallback.ts +0 -33
  283. package/src/composables/useVTKWorldToDisplay.ts +0 -141
  284. package/src/composables/useViewProxy.ts +0 -87
  285. package/src/composables/useVolumeThumbnailing.ts +0 -173
  286. package/src/composables/useWebGLWatchdog.ts +0 -32
  287. package/src/composables/useWidgetManager.ts +0 -41
  288. package/src/config.ts +0 -182
  289. package/src/constants.ts +0 -38
  290. package/src/core/id.ts +0 -18
  291. package/src/core/provider.ts +0 -31
  292. package/src/core/proxies.ts +0 -90
  293. package/src/core/thumbnailers/__tests__/vtk-image.spec.ts +0 -58
  294. package/src/core/thumbnailers/index.ts +0 -5
  295. package/src/core/thumbnailers/volume-thumbnailer.ts +0 -130
  296. package/src/core/thumbnailers/vtk-image.ts +0 -142
  297. package/src/core/tools/__tests__/paint.spec.ts +0 -101
  298. package/src/core/tools/__tests__/ruler.spec.ts +0 -73
  299. package/src/core/tools/paint/brush.ts +0 -20
  300. package/src/core/tools/paint/ellipse-brush.ts +0 -96
  301. package/src/core/tools/paint/index.ts +0 -141
  302. package/src/core/tools/ruler.ts +0 -149
  303. package/src/global.d.ts +0 -24
  304. package/src/io/__tests__/io.spec.ts +0 -26
  305. package/src/io/dicom.ts +0 -187
  306. package/src/io/index.ts +0 -11
  307. package/src/io/io.ts +0 -157
  308. package/src/io/itk/itkConfig.js +0 -8
  309. package/src/io/itk-dicom/dicom.cpp +0 -327
  310. package/src/io/itk-dicom/web-build/dicom.js +0 -16
  311. package/src/io/itk-dicom/web-build/dicom.umd.js +0 -21
  312. package/src/io/manifest.ts +0 -30
  313. package/src/io/readers.ts +0 -36
  314. package/src/io/state-file/index.ts +0 -170
  315. package/src/io/state-file/schema.ts +0 -277
  316. package/src/io/state-file/utils.ts +0 -33
  317. package/src/io/types.ts +0 -4
  318. package/src/io/vtk/async.reader.worker.ts +0 -50
  319. package/src/io/vtk/async.ts +0 -58
  320. package/src/io/vtk/async.writer.worker.ts +0 -46
  321. package/src/io/vtk/common.ts +0 -30
  322. package/src/io/zip.ts +0 -31
  323. package/src/main.js +0 -66
  324. package/src/main.ts +0 -1
  325. package/src/plugins/vuetify.js +0 -25
  326. package/src/shims-itk.d.ts +0 -67
  327. package/src/shims-misc.d.ts +0 -4
  328. package/src/shims-tsx.d.ts +0 -13
  329. package/src/shims-vtk.d.ts +0 -1042
  330. package/src/shims-vue.d.ts +0 -5
  331. package/src/store/__tests__/datasets.spec.ts +0 -75
  332. package/src/store/__tests__/messages.spec.ts +0 -74
  333. package/src/store/__tests__/rulers.spec.ts +0 -77
  334. package/src/store/__tests__/view-configs.spec.ts +0 -37
  335. package/src/store/datasets-dicom.ts +0 -398
  336. package/src/store/datasets-files.ts +0 -35
  337. package/src/store/datasets-images.ts +0 -118
  338. package/src/store/datasets-labelmaps.ts +0 -136
  339. package/src/store/datasets-models.ts +0 -25
  340. package/src/store/datasets.ts +0 -341
  341. package/src/store/messages.ts +0 -144
  342. package/src/store/tools/crop.ts +0 -136
  343. package/src/store/tools/crosshairs.ts +0 -131
  344. package/src/store/tools/index.ts +0 -95
  345. package/src/store/tools/paint.ts +0 -191
  346. package/src/store/tools/rulers.ts +0 -305
  347. package/src/store/tools/types.ts +0 -54
  348. package/src/store/view-configs/camera.ts +0 -51
  349. package/src/store/view-configs/common.ts +0 -61
  350. package/src/store/view-configs/slicing.ts +0 -86
  351. package/src/store/view-configs/types.ts +0 -39
  352. package/src/store/view-configs/volume-coloring.ts +0 -193
  353. package/src/store/view-configs/windowing.ts +0 -69
  354. package/src/store/view-configs.ts +0 -78
  355. package/src/store/views.ts +0 -130
  356. package/src/types/index.ts +0 -16
  357. package/src/types/layout.ts +0 -10
  358. package/src/types/lps.ts +0 -40
  359. package/src/types/views.ts +0 -65
  360. package/src/types/vtk-types.ts +0 -29
  361. package/src/utils/__tests__/lps.spec.ts +0 -102
  362. package/src/utils/color.ts +0 -23
  363. package/src/utils/errors.js +0 -3
  364. package/src/utils/fetch.ts +0 -101
  365. package/src/utils/hacks.ts +0 -14
  366. package/src/utils/index.ts +0 -83
  367. package/src/utils/lps.ts +0 -129
  368. package/src/utils/manipulators.ts +0 -35
  369. package/src/utils/promise-worker.ts +0 -45
  370. package/src/utils/vtk-helpers.ts +0 -215
  371. package/src/utils/workerHandler.js +0 -42
  372. package/src/vtk/ColorMaps.ts +0 -72
  373. package/src/vtk/CrosshairsWidget/behavior.ts +0 -112
  374. package/src/vtk/CrosshairsWidget/index.d.ts +0 -22
  375. package/src/vtk/CrosshairsWidget/index.js +0 -73
  376. package/src/vtk/CrosshairsWidget/state.ts +0 -51
  377. package/src/vtk/IJKSliceRepresentationProxy/index.d.ts +0 -9
  378. package/src/vtk/IJKSliceRepresentationProxy/index.js +0 -59
  379. package/src/vtk/LPSView2DProxy/index.d.ts +0 -18
  380. package/src/vtk/LPSView2DProxy/index.js +0 -89
  381. package/src/vtk/LPSView3DProxy/index.d.ts +0 -16
  382. package/src/vtk/LPSView3DProxy/index.js +0 -78
  383. package/src/vtk/LabelMap/index.d.ts +0 -16
  384. package/src/vtk/LabelMap/index.js +0 -49
  385. package/src/vtk/LabelMapSliceRepProxy/index.d.ts +0 -6
  386. package/src/vtk/LabelMapSliceRepProxy/index.js +0 -104
  387. package/src/vtk/MedicalColorPresets.json +0 -1448
  388. package/src/vtk/PaintBrushContextRepresentation/index.js +0 -191
  389. package/src/vtk/PaintWidget/behavior.ts +0 -101
  390. package/src/vtk/PaintWidget/index.d.ts +0 -28
  391. package/src/vtk/PaintWidget/index.js +0 -56
  392. package/src/vtk/PaintWidget/state.ts +0 -41
  393. package/src/vtk/PiecewiseWidget/index.js +0 -203
  394. package/src/vtk/RulerWidget/behavior.ts +0 -185
  395. package/src/vtk/RulerWidget/index.d.ts +0 -25
  396. package/src/vtk/RulerWidget/index.js +0 -79
  397. package/src/vtk/RulerWidget/state.ts +0 -63
  398. package/src/vtk/TreJsonConverter/index.js +0 -150
  399. package/src/vtk/proxy.js +0 -66
  400. package/src/vtk/proxyUtils.js +0 -16
  401. package/src/vtk/webvr-empty.js +0 -1
  402. package/tests/testUtils.js +0 -12
  403. package/tsconfig.json +0 -46
  404. package/vue.config.js +0 -86
@@ -0,0 +1 @@
1
+ var JPEGImageIOReadImage=(()=>{var r="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!==typeof __filename&&(r=r||__filename),function(e){e=e||{};var t,n,o="undefined"!=typeof e?e:{};o["ready"]=new Promise((function(r,e){t=r,n=e}));var a=null,i=null;o["resetModuleStdout"]=function(){a=""},o["resetModuleStderr"]=function(){i=""},o["print"]=function(r){console.log(r),a+=r+"\n"},o["printErr"]=function(r){console.error(r),i+=r+"\n"},o["getModuleStdout"]=function(){return a},o["getModuleStderr"]=function(){return i};a=null,i=null;o["resetModuleStdout"]=function(){a=""},o["resetModuleStderr"]=function(){i=""},o["print"]=function(r){console.log(r),a+=r+"\n"},o["printErr"]=function(r){console.error(r),i+=r+"\n"},o["getModuleStdout"]=function(){return a},o["getModuleStderr"]=function(){return i};var s,u,c,f,d,l,m=Object.assign({},o),h=[],p="./this.program",w=(r,e)=>{throw e},E="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g="";function _(r){return o["locateFile"]?o["locateFile"](r,g):g+r}function k(r){if(r instanceof at)return;let e=r;b("exiting due to exception: "+e)}y?(g=v?require("path").dirname(g)+"/":__dirname+"/",l=()=>{d||(f=require("fs"),d=require("path"))},s=function(r,e){return l(),r=d["normalize"](r),f.readFileSync(r,e?void 0:"utf8")},c=r=>{var e=s(r,!0);return e.buffer||(e=new Uint8Array(e)),e},u=(r,e,t)=>{l(),r=d["normalize"](r),f.readFile(r,(function(r,n){r?t(r):e(n.buffer)}))},process["argv"].length>1&&(p=process["argv"][1].replace(/\\/g,"/")),h=process["argv"].slice(2),process["on"]("uncaughtException",(function(r){if(!(r instanceof at))throw r})),process["on"]("unhandledRejection",(function(r){throw r})),w=(r,e)=>{if(ar())throw process["exitCode"]=r,e;k(e),process["exit"](r)},o["inspect"]=function(){return"[Emscripten Module object]"}):(E||v)&&(v?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},v&&(c=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)});var S=o["print"]||console.log.bind(console),b=o["printErr"]||console.warn.bind(console);Object.assign(o,m),m=null,o["arguments"]&&(h=o["arguments"]),o["thisProgram"]&&(p=o["thisProgram"]),o["quit"]&&(w=o["quit"]);var D,N=0,F=r=>{N=r},O=()=>N;o["wasmBinary"]&&(D=o["wasmBinary"]);var P,A=o["noExitRuntime"]||!0;"object"!=typeof WebAssembly&&yr("no native wasm support detected");var M,R=!1;function T(r,e){r||yr(e)}function C(r){var e=o["_"+r];return e}function I(r,e,t,n,o){var a={string:function(r){var e=0;if(null!==r&&void 0!==r&&0!==r){var t=1+(r.length<<2);e=qe(t),X(r,e,t)}return e},array:function(r){var e=qe(r.length);return Q(r,e),e}};function i(r){return"string"===e?G(r):"boolean"===e?Boolean(r):r}var s=C(r),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var d=a[t[f]];d?(0===c&&(c=We()),u[f]=d(n[f])):u[f]=n[f]}var l=s.apply(null,u);function m(r){return 0!==c&&Ge(c),i(r)}return l=m(l),l}function L(r,e,t,n){t=t||[];var o=t.every((function(r){return"number"===r})),a="string"!==e;return a&&o&&!n?C(r):function(){return I(r,e,t,arguments,n)}}var B,x,z,j,U,H,Y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function W(r,e,t){var n=e+t,o=e;while(r[o]&&!(o>=n))++o;if(o-e>16&&r.buffer&&Y)return Y.decode(r.subarray(e,o));var a="";while(e<o){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var u=63&r[e++];if(i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[e++],i<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function G(r,e){return r?W(z,r,e):""}function q(r,e,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343){var u=r.charCodeAt(++i);s=65536+((1023&s)<<10)|1023&u}if(s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function X(r,e,t){return q(r,z,e,t)}function K(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function V(r){var e="";while(1){var t=z[r++>>0];if(!t)return e;e+=String.fromCharCode(t)}}function J(r){var e=K(r)+1,t=qe(e);return q(r,x,t,e),t}function Q(r,e){x.set(r,e)}function Z(r,e,t){for(var n=0;n<r.length;++n)x[e++>>0]=r.charCodeAt(n);t||(x[e>>0]=0)}function $(r){B=r,o["HEAP8"]=x=new Int8Array(r),o["HEAP16"]=j=new Int16Array(r),o["HEAP32"]=U=new Int32Array(r),o["HEAPU8"]=z=new Uint8Array(r),o["HEAPU16"]=new Uint16Array(r),o["HEAPU32"]=H=new Uint32Array(r),o["HEAPF32"]=new Float32Array(r),o["HEAPF64"]=new Float64Array(r)}o["INITIAL_MEMORY"];var rr,er=[],tr=[],nr=[],or=[];function ar(){return A}function ir(){if(o["preRun"]){"function"==typeof o["preRun"]&&(o["preRun"]=[o["preRun"]]);while(o["preRun"].length)fr(o["preRun"].shift())}Pr(er)}function sr(){!0,o["noFSInit"]||Gr.init.initialized||Gr.init(),Gr.ignorePermissions=!1,zr.init(),Pr(tr)}function ur(){Pr(nr)}function cr(){if(o["postRun"]){"function"==typeof o["postRun"]&&(o["postRun"]=[o["postRun"]]);while(o["postRun"].length)lr(o["postRun"].shift())}Pr(or)}function fr(r){er.unshift(r)}function dr(r){tr.unshift(r)}function lr(r){or.unshift(r)}var mr=0,hr=null,pr=null;function wr(r){return r}function Er(r){mr++,o["monitorRunDependencies"]&&o["monitorRunDependencies"](mr)}function vr(r){if(mr--,o["monitorRunDependencies"]&&o["monitorRunDependencies"](mr),0==mr&&(null!==hr&&(clearInterval(hr),hr=null),pr)){var e=pr;pr=null,e()}}function yr(r){o["onAbort"]&&o["onAbort"](r),r="Aborted("+r+")",b(r),R=!0,M=1,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var gr,_r,kr,Sr="data:application/octet-stream;base64,";function br(r){return r.startsWith(Sr)}function Dr(r){return r.startsWith("file://")}function Nr(r){try{if(r==gr&&D)return new Uint8Array(D);if(c)return c(r);throw"both async and sync fetching of the wasm failed"}catch(b){yr(b)}}function Fr(){if(!D&&(E||v)){if("function"==typeof fetch&&!Dr(gr))return fetch(gr,{credentials:"same-origin"}).then((function(r){if(!r["ok"])throw"failed to load wasm binary file at '"+gr+"'";return r["arrayBuffer"]()})).catch((function(){return Nr(gr)}));if(u)return new Promise((function(r,e){u(gr,(function(e){r(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Nr(gr)}))}function Or(){var r={a:je};function e(r,e){var t=r.exports;o["asm"]=t,P=o["asm"]["O"],$(P.buffer),rr=o["asm"]["_"],dr(o["asm"]["P"]),vr("wasm-instantiate")}function t(r){e(r["instance"])}function a(e){return Fr().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){b("failed to asynchronously prepare wasm: "+r),yr(r)}))}function i(){return D||"function"!=typeof WebAssembly.instantiateStreaming||br(gr)||Dr(gr)||y||"function"!=typeof fetch?a(t):fetch(gr,{credentials:"same-origin"}).then((function(e){var n=WebAssembly.instantiateStreaming(e,r);return n.then(t,(function(r){return b("wasm streaming compile failed: "+r),b("falling back to ArrayBuffer instantiation"),a(t)}))}))}if(Er("wasm-instantiate"),o["instantiateWasm"])try{var s=o["instantiateWasm"](r,e);return s}catch(u){return b("Module.instantiateWasm callback failed with error: "+u),!1}return i().catch(n),{}}function Pr(r){while(r.length>0){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?Mr(t)():Mr(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}gr="JPEGImageIOReadImage.umd.wasm",br(gr)||(gr=_(gr));var Ar=[];function Mr(r){var e=Ar[r];return e||(r>=Ar.length&&(Ar.length=r+1),Ar[r]=e=rr.get(r)),e}function Rr(r){if(r instanceof at||"unwind"==r)return M;w(1,r)}function Tr(r){return He(r+24)+24}function Cr(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(r){H[this.ptr+4>>2]=r},this.get_type=function(){return H[this.ptr+4>>2]},this.set_destructor=function(r){H[this.ptr+8>>2]=r},this.get_destructor=function(){return H[this.ptr+8>>2]},this.set_refcount=function(r){U[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,x[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,x[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=U[this.ptr>>2];U[this.ptr>>2]=r+1},this.release_ref=function(){var r=U[this.ptr>>2];return U[this.ptr>>2]=r-1,1===r},this.set_adjusted_ptr=function(r){H[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return H[this.ptr+16>>2]},this.get_exception_ptr=function(){var r=Xe(this.get_type());if(r)return H[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function Ir(r,e,t){var n=new Cr(r);throw n.init(e,t),r,r}var Lr={isAbs:r=>"/"===r.charAt(0),splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=Lr.isAbs(r),t="/"===r.substr(-1);return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),r||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Lr.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";r=Lr.normalize(r),r=r.replace(/\/$/,"");var e=r.lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments,0);return Lr.normalize(r.join("/"))},join2:(r,e)=>Lr.normalize(r+"/"+e)};function Br(){if("object"==typeof crypto&&"function"==typeof crypto["getRandomValues"]){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(y)try{var e=require("crypto");return function(){return e["randomBytes"](1)[0]}}catch(t){}return function(){yr("randomDevice")}}var xr={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Gr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e=Lr.isAbs(n)}return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),(e?"/":"")+r||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length;e++)if(""!==r[e])break;for(var t=r.length-1;t>=0;t--)if(""!==r[t])break;return e>t?[]:r.slice(e,t-e+1)}r=xr.resolve(r).substr(1),e=xr.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return u=u.concat(o.slice(i)),u.join("/")}},zr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){zr.ttys[r]={input:[],output:[],ops:e},Gr.registerDevice(r,zr.stream_ops)},stream_ops:{open:function(r){var e=zr.ttys[r.node.rdev];if(!e)throw new Gr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Gr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(u){throw new Gr.ErrnoError(29)}if(void 0===s&&0===a)throw new Gr.ErrnoError(6);if(null===s||void 0===s)break;a++,e[t+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Gr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(i){throw new Gr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(y){var t=256,n=Buffer.alloc(t),o=0;try{o=f.readSync(process.stdin.fd,n,0,t,-1)}catch(a){if(!a.toString().includes("EOF"))throw a;o=0}e=o>0?n.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(e=window.prompt("Input: "),null!==e&&(e+="\n")):"function"==typeof readline&&(e=readline(),null!==e&&(e+="\n"));if(!e)return null;r.input=xe(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(S(W(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(S(W(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(b(W(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(b(W(r.output,0)),r.output=[])}}};function jr(r){yr()}var Ur={ops_table:null,mount:function(r){return Ur.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Gr.isBlkdev(t)||Gr.isFIFO(t))throw new Gr.ErrnoError(63);Ur.ops_table||(Ur.ops_table={dir:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,lookup:Ur.node_ops.lookup,mknod:Ur.node_ops.mknod,rename:Ur.node_ops.rename,unlink:Ur.node_ops.unlink,rmdir:Ur.node_ops.rmdir,readdir:Ur.node_ops.readdir,symlink:Ur.node_ops.symlink},stream:{llseek:Ur.stream_ops.llseek}},file:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:{llseek:Ur.stream_ops.llseek,read:Ur.stream_ops.read,write:Ur.stream_ops.write,allocate:Ur.stream_ops.allocate,mmap:Ur.stream_ops.mmap,msync:Ur.stream_ops.msync}},link:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,readlink:Ur.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:Gr.chrdev_stream_ops}});var o=Gr.createNode(r,e,t,n);return Gr.isDir(o.mode)?(o.node_ops=Ur.ops_table.dir.node,o.stream_ops=Ur.ops_table.dir.stream,o.contents={}):Gr.isFile(o.mode)?(o.node_ops=Ur.ops_table.file.node,o.stream_ops=Ur.ops_table.file.stream,o.usedBytes=0,o.contents=null):Gr.isLink(o.mode)?(o.node_ops=Ur.ops_table.link.node,o.stream_ops=Ur.ops_table.link.stream):Gr.isChrdev(o.mode)&&(o.node_ops=Ur.ops_table.chrdev.node,o.stream_ops=Ur.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Gr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Gr.isDir(r.mode)?e.size=4096:Gr.isFile(r.mode)?e.size=r.usedBytes:Gr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Ur.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Gr.genericErrors[44]},mknod:function(r,e,t,n){return Ur.createNode(r,e,t,n)},rename:function(r,e,t){if(Gr.isDir(r.mode)){var n;try{n=Gr.lookupNode(e,t)}catch(a){}if(n)for(var o in n.contents)throw new Gr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Gr.lookupNode(r,e);for(var n in t.contents)throw new Gr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=Ur.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Gr.isLink(r.mode))throw new Gr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write:function(r,e,t,n,o,a){if(e.buffer===x.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(Ur.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Gr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Gr.ErrnoError(28);return n},allocate:function(r,e,t){Ur.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o){if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||s.buffer!==B){if((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),i=!0,a=jr(e),!a)throw new Gr.ErrnoError(48);x.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:function(r,e,t,n,o){if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);if(2&o)return 0;Ur.stream_ops.write(r,e,0,n,t,!1);return 0}}};function Hr(r,e,t,n){var o=n?"":wr("al "+r);u(r,(function(t){T(t,'Loading data file "'+r+'" failed (no arrayBuffer).'),e(new Uint8Array(t)),o&&vr(o)}),(function(e){if(!t)throw'Loading data file "'+r+'" failed.';t()})),o&&Er(o)}var Yr={},Wr={isWindows:!1,staticInit:()=>{Wr.isWindows=!!process.platform.match(/^win/);var r=process["binding"]("constants");r["fs"]&&(r=r["fs"]),Wr.flagsForNodeMap={1024:r["O_APPEND"],64:r["O_CREAT"],128:r["O_EXCL"],256:r["O_NOCTTY"],0:r["O_RDONLY"],2:r["O_RDWR"],4096:r["O_SYNC"],512:r["O_TRUNC"],1:r["O_WRONLY"],131072:r["O_NOFOLLOW"]}},convertNodeCode:r=>{var e=r.code;return Yr[e]},mount:r=>Wr.createNode(null,"/",Wr.getMode(r.opts.root),0),createNode:(r,e,t,n)=>{if(!Gr.isDir(t)&&!Gr.isFile(t)&&!Gr.isLink(t))throw new Gr.ErrnoError(28);var o=Gr.createNode(r,e,t);return o.node_ops=Wr.node_ops,o.stream_ops=Wr.stream_ops,o},getMode:r=>{var e;try{e=f.lstatSync(r),Wr.isWindows&&(e.mode=e.mode|(292&e.mode)>>2)}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Wr.convertNodeCode(t))}return e.mode},realPath:r=>{var e=[];while(r.parent!==r)e.push(r.name),r=r.parent;return e.push(r.mount.opts.root),e.reverse(),Lr.join.apply(null,e)},flagsForNode:r=>{r&=-2097153,r&=-2049,r&=-32769,r&=-524289,r&=-65537;var e=0;for(var t in Wr.flagsForNodeMap)r&t&&(e|=Wr.flagsForNodeMap[t],r^=t);if(r)throw new Gr.ErrnoError(28);return e},node_ops:{getattr:r=>{var e,t=Wr.realPath(r);try{e=f.lstatSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Wr.convertNodeCode(n))}return Wr.isWindows&&!e.blksize&&(e.blksize=4096),Wr.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:(r,e)=>{var t=Wr.realPath(r);try{if(void 0!==e.mode&&(f.chmodSync(t,e.mode),r.mode=e.mode),void 0!==e.timestamp){var n=new Date(e.timestamp);f.utimesSync(t,n,n)}void 0!==e.size&&f.truncateSync(t,e.size)}catch(o){if(!o.code)throw o;throw new Gr.ErrnoError(Wr.convertNodeCode(o))}},lookup:(r,e)=>{var t=Lr.join2(Wr.realPath(r),e),n=Wr.getMode(t);return Wr.createNode(r,e,n)},mknod:(r,e,t,n)=>{var o=Wr.createNode(r,e,t,n),a=Wr.realPath(o);try{Gr.isDir(o.mode)?f.mkdirSync(a,o.mode):f.writeFileSync(a,"",{mode:o.mode})}catch(i){if(!i.code)throw i;throw new Gr.ErrnoError(Wr.convertNodeCode(i))}return o},rename:(r,e,t)=>{var n=Wr.realPath(r),o=Lr.join2(Wr.realPath(e),t);try{f.renameSync(n,o)}catch(a){if(!a.code)throw a;throw new Gr.ErrnoError(Wr.convertNodeCode(a))}r.name=t},unlink:(r,e)=>{var t=Lr.join2(Wr.realPath(r),e);try{f.unlinkSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Wr.convertNodeCode(n))}},rmdir:(r,e)=>{var t=Lr.join2(Wr.realPath(r),e);try{f.rmdirSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Wr.convertNodeCode(n))}},readdir:r=>{var e=Wr.realPath(r);try{return f.readdirSync(e)}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Wr.convertNodeCode(t))}},symlink:(r,e,t)=>{var n=Lr.join2(Wr.realPath(r),e);try{f.symlinkSync(t,n)}catch(o){if(!o.code)throw o;throw new Gr.ErrnoError(Wr.convertNodeCode(o))}},readlink:r=>{var e=Wr.realPath(r);try{return e=f.readlinkSync(e),e=d.relative(d.resolve(r.mount.opts.root),e),e}catch(t){if(!t.code)throw t;if("UNKNOWN"===t.code)throw new Gr.ErrnoError(28);throw new Gr.ErrnoError(Wr.convertNodeCode(t))}}},stream_ops:{open:r=>{var e=Wr.realPath(r.node);try{Gr.isFile(r.node.mode)&&(r.nfd=f.openSync(e,Wr.flagsForNode(r.flags)))}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Wr.convertNodeCode(t))}},close:r=>{try{Gr.isFile(r.node.mode)&&r.nfd&&f.closeSync(r.nfd)}catch(e){if(!e.code)throw e;throw new Gr.ErrnoError(Wr.convertNodeCode(e))}},read:(r,e,t,n,o)=>{if(0===n)return 0;try{return f.readSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(a){throw new Gr.ErrnoError(Wr.convertNodeCode(a))}},write:(r,e,t,n,o)=>{try{return f.writeSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(a){throw new Gr.ErrnoError(Wr.convertNodeCode(a))}},llseek:(r,e,t)=>{var n=e;if(1===t)n+=r.position;else if(2===t&&Gr.isFile(r.node.mode))try{var o=f.fstatSync(r.nfd);n+=o.size}catch(a){throw new Gr.ErrnoError(Wr.convertNodeCode(a))}if(n<0)throw new Gr.ErrnoError(28);return n},mmap:(r,e,t,n,o)=>{if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);var a=jr(e);return Wr.stream_ops.read(r,x,a,e,t),{ptr:a,allocated:!0}},msync:(r,e,t,n,o)=>{if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);if(2&o)return 0;Wr.stream_ops.write(r,e,0,n,t,!1);return 0}}},Gr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(r=xr.resolve(Gr.cwd(),r),!r)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(e=Object.assign(t,e),e.recurse_count>8)throw new Gr.ErrnoError(32);for(var n=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!1),o=Gr.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&e.parent)break;if(o=Gr.lookupNode(o,n[i]),a=Lr.join2(a,n[i]),Gr.isMountpoint(o)&&(!s||s&&e.follow_mount)&&(o=o.mounted.root),!s||e.follow){var u=0;while(Gr.isLink(o.mode)){var c=Gr.readlink(a);a=xr.resolve(Lr.dirname(a),c);var f=Gr.lookupPath(a,{recurse_count:e.recurse_count+1});if(o=f.node,u++>40)throw new Gr.ErrnoError(32)}}}return{path:a,node:o}},getPath:r=>{var e;while(1){if(Gr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Gr.nameTable.length},hashAddNode:r=>{var e=Gr.hashName(r.parent.id,r.name);r.name_next=Gr.nameTable[e],Gr.nameTable[e]=r},hashRemoveNode:r=>{var e=Gr.hashName(r.parent.id,r.name);if(Gr.nameTable[e]===r)Gr.nameTable[e]=r.name_next;else{var t=Gr.nameTable[e];while(t){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}}},lookupNode:(r,e)=>{var t=Gr.mayLookup(r);if(t)throw new Gr.ErrnoError(t,r);for(var n=Gr.hashName(r.id,e),o=Gr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return Gr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new Gr.FSNode(r,e,t,n);return Gr.hashAddNode(o),o},destroyNode:r=>{Gr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768===(61440&r),isDir:r=>16384===(61440&r),isLink:r=>40960===(61440&r),isChrdev:r=>8192===(61440&r),isBlkdev:r=>24576===(61440&r),isFIFO:r=>4096===(61440&r),isSocket:r=>49152===(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=Gr.flagModes[r];if("undefined"==typeof e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>Gr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=Gr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{Gr.lookupNode(r,e);return 20}catch(t){}return Gr.nodePermissions(r,"wx")},mayDelete:(r,e,t)=>{var n;try{n=Gr.lookupNode(r,e)}catch(a){return a.errno}var o=Gr.nodePermissions(r,"wx");if(o)return o;if(t){if(!Gr.isDir(n.mode))return 54;if(Gr.isRoot(n)||Gr.getPath(n)===Gr.cwd())return 10}else if(Gr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?Gr.isLink(r.mode)?32:Gr.isDir(r.mode)&&("r"!==Gr.flagsToPermissionString(e)||512&e)?31:Gr.nodePermissions(r,Gr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=Gr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!Gr.streams[t])return t;throw new Gr.ErrnoError(33)},getStream:r=>Gr.streams[r],createStream:(r,e,t)=>{Gr.FSStream||(Gr.FSStream=function(){this.shared={}},Gr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!==(2097155&this.flags)}},isWrite:{get:function(){return 0!==(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get function(){return this.shared.position},set:function(r){this.shared.position=r}}}),r=Object.assign(new Gr.FSStream,r);var n=Gr.nextfd(e,t);return r.fd=n,Gr.streams[n]=r,r},closeStream:r=>{Gr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=Gr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new Gr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{Gr.devices[r]={stream_ops:e}},getDevice:r=>Gr.devices[r],getMounts:r=>{var e=[],t=[r];while(t.length){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{"function"==typeof r&&(e=r,r=!1),Gr.syncFSRequests++,Gr.syncFSRequests>1&&b("warning: "+Gr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Gr.getMounts(Gr.root.mount),n=0;function o(r){return Gr.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)}))},mount:(r,e,t)=>{var n,o="/"===t,a=!t;if(o&&Gr.root)throw new Gr.ErrnoError(10);if(!o&&!a){var i=Gr.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,Gr.isMountpoint(n))throw new Gr.ErrnoError(10);if(!Gr.isDir(n.mode))throw new Gr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Gr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=Gr.lookupPath(r,{follow_mount:!1});if(!Gr.isMountpoint(e.node))throw new Gr.ErrnoError(28);var t=e.node,n=t.mounted,o=Gr.getMounts(n);Object.keys(Gr.nameTable).forEach((r=>{var e=Gr.nameTable[r];while(e){var t=e.name_next;o.includes(e.mount)&&Gr.destroyNode(e),e=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=Gr.lookupPath(r,{parent:!0}),o=n.node,a=Lr.basename(r);if(!a||"."===a||".."===a)throw new Gr.ErrnoError(28);var i=Gr.mayCreate(o,a);if(i)throw new Gr.ErrnoError(i);if(!o.node_ops.mknod)throw new Gr.ErrnoError(63);return o.node_ops.mknod(o,a,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,Gr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,Gr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Gr.mkdir(n,e)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,e,t)=>("undefined"==typeof t&&(t=e,e=438),e|=8192,Gr.mknod(r,e,t)),symlink:(r,e)=>{if(!xr.resolve(r))throw new Gr.ErrnoError(44);var t=Gr.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new Gr.ErrnoError(44);var o=Lr.basename(e),a=Gr.mayCreate(n,o);if(a)throw new Gr.ErrnoError(a);if(!n.node_ops.symlink)throw new Gr.ErrnoError(63);return n.node_ops.symlink(n,o,r)},rename:(r,e)=>{var t,n,o,a=Lr.dirname(r),i=Lr.dirname(e),s=Lr.basename(r),u=Lr.basename(e);if(t=Gr.lookupPath(r,{parent:!0}),n=t.node,t=Gr.lookupPath(e,{parent:!0}),o=t.node,!n||!o)throw new Gr.ErrnoError(44);if(n.mount!==o.mount)throw new Gr.ErrnoError(75);var c,f=Gr.lookupNode(n,s),d=xr.relative(r,i);if("."!==d.charAt(0))throw new Gr.ErrnoError(28);if(d=xr.relative(e,a),"."!==d.charAt(0))throw new Gr.ErrnoError(55);try{c=Gr.lookupNode(o,u)}catch(h){}if(f!==c){var l=Gr.isDir(f.mode),m=Gr.mayDelete(n,s,l);if(m)throw new Gr.ErrnoError(m);if(m=c?Gr.mayDelete(o,u,l):Gr.mayCreate(o,u),m)throw new Gr.ErrnoError(m);if(!n.node_ops.rename)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(f)||c&&Gr.isMountpoint(c))throw new Gr.ErrnoError(10);if(o!==n&&(m=Gr.nodePermissions(n,"w"),m))throw new Gr.ErrnoError(m);Gr.hashRemoveNode(f);try{n.node_ops.rename(f,o,u)}catch(h){throw h}finally{Gr.hashAddNode(f)}}},rmdir:r=>{var e=Gr.lookupPath(r,{parent:!0}),t=e.node,n=Lr.basename(r),o=Gr.lookupNode(t,n),a=Gr.mayDelete(t,n,!0);if(a)throw new Gr.ErrnoError(a);if(!t.node_ops.rmdir)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(o))throw new Gr.ErrnoError(10);t.node_ops.rmdir(t,n),Gr.destroyNode(o)},readdir:r=>{var e=Gr.lookupPath(r,{follow:!0}),t=e.node;if(!t.node_ops.readdir)throw new Gr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var e=Gr.lookupPath(r,{parent:!0}),t=e.node;if(!t)throw new Gr.ErrnoError(44);var n=Lr.basename(r),o=Gr.lookupNode(t,n),a=Gr.mayDelete(t,n,!1);if(a)throw new Gr.ErrnoError(a);if(!t.node_ops.unlink)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(o))throw new Gr.ErrnoError(10);t.node_ops.unlink(t,n),Gr.destroyNode(o)},readlink:r=>{var e=Gr.lookupPath(r),t=e.node;if(!t)throw new Gr.ErrnoError(44);if(!t.node_ops.readlink)throw new Gr.ErrnoError(28);return xr.resolve(Gr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,e)=>{var t=Gr.lookupPath(r,{follow:!e}),n=t.node;if(!n)throw new Gr.ErrnoError(44);if(!n.node_ops.getattr)throw new Gr.ErrnoError(63);return n.node_ops.getattr(n)},lstat:r=>Gr.stat(r,!0),chmod:(r,e,t)=>{var n;if("string"==typeof r){var o=Gr.lookupPath(r,{follow:!t});n=o.node}else n=r;if(!n.node_ops.setattr)throw new Gr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{Gr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=Gr.getStream(r);if(!t)throw new Gr.ErrnoError(8);Gr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;if("string"==typeof r){var a=Gr.lookupPath(r,{follow:!n});o=a.node}else o=r;if(!o.node_ops.setattr)throw new Gr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{Gr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=Gr.getStream(r);if(!n)throw new Gr.ErrnoError(8);Gr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new Gr.ErrnoError(28);var t;if("string"==typeof r){var n=Gr.lookupPath(r,{follow:!0});t=n.node}else t=r;if(!t.node_ops.setattr)throw new Gr.ErrnoError(63);if(Gr.isDir(t.mode))throw new Gr.ErrnoError(31);if(!Gr.isFile(t.mode))throw new Gr.ErrnoError(28);var o=Gr.nodePermissions(t,"w");if(o)throw new Gr.ErrnoError(o);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=Gr.getStream(r);if(!t)throw new Gr.ErrnoError(8);if(0===(2097155&t.flags))throw new Gr.ErrnoError(28);Gr.truncate(t.node,e)},utime:(r,e,t)=>{var n=Gr.lookupPath(r,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(e,t)})},open:(r,e,t)=>{if(""===r)throw new Gr.ErrnoError(44);var n;if(e="string"==typeof e?Gr.modeStringToFlags(e):e,t="undefined"==typeof t?438:t,t=64&e?4095&t|32768:0,"object"==typeof r)n=r;else{r=Lr.normalize(r);try{var a=Gr.lookupPath(r,{follow:!(131072&e)});n=a.node}catch(c){}}var i=!1;if(64&e)if(n){if(128&e)throw new Gr.ErrnoError(20)}else n=Gr.mknod(r,t,0),i=!0;if(!n)throw new Gr.ErrnoError(44);if(Gr.isChrdev(n.mode)&&(e&=-513),65536&e&&!Gr.isDir(n.mode))throw new Gr.ErrnoError(54);if(!i){var s=Gr.mayOpen(n,e);if(s)throw new Gr.ErrnoError(s)}512&e&&!i&&Gr.truncate(n,0),e&=-131713;var u=Gr.createStream({node:n,path:Gr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!o["logReadFiles"]||1&e||(Gr.readFiles||(Gr.readFiles={}),r in Gr.readFiles||(Gr.readFiles[r]=1)),u},close:r=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{Gr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Gr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Gr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new Gr.ErrnoError(28);if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(1===(2097155&r.flags))throw new Gr.ErrnoError(8);if(Gr.isDir(r.node.mode))throw new Gr.ErrnoError(31);if(!r.stream_ops.read)throw new Gr.ErrnoError(28);var a="undefined"!=typeof o;if(a){if(!r.seekable)throw new Gr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write:(r,e,t,n,o,a)=>{if(n<0||o<0)throw new Gr.ErrnoError(28);if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(0===(2097155&r.flags))throw new Gr.ErrnoError(8);if(Gr.isDir(r.node.mode))throw new Gr.ErrnoError(31);if(!r.stream_ops.write)throw new Gr.ErrnoError(28);r.seekable&&1024&r.flags&&Gr.llseek(r,0,2);var i="undefined"!=typeof o;if(i){if(!r.seekable)throw new Gr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},allocate:(r,e,t)=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(e<0||t<=0)throw new Gr.ErrnoError(28);if(0===(2097155&r.flags))throw new Gr.ErrnoError(8);if(!Gr.isFile(r.node.mode)&&!Gr.isDir(r.node.mode))throw new Gr.ErrnoError(43);if(!r.stream_ops.allocate)throw new Gr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o)=>{if(0!==(2&n)&&0===(2&o)&&2!==(2097155&r.flags))throw new Gr.ErrnoError(2);if(1===(2097155&r.flags))throw new Gr.ErrnoError(2);if(!r.stream_ops.mmap)throw new Gr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new Gr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var t,n=Gr.open(r,e.flags),o=Gr.stat(r),a=o.size,i=new Uint8Array(a);return Gr.read(n,i,0,a,0),"utf8"===e.encoding?t=W(i,0):"binary"===e.encoding&&(t=i),Gr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=Gr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(K(e)+1),a=q(e,o,0,o.length);Gr.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Gr.write(n,e,0,e.byteLength,void 0,t.canOwn)}Gr.close(n)},cwd:()=>Gr.currentPath,chdir:r=>{var e=Gr.lookupPath(r,{follow:!0});if(null===e.node)throw new Gr.ErrnoError(44);if(!Gr.isDir(e.node.mode))throw new Gr.ErrnoError(54);var t=Gr.nodePermissions(e.node,"x");if(t)throw new Gr.ErrnoError(t);Gr.currentPath=e.path},createDefaultDirectories:()=>{Gr.mkdir("/tmp"),Gr.mkdir("/home"),Gr.mkdir("/home/web_user")},createDefaultDevices:()=>{Gr.mkdir("/dev"),Gr.registerDevice(Gr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),Gr.mkdev("/dev/null",Gr.makedev(1,3)),zr.register(Gr.makedev(5,0),zr.default_tty_ops),zr.register(Gr.makedev(6,0),zr.default_tty1_ops),Gr.mkdev("/dev/tty",Gr.makedev(5,0)),Gr.mkdev("/dev/tty1",Gr.makedev(6,0));var r=Br();Gr.createDevice("/dev","random",r),Gr.createDevice("/dev","urandom",r),Gr.mkdir("/dev/shm"),Gr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Gr.mkdir("/proc");var r=Gr.mkdir("/proc/self");Gr.mkdir("/proc/self/fd"),Gr.mount({mount:()=>{var e=Gr.createNode(r,"fd",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=Gr.getStream(t);if(!n)throw new Gr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{o["stdin"]?Gr.createDevice("/dev","stdin",o["stdin"]):Gr.symlink("/dev/tty","/dev/stdin"),o["stdout"]?Gr.createDevice("/dev","stdout",null,o["stdout"]):Gr.symlink("/dev/tty","/dev/stdout"),o["stderr"]?Gr.createDevice("/dev","stderr",null,o["stderr"]):Gr.symlink("/dev/tty1","/dev/stderr");Gr.open("/dev/stdin",0),Gr.open("/dev/stdout",1),Gr.open("/dev/stderr",1)},ensureErrnoError:()=>{Gr.ErrnoError||(Gr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Gr.ErrnoError.prototype=new Error,Gr.ErrnoError.prototype.constructor=Gr.ErrnoError,[44].forEach((r=>{Gr.genericErrors[r]=new Gr.ErrnoError(r),Gr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{Gr.ensureErrnoError(),Gr.nameTable=new Array(4096),Gr.mount(Ur,{},"/"),Gr.createDefaultDirectories(),Gr.createDefaultDevices(),Gr.createSpecialDirectories(),Gr.filesystems={MEMFS:Ur,NODEFS:Wr}},init:(r,e,t)=>{Gr.init.initialized=!0,Gr.ensureErrnoError(),o["stdin"]=r||o["stdin"],o["stdout"]=e||o["stdout"],o["stderr"]=t||o["stderr"],Gr.createStandardStreams()},quit:()=>{Gr.init.initialized=!1;for(var r=0;r<Gr.streams.length;r++){var e=Gr.streams[r];e&&Gr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=Gr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{var t=Gr.lookupPath(r,{follow:!e});r=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{t=Gr.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Lr.basename(r),t=Gr.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(o){n.error=o.errno}return n},createPath:(r,e,t,n)=>{r="string"==typeof r?r:Gr.getPath(r);var o=e.split("/").reverse();while(o.length){var a=o.pop();if(a){var i=Lr.join2(r,a);try{Gr.mkdir(i)}catch(s){}r=i}}return i},createFile:(r,e,t,n,o)=>{var a=Lr.join2("string"==typeof r?r:Gr.getPath(r),e),i=Gr.getMode(n,o);return Gr.create(a,i)},createDataFile:(r,e,t,n,o,a)=>{var i=e;r&&(r="string"==typeof r?r:Gr.getPath(r),i=e?Lr.join2(r,e):r);var s=Gr.getMode(n,o),u=Gr.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,d=t.length;f<d;++f)c[f]=t.charCodeAt(f);t=c}Gr.chmod(u,146|s);var l=Gr.open(u,577);Gr.write(l,t,0,t.length,0,a),Gr.close(l),Gr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=Lr.join2("string"==typeof r?r:Gr.getPath(r),e),a=Gr.getMode(!!t,!!n);Gr.createDevice.major||(Gr.createDevice.major=64);var i=Gr.makedev(Gr.createDevice.major++,0);return Gr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(c){throw new Gr.ErrnoError(29)}if(void 0===u&&0===i)throw new Gr.ErrnoError(6);if(null===u||void 0===u)break;i++,e[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,e,t,o,a)=>{for(var i=0;i<o;i++)try{n(e[t+i])}catch(s){throw new Gr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),Gr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=xe(s(r.url),!0),r.usedBytes=r.contents.length}catch(e){throw new Gr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):xe(o.responseText||"",!0)},u=this;u.setDataGetter((r=>{var e=r*i,t=(r+1)*i-1;if(t=Math.min(t,n-1),"undefined"==typeof u.chunks[r]&&(u.chunks[r]=s(e,t)),"undefined"==typeof u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=Gr.createFile(r,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={},f=Object.keys(u.stream_ops);function d(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return f.forEach((r=>{var e=u.stream_ops[r];c[r]=function(){return Gr.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(r,e,t,n,o)=>(Gr.forceLoadFile(u),d(r,e,t,n,o)),c.mmap=(r,e,t,n,o)=>{Gr.forceLoadFile(u);var a=jr(e);if(!a)throw new Gr.ErrnoError(48);return d(r,x,a,e,t),{ptr:a,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(r,e,t,n,o,a,i,s,u,c)=>{var f=e?xr.resolve(Lr.join2(r,e)):r,d=wr("cp "+f);function l(t){function l(t){c&&c(),s||Gr.createDataFile(r,e,t,n,o,u),a&&a(),vr(d)}Browser.handledByPreloadPlugin(t,f,l,(()=>{i&&i(),vr(d)}))||l(t)}Er(d),"string"==typeof t?Hr(t,(r=>l(r)),i):l(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Gr.indexedDB();try{var o=n.open(Gr.DB_NAME(),Gr.DB_VERSION)}catch(a){return t(a)}o.onupgradeneeded=()=>{S("creating db");var r=o.result;r.createObjectStore(Gr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result,a=n.transaction([Gr.DB_STORE_NAME],"readwrite"),i=a.objectStore(Gr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach((r=>{var e=i.put(Gr.analyzePath(r).object.contents,r);e.onsuccess=()=>{s++,s+u==c&&f()},e.onerror=()=>{u++,s+u==c&&f()}})),a.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Gr.indexedDB();try{var o=n.open(Gr.DB_NAME(),Gr.DB_VERSION)}catch(a){return t(a)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([Gr.DB_STORE_NAME],"readonly")}catch(a){return void t(a)}var s=i.objectStore(Gr.DB_STORE_NAME),u=0,c=0,f=r.length;function d(){0==c?e():t()}r.forEach((r=>{var e=s.get(r);e.onsuccess=()=>{Gr.analyzePath(r).exists&&Gr.unlink(r),Gr.createDataFile(Lr.dirname(r),Lr.basename(r),e.result,!0,!0,!0),u++,u+c==f&&d()},e.onerror=()=>{c++,u+c==f&&d()}})),i.onerror=t},o.onerror=t}},qr={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if(Lr.isAbs(e))return e;var n;if(-100===r)n=Gr.cwd();else{var o=Gr.getStream(r);if(!o)throw new Gr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Gr.ErrnoError(44);return n}return Lr.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(o){if(o&&o.node&&Lr.normalize(e)!==Lr.normalize(Gr.getPath(o.node)))return-54;throw o}return U[t>>2]=n.dev,U[t+4>>2]=0,U[t+8>>2]=n.ino,U[t+12>>2]=n.mode,U[t+16>>2]=n.nlink,U[t+20>>2]=n.uid,U[t+24>>2]=n.gid,U[t+28>>2]=n.rdev,U[t+32>>2]=0,kr=[n.size>>>0,(_r=n.size,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+40>>2]=kr[0],U[t+44>>2]=kr[1],U[t+48>>2]=4096,U[t+52>>2]=n.blocks,U[t+56>>2]=n.atime.getTime()/1e3|0,U[t+60>>2]=0,U[t+64>>2]=n.mtime.getTime()/1e3|0,U[t+68>>2]=0,U[t+72>>2]=n.ctime.getTime()/1e3|0,U[t+76>>2]=0,kr=[n.ino>>>0,(_r=n.ino,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+80>>2]=kr[0],U[t+84>>2]=kr[1],0},doMsync:function(r,e,t,n,o){var a=z.slice(r,r+t);Gr.msync(e,a,o,t,n)},varargs:void 0,get:function(){qr.varargs+=4;var r=U[qr.varargs-4>>2];return r},getStr:function(r){var e=G(r);return e},getStreamFromFD:function(r){var e=Gr.getStream(r);if(!e)throw new Gr.ErrnoError(8);return e}};function Xr(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e),-8&t)return-28;var o=Gr.lookupPath(e,{follow:!0}),a=o.node;if(!a)return-44;var i="";return 4&t&&(i+="r"),2&t&&(i+="w"),1&t&&(i+="x"),i&&Gr.nodePermissions(a,i)?-2:0}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function Kr(r){return U[Ue()>>2]=r,r}function Vr(r,e,t){qr.varargs=t;try{var n=qr.getStreamFromFD(r);switch(e){case 0:var o,a=qr.get();return a<0?-28:(o=Gr.createStream(n,a),o.fd);case 1:case 2:return 0;case 3:return n.flags;case 4:a=qr.get();return n.flags|=a,0;case 5:a=qr.get();var i=0;return j[a+i>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Kr(28),-1;default:return-28}}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function Jr(r,e){try{if(0===e)return-28;var t=Gr.cwd(),n=K(t)+1;return e<n?-68:(X(t,r,e),n)}catch(o){if("undefined"==typeof Gr||!(o instanceof Gr.ErrnoError))throw o;return-o.errno}}function Qr(r,e,t){qr.varargs=t;try{var n=qr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=qr.get();return U[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=qr.get();return Gr.ioctl(n,e,o);case 21523:return n.tty?0:-59;case 21524:return n.tty?0:-59;default:yr("bad ioctl syscall "+e)}}catch(a){if("undefined"==typeof Gr||!(a instanceof Gr.ErrnoError))throw a;return-a.errno}}function Zr(r,e){try{return r=qr.getStr(r),qr.doStat(Gr.lstat,r,e)}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return-t.errno}}function $r(r,e,t){try{return e=qr.getStr(e),e=qr.calculateAt(r,e),e=Lr.normalize(e),"/"===e[e.length-1]&&(e=e.substr(0,e.length-1)),Gr.mkdir(e,t,0),0}catch(n){if("undefined"==typeof Gr||!(n instanceof Gr.ErrnoError))throw n;return-n.errno}}function re(r,e,t,n){try{e=qr.getStr(e);var o=256&n,a=4096&n;return n&=-4353,e=qr.calculateAt(r,e,a),qr.doStat(o?Gr.lstat:Gr.stat,e,t)}catch(i){if("undefined"==typeof Gr||!(i instanceof Gr.ErrnoError))throw i;return-i.errno}}function ee(r,e,t,n){qr.varargs=n;try{e=qr.getStr(e),e=qr.calculateAt(r,e);var o=n?qr.get():0;return Gr.open(e,t,o).fd}catch(a){if("undefined"==typeof Gr||!(a instanceof Gr.ErrnoError))throw a;return-a.errno}}function te(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e),n<=0)return-28;var o=Gr.readlink(e),a=Math.min(n,K(o)),i=x[t+a];return X(o,t,n+1),x[t+a]=i,a}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function ne(r,e){try{return r=qr.getStr(r),qr.doStat(Gr.stat,r,e)}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return-t.errno}}function oe(r,e,t){try{return e=qr.getStr(e),e=qr.calculateAt(r,e),0===t?Gr.unlink(e):512===t?Gr.rmdir(e):yr("Invalid flags passed to unlinkat"),0}catch(n){if("undefined"==typeof Gr||!(n instanceof Gr.ErrnoError))throw n;return-n.errno}}function ae(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e,!0),t){var o=U[t>>2],a=U[t+4>>2];i=1e3*o+a/1e6,t+=8,o=U[t>>2],a=U[t+4>>2],s=1e3*o+a/1e6}else var i=Date.now(),s=i;return Gr.utime(e,i,s),0}catch(u){if("undefined"==typeof Gr||!(u instanceof Gr.ErrnoError))throw u;return-u.errno}}function ie(){throw 1/0}function se(){yr("")}function ue(r,e,t){z.copyWithin(r,e,e+t)}function ce(){return 2147483648}function fe(r){try{return P.grow(r-B.byteLength+65535>>>16),$(P.buffer),1}catch(e){}}function de(r){var e=z.length;r>>>=0;var t=ce();if(r>t)return!1;let n=(r,e)=>r+(e-r%e)%e;for(var o=1;o<=4;o*=2){var a=e*(1+.2/o);a=Math.min(a,r+100663296);var i=Math.min(t,n(Math.max(r,a),65536)),s=fe(i);if(s)return!0}return!1}var le={};function me(){return p||"./this.program"}function he(){if(!he.strings){var r=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:me()};for(var t in le)void 0===le[t]?delete e[t]:e[t]=le[t];var n=[];for(var t in e)n.push(t+"="+e[t]);he.strings=n}return he.strings}function pe(r,e){var t=0;return he().forEach((function(n,o){var a=e+t;H[r+4*o>>2]=a,Z(n,a),t+=n.length+1})),0}function we(r,e){var t=he();H[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),H[e>>2]=n,0}function Ee(r){ut(r)}function ve(r){try{var e=qr.getStreamFromFD(r);return Gr.close(e),0}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return t.errno}}function ye(r,e){try{var t=qr.getStreamFromFD(r),n=t.tty?2:Gr.isDir(t.mode)?3:Gr.isLink(t.mode)?7:4;return x[e>>0]=n,0}catch(o){if("undefined"==typeof Gr||!(o instanceof Gr.ErrnoError))throw o;return o.errno}}function ge(r,e,t,n){for(var o=0,a=0;a<t;a++){var i=H[e>>2],s=H[e+4>>2];e+=8;var u=Gr.read(r,x,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}function _e(r,e,t,n){try{var o=qr.getStreamFromFD(r),a=ge(o,e,t);return U[n>>2]=a,0}catch(i){if("undefined"==typeof Gr||!(i instanceof Gr.ErrnoError))throw i;return i.errno}}function ke(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN}function Se(r,e,t,n,o){try{var a=ke(e,t);if(isNaN(a))return 61;var i=qr.getStreamFromFD(r);return Gr.llseek(i,a,n),kr=[i.position>>>0,(_r=i.position,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[o>>2]=kr[0],U[o+4>>2]=kr[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return s.errno}}function be(r,e,t,n){for(var o=0,a=0;a<t;a++){var i=H[e>>2],s=H[e+4>>2];e+=8;var u=Gr.write(r,x,i,s,n);if(u<0)return-1;o+=u}return o}function De(r,e,t,n){try{var o=qr.getStreamFromFD(r),a=be(o,e,t);return H[n>>2]=a,0}catch(i){if("undefined"==typeof Gr||!(i instanceof Gr.ErrnoError))throw i;return i.errno}}function Ne(){return O()}function Fe(r){F(r)}function Oe(r){return r%4===0&&(r%100!==0||r%400===0)}function Pe(r,e){for(var t=0,n=0;n<=e;t+=r[n++]);return t}var Ae=[31,29,31,30,31,30,31,31,30,31,30,31],Me=[31,28,31,30,31,30,31,31,30,31,30,31];function Re(r,e){var t=new Date(r.getTime());while(e>0){var n=Oe(t.getFullYear()),o=t.getMonth(),a=(n?Ae:Me)[o];if(!(e>a-t.getDate()))return t.setDate(t.getDate()+e),t;e-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}function Te(r,e,t,n){var o=U[n+40>>2],a={tm_sec:U[n>>2],tm_min:U[n+4>>2],tm_hour:U[n+8>>2],tm_mday:U[n+12>>2],tm_mon:U[n+16>>2],tm_year:U[n+20>>2],tm_wday:U[n+24>>2],tm_yday:U[n+28>>2],tm_isdst:U[n+32>>2],tm_gmtoff:U[n+36>>2],tm_zone:o?G(o):""},i=G(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(r,e,t){var n="number"==typeof r?r.toString():r||"";while(n.length<e)n=t[0]+n;return n}function l(r,e){return d(r,e,"0")}function m(r,e){function t(r){return r<0?-1:r>0?1:0}var n;return 0===(n=t(r.getFullYear()-e.getFullYear()))&&0===(n=t(r.getMonth()-e.getMonth()))&&(n=t(r.getDate()-e.getDate())),n}function h(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function p(r){var e=Re(new Date(r.tm_year+1900,0,1),r.tm_yday),t=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=h(t),a=h(n);return m(o,e)<=0?m(a,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var w={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){var e=r.tm_year+1900;return l(e/100|0,2)},"%d":function(r){return l(r.tm_mday,2)},"%e":function(r){return d(r.tm_mday,2," ")},"%g":function(r){return p(r).toString().substring(2)},"%G":function(r){return p(r)},"%H":function(r){return l(r.tm_hour,2)},"%I":function(r){var e=r.tm_hour;return 0==e?e=12:e>12&&(e-=12),l(e,2)},"%j":function(r){return l(r.tm_mday+Pe(Oe(r.tm_year+1900)?Ae:Me,r.tm_mon-1),3)},"%m":function(r){return l(r.tm_mon+1,2)},"%M":function(r){return l(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return l(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var e=r.tm_yday+7-r.tm_wday;return l(Math.floor(e/7),2)},"%V":function(r){var e=Math.floor((r.tm_yday+7-(r.tm_wday+6)%7)/7);if((r.tm_wday+371-r.tm_yday-2)%7<=2&&e++,e){if(53==e){var t=(r.tm_wday+371-r.tm_yday)%7;4==t||3==t&&Oe(r.tm_year)||(e=1)}}else{e=52;var n=(r.tm_wday+7-r.tm_yday-1)%7;(4==n||5==n&&Oe(r.tm_year%400-1))&&e++}return l(e,2)},"%w":function(r){return r.tm_wday},"%W":function(r){var e=r.tm_yday+7-(r.tm_wday+6)%7;return l(Math.floor(e/7),2)},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var e=r.tm_gmtoff,t=e>=0;return e=Math.abs(e)/60,e=e/60*100+e%60,(t?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\0\0"),w)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),w[u](a)));i=i.replace(/\0\0/g,"%");var E=xe(i,!1);return E.length>e?0:(Q(E,r),E.length-1)}function Ce(r,e,t,n){return Te(r,e,t,n)}var Ie=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Gr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},Le=365,Be=146;function xe(r,e,t){var n=t>0?t:K(r)+1,o=new Array(n),a=q(r,o,0,o.length);return e&&(o.length=a),o}Object.defineProperties(Ie.prototype,{read:{get:function(){return(this.mode&Le)===Le},set:function(r){r?this.mode|=Le:this.mode&=~Le}},write:{get:function(){return(this.mode&Be)===Be},set:function(r){r?this.mode|=Be:this.mode&=~Be}},isFolder:{get:function(){return Gr.isDir(this.mode)}},isDevice:{get:function(){return Gr.isChrdev(this.mode)}}}),Gr.FSNode=Ie,Gr.staticInit(),o["FS_createPath"]=Gr.createPath,o["FS_createDataFile"]=Gr.createDataFile,o["FS_createPreloadedFile"]=Gr.createPreloadedFile,o["FS_unlink"]=Gr.unlink,o["FS_createLazyFile"]=Gr.createLazyFile,o["FS_createDevice"]=Gr.createDevice,y&&(l(),Wr.staticInit()),Yr={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var ze,je={d:Tr,g:Ir,y:Xr,q:Vr,M:Jr,v:Qr,H:Zr,F:$r,G:re,w:ee,E:te,I:ne,D:oe,C:ae,A:ie,n:se,N:ue,p:de,K:pe,L:we,s:Ee,r:ve,J:ye,u:_e,x:Se,t:De,a:Ne,m:tt,h:Ke,e:Qe,f:Je,j:Ze,k:et,o:ot,z:Ve,c:$e,i:rt,l:nt,b:Fe,B:Ce},Ue=(Or(),o["___wasm_call_ctors"]=function(){return(o["___wasm_call_ctors"]=o["asm"]["P"]).apply(null,arguments)},o["_main"]=function(){return(o["_main"]=o["asm"]["Q"]).apply(null,arguments)},o["___errno_location"]=function(){return(Ue=o["___errno_location"]=o["asm"]["R"]).apply(null,arguments)}),He=(o["_itk_wasm_input_array_alloc"]=function(){return(o["_itk_wasm_input_array_alloc"]=o["asm"]["S"]).apply(null,arguments)},o["_itk_wasm_input_json_alloc"]=function(){return(o["_itk_wasm_input_json_alloc"]=o["asm"]["T"]).apply(null,arguments)},o["_itk_wasm_output_json_address"]=function(){return(o["_itk_wasm_output_json_address"]=o["asm"]["U"]).apply(null,arguments)},o["_itk_wasm_output_json_size"]=function(){return(o["_itk_wasm_output_json_size"]=o["asm"]["V"]).apply(null,arguments)},o["_itk_wasm_output_array_address"]=function(){return(o["_itk_wasm_output_array_address"]=o["asm"]["W"]).apply(null,arguments)},o["_itk_wasm_output_array_size"]=function(){return(o["_itk_wasm_output_array_size"]=o["asm"]["X"]).apply(null,arguments)},o["_itk_wasm_free_all"]=function(){return(o["_itk_wasm_free_all"]=o["asm"]["Y"]).apply(null,arguments)},o["_malloc"]=function(){return(He=o["_malloc"]=o["asm"]["Z"]).apply(null,arguments)}),Ye=o["_setThrew"]=function(){return(Ye=o["_setThrew"]=o["asm"]["$"]).apply(null,arguments)},We=o["stackSave"]=function(){return(We=o["stackSave"]=o["asm"]["aa"]).apply(null,arguments)},Ge=o["stackRestore"]=function(){return(Ge=o["stackRestore"]=o["asm"]["ba"]).apply(null,arguments)},qe=o["stackAlloc"]=function(){return(qe=o["stackAlloc"]=o["asm"]["ca"]).apply(null,arguments)},Xe=o["___cxa_is_pointer_type"]=function(){return(Xe=o["___cxa_is_pointer_type"]=o["asm"]["da"]).apply(null,arguments)};function Ke(r,e){var t=We();try{return Mr(r)(e)}catch(n){if(Ge(t),n!==n+0)throw n;Ye(1,0)}}function Ve(r){var e=We();try{Mr(r)()}catch(t){if(Ge(e),t!==t+0)throw t;Ye(1,0)}}function Je(r,e,t,n){var o=We();try{return Mr(r)(e,t,n)}catch(a){if(Ge(o),a!==a+0)throw a;Ye(1,0)}}function Qe(r,e,t){var n=We();try{return Mr(r)(e,t)}catch(o){if(Ge(n),o!==o+0)throw o;Ye(1,0)}}function Ze(r,e,t,n,o){var a=We();try{return Mr(r)(e,t,n,o)}catch(i){if(Ge(a),i!==i+0)throw i;Ye(1,0)}}function $e(r,e){var t=We();try{Mr(r)(e)}catch(n){if(Ge(t),n!==n+0)throw n;Ye(1,0)}}function rt(r,e,t){var n=We();try{Mr(r)(e,t)}catch(o){if(Ge(n),o!==o+0)throw o;Ye(1,0)}}function et(r,e,t,n,o,a){var i=We();try{return Mr(r)(e,t,n,o,a)}catch(s){if(Ge(i),s!==s+0)throw s;Ye(1,0)}}function tt(r){var e=We();try{return Mr(r)()}catch(t){if(Ge(e),t!==t+0)throw t;Ye(1,0)}}function nt(r,e,t,n,o){var a=We();try{Mr(r)(e,t,n,o)}catch(i){if(Ge(a),i!==i+0)throw i;Ye(1,0)}}function ot(r,e,t,n,o,a,i){var s=We();try{return Mr(r)(e,t,n,o,a,i)}catch(u){if(Ge(s),u!==u+0)throw u;Ye(1,0)}}function at(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}o["ccall"]=I,o["cwrap"]=L,o["addRunDependency"]=Er,o["removeRunDependency"]=vr,o["FS_createPath"]=Gr.createPath,o["FS_createDataFile"]=Gr.createDataFile,o["FS_createPreloadedFile"]=Gr.createPreloadedFile,o["FS_createLazyFile"]=Gr.createLazyFile,o["FS_createDevice"]=Gr.createDevice,o["FS_unlink"]=Gr.unlink,o["callMain"]=it,o["AsciiToString"]=V,o["writeArrayToMemory"]=Q,o["writeAsciiToMemory"]=Z;function it(r){var e=o["_main"];r=r||[],r.unshift(p);var t=r.length,n=qe(4*(t+1)),a=n>>2;r.forEach((r=>{U[a++]=J(r)})),U[a]=0;try{var i=e(t,n);return ut(i,!0),i}catch(s){return Rr(s)}finally{!0}}function st(r){function e(){ze||(ze=!0,o["calledRun"]=!0,R||(sr(),ur(),t(o),o["onRuntimeInitialized"]&&o["onRuntimeInitialized"](),ft&&it(r),cr()))}r=r||h,mr>0||(ir(),mr>0||(o["setStatus"]?(o["setStatus"]("Running..."),setTimeout((function(){setTimeout((function(){o["setStatus"]("")}),1),e()}),1)):e()))}function ut(r,e){M=r,ct(r)}function ct(r){M=r,ar()||(o["onExit"]&&o["onExit"](r),R=!0),w(r,new at(r))}if(pr=function r(){ze||st(),ze||(pr=r)},o["run"]=st,o["preInit"]){"function"==typeof o["preInit"]&&(o["preInit"]=[o["preInit"]]);while(o["preInit"].length>0)o["preInit"].pop()()}var ft=!1;return o["noInitialRun"]&&(ft=!1),st(),o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!Gr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),a=1;a<o.length;a++)n+=o[a],Gr.analyzePath(n).exists||Gr.mkdir(n),n+="/";return Gr.mount(Wr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);Gr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],Gr.analyzePath(e).exists||Gr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return Gr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return Gr.writeFile(r,e,t)},o.fs_unlink=function(r){return Gr.unlink(r)},o.fs_open=function(r,e,t){return Gr.open(r,e,t)},o.fs_stat=function(r){return Gr.stat(r)},o.fs_read=function(r,e,t,n,o){return Gr.read(r,e,t,n,o)},o.fs_close=function(r){return Gr.close(r)},o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!Gr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),a=1;a<o.length;a++)n+=o[a],Gr.analyzePath(n).exists||Gr.mkdir(n),n+="/";return Gr.mount(Wr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);Gr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],Gr.analyzePath(e).exists||Gr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return Gr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return Gr.writeFile(r,e,t)},o.fs_unlink=function(r){return Gr.unlink(r)},o.fs_open=function(r,e,t){return Gr.open(r,e,t)},o.fs_stat=function(r){return Gr.stat(r)},o.fs_read=function(r,e,t,n,o){return Gr.read(r,e,t,n,o)},o.fs_close=function(r){return Gr.close(r)},e.ready}})();"object"===typeof exports&&"object"===typeof module?module.exports=JPEGImageIOReadImage:"function"===typeof define&&define["amd"]?define([],(function(){return JPEGImageIOReadImage})):"object"===typeof exports&&(exports["JPEGImageIOReadImage"]=JPEGImageIOReadImage);
@@ -0,0 +1 @@
1
+ var JPEGImageIOWriteImage=(()=>{var r="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!==typeof __filename&&(r=r||__filename),function(e){e=e||{};var t,n,o="undefined"!=typeof e?e:{};o["ready"]=new Promise((function(r,e){t=r,n=e}));var i=null,a=null;o["resetModuleStdout"]=function(){i=""},o["resetModuleStderr"]=function(){a=""},o["print"]=function(r){console.log(r),i+=r+"\n"},o["printErr"]=function(r){console.error(r),a+=r+"\n"},o["getModuleStdout"]=function(){return i},o["getModuleStderr"]=function(){return a};i=null,a=null;o["resetModuleStdout"]=function(){i=""},o["resetModuleStderr"]=function(){a=""},o["print"]=function(r){console.log(r),i+=r+"\n"},o["printErr"]=function(r){console.error(r),a+=r+"\n"},o["getModuleStdout"]=function(){return i},o["getModuleStderr"]=function(){return a};var s,u,c,f,l,d,h=Object.assign({},o),m=[],p="./this.program",w=(r,e)=>{throw e},E="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g="";function _(r){return o["locateFile"]?o["locateFile"](r,g):g+r}function k(r){if(r instanceof it)return;let e=r;b("exiting due to exception: "+e)}y?(g=v?require("path").dirname(g)+"/":__dirname+"/",d=()=>{l||(f=require("fs"),l=require("path"))},s=function(r,e){return d(),r=l["normalize"](r),f.readFileSync(r,e?void 0:"utf8")},c=r=>{var e=s(r,!0);return e.buffer||(e=new Uint8Array(e)),e},u=(r,e,t)=>{d(),r=l["normalize"](r),f.readFile(r,(function(r,n){r?t(r):e(n.buffer)}))},process["argv"].length>1&&(p=process["argv"][1].replace(/\\/g,"/")),m=process["argv"].slice(2),process["on"]("uncaughtException",(function(r){if(!(r instanceof it))throw r})),process["on"]("unhandledRejection",(function(r){throw r})),w=(r,e)=>{if(ir())throw process["exitCode"]=r,e;k(e),process["exit"](r)},o["inspect"]=function(){return"[Emscripten Module object]"}):(E||v)&&(v?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},v&&(c=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)});var S=o["print"]||console.log.bind(console),b=o["printErr"]||console.warn.bind(console);Object.assign(o,h),h=null,o["arguments"]&&(m=o["arguments"]),o["thisProgram"]&&(p=o["thisProgram"]),o["quit"]&&(w=o["quit"]);var D,N=0,F=r=>{N=r},O=()=>N;o["wasmBinary"]&&(D=o["wasmBinary"]);var P,A=o["noExitRuntime"]||!0;"object"!=typeof WebAssembly&&yr("no native wasm support detected");var M,R=!1;function T(r,e){r||yr(e)}function C(r){var e=o["_"+r];return e}function I(r,e,t,n,o){var i={string:function(r){var e=0;if(null!==r&&void 0!==r&&0!==r){var t=1+(r.length<<2);e=Ge(t),X(r,e,t)}return e},array:function(r){var e=Ge(r.length);return Q(r,e),e}};function a(r){return"string"===e?q(r):"boolean"===e?Boolean(r):r}var s=C(r),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=i[t[f]];l?(0===c&&(c=Ye()),u[f]=l(n[f])):u[f]=n[f]}var d=s.apply(null,u);function h(r){return 0!==c&&qe(c),a(r)}return d=h(d),d}function L(r,e,t,n){t=t||[];var o=t.every((function(r){return"number"===r})),i="string"!==e;return i&&o&&!n?C(r):function(){return I(r,e,t,arguments,n)}}var B,z,x,j,U,H,W="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Y(r,e,t){var n=e+t,o=e;while(r[o]&&!(o>=n))++o;if(o-e>16&&r.buffer&&W)return W.decode(r.subarray(e,o));var i="";while(e<o){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if(a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++],a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function q(r,e){return r?Y(x,r,e):""}function G(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343){var u=r.charCodeAt(++a);s=65536+((1023&s)<<10)|1023&u}if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function X(r,e,t){return G(r,x,e,t)}function K(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function V(r){var e="";while(1){var t=x[r++>>0];if(!t)return e;e+=String.fromCharCode(t)}}function J(r){var e=K(r)+1,t=Ge(e);return G(r,z,t,e),t}function Q(r,e){z.set(r,e)}function Z(r,e,t){for(var n=0;n<r.length;++n)z[e++>>0]=r.charCodeAt(n);t||(z[e>>0]=0)}function $(r){B=r,o["HEAP8"]=z=new Int8Array(r),o["HEAP16"]=j=new Int16Array(r),o["HEAP32"]=U=new Int32Array(r),o["HEAPU8"]=x=new Uint8Array(r),o["HEAPU16"]=new Uint16Array(r),o["HEAPU32"]=H=new Uint32Array(r),o["HEAPF32"]=new Float32Array(r),o["HEAPF64"]=new Float64Array(r)}o["INITIAL_MEMORY"];var rr,er=[],tr=[],nr=[],or=[];function ir(){return A}function ar(){if(o["preRun"]){"function"==typeof o["preRun"]&&(o["preRun"]=[o["preRun"]]);while(o["preRun"].length)fr(o["preRun"].shift())}Pr(er)}function sr(){!0,o["noFSInit"]||qr.init.initialized||qr.init(),qr.ignorePermissions=!1,xr.init(),Pr(tr)}function ur(){Pr(nr)}function cr(){if(o["postRun"]){"function"==typeof o["postRun"]&&(o["postRun"]=[o["postRun"]]);while(o["postRun"].length)dr(o["postRun"].shift())}Pr(or)}function fr(r){er.unshift(r)}function lr(r){tr.unshift(r)}function dr(r){or.unshift(r)}var hr=0,mr=null,pr=null;function wr(r){return r}function Er(r){hr++,o["monitorRunDependencies"]&&o["monitorRunDependencies"](hr)}function vr(r){if(hr--,o["monitorRunDependencies"]&&o["monitorRunDependencies"](hr),0==hr&&(null!==mr&&(clearInterval(mr),mr=null),pr)){var e=pr;pr=null,e()}}function yr(r){o["onAbort"]&&o["onAbort"](r),r="Aborted("+r+")",b(r),R=!0,M=1,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var gr,_r,kr,Sr="data:application/octet-stream;base64,";function br(r){return r.startsWith(Sr)}function Dr(r){return r.startsWith("file://")}function Nr(r){try{if(r==gr&&D)return new Uint8Array(D);if(c)return c(r);throw"both async and sync fetching of the wasm failed"}catch(b){yr(b)}}function Fr(){if(!D&&(E||v)){if("function"==typeof fetch&&!Dr(gr))return fetch(gr,{credentials:"same-origin"}).then((function(r){if(!r["ok"])throw"failed to load wasm binary file at '"+gr+"'";return r["arrayBuffer"]()})).catch((function(){return Nr(gr)}));if(u)return new Promise((function(r,e){u(gr,(function(e){r(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Nr(gr)}))}function Or(){var r={a:je};function e(r,e){var t=r.exports;o["asm"]=t,P=o["asm"]["O"],$(P.buffer),rr=o["asm"]["_"],lr(o["asm"]["P"]),vr("wasm-instantiate")}function t(r){e(r["instance"])}function i(e){return Fr().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){b("failed to asynchronously prepare wasm: "+r),yr(r)}))}function a(){return D||"function"!=typeof WebAssembly.instantiateStreaming||br(gr)||Dr(gr)||y||"function"!=typeof fetch?i(t):fetch(gr,{credentials:"same-origin"}).then((function(e){var n=WebAssembly.instantiateStreaming(e,r);return n.then(t,(function(r){return b("wasm streaming compile failed: "+r),b("falling back to ArrayBuffer instantiation"),i(t)}))}))}if(Er("wasm-instantiate"),o["instantiateWasm"])try{var s=o["instantiateWasm"](r,e);return s}catch(u){return b("Module.instantiateWasm callback failed with error: "+u),!1}return a().catch(n),{}}function Pr(r){while(r.length>0){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?Mr(t)():Mr(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}gr="JPEGImageIOWriteImage.wasm",br(gr)||(gr=_(gr));var Ar=[];function Mr(r){var e=Ar[r];return e||(r>=Ar.length&&(Ar.length=r+1),Ar[r]=e=rr.get(r)),e}function Rr(r){if(r instanceof it||"unwind"==r)return M;w(1,r)}function Tr(r){return Ue(r+24)+24}function Cr(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(r){H[this.ptr+4>>2]=r},this.get_type=function(){return H[this.ptr+4>>2]},this.set_destructor=function(r){H[this.ptr+8>>2]=r},this.get_destructor=function(){return H[this.ptr+8>>2]},this.set_refcount=function(r){U[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,z[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=z[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,z[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=z[this.ptr+13>>0]},this.init=function(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=U[this.ptr>>2];U[this.ptr>>2]=r+1},this.release_ref=function(){var r=U[this.ptr>>2];return U[this.ptr>>2]=r-1,1===r},this.set_adjusted_ptr=function(r){H[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return H[this.ptr+16>>2]},this.get_exception_ptr=function(){var r=Xe(this.get_type());if(r)return H[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function Ir(r,e,t){var n=new Cr(r);throw n.init(e,t),r,r}var Lr={isAbs:r=>"/"===r.charAt(0),splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=Lr.isAbs(r),t="/"===r.substr(-1);return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),r||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Lr.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";r=Lr.normalize(r),r=r.replace(/\/$/,"");var e=r.lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments,0);return Lr.normalize(r.join("/"))},join2:(r,e)=>Lr.normalize(r+"/"+e)};function Br(){if("object"==typeof crypto&&"function"==typeof crypto["getRandomValues"]){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(y)try{var e=require("crypto");return function(){return e["randomBytes"](1)[0]}}catch(t){}return function(){yr("randomDevice")}}var zr={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:qr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e=Lr.isAbs(n)}return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),(e?"/":"")+r||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length;e++)if(""!==r[e])break;for(var t=r.length-1;t>=0;t--)if(""!==r[t])break;return e>t?[]:r.slice(e,t-e+1)}r=zr.resolve(r).substr(1),e=zr.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return u=u.concat(o.slice(a)),u.join("/")}},xr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){xr.ttys[r]={input:[],output:[],ops:e},qr.registerDevice(r,xr.stream_ops)},stream_ops:{open:function(r){var e=xr.ttys[r.node.rdev];if(!e)throw new qr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new qr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(u){throw new qr.ErrnoError(29)}if(void 0===s&&0===i)throw new qr.ErrnoError(6);if(null===s||void 0===s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new qr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(a){throw new qr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(y){var t=256,n=Buffer.alloc(t),o=0;try{o=f.readSync(process.stdin.fd,n,0,t,-1)}catch(i){if(!i.toString().includes("EOF"))throw i;o=0}e=o>0?n.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(e=window.prompt("Input: "),null!==e&&(e+="\n")):"function"==typeof readline&&(e=readline(),null!==e&&(e+="\n"));if(!e)return null;r.input=ze(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(S(Y(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(S(Y(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(b(Y(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(b(Y(r.output,0)),r.output=[])}}};function jr(r){yr()}var Ur={ops_table:null,mount:function(r){return Ur.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(qr.isBlkdev(t)||qr.isFIFO(t))throw new qr.ErrnoError(63);Ur.ops_table||(Ur.ops_table={dir:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,lookup:Ur.node_ops.lookup,mknod:Ur.node_ops.mknod,rename:Ur.node_ops.rename,unlink:Ur.node_ops.unlink,rmdir:Ur.node_ops.rmdir,readdir:Ur.node_ops.readdir,symlink:Ur.node_ops.symlink},stream:{llseek:Ur.stream_ops.llseek}},file:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:{llseek:Ur.stream_ops.llseek,read:Ur.stream_ops.read,write:Ur.stream_ops.write,allocate:Ur.stream_ops.allocate,mmap:Ur.stream_ops.mmap,msync:Ur.stream_ops.msync}},link:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,readlink:Ur.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:qr.chrdev_stream_ops}});var o=qr.createNode(r,e,t,n);return qr.isDir(o.mode)?(o.node_ops=Ur.ops_table.dir.node,o.stream_ops=Ur.ops_table.dir.stream,o.contents={}):qr.isFile(o.mode)?(o.node_ops=Ur.ops_table.file.node,o.stream_ops=Ur.ops_table.file.stream,o.usedBytes=0,o.contents=null):qr.isLink(o.mode)?(o.node_ops=Ur.ops_table.link.node,o.stream_ops=Ur.ops_table.link.stream):qr.isChrdev(o.mode)&&(o.node_ops=Ur.ops_table.chrdev.node,o.stream_ops=Ur.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=qr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,qr.isDir(r.mode)?e.size=4096:qr.isFile(r.mode)?e.size=r.usedBytes:qr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Ur.resizeFileStorage(r,e.size)},lookup:function(r,e){throw qr.genericErrors[44]},mknod:function(r,e,t,n){return Ur.createNode(r,e,t,n)},rename:function(r,e,t){if(qr.isDir(r.mode)){var n;try{n=qr.lookupNode(e,t)}catch(i){}if(n)for(var o in n.contents)throw new qr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=qr.lookupNode(r,e);for(var n in t.contents)throw new qr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=Ur.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!qr.isLink(r.mode))throw new qr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===z.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(Ur.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&qr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new qr.ErrnoError(28);return n},allocate:function(r,e,t){Ur.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o){if(!qr.isFile(r.node.mode))throw new qr.ErrnoError(43);var i,a,s=r.node.contents;if(2&o||s.buffer!==B){if((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),a=!0,i=jr(e),!i)throw new qr.ErrnoError(48);z.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(r,e,t,n,o){if(!qr.isFile(r.node.mode))throw new qr.ErrnoError(43);if(2&o)return 0;Ur.stream_ops.write(r,e,0,n,t,!1);return 0}}};function Hr(r,e,t,n){var o=n?"":wr("al "+r);u(r,(function(t){T(t,'Loading data file "'+r+'" failed (no arrayBuffer).'),e(new Uint8Array(t)),o&&vr(o)}),(function(e){if(!t)throw'Loading data file "'+r+'" failed.';t()})),o&&Er(o)}var Wr={},Yr={isWindows:!1,staticInit:()=>{Yr.isWindows=!!process.platform.match(/^win/);var r=process["binding"]("constants");r["fs"]&&(r=r["fs"]),Yr.flagsForNodeMap={1024:r["O_APPEND"],64:r["O_CREAT"],128:r["O_EXCL"],256:r["O_NOCTTY"],0:r["O_RDONLY"],2:r["O_RDWR"],4096:r["O_SYNC"],512:r["O_TRUNC"],1:r["O_WRONLY"],131072:r["O_NOFOLLOW"]}},convertNodeCode:r=>{var e=r.code;return Wr[e]},mount:r=>Yr.createNode(null,"/",Yr.getMode(r.opts.root),0),createNode:(r,e,t,n)=>{if(!qr.isDir(t)&&!qr.isFile(t)&&!qr.isLink(t))throw new qr.ErrnoError(28);var o=qr.createNode(r,e,t);return o.node_ops=Yr.node_ops,o.stream_ops=Yr.stream_ops,o},getMode:r=>{var e;try{e=f.lstatSync(r),Yr.isWindows&&(e.mode=e.mode|(292&e.mode)>>2)}catch(t){if(!t.code)throw t;throw new qr.ErrnoError(Yr.convertNodeCode(t))}return e.mode},realPath:r=>{var e=[];while(r.parent!==r)e.push(r.name),r=r.parent;return e.push(r.mount.opts.root),e.reverse(),Lr.join.apply(null,e)},flagsForNode:r=>{r&=-2097153,r&=-2049,r&=-32769,r&=-524289,r&=-65537;var e=0;for(var t in Yr.flagsForNodeMap)r&t&&(e|=Yr.flagsForNodeMap[t],r^=t);if(r)throw new qr.ErrnoError(28);return e},node_ops:{getattr:r=>{var e,t=Yr.realPath(r);try{e=f.lstatSync(t)}catch(n){if(!n.code)throw n;throw new qr.ErrnoError(Yr.convertNodeCode(n))}return Yr.isWindows&&!e.blksize&&(e.blksize=4096),Yr.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:(r,e)=>{var t=Yr.realPath(r);try{if(void 0!==e.mode&&(f.chmodSync(t,e.mode),r.mode=e.mode),void 0!==e.timestamp){var n=new Date(e.timestamp);f.utimesSync(t,n,n)}void 0!==e.size&&f.truncateSync(t,e.size)}catch(o){if(!o.code)throw o;throw new qr.ErrnoError(Yr.convertNodeCode(o))}},lookup:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e),n=Yr.getMode(t);return Yr.createNode(r,e,n)},mknod:(r,e,t,n)=>{var o=Yr.createNode(r,e,t,n),i=Yr.realPath(o);try{qr.isDir(o.mode)?f.mkdirSync(i,o.mode):f.writeFileSync(i,"",{mode:o.mode})}catch(a){if(!a.code)throw a;throw new qr.ErrnoError(Yr.convertNodeCode(a))}return o},rename:(r,e,t)=>{var n=Yr.realPath(r),o=Lr.join2(Yr.realPath(e),t);try{f.renameSync(n,o)}catch(i){if(!i.code)throw i;throw new qr.ErrnoError(Yr.convertNodeCode(i))}r.name=t},unlink:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e);try{f.unlinkSync(t)}catch(n){if(!n.code)throw n;throw new qr.ErrnoError(Yr.convertNodeCode(n))}},rmdir:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e);try{f.rmdirSync(t)}catch(n){if(!n.code)throw n;throw new qr.ErrnoError(Yr.convertNodeCode(n))}},readdir:r=>{var e=Yr.realPath(r);try{return f.readdirSync(e)}catch(t){if(!t.code)throw t;throw new qr.ErrnoError(Yr.convertNodeCode(t))}},symlink:(r,e,t)=>{var n=Lr.join2(Yr.realPath(r),e);try{f.symlinkSync(t,n)}catch(o){if(!o.code)throw o;throw new qr.ErrnoError(Yr.convertNodeCode(o))}},readlink:r=>{var e=Yr.realPath(r);try{return e=f.readlinkSync(e),e=l.relative(l.resolve(r.mount.opts.root),e),e}catch(t){if(!t.code)throw t;if("UNKNOWN"===t.code)throw new qr.ErrnoError(28);throw new qr.ErrnoError(Yr.convertNodeCode(t))}}},stream_ops:{open:r=>{var e=Yr.realPath(r.node);try{qr.isFile(r.node.mode)&&(r.nfd=f.openSync(e,Yr.flagsForNode(r.flags)))}catch(t){if(!t.code)throw t;throw new qr.ErrnoError(Yr.convertNodeCode(t))}},close:r=>{try{qr.isFile(r.node.mode)&&r.nfd&&f.closeSync(r.nfd)}catch(e){if(!e.code)throw e;throw new qr.ErrnoError(Yr.convertNodeCode(e))}},read:(r,e,t,n,o)=>{if(0===n)return 0;try{return f.readSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(i){throw new qr.ErrnoError(Yr.convertNodeCode(i))}},write:(r,e,t,n,o)=>{try{return f.writeSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(i){throw new qr.ErrnoError(Yr.convertNodeCode(i))}},llseek:(r,e,t)=>{var n=e;if(1===t)n+=r.position;else if(2===t&&qr.isFile(r.node.mode))try{var o=f.fstatSync(r.nfd);n+=o.size}catch(i){throw new qr.ErrnoError(Yr.convertNodeCode(i))}if(n<0)throw new qr.ErrnoError(28);return n},mmap:(r,e,t,n,o)=>{if(!qr.isFile(r.node.mode))throw new qr.ErrnoError(43);var i=jr(e);return Yr.stream_ops.read(r,z,i,e,t),{ptr:i,allocated:!0}},msync:(r,e,t,n,o)=>{if(!qr.isFile(r.node.mode))throw new qr.ErrnoError(43);if(2&o)return 0;Yr.stream_ops.write(r,e,0,n,t,!1);return 0}}},qr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(r=zr.resolve(qr.cwd(),r),!r)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(e=Object.assign(t,e),e.recurse_count>8)throw new qr.ErrnoError(32);for(var n=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!1),o=qr.root,i="/",a=0;a<n.length;a++){var s=a===n.length-1;if(s&&e.parent)break;if(o=qr.lookupNode(o,n[a]),i=Lr.join2(i,n[a]),qr.isMountpoint(o)&&(!s||s&&e.follow_mount)&&(o=o.mounted.root),!s||e.follow){var u=0;while(qr.isLink(o.mode)){var c=qr.readlink(i);i=zr.resolve(Lr.dirname(i),c);var f=qr.lookupPath(i,{recurse_count:e.recurse_count+1});if(o=f.node,u++>40)throw new qr.ErrnoError(32)}}}return{path:i,node:o}},getPath:r=>{var e;while(1){if(qr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%qr.nameTable.length},hashAddNode:r=>{var e=qr.hashName(r.parent.id,r.name);r.name_next=qr.nameTable[e],qr.nameTable[e]=r},hashRemoveNode:r=>{var e=qr.hashName(r.parent.id,r.name);if(qr.nameTable[e]===r)qr.nameTable[e]=r.name_next;else{var t=qr.nameTable[e];while(t){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}}},lookupNode:(r,e)=>{var t=qr.mayLookup(r);if(t)throw new qr.ErrnoError(t,r);for(var n=qr.hashName(r.id,e),o=qr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return qr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new qr.FSNode(r,e,t,n);return qr.hashAddNode(o),o},destroyNode:r=>{qr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768===(61440&r),isDir:r=>16384===(61440&r),isLink:r=>40960===(61440&r),isChrdev:r=>8192===(61440&r),isBlkdev:r=>24576===(61440&r),isFIFO:r=>4096===(61440&r),isSocket:r=>49152===(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=qr.flagModes[r];if("undefined"==typeof e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>qr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=qr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{qr.lookupNode(r,e);return 20}catch(t){}return qr.nodePermissions(r,"wx")},mayDelete:(r,e,t)=>{var n;try{n=qr.lookupNode(r,e)}catch(i){return i.errno}var o=qr.nodePermissions(r,"wx");if(o)return o;if(t){if(!qr.isDir(n.mode))return 54;if(qr.isRoot(n)||qr.getPath(n)===qr.cwd())return 10}else if(qr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?qr.isLink(r.mode)?32:qr.isDir(r.mode)&&("r"!==qr.flagsToPermissionString(e)||512&e)?31:qr.nodePermissions(r,qr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=qr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!qr.streams[t])return t;throw new qr.ErrnoError(33)},getStream:r=>qr.streams[r],createStream:(r,e,t)=>{qr.FSStream||(qr.FSStream=function(){this.shared={}},qr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!==(2097155&this.flags)}},isWrite:{get:function(){return 0!==(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get function(){return this.shared.position},set:function(r){this.shared.position=r}}}),r=Object.assign(new qr.FSStream,r);var n=qr.nextfd(e,t);return r.fd=n,qr.streams[n]=r,r},closeStream:r=>{qr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=qr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new qr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{qr.devices[r]={stream_ops:e}},getDevice:r=>qr.devices[r],getMounts:r=>{var e=[],t=[r];while(t.length){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{"function"==typeof r&&(e=r,r=!1),qr.syncFSRequests++,qr.syncFSRequests>1&&b("warning: "+qr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=qr.getMounts(qr.root.mount),n=0;function o(r){return qr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o="/"===t,i=!t;if(o&&qr.root)throw new qr.ErrnoError(10);if(!o&&!i){var a=qr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,qr.isMountpoint(n))throw new qr.ErrnoError(10);if(!qr.isDir(n.mode))throw new qr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?qr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=qr.lookupPath(r,{follow_mount:!1});if(!qr.isMountpoint(e.node))throw new qr.ErrnoError(28);var t=e.node,n=t.mounted,o=qr.getMounts(n);Object.keys(qr.nameTable).forEach((r=>{var e=qr.nameTable[r];while(e){var t=e.name_next;o.includes(e.mount)&&qr.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=qr.lookupPath(r,{parent:!0}),o=n.node,i=Lr.basename(r);if(!i||"."===i||".."===i)throw new qr.ErrnoError(28);var a=qr.mayCreate(o,i);if(a)throw new qr.ErrnoError(a);if(!o.node_ops.mknod)throw new qr.ErrnoError(63);return o.node_ops.mknod(o,i,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,qr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,qr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{qr.mkdir(n,e)}catch(i){if(20!=i.errno)throw i}}},mkdev:(r,e,t)=>("undefined"==typeof t&&(t=e,e=438),e|=8192,qr.mknod(r,e,t)),symlink:(r,e)=>{if(!zr.resolve(r))throw new qr.ErrnoError(44);var t=qr.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new qr.ErrnoError(44);var o=Lr.basename(e),i=qr.mayCreate(n,o);if(i)throw new qr.ErrnoError(i);if(!n.node_ops.symlink)throw new qr.ErrnoError(63);return n.node_ops.symlink(n,o,r)},rename:(r,e)=>{var t,n,o,i=Lr.dirname(r),a=Lr.dirname(e),s=Lr.basename(r),u=Lr.basename(e);if(t=qr.lookupPath(r,{parent:!0}),n=t.node,t=qr.lookupPath(e,{parent:!0}),o=t.node,!n||!o)throw new qr.ErrnoError(44);if(n.mount!==o.mount)throw new qr.ErrnoError(75);var c,f=qr.lookupNode(n,s),l=zr.relative(r,a);if("."!==l.charAt(0))throw new qr.ErrnoError(28);if(l=zr.relative(e,i),"."!==l.charAt(0))throw new qr.ErrnoError(55);try{c=qr.lookupNode(o,u)}catch(m){}if(f!==c){var d=qr.isDir(f.mode),h=qr.mayDelete(n,s,d);if(h)throw new qr.ErrnoError(h);if(h=c?qr.mayDelete(o,u,d):qr.mayCreate(o,u),h)throw new qr.ErrnoError(h);if(!n.node_ops.rename)throw new qr.ErrnoError(63);if(qr.isMountpoint(f)||c&&qr.isMountpoint(c))throw new qr.ErrnoError(10);if(o!==n&&(h=qr.nodePermissions(n,"w"),h))throw new qr.ErrnoError(h);qr.hashRemoveNode(f);try{n.node_ops.rename(f,o,u)}catch(m){throw m}finally{qr.hashAddNode(f)}}},rmdir:r=>{var e=qr.lookupPath(r,{parent:!0}),t=e.node,n=Lr.basename(r),o=qr.lookupNode(t,n),i=qr.mayDelete(t,n,!0);if(i)throw new qr.ErrnoError(i);if(!t.node_ops.rmdir)throw new qr.ErrnoError(63);if(qr.isMountpoint(o))throw new qr.ErrnoError(10);t.node_ops.rmdir(t,n),qr.destroyNode(o)},readdir:r=>{var e=qr.lookupPath(r,{follow:!0}),t=e.node;if(!t.node_ops.readdir)throw new qr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var e=qr.lookupPath(r,{parent:!0}),t=e.node;if(!t)throw new qr.ErrnoError(44);var n=Lr.basename(r),o=qr.lookupNode(t,n),i=qr.mayDelete(t,n,!1);if(i)throw new qr.ErrnoError(i);if(!t.node_ops.unlink)throw new qr.ErrnoError(63);if(qr.isMountpoint(o))throw new qr.ErrnoError(10);t.node_ops.unlink(t,n),qr.destroyNode(o)},readlink:r=>{var e=qr.lookupPath(r),t=e.node;if(!t)throw new qr.ErrnoError(44);if(!t.node_ops.readlink)throw new qr.ErrnoError(28);return zr.resolve(qr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,e)=>{var t=qr.lookupPath(r,{follow:!e}),n=t.node;if(!n)throw new qr.ErrnoError(44);if(!n.node_ops.getattr)throw new qr.ErrnoError(63);return n.node_ops.getattr(n)},lstat:r=>qr.stat(r,!0),chmod:(r,e,t)=>{var n;if("string"==typeof r){var o=qr.lookupPath(r,{follow:!t});n=o.node}else n=r;if(!n.node_ops.setattr)throw new qr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{qr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=qr.getStream(r);if(!t)throw new qr.ErrnoError(8);qr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;if("string"==typeof r){var i=qr.lookupPath(r,{follow:!n});o=i.node}else o=r;if(!o.node_ops.setattr)throw new qr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{qr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=qr.getStream(r);if(!n)throw new qr.ErrnoError(8);qr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new qr.ErrnoError(28);var t;if("string"==typeof r){var n=qr.lookupPath(r,{follow:!0});t=n.node}else t=r;if(!t.node_ops.setattr)throw new qr.ErrnoError(63);if(qr.isDir(t.mode))throw new qr.ErrnoError(31);if(!qr.isFile(t.mode))throw new qr.ErrnoError(28);var o=qr.nodePermissions(t,"w");if(o)throw new qr.ErrnoError(o);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=qr.getStream(r);if(!t)throw new qr.ErrnoError(8);if(0===(2097155&t.flags))throw new qr.ErrnoError(28);qr.truncate(t.node,e)},utime:(r,e,t)=>{var n=qr.lookupPath(r,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(e,t)})},open:(r,e,t)=>{if(""===r)throw new qr.ErrnoError(44);var n;if(e="string"==typeof e?qr.modeStringToFlags(e):e,t="undefined"==typeof t?438:t,t=64&e?4095&t|32768:0,"object"==typeof r)n=r;else{r=Lr.normalize(r);try{var i=qr.lookupPath(r,{follow:!(131072&e)});n=i.node}catch(c){}}var a=!1;if(64&e)if(n){if(128&e)throw new qr.ErrnoError(20)}else n=qr.mknod(r,t,0),a=!0;if(!n)throw new qr.ErrnoError(44);if(qr.isChrdev(n.mode)&&(e&=-513),65536&e&&!qr.isDir(n.mode))throw new qr.ErrnoError(54);if(!a){var s=qr.mayOpen(n,e);if(s)throw new qr.ErrnoError(s)}512&e&&!a&&qr.truncate(n,0),e&=-131713;var u=qr.createStream({node:n,path:qr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!o["logReadFiles"]||1&e||(qr.readFiles||(qr.readFiles={}),r in qr.readFiles||(qr.readFiles[r]=1)),u},close:r=>{if(qr.isClosed(r))throw new qr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{qr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(qr.isClosed(r))throw new qr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new qr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new qr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new qr.ErrnoError(28);if(qr.isClosed(r))throw new qr.ErrnoError(8);if(1===(2097155&r.flags))throw new qr.ErrnoError(8);if(qr.isDir(r.node.mode))throw new qr.ErrnoError(31);if(!r.stream_ops.read)throw new qr.ErrnoError(28);var i="undefined"!=typeof o;if(i){if(!r.seekable)throw new qr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new qr.ErrnoError(28);if(qr.isClosed(r))throw new qr.ErrnoError(8);if(0===(2097155&r.flags))throw new qr.ErrnoError(8);if(qr.isDir(r.node.mode))throw new qr.ErrnoError(31);if(!r.stream_ops.write)throw new qr.ErrnoError(28);r.seekable&&1024&r.flags&&qr.llseek(r,0,2);var a="undefined"!=typeof o;if(a){if(!r.seekable)throw new qr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(qr.isClosed(r))throw new qr.ErrnoError(8);if(e<0||t<=0)throw new qr.ErrnoError(28);if(0===(2097155&r.flags))throw new qr.ErrnoError(8);if(!qr.isFile(r.node.mode)&&!qr.isDir(r.node.mode))throw new qr.ErrnoError(43);if(!r.stream_ops.allocate)throw new qr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o)=>{if(0!==(2&n)&&0===(2&o)&&2!==(2097155&r.flags))throw new qr.ErrnoError(2);if(1===(2097155&r.flags))throw new qr.ErrnoError(2);if(!r.stream_ops.mmap)throw new qr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new qr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var t,n=qr.open(r,e.flags),o=qr.stat(r),i=o.size,a=new Uint8Array(i);return qr.read(n,a,0,i,0),"utf8"===e.encoding?t=Y(a,0):"binary"===e.encoding&&(t=a),qr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=qr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(K(e)+1),i=G(e,o,0,o.length);qr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");qr.write(n,e,0,e.byteLength,void 0,t.canOwn)}qr.close(n)},cwd:()=>qr.currentPath,chdir:r=>{var e=qr.lookupPath(r,{follow:!0});if(null===e.node)throw new qr.ErrnoError(44);if(!qr.isDir(e.node.mode))throw new qr.ErrnoError(54);var t=qr.nodePermissions(e.node,"x");if(t)throw new qr.ErrnoError(t);qr.currentPath=e.path},createDefaultDirectories:()=>{qr.mkdir("/tmp"),qr.mkdir("/home"),qr.mkdir("/home/web_user")},createDefaultDevices:()=>{qr.mkdir("/dev"),qr.registerDevice(qr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),qr.mkdev("/dev/null",qr.makedev(1,3)),xr.register(qr.makedev(5,0),xr.default_tty_ops),xr.register(qr.makedev(6,0),xr.default_tty1_ops),qr.mkdev("/dev/tty",qr.makedev(5,0)),qr.mkdev("/dev/tty1",qr.makedev(6,0));var r=Br();qr.createDevice("/dev","random",r),qr.createDevice("/dev","urandom",r),qr.mkdir("/dev/shm"),qr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{qr.mkdir("/proc");var r=qr.mkdir("/proc/self");qr.mkdir("/proc/self/fd"),qr.mount({mount:()=>{var e=qr.createNode(r,"fd",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=qr.getStream(t);if(!n)throw new qr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{o["stdin"]?qr.createDevice("/dev","stdin",o["stdin"]):qr.symlink("/dev/tty","/dev/stdin"),o["stdout"]?qr.createDevice("/dev","stdout",null,o["stdout"]):qr.symlink("/dev/tty","/dev/stdout"),o["stderr"]?qr.createDevice("/dev","stderr",null,o["stderr"]):qr.symlink("/dev/tty1","/dev/stderr");qr.open("/dev/stdin",0),qr.open("/dev/stdout",1),qr.open("/dev/stderr",1)},ensureErrnoError:()=>{qr.ErrnoError||(qr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},qr.ErrnoError.prototype=new Error,qr.ErrnoError.prototype.constructor=qr.ErrnoError,[44].forEach((r=>{qr.genericErrors[r]=new qr.ErrnoError(r),qr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{qr.ensureErrnoError(),qr.nameTable=new Array(4096),qr.mount(Ur,{},"/"),qr.createDefaultDirectories(),qr.createDefaultDevices(),qr.createSpecialDirectories(),qr.filesystems={MEMFS:Ur,NODEFS:Yr}},init:(r,e,t)=>{qr.init.initialized=!0,qr.ensureErrnoError(),o["stdin"]=r||o["stdin"],o["stdout"]=e||o["stdout"],o["stderr"]=t||o["stderr"],qr.createStandardStreams()},quit:()=>{qr.init.initialized=!1;for(var r=0;r<qr.streams.length;r++){var e=qr.streams[r];e&&qr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=qr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{var t=qr.lookupPath(r,{follow:!e});r=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{t=qr.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Lr.basename(r),t=qr.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(o){n.error=o.errno}return n},createPath:(r,e,t,n)=>{r="string"==typeof r?r:qr.getPath(r);var o=e.split("/").reverse();while(o.length){var i=o.pop();if(i){var a=Lr.join2(r,i);try{qr.mkdir(a)}catch(s){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=Lr.join2("string"==typeof r?r:qr.getPath(r),e),a=qr.getMode(n,o);return qr.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r="string"==typeof r?r:qr.getPath(r),a=e?Lr.join2(r,e):r);var s=qr.getMode(n,o),u=qr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}qr.chmod(u,146|s);var d=qr.open(u,577);qr.write(d,t,0,t.length,0,i),qr.close(d),qr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=Lr.join2("string"==typeof r?r:qr.getPath(r),e),i=qr.getMode(!!t,!!n);qr.createDevice.major||(qr.createDevice.major=64);var a=qr.makedev(qr.createDevice.major++,0);return qr.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(c){throw new qr.ErrnoError(29)}if(void 0===u&&0===a)throw new qr.ErrnoError(6);if(null===u||void 0===u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(s){throw new qr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),qr.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=ze(s(r.url),!0),r.usedBytes=r.contents.length}catch(e){throw new qr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=(r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ze(o.responseText||"",!0)},u=this;u.setDataGetter((r=>{var e=r*a,t=(r+1)*a-1;if(t=Math.min(t,n-1),"undefined"==typeof u.chunks[r]&&(u.chunks[r]=s(e,t)),"undefined"==typeof u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:t};var u=qr.createFile(r,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={},f=Object.keys(u.stream_ops);function l(r,e,t,n,o){var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[t+s]=i[o+s];else for(s=0;s<a;s++)e[t+s]=i.get(o+s);return a}return f.forEach((r=>{var e=u.stream_ops[r];c[r]=function(){return qr.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(r,e,t,n,o)=>(qr.forceLoadFile(u),l(r,e,t,n,o)),c.mmap=(r,e,t,n,o)=>{qr.forceLoadFile(u);var i=jr(e);if(!i)throw new qr.ErrnoError(48);return l(r,z,i,e,t),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(r,e,t,n,o,i,a,s,u,c)=>{var f=e?zr.resolve(Lr.join2(r,e)):r,l=wr("cp "+f);function d(t){function d(t){c&&c(),s||qr.createDataFile(r,e,t,n,o,u),i&&i(),vr(l)}Browser.handledByPreloadPlugin(t,f,d,(()=>{a&&a(),vr(l)}))||d(t)}Er(l),"string"==typeof t?Hr(t,(r=>d(r)),a):d(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=qr.indexedDB();try{var o=n.open(qr.DB_NAME(),qr.DB_VERSION)}catch(i){return t(i)}o.onupgradeneeded=()=>{S("creating db");var r=o.result;r.createObjectStore(qr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result,i=n.transaction([qr.DB_STORE_NAME],"readwrite"),a=i.objectStore(qr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach((r=>{var e=a.put(qr.analyzePath(r).object.contents,r);e.onsuccess=()=>{s++,s+u==c&&f()},e.onerror=()=>{u++,s+u==c&&f()}})),i.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=qr.indexedDB();try{var o=n.open(qr.DB_NAME(),qr.DB_VERSION)}catch(i){return t(i)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([qr.DB_STORE_NAME],"readonly")}catch(i){return void t(i)}var s=a.objectStore(qr.DB_STORE_NAME),u=0,c=0,f=r.length;function l(){0==c?e():t()}r.forEach((r=>{var e=s.get(r);e.onsuccess=()=>{qr.analyzePath(r).exists&&qr.unlink(r),qr.createDataFile(Lr.dirname(r),Lr.basename(r),e.result,!0,!0,!0),u++,u+c==f&&l()},e.onerror=()=>{c++,u+c==f&&l()}})),a.onerror=t},o.onerror=t}},Gr={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if(Lr.isAbs(e))return e;var n;if(-100===r)n=qr.cwd();else{var o=qr.getStream(r);if(!o)throw new qr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new qr.ErrnoError(44);return n}return Lr.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(o){if(o&&o.node&&Lr.normalize(e)!==Lr.normalize(qr.getPath(o.node)))return-54;throw o}return U[t>>2]=n.dev,U[t+4>>2]=0,U[t+8>>2]=n.ino,U[t+12>>2]=n.mode,U[t+16>>2]=n.nlink,U[t+20>>2]=n.uid,U[t+24>>2]=n.gid,U[t+28>>2]=n.rdev,U[t+32>>2]=0,kr=[n.size>>>0,(_r=n.size,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+40>>2]=kr[0],U[t+44>>2]=kr[1],U[t+48>>2]=4096,U[t+52>>2]=n.blocks,U[t+56>>2]=n.atime.getTime()/1e3|0,U[t+60>>2]=0,U[t+64>>2]=n.mtime.getTime()/1e3|0,U[t+68>>2]=0,U[t+72>>2]=n.ctime.getTime()/1e3|0,U[t+76>>2]=0,kr=[n.ino>>>0,(_r=n.ino,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+80>>2]=kr[0],U[t+84>>2]=kr[1],0},doMsync:function(r,e,t,n,o){var i=x.slice(r,r+t);qr.msync(e,i,o,t,n)},varargs:void 0,get:function(){Gr.varargs+=4;var r=U[Gr.varargs-4>>2];return r},getStr:function(r){var e=q(r);return e},getStreamFromFD:function(r){var e=qr.getStream(r);if(!e)throw new qr.ErrnoError(8);return e}};function Xr(r,e,t,n){try{if(e=Gr.getStr(e),e=Gr.calculateAt(r,e),-8&t)return-28;var o=qr.lookupPath(e,{follow:!0}),i=o.node;if(!i)return-44;var a="";return 4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&qr.nodePermissions(i,a)?-2:0}catch(s){if("undefined"==typeof qr||!(s instanceof qr.ErrnoError))throw s;return-s.errno}}function Kr(r){return U[He()>>2]=r,r}function Vr(r,e,t){Gr.varargs=t;try{var n=Gr.getStreamFromFD(r);switch(e){case 0:var o,i=Gr.get();return i<0?-28:(o=qr.createStream(n,i),o.fd);case 1:case 2:return 0;case 3:return n.flags;case 4:i=Gr.get();return n.flags|=i,0;case 5:i=Gr.get();var a=0;return j[i+a>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Kr(28),-1;default:return-28}}catch(s){if("undefined"==typeof qr||!(s instanceof qr.ErrnoError))throw s;return-s.errno}}function Jr(r,e){try{if(0===e)return-28;var t=qr.cwd(),n=K(t)+1;return e<n?-68:(X(t,r,e),n)}catch(o){if("undefined"==typeof qr||!(o instanceof qr.ErrnoError))throw o;return-o.errno}}function Qr(r,e,t){Gr.varargs=t;try{var n=Gr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Gr.get();return U[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=Gr.get();return qr.ioctl(n,e,o);case 21523:return n.tty?0:-59;case 21524:return n.tty?0:-59;default:yr("bad ioctl syscall "+e)}}catch(i){if("undefined"==typeof qr||!(i instanceof qr.ErrnoError))throw i;return-i.errno}}function Zr(r,e){try{return r=Gr.getStr(r),Gr.doStat(qr.lstat,r,e)}catch(t){if("undefined"==typeof qr||!(t instanceof qr.ErrnoError))throw t;return-t.errno}}function $r(r,e,t){try{return e=Gr.getStr(e),e=Gr.calculateAt(r,e),e=Lr.normalize(e),"/"===e[e.length-1]&&(e=e.substr(0,e.length-1)),qr.mkdir(e,t,0),0}catch(n){if("undefined"==typeof qr||!(n instanceof qr.ErrnoError))throw n;return-n.errno}}function re(r,e,t,n){try{e=Gr.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=Gr.calculateAt(r,e,i),Gr.doStat(o?qr.lstat:qr.stat,e,t)}catch(a){if("undefined"==typeof qr||!(a instanceof qr.ErrnoError))throw a;return-a.errno}}function ee(r,e,t,n){Gr.varargs=n;try{e=Gr.getStr(e),e=Gr.calculateAt(r,e);var o=n?Gr.get():0;return qr.open(e,t,o).fd}catch(i){if("undefined"==typeof qr||!(i instanceof qr.ErrnoError))throw i;return-i.errno}}function te(r,e,t,n){try{if(e=Gr.getStr(e),e=Gr.calculateAt(r,e),n<=0)return-28;var o=qr.readlink(e),i=Math.min(n,K(o)),a=z[t+i];return X(o,t,n+1),z[t+i]=a,i}catch(s){if("undefined"==typeof qr||!(s instanceof qr.ErrnoError))throw s;return-s.errno}}function ne(r,e){try{return r=Gr.getStr(r),Gr.doStat(qr.stat,r,e)}catch(t){if("undefined"==typeof qr||!(t instanceof qr.ErrnoError))throw t;return-t.errno}}function oe(r,e,t){try{return e=Gr.getStr(e),e=Gr.calculateAt(r,e),0===t?qr.unlink(e):512===t?qr.rmdir(e):yr("Invalid flags passed to unlinkat"),0}catch(n){if("undefined"==typeof qr||!(n instanceof qr.ErrnoError))throw n;return-n.errno}}function ie(r,e,t,n){try{if(e=Gr.getStr(e),e=Gr.calculateAt(r,e,!0),t){var o=U[t>>2],i=U[t+4>>2];a=1e3*o+i/1e6,t+=8,o=U[t>>2],i=U[t+4>>2],s=1e3*o+i/1e6}else var a=Date.now(),s=a;return qr.utime(e,a,s),0}catch(u){if("undefined"==typeof qr||!(u instanceof qr.ErrnoError))throw u;return-u.errno}}function ae(){throw 1/0}function se(){yr("")}function ue(r,e,t){x.copyWithin(r,e,e+t)}function ce(){return 2147483648}function fe(r){try{return P.grow(r-B.byteLength+65535>>>16),$(P.buffer),1}catch(e){}}function le(r){var e=x.length;r>>>=0;var t=ce();if(r>t)return!1;let n=(r,e)=>r+(e-r%e)%e;for(var o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,r+100663296);var a=Math.min(t,n(Math.max(r,i),65536)),s=fe(a);if(s)return!0}return!1}var de={};function he(){return p||"./this.program"}function me(){if(!me.strings){var r=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:he()};for(var t in de)void 0===de[t]?delete e[t]:e[t]=de[t];var n=[];for(var t in e)n.push(t+"="+e[t]);me.strings=n}return me.strings}function pe(r,e){var t=0;return me().forEach((function(n,o){var i=e+t;H[r+4*o>>2]=i,Z(n,i),t+=n.length+1})),0}function we(r,e){var t=me();H[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),H[e>>2]=n,0}function Ee(r){ut(r)}function ve(r){try{var e=Gr.getStreamFromFD(r);return qr.close(e),0}catch(t){if("undefined"==typeof qr||!(t instanceof qr.ErrnoError))throw t;return t.errno}}function ye(r,e){try{var t=Gr.getStreamFromFD(r),n=t.tty?2:qr.isDir(t.mode)?3:qr.isLink(t.mode)?7:4;return z[e>>0]=n,0}catch(o){if("undefined"==typeof qr||!(o instanceof qr.ErrnoError))throw o;return o.errno}}function ge(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=H[e>>2],s=H[e+4>>2];e+=8;var u=qr.read(r,z,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}function _e(r,e,t,n){try{var o=Gr.getStreamFromFD(r),i=ge(o,e,t);return U[n>>2]=i,0}catch(a){if("undefined"==typeof qr||!(a instanceof qr.ErrnoError))throw a;return a.errno}}function ke(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN}function Se(r,e,t,n,o){try{var i=ke(e,t);if(isNaN(i))return 61;var a=Gr.getStreamFromFD(r);return qr.llseek(a,i,n),kr=[a.position>>>0,(_r=a.position,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[o>>2]=kr[0],U[o+4>>2]=kr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(s){if("undefined"==typeof qr||!(s instanceof qr.ErrnoError))throw s;return s.errno}}function be(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=H[e>>2],s=H[e+4>>2];e+=8;var u=qr.write(r,z,a,s,n);if(u<0)return-1;o+=u}return o}function De(r,e,t,n){try{var o=Gr.getStreamFromFD(r),i=be(o,e,t);return H[n>>2]=i,0}catch(a){if("undefined"==typeof qr||!(a instanceof qr.ErrnoError))throw a;return a.errno}}function Ne(){return O()}function Fe(r){F(r)}function Oe(r){return r%4===0&&(r%100!==0||r%400===0)}function Pe(r,e){for(var t=0,n=0;n<=e;t+=r[n++]);return t}var Ae=[31,29,31,30,31,30,31,31,30,31,30,31],Me=[31,28,31,30,31,30,31,31,30,31,30,31];function Re(r,e){var t=new Date(r.getTime());while(e>0){var n=Oe(t.getFullYear()),o=t.getMonth(),i=(n?Ae:Me)[o];if(!(e>i-t.getDate()))return t.setDate(t.getDate()+e),t;e-=i-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}function Te(r,e,t,n){var o=U[n+40>>2],i={tm_sec:U[n>>2],tm_min:U[n+4>>2],tm_hour:U[n+8>>2],tm_mday:U[n+12>>2],tm_mon:U[n+16>>2],tm_year:U[n+20>>2],tm_wday:U[n+24>>2],tm_yday:U[n+28>>2],tm_isdst:U[n+32>>2],tm_gmtoff:U[n+36>>2],tm_zone:o?q(o):""},a=q(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,e,t){var n="number"==typeof r?r.toString():r||"";while(n.length<e)n=t[0]+n;return n}function d(r,e){return l(r,e,"0")}function h(r,e){function t(r){return r<0?-1:r>0?1:0}var n;return 0===(n=t(r.getFullYear()-e.getFullYear()))&&0===(n=t(r.getMonth()-e.getMonth()))&&(n=t(r.getDate()-e.getDate())),n}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function p(r){var e=Re(new Date(r.tm_year+1900,0,1),r.tm_yday),t=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=m(t),i=m(n);return h(o,e)<=0?h(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var w={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){var e=r.tm_year+1900;return d(e/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return l(r.tm_mday,2," ")},"%g":function(r){return p(r).toString().substring(2)},"%G":function(r){return p(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var e=r.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(r){return d(r.tm_mday+Pe(Oe(r.tm_year+1900)?Ae:Me,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var e=r.tm_yday+7-r.tm_wday;return d(Math.floor(e/7),2)},"%V":function(r){var e=Math.floor((r.tm_yday+7-(r.tm_wday+6)%7)/7);if((r.tm_wday+371-r.tm_yday-2)%7<=2&&e++,e){if(53==e){var t=(r.tm_wday+371-r.tm_yday)%7;4==t||3==t&&Oe(r.tm_year)||(e=1)}}else{e=52;var n=(r.tm_wday+7-r.tm_yday-1)%7;(4==n||5==n&&Oe(r.tm_year%400-1))&&e++}return d(e,2)},"%w":function(r){return r.tm_wday},"%W":function(r){var e=r.tm_yday+7-(r.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var e=r.tm_gmtoff,t=e>=0;return e=Math.abs(e)/60,e=e/60*100+e%60,(t?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),w)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),w[u](i)));a=a.replace(/\0\0/g,"%");var E=ze(a,!1);return E.length>e?0:(Q(E,r),E.length-1)}function Ce(r,e,t,n){return Te(r,e,t,n)}var Ie=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=qr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},Le=365,Be=146;function ze(r,e,t){var n=t>0?t:K(r)+1,o=new Array(n),i=G(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(Ie.prototype,{read:{get:function(){return(this.mode&Le)===Le},set:function(r){r?this.mode|=Le:this.mode&=~Le}},write:{get:function(){return(this.mode&Be)===Be},set:function(r){r?this.mode|=Be:this.mode&=~Be}},isFolder:{get:function(){return qr.isDir(this.mode)}},isDevice:{get:function(){return qr.isChrdev(this.mode)}}}),qr.FSNode=Ie,qr.staticInit(),o["FS_createPath"]=qr.createPath,o["FS_createDataFile"]=qr.createDataFile,o["FS_createPreloadedFile"]=qr.createPreloadedFile,o["FS_unlink"]=qr.unlink,o["FS_createLazyFile"]=qr.createLazyFile,o["FS_createDevice"]=qr.createDevice,y&&(d(),Yr.staticInit()),Wr={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var xe,je={d:Tr,g:Ir,y:Xr,q:Vr,M:Jr,v:Qr,H:Zr,F:$r,G:re,w:ee,E:te,I:ne,D:oe,C:ie,A:ae,n:se,N:ue,p:le,K:pe,L:we,s:Ee,r:ve,J:ye,u:_e,x:Se,t:De,a:Ne,m:tt,h:Ke,e:Qe,f:Je,j:Ze,k:et,o:ot,z:Ve,c:$e,i:rt,l:nt,b:Fe,B:Ce},Ue=(Or(),o["___wasm_call_ctors"]=function(){return(o["___wasm_call_ctors"]=o["asm"]["P"]).apply(null,arguments)},o["_main"]=function(){return(o["_main"]=o["asm"]["Q"]).apply(null,arguments)},o["_malloc"]=function(){return(Ue=o["_malloc"]=o["asm"]["R"]).apply(null,arguments)}),He=o["___errno_location"]=function(){return(He=o["___errno_location"]=o["asm"]["S"]).apply(null,arguments)},We=(o["_itk_wasm_input_array_alloc"]=function(){return(o["_itk_wasm_input_array_alloc"]=o["asm"]["T"]).apply(null,arguments)},o["_itk_wasm_input_json_alloc"]=function(){return(o["_itk_wasm_input_json_alloc"]=o["asm"]["U"]).apply(null,arguments)},o["_itk_wasm_output_json_address"]=function(){return(o["_itk_wasm_output_json_address"]=o["asm"]["V"]).apply(null,arguments)},o["_itk_wasm_output_json_size"]=function(){return(o["_itk_wasm_output_json_size"]=o["asm"]["W"]).apply(null,arguments)},o["_itk_wasm_output_array_address"]=function(){return(o["_itk_wasm_output_array_address"]=o["asm"]["X"]).apply(null,arguments)},o["_itk_wasm_output_array_size"]=function(){return(o["_itk_wasm_output_array_size"]=o["asm"]["Y"]).apply(null,arguments)},o["_itk_wasm_free_all"]=function(){return(o["_itk_wasm_free_all"]=o["asm"]["Z"]).apply(null,arguments)},o["_setThrew"]=function(){return(We=o["_setThrew"]=o["asm"]["$"]).apply(null,arguments)}),Ye=o["stackSave"]=function(){return(Ye=o["stackSave"]=o["asm"]["aa"]).apply(null,arguments)},qe=o["stackRestore"]=function(){return(qe=o["stackRestore"]=o["asm"]["ba"]).apply(null,arguments)},Ge=o["stackAlloc"]=function(){return(Ge=o["stackAlloc"]=o["asm"]["ca"]).apply(null,arguments)},Xe=o["___cxa_is_pointer_type"]=function(){return(Xe=o["___cxa_is_pointer_type"]=o["asm"]["da"]).apply(null,arguments)};function Ke(r,e){var t=Ye();try{return Mr(r)(e)}catch(n){if(qe(t),n!==n+0)throw n;We(1,0)}}function Ve(r){var e=Ye();try{Mr(r)()}catch(t){if(qe(e),t!==t+0)throw t;We(1,0)}}function Je(r,e,t,n){var o=Ye();try{return Mr(r)(e,t,n)}catch(i){if(qe(o),i!==i+0)throw i;We(1,0)}}function Qe(r,e,t){var n=Ye();try{return Mr(r)(e,t)}catch(o){if(qe(n),o!==o+0)throw o;We(1,0)}}function Ze(r,e,t,n,o){var i=Ye();try{return Mr(r)(e,t,n,o)}catch(a){if(qe(i),a!==a+0)throw a;We(1,0)}}function $e(r,e){var t=Ye();try{Mr(r)(e)}catch(n){if(qe(t),n!==n+0)throw n;We(1,0)}}function rt(r,e,t){var n=Ye();try{Mr(r)(e,t)}catch(o){if(qe(n),o!==o+0)throw o;We(1,0)}}function et(r,e,t,n,o,i){var a=Ye();try{return Mr(r)(e,t,n,o,i)}catch(s){if(qe(a),s!==s+0)throw s;We(1,0)}}function tt(r){var e=Ye();try{return Mr(r)()}catch(t){if(qe(e),t!==t+0)throw t;We(1,0)}}function nt(r,e,t,n,o){var i=Ye();try{Mr(r)(e,t,n,o)}catch(a){if(qe(i),a!==a+0)throw a;We(1,0)}}function ot(r,e,t,n,o,i,a){var s=Ye();try{return Mr(r)(e,t,n,o,i,a)}catch(u){if(qe(s),u!==u+0)throw u;We(1,0)}}function it(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}o["ccall"]=I,o["cwrap"]=L,o["addRunDependency"]=Er,o["removeRunDependency"]=vr,o["FS_createPath"]=qr.createPath,o["FS_createDataFile"]=qr.createDataFile,o["FS_createPreloadedFile"]=qr.createPreloadedFile,o["FS_createLazyFile"]=qr.createLazyFile,o["FS_createDevice"]=qr.createDevice,o["FS_unlink"]=qr.unlink,o["callMain"]=at,o["AsciiToString"]=V,o["writeArrayToMemory"]=Q,o["writeAsciiToMemory"]=Z;function at(r){var e=o["_main"];r=r||[],r.unshift(p);var t=r.length,n=Ge(4*(t+1)),i=n>>2;r.forEach((r=>{U[i++]=J(r)})),U[i]=0;try{var a=e(t,n);return ut(a,!0),a}catch(s){return Rr(s)}finally{!0}}function st(r){function e(){xe||(xe=!0,o["calledRun"]=!0,R||(sr(),ur(),t(o),o["onRuntimeInitialized"]&&o["onRuntimeInitialized"](),ft&&at(r),cr()))}r=r||m,hr>0||(ar(),hr>0||(o["setStatus"]?(o["setStatus"]("Running..."),setTimeout((function(){setTimeout((function(){o["setStatus"]("")}),1),e()}),1)):e()))}function ut(r,e){M=r,ct(r)}function ct(r){M=r,ir()||(o["onExit"]&&o["onExit"](r),R=!0),w(r,new it(r))}if(pr=function r(){xe||st(),xe||(pr=r)},o["run"]=st,o["preInit"]){"function"==typeof o["preInit"]&&(o["preInit"]=[o["preInit"]]);while(o["preInit"].length>0)o["preInit"].pop()()}var ft=!1;return o["noInitialRun"]&&(ft=!1),st(),o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!qr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),i=1;i<o.length;i++)n+=o[i],qr.analyzePath(n).exists||qr.mkdir(n),n+="/";return qr.mount(Yr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);qr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],qr.analyzePath(e).exists||qr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return qr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return qr.writeFile(r,e,t)},o.fs_unlink=function(r){return qr.unlink(r)},o.fs_open=function(r,e,t){return qr.open(r,e,t)},o.fs_stat=function(r){return qr.stat(r)},o.fs_read=function(r,e,t,n,o){return qr.read(r,e,t,n,o)},o.fs_close=function(r){return qr.close(r)},o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!qr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),i=1;i<o.length;i++)n+=o[i],qr.analyzePath(n).exists||qr.mkdir(n),n+="/";return qr.mount(Yr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);qr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],qr.analyzePath(e).exists||qr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return qr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return qr.writeFile(r,e,t)},o.fs_unlink=function(r){return qr.unlink(r)},o.fs_open=function(r,e,t){return qr.open(r,e,t)},o.fs_stat=function(r){return qr.stat(r)},o.fs_read=function(r,e,t,n,o){return qr.read(r,e,t,n,o)},o.fs_close=function(r){return qr.close(r)},e.ready}})();export default JPEGImageIOWriteImage;
@@ -0,0 +1 @@
1
+ var JPEGImageIOWriteImage=(()=>{var r="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!==typeof __filename&&(r=r||__filename),function(e){e=e||{};var t,n,o="undefined"!=typeof e?e:{};o["ready"]=new Promise((function(r,e){t=r,n=e}));var i=null,a=null;o["resetModuleStdout"]=function(){i=""},o["resetModuleStderr"]=function(){a=""},o["print"]=function(r){console.log(r),i+=r+"\n"},o["printErr"]=function(r){console.error(r),a+=r+"\n"},o["getModuleStdout"]=function(){return i},o["getModuleStderr"]=function(){return a};i=null,a=null;o["resetModuleStdout"]=function(){i=""},o["resetModuleStderr"]=function(){a=""},o["print"]=function(r){console.log(r),i+=r+"\n"},o["printErr"]=function(r){console.error(r),a+=r+"\n"},o["getModuleStdout"]=function(){return i},o["getModuleStderr"]=function(){return a};var s,u,c,f,l,d,m=Object.assign({},o),h=[],p="./this.program",w=(r,e)=>{throw e},E="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g="";function _(r){return o["locateFile"]?o["locateFile"](r,g):g+r}function k(r){if(r instanceof it)return;let e=r;b("exiting due to exception: "+e)}y?(g=v?require("path").dirname(g)+"/":__dirname+"/",d=()=>{l||(f=require("fs"),l=require("path"))},s=function(r,e){return d(),r=l["normalize"](r),f.readFileSync(r,e?void 0:"utf8")},c=r=>{var e=s(r,!0);return e.buffer||(e=new Uint8Array(e)),e},u=(r,e,t)=>{d(),r=l["normalize"](r),f.readFile(r,(function(r,n){r?t(r):e(n.buffer)}))},process["argv"].length>1&&(p=process["argv"][1].replace(/\\/g,"/")),h=process["argv"].slice(2),process["on"]("uncaughtException",(function(r){if(!(r instanceof it))throw r})),process["on"]("unhandledRejection",(function(r){throw r})),w=(r,e)=>{if(ir())throw process["exitCode"]=r,e;k(e),process["exit"](r)},o["inspect"]=function(){return"[Emscripten Module object]"}):(E||v)&&(v?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},v&&(c=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)});var S=o["print"]||console.log.bind(console),b=o["printErr"]||console.warn.bind(console);Object.assign(o,m),m=null,o["arguments"]&&(h=o["arguments"]),o["thisProgram"]&&(p=o["thisProgram"]),o["quit"]&&(w=o["quit"]);var D,N=0,F=r=>{N=r},O=()=>N;o["wasmBinary"]&&(D=o["wasmBinary"]);var P,A=o["noExitRuntime"]||!0;"object"!=typeof WebAssembly&&yr("no native wasm support detected");var M,R=!1;function T(r,e){r||yr(e)}function C(r){var e=o["_"+r];return e}function I(r,e,t,n,o){var i={string:function(r){var e=0;if(null!==r&&void 0!==r&&0!==r){var t=1+(r.length<<2);e=qe(t),X(r,e,t)}return e},array:function(r){var e=qe(r.length);return Q(r,e),e}};function a(r){return"string"===e?G(r):"boolean"===e?Boolean(r):r}var s=C(r),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=i[t[f]];l?(0===c&&(c=Ye()),u[f]=l(n[f])):u[f]=n[f]}var d=s.apply(null,u);function m(r){return 0!==c&&Ge(c),a(r)}return d=m(d),d}function L(r,e,t,n){t=t||[];var o=t.every((function(r){return"number"===r})),i="string"!==e;return i&&o&&!n?C(r):function(){return I(r,e,t,arguments,n)}}var B,x,z,j,U,H,W="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Y(r,e,t){var n=e+t,o=e;while(r[o]&&!(o>=n))++o;if(o-e>16&&r.buffer&&W)return W.decode(r.subarray(e,o));var i="";while(e<o){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if(a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++],a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function G(r,e){return r?Y(z,r,e):""}function q(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343){var u=r.charCodeAt(++a);s=65536+((1023&s)<<10)|1023&u}if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function X(r,e,t){return q(r,z,e,t)}function K(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function V(r){var e="";while(1){var t=z[r++>>0];if(!t)return e;e+=String.fromCharCode(t)}}function J(r){var e=K(r)+1,t=qe(e);return q(r,x,t,e),t}function Q(r,e){x.set(r,e)}function Z(r,e,t){for(var n=0;n<r.length;++n)x[e++>>0]=r.charCodeAt(n);t||(x[e>>0]=0)}function $(r){B=r,o["HEAP8"]=x=new Int8Array(r),o["HEAP16"]=j=new Int16Array(r),o["HEAP32"]=U=new Int32Array(r),o["HEAPU8"]=z=new Uint8Array(r),o["HEAPU16"]=new Uint16Array(r),o["HEAPU32"]=H=new Uint32Array(r),o["HEAPF32"]=new Float32Array(r),o["HEAPF64"]=new Float64Array(r)}o["INITIAL_MEMORY"];var rr,er=[],tr=[],nr=[],or=[];function ir(){return A}function ar(){if(o["preRun"]){"function"==typeof o["preRun"]&&(o["preRun"]=[o["preRun"]]);while(o["preRun"].length)fr(o["preRun"].shift())}Pr(er)}function sr(){!0,o["noFSInit"]||Gr.init.initialized||Gr.init(),Gr.ignorePermissions=!1,zr.init(),Pr(tr)}function ur(){Pr(nr)}function cr(){if(o["postRun"]){"function"==typeof o["postRun"]&&(o["postRun"]=[o["postRun"]]);while(o["postRun"].length)dr(o["postRun"].shift())}Pr(or)}function fr(r){er.unshift(r)}function lr(r){tr.unshift(r)}function dr(r){or.unshift(r)}var mr=0,hr=null,pr=null;function wr(r){return r}function Er(r){mr++,o["monitorRunDependencies"]&&o["monitorRunDependencies"](mr)}function vr(r){if(mr--,o["monitorRunDependencies"]&&o["monitorRunDependencies"](mr),0==mr&&(null!==hr&&(clearInterval(hr),hr=null),pr)){var e=pr;pr=null,e()}}function yr(r){o["onAbort"]&&o["onAbort"](r),r="Aborted("+r+")",b(r),R=!0,M=1,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var gr,_r,kr,Sr="data:application/octet-stream;base64,";function br(r){return r.startsWith(Sr)}function Dr(r){return r.startsWith("file://")}function Nr(r){try{if(r==gr&&D)return new Uint8Array(D);if(c)return c(r);throw"both async and sync fetching of the wasm failed"}catch(b){yr(b)}}function Fr(){if(!D&&(E||v)){if("function"==typeof fetch&&!Dr(gr))return fetch(gr,{credentials:"same-origin"}).then((function(r){if(!r["ok"])throw"failed to load wasm binary file at '"+gr+"'";return r["arrayBuffer"]()})).catch((function(){return Nr(gr)}));if(u)return new Promise((function(r,e){u(gr,(function(e){r(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Nr(gr)}))}function Or(){var r={a:je};function e(r,e){var t=r.exports;o["asm"]=t,P=o["asm"]["O"],$(P.buffer),rr=o["asm"]["_"],lr(o["asm"]["P"]),vr("wasm-instantiate")}function t(r){e(r["instance"])}function i(e){return Fr().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){b("failed to asynchronously prepare wasm: "+r),yr(r)}))}function a(){return D||"function"!=typeof WebAssembly.instantiateStreaming||br(gr)||Dr(gr)||y||"function"!=typeof fetch?i(t):fetch(gr,{credentials:"same-origin"}).then((function(e){var n=WebAssembly.instantiateStreaming(e,r);return n.then(t,(function(r){return b("wasm streaming compile failed: "+r),b("falling back to ArrayBuffer instantiation"),i(t)}))}))}if(Er("wasm-instantiate"),o["instantiateWasm"])try{var s=o["instantiateWasm"](r,e);return s}catch(u){return b("Module.instantiateWasm callback failed with error: "+u),!1}return a().catch(n),{}}function Pr(r){while(r.length>0){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?Mr(t)():Mr(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}gr="JPEGImageIOWriteImage.umd.wasm",br(gr)||(gr=_(gr));var Ar=[];function Mr(r){var e=Ar[r];return e||(r>=Ar.length&&(Ar.length=r+1),Ar[r]=e=rr.get(r)),e}function Rr(r){if(r instanceof it||"unwind"==r)return M;w(1,r)}function Tr(r){return Ue(r+24)+24}function Cr(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(r){H[this.ptr+4>>2]=r},this.get_type=function(){return H[this.ptr+4>>2]},this.set_destructor=function(r){H[this.ptr+8>>2]=r},this.get_destructor=function(){return H[this.ptr+8>>2]},this.set_refcount=function(r){U[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,x[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,x[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=U[this.ptr>>2];U[this.ptr>>2]=r+1},this.release_ref=function(){var r=U[this.ptr>>2];return U[this.ptr>>2]=r-1,1===r},this.set_adjusted_ptr=function(r){H[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return H[this.ptr+16>>2]},this.get_exception_ptr=function(){var r=Xe(this.get_type());if(r)return H[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function Ir(r,e,t){var n=new Cr(r);throw n.init(e,t),r,r}var Lr={isAbs:r=>"/"===r.charAt(0),splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=Lr.isAbs(r),t="/"===r.substr(-1);return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),r||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Lr.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";r=Lr.normalize(r),r=r.replace(/\/$/,"");var e=r.lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments,0);return Lr.normalize(r.join("/"))},join2:(r,e)=>Lr.normalize(r+"/"+e)};function Br(){if("object"==typeof crypto&&"function"==typeof crypto["getRandomValues"]){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(y)try{var e=require("crypto");return function(){return e["randomBytes"](1)[0]}}catch(t){}return function(){yr("randomDevice")}}var xr={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Gr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e=Lr.isAbs(n)}return r=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"),(e?"/":"")+r||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length;e++)if(""!==r[e])break;for(var t=r.length-1;t>=0;t--)if(""!==r[t])break;return e>t?[]:r.slice(e,t-e+1)}r=xr.resolve(r).substr(1),e=xr.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return u=u.concat(o.slice(a)),u.join("/")}},zr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){zr.ttys[r]={input:[],output:[],ops:e},Gr.registerDevice(r,zr.stream_ops)},stream_ops:{open:function(r){var e=zr.ttys[r.node.rdev];if(!e)throw new Gr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Gr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(u){throw new Gr.ErrnoError(29)}if(void 0===s&&0===i)throw new Gr.ErrnoError(6);if(null===s||void 0===s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Gr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(a){throw new Gr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(y){var t=256,n=Buffer.alloc(t),o=0;try{o=f.readSync(process.stdin.fd,n,0,t,-1)}catch(i){if(!i.toString().includes("EOF"))throw i;o=0}e=o>0?n.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(e=window.prompt("Input: "),null!==e&&(e+="\n")):"function"==typeof readline&&(e=readline(),null!==e&&(e+="\n"));if(!e)return null;r.input=xe(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(S(Y(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(S(Y(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(b(Y(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(b(Y(r.output,0)),r.output=[])}}};function jr(r){yr()}var Ur={ops_table:null,mount:function(r){return Ur.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Gr.isBlkdev(t)||Gr.isFIFO(t))throw new Gr.ErrnoError(63);Ur.ops_table||(Ur.ops_table={dir:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,lookup:Ur.node_ops.lookup,mknod:Ur.node_ops.mknod,rename:Ur.node_ops.rename,unlink:Ur.node_ops.unlink,rmdir:Ur.node_ops.rmdir,readdir:Ur.node_ops.readdir,symlink:Ur.node_ops.symlink},stream:{llseek:Ur.stream_ops.llseek}},file:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:{llseek:Ur.stream_ops.llseek,read:Ur.stream_ops.read,write:Ur.stream_ops.write,allocate:Ur.stream_ops.allocate,mmap:Ur.stream_ops.mmap,msync:Ur.stream_ops.msync}},link:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr,readlink:Ur.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ur.node_ops.getattr,setattr:Ur.node_ops.setattr},stream:Gr.chrdev_stream_ops}});var o=Gr.createNode(r,e,t,n);return Gr.isDir(o.mode)?(o.node_ops=Ur.ops_table.dir.node,o.stream_ops=Ur.ops_table.dir.stream,o.contents={}):Gr.isFile(o.mode)?(o.node_ops=Ur.ops_table.file.node,o.stream_ops=Ur.ops_table.file.stream,o.usedBytes=0,o.contents=null):Gr.isLink(o.mode)?(o.node_ops=Ur.ops_table.link.node,o.stream_ops=Ur.ops_table.link.stream):Gr.isChrdev(o.mode)&&(o.node_ops=Ur.ops_table.chrdev.node,o.stream_ops=Ur.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Gr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Gr.isDir(r.mode)?e.size=4096:Gr.isFile(r.mode)?e.size=r.usedBytes:Gr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Ur.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Gr.genericErrors[44]},mknod:function(r,e,t,n){return Ur.createNode(r,e,t,n)},rename:function(r,e,t){if(Gr.isDir(r.mode)){var n;try{n=Gr.lookupNode(e,t)}catch(i){}if(n)for(var o in n.contents)throw new Gr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Gr.lookupNode(r,e);for(var n in t.contents)throw new Gr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=Ur.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Gr.isLink(r.mode))throw new Gr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===x.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(Ur.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Gr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Gr.ErrnoError(28);return n},allocate:function(r,e,t){Ur.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o){if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);var i,a,s=r.node.contents;if(2&o||s.buffer!==B){if((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),a=!0,i=jr(e),!i)throw new Gr.ErrnoError(48);x.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(r,e,t,n,o){if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);if(2&o)return 0;Ur.stream_ops.write(r,e,0,n,t,!1);return 0}}};function Hr(r,e,t,n){var o=n?"":wr("al "+r);u(r,(function(t){T(t,'Loading data file "'+r+'" failed (no arrayBuffer).'),e(new Uint8Array(t)),o&&vr(o)}),(function(e){if(!t)throw'Loading data file "'+r+'" failed.';t()})),o&&Er(o)}var Wr={},Yr={isWindows:!1,staticInit:()=>{Yr.isWindows=!!process.platform.match(/^win/);var r=process["binding"]("constants");r["fs"]&&(r=r["fs"]),Yr.flagsForNodeMap={1024:r["O_APPEND"],64:r["O_CREAT"],128:r["O_EXCL"],256:r["O_NOCTTY"],0:r["O_RDONLY"],2:r["O_RDWR"],4096:r["O_SYNC"],512:r["O_TRUNC"],1:r["O_WRONLY"],131072:r["O_NOFOLLOW"]}},convertNodeCode:r=>{var e=r.code;return Wr[e]},mount:r=>Yr.createNode(null,"/",Yr.getMode(r.opts.root),0),createNode:(r,e,t,n)=>{if(!Gr.isDir(t)&&!Gr.isFile(t)&&!Gr.isLink(t))throw new Gr.ErrnoError(28);var o=Gr.createNode(r,e,t);return o.node_ops=Yr.node_ops,o.stream_ops=Yr.stream_ops,o},getMode:r=>{var e;try{e=f.lstatSync(r),Yr.isWindows&&(e.mode=e.mode|(292&e.mode)>>2)}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Yr.convertNodeCode(t))}return e.mode},realPath:r=>{var e=[];while(r.parent!==r)e.push(r.name),r=r.parent;return e.push(r.mount.opts.root),e.reverse(),Lr.join.apply(null,e)},flagsForNode:r=>{r&=-2097153,r&=-2049,r&=-32769,r&=-524289,r&=-65537;var e=0;for(var t in Yr.flagsForNodeMap)r&t&&(e|=Yr.flagsForNodeMap[t],r^=t);if(r)throw new Gr.ErrnoError(28);return e},node_ops:{getattr:r=>{var e,t=Yr.realPath(r);try{e=f.lstatSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Yr.convertNodeCode(n))}return Yr.isWindows&&!e.blksize&&(e.blksize=4096),Yr.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:(r,e)=>{var t=Yr.realPath(r);try{if(void 0!==e.mode&&(f.chmodSync(t,e.mode),r.mode=e.mode),void 0!==e.timestamp){var n=new Date(e.timestamp);f.utimesSync(t,n,n)}void 0!==e.size&&f.truncateSync(t,e.size)}catch(o){if(!o.code)throw o;throw new Gr.ErrnoError(Yr.convertNodeCode(o))}},lookup:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e),n=Yr.getMode(t);return Yr.createNode(r,e,n)},mknod:(r,e,t,n)=>{var o=Yr.createNode(r,e,t,n),i=Yr.realPath(o);try{Gr.isDir(o.mode)?f.mkdirSync(i,o.mode):f.writeFileSync(i,"",{mode:o.mode})}catch(a){if(!a.code)throw a;throw new Gr.ErrnoError(Yr.convertNodeCode(a))}return o},rename:(r,e,t)=>{var n=Yr.realPath(r),o=Lr.join2(Yr.realPath(e),t);try{f.renameSync(n,o)}catch(i){if(!i.code)throw i;throw new Gr.ErrnoError(Yr.convertNodeCode(i))}r.name=t},unlink:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e);try{f.unlinkSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Yr.convertNodeCode(n))}},rmdir:(r,e)=>{var t=Lr.join2(Yr.realPath(r),e);try{f.rmdirSync(t)}catch(n){if(!n.code)throw n;throw new Gr.ErrnoError(Yr.convertNodeCode(n))}},readdir:r=>{var e=Yr.realPath(r);try{return f.readdirSync(e)}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Yr.convertNodeCode(t))}},symlink:(r,e,t)=>{var n=Lr.join2(Yr.realPath(r),e);try{f.symlinkSync(t,n)}catch(o){if(!o.code)throw o;throw new Gr.ErrnoError(Yr.convertNodeCode(o))}},readlink:r=>{var e=Yr.realPath(r);try{return e=f.readlinkSync(e),e=l.relative(l.resolve(r.mount.opts.root),e),e}catch(t){if(!t.code)throw t;if("UNKNOWN"===t.code)throw new Gr.ErrnoError(28);throw new Gr.ErrnoError(Yr.convertNodeCode(t))}}},stream_ops:{open:r=>{var e=Yr.realPath(r.node);try{Gr.isFile(r.node.mode)&&(r.nfd=f.openSync(e,Yr.flagsForNode(r.flags)))}catch(t){if(!t.code)throw t;throw new Gr.ErrnoError(Yr.convertNodeCode(t))}},close:r=>{try{Gr.isFile(r.node.mode)&&r.nfd&&f.closeSync(r.nfd)}catch(e){if(!e.code)throw e;throw new Gr.ErrnoError(Yr.convertNodeCode(e))}},read:(r,e,t,n,o)=>{if(0===n)return 0;try{return f.readSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(i){throw new Gr.ErrnoError(Yr.convertNodeCode(i))}},write:(r,e,t,n,o)=>{try{return f.writeSync(r.nfd,Buffer.from(e.buffer),t,n,o)}catch(i){throw new Gr.ErrnoError(Yr.convertNodeCode(i))}},llseek:(r,e,t)=>{var n=e;if(1===t)n+=r.position;else if(2===t&&Gr.isFile(r.node.mode))try{var o=f.fstatSync(r.nfd);n+=o.size}catch(i){throw new Gr.ErrnoError(Yr.convertNodeCode(i))}if(n<0)throw new Gr.ErrnoError(28);return n},mmap:(r,e,t,n,o)=>{if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);var i=jr(e);return Yr.stream_ops.read(r,x,i,e,t),{ptr:i,allocated:!0}},msync:(r,e,t,n,o)=>{if(!Gr.isFile(r.node.mode))throw new Gr.ErrnoError(43);if(2&o)return 0;Yr.stream_ops.write(r,e,0,n,t,!1);return 0}}},Gr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(r=xr.resolve(Gr.cwd(),r),!r)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(e=Object.assign(t,e),e.recurse_count>8)throw new Gr.ErrnoError(32);for(var n=Lr.normalizeArray(r.split("/").filter((r=>!!r)),!1),o=Gr.root,i="/",a=0;a<n.length;a++){var s=a===n.length-1;if(s&&e.parent)break;if(o=Gr.lookupNode(o,n[a]),i=Lr.join2(i,n[a]),Gr.isMountpoint(o)&&(!s||s&&e.follow_mount)&&(o=o.mounted.root),!s||e.follow){var u=0;while(Gr.isLink(o.mode)){var c=Gr.readlink(i);i=xr.resolve(Lr.dirname(i),c);var f=Gr.lookupPath(i,{recurse_count:e.recurse_count+1});if(o=f.node,u++>40)throw new Gr.ErrnoError(32)}}}return{path:i,node:o}},getPath:r=>{var e;while(1){if(Gr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Gr.nameTable.length},hashAddNode:r=>{var e=Gr.hashName(r.parent.id,r.name);r.name_next=Gr.nameTable[e],Gr.nameTable[e]=r},hashRemoveNode:r=>{var e=Gr.hashName(r.parent.id,r.name);if(Gr.nameTable[e]===r)Gr.nameTable[e]=r.name_next;else{var t=Gr.nameTable[e];while(t){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}}},lookupNode:(r,e)=>{var t=Gr.mayLookup(r);if(t)throw new Gr.ErrnoError(t,r);for(var n=Gr.hashName(r.id,e),o=Gr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Gr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new Gr.FSNode(r,e,t,n);return Gr.hashAddNode(o),o},destroyNode:r=>{Gr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768===(61440&r),isDir:r=>16384===(61440&r),isLink:r=>40960===(61440&r),isChrdev:r=>8192===(61440&r),isBlkdev:r=>24576===(61440&r),isFIFO:r=>4096===(61440&r),isSocket:r=>49152===(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=Gr.flagModes[r];if("undefined"==typeof e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>Gr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=Gr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{Gr.lookupNode(r,e);return 20}catch(t){}return Gr.nodePermissions(r,"wx")},mayDelete:(r,e,t)=>{var n;try{n=Gr.lookupNode(r,e)}catch(i){return i.errno}var o=Gr.nodePermissions(r,"wx");if(o)return o;if(t){if(!Gr.isDir(n.mode))return 54;if(Gr.isRoot(n)||Gr.getPath(n)===Gr.cwd())return 10}else if(Gr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?Gr.isLink(r.mode)?32:Gr.isDir(r.mode)&&("r"!==Gr.flagsToPermissionString(e)||512&e)?31:Gr.nodePermissions(r,Gr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=Gr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!Gr.streams[t])return t;throw new Gr.ErrnoError(33)},getStream:r=>Gr.streams[r],createStream:(r,e,t)=>{Gr.FSStream||(Gr.FSStream=function(){this.shared={}},Gr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!==(2097155&this.flags)}},isWrite:{get:function(){return 0!==(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get function(){return this.shared.position},set:function(r){this.shared.position=r}}}),r=Object.assign(new Gr.FSStream,r);var n=Gr.nextfd(e,t);return r.fd=n,Gr.streams[n]=r,r},closeStream:r=>{Gr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=Gr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new Gr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{Gr.devices[r]={stream_ops:e}},getDevice:r=>Gr.devices[r],getMounts:r=>{var e=[],t=[r];while(t.length){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{"function"==typeof r&&(e=r,r=!1),Gr.syncFSRequests++,Gr.syncFSRequests>1&&b("warning: "+Gr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Gr.getMounts(Gr.root.mount),n=0;function o(r){return Gr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o="/"===t,i=!t;if(o&&Gr.root)throw new Gr.ErrnoError(10);if(!o&&!i){var a=Gr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Gr.isMountpoint(n))throw new Gr.ErrnoError(10);if(!Gr.isDir(n.mode))throw new Gr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Gr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=Gr.lookupPath(r,{follow_mount:!1});if(!Gr.isMountpoint(e.node))throw new Gr.ErrnoError(28);var t=e.node,n=t.mounted,o=Gr.getMounts(n);Object.keys(Gr.nameTable).forEach((r=>{var e=Gr.nameTable[r];while(e){var t=e.name_next;o.includes(e.mount)&&Gr.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=Gr.lookupPath(r,{parent:!0}),o=n.node,i=Lr.basename(r);if(!i||"."===i||".."===i)throw new Gr.ErrnoError(28);var a=Gr.mayCreate(o,i);if(a)throw new Gr.ErrnoError(a);if(!o.node_ops.mknod)throw new Gr.ErrnoError(63);return o.node_ops.mknod(o,i,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,Gr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,Gr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Gr.mkdir(n,e)}catch(i){if(20!=i.errno)throw i}}},mkdev:(r,e,t)=>("undefined"==typeof t&&(t=e,e=438),e|=8192,Gr.mknod(r,e,t)),symlink:(r,e)=>{if(!xr.resolve(r))throw new Gr.ErrnoError(44);var t=Gr.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new Gr.ErrnoError(44);var o=Lr.basename(e),i=Gr.mayCreate(n,o);if(i)throw new Gr.ErrnoError(i);if(!n.node_ops.symlink)throw new Gr.ErrnoError(63);return n.node_ops.symlink(n,o,r)},rename:(r,e)=>{var t,n,o,i=Lr.dirname(r),a=Lr.dirname(e),s=Lr.basename(r),u=Lr.basename(e);if(t=Gr.lookupPath(r,{parent:!0}),n=t.node,t=Gr.lookupPath(e,{parent:!0}),o=t.node,!n||!o)throw new Gr.ErrnoError(44);if(n.mount!==o.mount)throw new Gr.ErrnoError(75);var c,f=Gr.lookupNode(n,s),l=xr.relative(r,a);if("."!==l.charAt(0))throw new Gr.ErrnoError(28);if(l=xr.relative(e,i),"."!==l.charAt(0))throw new Gr.ErrnoError(55);try{c=Gr.lookupNode(o,u)}catch(h){}if(f!==c){var d=Gr.isDir(f.mode),m=Gr.mayDelete(n,s,d);if(m)throw new Gr.ErrnoError(m);if(m=c?Gr.mayDelete(o,u,d):Gr.mayCreate(o,u),m)throw new Gr.ErrnoError(m);if(!n.node_ops.rename)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(f)||c&&Gr.isMountpoint(c))throw new Gr.ErrnoError(10);if(o!==n&&(m=Gr.nodePermissions(n,"w"),m))throw new Gr.ErrnoError(m);Gr.hashRemoveNode(f);try{n.node_ops.rename(f,o,u)}catch(h){throw h}finally{Gr.hashAddNode(f)}}},rmdir:r=>{var e=Gr.lookupPath(r,{parent:!0}),t=e.node,n=Lr.basename(r),o=Gr.lookupNode(t,n),i=Gr.mayDelete(t,n,!0);if(i)throw new Gr.ErrnoError(i);if(!t.node_ops.rmdir)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(o))throw new Gr.ErrnoError(10);t.node_ops.rmdir(t,n),Gr.destroyNode(o)},readdir:r=>{var e=Gr.lookupPath(r,{follow:!0}),t=e.node;if(!t.node_ops.readdir)throw new Gr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var e=Gr.lookupPath(r,{parent:!0}),t=e.node;if(!t)throw new Gr.ErrnoError(44);var n=Lr.basename(r),o=Gr.lookupNode(t,n),i=Gr.mayDelete(t,n,!1);if(i)throw new Gr.ErrnoError(i);if(!t.node_ops.unlink)throw new Gr.ErrnoError(63);if(Gr.isMountpoint(o))throw new Gr.ErrnoError(10);t.node_ops.unlink(t,n),Gr.destroyNode(o)},readlink:r=>{var e=Gr.lookupPath(r),t=e.node;if(!t)throw new Gr.ErrnoError(44);if(!t.node_ops.readlink)throw new Gr.ErrnoError(28);return xr.resolve(Gr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,e)=>{var t=Gr.lookupPath(r,{follow:!e}),n=t.node;if(!n)throw new Gr.ErrnoError(44);if(!n.node_ops.getattr)throw new Gr.ErrnoError(63);return n.node_ops.getattr(n)},lstat:r=>Gr.stat(r,!0),chmod:(r,e,t)=>{var n;if("string"==typeof r){var o=Gr.lookupPath(r,{follow:!t});n=o.node}else n=r;if(!n.node_ops.setattr)throw new Gr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{Gr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=Gr.getStream(r);if(!t)throw new Gr.ErrnoError(8);Gr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;if("string"==typeof r){var i=Gr.lookupPath(r,{follow:!n});o=i.node}else o=r;if(!o.node_ops.setattr)throw new Gr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{Gr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=Gr.getStream(r);if(!n)throw new Gr.ErrnoError(8);Gr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new Gr.ErrnoError(28);var t;if("string"==typeof r){var n=Gr.lookupPath(r,{follow:!0});t=n.node}else t=r;if(!t.node_ops.setattr)throw new Gr.ErrnoError(63);if(Gr.isDir(t.mode))throw new Gr.ErrnoError(31);if(!Gr.isFile(t.mode))throw new Gr.ErrnoError(28);var o=Gr.nodePermissions(t,"w");if(o)throw new Gr.ErrnoError(o);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=Gr.getStream(r);if(!t)throw new Gr.ErrnoError(8);if(0===(2097155&t.flags))throw new Gr.ErrnoError(28);Gr.truncate(t.node,e)},utime:(r,e,t)=>{var n=Gr.lookupPath(r,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(e,t)})},open:(r,e,t)=>{if(""===r)throw new Gr.ErrnoError(44);var n;if(e="string"==typeof e?Gr.modeStringToFlags(e):e,t="undefined"==typeof t?438:t,t=64&e?4095&t|32768:0,"object"==typeof r)n=r;else{r=Lr.normalize(r);try{var i=Gr.lookupPath(r,{follow:!(131072&e)});n=i.node}catch(c){}}var a=!1;if(64&e)if(n){if(128&e)throw new Gr.ErrnoError(20)}else n=Gr.mknod(r,t,0),a=!0;if(!n)throw new Gr.ErrnoError(44);if(Gr.isChrdev(n.mode)&&(e&=-513),65536&e&&!Gr.isDir(n.mode))throw new Gr.ErrnoError(54);if(!a){var s=Gr.mayOpen(n,e);if(s)throw new Gr.ErrnoError(s)}512&e&&!a&&Gr.truncate(n,0),e&=-131713;var u=Gr.createStream({node:n,path:Gr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!o["logReadFiles"]||1&e||(Gr.readFiles||(Gr.readFiles={}),r in Gr.readFiles||(Gr.readFiles[r]=1)),u},close:r=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{Gr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Gr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Gr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new Gr.ErrnoError(28);if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(1===(2097155&r.flags))throw new Gr.ErrnoError(8);if(Gr.isDir(r.node.mode))throw new Gr.ErrnoError(31);if(!r.stream_ops.read)throw new Gr.ErrnoError(28);var i="undefined"!=typeof o;if(i){if(!r.seekable)throw new Gr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new Gr.ErrnoError(28);if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(0===(2097155&r.flags))throw new Gr.ErrnoError(8);if(Gr.isDir(r.node.mode))throw new Gr.ErrnoError(31);if(!r.stream_ops.write)throw new Gr.ErrnoError(28);r.seekable&&1024&r.flags&&Gr.llseek(r,0,2);var a="undefined"!=typeof o;if(a){if(!r.seekable)throw new Gr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(Gr.isClosed(r))throw new Gr.ErrnoError(8);if(e<0||t<=0)throw new Gr.ErrnoError(28);if(0===(2097155&r.flags))throw new Gr.ErrnoError(8);if(!Gr.isFile(r.node.mode)&&!Gr.isDir(r.node.mode))throw new Gr.ErrnoError(43);if(!r.stream_ops.allocate)throw new Gr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o)=>{if(0!==(2&n)&&0===(2&o)&&2!==(2097155&r.flags))throw new Gr.ErrnoError(2);if(1===(2097155&r.flags))throw new Gr.ErrnoError(2);if(!r.stream_ops.mmap)throw new Gr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new Gr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var t,n=Gr.open(r,e.flags),o=Gr.stat(r),i=o.size,a=new Uint8Array(i);return Gr.read(n,a,0,i,0),"utf8"===e.encoding?t=Y(a,0):"binary"===e.encoding&&(t=a),Gr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=Gr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(K(e)+1),i=q(e,o,0,o.length);Gr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Gr.write(n,e,0,e.byteLength,void 0,t.canOwn)}Gr.close(n)},cwd:()=>Gr.currentPath,chdir:r=>{var e=Gr.lookupPath(r,{follow:!0});if(null===e.node)throw new Gr.ErrnoError(44);if(!Gr.isDir(e.node.mode))throw new Gr.ErrnoError(54);var t=Gr.nodePermissions(e.node,"x");if(t)throw new Gr.ErrnoError(t);Gr.currentPath=e.path},createDefaultDirectories:()=>{Gr.mkdir("/tmp"),Gr.mkdir("/home"),Gr.mkdir("/home/web_user")},createDefaultDevices:()=>{Gr.mkdir("/dev"),Gr.registerDevice(Gr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),Gr.mkdev("/dev/null",Gr.makedev(1,3)),zr.register(Gr.makedev(5,0),zr.default_tty_ops),zr.register(Gr.makedev(6,0),zr.default_tty1_ops),Gr.mkdev("/dev/tty",Gr.makedev(5,0)),Gr.mkdev("/dev/tty1",Gr.makedev(6,0));var r=Br();Gr.createDevice("/dev","random",r),Gr.createDevice("/dev","urandom",r),Gr.mkdir("/dev/shm"),Gr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Gr.mkdir("/proc");var r=Gr.mkdir("/proc/self");Gr.mkdir("/proc/self/fd"),Gr.mount({mount:()=>{var e=Gr.createNode(r,"fd",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=Gr.getStream(t);if(!n)throw new Gr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{o["stdin"]?Gr.createDevice("/dev","stdin",o["stdin"]):Gr.symlink("/dev/tty","/dev/stdin"),o["stdout"]?Gr.createDevice("/dev","stdout",null,o["stdout"]):Gr.symlink("/dev/tty","/dev/stdout"),o["stderr"]?Gr.createDevice("/dev","stderr",null,o["stderr"]):Gr.symlink("/dev/tty1","/dev/stderr");Gr.open("/dev/stdin",0),Gr.open("/dev/stdout",1),Gr.open("/dev/stderr",1)},ensureErrnoError:()=>{Gr.ErrnoError||(Gr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Gr.ErrnoError.prototype=new Error,Gr.ErrnoError.prototype.constructor=Gr.ErrnoError,[44].forEach((r=>{Gr.genericErrors[r]=new Gr.ErrnoError(r),Gr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{Gr.ensureErrnoError(),Gr.nameTable=new Array(4096),Gr.mount(Ur,{},"/"),Gr.createDefaultDirectories(),Gr.createDefaultDevices(),Gr.createSpecialDirectories(),Gr.filesystems={MEMFS:Ur,NODEFS:Yr}},init:(r,e,t)=>{Gr.init.initialized=!0,Gr.ensureErrnoError(),o["stdin"]=r||o["stdin"],o["stdout"]=e||o["stdout"],o["stderr"]=t||o["stderr"],Gr.createStandardStreams()},quit:()=>{Gr.init.initialized=!1;for(var r=0;r<Gr.streams.length;r++){var e=Gr.streams[r];e&&Gr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=Gr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{var t=Gr.lookupPath(r,{follow:!e});r=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{t=Gr.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Lr.basename(r),t=Gr.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(o){n.error=o.errno}return n},createPath:(r,e,t,n)=>{r="string"==typeof r?r:Gr.getPath(r);var o=e.split("/").reverse();while(o.length){var i=o.pop();if(i){var a=Lr.join2(r,i);try{Gr.mkdir(a)}catch(s){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=Lr.join2("string"==typeof r?r:Gr.getPath(r),e),a=Gr.getMode(n,o);return Gr.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r="string"==typeof r?r:Gr.getPath(r),a=e?Lr.join2(r,e):r);var s=Gr.getMode(n,o),u=Gr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}Gr.chmod(u,146|s);var d=Gr.open(u,577);Gr.write(d,t,0,t.length,0,i),Gr.close(d),Gr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=Lr.join2("string"==typeof r?r:Gr.getPath(r),e),i=Gr.getMode(!!t,!!n);Gr.createDevice.major||(Gr.createDevice.major=64);var a=Gr.makedev(Gr.createDevice.major++,0);return Gr.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(c){throw new Gr.ErrnoError(29)}if(void 0===u&&0===a)throw new Gr.ErrnoError(6);if(null===u||void 0===u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(s){throw new Gr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Gr.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=xe(s(r.url),!0),r.usedBytes=r.contents.length}catch(e){throw new Gr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=(r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):xe(o.responseText||"",!0)},u=this;u.setDataGetter((r=>{var e=r*a,t=(r+1)*a-1;if(t=Math.min(t,n-1),"undefined"==typeof u.chunks[r]&&(u.chunks[r]=s(e,t)),"undefined"==typeof u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:t};var u=Gr.createFile(r,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={},f=Object.keys(u.stream_ops);function l(r,e,t,n,o){var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[t+s]=i[o+s];else for(s=0;s<a;s++)e[t+s]=i.get(o+s);return a}return f.forEach((r=>{var e=u.stream_ops[r];c[r]=function(){return Gr.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(r,e,t,n,o)=>(Gr.forceLoadFile(u),l(r,e,t,n,o)),c.mmap=(r,e,t,n,o)=>{Gr.forceLoadFile(u);var i=jr(e);if(!i)throw new Gr.ErrnoError(48);return l(r,x,i,e,t),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(r,e,t,n,o,i,a,s,u,c)=>{var f=e?xr.resolve(Lr.join2(r,e)):r,l=wr("cp "+f);function d(t){function d(t){c&&c(),s||Gr.createDataFile(r,e,t,n,o,u),i&&i(),vr(l)}Browser.handledByPreloadPlugin(t,f,d,(()=>{a&&a(),vr(l)}))||d(t)}Er(l),"string"==typeof t?Hr(t,(r=>d(r)),a):d(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Gr.indexedDB();try{var o=n.open(Gr.DB_NAME(),Gr.DB_VERSION)}catch(i){return t(i)}o.onupgradeneeded=()=>{S("creating db");var r=o.result;r.createObjectStore(Gr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result,i=n.transaction([Gr.DB_STORE_NAME],"readwrite"),a=i.objectStore(Gr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach((r=>{var e=a.put(Gr.analyzePath(r).object.contents,r);e.onsuccess=()=>{s++,s+u==c&&f()},e.onerror=()=>{u++,s+u==c&&f()}})),i.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Gr.indexedDB();try{var o=n.open(Gr.DB_NAME(),Gr.DB_VERSION)}catch(i){return t(i)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([Gr.DB_STORE_NAME],"readonly")}catch(i){return void t(i)}var s=a.objectStore(Gr.DB_STORE_NAME),u=0,c=0,f=r.length;function l(){0==c?e():t()}r.forEach((r=>{var e=s.get(r);e.onsuccess=()=>{Gr.analyzePath(r).exists&&Gr.unlink(r),Gr.createDataFile(Lr.dirname(r),Lr.basename(r),e.result,!0,!0,!0),u++,u+c==f&&l()},e.onerror=()=>{c++,u+c==f&&l()}})),a.onerror=t},o.onerror=t}},qr={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if(Lr.isAbs(e))return e;var n;if(-100===r)n=Gr.cwd();else{var o=Gr.getStream(r);if(!o)throw new Gr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Gr.ErrnoError(44);return n}return Lr.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(o){if(o&&o.node&&Lr.normalize(e)!==Lr.normalize(Gr.getPath(o.node)))return-54;throw o}return U[t>>2]=n.dev,U[t+4>>2]=0,U[t+8>>2]=n.ino,U[t+12>>2]=n.mode,U[t+16>>2]=n.nlink,U[t+20>>2]=n.uid,U[t+24>>2]=n.gid,U[t+28>>2]=n.rdev,U[t+32>>2]=0,kr=[n.size>>>0,(_r=n.size,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+40>>2]=kr[0],U[t+44>>2]=kr[1],U[t+48>>2]=4096,U[t+52>>2]=n.blocks,U[t+56>>2]=n.atime.getTime()/1e3|0,U[t+60>>2]=0,U[t+64>>2]=n.mtime.getTime()/1e3|0,U[t+68>>2]=0,U[t+72>>2]=n.ctime.getTime()/1e3|0,U[t+76>>2]=0,kr=[n.ino>>>0,(_r=n.ino,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[t+80>>2]=kr[0],U[t+84>>2]=kr[1],0},doMsync:function(r,e,t,n,o){var i=z.slice(r,r+t);Gr.msync(e,i,o,t,n)},varargs:void 0,get:function(){qr.varargs+=4;var r=U[qr.varargs-4>>2];return r},getStr:function(r){var e=G(r);return e},getStreamFromFD:function(r){var e=Gr.getStream(r);if(!e)throw new Gr.ErrnoError(8);return e}};function Xr(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e),-8&t)return-28;var o=Gr.lookupPath(e,{follow:!0}),i=o.node;if(!i)return-44;var a="";return 4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&Gr.nodePermissions(i,a)?-2:0}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function Kr(r){return U[He()>>2]=r,r}function Vr(r,e,t){qr.varargs=t;try{var n=qr.getStreamFromFD(r);switch(e){case 0:var o,i=qr.get();return i<0?-28:(o=Gr.createStream(n,i),o.fd);case 1:case 2:return 0;case 3:return n.flags;case 4:i=qr.get();return n.flags|=i,0;case 5:i=qr.get();var a=0;return j[i+a>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Kr(28),-1;default:return-28}}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function Jr(r,e){try{if(0===e)return-28;var t=Gr.cwd(),n=K(t)+1;return e<n?-68:(X(t,r,e),n)}catch(o){if("undefined"==typeof Gr||!(o instanceof Gr.ErrnoError))throw o;return-o.errno}}function Qr(r,e,t){qr.varargs=t;try{var n=qr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=qr.get();return U[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=qr.get();return Gr.ioctl(n,e,o);case 21523:return n.tty?0:-59;case 21524:return n.tty?0:-59;default:yr("bad ioctl syscall "+e)}}catch(i){if("undefined"==typeof Gr||!(i instanceof Gr.ErrnoError))throw i;return-i.errno}}function Zr(r,e){try{return r=qr.getStr(r),qr.doStat(Gr.lstat,r,e)}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return-t.errno}}function $r(r,e,t){try{return e=qr.getStr(e),e=qr.calculateAt(r,e),e=Lr.normalize(e),"/"===e[e.length-1]&&(e=e.substr(0,e.length-1)),Gr.mkdir(e,t,0),0}catch(n){if("undefined"==typeof Gr||!(n instanceof Gr.ErrnoError))throw n;return-n.errno}}function re(r,e,t,n){try{e=qr.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=qr.calculateAt(r,e,i),qr.doStat(o?Gr.lstat:Gr.stat,e,t)}catch(a){if("undefined"==typeof Gr||!(a instanceof Gr.ErrnoError))throw a;return-a.errno}}function ee(r,e,t,n){qr.varargs=n;try{e=qr.getStr(e),e=qr.calculateAt(r,e);var o=n?qr.get():0;return Gr.open(e,t,o).fd}catch(i){if("undefined"==typeof Gr||!(i instanceof Gr.ErrnoError))throw i;return-i.errno}}function te(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e),n<=0)return-28;var o=Gr.readlink(e),i=Math.min(n,K(o)),a=x[t+i];return X(o,t,n+1),x[t+i]=a,i}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return-s.errno}}function ne(r,e){try{return r=qr.getStr(r),qr.doStat(Gr.stat,r,e)}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return-t.errno}}function oe(r,e,t){try{return e=qr.getStr(e),e=qr.calculateAt(r,e),0===t?Gr.unlink(e):512===t?Gr.rmdir(e):yr("Invalid flags passed to unlinkat"),0}catch(n){if("undefined"==typeof Gr||!(n instanceof Gr.ErrnoError))throw n;return-n.errno}}function ie(r,e,t,n){try{if(e=qr.getStr(e),e=qr.calculateAt(r,e,!0),t){var o=U[t>>2],i=U[t+4>>2];a=1e3*o+i/1e6,t+=8,o=U[t>>2],i=U[t+4>>2],s=1e3*o+i/1e6}else var a=Date.now(),s=a;return Gr.utime(e,a,s),0}catch(u){if("undefined"==typeof Gr||!(u instanceof Gr.ErrnoError))throw u;return-u.errno}}function ae(){throw 1/0}function se(){yr("")}function ue(r,e,t){z.copyWithin(r,e,e+t)}function ce(){return 2147483648}function fe(r){try{return P.grow(r-B.byteLength+65535>>>16),$(P.buffer),1}catch(e){}}function le(r){var e=z.length;r>>>=0;var t=ce();if(r>t)return!1;let n=(r,e)=>r+(e-r%e)%e;for(var o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,r+100663296);var a=Math.min(t,n(Math.max(r,i),65536)),s=fe(a);if(s)return!0}return!1}var de={};function me(){return p||"./this.program"}function he(){if(!he.strings){var r=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:me()};for(var t in de)void 0===de[t]?delete e[t]:e[t]=de[t];var n=[];for(var t in e)n.push(t+"="+e[t]);he.strings=n}return he.strings}function pe(r,e){var t=0;return he().forEach((function(n,o){var i=e+t;H[r+4*o>>2]=i,Z(n,i),t+=n.length+1})),0}function we(r,e){var t=he();H[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),H[e>>2]=n,0}function Ee(r){ut(r)}function ve(r){try{var e=qr.getStreamFromFD(r);return Gr.close(e),0}catch(t){if("undefined"==typeof Gr||!(t instanceof Gr.ErrnoError))throw t;return t.errno}}function ye(r,e){try{var t=qr.getStreamFromFD(r),n=t.tty?2:Gr.isDir(t.mode)?3:Gr.isLink(t.mode)?7:4;return x[e>>0]=n,0}catch(o){if("undefined"==typeof Gr||!(o instanceof Gr.ErrnoError))throw o;return o.errno}}function ge(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=H[e>>2],s=H[e+4>>2];e+=8;var u=Gr.read(r,x,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}function _e(r,e,t,n){try{var o=qr.getStreamFromFD(r),i=ge(o,e,t);return U[n>>2]=i,0}catch(a){if("undefined"==typeof Gr||!(a instanceof Gr.ErrnoError))throw a;return a.errno}}function ke(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN}function Se(r,e,t,n,o){try{var i=ke(e,t);if(isNaN(i))return 61;var a=qr.getStreamFromFD(r);return Gr.llseek(a,i,n),kr=[a.position>>>0,(_r=a.position,+Math.abs(_r)>=1?_r>0?(0|Math.min(+Math.floor(_r/4294967296),4294967295))>>>0:~~+Math.ceil((_r-+(~~_r>>>0))/4294967296)>>>0:0)],U[o>>2]=kr[0],U[o+4>>2]=kr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(s){if("undefined"==typeof Gr||!(s instanceof Gr.ErrnoError))throw s;return s.errno}}function be(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=H[e>>2],s=H[e+4>>2];e+=8;var u=Gr.write(r,x,a,s,n);if(u<0)return-1;o+=u}return o}function De(r,e,t,n){try{var o=qr.getStreamFromFD(r),i=be(o,e,t);return H[n>>2]=i,0}catch(a){if("undefined"==typeof Gr||!(a instanceof Gr.ErrnoError))throw a;return a.errno}}function Ne(){return O()}function Fe(r){F(r)}function Oe(r){return r%4===0&&(r%100!==0||r%400===0)}function Pe(r,e){for(var t=0,n=0;n<=e;t+=r[n++]);return t}var Ae=[31,29,31,30,31,30,31,31,30,31,30,31],Me=[31,28,31,30,31,30,31,31,30,31,30,31];function Re(r,e){var t=new Date(r.getTime());while(e>0){var n=Oe(t.getFullYear()),o=t.getMonth(),i=(n?Ae:Me)[o];if(!(e>i-t.getDate()))return t.setDate(t.getDate()+e),t;e-=i-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}function Te(r,e,t,n){var o=U[n+40>>2],i={tm_sec:U[n>>2],tm_min:U[n+4>>2],tm_hour:U[n+8>>2],tm_mday:U[n+12>>2],tm_mon:U[n+16>>2],tm_year:U[n+20>>2],tm_wday:U[n+24>>2],tm_yday:U[n+28>>2],tm_isdst:U[n+32>>2],tm_gmtoff:U[n+36>>2],tm_zone:o?G(o):""},a=G(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,e,t){var n="number"==typeof r?r.toString():r||"";while(n.length<e)n=t[0]+n;return n}function d(r,e){return l(r,e,"0")}function m(r,e){function t(r){return r<0?-1:r>0?1:0}var n;return 0===(n=t(r.getFullYear()-e.getFullYear()))&&0===(n=t(r.getMonth()-e.getMonth()))&&(n=t(r.getDate()-e.getDate())),n}function h(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function p(r){var e=Re(new Date(r.tm_year+1900,0,1),r.tm_yday),t=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=h(t),i=h(n);return m(o,e)<=0?m(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var w={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){var e=r.tm_year+1900;return d(e/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return l(r.tm_mday,2," ")},"%g":function(r){return p(r).toString().substring(2)},"%G":function(r){return p(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var e=r.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(r){return d(r.tm_mday+Pe(Oe(r.tm_year+1900)?Ae:Me,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var e=r.tm_yday+7-r.tm_wday;return d(Math.floor(e/7),2)},"%V":function(r){var e=Math.floor((r.tm_yday+7-(r.tm_wday+6)%7)/7);if((r.tm_wday+371-r.tm_yday-2)%7<=2&&e++,e){if(53==e){var t=(r.tm_wday+371-r.tm_yday)%7;4==t||3==t&&Oe(r.tm_year)||(e=1)}}else{e=52;var n=(r.tm_wday+7-r.tm_yday-1)%7;(4==n||5==n&&Oe(r.tm_year%400-1))&&e++}return d(e,2)},"%w":function(r){return r.tm_wday},"%W":function(r){var e=r.tm_yday+7-(r.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var e=r.tm_gmtoff,t=e>=0;return e=Math.abs(e)/60,e=e/60*100+e%60,(t?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),w)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),w[u](i)));a=a.replace(/\0\0/g,"%");var E=xe(a,!1);return E.length>e?0:(Q(E,r),E.length-1)}function Ce(r,e,t,n){return Te(r,e,t,n)}var Ie=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Gr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},Le=365,Be=146;function xe(r,e,t){var n=t>0?t:K(r)+1,o=new Array(n),i=q(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(Ie.prototype,{read:{get:function(){return(this.mode&Le)===Le},set:function(r){r?this.mode|=Le:this.mode&=~Le}},write:{get:function(){return(this.mode&Be)===Be},set:function(r){r?this.mode|=Be:this.mode&=~Be}},isFolder:{get:function(){return Gr.isDir(this.mode)}},isDevice:{get:function(){return Gr.isChrdev(this.mode)}}}),Gr.FSNode=Ie,Gr.staticInit(),o["FS_createPath"]=Gr.createPath,o["FS_createDataFile"]=Gr.createDataFile,o["FS_createPreloadedFile"]=Gr.createPreloadedFile,o["FS_unlink"]=Gr.unlink,o["FS_createLazyFile"]=Gr.createLazyFile,o["FS_createDevice"]=Gr.createDevice,y&&(d(),Yr.staticInit()),Wr={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var ze,je={d:Tr,g:Ir,y:Xr,q:Vr,M:Jr,v:Qr,H:Zr,F:$r,G:re,w:ee,E:te,I:ne,D:oe,C:ie,A:ae,n:se,N:ue,p:le,K:pe,L:we,s:Ee,r:ve,J:ye,u:_e,x:Se,t:De,a:Ne,m:tt,h:Ke,e:Qe,f:Je,j:Ze,k:et,o:ot,z:Ve,c:$e,i:rt,l:nt,b:Fe,B:Ce},Ue=(Or(),o["___wasm_call_ctors"]=function(){return(o["___wasm_call_ctors"]=o["asm"]["P"]).apply(null,arguments)},o["_main"]=function(){return(o["_main"]=o["asm"]["Q"]).apply(null,arguments)},o["_malloc"]=function(){return(Ue=o["_malloc"]=o["asm"]["R"]).apply(null,arguments)}),He=o["___errno_location"]=function(){return(He=o["___errno_location"]=o["asm"]["S"]).apply(null,arguments)},We=(o["_itk_wasm_input_array_alloc"]=function(){return(o["_itk_wasm_input_array_alloc"]=o["asm"]["T"]).apply(null,arguments)},o["_itk_wasm_input_json_alloc"]=function(){return(o["_itk_wasm_input_json_alloc"]=o["asm"]["U"]).apply(null,arguments)},o["_itk_wasm_output_json_address"]=function(){return(o["_itk_wasm_output_json_address"]=o["asm"]["V"]).apply(null,arguments)},o["_itk_wasm_output_json_size"]=function(){return(o["_itk_wasm_output_json_size"]=o["asm"]["W"]).apply(null,arguments)},o["_itk_wasm_output_array_address"]=function(){return(o["_itk_wasm_output_array_address"]=o["asm"]["X"]).apply(null,arguments)},o["_itk_wasm_output_array_size"]=function(){return(o["_itk_wasm_output_array_size"]=o["asm"]["Y"]).apply(null,arguments)},o["_itk_wasm_free_all"]=function(){return(o["_itk_wasm_free_all"]=o["asm"]["Z"]).apply(null,arguments)},o["_setThrew"]=function(){return(We=o["_setThrew"]=o["asm"]["$"]).apply(null,arguments)}),Ye=o["stackSave"]=function(){return(Ye=o["stackSave"]=o["asm"]["aa"]).apply(null,arguments)},Ge=o["stackRestore"]=function(){return(Ge=o["stackRestore"]=o["asm"]["ba"]).apply(null,arguments)},qe=o["stackAlloc"]=function(){return(qe=o["stackAlloc"]=o["asm"]["ca"]).apply(null,arguments)},Xe=o["___cxa_is_pointer_type"]=function(){return(Xe=o["___cxa_is_pointer_type"]=o["asm"]["da"]).apply(null,arguments)};function Ke(r,e){var t=Ye();try{return Mr(r)(e)}catch(n){if(Ge(t),n!==n+0)throw n;We(1,0)}}function Ve(r){var e=Ye();try{Mr(r)()}catch(t){if(Ge(e),t!==t+0)throw t;We(1,0)}}function Je(r,e,t,n){var o=Ye();try{return Mr(r)(e,t,n)}catch(i){if(Ge(o),i!==i+0)throw i;We(1,0)}}function Qe(r,e,t){var n=Ye();try{return Mr(r)(e,t)}catch(o){if(Ge(n),o!==o+0)throw o;We(1,0)}}function Ze(r,e,t,n,o){var i=Ye();try{return Mr(r)(e,t,n,o)}catch(a){if(Ge(i),a!==a+0)throw a;We(1,0)}}function $e(r,e){var t=Ye();try{Mr(r)(e)}catch(n){if(Ge(t),n!==n+0)throw n;We(1,0)}}function rt(r,e,t){var n=Ye();try{Mr(r)(e,t)}catch(o){if(Ge(n),o!==o+0)throw o;We(1,0)}}function et(r,e,t,n,o,i){var a=Ye();try{return Mr(r)(e,t,n,o,i)}catch(s){if(Ge(a),s!==s+0)throw s;We(1,0)}}function tt(r){var e=Ye();try{return Mr(r)()}catch(t){if(Ge(e),t!==t+0)throw t;We(1,0)}}function nt(r,e,t,n,o){var i=Ye();try{Mr(r)(e,t,n,o)}catch(a){if(Ge(i),a!==a+0)throw a;We(1,0)}}function ot(r,e,t,n,o,i,a){var s=Ye();try{return Mr(r)(e,t,n,o,i,a)}catch(u){if(Ge(s),u!==u+0)throw u;We(1,0)}}function it(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}o["ccall"]=I,o["cwrap"]=L,o["addRunDependency"]=Er,o["removeRunDependency"]=vr,o["FS_createPath"]=Gr.createPath,o["FS_createDataFile"]=Gr.createDataFile,o["FS_createPreloadedFile"]=Gr.createPreloadedFile,o["FS_createLazyFile"]=Gr.createLazyFile,o["FS_createDevice"]=Gr.createDevice,o["FS_unlink"]=Gr.unlink,o["callMain"]=at,o["AsciiToString"]=V,o["writeArrayToMemory"]=Q,o["writeAsciiToMemory"]=Z;function at(r){var e=o["_main"];r=r||[],r.unshift(p);var t=r.length,n=qe(4*(t+1)),i=n>>2;r.forEach((r=>{U[i++]=J(r)})),U[i]=0;try{var a=e(t,n);return ut(a,!0),a}catch(s){return Rr(s)}finally{!0}}function st(r){function e(){ze||(ze=!0,o["calledRun"]=!0,R||(sr(),ur(),t(o),o["onRuntimeInitialized"]&&o["onRuntimeInitialized"](),ft&&at(r),cr()))}r=r||h,mr>0||(ar(),mr>0||(o["setStatus"]?(o["setStatus"]("Running..."),setTimeout((function(){setTimeout((function(){o["setStatus"]("")}),1),e()}),1)):e()))}function ut(r,e){M=r,ct(r)}function ct(r){M=r,ir()||(o["onExit"]&&o["onExit"](r),R=!0),w(r,new it(r))}if(pr=function r(){ze||st(),ze||(pr=r)},o["run"]=st,o["preInit"]){"function"==typeof o["preInit"]&&(o["preInit"]=[o["preInit"]]);while(o["preInit"].length>0)o["preInit"].pop()()}var ft=!1;return o["noInitialRun"]&&(ft=!1),st(),o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!Gr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),i=1;i<o.length;i++)n+=o[i],Gr.analyzePath(n).exists||Gr.mkdir(n),n+="/";return Gr.mount(Yr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);Gr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],Gr.analyzePath(e).exists||Gr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return Gr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return Gr.writeFile(r,e,t)},o.fs_unlink=function(r){return Gr.unlink(r)},o.fs_open=function(r,e,t){return Gr.open(r,e,t)},o.fs_stat=function(r){return Gr.stat(r)},o.fs_read=function(r,e,t,n,o){return Gr.read(r,e,t,n,o)},o.fs_close=function(r){return Gr.close(r)},o.mountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);if(!Gr.isDir(t)&&"/"!==t){for(var n="/",o=t.split(e.sep),i=1;i<o.length;i++)n+=o[i],Gr.analyzePath(n).exists||Gr.mkdir(n),n+="/";return Gr.mount(Yr,{root:t},n),n+e.basename(r)}}},o.unmountContainingDir=function(r){if(y){var e=require("path"),t=e.dirname(r);Gr.unmount(t)}},o.fs_mkdirs=function(r){for(var e="/",t=r.split("/"),n=1;n<t.length;++n)e+=t[n],Gr.analyzePath(e).exists||Gr.mkdir(e),e+="/"},o.fs_readFile=function(r,e){return Gr.readFile(r,e)},o.fs_writeFile=function(r,e,t){return Gr.writeFile(r,e,t)},o.fs_unlink=function(r){return Gr.unlink(r)},o.fs_open=function(r,e,t){return Gr.open(r,e,t)},o.fs_stat=function(r){return Gr.stat(r)},o.fs_read=function(r,e,t,n,o){return Gr.read(r,e,t,n,o)},o.fs_close=function(r){return Gr.close(r)},e.ready}})();"object"===typeof exports&&"object"===typeof module?module.exports=JPEGImageIOWriteImage:"function"===typeof define&&define["amd"]?define([],(function(){return JPEGImageIOWriteImage})):"object"===typeof exports&&(exports["JPEGImageIOWriteImage"]=JPEGImageIOWriteImage);