@verdocs/web-sdk 5.0.41 → 5.0.42

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 (97) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +18 -33
  3. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
  4. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +0 -2
  5. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-preview_7.cjs.entry.js +0 -1
  7. package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
  8. package/dist/cjs/verdocs-sign.cjs.entry.js +114 -90
  9. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  10. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  11. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +0 -1
  12. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  13. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +121 -95
  14. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  15. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -8
  16. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
  17. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +0 -2
  18. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
  19. package/dist/components/{p-36368807.js → p-4a04090c.js} +3 -3
  20. package/dist/components/{p-36368807.js.map → p-4a04090c.js.map} +1 -1
  21. package/dist/components/{p-c1d312d8.js → p-4a4bf38c.js} +2 -3
  22. package/dist/components/p-4a4bf38c.js.map +1 -0
  23. package/dist/components/{p-6bfb8eba.js → p-73a39d5a.js} +19 -34
  24. package/dist/components/p-73a39d5a.js.map +1 -0
  25. package/dist/components/{p-795b4192.js → p-91eae04c.js} +3 -3
  26. package/dist/components/{p-795b4192.js.map → p-91eae04c.js.map} +1 -1
  27. package/dist/components/{p-52c195dd.js → p-92cce3dc.js} +1 -3
  28. package/dist/components/{p-52c195dd.js.map → p-92cce3dc.js.map} +1 -1
  29. package/dist/components/{p-7481c7db.js → p-b474c324.js} +2 -2
  30. package/dist/components/{p-7481c7db.js.map → p-b474c324.js.map} +1 -1
  31. package/dist/components/verdocs-build.js +6 -6
  32. package/dist/components/verdocs-contact-picker.js +1 -1
  33. package/dist/components/verdocs-field-date.js +1 -1
  34. package/dist/components/verdocs-preview.js +1 -1
  35. package/dist/components/verdocs-send.js +1 -1
  36. package/dist/components/verdocs-sign.js +117 -92
  37. package/dist/components/verdocs-sign.js.map +1 -1
  38. package/dist/components/verdocs-template-document-page.js +1 -1
  39. package/dist/components/verdocs-template-fields.js +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/verdocs-contact-picker_2.entry.js +18 -33
  42. package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
  43. package/dist/esm/verdocs-field-attachment_13.entry.js +0 -2
  44. package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
  45. package/dist/esm/verdocs-preview_7.entry.js +0 -1
  46. package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
  47. package/dist/esm/verdocs-sign.entry.js +115 -91
  48. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  49. package/dist/esm/verdocs-web-sdk.js +1 -1
  50. package/dist/esm-es5/loader.js +1 -1
  51. package/dist/esm-es5/loader.js.map +1 -1
  52. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  53. package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
  54. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  55. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  56. package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
  57. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
  58. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  59. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  60. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  61. package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
  62. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +4 -2
  63. package/dist/verdocs-web-sdk/p-02e09803.system.entry.js +2 -0
  64. package/dist/verdocs-web-sdk/p-02e09803.system.entry.js.map +1 -0
  65. package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
  66. package/dist/verdocs-web-sdk/p-0c1898f6.system.js.map +1 -1
  67. package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js +2 -0
  68. package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js.map +1 -0
  69. package/dist/verdocs-web-sdk/p-4d92a71b.entry.js +2 -0
  70. package/dist/verdocs-web-sdk/p-4d92a71b.entry.js.map +1 -0
  71. package/dist/verdocs-web-sdk/{p-7f982a59.system.entry.js → p-6cfb51e3.system.entry.js} +2 -2
  72. package/dist/verdocs-web-sdk/p-6cfb51e3.system.entry.js.map +1 -0
  73. package/dist/verdocs-web-sdk/{p-62bde242.system.entry.js → p-89c69404.system.entry.js} +2 -2
  74. package/dist/verdocs-web-sdk/p-89c69404.system.entry.js.map +1 -0
  75. package/dist/verdocs-web-sdk/p-d47c58de.entry.js +2 -0
  76. package/dist/verdocs-web-sdk/p-d47c58de.entry.js.map +1 -0
  77. package/dist/verdocs-web-sdk/{p-7962eb00.entry.js → p-e7ca4f15.entry.js} +2 -2
  78. package/dist/verdocs-web-sdk/p-e7ca4f15.entry.js.map +1 -0
  79. package/dist/verdocs-web-sdk/{p-dda88c7f.entry.js → p-e8268ed9.entry.js} +2 -2
  80. package/dist/verdocs-web-sdk/p-e8268ed9.entry.js.map +1 -0
  81. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  82. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
  83. package/package.json +3 -3
  84. package/dist/components/p-6bfb8eba.js.map +0 -1
  85. package/dist/components/p-c1d312d8.js.map +0 -1
  86. package/dist/verdocs-web-sdk/p-1c8788f5.entry.js +0 -2
  87. package/dist/verdocs-web-sdk/p-1c8788f5.entry.js.map +0 -1
  88. package/dist/verdocs-web-sdk/p-62bde242.system.entry.js.map +0 -1
  89. package/dist/verdocs-web-sdk/p-7962eb00.entry.js.map +0 -1
  90. package/dist/verdocs-web-sdk/p-7f982a59.system.entry.js.map +0 -1
  91. package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js +0 -2
  92. package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js.map +0 -1
  93. package/dist/verdocs-web-sdk/p-dda88c7f.entry.js.map +0 -1
  94. package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js +0 -2
  95. package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js.map +0 -1
  96. package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js +0 -2
  97. package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-2cd5f887.js';
2
- import { VerdocsEndpoint, startSigningSession, getKbaStep, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, sortFields, envelopeRecipientSubmit, getEnvelope, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, submitKbaPin, submitKbaIdentity, submitKbaChallengeResponse, integerSequence } from '@verdocs/js-sdk';
2
+ import { VerdocsEndpoint, startSigningSession, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, sortFields, envelopeRecipientSubmit, getEnvelope, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, authenticateSigner, integerSequence } from '@verdocs/js-sdk';
3
3
  import { a as saveAttachment, u as updateDocumentFieldValue, r as renderDocumentField, g as getFieldId } from './utils-bd656c37.js';
4
4
  import { V as VerdocsToast } from './Toast-c4843828.js';
5
5
  import { S as SDKError } from './errors-887f1e88.js';
@@ -72,7 +72,10 @@ const VerdocsSign = class {
72
72
  this.showFinishLater = false;
73
73
  this.agreed = false;
74
74
  this.documentsSingularPlural = 'document';
75
- this.kbaStep = '';
75
+ // TODO
76
+ // @State() authStep: TRecipientAuthMethod | null = null;
77
+ this.authStep = null;
78
+ this.authDetails = null;
76
79
  this.kbaQuestions = [];
77
80
  this.showSpinner = false;
78
81
  this.kbaChoices = [];
@@ -122,13 +125,26 @@ const VerdocsSign = class {
122
125
  if (this.recipientIndex > -1) {
123
126
  this.recipient = this.sortedRecipients[this.recipientIndex];
124
127
  this.agreed = this.recipient.agreed;
128
+ this.submitted = this.recipient.status === 'submitted';
129
+ this.authStep = this.recipient.auth_step;
130
+ if (this.authStep) {
131
+ console.log('[SIGN] Authentication required', this.authStep);
132
+ }
133
+ const auth_method_states = (this.recipient.auth_method_states || {});
134
+ if (Object.values(auth_method_states).includes('failed')) {
135
+ this.fatalErrorHeader = 'Recipient Verification Failed';
136
+ this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
137
+ this.isDone = true;
138
+ }
139
+ // TODO
140
+ // this.kbaQuestions = (r as any).questions?.question || [];
141
+ // this.kbaChoices = [];
125
142
  }
126
143
  else {
127
144
  console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);
128
145
  }
129
146
  // TODO: Envelope "complete" | "declined" | "canceled"
130
147
  // TODO: Recipient "canceled"
131
- this.submitted = this.recipient.status === 'submitted';
132
148
  this.isDone = this.submitted;
133
149
  this.showDone = this.submitted;
134
150
  if (this.envelope.status === 'canceled') {
@@ -144,24 +160,6 @@ const VerdocsSign = class {
144
160
  }
145
161
  this.checkRecipientFields();
146
162
  (_d = this.envelopeLoaded) === null || _d === void 0 ? void 0 : _d.emit({ endpoint: this.endpoint, envelope: this.envelope });
147
- if (!this.isDone) {
148
- getKbaStep(this.endpoint, this.envelopeId, this.roleId)
149
- .then(r => {
150
- var _a;
151
- console.log('[SIGN] KBA Step', r);
152
- this.kbaStep = r.kba_step;
153
- if (this.kbaStep === 'failed') {
154
- this.fatalErrorHeader = 'Identity Verification Failed';
155
- this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
156
- this.isDone = true;
157
- }
158
- else {
159
- this.kbaQuestions = ((_a = r.questions) === null || _a === void 0 ? void 0 : _a.question) || [];
160
- this.kbaChoices = [];
161
- }
162
- })
163
- .catch(e => console.log('Error getting KBA step', e));
164
- }
165
163
  }
166
164
  catch (e) {
167
165
  console.log('[SIGN] Error with signing session', e);
@@ -580,6 +578,27 @@ const VerdocsSign = class {
580
578
  });
581
579
  this.checkRecipientFields();
582
580
  }
581
+ handleAuthenticateSigner(params) {
582
+ console.log('[SIGN] Submitting authentication step', params);
583
+ authenticateSigner(this.endpoint, params)
584
+ .then(r => {
585
+ console.log('[SIGN] Authentication successful', r);
586
+ this.authStep = r.auth_step;
587
+ this.authDetails = r.auth_details;
588
+ })
589
+ .catch(e => {
590
+ var _a, _b, _c, _d, _e;
591
+ console.log('[SIGN] Error submitting authentication step', e);
592
+ if ((_c = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.includes('failed')) {
593
+ this.fatalErrorHeader = 'Recipient Verification Failed';
594
+ this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
595
+ this.isDone = true;
596
+ }
597
+ else {
598
+ VerdocsToast(((_e = (_d = e.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) || 'Unable to verify your identity. Please try again.', { style: 'error' });
599
+ }
600
+ });
601
+ }
583
602
  render() {
584
603
  if (this.showLoadError) {
585
604
  return (h(Host, null, h("verdocs-ok-dialog", { heading: "Unable to Start Signing", message: `Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`, buttonLabel: "OK", onNext: () => {
@@ -603,86 +622,91 @@ const VerdocsSign = class {
603
622
  if (!this.agreed) {
604
623
  return (h(Host, { class: "agreed" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "By checking this box, you:", onInput: () => this.handleClickAgree() }), h("ul", null, h("li", null, "Agree to use electronic records and signatures, and confirm you have read the", ' ', h("a", { href: "https://verdocs.com/en/electronic-record-signature-disclosure/", target: "_blank" }, "Electronic Record and Signatures Disclosure"), "."), h("li", null, "Agree to Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/eula", target: "_blank" }, "End User License Agreement"), ' ', "and confirm you have read Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/privacy-policy/", target: "_blank" }, "Privacy Policy"), "."))))));
605
624
  }
606
- if (this.kbaStep === 'pin') {
607
- return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "text", step: 1, steps: 1, helptitle: "Document is protected by a PIN code", helptext: "Please enter your PIN code to proceed. If you do not have one, please contact the sender.", label: "PIN Code", onNext: async (e) => {
608
- submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail)
609
- .then(r => {
610
- console.log('[SIGN] PIN code submission result', r);
611
- if (r.kba_step === 'complete') {
612
- this.kbaStep = '';
613
- }
614
- })
615
- .catch(e => {
616
- var _a, _b, _c, _d;
617
- console.log('[SIGN] Error submitting PIN', e);
618
- if (((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === 'Rejecting PIN submission, too many attempts') {
619
- this.fatalErrorHeader = 'PIN Verification Failed';
620
- this.fatalErrorMessage = 'Too many failed attempts. The sender has been notified.';
621
- this.isDone = true;
622
- }
623
- else {
624
- VerdocsToast(((_d = (_c = e.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error) || 'Unable to verify PIN code. Please try again.', { style: 'error' });
625
- }
626
- });
627
- } })))));
625
+ if (this.authStep === 'passcode') {
626
+ return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "text", step: 1, steps: 1, helptitle: "Document is protected by a Passcode", helptext: "Please enter your Passcode to proceed. If you do not have one, please contact the sender.", label: "Passcode", onNext: e => this.handleAuthenticateSigner({ auth_method: 'passcode', code: e.detail }) })))));
628
627
  }
629
- if (this.kbaStep === 'identity') {
628
+ if (this.authStep === 'kba') {
630
629
  return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "identity", helptitle: "Document requires identity verification", helptext: "Please complete your contact details to proceed.", recipient: this.recipient, onNext: async (e) => {
631
630
  const recipDetails = e.detail;
632
- submitKbaIdentity(this.endpoint, this.envelopeId, this.roleId, {
633
- firstName: recipDetails.first_name,
634
- lastName: recipDetails.last_name,
631
+ this.handleAuthenticateSigner({
632
+ auth_method: 'kba',
633
+ first_name: recipDetails.first_name,
634
+ last_name: recipDetails.last_name,
635
635
  address: recipDetails.address,
636
636
  city: recipDetails.city,
637
637
  state: recipDetails.state,
638
638
  zip: recipDetails.zip,
639
- ssnLast4: recipDetails.ssn_last_4,
640
- })
641
- .then(r => {
642
- console.log('[SIGN] Identity submission result', r);
643
- this.kbaStep = r.kba_step;
644
- })
645
- .catch(e => {
646
- var _a, _b;
647
- console.log('[SIGN] Error submitting identity', e);
648
- VerdocsToast(((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || 'Unable to verify identity.', { style: 'error' });
639
+ ssn_last_4: recipDetails.ssn_last_4,
640
+ dob: recipDetails.dob,
649
641
  });
650
642
  } })))));
651
643
  }
652
- if (this.kbaStep === 'challenge') {
653
- const questionNumber = this.kbaChoices.length;
654
- const kbaQuestion = this.kbaQuestions[questionNumber];
655
- return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, this.kbaChoices.length >= this.kbaQuestions.length ? (h("verdocs-spinner", null)) : (h("verdocs-kba-dialog", { mode: "choice", helptitle: "Your identity requires additional verification", helptext: (kbaQuestion === null || kbaQuestion === void 0 ? void 0 : kbaQuestion.prompt) || 'Please select one of the options below.', choices: (kbaQuestion === null || kbaQuestion === void 0 ? void 0 : kbaQuestion.answer) || ['Skip Question'], step: questionNumber + 1, steps: this.kbaQuestions.length, onNext: async (e) => {
656
- var _a, _b, _c;
657
- const answer = e.detail;
658
- this.kbaChoices = [...this.kbaChoices, answer];
659
- if (this.kbaChoices.length >= this.kbaQuestions.length) {
660
- const responses = this.kbaQuestions.map((q, i) => ({ type: q.type, answer: this.kbaChoices[i] }));
661
- console.log('Submitting KBA responses', this.kbaChoices, responses);
662
- try {
663
- const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);
664
- console.log('KBA challenge response', response);
665
- this.kbaStep = response.kba_step;
666
- if (this.kbaStep === 'failed') {
667
- this.fatalErrorHeader = 'Identity Verification Failed';
668
- this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
669
- this.isDone = true;
670
- }
671
- else {
672
- this.kbaQuestions = ((_a = response.questions) === null || _a === void 0 ? void 0 : _a.question) || [];
673
- this.kbaChoices = [];
674
- }
675
- }
676
- catch (e) {
677
- console.log('Error submitting KBA challenge', e);
678
- this.kbaStep = '';
679
- this.fatalErrorHeader = 'Unable to Verify Identity';
680
- this.fatalErrorMessage = ((_c = (_b = e.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) || 'Please try again later.';
681
- this.isDone = true;
682
- }
683
- }
684
- } }))))));
685
- }
644
+ // if (this.kbaStep === 'challenge') {
645
+ // const questionNumber = this.kbaChoices.length;
646
+ // const kbaQuestion = this.kbaQuestions[questionNumber];
647
+ // return (
648
+ // <Host class="kba">
649
+ // <div id="verdocs-sign-header">
650
+ // <div class="inner">
651
+ // <img src="https://verdocs.com/assets/white-logo.svg" alt="Verdocs Logo" class="logo" />
652
+ // <div class="title">{this.envelope.name}</div>
653
+ // </div>
654
+ // </div>
655
+ //
656
+ // <div class="document" style={{paddingTop: '15px'}}>
657
+ // <img
658
+ // src="https://public-assets.verdocs.com/loading-placeholder.png"
659
+ // style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}
660
+ // alt="Placeholder page"
661
+ // />
662
+ // </div>
663
+ //
664
+ // <div class="cover">
665
+ // <div class="kba">
666
+ // {this.kbaChoices.length >= this.kbaQuestions.length ? (
667
+ // <verdocs-spinner />
668
+ // ) : (
669
+ // <verdocs-kba-dialog
670
+ // mode="choice"
671
+ // helptitle="Your identity requires additional verification"
672
+ // helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}
673
+ // choices={kbaQuestion?.answer || ['Skip Question']}
674
+ // step={questionNumber + 1}
675
+ // steps={this.kbaQuestions.length}
676
+ // onNext={async (e: any) => {
677
+ // const answer = e.detail as string;
678
+ // this.kbaChoices = [...this.kbaChoices, answer];
679
+ // if (this.kbaChoices.length >= this.kbaQuestions.length) {
680
+ // const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));
681
+ // console.log('Submitting KBA responses', this.kbaChoices, responses);
682
+ // try {
683
+ // const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);
684
+ // console.log('KBA challenge response', response);
685
+ // this.kbaStep = response.kba_step;
686
+ // if (this.kbaStep === 'failed') {
687
+ // this.fatalErrorHeader = 'Identity Verification Failed';
688
+ // this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
689
+ // this.isDone = true;
690
+ // } else {
691
+ // this.kbaQuestions = (response as any).questions?.question || [];
692
+ // this.kbaChoices = [];
693
+ // }
694
+ // } catch (e) {
695
+ // console.log('Error submitting KBA challenge', e);
696
+ // this.kbaStep = '';
697
+ // this.fatalErrorHeader = 'Unable to Verify Identity';
698
+ // this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';
699
+ // this.isDone = true;
700
+ // }
701
+ // }
702
+ // }}
703
+ // />
704
+ // )}
705
+ // </div>
706
+ // </div>
707
+ // </Host>
708
+ // );
709
+ // }
686
710
  return (h(Host, null, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
687
711
  const pageNumbers = integerSequence(1, envelopeDocument.pages);
688
712
  return (h(Fragment, null, pageNumbers.map(pageNumber => {