@wise/dynamic-flow-client 4.0.2 → 4.1.0-experimental-6bb6f02

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.
package/build/main.js CHANGED
@@ -5427,11 +5427,37 @@ var z = /* @__PURE__ */ Object.freeze({
5427
5427
  quotelessJson,
5428
5428
  ZodError
5429
5429
  });
5430
- var imageSchema = z.object({
5431
- text: z.string().optional(),
5432
- url: z.string().optional(),
5433
- uri: z.string().optional(),
5434
- accessibilityDescription: z.string().optional()
5430
+ var linkBehaviorSchema = z.object({
5431
+ type: z.literal("link"),
5432
+ url: z.string()
5433
+ });
5434
+ var navigationStackBehaviorSchema = z.union([
5435
+ z.literal("default"),
5436
+ z.literal("remove-previous"),
5437
+ z.literal("remove-all"),
5438
+ z.literal("replace-current")
5439
+ ]);
5440
+ var jsonElementSchema = z.lazy(
5441
+ () => z.union([
5442
+ z.string(),
5443
+ z.number(),
5444
+ z.boolean(),
5445
+ z.record(jsonElementSchema),
5446
+ z.array(jsonElementSchema)
5447
+ ]).nullable()
5448
+ );
5449
+ var helpSchema = z.object({
5450
+ markdown: z.string()
5451
+ });
5452
+ var actionTypeSchema = z.union([
5453
+ z.literal("primary"),
5454
+ z.literal("secondary"),
5455
+ z.literal("link"),
5456
+ z.literal("positive"),
5457
+ z.literal("negative")
5458
+ ]);
5459
+ var linkSchema = z.object({
5460
+ url: z.string()
5435
5461
  });
5436
5462
  var httpMethodSchema = z.union([
5437
5463
  z.literal("GET"),
@@ -5440,8 +5466,54 @@ var httpMethodSchema = z.union([
5440
5466
  z.literal("PATCH"),
5441
5467
  z.literal("DELETE")
5442
5468
  ]);
5443
- var iconNamedSchema = z.object({
5444
- name: z.string()
5469
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
5470
+ var validateAsyncSchema = z.object({
5471
+ param: z.string(),
5472
+ method: httpMethodSchema,
5473
+ url: z.string()
5474
+ });
5475
+ var summaryProviderSchema = z.object({
5476
+ providesTitle: z.boolean().optional(),
5477
+ providesDescription: z.boolean().optional(),
5478
+ providesIcon: z.boolean().optional(),
5479
+ providesImage: z.boolean().optional()
5480
+ });
5481
+ var imageSchema = z.object({
5482
+ text: z.string().optional(),
5483
+ url: z.string().optional(),
5484
+ uri: z.string().optional(),
5485
+ accessibilityDescription: z.string().optional()
5486
+ });
5487
+ var externalSchema = z.object({
5488
+ url: z.string()
5489
+ });
5490
+ var columnsLayoutBiasSchema = z.union([
5491
+ z.literal("none"),
5492
+ z.literal("left"),
5493
+ z.literal("right")
5494
+ ]);
5495
+ var sizeSchema = z.union([
5496
+ z.literal("xs"),
5497
+ z.literal("sm"),
5498
+ z.literal("md"),
5499
+ z.literal("lg"),
5500
+ z.literal("xl")
5501
+ ]);
5502
+ var dividerLayoutSchema = z.object({
5503
+ type: z.literal("divider"),
5504
+ control: z.string().optional(),
5505
+ margin: sizeSchema.optional()
5506
+ });
5507
+ var statusListLayoutStatusSchema = z.union([
5508
+ z.literal("not-done"),
5509
+ z.literal("pending"),
5510
+ z.literal("done")
5511
+ ]);
5512
+ var loadingIndicatorLayoutSchema = z.object({
5513
+ type: z.literal("loading-indicator"),
5514
+ size: sizeSchema.optional(),
5515
+ control: z.string().optional(),
5516
+ margin: sizeSchema.optional()
5445
5517
  });
5446
5518
  var contextSchema = z.union([
5447
5519
  z.literal("positive"),
@@ -5453,24 +5525,92 @@ var contextSchema = z.union([
5453
5525
  z.literal("info"),
5454
5526
  z.literal("primary")
5455
5527
  ]);
5456
- var iconTextSchema = z.object({
5457
- text: z.string()
5528
+ var instructionsLayoutItemSchema = z.object({
5529
+ text: z.string(),
5530
+ context: contextSchema,
5531
+ tag: z.string().optional()
5532
+ });
5533
+ var formLayoutSchemaReferenceSchema = z.object({
5534
+ $ref: z.string()
5535
+ });
5536
+ var modalLayoutTriggerSchema = z.object({
5537
+ title: z.string()
5538
+ });
5539
+ var instructionsLayoutSchema = z.object({
5540
+ type: z.literal("instructions"),
5541
+ title: z.string().optional(),
5542
+ items: z.array(instructionsLayoutItemSchema),
5543
+ control: z.string().optional(),
5544
+ margin: sizeSchema.optional()
5545
+ });
5546
+ var reviewLayoutFieldSchema = z.object({
5547
+ label: z.string(),
5548
+ value: z.string(),
5549
+ rawValue: z.string().optional(),
5550
+ help: helpSchema.optional(),
5551
+ tag: z.string().optional()
5458
5552
  });
5459
- var sizeSchema = z.union([
5460
- z.literal("xs"),
5461
- z.literal("sm"),
5462
- z.literal("md"),
5463
- z.literal("lg"),
5464
- z.literal("xl")
5465
- ]);
5466
- var autocapitalizationTypeSchema = z.union([
5467
- z.literal("none"),
5468
- z.literal("characters"),
5469
- z.literal("sentences"),
5470
- z.literal("words")
5471
- ]);
5472
5553
  var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
5473
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
5554
+ var searchLayoutSchema = z.object({
5555
+ type: z.literal("search"),
5556
+ title: z.string(),
5557
+ method: httpMethodSchema,
5558
+ url: z.string(),
5559
+ param: z.string(),
5560
+ emptyMessage: z.string().optional(),
5561
+ control: z.string().optional(),
5562
+ margin: sizeSchema.optional()
5563
+ });
5564
+ var headingLayoutSchema = z.object({
5565
+ type: z.literal("heading"),
5566
+ text: z.string(),
5567
+ size: sizeSchema.optional(),
5568
+ align: alignSchema.optional(),
5569
+ control: z.string().optional(),
5570
+ margin: sizeSchema.optional()
5571
+ });
5572
+ var imageLayoutSchema = z.object({
5573
+ type: z.literal("image"),
5574
+ text: z.string().optional(),
5575
+ url: z.string().optional(),
5576
+ accessibilityDescription: z.string().optional(),
5577
+ content: imageSchema.optional(),
5578
+ size: sizeSchema.optional(),
5579
+ control: z.string().optional(),
5580
+ margin: sizeSchema.optional()
5581
+ });
5582
+ var markdownLayoutSchema = z.object({
5583
+ type: z.literal("markdown"),
5584
+ content: z.string(),
5585
+ align: alignSchema.optional(),
5586
+ control: z.string().optional(),
5587
+ margin: sizeSchema.optional()
5588
+ });
5589
+ var paragraphLayoutSchema = z.object({
5590
+ type: z.literal("paragraph"),
5591
+ text: z.string(),
5592
+ align: alignSchema.optional(),
5593
+ control: z.string().optional(),
5594
+ margin: sizeSchema.optional()
5595
+ });
5596
+ var listLayoutStatusSchema = z.union([
5597
+ z.literal("warning"),
5598
+ z.literal("neutral"),
5599
+ z.literal("positive")
5600
+ ]);
5601
+ var errorResponseBodySchema = z.object({
5602
+ refreshFormUrl: z.string().optional(),
5603
+ analytics: z.record(z.string()).optional(),
5604
+ error: z.string().optional(),
5605
+ validation: jsonElementSchema.optional(),
5606
+ refreshUrl: z.string().optional()
5607
+ });
5608
+ var searchSearchRequestSchema = z.object({
5609
+ url: z.string(),
5610
+ method: httpMethodSchema,
5611
+ param: z.string(),
5612
+ query: z.string()
5613
+ });
5474
5614
  var autocompleteTokenSchema = z.union([
5475
5615
  z.literal("on"),
5476
5616
  z.literal("name"),
@@ -5526,184 +5666,39 @@ var autocompleteTokenSchema = z.union([
5526
5666
  z.literal("phone-local-suffix"),
5527
5667
  z.literal("phone-extension"),
5528
5668
  z.literal("url"),
5529
- z.literal("photo"),
5530
- z.literal("impp"),
5531
- z.literal("shipping"),
5532
- z.literal("billing"),
5533
- z.literal("home"),
5534
- z.literal("work"),
5535
- z.literal("mobile"),
5536
- z.literal("fax"),
5537
- z.literal("pager")
5538
- ]);
5539
- var loadingIndicatorLayoutSchema = z.object({
5540
- type: z.literal("loading-indicator"),
5541
- size: sizeSchema.optional(),
5542
- control: z.string().optional(),
5543
- margin: sizeSchema.optional()
5544
- });
5545
- var paragraphLayoutSchema = z.object({
5546
- type: z.literal("paragraph"),
5547
- text: z.string(),
5548
- align: alignSchema.optional(),
5549
- control: z.string().optional(),
5550
- margin: sizeSchema.optional()
5551
- });
5552
- var dividerLayoutSchema = z.object({
5553
- type: z.literal("divider"),
5554
- control: z.string().optional(),
5555
- margin: sizeSchema.optional()
5556
- });
5557
- var listLayoutStatusSchema = z.union([
5558
- z.literal("warning"),
5559
- z.literal("neutral"),
5560
- z.literal("positive")
5561
- ]);
5562
- var formLayoutSchemaReferenceSchema = z.object({
5563
- $ref: z.string()
5564
- });
5565
- var imageLayoutSchema = z.object({
5566
- type: z.literal("image"),
5567
- text: z.string().optional(),
5568
- url: z.string().optional(),
5569
- accessibilityDescription: z.string().optional(),
5570
- content: imageSchema.optional(),
5571
- size: sizeSchema.optional(),
5572
- control: z.string().optional(),
5573
- margin: sizeSchema.optional()
5574
- });
5575
- var statusListLayoutStatusSchema = z.union([
5576
- z.literal("not-done"),
5577
- z.literal("pending"),
5578
- z.literal("done")
5579
- ]);
5580
- var instructionsLayoutItemSchema = z.object({
5581
- text: z.string(),
5582
- context: contextSchema,
5583
- tag: z.string().optional()
5584
- });
5585
- var modalLayoutTriggerSchema = z.object({
5586
- title: z.string()
5587
- });
5588
- var searchLayoutSchema = z.object({
5589
- type: z.literal("search"),
5590
- title: z.string(),
5591
- method: httpMethodSchema,
5592
- url: z.string(),
5593
- param: z.string(),
5594
- emptyMessage: z.string().optional(),
5595
- control: z.string().optional(),
5596
- margin: sizeSchema.optional()
5597
- });
5598
- var infoLayoutSchema = z.object({
5599
- type: z.literal("info"),
5600
- markdown: z.string(),
5601
- align: alignSchema.optional(),
5602
- control: z.string().optional(),
5603
- margin: sizeSchema.optional()
5604
- });
5605
- var formLayoutSchema = z.object({
5606
- type: z.literal("form"),
5607
- schema: formLayoutSchemaReferenceSchema.optional(),
5608
- schemaId: z.string(),
5609
- control: z.string().optional(),
5610
- margin: sizeSchema.optional()
5611
- });
5612
- var headingLayoutSchema = z.object({
5613
- type: z.literal("heading"),
5614
- text: z.string(),
5615
- size: sizeSchema.optional(),
5616
- align: alignSchema.optional(),
5617
- control: z.string().optional(),
5618
- margin: sizeSchema.optional()
5619
- });
5620
- var markdownLayoutSchema = z.object({
5621
- type: z.literal("markdown"),
5622
- content: z.string(),
5623
- align: alignSchema.optional(),
5624
- control: z.string().optional(),
5625
- margin: sizeSchema.optional()
5626
- });
5627
- var columnsLayoutBiasSchema = z.union([
5628
- z.literal("none"),
5629
- z.literal("left"),
5630
- z.literal("right")
5631
- ]);
5632
- var helpSchema = z.object({
5633
- markdown: z.string()
5634
- });
5635
- var searchSearchRequestSchema = z.object({
5636
- url: z.string(),
5637
- method: httpMethodSchema,
5638
- param: z.string(),
5639
- query: z.string()
5640
- });
5641
- var jsonElementSchema = z.lazy(
5642
- () => z.union([
5643
- z.string(),
5644
- z.number(),
5645
- z.boolean(),
5646
- z.record(jsonElementSchema),
5647
- z.array(jsonElementSchema)
5648
- ]).nullable()
5649
- );
5650
- var externalSchema = z.object({
5651
- url: z.string()
5652
- });
5653
- var stepErrorSchema = z.object({
5654
- error: z.string().optional(),
5655
- validation: jsonElementSchema.optional()
5656
- });
5657
- var stringSchemaFormatSchema = z.union([
5658
- z.literal("date"),
5659
- z.literal("email"),
5660
- z.literal("numeric"),
5661
- z.literal("password"),
5662
- z.literal("phone-number"),
5663
- z.literal("base64url")
5664
- ]);
5665
- var summarySummariserSchema = z.object({
5666
- defaultTitle: z.string().optional(),
5667
- defaultDescription: z.string().optional(),
5668
- defaultIcon: iconSchema.optional(),
5669
- defaultImage: imageSchema.optional(),
5670
- providesTitle: z.boolean().optional(),
5671
- providesDescription: z.boolean().optional(),
5672
- providesIcon: z.boolean().optional(),
5673
- providesImage: z.boolean().optional()
5674
- });
5675
- var validateAsyncSchema = z.object({
5676
- param: z.string(),
5677
- method: httpMethodSchema,
5678
- url: z.string()
5679
- });
5680
- var summaryProviderSchema = z.object({
5681
- providesTitle: z.boolean().optional(),
5682
- providesDescription: z.boolean().optional(),
5683
- providesIcon: z.boolean().optional(),
5684
- providesImage: z.boolean().optional()
5685
- });
5686
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
5687
- var navigationStackBehaviorSchema = z.union([
5688
- z.literal("default"),
5689
- z.literal("remove-previous"),
5690
- z.literal("remove-all"),
5691
- z.literal("replace-current")
5669
+ z.literal("photo"),
5670
+ z.literal("impp"),
5671
+ z.literal("shipping"),
5672
+ z.literal("billing"),
5673
+ z.literal("home"),
5674
+ z.literal("work"),
5675
+ z.literal("mobile"),
5676
+ z.literal("fax"),
5677
+ z.literal("pager")
5692
5678
  ]);
5693
- var actionTypeSchema = z.union([
5694
- z.literal("primary"),
5695
- z.literal("secondary"),
5696
- z.literal("link"),
5697
- z.literal("positive"),
5698
- z.literal("negative")
5679
+ var autocapitalizationTypeSchema = z.union([
5680
+ z.literal("none"),
5681
+ z.literal("characters"),
5682
+ z.literal("sentences"),
5683
+ z.literal("words")
5699
5684
  ]);
5700
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
5701
- var linkBehaviorSchema = z.object({
5702
- type: z.literal("link"),
5703
- url: z.string()
5685
+ var iconNamedSchema = z.object({
5686
+ name: z.string()
5704
5687
  });
5705
- var linkSchema = z.object({
5706
- url: z.string()
5688
+ var iconTextSchema = z.object({
5689
+ text: z.string()
5690
+ });
5691
+ var stringSchemaFormatSchema = z.union([
5692
+ z.literal("date"),
5693
+ z.literal("email"),
5694
+ z.literal("numeric"),
5695
+ z.literal("password"),
5696
+ z.literal("phone-number"),
5697
+ z.literal("base64url")
5698
+ ]);
5699
+ var stepErrorSchema = z.object({
5700
+ error: z.string().optional(),
5701
+ validation: jsonElementSchema.optional()
5707
5702
  });
5708
5703
  var actionSchema = z.object({
5709
5704
  title: z.string().optional(),
@@ -5720,6 +5715,21 @@ var actionSchema = z.object({
5720
5715
  timeout: z.number().optional(),
5721
5716
  skipValidation: z.boolean().optional()
5722
5717
  });
5718
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
5719
+ var formLayoutSchema = z.object({
5720
+ type: z.literal("form"),
5721
+ schema: formLayoutSchemaReferenceSchema.optional(),
5722
+ schemaId: z.string(),
5723
+ control: z.string().optional(),
5724
+ margin: sizeSchema.optional()
5725
+ });
5726
+ var infoLayoutSchema = z.object({
5727
+ type: z.literal("info"),
5728
+ markdown: z.string(),
5729
+ align: alignSchema.optional(),
5730
+ control: z.string().optional(),
5731
+ margin: sizeSchema.optional()
5732
+ });
5723
5733
  var listLayoutItemSchema = z.object({
5724
5734
  description: z.string().optional(),
5725
5735
  status: listLayoutStatusSchema.optional(),
@@ -5731,73 +5741,78 @@ var listLayoutItemSchema = z.object({
5731
5741
  subvalue: z.string().optional(),
5732
5742
  tag: z.string().optional()
5733
5743
  });
5734
- var instructionsLayoutSchema = z.object({
5735
- type: z.literal("instructions"),
5736
- title: z.string().optional(),
5737
- items: z.array(instructionsLayoutItemSchema),
5738
- control: z.string().optional(),
5739
- margin: sizeSchema.optional()
5740
- });
5741
- var reviewLayoutFieldSchema = z.object({
5742
- label: z.string(),
5743
- value: z.string(),
5744
- rawValue: z.string().optional(),
5745
- help: helpSchema.optional(),
5746
- tag: z.string().optional()
5744
+ var actionResponseBodySchema = z.object({
5745
+ action: actionSchema
5747
5746
  });
5748
- var searchResultSearchSchema = z.object({
5749
- type: z.literal("search"),
5747
+ var searchResultActionSchema = z.object({
5748
+ type: z.literal("action"),
5750
5749
  title: z.string(),
5751
5750
  description: z.string().optional(),
5752
5751
  icon: iconSchema.optional(),
5753
5752
  image: imageSchema.optional(),
5754
- value: searchSearchRequestSchema
5753
+ value: actionSchema
5755
5754
  });
5756
- var searchResultActionSchema = z.object({
5757
- type: z.literal("action"),
5755
+ var searchResultSearchSchema = z.object({
5756
+ type: z.literal("search"),
5758
5757
  title: z.string(),
5759
5758
  description: z.string().optional(),
5760
5759
  icon: iconSchema.optional(),
5761
5760
  image: imageSchema.optional(),
5762
- value: actionSchema
5761
+ value: searchSearchRequestSchema
5763
5762
  });
5764
- var actionResponseBodySchema = z.object({
5763
+ var actionBehaviorSchema = z.object({
5764
+ type: z.literal("action"),
5765
5765
  action: actionSchema
5766
5766
  });
5767
- var errorResponseBodySchema = z.object({
5768
- refreshFormUrl: z.string().optional(),
5769
- analytics: z.record(z.string()).optional(),
5770
- error: z.string().optional(),
5771
- validation: jsonElementSchema.optional(),
5772
- refreshUrl: z.string().optional()
5767
+ var containerBehaviorSchema = z.object({
5768
+ action: actionSchema.optional(),
5769
+ link: linkSchema.optional()
5773
5770
  });
5774
5771
  var navigationBackBehaviorSchema = z.object({
5775
5772
  title: z.string().optional(),
5776
5773
  action: actionSchema
5777
5774
  });
5778
- var actionBehaviorSchema = z.object({
5779
- type: z.literal("action"),
5780
- action: actionSchema
5775
+ var summarySummariserSchema = z.object({
5776
+ defaultTitle: z.string().optional(),
5777
+ defaultDescription: z.string().optional(),
5778
+ defaultIcon: iconSchema.optional(),
5779
+ defaultImage: imageSchema.optional(),
5780
+ providesTitle: z.boolean().optional(),
5781
+ providesDescription: z.boolean().optional(),
5782
+ providesIcon: z.boolean().optional(),
5783
+ providesImage: z.boolean().optional()
5781
5784
  });
5782
- var containerBehaviorSchema = z.object({
5783
- action: actionSchema.optional(),
5784
- link: linkSchema.optional()
5785
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
5786
+ var searchResponseBodySchema = z.object({
5787
+ results: z.array(searchResultSchema)
5785
5788
  });
5786
5789
  var behaviorSchema = z.union([
5787
5790
  actionBehaviorSchema,
5788
5791
  containerBehaviorSchema,
5789
5792
  linkBehaviorSchema
5790
5793
  ]);
5791
- var alertLayoutCallToActionSchema = z.object({
5792
- title: z.string(),
5793
- accessibilityDescription: z.string().optional(),
5794
- behavior: behaviorSchema
5794
+ var navigationSchema = z.object({
5795
+ backButton: navigationBackBehaviorSchema.optional(),
5796
+ back: navigationBackBehaviorSchema.optional(),
5797
+ stackBehavior: navigationStackBehaviorSchema.optional()
5795
5798
  });
5796
- var listLayoutCallToActionSchema = z.object({
5797
- title: z.string(),
5798
- accessibilityDescription: z.string().optional(),
5799
- behavior: behaviorSchema
5799
+ var linkHandlerSchema = z.object({
5800
+ regexPattern: z.string(),
5801
+ behavior: behaviorSchema.optional()
5802
+ });
5803
+ var pollingOnErrorSchema = z.object({
5804
+ action: actionSchema.optional(),
5805
+ behavior: behaviorSchema.optional()
5806
+ });
5807
+ var pollingSchema = z.object({
5808
+ interval: z.number().optional(),
5809
+ url: z.string(),
5810
+ delay: z.number().optional(),
5811
+ timeout: z.number().optional(),
5812
+ maxAttempts: z.number(),
5813
+ onError: pollingOnErrorSchema
5800
5814
  });
5815
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
5801
5816
  var decisionLayoutOptionSchema = z.object({
5802
5817
  action: actionSchema.optional(),
5803
5818
  title: z.string(),
@@ -5808,11 +5823,6 @@ var decisionLayoutOptionSchema = z.object({
5808
5823
  behavior: behaviorSchema.optional(),
5809
5824
  tag: z.string().optional()
5810
5825
  });
5811
- var itemCallToActionSchema = z.object({
5812
- title: z.string(),
5813
- accessibilityDescription: z.string().optional(),
5814
- behavior: behaviorSchema
5815
- });
5816
5826
  var buttonLayoutSchema = z.object({
5817
5827
  type: z.literal("button"),
5818
5828
  action: actionSchema.optional(),
@@ -5825,26 +5835,22 @@ var buttonLayoutSchema = z.object({
5825
5835
  control: z.string().optional(),
5826
5836
  margin: sizeSchema.optional()
5827
5837
  });
5828
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
5829
- var linkHandlerSchema = z.object({
5830
- regexPattern: z.string(),
5831
- behavior: behaviorSchema.optional()
5832
- });
5833
- var navigationSchema = z.object({
5834
- backButton: navigationBackBehaviorSchema.optional(),
5835
- back: navigationBackBehaviorSchema.optional(),
5836
- stackBehavior: navigationStackBehaviorSchema.optional()
5837
- });
5838
- var pollingOnErrorSchema = z.object({
5839
- action: actionSchema.optional(),
5840
- behavior: behaviorSchema.optional()
5841
- });
5842
5838
  var reviewLayoutCallToActionSchema = z.object({
5843
5839
  action: actionSchema.optional(),
5844
5840
  title: z.string(),
5845
5841
  accessibilityDescription: z.string().optional(),
5846
5842
  behavior: behaviorSchema.optional()
5847
5843
  });
5844
+ var alertLayoutCallToActionSchema = z.object({
5845
+ title: z.string(),
5846
+ accessibilityDescription: z.string().optional(),
5847
+ behavior: behaviorSchema
5848
+ });
5849
+ var itemCallToActionSchema = z.object({
5850
+ title: z.string(),
5851
+ accessibilityDescription: z.string().optional(),
5852
+ behavior: behaviorSchema
5853
+ });
5848
5854
  var alertLayoutSchema = z.object({
5849
5855
  type: z.literal("alert"),
5850
5856
  markdown: z.string(),
@@ -5853,13 +5859,10 @@ var alertLayoutSchema = z.object({
5853
5859
  margin: sizeSchema.optional(),
5854
5860
  callToAction: alertLayoutCallToActionSchema.optional()
5855
5861
  });
5856
- var listLayoutSchema = z.object({
5857
- type: z.literal("list"),
5858
- title: z.string().optional(),
5859
- callToAction: listLayoutCallToActionSchema.optional(),
5860
- items: z.array(listLayoutItemSchema),
5861
- control: z.string().optional(),
5862
- margin: sizeSchema.optional()
5862
+ var listLayoutCallToActionSchema = z.object({
5863
+ title: z.string(),
5864
+ accessibilityDescription: z.string().optional(),
5865
+ behavior: behaviorSchema
5863
5866
  });
5864
5867
  var decisionLayoutSchema = z.object({
5865
5868
  type: z.literal("decision"),
@@ -5868,34 +5871,29 @@ var decisionLayoutSchema = z.object({
5868
5871
  control: z.string().optional(),
5869
5872
  margin: sizeSchema.optional()
5870
5873
  });
5871
- var statusListLayoutItemSchema = z.object({
5872
- title: z.string(),
5873
- description: z.string().optional(),
5874
- icon: iconSchema,
5875
- status: statusListLayoutStatusSchema.optional(),
5876
- callToAction: itemCallToActionSchema.optional(),
5877
- tag: z.string().optional()
5878
- });
5879
- var reviewLayoutSchema = z.object({
5880
- type: z.literal("review"),
5881
- orientation: z.string().optional(),
5882
- action: actionSchema.optional(),
5883
- fields: z.array(reviewLayoutFieldSchema),
5874
+ var listLayoutSchema = z.object({
5875
+ type: z.literal("list"),
5884
5876
  title: z.string().optional(),
5885
- callToAction: reviewLayoutCallToActionSchema.optional(),
5877
+ callToAction: listLayoutCallToActionSchema.optional(),
5878
+ items: z.array(listLayoutItemSchema),
5886
5879
  control: z.string().optional(),
5887
5880
  margin: sizeSchema.optional()
5888
5881
  });
5889
- var searchResponseBodySchema = z.object({
5890
- results: z.array(searchResultSchema)
5891
- });
5892
- var pollingSchema = z.object({
5893
- interval: z.number().optional(),
5894
- url: z.string(),
5895
- delay: z.number().optional(),
5896
- timeout: z.number().optional(),
5897
- maxAttempts: z.number(),
5898
- onError: pollingOnErrorSchema
5882
+ var constSchemaSchema = z.object({
5883
+ hidden: z.boolean().optional(),
5884
+ alert: alertLayoutSchema.optional(),
5885
+ control: z.string().optional(),
5886
+ promoted: z.boolean().optional(),
5887
+ $id: z.string().optional(),
5888
+ const: jsonElementSchema,
5889
+ title: z.string().optional(),
5890
+ description: z.string().optional(),
5891
+ icon: iconSchema.optional(),
5892
+ image: imageSchema.optional(),
5893
+ keywords: z.array(z.string()).optional(),
5894
+ summary: summaryProviderSchema.optional(),
5895
+ analyticsId: z.string().optional(),
5896
+ disabled: z.boolean().optional()
5899
5897
  });
5900
5898
  var blobSchemaSchema = z.object({
5901
5899
  type: z.literal("blob"),
@@ -5919,21 +5917,23 @@ var blobSchemaSchema = z.object({
5919
5917
  source: uploadSourceSchema.optional(),
5920
5918
  disabled: z.boolean().optional()
5921
5919
  });
5922
- var constSchemaSchema = z.object({
5923
- hidden: z.boolean().optional(),
5924
- alert: alertLayoutSchema.optional(),
5925
- control: z.string().optional(),
5926
- promoted: z.boolean().optional(),
5927
- $id: z.string().optional(),
5928
- const: jsonElementSchema,
5920
+ var reviewLayoutSchema = z.object({
5921
+ type: z.literal("review"),
5922
+ orientation: z.string().optional(),
5923
+ action: actionSchema.optional(),
5924
+ fields: z.array(reviewLayoutFieldSchema),
5929
5925
  title: z.string().optional(),
5926
+ callToAction: reviewLayoutCallToActionSchema.optional(),
5927
+ control: z.string().optional(),
5928
+ margin: sizeSchema.optional()
5929
+ });
5930
+ var statusListLayoutItemSchema = z.object({
5931
+ title: z.string(),
5930
5932
  description: z.string().optional(),
5931
- icon: iconSchema.optional(),
5932
- image: imageSchema.optional(),
5933
- keywords: z.array(z.string()).optional(),
5934
- summary: summaryProviderSchema.optional(),
5935
- analyticsId: z.string().optional(),
5936
- disabled: z.boolean().optional()
5933
+ icon: iconSchema,
5934
+ status: statusListLayoutStatusSchema.optional(),
5935
+ callToAction: itemCallToActionSchema.optional(),
5936
+ tag: z.string().optional()
5937
5937
  });
5938
5938
  var statusListLayoutSchema = z.object({
5939
5939
  type: z.literal("status-list"),
@@ -5942,6 +5942,39 @@ var statusListLayoutSchema = z.object({
5942
5942
  control: z.string().optional(),
5943
5943
  margin: sizeSchema.optional()
5944
5944
  });
5945
+ var persistAsyncSchema = z.lazy(
5946
+ () => z.object({
5947
+ param: z.string(),
5948
+ idProperty: z.string(),
5949
+ schema: schemaSchema,
5950
+ url: z.string(),
5951
+ method: httpMethodSchema
5952
+ })
5953
+ );
5954
+ var schemaSchema = z.lazy(
5955
+ () => z.union([
5956
+ allOfSchemaSchema,
5957
+ arraySchemaSchema,
5958
+ blobSchemaSchema,
5959
+ booleanSchemaSchema,
5960
+ constSchemaSchema,
5961
+ integerSchemaSchema,
5962
+ numberSchemaSchema,
5963
+ objectSchemaSchema,
5964
+ oneOfSchemaSchema,
5965
+ stringSchemaSchema
5966
+ ])
5967
+ );
5968
+ var columnsLayoutSchema = z.lazy(
5969
+ () => z.object({
5970
+ type: z.literal("columns"),
5971
+ left: z.array(layoutSchema),
5972
+ right: z.array(layoutSchema),
5973
+ bias: columnsLayoutBiasSchema.optional(),
5974
+ control: z.string().optional(),
5975
+ margin: sizeSchema.optional()
5976
+ })
5977
+ );
5945
5978
  var layoutSchema = z.lazy(
5946
5979
  () => z.union([
5947
5980
  alertLayoutSchema,
@@ -5965,6 +5998,12 @@ var layoutSchema = z.lazy(
5965
5998
  statusListLayoutSchema
5966
5999
  ])
5967
6000
  );
6001
+ var modalLayoutContentSchema = z.lazy(
6002
+ () => z.object({
6003
+ title: z.string().optional(),
6004
+ components: z.array(layoutSchema)
6005
+ })
6006
+ );
5968
6007
  var boxLayoutSchema = z.lazy(
5969
6008
  () => z.object({
5970
6009
  type: z.literal("box"),
@@ -5975,16 +6014,6 @@ var boxLayoutSchema = z.lazy(
5975
6014
  margin: sizeSchema.optional()
5976
6015
  })
5977
6016
  );
5978
- var columnsLayoutSchema = z.lazy(
5979
- () => z.object({
5980
- type: z.literal("columns"),
5981
- left: z.array(layoutSchema),
5982
- right: z.array(layoutSchema),
5983
- bias: columnsLayoutBiasSchema.optional(),
5984
- control: z.string().optional(),
5985
- margin: sizeSchema.optional()
5986
- })
5987
- );
5988
6017
  var modalLayoutSchema = z.lazy(
5989
6018
  () => z.object({
5990
6019
  type: z.literal("modal"),
@@ -5994,12 +6023,6 @@ var modalLayoutSchema = z.lazy(
5994
6023
  content: modalLayoutContentSchema
5995
6024
  })
5996
6025
  );
5997
- var modalLayoutContentSchema = z.lazy(
5998
- () => z.object({
5999
- title: z.string().optional(),
6000
- components: z.array(layoutSchema)
6001
- })
6002
- );
6003
6026
  var stepSchema = z.lazy(
6004
6027
  () => z.object({
6005
6028
  key: z.string().optional(),
@@ -6019,57 +6042,33 @@ var stepSchema = z.lazy(
6019
6042
  errors: stepErrorSchema.optional(),
6020
6043
  navigation: navigationSchema.optional(),
6021
6044
  refreshUrl: z.string().optional(),
6045
+ refreshAfter: z.string().optional(),
6022
6046
  control: z.string().optional()
6023
6047
  })
6024
6048
  );
6025
- var schemaSchema = z.lazy(
6026
- () => z.union([
6027
- allOfSchemaSchema,
6028
- arraySchemaSchema,
6029
- blobSchemaSchema,
6030
- booleanSchemaSchema,
6031
- constSchemaSchema,
6032
- integerSchemaSchema,
6033
- numberSchemaSchema,
6034
- objectSchemaSchema,
6035
- oneOfSchemaSchema,
6036
- stringSchemaSchema
6037
- ])
6038
- );
6039
- var allOfSchemaSchema = z.lazy(
6040
- () => z.object({
6041
- disabled: z.boolean().optional(),
6042
- promoted: z.boolean().optional(),
6043
- allOf: z.array(schemaSchema),
6044
- $id: z.string().optional(),
6045
- title: z.string().optional(),
6046
- description: z.string().optional(),
6047
- control: z.string().optional(),
6048
- hidden: z.boolean().optional(),
6049
- icon: iconSchema.optional(),
6050
- image: imageSchema.optional(),
6051
- keywords: z.array(z.string()).optional(),
6052
- summary: summaryProviderSchema.optional(),
6053
- analyticsId: z.string().optional(),
6054
- alert: alertLayoutSchema.optional()
6055
- })
6056
- );
6057
- var arraySchemaSchema = z.lazy(
6058
- () => z.union([arraySchemaListSchema, arraySchemaTupleSchema])
6059
- );
6060
- var booleanSchemaSchema = z.lazy(
6049
+ var stringSchemaSchema = z.lazy(
6061
6050
  () => z.object({
6062
- type: z.literal("boolean"),
6051
+ type: z.literal("string"),
6063
6052
  autofillProvider: z.string().optional(),
6064
6053
  promoted: z.boolean().optional(),
6065
6054
  refreshFormOnChange: z.boolean().optional(),
6066
6055
  refreshUrl: z.string().optional(),
6067
6056
  refreshFormUrl: z.string().optional(),
6057
+ format: stringSchemaFormatSchema.optional(),
6058
+ displayFormat: z.string().optional(),
6059
+ placeholder: z.string().optional(),
6060
+ minLength: z.number().optional(),
6061
+ maxLength: z.number().optional(),
6062
+ minimum: z.string().optional(),
6063
+ maximum: z.string().optional(),
6064
+ pattern: z.string().optional(),
6065
+ autocapitalization: autocapitalizationTypeSchema.optional(),
6066
+ autocorrect: z.boolean().optional(),
6068
6067
  $id: z.string().optional(),
6069
6068
  title: z.string().optional(),
6070
6069
  description: z.string().optional(),
6071
6070
  control: z.string().optional(),
6072
- default: z.boolean().optional(),
6071
+ default: z.string().optional(),
6073
6072
  hidden: z.boolean().optional(),
6074
6073
  disabled: z.boolean().optional(),
6075
6074
  icon: iconSchema.optional(),
@@ -6080,42 +6079,45 @@ var booleanSchemaSchema = z.lazy(
6080
6079
  persistAsync: persistAsyncSchema.optional(),
6081
6080
  refreshStepOnChange: z.boolean().optional(),
6082
6081
  validationAsync: validateAsyncSchema.optional(),
6082
+ validationMessages: z.record(z.string()).optional(),
6083
6083
  alert: alertLayoutSchema.optional(),
6084
+ cameraConfig: jsonElementSchema.optional(),
6085
+ accepts: z.array(z.string()).optional(),
6086
+ maxSize: z.number().optional(),
6087
+ source: uploadSourceSchema.optional(),
6088
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6084
6089
  autofillKey: z.string().optional(),
6085
6090
  help: helpSchema.optional()
6086
6091
  })
6087
6092
  );
6088
- var integerSchemaSchema = z.lazy(
6093
+ var oneOfSchemaSchema = z.lazy(
6089
6094
  () => z.object({
6090
- type: z.literal("integer"),
6091
6095
  autofillProvider: z.string().optional(),
6092
6096
  promoted: z.boolean().optional(),
6093
6097
  refreshFormOnChange: z.boolean().optional(),
6094
6098
  refreshUrl: z.string().optional(),
6095
6099
  refreshFormUrl: z.string().optional(),
6100
+ promotion: jsonElementSchema.optional(),
6101
+ oneOf: z.array(schemaSchema),
6096
6102
  placeholder: z.string().optional(),
6097
- minimum: z.number().optional(),
6098
- maximum: z.number().optional(),
6099
6103
  $id: z.string().optional(),
6100
6104
  title: z.string().optional(),
6101
6105
  description: z.string().optional(),
6102
6106
  control: z.string().optional(),
6103
- default: z.number().optional(),
6107
+ default: jsonElementSchema.optional(),
6104
6108
  hidden: z.boolean().optional(),
6105
- disabled: z.boolean().optional(),
6106
6109
  icon: iconSchema.optional(),
6107
6110
  image: imageSchema.optional(),
6108
6111
  keywords: z.array(z.string()).optional(),
6109
6112
  summary: summaryProviderSchema.optional(),
6110
6113
  analyticsId: z.string().optional(),
6111
- persistAsync: persistAsyncSchema.optional(),
6112
6114
  refreshStepOnChange: z.boolean().optional(),
6113
- validationAsync: validateAsyncSchema.optional(),
6114
- validationMessages: z.record(z.string()).optional(),
6115
6115
  alert: alertLayoutSchema.optional(),
6116
+ help: helpSchema.optional(),
6116
6117
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6117
6118
  autofillKey: z.string().optional(),
6118
- help: helpSchema.optional()
6119
+ validationMessages: z.record(z.string()).optional(),
6120
+ disabled: z.boolean().optional()
6119
6121
  })
6120
6122
  );
6121
6123
  var numberSchemaSchema = z.lazy(
@@ -6151,16 +6153,12 @@ var numberSchemaSchema = z.lazy(
6151
6153
  help: helpSchema.optional()
6152
6154
  })
6153
6155
  );
6154
- var objectSchemaSchema = z.lazy(
6156
+ var arraySchemaTupleSchema = z.lazy(
6155
6157
  () => z.object({
6156
- type: z.literal("object"),
6157
- disabled: z.boolean().optional(),
6158
+ type: z.literal("array"),
6158
6159
  promoted: z.boolean().optional(),
6159
- help: helpSchema.optional(),
6160
- properties: z.record(schemaSchema),
6161
- displayOrder: z.array(z.string()),
6162
- required: z.array(z.string()).optional(),
6163
6160
  $id: z.string().optional(),
6161
+ items: z.array(schemaSchema),
6164
6162
  title: z.string().optional(),
6165
6163
  description: z.string().optional(),
6166
6164
  control: z.string().optional(),
@@ -6170,62 +6168,27 @@ var objectSchemaSchema = z.lazy(
6170
6168
  keywords: z.array(z.string()).optional(),
6171
6169
  summary: summaryProviderSchema.optional(),
6172
6170
  analyticsId: z.string().optional(),
6171
+ persistAsync: persistAsyncSchema.optional(),
6172
+ validationAsync: validateAsyncSchema.optional(),
6173
6173
  alert: alertLayoutSchema.optional()
6174
6174
  })
6175
6175
  );
6176
- var oneOfSchemaSchema = z.lazy(
6177
- () => z.object({
6178
- autofillProvider: z.string().optional(),
6179
- promoted: z.boolean().optional(),
6180
- refreshFormOnChange: z.boolean().optional(),
6181
- refreshUrl: z.string().optional(),
6182
- refreshFormUrl: z.string().optional(),
6183
- promotion: jsonElementSchema.optional(),
6184
- oneOf: z.array(schemaSchema),
6185
- placeholder: z.string().optional(),
6186
- $id: z.string().optional(),
6187
- title: z.string().optional(),
6188
- description: z.string().optional(),
6189
- control: z.string().optional(),
6190
- default: jsonElementSchema.optional(),
6191
- hidden: z.boolean().optional(),
6192
- icon: iconSchema.optional(),
6193
- image: imageSchema.optional(),
6194
- keywords: z.array(z.string()).optional(),
6195
- summary: summaryProviderSchema.optional(),
6196
- analyticsId: z.string().optional(),
6197
- refreshStepOnChange: z.boolean().optional(),
6198
- alert: alertLayoutSchema.optional(),
6199
- help: helpSchema.optional(),
6200
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6201
- autofillKey: z.string().optional(),
6202
- validationMessages: z.record(z.string()).optional(),
6203
- disabled: z.boolean().optional()
6204
- })
6205
- );
6206
- var stringSchemaSchema = z.lazy(
6176
+ var integerSchemaSchema = z.lazy(
6207
6177
  () => z.object({
6208
- type: z.literal("string"),
6178
+ type: z.literal("integer"),
6209
6179
  autofillProvider: z.string().optional(),
6210
6180
  promoted: z.boolean().optional(),
6211
6181
  refreshFormOnChange: z.boolean().optional(),
6212
6182
  refreshUrl: z.string().optional(),
6213
6183
  refreshFormUrl: z.string().optional(),
6214
- format: stringSchemaFormatSchema.optional(),
6215
- displayFormat: z.string().optional(),
6216
6184
  placeholder: z.string().optional(),
6217
- minLength: z.number().optional(),
6218
- maxLength: z.number().optional(),
6219
- minimum: z.string().optional(),
6220
- maximum: z.string().optional(),
6221
- pattern: z.string().optional(),
6222
- autocapitalization: autocapitalizationTypeSchema.optional(),
6223
- autocorrect: z.boolean().optional(),
6185
+ minimum: z.number().optional(),
6186
+ maximum: z.number().optional(),
6224
6187
  $id: z.string().optional(),
6225
6188
  title: z.string().optional(),
6226
6189
  description: z.string().optional(),
6227
6190
  control: z.string().optional(),
6228
- default: z.string().optional(),
6191
+ default: z.number().optional(),
6229
6192
  hidden: z.boolean().optional(),
6230
6193
  disabled: z.boolean().optional(),
6231
6194
  icon: iconSchema.optional(),
@@ -6238,15 +6201,14 @@ var stringSchemaSchema = z.lazy(
6238
6201
  validationAsync: validateAsyncSchema.optional(),
6239
6202
  validationMessages: z.record(z.string()).optional(),
6240
6203
  alert: alertLayoutSchema.optional(),
6241
- cameraConfig: jsonElementSchema.optional(),
6242
- accepts: z.array(z.string()).optional(),
6243
- maxSize: z.number().optional(),
6244
- source: uploadSourceSchema.optional(),
6245
6204
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6246
6205
  autofillKey: z.string().optional(),
6247
6206
  help: helpSchema.optional()
6248
6207
  })
6249
6208
  );
6209
+ var arraySchemaSchema = z.lazy(
6210
+ () => z.union([arraySchemaListSchema, arraySchemaTupleSchema])
6211
+ );
6250
6212
  var arraySchemaListSchema = z.lazy(
6251
6213
  () => z.object({
6252
6214
  type: z.literal("array"),
@@ -6274,32 +6236,71 @@ var arraySchemaListSchema = z.lazy(
6274
6236
  disabled: z.boolean().optional()
6275
6237
  })
6276
6238
  );
6277
- var persistAsyncSchema = z.lazy(
6239
+ var allOfSchemaSchema = z.lazy(
6278
6240
  () => z.object({
6279
- param: z.string(),
6280
- idProperty: z.string(),
6281
- schema: schemaSchema,
6282
- url: z.string(),
6283
- method: httpMethodSchema
6241
+ disabled: z.boolean().optional(),
6242
+ promoted: z.boolean().optional(),
6243
+ allOf: z.array(schemaSchema),
6244
+ $id: z.string().optional(),
6245
+ title: z.string().optional(),
6246
+ description: z.string().optional(),
6247
+ control: z.string().optional(),
6248
+ hidden: z.boolean().optional(),
6249
+ icon: iconSchema.optional(),
6250
+ image: imageSchema.optional(),
6251
+ keywords: z.array(z.string()).optional(),
6252
+ summary: summaryProviderSchema.optional(),
6253
+ analyticsId: z.string().optional(),
6254
+ alert: alertLayoutSchema.optional()
6284
6255
  })
6285
6256
  );
6286
- var arraySchemaTupleSchema = z.lazy(
6257
+ var booleanSchemaSchema = z.lazy(
6287
6258
  () => z.object({
6288
- type: z.literal("array"),
6259
+ type: z.literal("boolean"),
6260
+ autofillProvider: z.string().optional(),
6289
6261
  promoted: z.boolean().optional(),
6262
+ refreshFormOnChange: z.boolean().optional(),
6263
+ refreshUrl: z.string().optional(),
6264
+ refreshFormUrl: z.string().optional(),
6290
6265
  $id: z.string().optional(),
6291
- items: z.array(schemaSchema),
6292
6266
  title: z.string().optional(),
6293
6267
  description: z.string().optional(),
6294
6268
  control: z.string().optional(),
6269
+ default: z.boolean().optional(),
6295
6270
  hidden: z.boolean().optional(),
6271
+ disabled: z.boolean().optional(),
6296
6272
  icon: iconSchema.optional(),
6297
6273
  image: imageSchema.optional(),
6298
6274
  keywords: z.array(z.string()).optional(),
6299
6275
  summary: summaryProviderSchema.optional(),
6300
6276
  analyticsId: z.string().optional(),
6301
6277
  persistAsync: persistAsyncSchema.optional(),
6278
+ refreshStepOnChange: z.boolean().optional(),
6302
6279
  validationAsync: validateAsyncSchema.optional(),
6280
+ alert: alertLayoutSchema.optional(),
6281
+ autofillKey: z.string().optional(),
6282
+ help: helpSchema.optional()
6283
+ })
6284
+ );
6285
+ var objectSchemaSchema = z.lazy(
6286
+ () => z.object({
6287
+ type: z.literal("object"),
6288
+ disabled: z.boolean().optional(),
6289
+ promoted: z.boolean().optional(),
6290
+ help: helpSchema.optional(),
6291
+ properties: z.record(schemaSchema),
6292
+ displayOrder: z.array(z.string()),
6293
+ required: z.array(z.string()).optional(),
6294
+ $id: z.string().optional(),
6295
+ title: z.string().optional(),
6296
+ description: z.string().optional(),
6297
+ control: z.string().optional(),
6298
+ hidden: z.boolean().optional(),
6299
+ icon: iconSchema.optional(),
6300
+ image: imageSchema.optional(),
6301
+ keywords: z.array(z.string()).optional(),
6302
+ summary: summaryProviderSchema.optional(),
6303
+ analyticsId: z.string().optional(),
6303
6304
  alert: alertLayoutSchema.optional()
6304
6305
  })
6305
6306
  );
@@ -6486,6 +6487,9 @@ var createStepComponent = (stepProps) => {
6486
6487
  },
6487
6488
  stop() {
6488
6489
  stepPolling == null ? void 0 : stepPolling.stop();
6490
+ },
6491
+ getRefreshAfter() {
6492
+ return this.step.refreshAfter;
6489
6493
  }
6490
6494
  });
6491
6495
  };
@@ -10521,7 +10525,8 @@ var mapStepToComponent = (_a) => {
10521
10525
  step,
10522
10526
  updateComponent,
10523
10527
  trackEvent,
10524
- onAction
10528
+ onAction,
10529
+ onRefresh
10525
10530
  });
10526
10531
  return stepComponent;
10527
10532
  };
@@ -10959,6 +10964,13 @@ function useStableCallback(handler) {
10959
10964
  return (0, import_react2.useCallback)((...args) => ref.current ? ref.current(...args) : null, []);
10960
10965
  }
10961
10966
 
10967
+ // src/revamp/utils/time-utils.ts
10968
+ var getTimeDiffInMs = (timestamp) => {
10969
+ const targetTime = new Date(timestamp).getTime();
10970
+ const currentTime = Date.now();
10971
+ return targetTime - currentTime;
10972
+ };
10973
+
10962
10974
  // src/revamp/useDynamicFlowCore.tsx
10963
10975
  function useDynamicFlowCore(props) {
10964
10976
  const _a = props, { flowId, initialAction, initialStep, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "displayStepTitle"]);
@@ -10995,6 +11007,20 @@ function useDynamicFlowCore(props) {
10995
11007
  trackCoreEvent("Step Shown", { isFirstStep: true });
10996
11008
  }
10997
11009
  }, []);
11010
+ const refreshAfter = stepComponent == null ? void 0 : stepComponent.getRefreshAfter();
11011
+ console.log({ refreshAfter });
11012
+ (0, import_react3.useEffect)(() => {
11013
+ if (!refreshAfter) return;
11014
+ const timeLeft = getTimeDiffInMs(refreshAfter);
11015
+ if (timeLeft <= 0) {
11016
+ void (stepComponent == null ? void 0 : stepComponent.onRefresh(void 0));
11017
+ return;
11018
+ }
11019
+ const timeout = setTimeout(() => {
11020
+ void (stepComponent == null ? void 0 : stepComponent.onRefresh(void 0));
11021
+ }, timeLeft);
11022
+ return () => clearTimeout(timeout);
11023
+ }, [refreshAfter]);
10998
11024
  const createStep = (0, import_react3.useCallback)((newStep, etag) => {
10999
11025
  if (stepComponentRef.current) {
11000
11026
  stepCount.current += 1;