@verdocs/web-sdk 1.9.25 → 1.9.26
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/{Envelopes-a9646e09.js → Envelopes-d44c4a28.js} +3 -2
- package/dist/cjs/Envelopes-d44c4a28.js.map +1 -0
- package/dist/cjs/{VerdocsEndpoint-a9bf9d59.js → VerdocsEndpoint-257ebdb3.js} +7 -5
- package/dist/cjs/VerdocsEndpoint-257ebdb3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +154 -0
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +6 -4
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -0
- package/dist/collection/components/elements/verdocs-field-checkbox/verdocs-field-checkbox.css +1 -1
- package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +903 -0
- package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +3 -0
- package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -0
- package/dist/collection/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +4 -2
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +2 -170
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
- package/dist/collection/utils/Envelopes.js +2 -1
- package/dist/collection/utils/Envelopes.js.map +1 -1
- package/dist/components/VerdocsEndpoint.js +6 -4
- package/dist/components/VerdocsEndpoint.js.map +1 -1
- package/dist/components/templateStore.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-checkbox.js.map +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-date.js.map +1 -1
- package/dist/components/verdocs-field-radio-button.js +1 -1
- package/dist/components/verdocs-field-radio-button.js.map +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-textbox.js.map +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-field-timestamp.js.map +1 -1
- package/dist/components/verdocs-ok-dialog2.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js.map +1 -1
- package/dist/components/verdocs-sign.js +22 -15
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-view.js +1 -259
- package/dist/components/verdocs-view.js.map +1 -1
- package/dist/components/verdocs-view2.js +152 -0
- package/dist/components/verdocs-view2.js.map +1 -0
- package/dist/docs.json +13 -2
- package/dist/esm/{Envelopes-bd915f3e.js → Envelopes-28a4c67f.js} +3 -2
- package/dist/esm/Envelopes-28a4c67f.js.map +1 -0
- package/dist/esm/{VerdocsEndpoint-76dbf9b9.js → VerdocsEndpoint-28ba21cc.js} +7 -5
- package/dist/esm/VerdocsEndpoint-28ba21cc.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +149 -0
- package/dist/esm/verdocs-dropdown_2.entry.js.map +1 -0
- package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js.map +1 -1
- package/dist/esm/verdocs-preview.entry.js +1 -1
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +6 -4
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Envelopes-28a4c67f.js +2 -0
- package/dist/esm-es5/Envelopes-28a4c67f.js.map +1 -0
- package/dist/esm-es5/{VerdocsEndpoint-76dbf9b9.js → VerdocsEndpoint-28ba21cc.js} +2 -2
- package/dist/esm-es5/{VerdocsEndpoint-76dbf9b9.js.map → VerdocsEndpoint-28ba21cc.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +2 -0
- package/dist/esm-es5/verdocs-dropdown_2.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +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-template-create_4.entry.js +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-view/verdocs-view.d.ts +0 -1
- package/dist/verdocs-web-sdk/p-070ba589.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-070ba589.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-75f6a179.system.entry.js → p-0ca01601.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-75f6a179.system.entry.js.map → p-0ca01601.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-1058c062.system.js +2 -0
- package/dist/verdocs-web-sdk/p-1058c062.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-15aa525d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-15aa525d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6524809d.entry.js → p-1cb6f31a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6524809d.entry.js.map → p-1cb6f31a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-93ada77f.system.entry.js → p-1f18d214.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-93ada77f.system.entry.js.map → p-1f18d214.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-8251b9eb.entry.js → p-23e0d562.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-8251b9eb.entry.js.map → p-23e0d562.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-4363499a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-4363499a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0a92a141.system.entry.js → p-4b516c47.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-4b516c47.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-61e0f6dd.system.entry.js → p-4d371bfe.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-61e0f6dd.system.entry.js.map → p-4d371bfe.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-a0259b33.system.entry.js → p-5597170d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a0259b33.system.entry.js.map → p-5597170d.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-71de4718.entry.js → p-577d46e3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-71de4718.entry.js.map → p-577d46e3.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d5af4c62.entry.js → p-5a08e378.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d5af4c62.entry.js.map → p-5a08e378.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-1f1127dd.js → p-5e67c42f.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1f1127dd.js.map → p-5e67c42f.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-5f036dfe.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-5f036dfe.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-27f3e394.entry.js → p-619a388e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-27f3e394.entry.js.map → p-619a388e.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-19435eaf.entry.js → p-695a3cce.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-19435eaf.entry.js.map → p-695a3cce.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-6ec79ddc.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-6ec79ddc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-74401f2e.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-74401f2e.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-cf1ed6b8.system.js → p-7a6c829f.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-cf1ed6b8.system.js.map → p-7a6c829f.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-08110f98.entry.js → p-7fd610f5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-08110f98.entry.js.map → p-7fd610f5.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a9413269.entry.js → p-87a424a0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a9413269.entry.js.map → p-87a424a0.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-2557ce63.system.entry.js → p-9dc3b579.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2557ce63.system.entry.js.map → p-9dc3b579.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d2c1dcf9.system.entry.js → p-a42a5853.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d2c1dcf9.system.entry.js.map → p-a42a5853.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a526fa66.system.entry.js → p-a98ced34.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a526fa66.system.entry.js.map → p-a98ced34.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-b5f64429.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b5f64429.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-d9b9a354.system.entry.js → p-ba6c3671.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d9b9a354.system.entry.js.map → p-ba6c3671.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-d4afe7a5.entry.js → p-c41d9fc0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d4afe7a5.entry.js.map → p-c41d9fc0.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d86dc6d1.system.entry.js → p-c6de4457.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d86dc6d1.system.entry.js.map → p-c6de4457.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-c731755d.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-c731755d.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-da9f0046.system.entry.js → p-db837a46.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-da9f0046.system.entry.js.map → p-db837a46.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-de06e0c6.js +2 -0
- package/dist/verdocs-web-sdk/p-de06e0c6.js.map +1 -0
- package/dist/verdocs-web-sdk/p-e02e05a2.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-e02e05a2.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-474155b8.system.entry.js → p-f47224c8.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-474155b8.system.entry.js.map → p-f47224c8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-958a833f.entry.js → p-f68306f5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-958a833f.entry.js.map → p-f68306f5.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-e3811c48.entry.js → p-f9103136.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-f9103136.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 +2 -2
- package/dist/cjs/Envelopes-a9646e09.js.map +0 -1
- package/dist/cjs/VerdocsEndpoint-a9bf9d59.js.map +0 -1
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +0 -91
- package/dist/cjs/verdocs-dropdown.cjs.entry.js.map +0 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +0 -239
- package/dist/cjs/verdocs-view.cjs.entry.js.map +0 -1
- package/dist/components/Envelopes.js +0 -62
- package/dist/components/Envelopes.js.map +0 -1
- package/dist/esm/Envelopes-bd915f3e.js.map +0 -1
- package/dist/esm/VerdocsEndpoint-76dbf9b9.js.map +0 -1
- package/dist/esm/verdocs-dropdown.entry.js +0 -87
- package/dist/esm/verdocs-dropdown.entry.js.map +0 -1
- package/dist/esm/verdocs-view.entry.js +0 -235
- package/dist/esm/verdocs-view.entry.js.map +0 -1
- package/dist/esm-es5/Envelopes-bd915f3e.js +0 -2
- package/dist/esm-es5/Envelopes-bd915f3e.js.map +0 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +0 -2
- package/dist/esm-es5/verdocs-dropdown.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-view.entry.js +0 -2
- package/dist/esm-es5/verdocs-view.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-05433ef8.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-05433ef8.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0a92a141.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3622cb3c.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-3622cb3c.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4e1fc08d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-4e1fc08d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4e775928.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-4e775928.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7e140c6b.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-7e140c6b.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-89641895.system.js +0 -2
- package/dist/verdocs-web-sdk/p-89641895.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-be67bcbf.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-be67bcbf.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c314c231.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c314c231.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d5c00a37.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5c00a37.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d774ad24.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d774ad24.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d942510c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d942510c.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dbb4398c.js +0 -2
- package/dist/verdocs-web-sdk/p-dbb4398c.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e3811c48.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e7295a17.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e7295a17.system.entry.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-97329951.system.js","./p-78f5c8ad.system.js","./p-a7433630.system.js","./p-7efdefa3.system.js","./p-cf1ed6b8.system.js","./p-89641895.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-0f6da8c7.system.js"],(function(e){"use strict";var t,n,i,r,o,s,a,l,d,c,u,p,h,f,v,g,m,x,b,y;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;o=e.F},function(e){s=e.b;a=e.s;l=e.u;d=e.c;c=e.d;u=e.f;p=e.a;h=e.r;f=e.e},function(){},function(e){v=e.a;g=e.i},function(e){m=e.V},function(e){x=e.g;b=e.s},function(e){y=e.S},function(){},function(){}],execute:function(){var w=undefined&&undefined.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var k=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var I=function(e,t,n,i){return w(void 0,void 0,void 0,(function(){return k(this,(function(r){return[2,e.api.put("/envelopes/".concat(t,"/recipients/").concat(n),i).then((function(e){return e.data}))]}))}))};var S=function(e,t,n){return I(e,t,n,{action:"submit"})};var _=function(e,t,n){return I(e,t,n,{action:"decline"})};var F=function(e,t,n,i){return I(e,t,n,{action:"update",agreed:i})};var L=function(e,t,n){var i=new FormData;i.append("signature",n,t);return e.api.post("/signatures",i).then((function(e){return e.data}))};var N=function(e,t,n){var i=new FormData;i.append("initial",n,t);return e.api.post("/initials",i).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .header{color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 15px;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-sign .header .logo{width:80px;margin:-6px 0 0 10px}verdocs-sign .header .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;padding:0 15px;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-sign .document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}@media print{verdocs-sign .header{display:none}}';var D='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>';var C='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>';var z=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.envelopeLoaded=n(this,"envelopeLoaded",7);this.envelopeUpdated=n(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.fields=[];this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false}e.prototype.componentWillLoad=function(){this.endpoint=new m({sessionType:"signing"})};e.prototype.componentDidLoad=function(){return w(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,d,c,u,p;var h=this;return k(this,(function(f){switch(f.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new y("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new y("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(n=this.sdkError)===null||n===void 0?void 0:n.emit(new y("[SIGN] Missing required inviteCode",500,""));return[2]}f.label=1;case 1:f.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:l=f.sent(),d=l.session,c=l.recipient,u=l.signerToken;console.log("[SIGN] Loaded signing session ".concat(d.email," / ").concat(d.profile_id));this.recipient=c;this.signerToken=u;this.endpoint.setToken(u);if(this.recipient.agreed){this.nextButtonLabel="Next"}return[4,x(this.endpoint,this.envelopeId)];case 3:f.sent();this.recipientIndex=b.envelope.recipients.findIndex((function(e){return e.role_name==h.roleId}));if(this.recipientIndex>-1){this.recipient=b.envelope.recipients[this.recipientIndex];this.fields=this.recipient.fields}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);console.log("Done",this.isDone);(i=this.envelopeLoaded)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:b.envelope});return[3,5];case 4:p=f.sent();console.log("Error with signing session",p);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new y(p.message,(o=p.response)===null||o===void 0?void 0:o.status,(a=p.response)===null||a===void 0?void 0:a.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;F(this.endpoint,this.envelopeId,this.roleId,true).then((function(t){var n;e.nextButtonLabel="Next";e.recipient=t;(n=e.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:e.endpoint,envelope:b.envelope,event:"agreed"})})).catch((function(t){var n,i,r;console.log("Update failure",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new y(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return w(this,void 0,void 0,(function(){var t,n;return k(this,(function(i){switch(i.label){case 0:t=e.detail.id;switch(t){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;return[3,7];case 2:return[3,7];case 3:return[4,_(this.endpoint,this.envelopeId,this.roleId)];case 4:n=i.sent();console.log("Decline result",n);this.isDone=true;return[3,7];case 5:window.print();return[3,7];case 6:a(this.endpoint,b.envelope,b.envelope.envelope_document_id).catch((function(){}));return[3,7];case 7:return[2]}}))}))};e.prototype.saveFieldChange=function(e,t){var n=this;l(this.endpoint,this.envelopeId,e,t).catch((function(e){var t,i,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.errorMessage="Signing session expired."}else{console.log("[SIGN] Server error",e)}(o=n.sdkError)===null||o===void 0?void 0:o.emit(new y(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return w(this,void 0,void 0,(function(){var n,i,r,o,s,s,a,l,u;var p=this;return k(this,(function(h){switch(h.label){case 0:n=t.target,i=n.value,r=n.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:i})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,h.sent().blob()];case 7:a=h.sent();return[2,N(this.endpoint,"initial",a).then((function(t){console.log("New initials",e.name,t);c(p.endpoint,p.envelopeId,e.name,t.id)}))];case 8:return[4,fetch(t.detail)];case 9:return[4,h.sent().blob()];case 10:l=h.sent();return[2,L(this.endpoint,"signature",l).then((function(t){console.log("New sign",e.name,t);d(p.endpoint,p.envelopeId,e.name,t.id)}))];case 11:u=t.target.getAttribute("iso");return[2,this.saveFieldChange(e.name,{prepared:false,value:u})];case 12:console.log("Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:i,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,n,i,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,p=u===void 0?"":u,h=c.value,f=h===void 0?"":h,m=c.base64,x=m===void 0?"":m;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return g(p);case"phone":return v(p);default:return!d||p!==""}case"signature":case"initial":return!d||x!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||p!=="";case"dropdown":return!d||f!=="";case"checkbox_group":var b=(((i=(n=e.settings)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.filter((function(e){return e.checked})))||[]).length;return!d||b>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&b<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return w(this,void 0,void 0,(function(){var e,t,n,i,r,o,s,a,l,d;var c=this;return k(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);return[4,S(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.showDone=true;this.isDone=true;return[3,4];case 3:n=u.sent();console.log("Error submitting",n);return[3,4];case 4:return[2];case 5:i=this.fields.filter((function(e){return e.required}));r=i.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=i.length){o=0}s=i[o];a=0;if(a<i.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=i.length){o=0}s=i[o]}if(a>=i.length){s=null}if(s){l=f(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",t);this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,n,i){var r=this;var o;i.addEventListener("input",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.setAttribute("roleindex",n);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?u(this.recipient.full_name):"");i.setAttribute("name",((o=this.recipient)===null||o===void 0?void 0:o.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var n=e.detail;var i=p(b.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===n.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:n,roleIndex:i,recipientFields:r});r.forEach((function(e){var r=h(e,n,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}));b.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name})).map((function(e){var i=p(b.roleNames,e.role_name);var r=e.fields.filter((function(e){return e.page===n.pageNumber}));r.forEach((function(e){var r=h(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}r.setAttribute("roleindex",i);r.setAttribute("xScale",n.xScale);r.setAttribute("yScale",n.yScale)}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;var t,n,s,l;if(b.loading||!b.envelope){return i(r,null,i("verdocs-loader",null))}var d=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing",disabled:true},{id:"download",label:"Download"}];return i(r,{class:{agreed:(t=this.recipient)===null||t===void 0?void 0:t.agreed}},!this.isDone&&!this.finishLater&&i("div",{class:"intro"},"Please review and act on these documents."),i("div",{class:"header"},!this.isDone&&!this.finishLater&&i("verdocs-dropdown",{options:d,onOptionSelected:function(t){return e.handleOptionSelected(t)}}),!((n=this.recipient)===null||n===void 0?void 0:n.agreed)?i("div",{class:"agree"},i("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):i(o,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},b.envelope.name),i("div",{style:{flex:"1"}}),i("div",{innerHTML:D,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer"},onClick:function(){return window.print()}}),i("div",{innerHTML:C,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer",margin:"0 16px",maginRight:"30px"},onClick:function(){return a(e.endpoint,b.envelope,b.envelope.envelope_document_id).catch((function(){}))}})),!this.isDone&&!this.finishLater&&i("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!((s=this.recipient)===null||s===void 0?void 0:s.agreed),onClick:function(){return e.handleNext()}})),!this.isDone&&!((l=this.recipient)===null||l===void 0?void 0:l.agreed)?i("div",{class:"cover"}):i("div",{style:{display:"none"}}),i("div",{class:"document"},(b.envelope.documents||[]).map((function(t){var n=__spreadArray([],(t===null||t===void 0?void 0:t.pages)||[],true);n.sort((function(e,t){return e.sequence-t.sequence}));return i(o,null,n.map((function(t){return i("verdocs-document-page",{pageImageUri:t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the document, use the link in the original email notification inviting you to review and finish the document.",onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.",onNext:function(){return e.showDone=false}}))};return e}());z.style=A}}}));
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-97329951.system.js","./p-78f5c8ad.system.js","./p-a7433630.system.js","./p-7efdefa3.system.js","./p-7a6c829f.system.js","./p-1058c062.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-0f6da8c7.system.js"],(function(e){"use strict";var t,n,i,r,o,s,a,l,d,c,u,p,h,f,v,g,m,x,b,y;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;o=e.F},function(e){s=e.b;a=e.s;l=e.u;d=e.c;c=e.d;u=e.f;p=e.a;h=e.r;f=e.e},function(){},function(e){v=e.a;g=e.i},function(e){m=e.V},function(e){x=e.g;b=e.s},function(e){y=e.S},function(){},function(){}],execute:function(){var w=undefined&&undefined.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var k=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var I=function(e,t,n,i){return w(void 0,void 0,void 0,(function(){return k(this,(function(r){return[2,e.api.put("/envelopes/".concat(t,"/recipients/").concat(n),i).then((function(e){return e.data}))]}))}))};var S=function(e,t,n){return I(e,t,n,{action:"submit"})};var _=function(e,t,n){return I(e,t,n,{action:"decline"})};var F=function(e,t,n,i){return I(e,t,n,{action:"update",agreed:i})};var L=function(e,t,n){var i=new FormData;i.append("signature",n,t);return e.api.post("/signatures",i).then((function(e){return e.data}))};var N=function(e,t,n){var i=new FormData;i.append("initial",n,t);return e.api.post("/initials",i).then((function(e){return e.data}))};var D='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .header{color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 15px;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-sign .header .logo{width:80px;margin:-6px 0 0 10px}verdocs-sign .header .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;padding:0 15px;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-sign .document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}@media print{verdocs-sign .header{display:none}}';var A='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>';var C='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>';var E=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.envelopeLoaded=n(this,"envelopeLoaded",7);this.envelopeUpdated=n(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.fields=[];this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false}e.prototype.componentWillLoad=function(){this.endpoint=new m({sessionType:"signing"})};e.prototype.componentDidLoad=function(){return w(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,d,c,u,p;var h=this;return k(this,(function(f){switch(f.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new y("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new y("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(n=this.sdkError)===null||n===void 0?void 0:n.emit(new y("[SIGN] Missing required inviteCode",500,""));return[2]}f.label=1;case 1:f.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:l=f.sent(),d=l.session,c=l.recipient,u=l.signerToken;console.log("[SIGN] Loaded signing session ".concat(d.email," / ").concat(d.profile_id));this.recipient=c;this.signerToken=u;this.endpoint.setToken(u);if(this.recipient.agreed){this.nextButtonLabel="Next"}return[4,x(this.endpoint,this.envelopeId)];case 3:f.sent();this.recipientIndex=b.envelope.recipients.findIndex((function(e){return e.role_name==h.roleId}));if(this.recipientIndex>-1){this.recipient=b.envelope.recipients[this.recipientIndex];this.fields=this.recipient.fields}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);console.log("Done",this.isDone);(i=this.envelopeLoaded)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:b.envelope});return[3,5];case 4:p=f.sent();console.log("Error with signing session",p);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new y(p.message,(o=p.response)===null||o===void 0?void 0:o.status,(a=p.response)===null||a===void 0?void 0:a.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;F(this.endpoint,this.envelopeId,this.roleId,true).then((function(t){var n;e.nextButtonLabel="Next";e.recipient=t;(n=e.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:e.endpoint,envelope:b.envelope,event:"agreed"})})).catch((function(t){var n,i,r;console.log("Update failure",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new y(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return w(this,void 0,void 0,(function(){var t,n;return k(this,(function(i){switch(i.label){case 0:t=e.detail.id;switch(t){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;return[3,7];case 2:return[3,7];case 3:return[4,_(this.endpoint,this.envelopeId,this.roleId)];case 4:n=i.sent();console.log("Decline result",n);this.isDone=true;return[3,7];case 5:window.print();return[3,7];case 6:a(this.endpoint,b.envelope,b.envelope.envelope_document_id).catch((function(){}));return[3,7];case 7:return[2]}}))}))};e.prototype.saveFieldChange=function(e,t){var n=this;l(this.endpoint,this.envelopeId,e,t).catch((function(e){var t,i,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.errorMessage="Signing session expired."}else{console.log("[SIGN] Server error",e)}(o=n.sdkError)===null||o===void 0?void 0:o.emit(new y(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return w(this,void 0,void 0,(function(){var n,i,r,o,s,s,a,l,u;var p=this;return k(this,(function(h){switch(h.label){case 0:n=t.target,i=n.value,r=n.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:i})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,h.sent().blob()];case 7:a=h.sent();return[2,N(this.endpoint,"initial",a).then((function(t){console.log("New initials",e.name,t);c(p.endpoint,p.envelopeId,e.name,t.id)}))];case 8:return[4,fetch(t.detail)];case 9:return[4,h.sent().blob()];case 10:l=h.sent();return[2,L(this.endpoint,"signature",l).then((function(t){console.log("New sign",e.name,t);d(p.endpoint,p.envelopeId,e.name,t.id)}))];case 11:u=t.target.getAttribute("iso");return[2,this.saveFieldChange(e.name,{prepared:false,value:u})];case 12:console.log("Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:i,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,n,i,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,p=u===void 0?"":u,h=c.value,f=h===void 0?"":h,m=c.base64,x=m===void 0?"":m;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return g(p);case"phone":return v(p);default:return!d||p!==""}case"signature":case"initial":return!d||x!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||p!=="";case"dropdown":return!d||f!=="";case"checkbox_group":var b=(((i=(n=e.settings)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.filter((function(e){return e.checked})))||[]).length;return!d||b>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&b<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return w(this,void 0,void 0,(function(){var e,t,n,i,r,o,s,a,l,d;var c=this;return k(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);return[4,S(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.showDone=true;this.isDone=true;return[3,4];case 3:n=u.sent();console.log("Error submitting",n);return[3,4];case 4:return[2];case 5:i=this.fields.filter((function(e){return e.required}));r=i.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=i.length){o=0}s=i[o];a=0;if(a<i.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=i.length){o=0}s=i[o]}if(a>=i.length){s=null}if(s){l=f(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",t);this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,n,i){var r=this;var o;i.addEventListener("input",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.setAttribute("roleindex",n);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?u(this.recipient.full_name):"");i.setAttribute("name",((o=this.recipient)===null||o===void 0?void 0:o.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var n=e.detail;var i=p(b.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===n.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:n,roleIndex:i,recipientFields:r});r.forEach((function(e){var r=h(e,n,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}));b.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name})).map((function(e){var i=p(b.roleNames,e.role_name);var r=e.fields.filter((function(e){return e.page===n.pageNumber}));r.forEach((function(e){var r=h(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}r.setAttribute("roleindex",i);r.setAttribute("xScale",n.xScale);r.setAttribute("yScale",n.yScale)}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;var t,n,s,l;if(b.loading||!b.envelope){return i(r,null,i("verdocs-loader",null))}var d=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing",disabled:true},{id:"download",label:"Download"}];return i(r,{class:{agreed:(t=this.recipient)===null||t===void 0?void 0:t.agreed}},!this.isDone&&!this.finishLater&&i("div",{class:"intro"},"Please review and act on these documents."),!this.isDone&&i("div",{class:"header"},!this.isDone&&!this.finishLater&&i("verdocs-dropdown",{options:d,onOptionSelected:function(t){return e.handleOptionSelected(t)}}),!((n=this.recipient)===null||n===void 0?void 0:n.agreed)?i("div",{class:"agree"},i("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):i(o,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},b.envelope.name),i("div",{style:{flex:"1"}}),i("div",{innerHTML:A,style:{width:"24px",height:"24px",fill:"#fff",cursor:"pointer"},onClick:function(){return window.print()}}),i("div",{innerHTML:C,style:{width:"24px",height:"24px",fill:"#fff",cursor:"pointer",margin:"0 16px",maginRight:"30px"},onClick:function(){return a(e.endpoint,b.envelope,b.envelope.envelope_document_id).catch((function(){}))}})),!this.isDone&&!this.finishLater&&i("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!((s=this.recipient)===null||s===void 0?void 0:s.agreed),onClick:function(){return e.handleNext()}})),!this.isDone&&!((l=this.recipient)===null||l===void 0?void 0:l.agreed)?i("div",{class:"cover"}):i("div",{style:{display:"none"}}),this.isDone?i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)}}):i("div",{class:"document"},(b.envelope.documents||[]).map((function(t){var n=__spreadArray([],(t===null||t===void 0?void 0:t.pages)||[],true);n.sort((function(e,t){return e.sequence-t.sequence}));return i(o,null,n.map((function(t){return i("verdocs-document-page",{pageImageUri:t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the document, use the link in the original email notification inviting you to review and finish the document.",onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.",onNext:function(){return e.showDone=false}}))};return e}());E.style=D}}}));
|
|
2
|
+
//# sourceMappingURL=p-4b516c47.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Recipients.js","node_modules/@verdocs/js-sdk/Envelopes/Signatures.js","node_modules/@verdocs/js-sdk/Envelopes/Initials.js","src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","updateRecipient","endpoint","envelopeId","roleName","params","_a","api","put","concat","r","data","envelopeRecipientSubmit","action","envelopeRecipientDecline","envelopeRecipientAgree","agreed","createSignature","name","signature","FormData","append","post","createInitials","initials","verdocsSignCss","PrintIcon","DownloadIcon","VerdocsSign","exports","recipientIndex","fields","class_1","prototype","componentWillLoad","VerdocsEndpoint","sessionType","componentDidLoad","sdkError","emit","SDKError","roleId","_b","inviteCode","_c","console","log","Envelopes.getSigningSession","_h","_j","session","recipient","signerToken","email","profile_id","setToken","nextButtonLabel","getEnvelopeById","EnvelopeStore","envelope","recipients","findIndex","role_name","_this","isDone","includes","status","_d","envelopeLoaded","e_1","_e","message","_f","response","_g","handleClickAgree","envelopeUpdated","event","catch","handleOptionSelected","detail","id","finishLater","showFinishLater","declineResult","window","print","savePDF","envelope_document_id","saveFieldChange","fieldName","Envelopes.updateEnvelopeField","error","errorMessage","handleFieldChange","field","target","checked","type","prepared","options","settings","map","option","selected","fetch","_k","blob","initialsBlob","newInitials","updateEnvelopeFieldInitials","signatureBlob","newSignature","updateEnvelopeFieldSignature","iso","getAttribute","ts","isFieldValid","required","_l","_m","base64","validator","isValidEmail","isValidPhone","checkedCount","filter","minimum_checked","maximum_checked","handleNext","nextSubmits","showDone","e_2","requiredFields","focusedIndex","focusedField","nextFocusedIndex","nextRequiredField","skips","getFieldId","el","document","getElementById","focusField","checkRecipientFields","invalidFields","attachFieldAttributes","pageInfo","roleIndex","addEventListener","finally","setAttribute","xScale","yScale","fullNameToInitials","full_name","handlePageRendered","getRoleIndex","roleNames","recipientFields","page","pageNumber","forEach","renderDocumentField","disabled","editable","draggable","Array","isArray","otherRecipient","otherRoleIndex","render","loading","h","Host","menuOptions","class","onOptionSelected","onInput","Fragment","src","alt","style","flex","innerHTML","width","height","fill","cursor","onClick","margin","maginRight","size","display","onSdkError","documents","envelopeDocument","pages","__spre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AKzB,YAAQ,MAAAhC,SAAA,OAAA,EAAAA,EAAEiC,KAAKpE,EAAE6G,WAE3G6F,EAAA,MAAA,CAAKG,MAAM,aACPtH,EAAcC,SAASwI,WAAa,IAAI7F,KAAI,SAAA8F,GAC5C,IAAMC,EAAKC,cAAA,IAAQF,IAAgB,MAAhBA,SAAgB,OAAA,EAAhBA,EAAkBC,QAAS,GAAG,MACjDA,EAAME,MAAK,SAACC,EAAGC,GAAM,OAAAD,EAAEE,SAAWD,EAAEC,YAEpC,OACE7B,EAACM,EAAQ,KACNkB,EAAM/F,KAAI,SAAA0D,GAAI,OACba,EAAA,wBAAA,CACE8B,aAAc3C,EAAK4C,YACnBC,aAAc,IACdC,cAAe,IACf7C,WAAYD,EAAK0C,SACjBK,eAAgB,SAAA5O,GAAK,OAAA4F,EAAK6F,mBAAmBzL,IAC7C6O,OAAQ,CACN,CAAC9L,KAAM,OAAQgF,KAAM,UACrB,CAAChF,KAAM,WAAYgF,KAAM,kBAUxC5I,KAAK6H,iBACJ0F,EAAA,oBAAA,CACEoC,QAAQ,8CACR1I,QAAQ,4HACR2I,OAAQ,WAAA,OAAOnJ,EAAKoB,gBAAkB,SAIzC7H,KAAKuI,cAAgBgF,EAAA,oBAAA,CAAmBoC,QAAQ,gBAAgB1I,QAASjH,KAAKuI,aAAcqH,OAAQ,WAAA,OAAOnJ,EAAK8B,aAAe,MAC/HvI,KAAK6K,UACJ0C,EAAA,oBAAA,CACEoC,QAAQ,eACR1I,QAAQ,wOACR2I,OAAQ,WAAA,OAAOnJ,EAAKoE,SAAW,oBAvfnB","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Update a recipient's status block\n */\nexport var updateRecipient = function (endpoint, envelopeId, roleName, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(roleName), params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.\n */\nexport var envelopeRecipientSubmit = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'submit' });\n};\n/**\n * Decline to complete an envelope (signing will not terminated).\n */\nexport var envelopeRecipientDecline = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'decline' });\n};\n/**\n * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.\n */\nexport var envelopeRecipientChangeOwner = function (endpoint, envelopeId, roleName, email, fullName) { return updateRecipient(endpoint, envelopeId, roleName, { action: 'owner_update', email: email, full_name: fullName }); };\n/**\n * Agree to electronic signing.\n */\nexport var envelopeRecipientAgree = function (endpoint, envelopeId, roleName, agreed) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', agreed: agreed });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientUpdateName = function (endpoint, envelopeId, roleName, fullName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', new_full_name: fullName });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientPrepare = function (endpoint, envelopeId, roleName, recipients) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'prepare', recipients: recipients });\n};\nexport var getSignerToken = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"/signer-token\"))\n .then(function (r) { return r.data; });\n};\nexport var getInPersonLink = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"?in_person_link=true\"))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to\n * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field\n * to be \"stamped\" by the user.\n */\nexport var createSignature = function (endpoint, name, signature) {\n var data = new FormData();\n data.append('signature', signature, name);\n return endpoint.api //\n .post(\"/signatures\", data)\n .then(function (r) { return r.data; });\n};\n/**\n * Get the availbable signatures for a user.\n */\nexport var getSignatures = function (endpoint) {\n return endpoint.api //\n .get('/signatures')\n .then(function (r) { return r.data; });\n};\n/**\n * Get a user's signature by ID.\n */\nexport var getSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .get(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a user's signature.\n */\nexport var deleteSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .delete(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to\n * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field\n * to be \"stamped\" by the user.\n */\nexport var createInitials = function (endpoint, name, initials) {\n var data = new FormData();\n data.append('initial', initials, name);\n return endpoint.api //\n .post(\"/initials\", data)\n .then(function (r) { return r.data; });\n};\n","@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n .header {\n color: #fff;\n display: flex;\n z-index: 1000;\n flex: 0 0 56px;\n padding: 0 15px;\n font-size: 12px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow: 0 4px 4px 0 rgb(0 0 0 / 24%), 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .logo {\n width: 80px;\n margin: -6px 0 0 10px;\n }\n\n .title {\n padding-left: 16px;\n font-size: 18px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n\n .intro {\n width: 100%;\n display: flex;\n flex: 0 0 60px;\n color: #111111;\n padding: 0 15px;\n font-size: 18px;\n font-weight: 500;\n line-height: 28px;\n flex-direction: row;\n background: #ffffff;\n align-items: center;\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999;\n position: absolute;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .document {\n flex: 1;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .agree {\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 15px;\n\n .intro {\n display: none;\n }\n\n .header {\n flex: 0 0 56px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {createInitials} from '@verdocs/js-sdk/Envelopes/Initials';\nimport {createSignature} from '@verdocs/js-sdk/Envelopes/Signatures';\nimport {IDocumentField, IEnvelope, IRecipient} from '@verdocs/js-sdk/Envelopes/Types';\nimport {envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk/Envelopes/Recipients';\nimport {isValidEmail, isValidPhone} from '@verdocs/js-sdk/Templates/Validators';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldInitials, updateEnvelopeFieldSignature} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport {fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF} from '../../../utils/utils';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop() envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop() roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop() inviteCode: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() recipient: IRecipient | null = null;\n @State() signerToken = null;\n // @State() envelope: IEnvelope | null = null;\n // @State() fields: IDocumentField[] = [];\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() errorMessage = '';\n @State() focusedField = '';\n @State() isDone = false;\n @State() showDone = false;\n\n @State() finishLater = false;\n @State() showFinishLater = false;\n\n recipientIndex: number = -1;\n fields: IDocumentField[] = [];\n\n componentWillLoad() {\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n const {session, recipient, signerToken} = await Envelopes.getSigningSession(this.endpoint, {\n envelopeId: this.envelopeId,\n roleId: this.roleId,\n inviteCode: this.inviteCode,\n });\n\n console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);\n\n this.recipient = recipient;\n this.signerToken = signerToken;\n this.endpoint.setToken(signerToken);\n\n if (this.recipient.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n await getEnvelopeById(this.endpoint, this.envelopeId);\n // const envelope = await Envelopes.getEnvelope(this.endpoint, this.envelopeId);\n // this.envelope = envelope;\n // console.log('[SIGN] Loaded envelope', envelope);\n\n this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];\n this.fields = this.recipient.fields;\n }\n\n this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);\n console.log('Done', this.isDone);\n\n // TODO: Fix service to allow this?\n // const sigs = await getSignatures();\n // console.log('sigs', sigs);\n\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope});\n } catch (e) {\n console.log('Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleClickAgree() {\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(r => {\n this.nextButtonLabel = 'Next';\n this.recipient = r;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('Update failure', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n // this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);\n // if (!window?.['STORYBOOK_ENV']) {\n // window.alert('User intends to sign later.');\n // }\n break;\n case 'claim':\n break;\n case 'decline':\n {\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('Decline result', declineResult);\n this.isDone = true;\n }\n break;\n case 'print':\n window.print();\n break;\n case 'download':\n savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {});\n break;\n }\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n // TODO: Do we want to improve the instructions here?\n console.log('[SIGN] Signing session expired');\n this.errorMessage = 'Signing session expired.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IDocumentField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type) {\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox_group': {\n const options = field.settings.options.map(option => ({id: option.id, checked: e.target.checked}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'radio_button_group': {\n const options = field.settings.options.map(option => ({id: option.id, selected: e.target.value === option.id}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'dropdown':\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(newInitials => {\n console.log('New initials', field.name, newInitials);\n updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n });\n\n case 'signature':\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(newSignature => {\n console.log('New sign', field.name, newSignature);\n updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n });\n\n case 'date':\n const iso = e.target.getAttribute('iso');\n return this.saveFieldChange(field.name, {prepared: false, value: iso});\n\n case 'timestamp':\n console.log('Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldValid(field: IDocumentField) {\n const {required = false} = field;\n const {result = '', value = '', base64 = ''} = field.settings || {};\n switch (field.type) {\n case 'textbox':\n switch (field.settings?.validator || '') {\n case 'email':\n return isValidEmail(result);\n case 'phone':\n return isValidPhone(result);\n default:\n return !required || result !== '';\n }\n\n case 'signature':\n case 'initial':\n return !required || base64 !== '';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'textarea':\n case 'date':\n case 'attachment':\n return !required || result !== '';\n\n case 'dropdown':\n return !required || value !== '';\n\n case 'checkbox_group':\n const checkedCount = (field.settings?.options?.filter(option => option.checked) || []).length;\n return !required || (checkedCount >= (field.settings?.minimum_checked || 0) && checkedCount <= (field.settings?.maximum_checked || 999));\n\n case 'radio_button_group':\n return !required || (field.settings?.options?.filter(option => option.selected) || []).length > 0;\n // TODO\n // case 'checkbox':\n // return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;\n // case 'payment':\n // return <verdocs-field-payment style={style} field={field} id={id} />;\n default:\n return false;\n }\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.showDone = true;\n this.isDone = true;\n // updateRecipientStatus()\n } catch (e) {\n console.log('Error submitting', e);\n }\n return;\n // You're done.\n // You can access the Verdoc at any time by clicking on the link from invitation email.\n //\n // After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\n //\n // Thank you for using Verdocs.\n // Got it, thanks\n }\n\n // Find and focus the next incomplete required field\n const requiredFields = this.fields.filter(field => field.required);\n const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);\n\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = requiredFields[nextFocusedIndex];\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < requiredFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && nextRequiredField.settings?.result === 'signed') {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = requiredFields[nextFocusedIndex];\n }\n\n if (skips >= requiredFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.recipient.fields.filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\n console.log('[SIGN] Remaining invalid fields', invalidFields);\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, roleIndex, el) {\n el.addEventListener('input', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n el.setAttribute('initials', this.recipient ? fullNameToInitials(this.recipient.full_name) : '');\n el.setAttribute('name', this.recipient?.full_name || '');\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, this.recipient.role_name);\n const recipientFields = this.recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n console.log('[SIGN] Page rendered, updating fields', {pageInfo, roleIndex, recipientFields});\n\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, roleIndex, {disabled: false, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, roleIndex, el);\n }\n\n // interact(el).draggable({\n // listeners: {\n // start(event) {\n // console.log('[FIELDS] Drag started', event.type, event.target);\n // },\n // move(event) {\n // const oldX = +(event.target.getAttribute('posX') || 0);\n // const oldY = +(event.target.getAttribute('posY') || 0);\n // const xScale = +(event.target.getAttribute('xScale') || 1);\n // const yScale = +(event.target.getAttribute('yScale') || 1);\n // const newX = event.dx / xScale + oldX;\n // const newY = event.dy / yScale + oldY;\n // event.target.setAttribute('posX', newX);\n // event.target.setAttribute('posy', newY);\n // updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n // },\n // end(event) {\n // console.log('[FIELDS] Drag ended', event);\n // // event.target.setAttribute('posX', 0);\n // // event.target.setAttribute('posy', 0);\n // // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n // },\n // },\n // });\n });\n\n // Render fields for \"the other\" recipients\n EnvelopeStore.envelope.recipients\n .filter(recipient => recipient.role_name !== this.recipient.role_name)\n .map(otherRecipient => {\n const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);\n const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, otherRoleIndex, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n el.setAttribute('roleindex', otherRoleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const menuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing', disabled: true},\n {id: 'download', label: 'Download'},\n ];\n\n return (\n <Host class={{agreed: this.recipient?.agreed}}>\n {!this.isDone && !this.finishLater && <div class=\"intro\">Please review and act on these documents.</div>}\n\n {!this.isDone && (\n <div class=\"header\">\n {!this.isDone && !this.finishLater && <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />}\n\n {!this.recipient?.agreed ? (\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"I agree to use electronic records and signatures.\" onInput={() => this.handleClickAgree()} />\n </div>\n ) : (\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer', margin: '0 16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n )}\n\n {!this.isDone && !this.finishLater && <verdocs-button size=\"small\" label={this.nextButtonLabel} disabled={!this.recipient?.agreed} onClick={() => this.handleNext()} />}\n </div>\n )}\n\n {!this.isDone && !this.recipient?.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\n\n {this.isDone ? (\n // <div>test</div>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n ) : (\n <div class=\"document\">\n {(EnvelopeStore.envelope.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n ))}\n </Fragment>\n );\n })}\n </div>\n )}\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message=\"To complete the document, use the link in the original email notification inviting you to review and finish the document.\"\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.errorMessage && <verdocs-ok-dialog heading=\"Network Error\" message={this.errorMessage} onNext={() => (this.errorMessage = '')} />}\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message=\"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\"\n onNext={() => (this.showDone = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|