@wise/dynamic-flow-client 3.28.7 → 3.28.8-experimental-44c10c9

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 (25) hide show
  1. package/build/main.js +434 -514
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +434 -514
  4. package/build/types/legacy/layout/button/utils.d.ts +1 -1
  5. package/build/types/revamp/domain/features/events.d.ts +1 -1
  6. package/build/types/revamp/domain/mappers/mapStepToComponent.d.ts +3 -1
  7. package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +1 -1
  8. package/build/types/revamp/renderers/mappers/allOfComponentToProps.d.ts +1 -1
  9. package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +2 -2
  10. package/build/types/revamp/renderers/mappers/decisionComponentToProps.d.ts +2 -2
  11. package/build/types/revamp/renderers/mappers/dividerComponentToProps.d.ts +1 -1
  12. package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +1 -1
  13. package/build/types/revamp/renderers/mappers/imageComponentToProps.d.ts +1 -1
  14. package/build/types/revamp/renderers/mappers/instructionsComponentToProps.d.ts +1 -1
  15. package/build/types/revamp/renderers/mappers/loadingIndicatorComponentToProps.d.ts +1 -1
  16. package/build/types/revamp/renderers/mappers/markdownComponentToProps.d.ts +1 -1
  17. package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +2 -2
  18. package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +1 -1
  19. package/build/types/revamp/renderers/mappers/reviewComponentToProps.d.ts +2 -2
  20. package/build/types/revamp/renderers/mappers/statusListComponentToProps.d.ts +2 -2
  21. package/build/types/revamp/renderers/mappers/tupleComponentToProps.d.ts +1 -1
  22. package/build/types/revamp/renderers/mappers/utils/pick.d.ts +1 -0
  23. package/build/types/revamp/renderers/stepComponentToProps.d.ts +1 -1
  24. package/build/types/revamp/types.d.ts +2 -0
  25. package/package.json +3 -3
package/build/main.js CHANGED
@@ -1611,8 +1611,6 @@ var mapControl = (control) => {
1611
1611
  case "primary":
1612
1612
  case "tertiary":
1613
1613
  return control;
1614
- case "minimal":
1615
- return "tertiary";
1616
1614
  default:
1617
1615
  return "secondary";
1618
1616
  }
@@ -3824,57 +3822,41 @@ var isStringSchema = (schema) => "type" in schema && schema.type === "string";
3824
3822
  var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.format === "base64url";
3825
3823
  var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish2(schema.persistAsync);
3826
3824
 
3825
+ // src/revamp/renderers/mappers/utils/pick.ts
3826
+ function pick(obj, ...keys) {
3827
+ const result = {};
3828
+ keys.forEach((key) => {
3829
+ result[key] = obj[key];
3830
+ });
3831
+ return result;
3832
+ }
3833
+
3827
3834
  // src/revamp/renderers/stepComponentToProps.ts
3828
- var stepComponentToProps = ({
3829
- back,
3830
- description,
3831
- error,
3832
- external,
3833
- loadingState,
3834
- step,
3835
- title,
3836
- onAction,
3837
- trackEvent
3838
- }, children) => ({
3839
- type: "step",
3840
- back,
3841
- description,
3842
- error,
3843
- external,
3844
- loadingState,
3845
- title,
3846
- trackEvent,
3847
- step,
3848
- onAction,
3835
+ var stepComponentToProps = (component, children) => __spreadProps(__spreadValues({
3836
+ type: "step"
3837
+ }, pick(
3838
+ component,
3839
+ "back",
3840
+ "description",
3841
+ "error",
3842
+ "external",
3843
+ "loadingState",
3844
+ "step",
3845
+ "title",
3846
+ "onAction",
3847
+ "trackEvent"
3848
+ )), {
3849
3849
  children
3850
3850
  });
3851
3851
 
3852
3852
  // src/revamp/renderers/mappers/alertComponentToProps.ts
3853
- var alertComponentToProps = ({
3854
- callToAction,
3855
- context,
3856
- control,
3857
- margin,
3858
- markdown
3859
- }) => ({
3860
- type: "alert",
3861
- callToAction,
3862
- context,
3863
- control,
3864
- margin,
3865
- markdown
3866
- });
3853
+ var alertComponentToProps = (component) => pick(component, "type", "callToAction", "context", "control", "margin", "markdown");
3867
3854
 
3868
3855
  // src/revamp/renderers/mappers/allOfComponentToProps.ts
3869
- var allOfComponentToProps = ({ control, description, help, icon, image, title }, children) => ({
3870
- type: "form-section",
3871
- children,
3872
- control,
3873
- description,
3874
- help,
3875
- icon,
3876
- image,
3877
- title
3856
+ var allOfComponentToProps = (component, children) => __spreadProps(__spreadValues({
3857
+ type: "form-section"
3858
+ }, pick(component, "control", "description", "help", "icon", "image", "title")), {
3859
+ children
3878
3860
  });
3879
3861
 
3880
3862
  // src/revamp/renderers/mappers/utils/mapErrorsToValidationState.ts
@@ -3951,22 +3933,25 @@ var booleanInputComponentToProps = (component) => {
3951
3933
  };
3952
3934
 
3953
3935
  // src/revamp/renderers/mappers/boxComponentToProps.ts
3954
- var boxComponentToProps = ({ border, control, width, margin }, children) => ({ type: "box", border, children, control, margin, width });
3936
+ var boxComponentToProps = (component, children) => __spreadProps(__spreadValues({}, pick(component, "type", "border", "control", "width", "margin")), {
3937
+ children
3938
+ });
3955
3939
 
3956
3940
  // src/revamp/renderers/mappers/buttonComponentToProps.ts
3957
3941
  var buttonComponentToProps = (component) => {
3958
- const { title, control, context, disabled, margin, pinOrder, size: size2, onClick } = component;
3959
- return {
3960
- type: "button",
3961
- title,
3962
- control,
3963
- context,
3964
- disabled,
3965
- margin,
3966
- pinOrder,
3967
- size: size2,
3968
- onClick
3969
- };
3942
+ return __spreadValues({
3943
+ type: "button"
3944
+ }, pick(
3945
+ component,
3946
+ "title",
3947
+ "control",
3948
+ "context",
3949
+ "disabled",
3950
+ "margin",
3951
+ "pinOrder",
3952
+ "size",
3953
+ "onClick"
3954
+ ));
3970
3955
  };
3971
3956
 
3972
3957
  // src/revamp/renderers/mappers/columnsComponentToProps.ts
@@ -3986,37 +3971,16 @@ var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({},
3986
3971
  });
3987
3972
 
3988
3973
  // src/revamp/renderers/mappers/decisionComponentToProps.ts
3989
- var decisionComponentToProps = ({
3990
- control,
3991
- options,
3992
- margin,
3993
- title
3994
- }) => ({ type: "decision", control, options, margin, title });
3974
+ var decisionComponentToProps = (component) => pick(component, "type", "control", "options", "margin", "title");
3995
3975
 
3996
3976
  // src/revamp/renderers/mappers/dividerComponentToProps.ts
3997
- var dividerComponentToProps = ({
3998
- control,
3999
- margin
4000
- }) => ({ type: "divider", control, margin });
3977
+ var dividerComponentToProps = (component) => pick(component, "type", "control", "margin");
4001
3978
 
4002
3979
  // src/revamp/renderers/mappers/formComponentToProps.ts
4003
3980
  var formComponentToProps = ({ control, margin }, children) => ({ type: "form", children, control, margin });
4004
3981
 
4005
3982
  // src/revamp/renderers/mappers/headingComponentToProps.ts
4006
- var headingComponentToProps = ({
4007
- align,
4008
- control,
4009
- margin,
4010
- size: size2,
4011
- text
4012
- }) => ({
4013
- type: "heading",
4014
- align,
4015
- control,
4016
- margin,
4017
- size: size2,
4018
- text
4019
- });
3983
+ var headingComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "size", "text");
4020
3984
 
4021
3985
  // src/revamp/renderers/mappers/hiddenComponentToProps.ts
4022
3986
  var hiddenComponentToProps = () => ({
@@ -4024,34 +3988,10 @@ var hiddenComponentToProps = () => ({
4024
3988
  });
4025
3989
 
4026
3990
  // src/revamp/renderers/mappers/imageComponentToProps.ts
4027
- var imageComponentToProps = ({
4028
- accessibilityDescription,
4029
- control,
4030
- margin,
4031
- size: size2,
4032
- url
4033
- }) => ({
4034
- type: "image",
4035
- accessibilityDescription,
4036
- control,
4037
- margin,
4038
- size: size2,
4039
- url
4040
- });
3991
+ var imageComponentToProps = (component) => pick(component, "type", "accessibilityDescription", "control", "margin", "size", "url");
4041
3992
 
4042
3993
  // src/revamp/renderers/mappers/instructionsComponentToProps.ts
4043
- var instructionsComponentToProps = ({
4044
- control,
4045
- items,
4046
- margin,
4047
- title
4048
- }) => ({
4049
- type: "instructions",
4050
- control,
4051
- items,
4052
- margin,
4053
- title
4054
- });
3994
+ var instructionsComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
4055
3995
 
4056
3996
  // src/revamp/renderers/mappers/integerInputComponentToProps.ts
4057
3997
  var integerInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-integer")), {
@@ -4061,30 +4001,10 @@ var integerInputComponentToProps = (component) => __spreadProps(__spreadValues({
4061
4001
  });
4062
4002
 
4063
4003
  // src/revamp/renderers/mappers/loadingIndicatorComponentToProps.ts
4064
- var loadingIndicatorComponentToProps = ({
4065
- control,
4066
- margin,
4067
- size: size2
4068
- }) => ({
4069
- type: "loading-indicator",
4070
- control,
4071
- margin,
4072
- size: size2
4073
- });
4004
+ var loadingIndicatorComponentToProps = (component) => pick(component, "type", "control", "margin", "size");
4074
4005
 
4075
4006
  // src/revamp/renderers/mappers/markdownComponentToProps.ts
4076
- var markdownComponentToProps = ({
4077
- align,
4078
- content,
4079
- control,
4080
- margin
4081
- }) => ({
4082
- type: "markdown",
4083
- align,
4084
- margin,
4085
- content,
4086
- control
4087
- });
4007
+ var markdownComponentToProps = (control) => pick(control, "type", "align", "margin", "content", "control");
4088
4008
 
4089
4009
  // src/revamp/renderers/mappers/modalComponentToProps.ts
4090
4010
  var modalComponentToProps = ({ content, control, margin, trigger }, components) => ({
@@ -4125,30 +4045,14 @@ var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}
4125
4045
  });
4126
4046
 
4127
4047
  // src/revamp/renderers/mappers/objectComponentToProps.ts
4128
- var objectComponentToProps = ({ control, description, help, icon, image, title }, children) => ({
4129
- type: "form-section",
4130
- children,
4131
- control,
4132
- description,
4133
- help,
4134
- icon,
4135
- image,
4136
- title
4048
+ var objectComponentToProps = (component, children) => __spreadProps(__spreadValues({
4049
+ type: "form-section"
4050
+ }, pick(component, "control", "description", "help", "icon", "image", "title")), {
4051
+ children
4137
4052
  });
4138
4053
 
4139
4054
  // src/revamp/renderers/mappers/paragraphComponentToProps.ts
4140
- var paragraphComponentToProps = ({
4141
- align,
4142
- control,
4143
- margin,
4144
- text
4145
- }) => ({
4146
- type: "paragraph",
4147
- align,
4148
- control,
4149
- margin,
4150
- text
4151
- });
4055
+ var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
4152
4056
 
4153
4057
  // src/revamp/renderers/mappers/repeatableComponentToProps.ts
4154
4058
  var repeatableComponentToProps = (component, children, editableItemChildren) => {
@@ -4206,20 +4110,7 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
4206
4110
  };
4207
4111
 
4208
4112
  // src/revamp/renderers/mappers/reviewComponentToProps.ts
4209
- var reviewComponentToProps = ({
4210
- callToAction,
4211
- control,
4212
- fields,
4213
- margin,
4214
- title
4215
- }) => ({
4216
- type: "review",
4217
- callToAction,
4218
- control,
4219
- fields,
4220
- margin,
4221
- title
4222
- });
4113
+ var reviewComponentToProps = (component) => pick(component, "type", "callToAction", "control", "fields", "margin", "title");
4223
4114
 
4224
4115
  // src/revamp/renderers/mappers/searchComponentToProps.ts
4225
4116
  var searchComponentToProps = (component) => {
@@ -4289,18 +4180,7 @@ var selectInputComponentToProps = (component, children) => {
4289
4180
  };
4290
4181
 
4291
4182
  // src/revamp/renderers/mappers/statusListComponentToProps.ts
4292
- var statusListComponentToProps = ({
4293
- control,
4294
- items,
4295
- margin,
4296
- title
4297
- }) => ({
4298
- type: "status-list",
4299
- control,
4300
- items,
4301
- margin,
4302
- title
4303
- });
4183
+ var statusListComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
4304
4184
 
4305
4185
  // src/revamp/renderers/mappers/textInputComponentToProps.ts
4306
4186
  var textInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-text")), {
@@ -4334,15 +4214,10 @@ var uploadInputComponentToProps = (component) => {
4334
4214
  };
4335
4215
 
4336
4216
  // src/revamp/renderers/mappers/tupleComponentToProps.ts
4337
- var tupleComponentToProps = ({ control, description, help, icon, image, title }, children) => ({
4338
- type: "form-section",
4339
- children,
4340
- control,
4341
- description,
4342
- help,
4343
- icon,
4344
- image,
4345
- title
4217
+ var tupleComponentToProps = (component, children) => __spreadProps(__spreadValues({
4218
+ type: "form-section"
4219
+ }, pick(component, "control", "description", "help", "icon", "image", "title")), {
4220
+ children
4346
4221
  });
4347
4222
 
4348
4223
  // src/revamp/renderers/mappers/componentToRendererProps.ts
@@ -8450,21 +8325,13 @@ var z = /* @__PURE__ */ Object.freeze({
8450
8325
  quotelessJson,
8451
8326
  ZodError
8452
8327
  });
8453
- var imageSchema = z.object({
8454
- text: z.string().optional(),
8455
- url: z.string(),
8456
- accessibilityDescription: z.string().optional()
8457
- });
8458
- var httpMethodSchema = z.union([
8459
- z.literal("GET"),
8460
- z.literal("POST"),
8461
- z.literal("PUT"),
8462
- z.literal("PATCH"),
8463
- z.literal("DELETE")
8328
+ var sizeSchema = z.union([
8329
+ z.literal("xs"),
8330
+ z.literal("sm"),
8331
+ z.literal("md"),
8332
+ z.literal("lg"),
8333
+ z.literal("xl")
8464
8334
  ]);
8465
- var iconNamedSchema = z.object({
8466
- name: z.string()
8467
- });
8468
8335
  var contextSchema = z.union([
8469
8336
  z.literal("positive"),
8470
8337
  z.literal("neutral"),
@@ -8475,18 +8342,107 @@ var contextSchema = z.union([
8475
8342
  z.literal("info"),
8476
8343
  z.literal("primary")
8477
8344
  ]);
8478
- var iconTextSchema = z.object({
8479
- text: z.string()
8480
- });
8481
- var sizeSchema = z.union([
8482
- z.literal("xs"),
8483
- z.literal("sm"),
8484
- z.literal("md"),
8485
- z.literal("lg"),
8486
- z.literal("xl")
8345
+ var columnsLayoutBiasSchema = z.union([
8346
+ z.literal("none"),
8347
+ z.literal("left"),
8348
+ z.literal("right")
8349
+ ]);
8350
+ var statusListLayoutStatusSchema = z.union([
8351
+ z.literal("not-done"),
8352
+ z.literal("pending"),
8353
+ z.literal("done")
8487
8354
  ]);
8488
8355
  var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
8489
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
8356
+ var formLayoutSchemaReferenceSchema = z.object({
8357
+ $ref: z.string()
8358
+ });
8359
+ var modalLayoutTriggerSchema = z.object({
8360
+ title: z.string()
8361
+ });
8362
+ var httpMethodSchema = z.union([
8363
+ z.literal("GET"),
8364
+ z.literal("POST"),
8365
+ z.literal("PUT"),
8366
+ z.literal("PATCH"),
8367
+ z.literal("DELETE")
8368
+ ]);
8369
+ var dividerLayoutSchema = z.object({
8370
+ type: z.literal("divider"),
8371
+ control: z.string().optional(),
8372
+ margin: sizeSchema.optional()
8373
+ });
8374
+ var listLayoutStatusSchema = z.union([
8375
+ z.literal("warning"),
8376
+ z.literal("neutral"),
8377
+ z.literal("positive")
8378
+ ]);
8379
+ var headingLayoutSchema = z.object({
8380
+ type: z.literal("heading"),
8381
+ text: z.string(),
8382
+ size: sizeSchema.optional(),
8383
+ align: alignSchema.optional(),
8384
+ control: z.string().optional(),
8385
+ margin: sizeSchema.optional()
8386
+ });
8387
+ var formLayoutSchema = z.object({
8388
+ type: z.literal("form"),
8389
+ schema: formLayoutSchemaReferenceSchema.optional(),
8390
+ schemaId: z.string(),
8391
+ control: z.string().optional(),
8392
+ margin: sizeSchema.optional()
8393
+ });
8394
+ var imageLayoutSchema = z.object({
8395
+ type: z.literal("image"),
8396
+ text: z.string().optional(),
8397
+ url: z.string(),
8398
+ size: sizeSchema.optional(),
8399
+ accessibilityDescription: z.string().optional(),
8400
+ control: z.string().optional(),
8401
+ margin: sizeSchema.optional()
8402
+ });
8403
+ var infoLayoutSchema = z.object({
8404
+ type: z.literal("info"),
8405
+ markdown: z.string(),
8406
+ align: alignSchema.optional(),
8407
+ control: z.string().optional(),
8408
+ margin: sizeSchema.optional()
8409
+ });
8410
+ var loadingIndicatorLayoutSchema = z.object({
8411
+ type: z.literal("loading-indicator"),
8412
+ size: sizeSchema.optional(),
8413
+ control: z.string().optional(),
8414
+ margin: sizeSchema.optional()
8415
+ });
8416
+ var paragraphLayoutSchema = z.object({
8417
+ type: z.literal("paragraph"),
8418
+ text: z.string(),
8419
+ align: alignSchema.optional(),
8420
+ control: z.string().optional(),
8421
+ margin: sizeSchema.optional()
8422
+ });
8423
+ var instructionsLayoutItemSchema = z.object({
8424
+ text: z.string(),
8425
+ context: contextSchema
8426
+ });
8427
+ var helpSchema = z.object({
8428
+ markdown: z.string()
8429
+ });
8430
+ var imageSchema = z.object({
8431
+ text: z.string().optional(),
8432
+ url: z.string(),
8433
+ accessibilityDescription: z.string().optional()
8434
+ });
8435
+ var summaryProviderSchema = z.object({
8436
+ providesTitle: z.boolean().optional(),
8437
+ providesDescription: z.boolean().optional(),
8438
+ providesIcon: z.boolean().optional(),
8439
+ providesImage: z.boolean().optional()
8440
+ });
8441
+ var validateAsyncSchema = z.object({
8442
+ param: z.string(),
8443
+ method: httpMethodSchema,
8444
+ url: z.string()
8445
+ });
8490
8446
  var autocompleteTokenSchema = z.union([
8491
8447
  z.literal("on"),
8492
8448
  z.literal("name"),
@@ -8552,106 +8508,14 @@ var autocompleteTokenSchema = z.union([
8552
8508
  z.literal("fax"),
8553
8509
  z.literal("pager")
8554
8510
  ]);
8555
- var loadingIndicatorLayoutSchema = z.object({
8556
- type: z.literal("loading-indicator"),
8557
- size: sizeSchema.optional(),
8558
- control: z.string().optional(),
8559
- margin: sizeSchema.optional()
8560
- });
8561
- var paragraphLayoutSchema = z.object({
8562
- type: z.literal("paragraph"),
8563
- text: z.string(),
8564
- align: alignSchema.optional(),
8565
- control: z.string().optional(),
8566
- margin: sizeSchema.optional()
8567
- });
8568
- var dividerLayoutSchema = z.object({
8569
- type: z.literal("divider"),
8570
- control: z.string().optional(),
8571
- margin: sizeSchema.optional()
8572
- });
8573
- var listLayoutStatusSchema = z.union([
8574
- z.literal("warning"),
8575
- z.literal("neutral"),
8576
- z.literal("positive")
8577
- ]);
8578
- var formLayoutSchemaReferenceSchema = z.object({
8579
- $ref: z.string()
8580
- });
8581
- var imageLayoutSchema = z.object({
8582
- type: z.literal("image"),
8583
- text: z.string().optional(),
8584
- url: z.string(),
8585
- size: sizeSchema.optional(),
8586
- accessibilityDescription: z.string().optional(),
8587
- control: z.string().optional(),
8588
- margin: sizeSchema.optional()
8589
- });
8590
- var statusListLayoutStatusSchema = z.union([
8591
- z.literal("not-done"),
8592
- z.literal("pending"),
8593
- z.literal("done")
8594
- ]);
8595
- var instructionsLayoutItemSchema = z.object({
8596
- text: z.string(),
8597
- context: contextSchema
8598
- });
8599
- var modalLayoutTriggerSchema = z.object({
8600
- title: z.string()
8601
- });
8602
- var searchLayoutSchema = z.object({
8603
- type: z.literal("search"),
8604
- title: z.string(),
8605
- method: httpMethodSchema,
8606
- url: z.string(),
8607
- param: z.string(),
8608
- emptyMessage: z.string().optional(),
8609
- control: z.string().optional(),
8610
- margin: sizeSchema.optional()
8611
- });
8612
- var infoLayoutSchema = z.object({
8613
- type: z.literal("info"),
8614
- markdown: z.string(),
8615
- align: alignSchema.optional(),
8616
- control: z.string().optional(),
8617
- margin: sizeSchema.optional()
8618
- });
8619
- var formLayoutSchema = z.object({
8620
- type: z.literal("form"),
8621
- schema: formLayoutSchemaReferenceSchema.optional(),
8622
- schemaId: z.string(),
8623
- control: z.string().optional(),
8624
- margin: sizeSchema.optional()
8625
- });
8626
- var headingLayoutSchema = z.object({
8627
- type: z.literal("heading"),
8628
- text: z.string(),
8629
- size: sizeSchema.optional(),
8630
- align: alignSchema.optional(),
8631
- control: z.string().optional(),
8632
- margin: sizeSchema.optional()
8633
- });
8634
- var markdownLayoutSchema = z.object({
8635
- type: z.literal("markdown"),
8636
- content: z.string(),
8637
- align: alignSchema.optional(),
8638
- control: z.string().optional(),
8639
- margin: sizeSchema.optional()
8640
- });
8641
- var columnsLayoutBiasSchema = z.union([
8642
- z.literal("none"),
8643
- z.literal("left"),
8644
- z.literal("right")
8511
+ var stringSchemaFormatSchema = z.union([
8512
+ z.literal("date"),
8513
+ z.literal("email"),
8514
+ z.literal("numeric"),
8515
+ z.literal("password"),
8516
+ z.literal("phone-number"),
8517
+ z.literal("base64url")
8645
8518
  ]);
8646
- var helpSchema = z.object({
8647
- markdown: z.string()
8648
- });
8649
- var searchSearchRequestSchema = z.object({
8650
- url: z.string(),
8651
- method: httpMethodSchema,
8652
- param: z.string(),
8653
- query: z.string()
8654
- });
8655
8519
  var jsonElementSchema = z.lazy(
8656
8520
  () => z.union([
8657
8521
  z.string(),
@@ -8661,6 +8525,7 @@ var jsonElementSchema = z.lazy(
8661
8525
  z.array(jsonElementSchema)
8662
8526
  ]).nullable()
8663
8527
  );
8528
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
8664
8529
  var externalSchema = z.object({
8665
8530
  url: z.string()
8666
8531
  });
@@ -8668,42 +8533,28 @@ var stepErrorSchema = z.object({
8668
8533
  error: z.string().optional(),
8669
8534
  validation: jsonElementSchema.optional()
8670
8535
  });
8671
- var stringSchemaFormatSchema = z.union([
8672
- z.literal("date"),
8673
- z.literal("email"),
8674
- z.literal("numeric"),
8675
- z.literal("password"),
8676
- z.literal("phone-number"),
8677
- z.literal("base64url")
8678
- ]);
8679
- var summarySummariserSchema = z.object({
8680
- defaultTitle: z.string().optional(),
8681
- defaultDescription: z.string().optional(),
8682
- defaultIcon: iconSchema.optional(),
8683
- defaultImage: imageLayoutSchema.optional(),
8684
- providesTitle: z.boolean().optional(),
8685
- providesDescription: z.boolean().optional(),
8686
- providesIcon: z.boolean().optional(),
8687
- providesImage: z.boolean().optional()
8536
+ var errorResponseBodySchema = z.object({
8537
+ refreshFormUrl: z.string().optional(),
8538
+ analytics: z.record(z.string()).optional(),
8539
+ error: z.string().optional(),
8540
+ validation: jsonElementSchema.optional(),
8541
+ refreshUrl: z.string().optional()
8688
8542
  });
8689
- var validateAsyncSchema = z.object({
8690
- param: z.string(),
8543
+ var searchSearchRequestSchema = z.object({
8544
+ url: z.string(),
8691
8545
  method: httpMethodSchema,
8692
- url: z.string()
8693
- });
8694
- var summaryProviderSchema = z.object({
8695
- providesTitle: z.boolean().optional(),
8696
- providesDescription: z.boolean().optional(),
8697
- providesIcon: z.boolean().optional(),
8698
- providesImage: z.boolean().optional()
8546
+ param: z.string(),
8547
+ query: z.string()
8699
8548
  });
8700
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
8701
8549
  var navigationStackBehaviorSchema = z.union([
8702
8550
  z.literal("default"),
8703
8551
  z.literal("remove-previous"),
8704
8552
  z.literal("remove-all"),
8705
8553
  z.literal("replace-current")
8706
8554
  ]);
8555
+ var linkSchema = z.object({
8556
+ url: z.string()
8557
+ });
8707
8558
  var actionTypeSchema = z.union([
8708
8559
  z.literal("primary"),
8709
8560
  z.literal("secondary"),
@@ -8711,9 +8562,11 @@ var actionTypeSchema = z.union([
8711
8562
  z.literal("positive"),
8712
8563
  z.literal("negative")
8713
8564
  ]);
8714
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
8715
- var linkSchema = z.object({
8716
- url: z.string()
8565
+ var iconNamedSchema = z.object({
8566
+ name: z.string()
8567
+ });
8568
+ var iconTextSchema = z.object({
8569
+ text: z.string()
8717
8570
  });
8718
8571
  var actionSchema = z.object({
8719
8572
  title: z.string().optional(),
@@ -8730,19 +8583,26 @@ var actionSchema = z.object({
8730
8583
  timeout: z.number().optional(),
8731
8584
  skipValidation: z.boolean().optional()
8732
8585
  });
8733
- var listLayoutItemSchema = z.object({
8586
+ var markdownLayoutSchema = z.object({
8587
+ type: z.literal("markdown"),
8588
+ content: z.string(),
8589
+ align: alignSchema.optional(),
8590
+ control: z.string().optional(),
8591
+ margin: sizeSchema.optional()
8592
+ });
8593
+ var searchLayoutSchema = z.object({
8594
+ type: z.literal("search"),
8734
8595
  title: z.string(),
8735
- description: z.string().optional(),
8736
- icon: iconSchema,
8737
- status: listLayoutStatusSchema.optional()
8596
+ method: httpMethodSchema,
8597
+ url: z.string(),
8598
+ param: z.string(),
8599
+ emptyMessage: z.string().optional(),
8600
+ control: z.string().optional(),
8601
+ margin: sizeSchema.optional()
8738
8602
  });
8739
- var decisionLayoutOptionSchema = z.object({
8740
- action: actionSchema,
8603
+ var reviewLayoutCallToActionSchema = z.object({
8741
8604
  title: z.string(),
8742
- description: z.string().optional(),
8743
- disabled: z.boolean().optional(),
8744
- icon: iconSchema.optional(),
8745
- image: imageLayoutSchema.optional()
8605
+ action: actionSchema
8746
8606
  });
8747
8607
  var instructionsLayoutSchema = z.object({
8748
8608
  type: z.literal("instructions"),
@@ -8751,27 +8611,39 @@ var instructionsLayoutSchema = z.object({
8751
8611
  control: z.string().optional(),
8752
8612
  margin: sizeSchema.optional()
8753
8613
  });
8614
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
8754
8615
  var behaviorSchema = z.object({
8755
8616
  action: actionSchema.optional(),
8756
8617
  link: linkSchema.optional()
8757
8618
  });
8758
- var buttonLayoutSchema = z.object({
8759
- type: z.literal("button"),
8760
- size: sizeSchema.optional(),
8761
- title: z.string().optional(),
8762
- action: actionSchema,
8763
- context: contextSchema.optional(),
8764
- disabled: z.boolean().optional(),
8765
- pinOrder: z.number().optional(),
8766
- control: z.string().optional(),
8767
- margin: sizeSchema.optional()
8768
- });
8769
8619
  var reviewLayoutFieldSchema = z.object({
8770
8620
  label: z.string(),
8771
8621
  value: z.string(),
8772
8622
  rawValue: z.string().optional(),
8773
8623
  help: helpSchema.optional()
8774
8624
  });
8625
+ var alertLayoutCallToActionSchema = z.object({
8626
+ title: z.string(),
8627
+ accessibilityDescription: z.string().optional(),
8628
+ behavior: behaviorSchema
8629
+ });
8630
+ var summarySummariserSchema = z.object({
8631
+ defaultTitle: z.string().optional(),
8632
+ defaultDescription: z.string().optional(),
8633
+ defaultIcon: iconSchema.optional(),
8634
+ defaultImage: imageLayoutSchema.optional(),
8635
+ providesTitle: z.boolean().optional(),
8636
+ providesDescription: z.boolean().optional(),
8637
+ providesIcon: z.boolean().optional(),
8638
+ providesImage: z.boolean().optional()
8639
+ });
8640
+ var linkHandlerSchema = z.object({
8641
+ regexPattern: z.string(),
8642
+ action: actionSchema
8643
+ });
8644
+ var actionResponseBodySchema = z.object({
8645
+ action: actionSchema
8646
+ });
8775
8647
  var searchResultSearchSchema = z.object({
8776
8648
  type: z.literal("search"),
8777
8649
  title: z.string(),
@@ -8782,25 +8654,11 @@ var searchResultSearchSchema = z.object({
8782
8654
  });
8783
8655
  var searchResultActionSchema = z.object({
8784
8656
  type: z.literal("action"),
8785
- title: z.string(),
8786
- description: z.string().optional(),
8787
- icon: iconSchema.optional(),
8788
- image: imageLayoutSchema.optional(),
8789
- value: actionSchema
8790
- });
8791
- var actionResponseBodySchema = z.object({
8792
- action: actionSchema
8793
- });
8794
- var errorResponseBodySchema = z.object({
8795
- refreshFormUrl: z.string().optional(),
8796
- analytics: z.record(z.string()).optional(),
8797
- error: z.string().optional(),
8798
- validation: jsonElementSchema.optional(),
8799
- refreshUrl: z.string().optional()
8800
- });
8801
- var linkHandlerSchema = z.object({
8802
- regexPattern: z.string(),
8803
- action: actionSchema
8657
+ title: z.string(),
8658
+ description: z.string().optional(),
8659
+ icon: iconSchema.optional(),
8660
+ image: imageLayoutSchema.optional(),
8661
+ value: actionSchema
8804
8662
  });
8805
8663
  var pollingOnErrorSchema = z.object({
8806
8664
  action: actionSchema
@@ -8809,33 +8667,33 @@ var navigationBackBehaviorSchema = z.object({
8809
8667
  title: z.string().optional(),
8810
8668
  action: actionSchema
8811
8669
  });
8812
- var reviewLayoutCallToActionSchema = z.object({
8813
- title: z.string(),
8814
- action: actionSchema
8815
- });
8816
- var alertLayoutCallToActionSchema = z.object({
8817
- title: z.string(),
8818
- accessibilityDescription: z.string().optional(),
8819
- behavior: behaviorSchema
8820
- });
8821
- var listLayoutSchema = z.object({
8822
- type: z.literal("list"),
8823
- items: z.array(listLayoutItemSchema),
8824
- title: z.string().optional(),
8825
- control: z.string().optional(),
8826
- margin: sizeSchema.optional()
8827
- });
8828
- var decisionLayoutSchema = z.object({
8829
- type: z.literal("decision"),
8670
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
8671
+ var buttonLayoutSchema = z.object({
8672
+ type: z.literal("button"),
8673
+ size: sizeSchema.optional(),
8830
8674
  title: z.string().optional(),
8831
- options: z.array(decisionLayoutOptionSchema),
8675
+ action: actionSchema,
8676
+ context: contextSchema.optional(),
8677
+ disabled: z.boolean().optional(),
8678
+ pinOrder: z.number().optional(),
8832
8679
  control: z.string().optional(),
8833
8680
  margin: sizeSchema.optional()
8834
8681
  });
8835
- var itemCallToActionSchema = z.object({
8682
+ var decisionLayoutOptionSchema = z.object({
8683
+ action: actionSchema,
8836
8684
  title: z.string(),
8837
- accessibilityDescription: z.string().optional(),
8838
- behavior: behaviorSchema
8685
+ description: z.string().optional(),
8686
+ disabled: z.boolean().optional(),
8687
+ icon: iconSchema.optional(),
8688
+ image: imageLayoutSchema.optional()
8689
+ });
8690
+ var alertLayoutSchema = z.object({
8691
+ type: z.literal("alert"),
8692
+ markdown: z.string(),
8693
+ context: contextSchema.optional(),
8694
+ control: z.string().optional(),
8695
+ margin: sizeSchema.optional(),
8696
+ callToAction: alertLayoutCallToActionSchema.optional()
8839
8697
  });
8840
8698
  var reviewLayoutSchema = z.object({
8841
8699
  type: z.literal("review"),
@@ -8847,27 +8705,16 @@ var reviewLayoutSchema = z.object({
8847
8705
  control: z.string().optional(),
8848
8706
  margin: sizeSchema.optional()
8849
8707
  });
8850
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
8851
- var pollingSchema = z.object({
8852
- url: z.string(),
8853
- interval: z.number().optional(),
8854
- delay: z.number().optional(),
8855
- timeout: z.number().optional(),
8856
- maxAttempts: z.number(),
8857
- onError: pollingOnErrorSchema
8858
- });
8859
- var navigationSchema = z.object({
8860
- backButton: navigationBackBehaviorSchema.optional(),
8861
- back: navigationBackBehaviorSchema.optional(),
8862
- stackBehavior: navigationStackBehaviorSchema.optional()
8708
+ var listLayoutItemSchema = z.object({
8709
+ title: z.string(),
8710
+ description: z.string().optional(),
8711
+ icon: iconSchema,
8712
+ status: listLayoutStatusSchema.optional()
8863
8713
  });
8864
- var alertLayoutSchema = z.object({
8865
- type: z.literal("alert"),
8866
- markdown: z.string(),
8867
- context: contextSchema.optional(),
8868
- control: z.string().optional(),
8869
- margin: sizeSchema.optional(),
8870
- callToAction: alertLayoutCallToActionSchema.optional()
8714
+ var itemCallToActionSchema = z.object({
8715
+ title: z.string(),
8716
+ accessibilityDescription: z.string().optional(),
8717
+ behavior: behaviorSchema
8871
8718
  });
8872
8719
  var statusListLayoutItemSchema = z.object({
8873
8720
  title: z.string(),
@@ -8876,9 +8723,6 @@ var statusListLayoutItemSchema = z.object({
8876
8723
  status: statusListLayoutStatusSchema.optional(),
8877
8724
  callToAction: itemCallToActionSchema.optional()
8878
8725
  });
8879
- var searchResponseBodySchema = z.object({
8880
- results: z.array(searchResultSchema)
8881
- });
8882
8726
  var blobSchemaSchema = z.object({
8883
8727
  type: z.literal("blob"),
8884
8728
  promoted: z.boolean().optional(),
@@ -8917,6 +8761,34 @@ var constSchemaSchema = z.object({
8917
8761
  analyticsId: z.string().optional(),
8918
8762
  disabled: z.boolean().optional()
8919
8763
  });
8764
+ var pollingSchema = z.object({
8765
+ url: z.string(),
8766
+ interval: z.number().optional(),
8767
+ delay: z.number().optional(),
8768
+ timeout: z.number().optional(),
8769
+ maxAttempts: z.number(),
8770
+ onError: pollingOnErrorSchema
8771
+ });
8772
+ var navigationSchema = z.object({
8773
+ backButton: navigationBackBehaviorSchema.optional(),
8774
+ back: navigationBackBehaviorSchema.optional(),
8775
+ stackBehavior: navigationStackBehaviorSchema.optional()
8776
+ });
8777
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
8778
+ var decisionLayoutSchema = z.object({
8779
+ type: z.literal("decision"),
8780
+ title: z.string().optional(),
8781
+ options: z.array(decisionLayoutOptionSchema),
8782
+ control: z.string().optional(),
8783
+ margin: sizeSchema.optional()
8784
+ });
8785
+ var listLayoutSchema = z.object({
8786
+ type: z.literal("list"),
8787
+ items: z.array(listLayoutItemSchema),
8788
+ title: z.string().optional(),
8789
+ control: z.string().optional(),
8790
+ margin: sizeSchema.optional()
8791
+ });
8920
8792
  var statusListLayoutSchema = z.object({
8921
8793
  type: z.literal("status-list"),
8922
8794
  items: z.array(statusListLayoutItemSchema),
@@ -8924,6 +8796,19 @@ var statusListLayoutSchema = z.object({
8924
8796
  control: z.string().optional(),
8925
8797
  margin: sizeSchema.optional()
8926
8798
  });
8799
+ var searchResponseBodySchema = z.object({
8800
+ results: z.array(searchResultSchema)
8801
+ });
8802
+ var columnsLayoutSchema = z.lazy(
8803
+ () => z.object({
8804
+ type: z.literal("columns"),
8805
+ left: z.array(layoutSchema),
8806
+ right: z.array(layoutSchema),
8807
+ bias: columnsLayoutBiasSchema.optional(),
8808
+ control: z.string().optional(),
8809
+ margin: sizeSchema.optional()
8810
+ })
8811
+ );
8927
8812
  var layoutSchema = z.lazy(
8928
8813
  () => z.union([
8929
8814
  alertLayoutSchema,
@@ -8947,26 +8832,6 @@ var layoutSchema = z.lazy(
8947
8832
  statusListLayoutSchema
8948
8833
  ])
8949
8834
  );
8950
- var boxLayoutSchema = z.lazy(
8951
- () => z.object({
8952
- type: z.literal("box"),
8953
- components: z.array(layoutSchema),
8954
- width: sizeSchema.optional(),
8955
- border: z.boolean().optional(),
8956
- control: z.string().optional(),
8957
- margin: sizeSchema.optional()
8958
- })
8959
- );
8960
- var columnsLayoutSchema = z.lazy(
8961
- () => z.object({
8962
- type: z.literal("columns"),
8963
- left: z.array(layoutSchema),
8964
- right: z.array(layoutSchema),
8965
- bias: columnsLayoutBiasSchema.optional(),
8966
- control: z.string().optional(),
8967
- margin: sizeSchema.optional()
8968
- })
8969
- );
8970
8835
  var modalLayoutSchema = z.lazy(
8971
8836
  () => z.object({
8972
8837
  type: z.literal("modal"),
@@ -8982,25 +8847,14 @@ var modalLayoutContentSchema = z.lazy(
8982
8847
  components: z.array(layoutSchema)
8983
8848
  })
8984
8849
  );
8985
- var stepSchema = z.lazy(
8850
+ var boxLayoutSchema = z.lazy(
8986
8851
  () => z.object({
8987
- key: z.string().optional(),
8988
- type: z.string().optional(),
8989
- actions: z.array(actionSchema).optional(),
8990
- refreshFormUrl: z.string().optional(),
8991
- id: z.string(),
8992
- title: z.string(),
8993
- schemas: z.array(schemaSchema),
8994
- layout: z.array(layoutSchema),
8995
- description: z.string().optional(),
8996
- model: jsonElementSchema.optional(),
8997
- external: externalSchema.optional(),
8998
- polling: pollingSchema.optional(),
8999
- linkHandlers: z.array(linkHandlerSchema).optional(),
9000
- analytics: z.record(z.string()).optional(),
9001
- errors: stepErrorSchema.optional(),
9002
- navigation: navigationSchema.optional(),
9003
- refreshUrl: z.string().optional()
8852
+ type: z.literal("box"),
8853
+ components: z.array(layoutSchema),
8854
+ width: sizeSchema.optional(),
8855
+ border: z.boolean().optional(),
8856
+ control: z.string().optional(),
8857
+ margin: sizeSchema.optional()
9004
8858
  })
9005
8859
  );
9006
8860
  var schemaSchema = z.lazy(
@@ -9226,17 +9080,21 @@ var stringSchemaSchema = z.lazy(
9226
9080
  help: helpSchema.optional()
9227
9081
  })
9228
9082
  );
9229
- var arraySchemaListSchema = z.lazy(
9083
+ var persistAsyncSchema = z.lazy(
9084
+ () => z.object({
9085
+ param: z.string(),
9086
+ idProperty: z.string(),
9087
+ schema: schemaSchema,
9088
+ url: z.string(),
9089
+ method: httpMethodSchema
9090
+ })
9091
+ );
9092
+ var arraySchemaTupleSchema = z.lazy(
9230
9093
  () => z.object({
9231
9094
  type: z.literal("array"),
9232
9095
  promoted: z.boolean().optional(),
9233
9096
  $id: z.string().optional(),
9234
- items: schemaSchema,
9235
- addItemTitle: z.string(),
9236
- editItemTitle: z.string(),
9237
- minItems: z.number().optional(),
9238
- maxItems: z.number().optional(),
9239
- placeholder: z.string().optional(),
9097
+ items: z.array(schemaSchema),
9240
9098
  title: z.string().optional(),
9241
9099
  description: z.string().optional(),
9242
9100
  control: z.string().optional(),
@@ -9244,30 +9102,24 @@ var arraySchemaListSchema = z.lazy(
9244
9102
  icon: iconSchema.optional(),
9245
9103
  image: imageSchema.optional(),
9246
9104
  keywords: z.array(z.string()).optional(),
9247
- summary: summarySummariserSchema.optional(),
9105
+ summary: summaryProviderSchema.optional(),
9248
9106
  analyticsId: z.string().optional(),
9249
9107
  persistAsync: persistAsyncSchema.optional(),
9250
9108
  validationAsync: validateAsyncSchema.optional(),
9251
- alert: alertLayoutSchema.optional(),
9252
- validationMessages: z.record(z.string()).optional(),
9253
- disabled: z.boolean().optional()
9254
- })
9255
- );
9256
- var persistAsyncSchema = z.lazy(
9257
- () => z.object({
9258
- param: z.string(),
9259
- idProperty: z.string(),
9260
- schema: schemaSchema,
9261
- url: z.string(),
9262
- method: httpMethodSchema
9109
+ alert: alertLayoutSchema.optional()
9263
9110
  })
9264
9111
  );
9265
- var arraySchemaTupleSchema = z.lazy(
9112
+ var arraySchemaListSchema = z.lazy(
9266
9113
  () => z.object({
9267
9114
  type: z.literal("array"),
9268
9115
  promoted: z.boolean().optional(),
9269
9116
  $id: z.string().optional(),
9270
- items: z.array(schemaSchema),
9117
+ items: schemaSchema,
9118
+ addItemTitle: z.string(),
9119
+ editItemTitle: z.string(),
9120
+ minItems: z.number().optional(),
9121
+ maxItems: z.number().optional(),
9122
+ placeholder: z.string().optional(),
9271
9123
  title: z.string().optional(),
9272
9124
  description: z.string().optional(),
9273
9125
  control: z.string().optional(),
@@ -9275,11 +9127,34 @@ var arraySchemaTupleSchema = z.lazy(
9275
9127
  icon: iconSchema.optional(),
9276
9128
  image: imageSchema.optional(),
9277
9129
  keywords: z.array(z.string()).optional(),
9278
- summary: summaryProviderSchema.optional(),
9130
+ summary: summarySummariserSchema.optional(),
9279
9131
  analyticsId: z.string().optional(),
9280
9132
  persistAsync: persistAsyncSchema.optional(),
9281
9133
  validationAsync: validateAsyncSchema.optional(),
9282
- alert: alertLayoutSchema.optional()
9134
+ alert: alertLayoutSchema.optional(),
9135
+ validationMessages: z.record(z.string()).optional(),
9136
+ disabled: z.boolean().optional()
9137
+ })
9138
+ );
9139
+ var stepSchema = z.lazy(
9140
+ () => z.object({
9141
+ key: z.string().optional(),
9142
+ type: z.string().optional(),
9143
+ actions: z.array(actionSchema).optional(),
9144
+ refreshFormUrl: z.string().optional(),
9145
+ id: z.string(),
9146
+ title: z.string(),
9147
+ schemas: z.array(schemaSchema),
9148
+ layout: z.array(layoutSchema),
9149
+ description: z.string().optional(),
9150
+ model: jsonElementSchema.optional(),
9151
+ external: externalSchema.optional(),
9152
+ polling: pollingSchema.optional(),
9153
+ linkHandlers: z.array(linkHandlerSchema).optional(),
9154
+ analytics: z.record(z.string()).optional(),
9155
+ errors: stepErrorSchema.optional(),
9156
+ navigation: navigationSchema.optional(),
9157
+ refreshUrl: z.string().optional()
9283
9158
  })
9284
9159
  );
9285
9160
  var validateStep = (step) => validate(step, stepSchema);
@@ -13200,24 +13075,22 @@ var mapStepToComponent = (_a) => {
13200
13075
  loadingState,
13201
13076
  displayStepTitle,
13202
13077
  trackEvent,
13203
- onPoll
13078
+ onPoll,
13079
+ onBack
13204
13080
  } = _b, restProps = __objRest(_b, [
13205
13081
  "loadingState",
13206
13082
  "displayStepTitle",
13207
13083
  "trackEvent",
13208
- "onPoll"
13084
+ "onPoll",
13085
+ "onBack"
13209
13086
  ]);
13210
- var _a2, _b2;
13087
+ var _a2, _b2, _c;
13211
13088
  const { step, updateComponent } = restProps;
13212
13089
  const { id, description, errors, external, key, layout = [], navigation, polling, title } = step;
13213
13090
  const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
13214
- const back = backNavigation ? {
13215
- title: backNavigation.title,
13216
- onClick: () => {
13217
- void restProps.onAction(__spreadProps(__spreadValues({}, backNavigation.action), { skipValidation: true }));
13218
- }
13219
- } : void 0;
13220
- const refreshUrl = (_b2 = step.refreshUrl) != null ? _b2 : step.refreshFormUrl;
13091
+ const backAction = onBack(backNavigation == null ? void 0 : backNavigation.action);
13092
+ const back = backAction ? { title: (_b2 = backNavigation == null ? void 0 : backNavigation.title) != null ? _b2 : "Back", onClick: backAction } : void 0;
13093
+ const refreshUrl = (_c = step.refreshUrl) != null ? _c : step.refreshFormUrl;
13221
13094
  const stepId = id || key;
13222
13095
  if (stepId === void 0) {
13223
13096
  throw new Error("Step must have an id or a key");
@@ -13694,8 +13567,9 @@ var executePoll = async (props) => {
13694
13567
 
13695
13568
  // src/revamp/useDynamicFlowCore.tsx
13696
13569
  function useDynamicFlowCore(props) {
13697
- const _a = props, { flowId, initialAction, initialStep, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "displayStepTitle"]);
13570
+ const _a = props, { flowId, initialAction, initialStep, displayStepTitle = true, nativeBack } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "displayStepTitle", "nativeBack"]);
13698
13571
  const httpClient = useStableCallback(rest.httpClient);
13572
+ const onCancellation = useStableCallback(rest.onCancellation);
13699
13573
  const onCompletion = useStableCallback(rest.onCompletion);
13700
13574
  const onValueChange = useStableCallback(props.onValueChange);
13701
13575
  const onLink = useStableCallback(props.onLink);
@@ -13707,8 +13581,9 @@ function useDynamicFlowCore(props) {
13707
13581
  () => getSchemaErrorMessageFunction(formatMessage, locale),
13708
13582
  [formatMessage, locale]
13709
13583
  );
13710
- const [stepComponent, setStepComponent] = (0, import_react17.useState)(null);
13584
+ const [stepStack, setStepStack] = (0, import_react17.useState)([]);
13711
13585
  const stepComponentRef = (0, import_react17.useRef)(null);
13586
+ const initialisedRef = (0, import_react17.useRef)(false);
13712
13587
  const stepRef = (0, import_react17.useRef)(initialStep != null ? initialStep : null);
13713
13588
  const etagRef = (0, import_react17.useRef)(null);
13714
13589
  const abortControllerRef = (0, import_react17.useRef)(new AbortController());
@@ -13718,18 +13593,48 @@ function useDynamicFlowCore(props) {
13718
13593
  return abortControllerRef.current.signal;
13719
13594
  };
13720
13595
  (0, import_react17.useEffect)(() => {
13596
+ if (initialisedRef.current) {
13597
+ return;
13598
+ }
13599
+ initialisedRef.current = true;
13721
13600
  trackCoreEvent("Initiated");
13722
13601
  if (!initialStep && initialAction) {
13723
13602
  void onAction(__spreadValues({ method: "GET" }, initialAction));
13724
13603
  }
13725
13604
  if (initialStep && !initialAction) {
13726
- initialiseWithStep(initialStep, null);
13605
+ initialiseWithStep(initialStep, null, true);
13727
13606
  trackCoreEvent("Step Shown", { isFirstStep: true });
13728
13607
  }
13729
13608
  }, []);
13609
+ const onBack = (action) => {
13610
+ if (action) {
13611
+ return () => {
13612
+ onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true })).then(() => {
13613
+ setStepStack((value) => {
13614
+ const newStepStack = [...value.slice(0, -1), ...value.slice(-1)];
13615
+ stepComponentRef.current = newStepStack[newStepStack.length - 1];
13616
+ return newStepStack;
13617
+ });
13618
+ }).catch(() => {
13619
+ });
13620
+ };
13621
+ }
13622
+ if (nativeBack) {
13623
+ return () => setStepStack((value) => {
13624
+ const newStepComponent = value.slice(0, -1);
13625
+ stepComponentRef.current = newStepComponent[newStepComponent.length - 1];
13626
+ if (value.length === 1) {
13627
+ onCancellation();
13628
+ trackCoreEvent("Cancelled");
13629
+ return [];
13630
+ }
13631
+ return newStepComponent;
13632
+ });
13633
+ }
13634
+ };
13730
13635
  const initialiseWithStep = (0, import_react17.useCallback)(
13731
- (newStep, etag) => {
13732
- var _a2, _b, _c;
13636
+ (newStep, etag, isNewStep = false) => {
13637
+ var _a2, _b, _c, _d, _e;
13733
13638
  (_a2 = stepComponentRef.current) == null ? void 0 : _a2.stop();
13734
13639
  stepRef.current = newStep;
13735
13640
  etagRef.current = etag;
@@ -13741,16 +13646,16 @@ function useDynamicFlowCore(props) {
13741
13646
  const currentStepComponent = stepComponentRef.current;
13742
13647
  if (currentStepComponent) {
13743
13648
  update(findComponent([currentStepComponent], id));
13744
- setStepComponent(() => {
13745
- const newStepDomainComponent = __spreadValues({}, currentStepComponent);
13746
- stepComponentRef.current = newStepDomainComponent;
13747
- return newStepDomainComponent;
13649
+ setStepStack((value) => {
13650
+ stepComponentRef.current = currentStepComponent;
13651
+ return [...value];
13748
13652
  });
13749
13653
  }
13750
13654
  };
13751
13655
  try {
13656
+ const { stackBehavior = void 0 } = (_b = newStep.navigation) != null ? _b : {};
13752
13657
  const newStepComponent = mapStepToComponent({
13753
- stepLocalValue: (_c = (_b = stepComponentRef.current) == null ? void 0 : _b.getLocalValue()) != null ? _c : null,
13658
+ stepLocalValue: (_d = (_c = stepComponentRef.current) == null ? void 0 : _c.getLocalValue()) != null ? _d : null,
13754
13659
  step: newStep,
13755
13660
  displayStepTitle,
13756
13661
  loadingState: "idle",
@@ -13763,11 +13668,29 @@ function useDynamicFlowCore(props) {
13763
13668
  onRefresh,
13764
13669
  onPoll,
13765
13670
  onLink,
13766
- onValueChange
13671
+ onValueChange,
13672
+ onBack
13767
13673
  });
13768
- setStepComponent(() => {
13674
+ const getStack = (current) => {
13675
+ if (!isNewStep) {
13676
+ return current.slice(0, -1);
13677
+ }
13678
+ switch (stackBehavior) {
13679
+ case "remove-all":
13680
+ return [];
13681
+ case "remove-previous":
13682
+ return current.slice(0, -1);
13683
+ case "replace-current":
13684
+ return current.slice(0, -1);
13685
+ case "default":
13686
+ default:
13687
+ return current;
13688
+ }
13689
+ };
13690
+ (_e = stepComponentRef == null ? void 0 : stepComponentRef.current) == null ? void 0 : _e.setLoadingState("idle");
13691
+ setStepStack((value) => {
13769
13692
  stepComponentRef.current = newStepComponent;
13770
- return newStepComponent;
13693
+ return [...getStack(value), newStepComponent];
13771
13694
  });
13772
13695
  } catch (error) {
13773
13696
  closeWithError(error);
@@ -13835,7 +13758,7 @@ function useDynamicFlowCore(props) {
13835
13758
  }
13836
13759
  case "replace-step": {
13837
13760
  const isFirstStep = stepRef.current === null;
13838
- initialiseWithStep(command.step, command.etag);
13761
+ initialiseWithStep(command.step, command.etag, true);
13839
13762
  trackCoreEvent("Step Shown", { isFirstStep });
13840
13763
  break;
13841
13764
  }
@@ -15567,9 +15490,6 @@ var priorities = {
15567
15490
  };
15568
15491
  var getButtonPriority = (control, action) => {
15569
15492
  const actionType = action ? action.type : void 0;
15570
- if (control === "minimal") {
15571
- return "tertiary";
15572
- }
15573
15493
  return control != null ? control : actionType ? priorities[actionType] : "secondary";
15574
15494
  };
15575
15495
  var contextToType = {