@vertigis/workflow 5.46.1 → 5.47.0

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 (447) hide show
  1. package/Activator.js +1 -1
  2. package/Collections.js +1 -1
  3. package/EnumUtils.js +1 -1
  4. package/Errors.js +1 -1
  5. package/Hooks.js +1 -1
  6. package/IActivityHandler.js +1 -0
  7. package/LanguageStringUtils.js +1 -1
  8. package/ProgramInspectorFacility.js +1 -1
  9. package/Task.js +1 -1
  10. package/TemplateUtils.js +1 -1
  11. package/Validation.js +1 -1
  12. package/activities/app/GetApplicationData.js +1 -1
  13. package/activities/app/GetApplicationInfo.js +1 -1
  14. package/activities/app/GetUserInfo.js +1 -1
  15. package/activities/app/PublishEvent.js +1 -1
  16. package/activities/app/RemoveApplicationData.d.ts +2 -1
  17. package/activities/app/RemoveApplicationData.js +1 -1
  18. package/activities/app/RunCommand.js +1 -1
  19. package/activities/app/RunOperation.js +1 -1
  20. package/activities/app/SetApplicationData.js +1 -1
  21. package/activities/app/applicationData.js +1 -1
  22. package/activities/arcgis/AddAttachment.js +1 -1
  23. package/activities/arcgis/AddFeatureLayer.js +1 -1
  24. package/activities/arcgis/AddFeatures.js +1 -1
  25. package/activities/arcgis/AddGraphics.js +1 -1
  26. package/activities/arcgis/ArcadeScript.js +1 -1
  27. package/activities/arcgis/AreaEngineTask.js +1 -1
  28. package/activities/arcgis/BufferEngineTask.d.ts +2 -2
  29. package/activities/arcgis/BufferEngineTask.js +1 -1
  30. package/activities/arcgis/BufferServiceTask.js +1 -1
  31. package/activities/arcgis/CastGeometry.d.ts +1 -1
  32. package/activities/arcgis/CastGeometry.js +1 -1
  33. package/activities/arcgis/ClearGraphics.js +1 -1
  34. package/activities/arcgis/ClipEngineTask.d.ts +4 -4
  35. package/activities/arcgis/ClipEngineTask.js +1 -1
  36. package/activities/arcgis/ClosestFacilityTask.js +1 -1
  37. package/activities/arcgis/CompareGeometries.d.ts +3 -3
  38. package/activities/arcgis/CompareGeometries.js +1 -1
  39. package/activities/arcgis/ConvertValueToArcGisFieldType.js +1 -1
  40. package/activities/arcgis/CreateFeatureSet.js +1 -1
  41. package/activities/arcgis/CreateGraphic.d.ts +1 -1
  42. package/activities/arcgis/CreateGraphic.js +1 -1
  43. package/activities/arcgis/CreatePoint.js +1 -1
  44. package/activities/arcgis/CutEngineTask.d.ts +2 -2
  45. package/activities/arcgis/CutEngineTask.js +1 -1
  46. package/activities/arcgis/DeleteAttachments.js +1 -1
  47. package/activities/arcgis/DeleteFeatures.js +1 -1
  48. package/activities/arcgis/DensifyEngineTask.d.ts +3 -3
  49. package/activities/arcgis/DensifyEngineTask.js +1 -1
  50. package/activities/arcgis/DifferenceEngineTask.d.ts +5 -5
  51. package/activities/arcgis/DifferenceEngineTask.js +1 -1
  52. package/activities/arcgis/DistanceEngineTask.d.ts +4 -4
  53. package/activities/arcgis/DistanceEngineTask.js +1 -1
  54. package/activities/arcgis/DistanceServiceTask.js +1 -1
  55. package/activities/arcgis/ExtendedSpatialReferenceInfoEngineTask.js +1 -1
  56. package/activities/arcgis/FeatureSetFromJson.js +1 -1
  57. package/activities/arcgis/FlipEngineTask.d.ts +3 -3
  58. package/activities/arcgis/FlipEngineTask.js +1 -1
  59. package/activities/arcgis/FromGeoCoordinateStringServiceTask.js +1 -1
  60. package/activities/arcgis/GeneralizeEngineTask.d.ts +4 -4
  61. package/activities/arcgis/GeneralizeEngineTask.js +1 -1
  62. package/activities/arcgis/GenerateArcGisToken.js +1 -1
  63. package/activities/arcgis/GenerateWebmapForReport.js +1 -1
  64. package/activities/arcgis/Geocode.js +1 -1
  65. package/activities/arcgis/GeometryFromJson.js +1 -1
  66. package/activities/arcgis/Geoprocessing.js +1 -1
  67. package/activities/arcgis/GeoprocessingAsync.js +1 -1
  68. package/activities/arcgis/GetAttributeValue.js +1 -1
  69. package/activities/arcgis/GetAttributeValues.js +1 -1
  70. package/activities/arcgis/GetCentroid.js +1 -1
  71. package/activities/arcgis/GetCodedValueDomain.js +1 -1
  72. package/activities/arcgis/GetCurrentPosition.js +1 -1
  73. package/activities/arcgis/GetFeatureGeometries.d.ts +2 -2
  74. package/activities/arcgis/GetFeatureGeometries.js +1 -1
  75. package/activities/arcgis/GetFeatureGeometry.d.ts +1 -1
  76. package/activities/arcgis/GetFeatureGeometry.js +1 -1
  77. package/activities/arcgis/GetFeatureLayerInfo.js +1 -1
  78. package/activities/arcgis/GetFeatureSetExtent.js +1 -1
  79. package/activities/arcgis/GetFeatureSetObjectIds.js +1 -1
  80. package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
  81. package/activities/arcgis/GetGeometryExtent.js +1 -1
  82. package/activities/arcgis/GetGraphics.js +1 -1
  83. package/activities/arcgis/GetLayer.js +1 -1
  84. package/activities/arcgis/GetLayerDefinitionExpression.js +1 -1
  85. package/activities/arcgis/GetLayerProperty.js +1 -1
  86. package/activities/arcgis/GetLayerVisibility.js +1 -1
  87. package/activities/arcgis/GetMapScreenshot.js +1 -1
  88. package/activities/arcgis/GetPortalUser.js +1 -1
  89. package/activities/arcgis/GetTable.js +1 -1
  90. package/activities/arcgis/IntersectEngineTask.d.ts +5 -5
  91. package/activities/arcgis/IntersectEngineTask.js +1 -1
  92. package/activities/arcgis/LabelPointsServiceTask.js +1 -1
  93. package/activities/arcgis/LengthEngineTask.d.ts +2 -2
  94. package/activities/arcgis/LengthEngineTask.js +1 -1
  95. package/activities/arcgis/MapProvider.d.ts +10 -10
  96. package/activities/arcgis/MapProvider.js +1 -1
  97. package/activities/arcgis/NearestCoordinateEngineTask.d.ts +2 -2
  98. package/activities/arcgis/NearestCoordinateEngineTask.js +1 -1
  99. package/activities/arcgis/NearestVertexEngineTask.d.ts +2 -2
  100. package/activities/arcgis/NearestVertexEngineTask.js +1 -1
  101. package/activities/arcgis/NearestVerticesEngineTask.d.ts +2 -2
  102. package/activities/arcgis/NearestVerticesEngineTask.js +1 -1
  103. package/activities/arcgis/OffsetEngineTask.d.ts +4 -4
  104. package/activities/arcgis/OffsetEngineTask.js +1 -1
  105. package/activities/arcgis/ProjectServiceTask.d.ts +3 -3
  106. package/activities/arcgis/ProjectServiceTask.js +1 -1
  107. package/activities/arcgis/QueryAttachmentInfos.js +1 -1
  108. package/activities/arcgis/QueryTask.d.ts +1 -1
  109. package/activities/arcgis/QueryTask.js +1 -1
  110. package/activities/arcgis/RefreshLayer.js +1 -1
  111. package/activities/arcgis/RegisterCorsUrl.js +1 -1
  112. package/activities/arcgis/RelateEngineTask.d.ts +2 -2
  113. package/activities/arcgis/RelateEngineTask.js +1 -1
  114. package/activities/arcgis/RelationServiceTask.d.ts +2 -2
  115. package/activities/arcgis/RelationServiceTask.js +1 -1
  116. package/activities/arcgis/RelationshipQueryTask.js +1 -1
  117. package/activities/arcgis/RemoveFeatureSetFields.js +1 -1
  118. package/activities/arcgis/RemoveGraphics.js +1 -1
  119. package/activities/arcgis/RemoveLayer.js +1 -1
  120. package/activities/arcgis/RendererFromJson.js +1 -1
  121. package/activities/arcgis/ResetAllLayerDefinitionExpressions.js +1 -1
  122. package/activities/arcgis/ResetLayerDefinitionExpression.js +1 -1
  123. package/activities/arcgis/ReshapeServiceTask.d.ts +1 -1
  124. package/activities/arcgis/ReshapeServiceTask.js +1 -1
  125. package/activities/arcgis/ReverseGeocode.js +1 -1
  126. package/activities/arcgis/RotateEngineTask.d.ts +2 -2
  127. package/activities/arcgis/RotateEngineTask.js +1 -1
  128. package/activities/arcgis/RouteTask.js +1 -1
  129. package/activities/arcgis/RunPrint.js +1 -1
  130. package/activities/arcgis/RunReport.d.ts +8 -2
  131. package/activities/arcgis/RunReport.js +1 -1
  132. package/activities/arcgis/RunWorkflow.js +1 -1
  133. package/activities/arcgis/SendLayerToAttributeTable.js +1 -1
  134. package/activities/arcgis/ServiceAreaTask.js +1 -1
  135. package/activities/arcgis/SetFeatureAttribute.js +1 -1
  136. package/activities/arcgis/SetFeatureGeometry.d.ts +1 -1
  137. package/activities/arcgis/SetFeatureGeometry.js +1 -1
  138. package/activities/arcgis/SetFeaturePopup.js +1 -1
  139. package/activities/arcgis/SetFeatureSymbol.d.ts +1 -1
  140. package/activities/arcgis/SetFeatureSymbol.js +1 -1
  141. package/activities/arcgis/SetImageryLayerOptions.js +1 -1
  142. package/activities/arcgis/SetLayerDefinitionExpression.js +1 -1
  143. package/activities/arcgis/SetLayerPopup.js +1 -1
  144. package/activities/arcgis/SetLayerProperty.js +1 -1
  145. package/activities/arcgis/SetLayerVisibility.js +1 -1
  146. package/activities/arcgis/SetMap.js +1 -1
  147. package/activities/arcgis/SetViewExtent.js +1 -1
  148. package/activities/arcgis/SetViewpoint.js +1 -1
  149. package/activities/arcgis/ShowFeaturePopup.js +1 -1
  150. package/activities/arcgis/ShowResults.js +1 -1
  151. package/activities/arcgis/SimplifyEngineTask.d.ts +3 -3
  152. package/activities/arcgis/SimplifyEngineTask.js +1 -1
  153. package/activities/arcgis/SortFeatureSet.js +1 -1
  154. package/activities/arcgis/SymbolFromJson.js +1 -1
  155. package/activities/arcgis/ToGeoCoordinateStringServiceTask.js +1 -1
  156. package/activities/arcgis/TypeChecking.js +1 -1
  157. package/activities/arcgis/UnionEngineTask.d.ts +4 -4
  158. package/activities/arcgis/UnionEngineTask.js +1 -1
  159. package/activities/arcgis/UnionServiceTask.d.ts +3 -3
  160. package/activities/arcgis/UnionServiceTask.js +1 -1
  161. package/activities/arcgis/UpdateAttachment.js +1 -1
  162. package/activities/arcgis/UpdateFeatures.js +1 -1
  163. package/activities/arcgis/libs/arcGisRestApi.js +1 -0
  164. package/activities/arcgis/printing.d.ts +13 -12
  165. package/activities/arcgis/printing.js +1 -1
  166. package/activities/arcgis/printingFields.d.ts +2 -63
  167. package/activities/arcgis/printingFields.js +1 -1
  168. package/activities/arcgis/runUtils.d.ts +0 -18
  169. package/activities/arcgis/runUtils.js +1 -1
  170. package/activities/arcgis/shared.d.ts +1 -0
  171. package/activities/arcgis/shared.js +1 -1
  172. package/activities/arcgis/tools.d.ts +2 -22
  173. package/activities/arcgis/tools.js +1 -1
  174. package/activities/browser/GetBrowserInfo.js +1 -1
  175. package/activities/browser/InjectCss.js +1 -1
  176. package/activities/constants.js +1 -1
  177. package/activities/core/AddItem.js +1 -1
  178. package/activities/core/AddItems.js +1 -1
  179. package/activities/core/Annotation.js +1 -1
  180. package/activities/core/CalculateDate.js +1 -1
  181. package/activities/core/Cast.js +1 -1
  182. package/activities/core/ChannelProvider.d.ts +3 -2
  183. package/activities/core/ChannelProvider.js +1 -1
  184. package/activities/core/ClearItems.js +1 -1
  185. package/activities/core/Container.js +1 -1
  186. package/activities/core/ConvertBytesToText.js +1 -1
  187. package/activities/core/ConvertDataTableToFeatureSet.js +1 -1
  188. package/activities/core/ConvertTextToBytes.js +1 -1
  189. package/activities/core/ConvertToJson.js +1 -1
  190. package/activities/core/CreateFile.js +1 -1
  191. package/activities/core/CreateValue.js +1 -1
  192. package/activities/core/DecodeUriComponent.js +1 -1
  193. package/activities/core/Delay.js +1 -1
  194. package/activities/core/EncodeUriComponent.js +1 -1
  195. package/activities/core/Evaluate.js +1 -1
  196. package/activities/core/EvaluateAsync.js +1 -1
  197. package/activities/core/ExecuteFunction.js +1 -1
  198. package/activities/core/Exit.js +1 -1
  199. package/activities/core/ForEach.js +1 -1
  200. package/activities/core/FormatDate.js +1 -1
  201. package/activities/core/Function.js +1 -1
  202. package/activities/core/GetBase64StringFromBytes.js +1 -1
  203. package/activities/core/GetBase64StringFromFile.js +1 -1
  204. package/activities/core/GetBytesFromBase64String.js +1 -1
  205. package/activities/core/GetFirstItem.js +1 -1
  206. package/activities/core/GetItemAtIndex.js +1 -1
  207. package/activities/core/GetLastItem.js +1 -1
  208. package/activities/core/GetLogLevel.js +1 -1
  209. package/activities/core/GetTextFromFile.js +1 -1
  210. package/activities/core/GetWorkflowInputs.js +1 -1
  211. package/activities/core/If.js +1 -1
  212. package/activities/core/Log.js +1 -1
  213. package/activities/core/Loop.js +1 -1
  214. package/activities/core/ParseJson.js +1 -1
  215. package/activities/core/ParseNumber.js +1 -1
  216. package/activities/core/ParseUrl.js +1 -1
  217. package/activities/core/Placeholder.js +1 -1
  218. package/activities/core/RegexMatches.js +1 -1
  219. package/activities/core/RegexReplace.js +1 -1
  220. package/activities/core/RemoveItem.js +1 -1
  221. package/activities/core/RunActivity.js +1 -1
  222. package/activities/core/SetLogLevel.js +1 -1
  223. package/activities/core/SetProperty.js +1 -1
  224. package/activities/core/SetWorkflowOutput.js +1 -1
  225. package/activities/core/Switch.js +1 -1
  226. package/activities/core/TextReplace.js +1 -1
  227. package/activities/core/Throw.js +1 -1
  228. package/activities/core/TryCatch.js +1 -1
  229. package/activities/core/WebRequest.js +1 -1
  230. package/activities/core/converters.js +1 -1
  231. package/activities/csv/ConvertCsvToDataTable.js +1 -1
  232. package/activities/csv/ConvertDataTableToCsv.js +1 -1
  233. package/activities/csv/ParseCsv.js +1 -1
  234. package/activities/essentials/GetEssentialsSite.d.ts +15 -14
  235. package/activities/essentials/GetEssentialsSite.js +1 -1
  236. package/activities/essentials/RunEssentialsWorkflow.js +1 -1
  237. package/activities/essentials/RunEssentialsWorkflowActivity.js +1 -1
  238. package/activities/forms/ActivateFormElement.js +1 -1
  239. package/activities/forms/AddFormElement.js +1 -1
  240. package/activities/forms/ClearFormElementError.js +1 -1
  241. package/activities/forms/CompleteForm.js +1 -1
  242. package/activities/forms/DisplayForm.js +1 -1
  243. package/activities/forms/Errors.js +1 -1
  244. package/activities/forms/FilterFormElementItems.js +1 -1
  245. package/activities/forms/FormActor.d.ts +1 -2
  246. package/activities/forms/FormActor.js +1 -1
  247. package/activities/forms/FormElementMap.js +1 -1
  248. package/activities/forms/FormRenderer.js +1 -1
  249. package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
  250. package/activities/forms/GetFormElementProperty.js +1 -1
  251. package/activities/forms/GetFormElementValue.js +1 -1
  252. package/activities/forms/GetFormEventData.js +1 -1
  253. package/activities/forms/HideFormElement.js +1 -1
  254. package/activities/forms/PropagateFormEvent.js +1 -1
  255. package/activities/forms/SetCurrentFormElementItem.js +1 -1
  256. package/activities/forms/SetFormElementError.js +1 -1
  257. package/activities/forms/SetFormElementEvent.js +1 -1
  258. package/activities/forms/SetFormElementItemProperty.js +1 -1
  259. package/activities/forms/SetFormElementItems.js +1 -1
  260. package/activities/forms/SetFormElementLimits.js +1 -1
  261. package/activities/forms/SetFormElementProperty.js +1 -1
  262. package/activities/forms/ShowFormElement.js +1 -1
  263. package/activities/image/GetImageMetadata.js +1 -1
  264. package/activities/image/RotateImage.js +1 -1
  265. package/activities/index.js +1 -1
  266. package/activities/main.js +1 -1
  267. package/activities/math/Abs.js +1 -1
  268. package/activities/math/Cos.js +1 -1
  269. package/activities/math/Max.js +1 -1
  270. package/activities/math/Min.js +1 -1
  271. package/activities/math/Pow.js +1 -1
  272. package/activities/math/Random.js +1 -1
  273. package/activities/math/Sin.js +1 -1
  274. package/activities/math/Sqrt.js +1 -1
  275. package/activities/math/Tan.js +1 -1
  276. package/activities/pdf/AddGeoreferenceToPdf.js +1 -1
  277. package/activities/pdf/AddImageToPdf.js +1 -1
  278. package/activities/pdf/AddTextToPdf.js +1 -1
  279. package/activities/pdf/CreatePdf.js +1 -1
  280. package/activities/pdf/ExtractPdfPages.js +1 -1
  281. package/activities/pdf/MergePdfs.js +1 -1
  282. package/activities/server/CopyFile.js +1 -1
  283. package/activities/server/CreateDirectory.js +1 -1
  284. package/activities/server/CreateDownload.js +1 -1
  285. package/activities/server/CreateEmailAttachment.js +1 -1
  286. package/activities/server/CreateZipFromDirectory.js +1 -1
  287. package/activities/server/DeleteDirectory.js +1 -1
  288. package/activities/server/DeleteFile.js +1 -1
  289. package/activities/server/DirectoryExists.js +1 -1
  290. package/activities/server/ExtractZipToDirectory.js +1 -1
  291. package/activities/server/FileExists.js +1 -1
  292. package/activities/server/GetDirectoriesInDirectory.js +1 -1
  293. package/activities/server/GetFilesInDirectory.js +1 -1
  294. package/activities/server/MoveFile.js +1 -1
  295. package/activities/server/ReadFile.js +1 -1
  296. package/activities/server/ReadFileBytes.js +1 -1
  297. package/activities/server/RunApplication.js +1 -1
  298. package/activities/server/RunPython.js +1 -1
  299. package/activities/server/SendEmail.js +1 -1
  300. package/activities/server/SqlNonQuery.js +1 -1
  301. package/activities/server/SqlQuery.js +1 -1
  302. package/activities/server/SqlQueryUnsafe.js +1 -1
  303. package/activities/server/WriteFile.js +1 -1
  304. package/activities/server/WriteFileBytes.js +1 -1
  305. package/activities/ui/Alert.js +1 -1
  306. package/activities/ui/Confirm.js +1 -1
  307. package/activities/ui/DialogContent.js +1 -1
  308. package/activities/ui/DialogProvider.js +1 -1
  309. package/activities/ui/Prompt.js +1 -1
  310. package/activities/wab/OpenWidget.js +1 -1
  311. package/activities/wab/PublishWidgetData.js +1 -1
  312. package/activities/xlsx/ConvertDataTableToXlsx.js +1 -1
  313. package/activities/xlsx/ConvertXlsxToDataSet.js +1 -1
  314. package/constants.js +1 -1
  315. package/definition/Activity.js +1 -0
  316. package/definition/ActivityInput.js +1 -1
  317. package/definition/Component.js +1 -0
  318. package/definition/DeploymentConfig.js +1 -0
  319. package/definition/Form.js +1 -0
  320. package/definition/Program.js +1 -0
  321. package/definition/ProgramInspector.js +1 -1
  322. package/definition/Reference.js +1 -0
  323. package/definition/Resource.js +1 -0
  324. package/definition/Step.js +1 -0
  325. package/definition/Transition.js +1 -0
  326. package/diagnostics/ConsoleDebugLogger.js +1 -1
  327. package/diagnostics/logging.js +1 -0
  328. package/execution/ActivityContext.js +1 -1
  329. package/execution/ActivityLoader.js +1 -1
  330. package/execution/AmbientState.js +1 -1
  331. package/execution/Engine.js +1 -1
  332. package/execution/ExternalEvent.js +1 -0
  333. package/execution/IDebugSession.js +1 -0
  334. package/execution/ModuleLoader.js +1 -1
  335. package/execution/ProgramRunner.js +1 -1
  336. package/execution/Proxy.js +1 -1
  337. package/execution/StepContext.js +1 -1
  338. package/execution/TransitionContext.js +1 -1
  339. package/execution/util.js +1 -1
  340. package/forms/Calendar.js +1 -1
  341. package/forms/ExclusiveTimer.js +1 -1
  342. package/forms/FormComponent.d.ts +1 -1
  343. package/forms/FormComponent.js +1 -1
  344. package/forms/FormDefinition.d.ts +29 -1
  345. package/forms/FormDefinition.js +1 -1
  346. package/forms/FormHost.js +1 -1
  347. package/forms/FormPresenterHost.js +1 -0
  348. package/forms/MutuallyExclusiveSectionGroup.js +1 -1
  349. package/forms/NumberParser.js +1 -1
  350. package/forms/components/AccordionGroup.js +1 -1
  351. package/forms/components/AutoComplete.js +1 -1
  352. package/forms/components/Button.d.ts +8 -0
  353. package/forms/components/Button.js +1 -0
  354. package/forms/components/ButtonBar.js +1 -1
  355. package/forms/components/CheckBox.js +1 -1
  356. package/forms/components/CheckGroup.js +1 -1
  357. package/forms/components/DatePicker.js +1 -1
  358. package/forms/components/DateRangePicker.js +1 -1
  359. package/forms/components/DateTimePicker.js +1 -1
  360. package/forms/components/DateTimeTextField.js +1 -1
  361. package/forms/components/DropDownList.js +1 -1
  362. package/forms/components/FilePicker.js +1 -1
  363. package/forms/components/Form.js +1 -1
  364. package/forms/components/FormElement.js +1 -1
  365. package/forms/components/FormLabelNumberField.d.ts +2 -0
  366. package/forms/components/FormLabelNumberField.js +1 -1
  367. package/forms/components/GeometryPicker.js +1 -1
  368. package/forms/components/Image.js +1 -1
  369. package/forms/components/ItemPicker.d.ts +1 -1
  370. package/forms/components/ItemPicker.js +1 -1
  371. package/forms/components/ListBox.js +1 -1
  372. package/forms/components/Markdown.js +1 -1
  373. package/forms/components/Number.js +1 -1
  374. package/forms/components/NumberRangeSlider.js +1 -1
  375. package/forms/components/NumberSlider.js +1 -1
  376. package/forms/components/RadioGroup.js +1 -1
  377. package/forms/components/Scanner.d.ts +0 -1
  378. package/forms/components/Scanner.js +1 -1
  379. package/forms/components/Section.js +1 -1
  380. package/forms/components/Signature.js +1 -1
  381. package/forms/components/SignatureDialog.js +1 -1
  382. package/forms/components/Sketch.js +1 -1
  383. package/forms/components/SketchDialog.js +1 -1
  384. package/forms/components/TabGroup.js +1 -1
  385. package/forms/components/TextArea.js +1 -1
  386. package/forms/components/TextBox.js +1 -1
  387. package/forms/components/TimePicker.js +1 -1
  388. package/forms/components/common.js +1 -1
  389. package/forms/constants.js +1 -1
  390. package/forms/customNumberFormat.js +1 -1
  391. package/forms/dateUtilities.d.ts +1 -1
  392. package/forms/dateUtilities.js +1 -1
  393. package/forms/elements/AutoComplete.js +1 -1
  394. package/forms/elements/ButtonBar.d.ts +3 -0
  395. package/forms/elements/ButtonBar.js +1 -0
  396. package/forms/elements/CheckBox.js +1 -0
  397. package/forms/elements/CheckGroup.js +1 -0
  398. package/forms/elements/Custom.js +1 -0
  399. package/forms/elements/DatePicker.js +1 -0
  400. package/forms/elements/DateRangePicker.js +1 -0
  401. package/forms/elements/DateTimePicker.js +1 -0
  402. package/forms/elements/DropDownList.js +1 -0
  403. package/forms/elements/FilePicker.js +1 -0
  404. package/forms/elements/GeometryPicker.js +1 -0
  405. package/forms/elements/Header.js +1 -0
  406. package/forms/elements/HorizontalRule.js +1 -0
  407. package/forms/elements/Image.js +1 -0
  408. package/forms/elements/ItemPicker.js +1 -0
  409. package/forms/elements/ListBox.js +1 -0
  410. package/forms/elements/Number.js +1 -1
  411. package/forms/elements/NumberRangeSlider.js +1 -1
  412. package/forms/elements/NumberSlider.js +1 -0
  413. package/forms/elements/PasswordBox.js +1 -0
  414. package/forms/elements/RadioGroup.js +1 -0
  415. package/forms/elements/Scanner.js +1 -1
  416. package/forms/elements/Section.js +1 -0
  417. package/forms/elements/Signature.js +1 -1
  418. package/forms/elements/Sketch.js +1 -0
  419. package/forms/elements/Text.js +1 -0
  420. package/forms/elements/TextArea.js +1 -0
  421. package/forms/elements/TextBox.js +1 -0
  422. package/forms/elements/TimePicker.js +1 -0
  423. package/forms/elements/types.js +1 -0
  424. package/forms/hostContext.d.ts +0 -1
  425. package/forms/hostContext.js +1 -1
  426. package/forms/index.d.ts +0 -1
  427. package/forms/keyboard.d.ts +0 -1
  428. package/forms/keyboard.js +1 -1
  429. package/forms/listUtilities.js +1 -1
  430. package/forms/manifest.js +1 -1
  431. package/forms/numberFormatter.js +1 -1
  432. package/forms/numberUtilities.js +1 -1
  433. package/forms/presenter.js +1 -1
  434. package/forms/renderers.js +1 -1
  435. package/forms/textUtilities.js +1 -1
  436. package/forms/utils.d.ts +19 -0
  437. package/forms/utils.js +1 -1
  438. package/index.d.ts +1 -1
  439. package/index.js +1 -0
  440. package/libs/version.d.ts +1 -1
  441. package/libs/version.js +1 -1
  442. package/licensing/LicenseChecker.js +1 -1
  443. package/licensing/Watermark.js +1 -1
  444. package/package.json +3 -3
  445. package/ui/UIService.js +1 -1
  446. package/activities/arcgis/FeatureTableMap.d.ts +0 -12
  447. package/activities/arcgis/FeatureTableMap.js +0 -1
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class ReadFileBytes{execute(e){throw new ActivityNotImplementedError(ReadFileBytes.action)}}ReadFileBytes.action="gcx:wf:server::ReadFileBytes",ReadFileBytes.suite="gcx:wf:builtin";export{ReadFileBytes};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class ReadFileBytes{execute(e){throw new ActivityNotImplementedError(ReadFileBytes.action)}}ReadFileBytes.action="gcx:wf:server::ReadFileBytes",ReadFileBytes.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class RunApplication{execute(i){throw new ActivityNotImplementedError(RunApplication.action)}}RunApplication.action="gcx:wf:server::RunApplication",RunApplication.suite="gcx:wf:builtin";export{RunApplication};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class RunApplication{execute(t){throw new ActivityNotImplementedError(RunApplication.action)}}RunApplication.action="gcx:wf:server::RunApplication",RunApplication.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class RunPython{execute(t){throw new ActivityNotImplementedError(RunPython.action)}}RunPython.action="gcx:wf:server::RunPython",RunPython.suite="gcx:wf:builtin";export{RunPython};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class RunPython{execute(t){throw new ActivityNotImplementedError(RunPython.action)}}RunPython.action="gcx:wf:server::RunPython",RunPython.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class SendEmail{execute(e){throw new ActivityNotImplementedError(SendEmail.action)}}SendEmail.action="gcx:wf:server::SendEmail",SendEmail.suite="gcx:wf:builtin";export{SendEmail};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class SendEmail{execute(e){throw new ActivityNotImplementedError(SendEmail.action)}}SendEmail.action="gcx:wf:server::SendEmail",SendEmail.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class SqlNonQuery{execute(r){throw new ActivityNotImplementedError(SqlNonQuery.action)}}SqlNonQuery.action="gcx:wf:server::SqlNonQuery",SqlNonQuery.suite="gcx:wf:builtin";export{SqlNonQuery};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class SqlNonQuery{execute(r){throw new ActivityNotImplementedError(SqlNonQuery.action)}}SqlNonQuery.action="gcx:wf:server::SqlNonQuery",SqlNonQuery.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class SqlQuery{execute(r){throw new ActivityNotImplementedError(SqlQuery.action)}}SqlQuery.action="gcx:wf:server::SqlQuery",SqlQuery.suite="gcx:wf:builtin";export{SqlQuery};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class SqlQuery{execute(r){throw new ActivityNotImplementedError(SqlQuery.action)}}SqlQuery.action="gcx:wf:server::SqlQuery",SqlQuery.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class SqlQueryUnsafe{execute(e){throw new ActivityNotImplementedError(SqlQueryUnsafe.action)}}SqlQueryUnsafe.action="gcx:wf:server::SqlQueryUnsafe",SqlQueryUnsafe.suite="gcx:wf:builtin";export{SqlQueryUnsafe};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class SqlQueryUnsafe{execute(e){throw new ActivityNotImplementedError(SqlQueryUnsafe.action)}}SqlQueryUnsafe.action="gcx:wf:server::SqlQueryUnsafe",SqlQueryUnsafe.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class WriteFile{execute(e){throw new ActivityNotImplementedError(WriteFile.action)}}WriteFile.action="gcx:wf:server::WriteFile",WriteFile.suite="gcx:wf:builtin";export{WriteFile};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class WriteFile{execute(e){throw new ActivityNotImplementedError(WriteFile.action)}}WriteFile.action="gcx:wf:server::WriteFile",WriteFile.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class WriteFileBytes{execute(e){throw new ActivityNotImplementedError(WriteFileBytes.action)}}WriteFileBytes.action="gcx:wf:server::WriteFileBytes",WriteFileBytes.suite="gcx:wf:builtin";export{WriteFileBytes};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class WriteFileBytes{execute(e){throw new ActivityNotImplementedError(WriteFileBytes.action)}}WriteFileBytes.action="gcx:wf:server::WriteFileBytes",WriteFileBytes.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Alert=class{async execute(t,e,i){var r=validation.string("title",t.title,""),o=validation.boolean("markdown",t.markdown,!1);let a=validation.string("text",t.text,"");return o&&(a={markdown:a}),await i.create(e.ambient.environment.getText).showAlert(a,r),{}}};Alert.action="gcx:wf:ui::Alert",Alert.suite="gcx:wf:builtin",Alert=__decorate([activate(DialogProvider)],Alert);export{Alert};
1
+ import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Alert=class{async execute(t,e,i){const r=validation.string("title",t.title,""),o=validation.boolean("markdown",t.markdown,!1);let a=validation.string("text",t.text,"");return o&&(a={markdown:a}),await i.create(e.ambient.environment.getText).showAlert(a,r),{}}};Alert.action="gcx:wf:ui::Alert",Alert.suite="gcx:wf:builtin",Alert=__decorate([activate(DialogProvider)],Alert);export{Alert};
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Confirm=class{async execute(i,t,o){var r=validation.string("title",i.title,""),a=validation.boolean("markdown",i.markdown,!1);let e=validation.string("text",i.text,"");return a&&(e={markdown:e}),{result:await o.create(t.ambient.environment.getText).showConfirm(e,r)}}};Confirm.action="gcx:wf:ui::Confirm",Confirm.suite="gcx:wf:builtin",Confirm=__decorate([activate(DialogProvider)],Confirm);export{Confirm};
1
+ import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Confirm=class{async execute(i,t,o){const r=validation.string("title",i.title,""),a=validation.boolean("markdown",i.markdown,!1);let e=validation.string("text",i.text,"");a&&(e={markdown:e});return{result:await o.create(t.ambient.environment.getText).showConfirm(e,r)}}};Confirm.action="gcx:wf:ui::Confirm",Confirm.suite="gcx:wf:builtin",Confirm=__decorate([activate(DialogProvider)],Confirm);export{Confirm};
@@ -1 +1 @@
1
- import Box from"@vertigis/react-ui/Box";import Button from"@vertigis/react-ui/Button";import DialogActions from"@vertigis/react-ui/DialogActions";import DialogContent from"@vertigis/react-ui/DialogContent";import DialogTitle from"@vertigis/react-ui/DialogTitle";import Input from"@vertigis/react-ui/Input";import Markdown from"@vertigis/react-ui/Markdown";import React,{useState}from"react";function isMarkdownRef(e){return"object"==typeof e&&"string"==typeof e.markdown}const AlertContent=({text:e,title:t,getText:n,onClose:a})=>{var o=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,t),React.createElement(DialogContent,{sx:{pb:0}},o&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!o&&e),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:a,variant:"contained"},n("@common-ok"))))},ConfirmContent=({text:e,title:t,getText:n,onClose:a})=>{var o=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,t),React.createElement(DialogContent,{sx:{pb:0}},o&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!o&&e),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:()=>a(!0),variant:"contained"},n("@common-ok")),React.createElement(Button,{onClick:()=>a(!1),variant:"contained"},n("@common-cancel"))))},PromptContent=({description:e,defaultText:t,title:n,getText:a,onClose:o})=>{const[r,l]=useState(t||"");t=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,n),React.createElement(DialogContent,{sx:{pb:0}},t&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!t&&React.createElement(Box,{sx:{pb:1.75,pt:1.75}},e),React.createElement(Input,{value:r,onChange:e=>{l(e.target.value)}})),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:()=>{o(r)},variant:"contained"},a("@common-ok")),React.createElement(Button,{onClick:()=>{o(null)},variant:"contained"},a("@common-cancel"))))};export{AlertContent,ConfirmContent,PromptContent};
1
+ import Box from"@vertigis/react-ui/Box";import Button from"@vertigis/react-ui/Button";import DialogActions from"@vertigis/react-ui/DialogActions";import DialogContent from"@vertigis/react-ui/DialogContent";import DialogTitle from"@vertigis/react-ui/DialogTitle";import Input from"@vertigis/react-ui/Input";import Markdown from"@vertigis/react-ui/Markdown";import React,{useState}from"react";function isMarkdownRef(e){return"object"==typeof e&&"string"==typeof e.markdown}export const AlertContent=({text:e,title:t,getText:n,onClose:a})=>{const o=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,t),React.createElement(DialogContent,{sx:{pb:0}},o&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!o&&e),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:a,variant:"contained"},n("@common-ok"))))};export const ConfirmContent=({text:e,title:t,getText:n,onClose:a})=>{const o=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,t),React.createElement(DialogContent,{sx:{pb:0}},o&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!o&&e),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:()=>a(!0),variant:"contained"},n("@common-ok")),React.createElement(Button,{onClick:()=>a(!1),variant:"contained"},n("@common-cancel"))))};export const PromptContent=({description:e,defaultText:t,title:n,getText:a,onClose:o})=>{const[r,c]=useState(t||""),l=isMarkdownRef(e);return React.createElement(React.Fragment,null,React.createElement(DialogTitle,null,n),React.createElement(DialogContent,{sx:{pb:0}},l&&React.createElement(Markdown,{markdown:e.markdown,escapeHtml:!0,linkTarget:"_blank"}),!l&&React.createElement(Box,{sx:{pb:1.75,pt:1.75}},e),React.createElement(Input,{value:r,onChange:e=>{c(e.target.value)}})),React.createElement(DialogActions,null,React.createElement(Button,{color:"primary",onClick:()=>{o(r)},variant:"contained"},a("@common-ok")),React.createElement(Button,{onClick:()=>{o(null)},variant:"contained"},a("@common-cancel"))))};
@@ -1 +1 @@
1
- import Dialog from"@vertigis/react-ui/Dialog";import React from"react";import{AlertContent,ConfirmContent,PromptContent}from"./DialogContent.js";class DialogProvider{static create(t){return new this(t)}static register(t){t.factories.push(t=>t===this.type?this:void 0)}constructor(t){this._getText=t,this.AlertContent=AlertContent,this.ConfirmContent=ConfirmContent,this.PromptContent=PromptContent}async showAlert(e,i){return this.uiService.displayDialog(t=>React.createElement(this.AlertContent,{getText:this._getText,onClose:t,text:e,title:i}),Dialog)}async showConfirm(t,i){let o=!1;return await this.uiService.displayDialog(e=>React.createElement(this.ConfirmContent,{getText:this._getText,onClose:t=>{o=t,e()},text:t,title:i}),Dialog),o}async showPrompt(t,i,o){let r=null;return await this.uiService.displayDialog(e=>React.createElement(this.PromptContent,{defaultText:i,description:t,getText:this._getText,onClose:t=>{r=t,e()},title:o}),Dialog),r}}DialogProvider.type="8F03DBFB-C0F4-499D-B176-70F51AF11E40:DialogProvider";export{DialogProvider};
1
+ import Dialog from"@vertigis/react-ui/Dialog";import React from"react";import{AlertContent,ConfirmContent,PromptContent}from"./DialogContent.js";export class DialogProvider{static create(t){return new this(t)}static register(t){t.factories.push(t=>t===this.type?this:void 0)}constructor(t){this._getText=t,this.AlertContent=AlertContent,this.ConfirmContent=ConfirmContent,this.PromptContent=PromptContent}async showAlert(t,e){return this.uiService.displayDialog(i=>React.createElement(this.AlertContent,{getText:this._getText,onClose:i,text:t,title:e}),Dialog)}async showConfirm(t,e){let i=!1;return await this.uiService.displayDialog(o=>React.createElement(this.ConfirmContent,{getText:this._getText,onClose:t=>{i=t,o()},text:t,title:e}),Dialog),i}async showPrompt(t,e,i){let o=null;return await this.uiService.displayDialog(r=>React.createElement(this.PromptContent,{defaultText:e,description:t,getText:this._getText,onClose:t=>{o=t,r()},title:i}),Dialog),o}}DialogProvider.type="8F03DBFB-C0F4-499D-B176-70F51AF11E40:DialogProvider";
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Prompt=class{async execute(t,o,i){var r=validation.string("title",t.title,""),a=validation.string("defaultText",t.defaultText),e=validation.boolean("markdown",t.markdown,!1);let n=validation.string("description",t.description,"");return e&&(n={markdown:n}),{result:await i.create(o.ambient.environment.getText).showPrompt(n,a,r)}}};Prompt.action="gcx:wf:ui::Prompt",Prompt.suite="gcx:wf:builtin",Prompt=__decorate([activate(DialogProvider)],Prompt);export{Prompt};
1
+ import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{DialogProvider}from"./DialogProvider.js";let Prompt=class{async execute(t,o,i){const r=validation.string("title",t.title,""),a=validation.string("defaultText",t.defaultText),e=validation.boolean("markdown",t.markdown,!1);let n=validation.string("description",t.description,"");e&&(n={markdown:n});return{result:await i.create(o.ambient.environment.getText).showPrompt(n,a,r)}}};Prompt.action="gcx:wf:ui::Prompt",Prompt.suite="gcx:wf:builtin",Prompt=__decorate([activate(DialogProvider)],Prompt);export{Prompt};
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class OpenWidget{execute(e){throw new ActivityNotImplementedError(OpenWidget.action)}}OpenWidget.action="gcx:wf:wab::OpenWidget",OpenWidget.suite="gcx:wf:builtin";export{OpenWidget};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class OpenWidget{execute(e){throw new ActivityNotImplementedError(OpenWidget.action)}}OpenWidget.action="gcx:wf:wab::OpenWidget",OpenWidget.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class PublishWidgetData{execute(t){throw new ActivityNotImplementedError(PublishWidgetData.action)}}PublishWidgetData.action="gcx:wf:wab::PublishWidgetData",PublishWidgetData.suite="gcx:wf:builtin";export{PublishWidgetData};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class PublishWidgetData{execute(t){throw new ActivityNotImplementedError(PublishWidgetData.action)}}PublishWidgetData.action="gcx:wf:wab::PublishWidgetData",PublishWidgetData.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class ConvertDataTableToXlsx{execute(t){throw new ActivityNotImplementedError(ConvertDataTableToXlsx.action)}}ConvertDataTableToXlsx.action="gcx:wf:xlsx::ConvertDataTableToXlsx",ConvertDataTableToXlsx.suite="gcx:wf:builtin";export{ConvertDataTableToXlsx};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class ConvertDataTableToXlsx{execute(t){throw new ActivityNotImplementedError(ConvertDataTableToXlsx.action)}}ConvertDataTableToXlsx.action="gcx:wf:xlsx::ConvertDataTableToXlsx",ConvertDataTableToXlsx.suite="gcx:wf:builtin";
@@ -1 +1 @@
1
- import{ActivityNotImplementedError}from"../../Errors.js";class ConvertXlsxToDataSet{execute(t){throw new ActivityNotImplementedError(ConvertXlsxToDataSet.action)}}ConvertXlsxToDataSet.action="gcx:wf:xlsx::ConvertXlsxToDataSet",ConvertXlsxToDataSet.suite="gcx:wf:builtin";export{ConvertXlsxToDataSet};
1
+ import{ActivityNotImplementedError}from"../../Errors.js";export class ConvertXlsxToDataSet{execute(t){throw new ActivityNotImplementedError(ConvertXlsxToDataSet.action)}}ConvertXlsxToDataSet.action="gcx:wf:xlsx::ConvertXlsxToDataSet",ConvertXlsxToDataSet.suite="gcx:wf:builtin";
package/constants.js CHANGED
@@ -1 +1 @@
1
- const DEFAULT_LOCALE="en-US";export{DEFAULT_LOCALE};
1
+ export const DEFAULT_LOCALE="en-US";
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- function isActivityInputExpression(t){return"object"==typeof t}export{isActivityInputExpression};
1
+ export function isActivityInputExpression(t){return"object"==typeof t}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- import{Dictionary,Iterator,Stash}from"../Collections.js";class ProgramInspector{constructor(t){this.incidents=new IncidentList,this.components=new ComponentList(this.incidents),this.forms=new FormList(this.incidents),this.hiddenValidationIssues=new Set,this.references=new ReferenceList(this.incidents),this.steps=new StepList(this.incidents),this.transitions=new TransitionList(this.incidents),this.program=makeBlankProgram(),this.editorId=t}newId(t){return"number"==typeof t&&(this.incidents.nextId=t),this.incidents.newId()}exists(t){return void 0!==this.incidents.findFor(t)}find(t){t=this.incidents.find(t);return void 0!==t?t.resource:void 0}findComponent(t){return this.components.findWith(t)}findForm(t){return this.forms.findWith(t)}findReference(t){return this.references.findWith(t)}findStep(t){return this.steps.findWith(t)}findTransition(t){return this.transitions.findWith(t)}all(){return iterate(this.incidents)}allComponents(){return this.components.all()}allForms(){return this.forms.all()}allReferences(){return this.references.all()}allSteps(){return this.steps.all()}allTransitions(){return this.transitions.all()}addComponent(){return this.components.add().resource}addForm(){return this.forms.add().resource}addReference(){return this.references.add().resource}addStep(){return this.steps.add().resource}addTransition(r,n){const i=this.steps.findFor(r),s=this.steps.findFor(n);if(void 0!==i&&void 0!==s){let t=i.transitions;void 0===t&&(t=i.transitions=new Dictionary);let e=s.transitions;void 0===e&&(e=s.transitions=new Dictionary);const o=this.transitions.add(),a=o.resource;return o.source=i,a.source=r,t.assign(o.token,o),o.target=s,a.target=n,e.assign(o.token,o),i.branches=void 0,a}}cacheComponents(){return this.components.cache()}cacheForms(){return this.forms.cache()}cacheReference(){return this.references.cache()}cacheSteps(){return this.steps.cache()}cacheTransitions(){return this.transitions.cache()}relate(t,e){const r=1<arguments.length?branchToToken(e):void 0;return Iterator.from(t).map(t=>this.incidents.relate(t,r))}remove(e,n){var r=t=>{let e=0;!1===n&&this.isComponent(t)&&(e+=this.remove(this.relate(t)));const r=this.incidents.findFor(t);return void 0!==r&&(e+=r.master.unlink(r),this.start===r.resource&&(this.start=void 0)),e};if(Array.isArray(e)||e instanceof Iterator){let t=0;const i=Iterator.from(e);for(;i.next();)t+=r(i.current);return t}return 0<r(e)}removeComponent(t){return this.components.removeFor(t)}removeForm(t){return this.forms.removeFor(t)}removeReference(t){return this.references.removeFor(t)}removeStep(t){return!!this.steps.removeFor(t)&&(this.start===t&&(this.start=void 0),!0)}removeTransition(t){return this.transitions.removeFor(t)}shift(t,e){const r=this.incidents.findFor(t);return void 0!==r&&r.master.shift(r,e)}shiftComponent(t,e){return this.components.shiftFor(t,e)}shiftForm(t,e){return this.forms.shiftFor(t,e)}shiftReference(t,e){return this.references.shiftFor(t,e)}shiftStep(t,e){return this.steps.shiftFor(t,e)}shiftTransition(t,e){return this.transitions.shiftFor(t,e)}rename(t,e){const r=this.incidents.findFor(t);return void 0!==r?r.master.rename(r,e):void 0}renameComponent(t,e){return this.components.renameFor(t,e)}renameForm(t,e){return this.forms.renameFor(t,e)}renameReference(t,e){return this.references.renameFor(t,e)}renameStep(t,e){return this.steps.renameFor(t,e)}renameTransition(t,e){return this.transitions.renameFor(t,e)}changeStart(t){return!!this.isStep(t)&&(this.start=t,!0)}changeBranch(t,e){const r=this.transitions.findFor(t);return void 0!==r&&(r.source.branches=void 0,t.branch="string"==typeof e?e:void 0,!0)}changeParent(t,e){let r=this.steps.findFor(t);if(void 0===r&&(r=this.transitions.findFor(t)),void 0===r)return!1;let n;return(null==e||(n=this.components.findFor(e),void 0!==n))&&(r.master.changeParent(r,n),!0)}changeSource(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.source.branches=void 0,r.source!==r.target&&r.source.transitions.remove(r.token);let i=n.transitions;return void 0===i&&(i=n.transitions=new Dictionary),r.source=n,t.source=e,n.branches=void 0,i.assign(r.token,r),!0}changeTarget(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.target!==r.source&&r.target.transitions.remove(r.token);let i=n.transitions;return void 0===i&&(i=n.transitions=new Dictionary),r.target=n,t.target=e,i.assign(r.token,r),!0}isComponent(t){return void 0!==this.components.findFor(t)}isParent(t,e){return this.isActivity(e)&&e.parent===t}isForm(t){return void 0!==this.forms.findFor(t)}isActivity(t){return this.isStep(t)||this.isTransition(t)}isReference(t){return void 0!==this.references.findFor(t)}isStep(t){return void 0!==this.steps.findFor(t)}isTransition(t){return void 0!==this.transitions.findFor(t)}isSource(t,e){return this.isTransition(t)&&t.source===e}isTarget(t,e){return this.isTransition(t)&&t.target===e}getDeploymentConfig(){return this.program.deploymentConfig||{supportedApps:{}}}getDefaultLocale(){return navigator.language||"inv"}getHiddenValidationIssues(){return this.hiddenValidationIssues}getStrings(t){var e,r=this.program.strings||{};t=t||this.getDefaultLocale();let n={...r.inv||{}};return"inv"===t||(t=canonicalizeLocale(t))&&(t!==(e=parseLocale(t).language)&&e in r&&(n={...n,...r[e]}),t in r&&(n={...n,...r[t]})),n}realize(){this.program.components=this.allComponents().list(),this.program.forms=this.allForms().list(),this.program.hiddenValidationIssues=[...this.hiddenValidationIssues],this.program.references=this.allReferences().list(),this.program.steps=this.allSteps().list(),this.program.transitions=this.allTransitions().list(),this.program.start=this.start;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();){const n=e.current;n.transitions=[];const i=n.parent;void 0!==i&&i.steps.push(n)}const r=this.allTransitions();for(;r.next();){const s=r.current,o=s.parent;void 0!==o&&o.transitions.push(s),s.source.transitions.push(s),s.target!==s.source&&s.target.transitions.push(s)}}release(){this.program.components=[],this.program.forms=[],this.program.hiddenValidationIssues=[],this.program.references=[],this.program.steps=[],this.program.transitions=[],this.program.start=void 0;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();)e.current.transitions=[]}resolveStart(t){if("number"==typeof t)return this.findStep(t);if("string"==typeof t)return this.findStep(t);if("object"!=typeof t||null===t)return this.start;var e=t.id;if("number"==typeof e)return this.findStep(e);t=t.name;return"string"==typeof t?this.findStep(t):void 0}import(t,n,s){if("object"!=typeof(t="string"==typeof t?JSON.parse(t):t)||null===t)return{};"function"!=typeof s&&(s=void 0),n=!1!==n;const i={},o={},a=new Stash,c=(t,e)=>{copyResource(t,e);let r=t.id,n=t.name;void 0!==s&&("number"==typeof(i=s(r,n))?(r=i,n=void 0):"string"==typeof i?(r=void 0,n=i):"object"==typeof i&&null!==i?(r=i.id,n=i.name):!0!==i&&(r=void 0,n=void 0)),"number"==typeof r&&(this.shift(e,r),o[r]=e),"string"==typeof n&&this.rename(e,n);var i="number"==typeof r?"id$"+r:"auto";return a.write(i,t,e),e};function u(t,e,r){var n=e.id;if("number"!=typeof n)return c(e,r());t+=n,n=i[t];return void 0===n?c(e,i[t]=r()):c(e,n)}const r=()=>this.addComponent();function d(t){const e=u("component$",t,r);return y(t.steps,t=>p(t,e)),y(t.transitions,t=>v(t,e)),e}const e=()=>this.addForm();const h=()=>this.addReference();const f=()=>this.addStep(),p=(t,e)=>{const r=u("step$",t,f);return this.changeParent(r,g(t.parent,d)||r.parent||e),y(t.transitions,t=>v(t,n?e:void 0,r)),r},m=this.addStep(),l=()=>this.addTransition(m,m),v=(t,e,r)=>{var n=u("transition$",t,()=>l());this.changeParent(n,g(t.parent,d)||n.parent||e);e=n.source!==m?n.source:void 0;this.changeSource(n,g(t.source,p)||e||r);e=n.target!==m?n.target:void 0;return this.changeTarget(n,g(t.target,p)||e||r),n};function g(t,e){if(isObject(t)){var r=t.id,r="number"==typeof r?"id$"+r:"auto";return a.read(r,t)||e(t)}}function y(t,e){if(Array.isArray(t))for(const r of t)g(r,e)}copyResource(t,this.program),y(t.components,d),y(t.forms,function(t){return u("form$",t,e)}),y(t.references,function(t){return u("reference$",t,h)}),y(t.steps,p),y(t.transitions,v),this.hiddenValidationIssues=new Set(t.hiddenValidationIssues??[]),o.start=g(t.start,p),void 0===s&&(this.start=o.start);let F;var k=t=>(void 0===F&&(F=this.addStep(),this.changeParent(F,t)),F);const I=this.relate(m);for(;I.next();){F=void 0;var S=I.current;S.source===m&&this.changeSource(S,k(S.parent)),S.target===m&&this.changeTarget(S,k(S.parent))}return this.removeStep(m),this.realize(),o}export(){this.realize();const t=new ProgramInspector;t.import(this.program,!1);const e=t.program;e.steps=minifyArray(e.steps,function(e){return e.transitions=minifyArray(e.transitions,function(t){return t.source===e&&t.parent===e.parent&&(t.parent=void 0,t.source=void 0,t.target=t.target!==t.source?{id:t.target.id}:void 0,!0)}),void 0===e.parent}),e.transitions=minifyArray(e.transitions,function(t){return void 0===t.parent&&void 0!==t.source&&(t.source={id:t.source.id},t.target={id:t.target.id},!0)}),e.components=minifyArray(e.components,function(t){return t.steps=minifyArray(t.steps,function(t){return!(t.parent=void 0)}),t.transitions=minifyArray(t.transitions,function(t){return void 0!==t.parent&&(t.parent=void 0,t.source={id:t.source.id},t.target={id:t.target.id},!0)}),!0}),e.forms=minifyArray(e.forms),e.hiddenValidationIssues=minifyArray(e.hiddenValidationIssues??[]),e.references=minifyArray(e.references);var r=t.start;return e.start=void 0!==r?{id:r.id}:void 0,e}reset(){this.incidents.clear(),this.components.clear(),this.forms.clear(),this.references.clear(),this.steps.clear(),this.transitions.clear(),this.incidents.nextId=1,this.program=makeBlankProgram(),this.start=void 0}toJSON(){return this.export()}}function iterate(t){return void 0===t?Iterator.empty:t.iterate().filter(function(t,e){return 0===String(e).lastIndexOf("token$",0)}).map(t=>t.resource,t=>t.id)}class IncidentList extends Dictionary{constructor(){super(...arguments),this.nextId=1}findFor(t){if(null!=t){var e=this.find(t.id);if(void 0!==e&&e.resource===t)return e}}newId(){let t=this.nextId;for(;this.exists(t);)t++;return this.nextId=t+1,t}relate(t,e){const r=this.findFor(t);return void 0!==r?r.master.relate(r,e):Iterator.empty}}class ResourceList extends Dictionary{constructor(t){super(),this.incidents=t}all(){return iterate(this)}cache(){let t=this.cacheLookup;if(void 0!==t)return t;t=this.cacheLookup={};const e=this.iterate();for(;e.next();){var r=e.current.resource,n=(t[r.id]=r).name;void 0!==n&&(t["$"+n]=r)}return t}findFor(t){t=this.incidents.findFor(t);return this.test(t)?t:void 0}test(t){return void 0!==t&&t.master===this}findWith(t){"string"==typeof t&&(t=this.qualify(t));t=this.incidents.find(t);return this.test(t)?t.resource:void 0}shift(t,e){this.incidents.remove(t.resource.id),"number"!=typeof e&&(e=this.incidents.newId());const r=this.incidents.assign(t.resource.id=e,t);void 0!==r&&this.incidents.assign(r.resource.id=this.incidents.newId(),r),this.cacheLookup=void 0}shiftFor(t,e){t=this.findFor(t);return void 0!==t&&(this.shift(t,e),!0)}rename(t,e){var r=t.resource.name;if(void 0!==r&&this.incidents.remove(this.qualify(r)),"string"==typeof e){e=this.qualify(t.resource.name=e);const n=this.incidents.assign(e,t);void 0!==n&&(n.resource.name=void 0)}else t.resource.name=void 0;return this.cacheLookup=void 0,r}renameFor(t,e){t=this.findFor(t);return void 0!==t&&(this.rename(t,e),!0)}add(){const t={},e=t.resource=this.create();return t.token=generateToken(),t.master=this,e.id=this.incidents.newId(),this.assign(t.token,t),this.incidents.assign(e.id,t),this.cacheLookup=void 0,t}removeFor(t){t=this.findFor(t);return void 0!==t&&(this.unlink(t),!0)}unlink(t){this.remove(t.token),this.cacheLookup=void 0;var e=t.resource.id;this.incidents.remove(e);t=t.resource.name;return void 0!==t&&this.incidents.remove(this.qualify(t)),1}relate(t,e){return Iterator.empty}changeParent(t,e){var r=t.parent;void 0!==r&&this.siblings(r).remove(t.token),void 0!==e?(t.parent=e,t.resource.parent=e.resource,this.siblings(e).assign(t.token,t)):(t.parent=void 0,t.resource.parent=void 0)}}class ComponentList extends ResourceList{create(){return{steps:[],transitions:[]}}qualify(t){return"component$"+t}unlink(t){super.unlink(t);const e=t.steps;if(void 0!==e){const n=e.iterate();for(;n.next();)n.current.resource.parent=void 0}const r=t.transitions;if(void 0!==r){const i=r.iterate();for(;i.next();)i.current.resource.parent=void 0}return 1}relate(t){const e=iterate(t.steps);t=iterate(t.transitions);return e.concat(t)}}class FormList extends ResourceList{create(){return{defaults:{},elements:{}}}qualify(t){return"form$"+t}}class ReferenceList extends ResourceList{create(){return{suite:"",path:""}}qualify(t){return"reference$"+t}}class StepList extends ResourceList{create(){return{inputs:{},transitions:[]}}qualify(t){return"activity$"+t}siblings(t){return t.steps||(t.steps=new Dictionary)}unlink(t){let e=super.unlink(t);void 0!==t.parent&&t.parent.steps.remove(t.token);const r=t.transitions;if(void 0!==r){const n=r.iterate();for(;n.next();)e+=n.current.master.unlink(n.current)}return e}relate(t,e){var r=t.transitions;if(void 0===r)return Iterator.empty;if(void 0===e)return iterate(r);let n=t.branches;if(void 0===n){n=t.branches={};for(const s of iterate(r).list().sort(compareTransitions))if(s.source===t.resource){var i=branchToToken(s.branch);const o=n[i];void 0===o?n[i]=s:Array.isArray(o)?o.push(s):n[i]=[o,s]}}return n[e]||Iterator.empty}}class TransitionList extends ResourceList{create(){return{inputs:{}}}qualify(t){return"activity$"+t}siblings(t){return t.transitions||(t.transitions=new Dictionary)}unlink(t){return super.unlink(t),t.source.branches=void 0,t.source.transitions.remove(t.token),t.target.transitions.remove(t.token),void 0!==t.parent&&t.parent.transitions.remove(t.token),1}relate(t){return t.source!==t.target?[t.source.resource,t.target.resource]:t.source.resource}}const safeProps={id:!1,name:!1,components:!1,elements:!0,forms:!1,hiddenValidationIssues:!1,references:!1,steps:!1,transitions:!1,start:!1,parent:!1,source:!1,target:!1,suite:!0,path:!0};function copyResource(t,e){for(const r in t)!1!==safeProps[r]&&(e[r]=deepClone(t[r]))}function deepClone(t){if(null!=t){if(Array.isArray(t))return t.map(deepClone);if("object"!=typeof t)return t;{const r={};for(const n in t){var e=t[n];null!=e&&(r[n]=e)}return r}}}function isObject(t){return!Array.isArray(t)&&("object"==typeof t&&null!==t)}function makeBlankProgram(){return{components:[],forms:[],hiddenValidationIssues:[],references:[],steps:[],transitions:[]}}function minifyArray(e,r){let n=0;for(let t=0;t<e.length;t++){var i=e[t];void 0!==r&&!r(i)||(e[n++]=i)}return e.length=n,0<e.length?e:void 0}function branchToToken(t){return void 0!==t?"string$"+t:"blank"}function hasInputs(t){for(const e in t)return!0;return!1}function compareTransitions(t,e){return"number"==typeof t.rank?"number"!=typeof e.rank||t<e?-1:e<t?1:0:"number"==typeof e.rank?1:hasInputs(t)?hasInputs(e)?0:-1:hasInputs(e)?1:0}const generateToken=function(){let t,e;function r(){t=0,e="token$"+(new Date).valueOf()+"$"}r();return function(){return 1073741824<=t&&r(),e+t++}}();function parseLocale(t){if("string"==typeof t){const e=t.split("-");if(!(e.length<1||3<e.length||e.some(t=>0===t.length))){const r={language:e[0].toLowerCase()};return 2==e.length?2==e[1].length?r.territory=e[1].toUpperCase():r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase():3===e.length&&(r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase(),r.territory=e[2].toUpperCase()),r}}}function canonicalizeLocale(e){e=parseLocale(e);if(e){let t=e.language;return e.script&&(t+="-"+e.script),e.territory&&(t+="-"+e.territory),t}}export{ProgramInspector,parseLocale,canonicalizeLocale};
1
+ import{Dictionary,Iterator,Stash}from"../Collections.js";export class ProgramInspector{constructor(t){this.incidents=new IncidentList,this.components=new ComponentList(this.incidents),this.forms=new FormList(this.incidents),this.hiddenValidationIssues=new Set,this.references=new ReferenceList(this.incidents),this.steps=new StepList(this.incidents),this.transitions=new TransitionList(this.incidents),this.program=makeBlankProgram(),this.editorId=t}newId(t){return"number"==typeof t&&(this.incidents.nextId=t),this.incidents.newId()}exists(t){return void 0!==this.incidents.findFor(t)}find(t){const e=this.incidents.find(t);return void 0!==e?e.resource:void 0}findComponent(t){return this.components.findWith(t)}findForm(t){return this.forms.findWith(t)}findReference(t){return this.references.findWith(t)}findStep(t){return this.steps.findWith(t)}findTransition(t){return this.transitions.findWith(t)}all(){return iterate(this.incidents)}allComponents(){return this.components.all()}allForms(){return this.forms.all()}allReferences(){return this.references.all()}allSteps(){return this.steps.all()}allTransitions(){return this.transitions.all()}addComponent(){return this.components.add().resource}addForm(){return this.forms.add().resource}addReference(){return this.references.add().resource}addStep(){return this.steps.add().resource}addTransition(t,e){const r=this.steps.findFor(t),n=this.steps.findFor(e);if(void 0!==r&&void 0!==n){let s=r.transitions;void 0===s&&(s=r.transitions=new Dictionary);let i=n.transitions;void 0===i&&(i=n.transitions=new Dictionary);const o=this.transitions.add(),a=o.resource;return o.source=r,a.source=t,s.assign(o.token,o),o.target=n,a.target=e,i.assign(o.token,o),r.branches=void 0,a}}cacheComponents(){return this.components.cache()}cacheForms(){return this.forms.cache()}cacheReference(){return this.references.cache()}cacheSteps(){return this.steps.cache()}cacheTransitions(){return this.transitions.cache()}relate(t,e){const r=arguments.length>1?branchToToken(e):void 0;return Iterator.from(t).map(t=>this.incidents.relate(t,r))}remove(t,e){const r=t=>{let r=0;!1===e&&this.isComponent(t)&&(r+=this.remove(this.relate(t)));const n=this.incidents.findFor(t);return void 0!==n&&(r+=n.master.unlink(n),this.start===n.resource&&(this.start=void 0)),r};if(Array.isArray(t)||t instanceof Iterator){let e=0;const n=Iterator.from(t);for(;n.next();)e+=r(n.current);return e}return r(t)>0}removeComponent(t){return this.components.removeFor(t)}removeForm(t){return this.forms.removeFor(t)}removeReference(t){return this.references.removeFor(t)}removeStep(t){return!!this.steps.removeFor(t)&&(this.start===t&&(this.start=void 0),!0)}removeTransition(t){return this.transitions.removeFor(t)}shift(t,e){const r=this.incidents.findFor(t);return void 0!==r&&r.master.shift(r,e)}shiftComponent(t,e){return this.components.shiftFor(t,e)}shiftForm(t,e){return this.forms.shiftFor(t,e)}shiftReference(t,e){return this.references.shiftFor(t,e)}shiftStep(t,e){return this.steps.shiftFor(t,e)}shiftTransition(t,e){return this.transitions.shiftFor(t,e)}rename(t,e){const r=this.incidents.findFor(t);return void 0!==r?r.master.rename(r,e):void 0}renameComponent(t,e){return this.components.renameFor(t,e)}renameForm(t,e){return this.forms.renameFor(t,e)}renameReference(t,e){return this.references.renameFor(t,e)}renameStep(t,e){return this.steps.renameFor(t,e)}renameTransition(t,e){return this.transitions.renameFor(t,e)}changeStart(t){return!!this.isStep(t)&&(this.start=t,!0)}changeBranch(t,e){const r=this.transitions.findFor(t);return void 0!==r&&(r.source.branches=void 0,t.branch="string"==typeof e?e:void 0,!0)}changeParent(t,e){let r,n=this.steps.findFor(t);return void 0===n&&(n=this.transitions.findFor(t)),void 0!==n&&((null==e||(r=this.components.findFor(e),void 0!==r))&&(n.master.changeParent(n,r),!0))}changeSource(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.source.branches=void 0,r.source!==r.target&&r.source.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.source=n,t.source=e,n.branches=void 0,s.assign(r.token,r),!0}changeTarget(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.target!==r.source&&r.target.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.target=n,t.target=e,s.assign(r.token,r),!0}isComponent(t){return void 0!==this.components.findFor(t)}isParent(t,e){return this.isActivity(e)&&e.parent===t}isForm(t){return void 0!==this.forms.findFor(t)}isActivity(t){return this.isStep(t)||this.isTransition(t)}isReference(t){return void 0!==this.references.findFor(t)}isStep(t){return void 0!==this.steps.findFor(t)}isTransition(t){return void 0!==this.transitions.findFor(t)}isSource(t,e){return this.isTransition(t)&&t.source===e}isTarget(t,e){return this.isTransition(t)&&t.target===e}getDeploymentConfig(){return this.program.deploymentConfig||{supportedApps:{}}}getDefaultLocale(){return navigator.language||"inv"}getHiddenValidationIssues(){return this.hiddenValidationIssues}getStrings(t){const e=this.program.strings||{};t||(t=this.getDefaultLocale());let r={...e.inv||{}};if("inv"===t)return r;if(t=canonicalizeLocale(t)){const n=parseLocale(t).language;t!==n&&n in e&&(r={...r,...e[n]}),t in e&&(r={...r,...e[t]})}return r}realize(){this.program.components=this.allComponents().list(),this.program.forms=this.allForms().list(),this.program.hiddenValidationIssues=[...this.hiddenValidationIssues],this.program.references=this.allReferences().list(),this.program.steps=this.allSteps().list(),this.program.transitions=this.allTransitions().list(),this.program.start=this.start;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();){const t=e.current;t.transitions=[];const r=t.parent;void 0!==r&&r.steps.push(t)}const r=this.allTransitions();for(;r.next();){const t=r.current,e=t.parent;void 0!==e&&e.transitions.push(t),t.source.transitions.push(t),t.target!==t.source&&t.target.transitions.push(t)}}release(){this.program.components=[],this.program.forms=[],this.program.hiddenValidationIssues=[],this.program.references=[],this.program.steps=[],this.program.transitions=[],this.program.start=void 0;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();)e.current.transitions=[]}resolveStart(t){if("number"==typeof t)return this.findStep(t);if("string"==typeof t)return this.findStep(t);if("object"==typeof t&&null!==t){const e=t.id;if("number"==typeof e)return this.findStep(e);const r=t.name;return"string"==typeof r?this.findStep(r):void 0}return this.start}import(t,e,r){if("string"==typeof t&&(t=JSON.parse(t)),"object"!=typeof t||null===t)return{};"function"!=typeof r&&(r=void 0),e=!1!==e;const n={},s={},i=new Stash,o=(t,e)=>{copyResource(t,e);let n=t.id,o=t.name;if(void 0!==r){const t=r(n,o);"number"==typeof t?(n=t,o=void 0):"string"==typeof t?(n=void 0,o=t):"object"==typeof t&&null!==t?(n=t.id,o=t.name):!0!==t&&(n=void 0,o=void 0)}"number"==typeof n&&(this.shift(e,n),s[n]=e),"string"==typeof o&&this.rename(e,o);const a="number"==typeof n?"id$"+n:"auto";return i.write(a,t,e),e};function a(t,e,r){const s=e.id;if("number"!=typeof s)return o(e,r());const i=t+s,a=n[i];return o(e,void 0===a?n[i]=r():a)}const c=()=>this.addComponent();function u(t){const e=a("component$",t,c);return y(t.steps,t=>p(t,e)),y(t.transitions,t=>v(t,e)),e}const d=()=>this.addForm();const h=()=>this.addReference();const f=()=>this.addStep(),p=(t,r)=>{const n=a("step$",t,f);return this.changeParent(n,g(t.parent,u)||n.parent||r),y(t.transitions,t=>v(t,e?r:void 0,n)),n},m=this.addStep(),l=()=>this.addTransition(m,m),v=(t,e,r)=>{const n=a("transition$",t,()=>l());this.changeParent(n,g(t.parent,u)||n.parent||e);const s=n.source!==m?n.source:void 0;this.changeSource(n,g(t.source,p)||s||r);const i=n.target!==m?n.target:void 0;return this.changeTarget(n,g(t.target,p)||i||r),n};function g(t,e){if(isObject(t)){const r=t.id,n="number"==typeof r?"id$"+r:"auto";return i.read(n,t)||e(t)}}function y(t,e){if(Array.isArray(t))for(const r of t)g(r,e)}let F;copyResource(t,this.program),y(t.components,u),y(t.forms,function(t){return a("form$",t,d)}),y(t.references,function(t){return a("reference$",t,h)}),y(t.steps,p),y(t.transitions,v),this.hiddenValidationIssues=new Set(t.hiddenValidationIssues??[]),s.start=g(t.start,p),void 0===r&&(this.start=s.start);const k=t=>(void 0===F&&(F=this.addStep(),this.changeParent(F,t)),F),I=this.relate(m);for(;I.next();){F=void 0;const t=I.current;t.source===m&&this.changeSource(t,k(t.parent)),t.target===m&&this.changeTarget(t,k(t.parent))}return this.removeStep(m),this.realize(),s}export(){this.realize();const t=new ProgramInspector;t.import(this.program,!1);const e=t.program;e.steps=minifyArray(e.steps,function(t){return t.transitions=minifyArray(t.transitions,function(e){return e.source===t&&e.parent===t.parent&&(e.parent=void 0,e.source=void 0,e.target=e.target!==e.source?{id:e.target.id}:void 0,!0)}),void 0===t.parent}),e.transitions=minifyArray(e.transitions,function(t){return void 0===t.parent&&void 0!==t.source&&(t.source={id:t.source.id},t.target={id:t.target.id},!0)}),e.components=minifyArray(e.components,function(t){return t.steps=minifyArray(t.steps,function(t){return t.parent=void 0,!0}),t.transitions=minifyArray(t.transitions,function(t){return void 0!==t.parent&&(t.parent=void 0,t.source={id:t.source.id},t.target={id:t.target.id},!0)}),!0}),e.forms=minifyArray(e.forms),e.hiddenValidationIssues=minifyArray(e.hiddenValidationIssues??[]),e.references=minifyArray(e.references);const r=t.start;return e.start=void 0!==r?{id:r.id}:void 0,e}reset(){this.incidents.clear(),this.components.clear(),this.forms.clear(),this.references.clear(),this.steps.clear(),this.transitions.clear(),this.incidents.nextId=1,this.program=makeBlankProgram(),this.start=void 0}toJSON(){return this.export()}}function iterate(t){if(void 0===t)return Iterator.empty;return t.iterate().filter(function(t,e){return 0===String(e).lastIndexOf("token$",0)}).map(t=>t.resource,t=>t.id)}class IncidentList extends Dictionary{constructor(){super(...arguments),this.nextId=1}findFor(t){if(null!=t){const e=this.find(t.id);if(void 0!==e&&e.resource===t)return e}}newId(){let t=this.nextId;for(;this.exists(t);)t++;return this.nextId=t+1,t}relate(t,e){const r=this.findFor(t);return void 0!==r?r.master.relate(r,e):Iterator.empty}}class ResourceList extends Dictionary{constructor(t){super(),this.incidents=t}all(){return iterate(this)}cache(){let t=this.cacheLookup;if(void 0!==t)return t;t=this.cacheLookup={};const e=this.iterate();for(;e.next();){const r=e.current.resource;t[r.id]=r;const n=r.name;void 0!==n&&(t["$"+n]=r)}return t}findFor(t){const e=this.incidents.findFor(t);return this.test(e)?e:void 0}test(t){return void 0!==t&&t.master===this}findWith(t){"string"==typeof t&&(t=this.qualify(t));const e=this.incidents.find(t);return this.test(e)?e.resource:void 0}shift(t,e){this.incidents.remove(t.resource.id),"number"!=typeof e&&(e=this.incidents.newId());const r=this.incidents.assign(t.resource.id=e,t);void 0!==r&&this.incidents.assign(r.resource.id=this.incidents.newId(),r),this.cacheLookup=void 0}shiftFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.shift(r,e),!0)}rename(t,e){const r=t.resource.name;if(void 0!==r&&this.incidents.remove(this.qualify(r)),"string"==typeof e){const r=this.qualify(t.resource.name=e),n=this.incidents.assign(r,t);void 0!==n&&(n.resource.name=void 0)}else t.resource.name=void 0;return this.cacheLookup=void 0,r}renameFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.rename(r,e),!0)}add(){const t={},e=t.resource=this.create();return t.token=generateToken(),t.master=this,e.id=this.incidents.newId(),this.assign(t.token,t),this.incidents.assign(e.id,t),this.cacheLookup=void 0,t}removeFor(t){const e=this.findFor(t);return void 0!==e&&(this.unlink(e),!0)}unlink(t){this.remove(t.token),this.cacheLookup=void 0;const e=t.resource.id;this.incidents.remove(e);const r=t.resource.name;return void 0!==r&&this.incidents.remove(this.qualify(r)),1}relate(t,e){return Iterator.empty}changeParent(t,e){const r=t.parent;void 0!==r&&this.siblings(r).remove(t.token),void 0!==e?(t.parent=e,t.resource.parent=e.resource,this.siblings(e).assign(t.token,t)):(t.parent=void 0,t.resource.parent=void 0)}}class ComponentList extends ResourceList{create(){return{steps:[],transitions:[]}}qualify(t){return"component$"+t}unlink(t){super.unlink(t);const e=t.steps;if(void 0!==e){const t=e.iterate();for(;t.next();)t.current.resource.parent=void 0}const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)t.current.resource.parent=void 0}return 1}relate(t){const e=iterate(t.steps),r=iterate(t.transitions);return e.concat(r)}}class FormList extends ResourceList{create(){return{defaults:{},elements:{}}}qualify(t){return"form$"+t}}class ReferenceList extends ResourceList{create(){return{suite:"",path:""}}qualify(t){return"reference$"+t}}class StepList extends ResourceList{create(){return{inputs:{},transitions:[]}}qualify(t){return"activity$"+t}siblings(t){return t.steps||(t.steps=new Dictionary)}unlink(t){let e=super.unlink(t);void 0!==t.parent&&t.parent.steps.remove(t.token);const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)e+=t.current.master.unlink(t.current)}return e}relate(t,e){const r=t.transitions;if(void 0===r)return Iterator.empty;if(void 0===e)return iterate(r);let n=t.branches;if(void 0===n){n=t.branches={};for(const e of iterate(r).list().sort(compareTransitions))if(e.source===t.resource){const t=branchToToken(e.branch),r=n[t];void 0===r?n[t]=e:Array.isArray(r)?r.push(e):n[t]=[r,e]}}return n[e]||Iterator.empty}}class TransitionList extends ResourceList{create(){return{inputs:{}}}qualify(t){return"activity$"+t}siblings(t){return t.transitions||(t.transitions=new Dictionary)}unlink(t){return super.unlink(t),t.source.branches=void 0,t.source.transitions.remove(t.token),t.target.transitions.remove(t.token),void 0!==t.parent&&t.parent.transitions.remove(t.token),1}relate(t){return t.source!==t.target?[t.source.resource,t.target.resource]:t.source.resource}}const safeProps={id:!1,name:!1,components:!1,elements:!0,forms:!1,hiddenValidationIssues:!1,references:!1,steps:!1,transitions:!1,start:!1,parent:!1,source:!1,target:!1,suite:!0,path:!0};function copyResource(t,e){for(const r in t)!1!==safeProps[r]&&(e[r]=deepClone(t[r]))}function deepClone(t){if(null!=t){if(Array.isArray(t))return t.map(deepClone);if("object"==typeof t){const e={};for(const r in t){const n=t[r];null!=n&&(e[r]=n)}return e}return t}}function isObject(t){return!Array.isArray(t)&&("object"==typeof t&&null!==t)}function makeBlankProgram(){return{components:[],forms:[],hiddenValidationIssues:[],references:[],steps:[],transitions:[]}}function minifyArray(t,e){let r=0;for(let n=0;n<t.length;n++){const s=t[n];(void 0===e||e(s))&&(t[r++]=s)}return t.length=r,t.length>0?t:void 0}function branchToToken(t){return void 0!==t?"string$"+t:"blank"}function hasInputs(t){for(const e in t)return!0;return!1}function compareTransitions(t,e){return"number"==typeof t.rank?"number"==typeof e.rank?t<e?-1:t>e?1:0:-1:"number"==typeof e.rank?1:hasInputs(t)?hasInputs(e)?0:-1:hasInputs(e)?1:0}const generateToken=function(){let t,e;function r(){t=0,e="token$"+(new Date).valueOf()+"$"}r();return function(){return t>=1073741824&&r(),e+t++}}();export function parseLocale(t){if("string"!=typeof t)return;const e=t.split("-");if(e.length<1||e.length>3||e.some(t=>0===t.length))return;const r={language:e[0].toLowerCase()};return 2==e.length?2==e[1].length?r.territory=e[1].toUpperCase():r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase():3===e.length&&(r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase(),r.territory=e[2].toUpperCase()),r}export function canonicalizeLocale(t){const e=parseLocale(t);if(!e)return;let r=e.language;return e.script&&(r+="-"+e.script),e.territory&&(r+="-"+e.territory),r}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- class ConsoleDebugLogger{onSession(o){var e,s,t;!o||(s=(e=o.frame.current).activity).action&&(t={inputs:e.inputs,outputs:e.outputs},o=s.name?"$"+s.name:s.id,o=`${s.action} (${o})`,this.lastId===e.id?console.debug(` ${o} -->`,t):(console.debug(`--> ${o} `,t),this.lastId=e.id))}}export{ConsoleDebugLogger};
1
+ export class ConsoleDebugLogger{onSession(t){if(!t)return;const e=t.frame.current,s=e.activity;if(!s.action)return;const n={inputs:e.inputs,outputs:e.outputs},o=s.name?"$"+s.name:s.id,i=`${s.action} (${o})`;this.lastId===e.id?console.debug(` ${i} --\x3e`,n):(console.debug(`--\x3e ${i} `,n),this.lastId=e.id)}}
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{ExpressionEvaluationError,ExpressionSyntaxError,ExpressionAccessorError,ActivityBindingError,ActivityActivationError,ActivityError,GenericActivityError,AggregateActivityError}from"../Errors.js";import{query}from"../Hooks.js";import{isAccessor,isExpression,isLiteral}from"./util.js";const echoHandler={execute:t=>t},evaluators={};function compileExpression(t,i){var e=t.code;let r=evaluators[e];if(void 0===r){const n=[],o={};n.push('"use strict"; ');var s=t.accessors;if(Array.isArray(s))for(const c of s)isAccessor(c)&&!o[c]&&(n.push(`var ${c} = this.${c};`),o[c]=!0);n.push("return "),n.push(e),n.push(";"),r=evaluators[e]=new Function("resources","values",n.join(""))}return function(){return r.call(this,i,t.values)}}class PromiseWrapper{}class ActivityContext{constructor(){this.action="",this.activity={},this.ambient={},this.frame={},this.proxy={},this.passes=0,this.inputs={},this.outputs={},this.extras=[],this.monikers=[],this.evaluators={},this.scope={},this.cancellationToken={},this.cancellationResolve=()=>{}}static filterErrors(t){return t.filter(ActivityContext.isError)}static isError(t){return void 0!==t}static isInvalidHandler(t){return null==t||"function"!=typeof t.execute}static reduceErrors(t){return t.isPending()?t.then(ActivityContext.filterErrors):t.isFulfilled()?Bluebird.resolve(ActivityContext.filterErrors(t.value())):t}registerForErrors(){this.registeredForErrors=!0}persist(t){this.stateToPersist=t}call(t){this.callBranch=!0,this.forkBranch=!1,this.jumpBranch=t}fork(t){this.callBranch=!1,this.forkBranch=!0,this.jumpBranch=t}jump(t){this.callBranch=!1,this.forkBranch=!1,this.jumpBranch=t}hasBranch(t){var i=this.activity;const e=this.ambient.inspector;return e.isStep(i)&&void 0!==e.relate(i,t).peek()}emitExpressionEvaluationError(t,i){var e=this.activity.id,r=this.activity.inputs[t];return new ExpressionEvaluationError(e,t,r.source||r.code,i)}emitExpressionSyntaxError(t,i){var e=this.activity.id,r=this.activity.inputs[t];return new ExpressionSyntaxError(e,t,r.source||r.code,i)}emitExpressionAccessorError(t,i,e){return new ExpressionAccessorError(this.activity.id,t,i,e)}emitActivityBindingError(t){var i=this.activity;return new ActivityBindingError(i.id,i.action,t)}emitActivityActivationError(t,i){return new ActivityActivationError(this.activity.id,t,i)}emitActivityError(t){if(t instanceof ActivityError)return t;var i=this.activity;const e=new GenericActivityError(void 0,t?.message);return e.activityId=i.id,e.error=t,e}executeHandlerInline(i){if(0<i.length||this.cancellationToken.isFulfilled())return i;const e=this.extras;for(let t=0;t<e.length;t++)e[t]=Bluebird.resolve(e[t]).value();const r=this.inputs;for(const o in r){let t=Bluebird.resolve(r[o]).value();t instanceof PromiseWrapper&&(t=t.result),r[o]=t}const t=this.proxy,s=this.handler.value(),n=Bluebird.attempt(function(){return s.execute(r,t,...e)});return n.isPending()?n.then(t=>(this.outputs=t,i),t=>[this.emitActivityError(t)]):n.isRejected()?[this.emitActivityError(n.reason())]:(this.outputs=n.value(),i)}resolveExtrasInline(){for(const i of query(this.handler.value())){const t=this.ambient.engine.activator,e=t.activate(i);if(this.extras.push(e),e.isPending())return e.then(()=>{},t=>this.emitActivityActivationError(i.type,t));if(e.isRejected())return this.emitActivityActivationError(i.type,e.reason())}}resolveInputsInline(t){if(0<t.length||this.cancellationToken.isFulfilled())return t;const i=[];i.push(this.resolveExtrasInline());const e=this.evaluators;if(void 0!==e){const r=this.scope;for(const n in r)r[n]=Bluebird.resolve(r[n]).value();const s=this.inputs;for(const o in e){const c=s[o]=Bluebird.attempt(function(){var t=e[o].call(r,void 0,void 0);if(t&&"function"==typeof t.then){const i=new PromiseWrapper;return i.result=t,i}return t});c.isPending()&&i.push(c.then(()=>{},t=>this.emitExpressionEvaluationError(o,t))),c.isRejected()&&i.push(this.emitExpressionEvaluationError(o,c.reason()))}}return ActivityContext.reduceErrors(Bluebird.all(i))}resolveHandlerInline(){const i=this.activity.action;if("string"==typeof i){var e=this.ambient;const r=e.handlers;let t=this.handler=r[i];if(void 0===t){const s=e.engine,n=e.inspector;t=this.handler=r[i]=Bluebird.attempt(function(){return s.createHandler(i,n)})}return t.isPending()?t.then(t=>ActivityContext.isInvalidHandler(t)?this.emitActivityBindingError():void 0,t=>this.emitActivityBindingError(t)):t.isRejected()?this.emitActivityBindingError(t.reason()):ActivityContext.isInvalidHandler(t.value())?this.emitActivityBindingError():void 0}this.handler=Bluebird.resolve(echoHandler)}findContext(t){var i=this.ambient,e=i.stack;let r=i.frame;for(;void 0!==r;){var s=r.state[t];if(void 0!==s)return s;r=e[r.index-1]}}resolveOutputsInline(){const t=this.promise;if(t.isPending())return t.then(t=>void 0!==t&&0<t.length?Bluebird.reject(t):this.outputs,()=>{});if(t.isRejected())return Bluebird.resolve(void 0);var i=t.value();return void 0!==i&&0<i.length?Bluebird.reject(i):Bluebird.resolve(this.outputs)}resolveAccessorInline(i){const t=this.findContext(i);if(void 0!==t){const e=this.scope[i]=t.resolveOutputsInline();return e.isPending()?e.then(()=>{},t=>this.emitExpressionAccessorError(i,void 0,t)):e.isRejected()?this.emitExpressionAccessorError(i,void 0,e.reason()):void 0}const e=this.scope[i]=Bluebird.resolve(this.ambient.environment[i]);return e.isPending()?e.then(()=>{},t=>this.emitExpressionAccessorError(i,t)):e.isRejected()?this.emitExpressionAccessorError(i,e.reason()):void 0}resolveAssetsInline(){const e=[];e.push(this.resolveHandlerInline());var r=this.activity.inputs;if(null!=r){let t,i;const n=this.ambient;for(const o in r){const c=r[o];if(void 0!==c&&null!==c)if(isLiteral(c))this.inputs[o]=Bluebird.resolve(c);else if(isExpression(c)){void 0===t&&(this.scope=t={}),void 0===i&&(this.evaluators=i={});var s=c.accessors;if(Array.isArray(s))for(const l of s)"string"==typeof l&&void 0===t[l]&&e.push(this.resolveAccessorInline(l));const a=Bluebird.attempt(function(){return compileExpression(c,n.resources)});a.isFulfilled()?i[o]=a.value():e.push(this.emitExpressionSyntaxError(o,a.reason()))}else e.push(this.emitExpressionSyntaxError(o))}}return ActivityContext.reduceErrors(Bluebird.all(e))}concludeInline(t){return this.cancellationResolve(),t}generateMonikers(){const t=this.monikers;var i=this.activity;t.push("$"+i.id),"string"==typeof i.name&&t.push("$"+i.name);const e=i.action;"string"!=typeof e||1<(i=e.split(":")).length&&(0<(i=i[i.length-2]).length&&t.push("$$"+i))}marshalError(){var t=this.promise.value();return 1<t.length?new AggregateActivityError(this.activity.id,t):0<t.length?t[0]:void 0}execute(){let t=this.promise;const i=this.ambient;if(void 0!==t)return i.debug(i),i.halted||this.transferInline(),t;{if(t=this.resolveAssetsInline(),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.resolveInputsInline(t)):Bluebird.resolve(this.resolveInputsInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.executeHandlerInline(t)):Bluebird.resolve(this.executeHandlerInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.concludeInline(t)):Bluebird.resolve(this.concludeInline(t.value())),t.isRejected())return t;t.isPending()&&(t=t.catch(t=>i.fail(t)),t.then(()=>i.execute())),this.generateMonikers();const e=i.frame.state;for(const r of this.monikers)e[r]=this;return this.promise=t,Bluebird.resolve(void 0)}}goto(){}}export default ActivityContext;
1
+ import Bluebird from"bluebird";import{ExpressionEvaluationError,ExpressionSyntaxError,ExpressionAccessorError,ActivityBindingError,ActivityActivationError,ActivityError,GenericActivityError,AggregateActivityError}from"../Errors.js";import{query}from"../Hooks.js";import{isAccessor,isExpression,isLiteral}from"./util.js";const echoHandler={execute:t=>t},evaluators={};function compileExpression(t,i){const e=t.code;let r=evaluators[e];if(void 0===r){const i=[],s={};i.push('"use strict"; ');const n=t.accessors;if(Array.isArray(n))for(const t of n)isAccessor(t)&&!s[t]&&(i.push(`var ${t} = this.${t};`),s[t]=!0);i.push("return "),i.push(e),i.push(";"),r=evaluators[e]=new Function("resources","values",i.join(""))}return function(){return r.call(this,i,t.values)}}class PromiseWrapper{}class ActivityContext{constructor(){this.action="",this.activity={},this.ambient={},this.frame={},this.proxy={},this.passes=0,this.inputs={},this.outputs={},this.extras=[],this.monikers=[],this.evaluators={},this.scope={},this.cancellationToken={},this.cancellationResolve=()=>{}}static filterErrors(t){return t.filter(ActivityContext.isError)}static isError(t){return void 0!==t}static isInvalidHandler(t){return null==t||"function"!=typeof t.execute}static reduceErrors(t){return t.isPending()?t.then(ActivityContext.filterErrors):t.isFulfilled()?Bluebird.resolve(ActivityContext.filterErrors(t.value())):t}registerForErrors(){this.registeredForErrors=!0}persist(t){this.stateToPersist=t}call(t){this.callBranch=!0,this.forkBranch=!1,this.jumpBranch=t}fork(t){this.callBranch=!1,this.forkBranch=!0,this.jumpBranch=t}jump(t){this.callBranch=!1,this.forkBranch=!1,this.jumpBranch=t}hasBranch(t){const i=this.activity,e=this.ambient.inspector;return e.isStep(i)&&void 0!==e.relate(i,t).peek()}emitExpressionEvaluationError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionEvaluationError(e,t,r.source||r.code,i)}emitExpressionSyntaxError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionSyntaxError(e,t,r.source||r.code,i)}emitExpressionAccessorError(t,i,e){return new ExpressionAccessorError(this.activity.id,t,i,e)}emitActivityBindingError(t){const i=this.activity;return new ActivityBindingError(i.id,i.action,t)}emitActivityActivationError(t,i){return new ActivityActivationError(this.activity.id,t,i)}emitActivityError(t){if(t instanceof ActivityError)return t;const i=this.activity,e=new GenericActivityError(void 0,t?.message);return e.activityId=i.id,e.error=t,e}executeHandlerInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=this.extras;for(let t=0;t<i.length;t++)i[t]=Bluebird.resolve(i[t]).value();const e=this.inputs;for(const t in e){let i=Bluebird.resolve(e[t]).value();i instanceof PromiseWrapper&&(i=i.result),e[t]=i}const r=this.proxy,s=this.handler.value(),n=Bluebird.attempt(function(){return s.execute(e,r,...i)});return n.isPending()?n.then(i=>(this.outputs=i,t),t=>[this.emitActivityError(t)]):n.isRejected()?[this.emitActivityError(n.reason())]:(this.outputs=n.value(),t)}resolveExtrasInline(){const t=query(this.handler.value());for(const i of t){const t=this.ambient.engine.activator.activate(i);if(this.extras.push(t),t.isPending())return t.then(()=>{},t=>this.emitActivityActivationError(i.type,t));if(t.isRejected())return this.emitActivityActivationError(i.type,t.reason())}}resolveInputsInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=[];i.push(this.resolveExtrasInline());const e=this.evaluators;if(void 0!==e){const t=this.scope;for(const i in t)t[i]=Bluebird.resolve(t[i]).value();const r=this.inputs;for(const s in e){const n=r[s]=Bluebird.attempt(function(){const i=e[s].call(t,void 0,void 0);if(i&&"function"==typeof i.then){const t=new PromiseWrapper;return t.result=i,t}return i});n.isPending()&&i.push(n.then(()=>{},t=>this.emitExpressionEvaluationError(s,t))),n.isRejected()&&i.push(this.emitExpressionEvaluationError(s,n.reason()))}}return ActivityContext.reduceErrors(Bluebird.all(i))}resolveHandlerInline(){const t=this.activity.action;if("string"!=typeof t)this.handler=Bluebird.resolve(echoHandler);else{const i=this.ambient,e=i.handlers;let r=this.handler=e[t];if(void 0===r){const s=i.engine,n=i.inspector;r=this.handler=e[t]=Bluebird.attempt(function(){return s.createHandler(t,n)})}if(r.isPending())return r.then(t=>ActivityContext.isInvalidHandler(t)?this.emitActivityBindingError():void 0,t=>this.emitActivityBindingError(t));if(r.isRejected())return this.emitActivityBindingError(r.reason());if(ActivityContext.isInvalidHandler(r.value()))return this.emitActivityBindingError()}}findContext(t){const i=this.ambient,e=i.stack;let r=i.frame;for(;void 0!==r;){const i=r.state[t];if(void 0!==i)return i;r=e[r.index-1]}}resolveOutputsInline(){const t=this.promise;if(t.isPending())return t.then(t=>void 0!==t&&t.length>0?Bluebird.reject(t):this.outputs,()=>{});if(t.isRejected())return Bluebird.resolve(void 0);const i=t.value();return void 0!==i&&i.length>0?Bluebird.reject(i):Bluebird.resolve(this.outputs)}resolveAccessorInline(t){const i=this.findContext(t);if(void 0!==i){const e=this.scope[t]=i.resolveOutputsInline();return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,void 0,i)):e.isRejected()?this.emitExpressionAccessorError(t,void 0,e.reason()):void 0}const e=this.scope[t]=Bluebird.resolve(this.ambient.environment[t]);return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,i)):e.isRejected()?this.emitExpressionAccessorError(t,e.reason()):void 0}resolveAssetsInline(){const t=[];t.push(this.resolveHandlerInline());const i=this.activity.inputs;if(null!=i){let e,r;const s=this.ambient;for(const n in i){const o=i[n];if(null!=o)if(isLiteral(o))this.inputs[n]=Bluebird.resolve(o);else if(isExpression(o)){void 0===e&&(this.scope=e={}),void 0===r&&(this.evaluators=r={});const i=o.accessors;if(Array.isArray(i))for(const r of i)"string"==typeof r&&void 0===e[r]&&t.push(this.resolveAccessorInline(r));const c=Bluebird.attempt(function(){return compileExpression(o,s.resources)});c.isFulfilled()?r[n]=c.value():t.push(this.emitExpressionSyntaxError(n,c.reason()))}else t.push(this.emitExpressionSyntaxError(n))}}return ActivityContext.reduceErrors(Bluebird.all(t))}concludeInline(t){return this.cancellationResolve(),t}generateMonikers(){const t=this.monikers,i=this.activity;t.push("$"+i.id);"string"==typeof i.name&&t.push("$"+i.name);const e=i.action;if("string"==typeof e){const i=e.split(":");if(i.length>1){const e=i[i.length-2];e.length>0&&t.push("$$"+e)}}}marshalError(){const t=this.promise.value();return t.length>1?new AggregateActivityError(this.activity.id,t):t.length>0?t[0]:void 0}execute(){let t=this.promise;const i=this.ambient;if(void 0===t){if(t=this.resolveAssetsInline(),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.resolveInputsInline(t)):Bluebird.resolve(this.resolveInputsInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.executeHandlerInline(t)):Bluebird.resolve(this.executeHandlerInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.concludeInline(t)):Bluebird.resolve(this.concludeInline(t.value())),t.isRejected())return t;t.isPending()&&(t=t.catch(t=>i.fail(t)),t.then(()=>i.execute())),this.generateMonikers();const e=i.frame.state;for(const t of this.monikers)e[t]=this;return this.promise=t,Bluebird.resolve(void 0)}return i.debug(i),i.halted||this.transferInline(),t}goto(){}}export default ActivityContext;
@@ -1 +1 @@
1
- import{registerModuleName,importModule}from"./ModuleLoader.js";const activityCache={},modules={},formElementCache={};function getCachedFormElements(){return{...formElementCache}}const httpPrefix="http://",httpsPrefix="https://";function isHttp(t){return t.substring(0,httpPrefix.length)===httpPrefix||t.substring(0,httpsPrefix.length)===httpsPrefix}function importRef(t,e){if(isHttp(t)){var o=registerModuleName(t);return importModule(o+"/main",e,o)}return importModule(t+"main",e)}function exportIsFormElementRegistration(t){return!("object"!=typeof t||!t.component)}function exportIsActivity(t){if("function"!=typeof t)return!1;var e=t.prototype;return"object"==typeof e&&null!==e&&("function"==typeof e.execute&&("string"==typeof t.action&&"string"==typeof t.suite))}async function loadRef(t,e,o,r){var i=await importRef(e,{action:t,suite:o});if("object"==typeof i&&null!==i&&modules[e]!==i)for(const f in modules[e]=i){var n=i[f];exportIsActivity(n)?createRef(n.action,e,n.suite,r,n):exportIsFormElementRegistration(n)&&r(formElementCache[n.id]=n)}}function createRef(t,e,o,r,i){let n=activityCache[t];void 0===n&&(n=activityCache[t]=[]);for(const f of n)if(f.path===e&&f.suite===o)return void 0!==i&&(f.factory=i),f;const f={factory:i,path:e,suite:o};return n.push(f),void 0!==i?f.factory=i:f.promise=loadRef(t,e,o,r),f}async function resolveRef(t){for(const e of t)if(await e.promise,(e.promise=void 0)!==e.factory)return new e.factory}class ActivityLoader{constructor(){this.references=[]}create(f,c,t){if("string"==typeof f){let n;if(void 0!==t){const o=e(t.program.references);if(void 0!==o)return o}const o=e(this.references);return void 0!==o?o:void 0!==n?resolveRef(n):void 0;function e(t){for(const r of t){var e=r.path,o=r.suite;const i=createRef(f,e,o,c);if(void 0===n){if(void 0!==i.factory)return new i.factory;void 0!==i.promise&&(n=[i])}else n.push(i)}}}}}ActivityLoader.defaultReference={path:"@vertigis/workflow/activities/",suite:"gcx:wf:builtin"};export{getCachedFormElements,ActivityLoader};
1
+ import{registerModuleName,importModule}from"./ModuleLoader.js";const activityCache={},modules={},formElementCache={};export function getCachedFormElements(){return{...formElementCache}}const httpPrefix="http://",httpsPrefix="https://";function isHttp(t){return"http://"===t.substring(0,7)||"https://"===t.substring(0,8)}function importRef(t,e){if(isHttp(t)){const o=registerModuleName(t);return importModule(o+"/main",e,o)}return importModule(t+"main",e)}function exportIsFormElementRegistration(t){return!("object"!=typeof t||!t.component)}function exportIsActivity(t){if("function"!=typeof t)return!1;const e=t.prototype;return"object"==typeof e&&null!==e&&("function"==typeof e.execute&&("string"==typeof t.action&&"string"==typeof t.suite))}async function loadRef(t,e,o,i){const r=await importRef(e,{action:t,suite:o});if("object"==typeof r&&null!==r&&modules[e]!==r){modules[e]=r;for(const t in r){const o=r[t];exportIsActivity(o)?createRef(o.action,e,o.suite,i,o):exportIsFormElementRegistration(o)&&(formElementCache[o.id]=o,i(o))}}}function createRef(t,e,o,i,r){let n=activityCache[t];void 0===n&&(n=activityCache[t]=[]);for(const t of n)if(t.path===e&&t.suite===o)return void 0!==r&&(t.factory=r),t;const c={factory:r,path:e,suite:o};return n.push(c),void 0!==r?c.factory=r:c.promise=loadRef(t,e,o,i),c}async function resolveRef(t){for(const e of t)if(await e.promise,e.promise=void 0,void 0!==e.factory)return new e.factory}export class ActivityLoader{constructor(){this.references=[]}create(t,e,o){if("string"!=typeof t)return;let i;function r(o){for(const r of o){const o=r.path,n=r.suite,c=createRef(t,o,n,e);if(void 0===i){if(void 0!==c.factory)return new c.factory;void 0!==c.promise&&(i=[c])}else i.push(c)}}if(void 0!==o){const t=r(o.program.references);if(void 0!==t)return t}const n=r(this.references);return void 0!==n?n:void 0!==i?resolveRef(i):void 0}}ActivityLoader.defaultReference={path:"@vertigis/workflow/activities/",suite:"gcx:wf:builtin"};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{ActivityCancellationError,EngineRuntimeError}from"../Errors.js";import{Task}from"../Task.js";import ActivityContextProxy from"./ActivityContextProxy.js";import AsyncContext from"./AsyncContext.js";import MonikerFrame from"./MonikerFrame.js";import StepContext from"./StepContext.js";import TransitionContext from"./TransitionContext.js";import{newSymbol}from"./util.js";class AmbientState{constructor(){this.debug=()=>{},this.engine={},this.inspector={},this.id="",this.environment={},this.inputs={},this.outputs={},this.removeExternalEventHandler=t=>{},this.setExternalEventHandler=t=>{},this.frame=new MonikerFrame,this.queue=[],this.stack=[],this.handlers={},this.cancellationResolve=()=>{},this.cancellationToken={},this.completion={},this.resolveCompletion=()=>{},this.rejectCompletion=()=>{},this.scheduler={},this.proxy={},this.inline=!1,this.halted=!1}get activityContexts(){const t={};for(const e of[...this.stack,this.frame])for(const i in e.state)"$$"===i.substring(0,2)&&(t[i]=e.state[i]);return t}static createLinkedCancellationToken(t,e){const i=Task.race([new Task(e),t]),n=new AbortController;return i.signal=n.signal,i.finally(()=>n.abort()),i}break(){this.halted=!0}continue(){this.halted=!1,void 0!==this.scheduler&&!this.scheduler.isFulfilled()||(this.scheduler=Bluebird.resolve(void 0).then(()=>{this.execute()}))}execute(t){if(this.inline)return!1;this.inline=!0;try{void 0!==t&&t();const e=this.completion;for(;e.isPending();){if(this.halted)return!1;const i=this.frame.current.execute();if(i.isPending())break;i.isRejected()&&this.fail(i.reason())}}catch(t){this.fail(t)}finally{this.inline=!1}return!0}complete(t){this.completion.isPending()&&(this.cancellationResolve(),this.resolveCompletion(t||this.outputs))}reject(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(t||this.error))}fail(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new EngineRuntimeError(t)))}cancel(){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new ActivityCancellationError))}push(){const t=this.stack;t.push(this.frame);const e=this.frame=new MonikerFrame;return e.index=t.length,e}pop(t){const e=this.frame;if(void 0!==e){e.current=void 0;const n=e.cancellationResolve;void 0!==n&&n()}var i=this.frame=this.stack.pop();return void 0===i&&(void 0!==t?this.reject(t):this.complete()),i}call(){var t=this.frame;const e=this.push();e.cancellationToken=t.cancellationToken,e.state=t.state}fork(){const e=this.push();e.cancellationToken=AmbientState.createLinkedCancellationToken(this.cancellationToken,t=>e.cancellationResolve=t),e.state={}}bubble(t){let e=this.pop(t);for(;void 0!==e&&!e.current.registeredForErrors;)e=this.pop(t);var i;void 0!==e&&(i=e.current,this.start(i.activity,i,t))}next(){var t=this.queue.pop();void 0!==t?this.attempt(t):void 0!==(t=this.pop())&&(t=t.current,this.start(t.activity,t))}prepare(e,t,i){const n=e.frame=this.frame;if((n.current=e).luid=this.id+":"+e.activity.id,e.action=e.activity.action,e.ambient=this,e.id=newSymbol(),e.caught=i,e.cancellationToken=AmbientState.createLinkedCancellationToken(n.cancellationToken,t=>e.cancellationResolve=t),e.proxy=new ActivityContextProxy(e),void 0!==t){const s=e.recent=t.recent||(t.recent={});t=s.context||t;(s.context=e).passes=t.passes+1,e.stateToPersist=e.state=t.stateToPersist}else e.passes=0}attempt(t){const e=new TransitionContext;e.activity=t,e.branch=t.branch,this.prepare(e)}start(t,e,i){const n=new(t.async?AsyncContext:StepContext);n.activity=t,n.monikers.push("$"),this.prepare(n,e,i)}enqueue(t,e){const i=this.inspector;this.queue=i.relate(t,e).list(),this.next()}goto(t){for(var e=this.stack,i=t.index;e[i]===t;)this.pop();return t===this.frame}}export default AmbientState;
1
+ import Bluebird from"bluebird";import{ActivityCancellationError,EngineRuntimeError}from"../Errors.js";import{Task}from"../Task.js";import ActivityContextProxy from"./ActivityContextProxy.js";import AsyncContext from"./AsyncContext.js";import MonikerFrame from"./MonikerFrame.js";import StepContext from"./StepContext.js";import TransitionContext from"./TransitionContext.js";import{newSymbol}from"./util.js";class AmbientState{constructor(){this.debug=()=>{},this.engine={},this.inspector={},this.id="",this.environment={},this.inputs={},this.outputs={},this.removeExternalEventHandler=t=>{},this.setExternalEventHandler=t=>{},this.frame=new MonikerFrame,this.queue=[],this.stack=[],this.handlers={},this.cancellationResolve=()=>{},this.cancellationToken={},this.completion={},this.resolveCompletion=()=>{},this.rejectCompletion=()=>{},this.scheduler={},this.proxy={},this.inline=!1,this.halted=!1}get activityContexts(){const t={},e=[...this.stack,this.frame];for(const i of e)for(const e in i.state)"$$"===e.substring(0,2)&&(t[e]=i.state[e]);return t}static createLinkedCancellationToken(t,e){const i=Task.race([new Task(e),t]),n=new AbortController;return i.signal=n.signal,i.finally(()=>n.abort()),i}break(){this.halted=!0}continue(){this.halted=!1,(void 0===this.scheduler||this.scheduler.isFulfilled())&&(this.scheduler=Bluebird.resolve(void 0).then(()=>{this.execute()}))}execute(t){if(this.inline)return!1;this.inline=!0;try{void 0!==t&&t();const e=this.completion;for(;e.isPending();){if(this.halted)return!1;const t=this.frame.current.execute();if(t.isPending())break;t.isRejected()&&this.fail(t.reason())}}catch(t){this.fail(t)}finally{this.inline=!1}return!0}complete(t){this.completion.isPending()&&(this.cancellationResolve(),this.resolveCompletion(t||this.outputs))}reject(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(t||this.error))}fail(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new EngineRuntimeError(t)))}cancel(){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new ActivityCancellationError))}push(){const t=this.stack;t.push(this.frame);const e=this.frame=new MonikerFrame;return e.index=t.length,e}pop(t){const e=this.frame;if(void 0!==e){e.current=void 0;const t=e.cancellationResolve;void 0!==t&&t()}const i=this.frame=this.stack.pop();return void 0===i&&(void 0!==t?this.reject(t):this.complete()),i}call(){const t=this.frame,e=this.push();e.cancellationToken=t.cancellationToken,e.state=t.state}fork(){const t=this.push();t.cancellationToken=AmbientState.createLinkedCancellationToken(this.cancellationToken,e=>t.cancellationResolve=e),t.state={}}bubble(t){let e=this.pop(t);for(;void 0!==e&&!e.current.registeredForErrors;)e=this.pop(t);if(void 0!==e){const i=e.current;this.start(i.activity,i,t)}}next(){const t=this.queue.pop();if(void 0!==t)this.attempt(t);else{const t=this.pop();if(void 0!==t){const e=t.current;this.start(e.activity,e)}}}prepare(t,e,i){const n=t.frame=this.frame;if(n.current=t,t.luid=this.id+":"+t.activity.id,t.action=t.activity.action,t.ambient=this,t.id=newSymbol(),t.caught=i,t.cancellationToken=AmbientState.createLinkedCancellationToken(n.cancellationToken,e=>t.cancellationResolve=e),t.proxy=new ActivityContextProxy(t),void 0!==e){const i=t.recent=e.recent||(e.recent={}),n=i.context||e;i.context=t,t.passes=n.passes+1,t.stateToPersist=t.state=n.stateToPersist}else t.passes=0}attempt(t){const e=new TransitionContext;e.activity=t,e.branch=t.branch,this.prepare(e)}start(t,e,i){const n=t.async?new AsyncContext:new StepContext;n.activity=t,n.monikers.push("$"),this.prepare(n,e,i)}enqueue(t,e){const i=this.inspector;this.queue=i.relate(t,e).list(),this.next()}goto(t){const e=this.stack,i=t.index;for(;e[i]===t;)this.pop();return t===this.frame}}export default AmbientState;
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{Activator}from"../Activator.js";import{getStringsForProgram}from"../LanguageStringUtils.js";import{Task}from"../Task.js";import{ProgramInspector,canonicalizeLocale}from"../definition/ProgramInspector.js";import{getCachedFormElements}from"../execution/ActivityLoader.js";import{BuiltInFormElements}from"../forms/manifest.js";import{check as checkLicense}from"../licensing/LicenseChecker.js";import{run}from"./ProgramRunner.js";class Engine{constructor(e){this._getFormElementRegistration=e=>this.formElements[e],this._registerFormElement=e=>{var t,r=e["id"];this.formElements[r]?(t={...this.formElements[r],...e},this.formElements[r]=t):this.formElements[r]=e},this.activator=new Activator,this.environment={},this.trivia={getFormElementRegistration:this._getFormElementRegistration,registerFormElement:this._registerFormElement},this.factories=[],this.implementations={},this.formElements={...getCachedFormElements(),...BuiltInFormElements},this.appSkuCode=e}setExternalEventHandler(e){this.externalEventCallback=e}removeExternalEventHandler(e){e===this.externalEventCallback&&(this.externalEventCallback=void 0)}static buildOptions(e,t){(t={...t||{}}).locale=canonicalizeLocale(t.locale),t.locale||(t.locale=e.getDefaultLocale()),t.logLevel=t.logLevel||"log";var r=new Proxy({},{get(e,t){return t}});const n=getStringsForProgram(e,t);return t.environment={activities:r,encodeHtml:function(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""},getText:function(e){if("string"==typeof e&&"@"===e.charAt(0)){var t=e.slice(1);if(t in n)return n[t]}return e},strings:n,...t.environment||{}},t}createHandler(e,t){var r=this.implementations[e];if(void 0!==r){const i=Bluebird.resolve(r);return i.isFulfilled()?new(i.value()):i.then(function(e){return Bluebird.attempt(function(){return new e})})}for(const o of this.factories){var n=o.create(e,this._registerFormElement,t);if(void 0!==n)return n}}run(r,n){return Task.attempt(()=>{let e;r instanceof ProgramInspector?e=r:(e=new ProgramInspector,e.import(r)),checkLicense(e.program,this.appSkuCode),n=Engine.buildOptions(e,n);var t=e.resolveStart(n?n.start:void 0);return run(this,e,n,t)})}enqueueExternalEvent(e){this.externalEventCallback&&this.externalEventCallback(e)}}export{Engine};
1
+ import Bluebird from"bluebird";import{Activator}from"../Activator.js";import{getStringsForProgram}from"../LanguageStringUtils.js";import{Task}from"../Task.js";import{ProgramInspector,canonicalizeLocale}from"../definition/ProgramInspector.js";import{getCachedFormElements}from"../execution/ActivityLoader.js";import{BuiltInFormElements}from"../forms/manifest.js";import{check as checkLicense}from"../licensing/LicenseChecker.js";import{run}from"./ProgramRunner.js";export class Engine{constructor(e){this._getFormElementRegistration=e=>this.formElements[e],this._registerFormElement=e=>{const{id:t}=e;if(this.formElements[t]){const r={...this.formElements[t],...e};this.formElements[t]=r}else this.formElements[t]=e},this.activator=new Activator,this.environment={},this.trivia={getFormElementRegistration:this._getFormElementRegistration,registerFormElement:this._registerFormElement},this.factories=[],this.implementations={},this.formElements={...getCachedFormElements(),...BuiltInFormElements},this.appSkuCode=e}setExternalEventHandler(e){this.externalEventCallback=e}removeExternalEventHandler(e){e===this.externalEventCallback&&(this.externalEventCallback=void 0)}static buildOptions(e,t){(t={...t||{}}).locale=canonicalizeLocale(t.locale),t.locale||(t.locale=e.getDefaultLocale()),t.logLevel=t.logLevel||"log";const r=new Proxy({},{get:(e,t)=>t}),n=getStringsForProgram(e,t);return t.environment={activities:r,encodeHtml:function(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""},getText:function(e){if("string"==typeof e&&"@"===e.charAt(0)){const t=e.slice(1);if(t in n)return n[t]}return e},strings:n,...t.environment||{}},t}createHandler(e,t){const r=this.implementations[e];if(void 0!==r){const e=Bluebird.resolve(r);return e.isFulfilled()?new(e.value()):e.then(function(e){return Bluebird.attempt(function(){return new e})})}for(const r of this.factories){const n=r.create(e,this._registerFormElement,t);if(void 0!==n)return n}}run(e,t){return Task.attempt(()=>{let r;e instanceof ProgramInspector?r=e:(r=new ProgramInspector,r.import(e)),checkLicense(r.program,this.appSkuCode),t=Engine.buildOptions(r,t);const n=r.resolveStart(t?t.start:void 0);return run(this,r,t,n)})}enqueueExternalEvent(e){this.externalEventCallback&&this.externalEventCallback(e)}}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- import{Task}from"../Task.js";import*as Activities from"../activities/main.js";const global=new Function("return this")();function getRequireString(){return"require"}async function load(e,i,o){"function"!=typeof i&&(i=global[getRequireString()]);var t=new Task(function(t){i([e],function(e){t(e),"function"==typeof o&&o(e)})});return Task.race([t,new Task((e,t)=>setTimeout(t,9e4))])}"function"!=typeof global.Promise&&(global.Promise=Promise);let nextId=0;const moduleNames={};function registerModuleName(e){let t=moduleNames[e];if(void 0!==t)return t;t=`@vertigis/workflow/externals/ext-${nextId++}`;var i="/"===e[e.length-1]?e.substring(0,e.length-1):e;return global[getRequireString()]({map:{"*":{"@geocortex/workflow":"@vertigis/workflow"}},paths:{[t]:i}}),moduleNames[e]=t}async function importModule(e,t,i){let o;return o="@vertigis/workflow/activities/main"===e?Activities:await load(e),void 0!==o&&null!==o&&"function"==typeof o.main?o.main.call(global,load,t,i):o}export{registerModuleName,importModule};
1
+ import{Task}from"../Task.js";import*as Activities from"../activities/main.js";const global=new Function("return this")();function getRequireString(){return"require"}async function load(t,e,o){"function"!=typeof e&&(e=global[getRequireString()]);const i=new Task(function(i){e([t],function(t){i(t),"function"==typeof o&&o(t)})});return Task.race([i,new Task((t,e)=>setTimeout(e,9e4))])}"function"!=typeof global.Promise&&(global.Promise=Promise);let nextId=0;const moduleNames={};export function registerModuleName(t){let e=moduleNames[t];if(void 0!==e)return e;e="@vertigis/workflow/externals/ext-"+nextId++;const o="/"===t[t.length-1]?t.substring(0,t.length-1):t;return global[getRequireString()]({map:{"*":{"@geocortex/workflow":"@vertigis/workflow"}},paths:{[e]:o}}),moduleNames[t]=e}export async function importModule(t,e,o){let i;return i="@vertigis/workflow/activities/main"===t?Activities:await load(t),null!=i&&"function"==typeof i.main?await i.main.call(global,load,e,o):i}
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{GenericActivityError,ProgramStartError}from"../Errors.js";import{Task}from"../Task.js";import AmbientState from"./AmbientState.js";import AmbientStateProxy from"./AmbientStateProxy.js";import{isFunctionStep,newSymbol}from"./util.js";function combine(e,t){return{...e||{},...t||{}}}function run(i,o,a,c){const s=e=>{var t=o.findStep(e);if(!t)throw new GenericActivityError(void 0,`The workflow does not contain a step with the id ${e}.`);return t},l=()=>{const t=p.frame.current.action;return o.allReferences().filter(e=>void 0!==e.suite&&t.startsWith(e.suite)).peek()?.path},m=(e,t,n,r)=>{e=s(e);const i=s(t);if(!i.transitions.some(e=>"content"===e.branch||"try"===e.branch))throw new GenericActivityError(void 0,`The ${t} step is not a Container, Function, or Try Catch activity.`);n=`${r}$${n}`;u(e,i,n)},v=e=>{var t=p.frame.current.activity,n=s(e);if(!isFunctionStep(n))throw new GenericActivityError(void 0,`The target step ${e} is not a Function activity.`);u(t,n,"default")},u=(e,t,n)=>{var r=o.relate(e,n).peek();void 0!==r&&o.remove(r);const i=o.addTransition(e,t);i.branch=n},p=new AmbientState;return p.completion=new Bluebird((e,t)=>{p.resolveCompletion=e,p.rejectCompletion=t}),p.cancellationToken=new Task(e=>p.cancellationResolve=e),p.execute(function(){if(o.isStep(c)){a=a||{},p.engine=i,p.inspector=o,p.id=newSymbol(),p.debug=a.debug||(()=>{}),p.environment=combine(i.environment,a.environment),p.inputs=a.inputs||{},p.locale=a.locale,p.logLevel=a.logLevel,p.outputs={},p.printingServiceUrl=a.printingServiceUrl,p.removeExternalEventHandler=i.removeExternalEventHandler.bind(i),p.resources={forms:o.cacheForms()},p.setExternalEventHandler=i.setExternalEventHandler.bind(i),p.trivia=combine(i.trivia,a.trivia),p.trivia.getActivityPackUrl=l,p.trivia.setFormElementEvent=m,p.trivia.setFunctionTransition=v,p.proxy=new AmbientStateProxy(p);const t=p.trivia.isDescendantOf;t?p.trivia.isDescendantOf=e=>e===p.proxy||t(e):p.trivia.isDescendantOf=e=>e===p.proxy;const n=p.frame;n.index=0,n.cancellationToken=p.cancellationToken,n.state=a.state||{};var e=a.cancellationToken;if(null!=e){const r=Task.race([e,p.cancellationToken]);r.isPending()?(e=()=>p.cancel(),r.then(e,e)):p.cancel()}p.start(c)}else p.reject(new ProgramStartError)}),p.completion}export{run};
1
+ import Bluebird from"bluebird";import{GenericActivityError,ProgramStartError}from"../Errors.js";import{Task}from"../Task.js";import AmbientState from"./AmbientState.js";import AmbientStateProxy from"./AmbientStateProxy.js";import{isFunctionStep,newSymbol}from"./util.js";function combine(e,t){return{...e||{},...t||{}}}export function run(e,t,n,r){const i=e=>{const n=t.findStep(e);if(!n)throw new GenericActivityError(void 0,`The workflow does not contain a step with the id ${e}.`);return n},o=()=>{const e=l.frame.current.action,n=t.allReferences().filter(t=>void 0!==t.suite&&e.startsWith(t.suite)).peek();return n?.path},a=(e,t,n,r)=>{const o=i(e),a=i(t);if(!a.transitions.some(e=>"content"===e.branch||"try"===e.branch))throw new GenericActivityError(void 0,`The ${t} step is not a Container, Function, or Try Catch activity.`);s(o,a,`${r}$${n}`)},c=e=>{const t=l.frame.current.activity,n=i(e);if(!isFunctionStep(n))throw new GenericActivityError(void 0,`The target step ${e} is not a Function activity.`);s(t,n,"default")},s=(e,n,r)=>{const i=t.relate(e,r).peek();void 0!==i&&t.remove(i);t.addTransition(e,n).branch=r},l=new AmbientState;return l.completion=new Bluebird((e,t)=>{l.resolveCompletion=e,l.rejectCompletion=t}),l.cancellationToken=new Task(e=>l.cancellationResolve=e),l.execute(function(){if(t.isStep(r)){n=n||{},l.engine=e,l.inspector=t,l.id=newSymbol(),l.debug=n.debug||(()=>{}),l.environment=combine(e.environment,n.environment),l.inputs=n.inputs||{},l.locale=n.locale,l.logLevel=n.logLevel,l.outputs={},l.printingServiceUrl=n.printingServiceUrl,l.removeExternalEventHandler=e.removeExternalEventHandler.bind(e),l.resources={forms:t.cacheForms()},l.setExternalEventHandler=e.setExternalEventHandler.bind(e),l.trivia=combine(e.trivia,n.trivia),l.trivia.getActivityPackUrl=o,l.trivia.setFormElementEvent=a,l.trivia.setFunctionTransition=c,l.proxy=new AmbientStateProxy(l);const i=l.trivia.isDescendantOf;l.trivia.isDescendantOf=i?e=>e===l.proxy||i(e):e=>e===l.proxy;const s=l.frame;s.index=0,s.cancellationToken=l.cancellationToken,s.state=n.state||{};const m=n.cancellationToken;if(null!=m){const e=Task.race([m,l.cancellationToken]);if(e.isPending()){const t=()=>l.cancel();e.then(t,t)}else l.cancel()}l.start(r)}else l.reject(new ProgramStartError)}),l.completion}
@@ -1 +1 @@
1
- let guard=!0;function clearGuard(){guard=!1}class Proxy{get target(){}constructor(r){Object.defineProperty(this,"target",{get(){if(!1===guard)return guard=!0,r}})}}export default Proxy;export{clearGuard};
1
+ let guard=!0;export function clearGuard(){guard=!1}class Proxy{get target(){}constructor(r){Object.defineProperty(this,"target",{get(){if(!1===guard)return guard=!0,r}})}}export default Proxy;
@@ -1 +1 @@
1
- import ActivityContext from"./ActivityContext.js";class StepContext extends ActivityContext{transferInline(){const t=this.promise;if(t.isFulfilled()){const e=this.ambient;var i=this.marshalError();void 0!==i?e.bubble(i):this.repeat?e.start(this.activity,this):(this.callBranch&&e.call(),this.forkBranch&&e.fork(),e.enqueue(this.activity,this.jumpBranch))}}goto(){const t=this.frame,i=this.ambient;if(i.goto(t)){var e=this.recent;const s=void 0!==e?e.context:this;t.current=s,s.repeat=!0,i.halted=!1,i.execute()}}}export default StepContext;
1
+ import ActivityContext from"./ActivityContext.js";class StepContext extends ActivityContext{transferInline(){if(this.promise.isFulfilled()){const t=this.ambient,i=this.marshalError();void 0!==i?t.bubble(i):this.repeat?t.start(this.activity,this):(this.callBranch&&t.call(),this.forkBranch&&t.fork(),t.enqueue(this.activity,this.jumpBranch))}}goto(){const t=this.frame,i=this.ambient;if(i.goto(t)){const e=this.recent,s=void 0!==e?e.context:this;t.current=s,s.repeat=!0,i.halted=!1,i.execute()}}}export default StepContext;
@@ -1 +1 @@
1
- import ActivityContext from"./ActivityContext.js";import{isLiteral}from"./util.js";class TransitionContext extends ActivityContext{constructor(){super(...arguments),this.activity={}}test(){let t=void 0,i=void 0;var e=this.outputs;for(const o in e){if(void 0!==t&&void 0!==i)return!1;if(i=e[o],!isLiteral(i))return!1;if(void 0===t)t=i,i=void 0;else if(t!==i)return!1}return void 0===t||(void 0!==i||("boolean"==typeof t?t:"number"==typeof t?0<t:"string"==typeof t&&0<t.length))}transferInline(){const t=this.promise;if(t.isFulfilled()){const e=this.ambient;var i=this.marshalError();void 0!==i?e.bubble(i):this.test()?e.start(this.activity.target):e.next()}}}export default TransitionContext;
1
+ import ActivityContext from"./ActivityContext.js";import{isLiteral}from"./util.js";class TransitionContext extends ActivityContext{constructor(){super(...arguments),this.activity={}}test(){let t,i;const e=this.outputs;for(const o in e){if(void 0!==t&&void 0!==i)return!1;if(i=e[o],!isLiteral(i))return!1;if(void 0===t)t=i,i=void 0;else if(t!==i)return!1}return void 0===t||(void 0!==i||("boolean"==typeof t?t:"number"==typeof t?t>0:"string"==typeof t&&t.length>0))}transferInline(){if(this.promise.isFulfilled()){const t=this.ambient,i=this.marshalError();void 0!==i?t.bubble(i):this.test()?t.start(this.activity.target):t.next()}}}export default TransitionContext;
package/execution/util.js CHANGED
@@ -1 +1 @@
1
- const reservedIdentifiers=["Array","Date","Intl","JSON","Math","Object","Set","decodeURIComponent","document","encodeURIComponent","isNaN","parseFloat","parseInt","resources","values","window"];function isAccessor(t){return!("string"!=typeof t||t.length<1)&&(!(0<=t.indexOf("."))&&!reservedIdentifiers.some(e=>e===t))}function isExpression(e){var t=e.type;return null==t&&"string"==typeof e.code}function isLiteral(e){switch(typeof e){case"boolean":case"number":case"string":return!0}return!1}let nextSymbol,nextSymbolPrefix;function newSymbol(){return void 0!==nextSymbol&&1073741824<=nextSymbol&&(nextSymbol=void 0),void 0===nextSymbol&&(nextSymbol=0,nextSymbolPrefix=(new Date).valueOf()+":"),nextSymbolPrefix+nextSymbol++}const ActivityActions={FUNCTION:"gcx:wf:core::Subworkflow"};function isFunctionStep(e){return e?.action===ActivityActions.FUNCTION}export{isAccessor,isExpression,isLiteral,newSymbol,isFunctionStep};
1
+ const reservedIdentifiers=["Array","Date","Intl","JSON","Math","Object","Set","decodeURIComponent","document","encodeURIComponent","isNaN","parseFloat","parseInt","resources","values","window"];export function isAccessor(e){return!("string"!=typeof e||e.length<1)&&(!(e.indexOf(".")>=0)&&!reservedIdentifiers.some(t=>t===e))}export function isExpression(e){const t=e.type;return null==t&&"string"==typeof e.code}export function isLiteral(e){switch(typeof e){case"boolean":case"number":case"string":return!0}return!1}let nextSymbol,nextSymbolPrefix;export function newSymbol(){return void 0!==nextSymbol&&nextSymbol>=1073741824&&(nextSymbol=void 0),void 0===nextSymbol&&(nextSymbol=0,nextSymbolPrefix=(new Date).valueOf()+":"),nextSymbolPrefix+nextSymbol++}const ActivityActions={FUNCTION:"gcx:wf:core::Subworkflow"};export function isFunctionStep(e){return e?.action===ActivityActions.FUNCTION}
package/forms/Calendar.js CHANGED
@@ -1 +1 @@
1
- let nativeDefault;const markCleaner=/[\u200E\u200F]+/g,spaceCleaner=/\s+/g;function clean(e){return e.replace(markCleaner,"").replace(spaceCleaner," ")}function trim(e,t){var n=e.lastIndexOf(t);return 0<=n&&n===e.length-t.length?e.substring(0,e.length-t.length):e}class Calendar{coerceDate(e,t){e=clean(e);const n=new Date(e);return n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),n.setMilliseconds(t.getMilliseconds()),n}coerceTime(e,t){if((e=clean(e)).length<1)return new Date(NaN);var n=this.format(t,Calendar.dateFormat);const r=new Date(n+" "+e);return r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()),r.setDate(t.getDate()),r}format(e,t){const n=this.coerceIntoValue(e);if(t===Calendar.hourFormat){var r=clean(n.toLocaleTimeString("en",t));return trim(r," AM")!==r?trim(r," AM"):trim(r," PM")!==r?trim(r," PM"):r}if(t!==Calendar.ampmFormat)return t===Calendar.minuteFormat?n.getMinutes().toLocaleString(void 0,t):t===Calendar.timeFormat?0<e.getSeconds()?clean(n.toLocaleTimeString(void 0,Calendar.timeLongFormat)):clean(n.toLocaleTimeString(void 0,t)):t===Calendar.timeClockFormat?clean(n.toLocaleTimeString(void 0,t)):clean(n.toLocaleString(void 0,t));t=clean(n.toLocaleTimeString("en",t));return trim(t," AM")!==t?"AM":trim(t," PM")!==t?"PM":""}today(){const e=this.now();return e.setHours(12),e.setMinutes(0),e}now(){const e=new Date;return e.setSeconds(0),e.setMilliseconds(0),e}coerceIntoLocal(e){return this.coerceIntoValue(e)}coerceIntoValue(e){return e instanceof Date||"string"==typeof e?new Date(e):null!=e?new Date(e.valueOf()):new Date(NaN)}static useNative(){return void 0===nativeDefault&&(nativeDefault=new Calendar),nativeDefault}}Calendar.yearFormat={year:"numeric",toString:()=>"YYYY"},Calendar.monthFormat={month:"long",toString:()=>"MMM"},Calendar.monthYearFormat={month:"long",year:"numeric",toString:()=>"MMM YYYY"},Calendar.dayOfMonthFormat={day:"numeric",toString:()=>"D"},Calendar.dayOfWeekFormat={weekday:"short",toString:()=>"ddd"},Calendar.dateFormat={day:"numeric",month:"short",year:"numeric",toString:()=>"ll"},Calendar.hourFormat={hour:"numeric",toString:()=>"LT"},Calendar.ampmFormat={hour:"numeric",toString:()=>"LT"},Calendar.minuteFormat={maximumFractionDigits:0,minimumIntegerDigits:2,toString:()=>"mm"},Calendar.timeFormat={hour:"numeric",minute:"2-digit",toString:()=>"LT"},Calendar.timeLongFormat={hour:"numeric",minute:"2-digit",second:"2-digit",toString:()=>"LTS"},Calendar.timeClockFormat={hour:"numeric",minute:"2-digit",second:"2-digit",timeZoneName:"short",toString:()=>"LTS z"},Calendar.fractionalFormat={toString:()=>"~fff"},Calendar.fullFormat={toString:()=>"LL LTS ~fff z"};export{Calendar};
1
+ let nativeDefault;const markCleaner=/[\u200E\u200F]+/g,spaceCleaner=/\s+/g;function clean(e){return e.replace(markCleaner,"").replace(spaceCleaner," ")}function trim(e,t){const n=e.lastIndexOf(t);return n>=0&&n===e.length-t.length?e.substring(0,e.length-t.length):e}export class Calendar{coerceDate(e,t){e=clean(e);const n=new Date(e);return n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),n.setMilliseconds(t.getMilliseconds()),n}coerceTime(e,t){if((e=clean(e)).length<1)return new Date(NaN);const n=this.format(t,Calendar.dateFormat),r=new Date(n+" "+e);return r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()),r.setDate(t.getDate()),r}format(e,t){const n=this.coerceIntoValue(e);if(t===Calendar.hourFormat){const e=clean(n.toLocaleTimeString("en",t));return trim(e," AM")!==e?trim(e," AM"):trim(e," PM")!==e?trim(e," PM"):e}if(t===Calendar.ampmFormat){const e=clean(n.toLocaleTimeString("en",t));return trim(e," AM")!==e?"AM":trim(e," PM")!==e?"PM":""}return t===Calendar.minuteFormat?n.getMinutes().toLocaleString(void 0,t):t===Calendar.timeFormat?e.getSeconds()>0?clean(n.toLocaleTimeString(void 0,Calendar.timeLongFormat)):clean(n.toLocaleTimeString(void 0,t)):t===Calendar.timeClockFormat?clean(n.toLocaleTimeString(void 0,t)):clean(n.toLocaleString(void 0,t))}today(){const e=this.now();return e.setHours(12),e.setMinutes(0),e}now(){const e=new Date;return e.setSeconds(0),e.setMilliseconds(0),e}coerceIntoLocal(e){return this.coerceIntoValue(e)}coerceIntoValue(e){return e instanceof Date||"string"==typeof e?new Date(e):null!=e?new Date(e.valueOf()):new Date(NaN)}static useNative(){return void 0===nativeDefault&&(nativeDefault=new Calendar),nativeDefault}}Calendar.yearFormat={year:"numeric",toString:()=>"YYYY"},Calendar.monthFormat={month:"long",toString:()=>"MMM"},Calendar.monthYearFormat={month:"long",year:"numeric",toString:()=>"MMM YYYY"},Calendar.dayOfMonthFormat={day:"numeric",toString:()=>"D"},Calendar.dayOfWeekFormat={weekday:"short",toString:()=>"ddd"},Calendar.dateFormat={day:"numeric",month:"short",year:"numeric",toString:()=>"ll"},Calendar.hourFormat={hour:"numeric",toString:()=>"LT"},Calendar.ampmFormat={hour:"numeric",toString:()=>"LT"},Calendar.minuteFormat={maximumFractionDigits:0,minimumIntegerDigits:2,toString:()=>"mm"},Calendar.timeFormat={hour:"numeric",minute:"2-digit",toString:()=>"LT"},Calendar.timeLongFormat={hour:"numeric",minute:"2-digit",second:"2-digit",toString:()=>"LTS"},Calendar.timeClockFormat={hour:"numeric",minute:"2-digit",second:"2-digit",timeZoneName:"short",toString:()=>"LTS z"},Calendar.fractionalFormat={toString:()=>"~fff"},Calendar.fullFormat={toString:()=>"LL LTS ~fff z"};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";let current,callback,cancellationResolve,cancellationToken,delay,defer;function invoke(){if((delay=void 0)===defer){const e=callback;callback=void 0,e()}}let immediate;class ExclusiveTimer{get cancellationToken(){return current!==this?(void 0===immediate&&(immediate=Bluebird.resolve()),immediate):(void 0===cancellationToken&&(cancellationToken=new Bluebird(e=>cancellationResolve=e)),cancellationToken)}start(e,i){current!==this&&"function"==typeof i&&(void 0!==current&&current.reset(),current=this,callback=i,delay=setTimeout(invoke,e))}reset(){current===this&&(callback=void 0,(current=void 0)!==delay&&(clearTimeout(delay),delay=void 0),void 0!==defer&&(clearTimeout(defer),defer=void 0),void 0!==cancellationResolve&&(cancellationResolve(),cancellationResolve=void 0,cancellationToken=void 0))}resume(e){current===this&&(void 0!==callback&&("function"==typeof e&&(callback=e),void 0===delay&&(delay=setTimeout(invoke))),void 0!==defer&&(clearTimeout(defer),defer=void 0))}suspend(){current===this&&void 0===defer&&(defer=setTimeout(()=>this.reset()))}}export{ExclusiveTimer};
1
+ import Bluebird from"bluebird";let current,callback,cancellationResolve,cancellationToken,delay,defer,immediate;function invoke(){if(delay=void 0,void 0===defer){const e=callback;callback=void 0,e()}}export class ExclusiveTimer{get cancellationToken(){return current!==this?(void 0===immediate&&(immediate=Bluebird.resolve()),immediate):(void 0===cancellationToken&&(cancellationToken=new Bluebird(e=>cancellationResolve=e)),cancellationToken)}start(e,i){current!==this&&"function"==typeof i&&(void 0!==current&&current.reset(),current=this,callback=i,delay=setTimeout(invoke,e))}reset(){current===this&&(callback=void 0,current=void 0,void 0!==delay&&(clearTimeout(delay),delay=void 0),void 0!==defer&&(clearTimeout(defer),defer=void 0),void 0!==cancellationResolve&&(cancellationResolve(),cancellationResolve=void 0,cancellationToken=void 0))}resume(e){current===this&&(void 0!==callback&&("function"==typeof e&&(callback=e),void 0===delay&&(delay=setTimeout(invoke))),void 0!==defer&&(clearTimeout(defer),defer=void 0))}suspend(){current===this&&void 0===defer&&(defer=setTimeout(()=>this.reset()))}}
@@ -35,7 +35,7 @@ export declare class FormComponent extends Component<FormComponentProps, object>
35
35
  private get element();
36
36
  prepare(): defs.Element | undefined;
37
37
  render(): any;
38
- raiseEvent: <K extends keyof EventValueTypes>(eventName: K, eventValue: EventValueTypes[K], argument?: EventArgumentTypes[K] | undefined, item?: string, cancellationToken?: PromiseLike<void> | undefined) => void;
38
+ raiseEvent: <K extends keyof EventValueTypes>(eventName: K, eventValue: EventValueTypes[K], argument?: EventArgumentTypes[K], item?: string, cancellationToken?: PromiseLike<void> | undefined) => void;
39
39
  setProperty: FormElementProps<any>["setProperty"];
40
40
  setItemProperty: FormElementProps<any>["setItemProperty"];
41
41
  setValue: FormElementProps["setValue"];
@@ -1 +1 @@
1
- import{Component}from"react";import{makeId}from"./utils.js";class FormComponent extends Component{constructor(){super(...arguments),this.enabled=!1,this.raiseEvent=(e,t,s,n,o)=>this.props.host?.post(e,{name:this.props.name,value:t,argument:s,item:n,cancellationToken:o}),this.setProperty=(e,t,s=!0)=>{const n=this.props.host;var o=this.props.name;n.assignElementProperty(o,e,t,void 0,s)},this.setItemProperty=(e,t,s,n)=>{const o=this.props.host;var r=this.props.name;o.assignElementItemProperty(r,e,t,s,n)},this.setValue=(e,t=!0)=>this.setProperty("value",e,t)}get elementRegistration(){const e=this.props["host"];if(isFormRenderer(e))return e.getElementRegistration(this.element)}get element(){const{host:e,name:t}=this.props;if(t)return e.find(t)}prepare(){var e;void 0===this.id&&(this.id=makeId()),this.enabled=!0;const t=this.props.host;return!1===t.enabled&&(this.enabled=!1),void 0!==this.element&&(void 0!==(e=t.find(this.element.section))&&!1===e.enabled&&(this.enabled=!1),!1===this.element.enabled&&(this.enabled=!1)),this.element}render(){return this.props.host.renderVisual(this)}}class FormElementComponent extends FormComponent{componentDidMount(){const e=this.props;e.host.refs[e.name]=this}componentDidUpdate(){const e=this.props;e.host.refs[e.name]=this}componentWillUnmount(){const e=this.props;e.host.refs[e.name]=void 0}}function isFormRenderer(e){return!!e&&"function"==typeof e.getElementRegistration}export{FormComponent,FormElementComponent};
1
+ import{Component}from"react";import{makeId}from"./utils.js";export class FormComponent extends Component{constructor(){super(...arguments),this.enabled=!1,this.raiseEvent=(e,t,s,n,o)=>this.props.host?.post(e,{name:this.props.name,value:t,argument:s,item:n,cancellationToken:o}),this.setProperty=(e,t,s=!0)=>{const n=this.props.host,o=this.props.name;n.assignElementProperty(o,e,t,void 0,s)},this.setItemProperty=(e,t,s,n)=>{const o=this.props.host,i=this.props.name;o.assignElementItemProperty(i,e,t,s,n)},this.setValue=(e,t=!0)=>this.setProperty("value",e,t)}get elementRegistration(){const{host:e}=this.props;if(isFormRenderer(e))return e.getElementRegistration(this.element)}get element(){const{host:e,name:t}=this.props;if(t)return e.find(t)}prepare(){void 0===this.id&&(this.id=makeId()),this.enabled=!0;const e=this.props.host;if(!1===e.enabled&&(this.enabled=!1),void 0!==this.element){const t=e.find(this.element.section);void 0!==t&&!1===t.enabled&&(this.enabled=!1),!1===this.element.enabled&&(this.enabled=!1)}return this.element}render(){return this.props.host.renderVisual(this)}}export class FormElementComponent extends FormComponent{componentDidMount(){const e=this.props;e.host.refs[e.name]=this}componentDidUpdate(){const e=this.props;e.host.refs[e.name]=this}componentWillUnmount(){const e=this.props;e.host.refs[e.name]=void 0}}function isFormRenderer(e){return!!e&&"function"==typeof e.getElementRegistration}
@@ -231,7 +231,6 @@ export interface Size {
231
231
  /** The width. */
232
232
  width?: number;
233
233
  }
234
- export type SizePropertyName = keyof Size;
235
234
  /**
236
235
  * Defines a form.
237
236
  * @product This is intended for internal use only within VertiGIS Studio products.
@@ -365,11 +364,40 @@ export interface Element {
365
364
  /** Indicates how the control wraps text. */
366
365
  wrap?: "hard" | "soft" | "off";
367
366
  }
367
+ /** The style of border on an item. */
368
+ export type BorderStyle = "rounded" | "square";
369
+ /** The level of emphasis on an item. */
370
+ export type Emphasis = "low" | "medium" | "high";
371
+ /** The position of an item's icon relative to the text. */
372
+ export type IconPosition = "above" | "below" | "before" | "after";
373
+ /** The size of an item. */
374
+ export type ItemSize = "small" | "medium" | "large";
375
+ /** Details of the appearance of an item. */
376
+ export interface ItemAppearance {
377
+ /** The background color of the item. */
378
+ backgroundColor: string;
379
+ /** The style of the button. */
380
+ borderStyle?: BorderStyle;
381
+ /** The emphasis of the button. This affects border and colours. */
382
+ emphasis?: Emphasis | "custom";
383
+ /** The foreground color of the item. */
384
+ foregroundColor: string;
385
+ /** The name of the icon to be shown on this item. */
386
+ icon?: string;
387
+ /** Where the icon should be shown on this item, if {@link icon} is set. Default is "before". */
388
+ iconPosition?: IconPosition;
389
+ /** Set whether the item should show a border. */
390
+ showBorder: boolean;
391
+ /** The size of the button. */
392
+ size?: ItemSize;
393
+ }
368
394
  /**
369
395
  * Defines an ad hoc item.
370
396
  * @product This is intended for internal use only within VertiGIS Studio products.
371
397
  */
372
398
  export interface Item {
399
+ /** Settings controlling the appearance of the item. */
400
+ appearance?: ItemAppearance;
373
401
  /** Indicates the placement of the item. */
374
402
  index?: number;
375
403
  /** Indicates the label for the item. */
@@ -1 +1 @@
1
- const DEFAULT_SECTION_FORMAT="unstyled-section";var PreSelectionAction;!function(e){e[e.None=0]="None",e[e.RetrieveSuggestions=1]="RetrieveSuggestions",e[e.SelectFirstItem=2]="SelectFirstItem"}(PreSelectionAction=PreSelectionAction||{});export{DEFAULT_SECTION_FORMAT,PreSelectionAction};
1
+ export const DEFAULT_SECTION_FORMAT="unstyled-section";export var PreSelectionAction;!function(e){e[e.None=0]="None",e[e.RetrieveSuggestions=1]="RetrieveSuggestions",e[e.SelectFirstItem=2]="SelectFirstItem"}(PreSelectionAction||(PreSelectionAction={}));