@verdocs/web-sdk 5.0.41 → 5.0.43
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +18 -33
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +0 -2
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +0 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +116 -90
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +0 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +123 -95
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -8
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +0 -2
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
- package/dist/components/{p-36368807.js → p-4a04090c.js} +3 -3
- package/dist/components/{p-36368807.js.map → p-4a04090c.js.map} +1 -1
- package/dist/components/{p-c1d312d8.js → p-4a4bf38c.js} +2 -3
- package/dist/components/p-4a4bf38c.js.map +1 -0
- package/dist/components/{p-6bfb8eba.js → p-73a39d5a.js} +19 -34
- package/dist/components/p-73a39d5a.js.map +1 -0
- package/dist/components/{p-795b4192.js → p-91eae04c.js} +3 -3
- package/dist/components/{p-795b4192.js.map → p-91eae04c.js.map} +1 -1
- package/dist/components/{p-52c195dd.js → p-92cce3dc.js} +1 -3
- package/dist/components/{p-52c195dd.js.map → p-92cce3dc.js.map} +1 -1
- package/dist/components/{p-7481c7db.js → p-b474c324.js} +2 -2
- package/dist/components/{p-7481c7db.js.map → p-b474c324.js.map} +1 -1
- package/dist/components/verdocs-build.js +6 -6
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +119 -92
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +18 -33
- package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +0 -2
- package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +0 -1
- package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +117 -91
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +4 -2
- package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
- package/dist/verdocs-web-sdk/p-0c1898f6.system.js.map +1 -1
- package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-56170f1d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-56170f1d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7f982a59.system.entry.js → p-6cfb51e3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-6cfb51e3.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-62bde242.system.entry.js → p-89c69404.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-89c69404.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d47c58de.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-d47c58de.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7962eb00.entry.js → p-e7ca4f15.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e7ca4f15.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-dda88c7f.entry.js → p-e8268ed9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e8268ed9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/p-6bfb8eba.js.map +0 -1
- package/dist/components/p-c1d312d8.js.map +0 -1
- package/dist/custom-elements.json +0 -2198
- package/dist/verdocs-web-sdk/p-1c8788f5.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1c8788f5.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-62bde242.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7962eb00.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7f982a59.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dda88c7f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js +0 -2
- 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,
|
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
|
-
|
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 = [];
|
@@ -120,15 +123,29 @@ const VerdocsSign = class {
|
|
120
123
|
}
|
121
124
|
this.recipientIndex = this.roleNames.findIndex(roleName => roleName == this.roleId);
|
122
125
|
if (this.recipientIndex > -1) {
|
126
|
+
console.log('[SIGN] Processing recipient', this.authStep);
|
123
127
|
this.recipient = this.sortedRecipients[this.recipientIndex];
|
124
128
|
this.agreed = this.recipient.agreed;
|
129
|
+
this.submitted = this.recipient.status === 'submitted';
|
130
|
+
this.authStep = this.recipient.auth_step;
|
131
|
+
if (this.authStep) {
|
132
|
+
console.log('[SIGN] Authentication required', this.authStep);
|
133
|
+
}
|
134
|
+
const auth_method_states = (this.recipient.auth_method_states || {});
|
135
|
+
if (Object.values(auth_method_states).includes('failed')) {
|
136
|
+
this.fatalErrorHeader = 'Recipient Verification Failed';
|
137
|
+
this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
|
138
|
+
this.isDone = true;
|
139
|
+
}
|
140
|
+
// TODO
|
141
|
+
// this.kbaQuestions = (r as any).questions?.question || [];
|
142
|
+
// this.kbaChoices = [];
|
125
143
|
}
|
126
144
|
else {
|
127
145
|
console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);
|
128
146
|
}
|
129
147
|
// TODO: Envelope "complete" | "declined" | "canceled"
|
130
148
|
// TODO: Recipient "canceled"
|
131
|
-
this.submitted = this.recipient.status === 'submitted';
|
132
149
|
this.isDone = this.submitted;
|
133
150
|
this.showDone = this.submitted;
|
134
151
|
if (this.envelope.status === 'canceled') {
|
@@ -144,24 +161,6 @@ const VerdocsSign = class {
|
|
144
161
|
}
|
145
162
|
this.checkRecipientFields();
|
146
163
|
(_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
164
|
}
|
166
165
|
catch (e) {
|
167
166
|
console.log('[SIGN] Error with signing session', e);
|
@@ -580,7 +579,29 @@ const VerdocsSign = class {
|
|
580
579
|
});
|
581
580
|
this.checkRecipientFields();
|
582
581
|
}
|
582
|
+
handleAuthenticateSigner(params) {
|
583
|
+
console.log('[SIGN] Submitting authentication step', params);
|
584
|
+
authenticateSigner(this.endpoint, params)
|
585
|
+
.then(r => {
|
586
|
+
console.log('[SIGN] Authentication successful', r);
|
587
|
+
this.authStep = r.auth_step;
|
588
|
+
this.authDetails = r.auth_details;
|
589
|
+
})
|
590
|
+
.catch(e => {
|
591
|
+
var _a, _b, _c, _d, _e;
|
592
|
+
console.log('[SIGN] Error submitting authentication step', e);
|
593
|
+
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')) {
|
594
|
+
this.fatalErrorHeader = 'Recipient Verification Failed';
|
595
|
+
this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
|
596
|
+
this.isDone = true;
|
597
|
+
}
|
598
|
+
else {
|
599
|
+
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' });
|
600
|
+
}
|
601
|
+
});
|
602
|
+
}
|
583
603
|
render() {
|
604
|
+
console.log('[SIGN] Rendering', { authStep: this.authStep });
|
584
605
|
if (this.showLoadError) {
|
585
606
|
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: () => {
|
586
607
|
window.location.reload();
|
@@ -603,86 +624,91 @@ const VerdocsSign = class {
|
|
603
624
|
if (!this.agreed) {
|
604
625
|
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
626
|
}
|
606
|
-
if (this.
|
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
|
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
|
-
} })))));
|
627
|
+
if (this.authStep === 'passcode') {
|
628
|
+
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
629
|
}
|
629
|
-
if (this.
|
630
|
+
if (this.authStep === 'kba') {
|
630
631
|
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
632
|
const recipDetails = e.detail;
|
632
|
-
|
633
|
-
|
634
|
-
|
633
|
+
this.handleAuthenticateSigner({
|
634
|
+
auth_method: 'kba',
|
635
|
+
first_name: recipDetails.first_name,
|
636
|
+
last_name: recipDetails.last_name,
|
635
637
|
address: recipDetails.address,
|
636
638
|
city: recipDetails.city,
|
637
639
|
state: recipDetails.state,
|
638
640
|
zip: recipDetails.zip,
|
639
|
-
|
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' });
|
641
|
+
ssn_last_4: recipDetails.ssn_last_4,
|
642
|
+
dob: recipDetails.dob,
|
649
643
|
});
|
650
644
|
} })))));
|
651
645
|
}
|
652
|
-
if (this.kbaStep === 'challenge') {
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
646
|
+
// if (this.kbaStep === 'challenge') {
|
647
|
+
// const questionNumber = this.kbaChoices.length;
|
648
|
+
// const kbaQuestion = this.kbaQuestions[questionNumber];
|
649
|
+
// return (
|
650
|
+
// <Host class="kba">
|
651
|
+
// <div id="verdocs-sign-header">
|
652
|
+
// <div class="inner">
|
653
|
+
// <img src="https://verdocs.com/assets/white-logo.svg" alt="Verdocs Logo" class="logo" />
|
654
|
+
// <div class="title">{this.envelope.name}</div>
|
655
|
+
// </div>
|
656
|
+
// </div>
|
657
|
+
//
|
658
|
+
// <div class="document" style={{paddingTop: '15px'}}>
|
659
|
+
// <img
|
660
|
+
// src="https://public-assets.verdocs.com/loading-placeholder.png"
|
661
|
+
// style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}
|
662
|
+
// alt="Placeholder page"
|
663
|
+
// />
|
664
|
+
// </div>
|
665
|
+
//
|
666
|
+
// <div class="cover">
|
667
|
+
// <div class="kba">
|
668
|
+
// {this.kbaChoices.length >= this.kbaQuestions.length ? (
|
669
|
+
// <verdocs-spinner />
|
670
|
+
// ) : (
|
671
|
+
// <verdocs-kba-dialog
|
672
|
+
// mode="choice"
|
673
|
+
// helptitle="Your identity requires additional verification"
|
674
|
+
// helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}
|
675
|
+
// choices={kbaQuestion?.answer || ['Skip Question']}
|
676
|
+
// step={questionNumber + 1}
|
677
|
+
// steps={this.kbaQuestions.length}
|
678
|
+
// onNext={async (e: any) => {
|
679
|
+
// const answer = e.detail as string;
|
680
|
+
// this.kbaChoices = [...this.kbaChoices, answer];
|
681
|
+
// if (this.kbaChoices.length >= this.kbaQuestions.length) {
|
682
|
+
// const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));
|
683
|
+
// console.log('Submitting KBA responses', this.kbaChoices, responses);
|
684
|
+
// try {
|
685
|
+
// const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);
|
686
|
+
// console.log('KBA challenge response', response);
|
687
|
+
// this.kbaStep = response.kba_step;
|
688
|
+
// if (this.kbaStep === 'failed') {
|
689
|
+
// this.fatalErrorHeader = 'Identity Verification Failed';
|
690
|
+
// this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
|
691
|
+
// this.isDone = true;
|
692
|
+
// } else {
|
693
|
+
// this.kbaQuestions = (response as any).questions?.question || [];
|
694
|
+
// this.kbaChoices = [];
|
695
|
+
// }
|
696
|
+
// } catch (e) {
|
697
|
+
// console.log('Error submitting KBA challenge', e);
|
698
|
+
// this.kbaStep = '';
|
699
|
+
// this.fatalErrorHeader = 'Unable to Verify Identity';
|
700
|
+
// this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';
|
701
|
+
// this.isDone = true;
|
702
|
+
// }
|
703
|
+
// }
|
704
|
+
// }}
|
705
|
+
// />
|
706
|
+
// )}
|
707
|
+
// </div>
|
708
|
+
// </div>
|
709
|
+
// </Host>
|
710
|
+
// );
|
711
|
+
// }
|
686
712
|
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
713
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|
688
714
|
return (h(Fragment, null, pageNumbers.map(pageNumber => {
|