@verdocs/web-sdk 4.2.117 → 4.2.119
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/{utils-c878d0c2.js → utils-469e8fc5.js} +1 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_9.cjs.entry.js +28 -16
- package/dist/cjs/verdocs-sign.cjs.entry.js +3 -27
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +2 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +4 -28
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +27 -15
- package/dist/collection/utils/utils.js +1 -0
- package/dist/components/utils.js +1 -0
- package/dist/components/verdocs-auth.js +1 -1
- package/dist/components/verdocs-sign.js +3 -27
- package/dist/components/verdocs-template-fields2.js +27 -15
- package/dist/components/verdocs-upload-dialog2.js +1 -1
- package/dist/esm/{utils-0a9eb6f8.js → utils-06448b9b.js} +1 -0
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm/verdocs-kba-dialog_2.entry.js +1 -1
- package/dist/esm/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_9.entry.js +28 -16
- package/dist/esm/verdocs-sign.entry.js +4 -28
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/{utils-0a9eb6f8.js → utils-06448b9b.js} +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_9.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -1
- package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +0 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/verdocs-web-sdk/p-1151b8f6.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-195fbae1.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-9ee3f90d.entry.js → p-1cf84ac4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-d41c5eae.entry.js → p-345f08c2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3a0db043.entry.js → p-35fa7834.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d1241532.entry.js → p-3bd8fbaa.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b57446bb.system.entry.js → p-4af90836.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-97e16d5d.entry.js → p-4d9b8926.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-98b60918.system.entry.js → p-6465a990.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8f29bffd.system.entry.js → p-75079e4e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-476996a3.system.entry.js → p-77feaf73.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-fd27aa1a.system.entry.js → p-79d28740.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1f4feeff.system.entry.js → p-8ac88c27.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a583ffe0.system.entry.js → p-8f68db2b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b5c1bd5.system.entry.js → p-952f4967.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7933fc15.system.js → p-b96a9a0f.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-123768d7.entry.js → p-ba49517a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e0d7224c.system.entry.js → p-bab9ba61.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5c903ba4.entry.js → p-c97702db.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-cbac8750.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-925f6ad5.js → p-ddcffa6b.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c7606304.entry.js → p-fb70eb59.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-226ae566.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a24ad229.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e5b0751b.entry.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,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(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,o;n<r;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-a68c7262.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,getEnvelope,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,envelopeRecipientSubmit,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-0a9eb6f8.js";import{a as createTemplateFieldStoreFromEnvelope}from"./TemplateFieldStore-68bf6acd.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-0771834a.js";import"./index-a971a584.js";var verdocsSignCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;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}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-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 .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.canceled=false;this.declined=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep=""}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}h.label=1;case 1:h.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=h.sent(),l=a.envelope,c=a.recipient;console.log("[SIGN] Loaded signing session",l,c);this.recipient=c;this.envelope=l;createTemplateFieldStoreFromEnvelope(this.envelope);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==u.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.submitted=this.recipient.status==="submitted";this.declined=this.recipient.status==="declined";this.canceled=this.envelope.status==="canceled";this.isDone=this.submitted||this.declined||this.canceled;if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){console.log("[SIGN] KBA Step",e);u.kbaStep=e.kba_step})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:d=h.sent();console.log("[SIGN] Error with signing session",d);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(d.message,(o=d.response)===null||o===void 0?void 0:o.status,(s=d.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,r;console.log("[SIGN] Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:s=e.detail.id;switch(s){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;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=d.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.declined=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.isDone=true})).catch((function(e){c.isDone=true;console.log("[SIGN] Error reloading envelope",e)}));return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;updateDocumentFieldValue(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);updateEnvelopeField(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=i.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(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 __awaiter(this,void 0,void 0,(function(){var i,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:i=t.target,n=i.value,r=i.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":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:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 6:return[4,d.sent().blob()];case 7:s=d.sent();return[2,createInitials(this.endpoint,"initial",s).then((function(t){return __awaiter(c,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))}))];case 8:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(t){return __awaiter(c,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e)}))];case 11:l=t.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var t=e.value,i=t===void 0?"":t;switch(e.type){case"textbox":switch(e.validator||""){case"email":return isValidEmail(i);case"phone":return isValidPhone(i);default:return i!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"textarea":case"date":return i!=="";case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(t){return t.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));e.sort((function(e,t){var i=e.x||0;var n=e.y||0;var r=t.x||0;var o=t.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:i-r}));return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:i=h.sent();console.log("[SIGN] Submitted successfully",i);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){u.envelope=e})).catch((function(e){console.log("[SIGN] Error reloading envelope",e)}));return[3,4];case 3:n=h.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:r=this.getSortedFillableFields().filter((function(e){return!u.isFieldFilled(e)}));r.sort((function(e,t){var i=e.x||0;var n=e.y||0;var r=t.x||0;var o=t.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:i-r}));o=r.findIndex((function(e){return e.name===u.focusedField}));s=o+1;if(s>=r.length){s=0}a=r[s];l=0;if(l<r.length&&["signature","initial"].includes(a.type)&&((t=a.settings)===null||t===void 0?void 0:t.result)==="signed"){l++;s++;if(s>=r.length){s=0}a=r[s]}if(l>=r.length){a=null}if(a){c=getFieldId(a);d=document.getElementById(c);d===null||d===void 0?void 0:d.focusField();d===null||d===void 0?void 0:d.scrollTo({behavior:"smooth",top:0});this.focusedField=a.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;i.addEventListener("input",(function(e){console.log("onInput",e.target.type,e.target.name);if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name,e.detail)];case 1:i=n.sent();console.log("upload result",i);this.checkRecipientFields();return[2]}}))}))}));i.addEventListener("remove",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value);deleteEnvelopeFieldAttachment(n.endpoint,n.envelopeId,t.name).then((function(e){console.log("[SIGN] Deleted attachment",e)})).catch((function(e){return console.log("[SIGN] Error deleting attachment",e)}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var r=formatFullName(this.recipient);i.setAttribute("initials",fullNameToInitials(r));i.setAttribute("name",r)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=this.getSortedFillableFields();console.log("Recipient fields",n);n.forEach((function(e,n){if(e.page!==i.pageNumber){return}var r=renderDocumentField(e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=renderDocumentField(e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){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:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,envelope:this.envelope,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){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:function(){return e.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"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,t.detail).then((function(t){console.log("[SIGN] PIN code submission result",t);if(t.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var t,i;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}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:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=integerSequence(1,t.pages);return h(Fragment,null,i.map((function(i){return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):r(e.value).then(s,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,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(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;r=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,r=i.length,o;n<r;n++){if(o||!(n in i)){if(!o)o=Array.prototype.slice.call(i,0,n);o[n]=i[n]}}return e.concat(o||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-a68c7262.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,getEnvelope,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,sortFields,envelopeRecipientSubmit,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-06448b9b.js";import{a as createTemplateFieldStoreFromEnvelope}from"./TemplateFieldStore-68bf6acd.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-0771834a.js";import"./index-a971a584.js";var verdocsSignCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;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}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-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 .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.canceled=false;this.declined=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep=""}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}h.label=1;case 1:h.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=h.sent(),l=a.envelope,c=a.recipient;console.log("[SIGN] Loaded signing session",l,c);this.recipient=c;this.envelope=l;createTemplateFieldStoreFromEnvelope(this.envelope);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==u.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.submitted=this.recipient.status==="submitted";this.declined=this.recipient.status==="declined";this.canceled=this.envelope.status==="canceled";this.isDone=this.submitted||this.declined||this.canceled;if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){console.log("[SIGN] KBA Step",e);u.kbaStep=e.kba_step})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:d=h.sent();console.log("[SIGN] Error with signing session",d);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(d.message,(o=d.response)===null||o===void 0?void 0:o.status,(s=d.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var i;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(i=e.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(i){var t,n,r;console.log("[SIGN] Update failure",i);e.submitting=false;(t=e.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(i.message,(n=i.response)===null||n===void 0?void 0:n.status,(r=i.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:s=e.detail.id;switch(s){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;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=d.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.declined=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.isDone=true})).catch((function(e){c.isDone=true;console.log("[SIGN] Error reloading envelope",e)}));return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=i.value;n.settings=i.settings;updateDocumentFieldValue(n);t.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);updateEnvelopeField(this.endpoint,this.envelopeId,e,i).then((function(i){return t.updateRecipientFieldValue(e,i)})).catch((function(e){var i,n,r,o,s,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");t.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=t.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(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,i){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:t=i.target,n=t.value,r=t.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":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:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,i.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:i.detail})];case 5:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 6:return[4,d.sent().blob()];case 7:s=d.sent();return[2,createInitials(this.endpoint,"initial",s).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))}))];case 8:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",i);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e)}))];case 11:l=i.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:i.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var i=e.value,t=i===void 0?"":i;switch(e.type){case"textbox":switch(e.validator||""){case"email":return isValidEmail(t);case"phone":return isValidPhone(t);default:return t!==""}case"signature":return t==="signed";case"initial":return t==="initialed";case"timestamp":return true;case"textarea":case"date":return t!=="";case"attachment":return t==="attached";case"dropdown":return t!=="";case"checkbox":return t==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(i){return i.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));sortFields(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:t=h.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){u.envelope=e})).catch((function(e){console.log("[SIGN] Error reloading envelope",e)}));return[3,4];case 3:n=h.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:r=this.getSortedFillableFields().filter((function(e){return!u.isFieldFilled(e)}));sortFields(r);o=r.findIndex((function(e){return e.name===u.focusedField}));s=o+1;if(s>=r.length){s=0}a=r[s];l=0;if(l<r.length&&["signature","initial"].includes(a.type)&&((i=a.settings)===null||i===void 0?void 0:i.result)==="signed"){l++;s++;if(s>=r.length){s=0}a=r[s]}if(l>=r.length){a=null}if(a){c=getFieldId(a);d=document.getElementById(c);d===null||d===void 0?void 0:d.focusField();d===null||d===void 0?void 0:d.scrollTo({behavior:"smooth",top:0});this.focusedField=a.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(i){return i.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var i=this.getRecipientFields().filter((function(i){return!e.isFieldValid(i)}));if(i.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",i);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,i,t){var n=this;t.addEventListener("input",(function(e){console.log("onInput",e.target.type,e.target.name);if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));t.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,i.name,e.detail)];case 1:t=n.sent();console.log("upload result",t);this.checkRecipientFields();return[2]}}))}))}));t.addEventListener("remove",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value);deleteEnvelopeFieldAttachment(n.endpoint,n.envelopeId,i.name).then((function(e){console.log("[SIGN] Deleted attachment",e)})).catch((function(e){return console.log("[SIGN] Error deleting attachment",e)}))}));t.addEventListener("focusout",(function(e){if(i.type!=="dropdown"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}}));t.addEventListener("fieldChange",(function(e){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);var r=formatFullName(this.recipient);t.setAttribute("initials",fullNameToInitials(r));t.setAttribute("name",r)};e.prototype.handlePageRendered=function(e){var i=this;var t=e.detail;var n=this.getSortedFillableFields();console.log("Recipient fields",n);n.forEach((function(e,n){if(e.page!==t.pageNumber){return}var r=renderDocumentField(e,t,{disabled:false,editable:false,draggable:false,done:i.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==i.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){i.getRecipientFields().filter((function(e){return e.page===t.pageNumber})).forEach((function(e){var n=renderDocumentField(e,t,{disabled:true,editable:false,draggable:false,done:i.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){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:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,envelope:this.envelope,onSdkError:function(i){var t;return(t=e.sdkError)===null||t===void 0?void 0:t.emit(i.detail)}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){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:function(){return e.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"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(i){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,i.detail).then((function(i){console.log("[SIGN] PIN code submission result",i);if(i.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var i,t;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}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:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(i){var t=integerSequence(1,i.pages);return h(Fragment,null,t.map((function(t){return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:t,onPageRendered:function(i){return e.handlePageRendered(i)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function n(e){try{l(i["throw"](e))}catch(e){a(e)}}function l(e){e.done?o(e.value):r(e.value).then(s,n)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return l([e,t])}}function l(n){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(i=1,r&&(a=n[0]&2?r["return"]:n[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;if(r=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;r=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];r=0}finally{i=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-a68c7262.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri}from"@verdocs/js-sdk";import{g as getTemplateFieldStore}from"./TemplateFieldStore-68bf6acd.js";import{t as throttle,i as getControlStyles,g as getFieldId}from"./utils-0a9eb6f8.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./index-a971a584.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-0771834a.js";var verdocsTemplateDocumentPageCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.fieldStore=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.fieldStore=getTemplateFieldStore(this.templateId);return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,i=t;o<i.length;o++){var r=i[o];var a=r.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{key:"a0d656b86f18762601961c420ab39fb439c3ca7e",id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&e.fieldStore.get("fields").filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,i;var r=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var l=e,d=l.xScale,c=l.yScale,p=l.templateId,u=l.editable,f=l.disabled,b=l.done,m=l.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((i=t["settings"])===null||i===void 0?void 0:i.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:r,fieldname:a,templateid:p,editable:u,multiline:n,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"textarea":return h("verdocs-field-textarea",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"date":return h("verdocs-field-date",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"attachment":return h("verdocs-field-attachment",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"dropdown":return h("verdocs-field-dropdown",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"initial":return h("verdocs-field-initial",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"signature":return h("verdocs-field-signature",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"checkbox":return h("verdocs-field-checkbox",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"radio":return h("verdocs-field-radio",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"de2235124c7fbeb0a24950b67617a2acb55cdd69",class:{}},h("div",{key:"35fe164dc6dd850c31d7fa50e91312b14a213da1","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"1b4e2acd66ce940c36736bb5cff35a89f6d3142b",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"df3ad06add46d573dbcdbbf9f675d1b0949d1892","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function n(e){try{l(i["throw"](e))}catch(e){a(e)}}function l(e){e.done?o(e.value):r(e.value).then(s,n)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return l([e,t])}}function l(n){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(i=1,r&&(a=n[0]&2?r["return"]:n[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;if(r=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;r=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];r=0}finally{i=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-a68c7262.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri}from"@verdocs/js-sdk";import{g as getTemplateFieldStore}from"./TemplateFieldStore-68bf6acd.js";import{t as throttle,i as getControlStyles,g as getFieldId}from"./utils-06448b9b.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./index-a971a584.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-0771834a.js";var verdocsTemplateDocumentPageCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.fieldStore=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.fieldStore=getTemplateFieldStore(this.templateId);return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,i=t;o<i.length;o++){var r=i[o];var a=r.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{key:"a0d656b86f18762601961c420ab39fb439c3ca7e",id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&e.fieldStore.get("fields").filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,i;var r=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var l=e,d=l.xScale,c=l.yScale,p=l.templateId,u=l.editable,f=l.disabled,b=l.done,m=l.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((i=t["settings"])===null||i===void 0?void 0:i.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:r,fieldname:a,templateid:p,editable:u,multiline:n,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"textarea":return h("verdocs-field-textarea",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"date":return h("verdocs-field-date",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"attachment":return h("verdocs-field-attachment",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"dropdown":return h("verdocs-field-dropdown",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"initial":return h("verdocs-field-initial",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"signature":return h("verdocs-field-signature",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"checkbox":return h("verdocs-field-checkbox",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});case"radio":return h("verdocs-field-radio",{id:r,fieldname:a,templateid:p,editable:u,disabled:f,done:b,xscale:d,yscale:c,pagenumber:m,style:getControlStyles(t,d,c)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"de2235124c7fbeb0a24950b67617a2acb55cdd69",class:{}},h("div",{key:"35fe164dc6dd850c31d7fa50e91312b14a213da1","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"1b4e2acd66ce940c36736bb5cff35a89f6d3142b",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"df3ad06add46d573dbcdbbf9f675d1b0949d1892","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
2
|
-
import { IRecipient } from '@verdocs/js-sdk';
|
3
2
|
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
4
3
|
import { IEnvelope, IEnvelopeField } from '@verdocs/js-sdk';
|
4
|
+
import { IRecipient } from '@verdocs/js-sdk';
|
5
5
|
import { SDKError } from '../../../utils/errors';
|
6
6
|
/**
|
7
7
|
* Display an envelope signing experience. This will display the envelope's attached
|
package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts
CHANGED
@@ -59,7 +59,6 @@ export declare class VerdocsTemplateFields {
|
|
59
59
|
componentDidRender(): void;
|
60
60
|
componentWillUpdate(): void;
|
61
61
|
handleKeyDown(ev: KeyboardEvent): void;
|
62
|
-
handleFieldChange(field: ITemplateField, e: any, optionId?: string): Promise<void>;
|
63
62
|
attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement): void;
|
64
63
|
cachedPageInfo: Record<number, IDocumentPageInfo>;
|
65
64
|
handlePageRendered(e: any): void;
|
@@ -4,6 +4,7 @@ export declare const defaultWidth: (type: TFieldType) => 150 | 105 | 75 | 85 | 2
|
|
4
4
|
export declare const defaultHeight: (type: TFieldType) => 24 | 14 | 41 | 15 | 20 | 36 | 50;
|
5
5
|
export declare const setControlStyles: (el: HTMLElement, field: ITemplateField | IEnvelopeField, xScale: number, yScale: number) => void;
|
6
6
|
export declare const getControlStyles: (field: ITemplateField | IEnvelopeField, xScale: number, yScale: number) => {
|
7
|
+
zIndex: string;
|
7
8
|
width: string;
|
8
9
|
height: string;
|
9
10
|
position: string;
|
@@ -0,0 +1 @@
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):r(e.value).then(o,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(t=0)),t)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;r=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1];s=a;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(a);break}if(s[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,r=i.length,s;n<r;n++){if(s||!(n in i)){if(!s)s=Array.prototype.slice.call(i,0,n);s[n]=i[n]}}return e.concat(s||Array.prototype.slice.call(i))};System.register(["./p-59073837.system.js","@verdocs/js-sdk","./p-b96a9a0f.system.js","./p-38c6897c.system.js","./p-9b26e4e0.system.js","./p-c8a15cb7.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js","./p-db854498.system.js","./p-38778553.system.js"],(function(e){"use strict";var i,t,n,r,s,o,a,l,c,d,u,h,f,v,p,g,m,x,b,w,y,S,k,N,I,_,G,P,E,A,z,j,D;return{setters:[function(e){i=e.r;t=e.c;n=e.h;r=e.H;s=e.F},function(e){o=e.VerdocsEndpoint;a=e.startSigningSession;l=e.getKbaStep;c=e.envelopeRecipientAgree;d=e.envelopeRecipientDecline;u=e.getEnvelope;h=e.updateEnvelopeField;f=e.createSignature;v=e.updateEnvelopeFieldSignature;p=e.createInitials;g=e.updateEnvelopeFieldInitials;m=e.isValidPhone;x=e.isValidEmail;b=e.sortFields;w=e.envelopeRecipientSubmit;y=e.uploadEnvelopeFieldAttachment;S=e.deleteEnvelopeFieldAttachment;k=e.formatFullName;N=e.fullNameToInitials;I=e.submitKbaPin;_=e.integerSequence},function(e){G=e.a;P=e.u;E=e.r;A=e.g},function(e){z=e.a},function(e){j=e.V},function(e){D=e.S},function(){},function(){},function(){},function(){}],execute:function(){var L='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;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}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-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 .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var R=L;var T=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var U=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var V=e("verdocs_sign",function(){function e(e){i(this,e);this.sdkError=t(this,"sdkError",7);this.envelopeLoaded=t(this,"envelopeLoaded",7);this.envelopeUpdated=t(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.canceled=false;this.declined=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep=""}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new o({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,s,o,c,d,u,h;var f=this;return __generator(this,(function(v){switch(v.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new D("[SIGN] Missing required inviteCode",500,""));return[2]}v.label=1;case 1:v.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:c=v.sent(),d=c.envelope,u=c.recipient;console.log("[SIGN] Loaded signing session",d,u);this.recipient=u;this.envelope=d;z(this.envelope);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==f.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.submitted=this.recipient.status==="submitted";this.declined=this.recipient.status==="declined";this.canceled=this.envelope.status==="canceled";this.isDone=this.submitted||this.declined||this.canceled;if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){l(this.endpoint,this.envelopeId,this.roleId).then((function(e){console.log("[SIGN] KBA Step",e);f.kbaStep=e.kba_step})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:h=v.sent();console.log("[SIGN] Error with signing session",h);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new D(h.message,(s=h.response)===null||s===void 0?void 0:s.status,(o=h.response)===null||o===void 0?void 0:o.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;c(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var i;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(i=e.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(i){var t,n,r;console.log("[SIGN] Update failure",i);e.submitting=false;(t=e.sdkError)===null||t===void 0?void 0:t.emit(new D(i.message,(n=i.response)===null||n===void 0?void 0:n.status,(r=i.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n,r,s,o,a,l;var c=this;return __generator(this,(function(h){switch(h.label){case 0:o=e.detail.id;switch(o){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;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:j("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,d(this.endpoint,this.envelopeId,this.roleId)];case 4:a=h.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.declined=true;console.log("[SIGN] Reloading envelope");u(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.isDone=true})).catch((function(e){c.isDone=true;console.log("[SIGN] Error reloading envelope",e)}));return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){G(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=i.value;n.settings=i.settings;P(n);t.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);h(this.endpoint,this.envelopeId,e,i).then((function(i){return t.updateRecipientFieldValue(e,i)})).catch((function(e){var i,n,r,s,o,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");t.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(s=t.sdkError)===null||s===void 0?void 0:s.emit(new D(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,i){return __awaiter(this,void 0,void 0,(function(){var t,n,r,s,o,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:t=i.target,n=t.value,r=t.checked;s=e.type;switch(s){case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":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:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,i.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:i.detail})];case 5:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 6:return[4,d.sent().blob()];case 7:o=d.sent();return[2,p(this.endpoint,"initial",o).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,g(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))}))];case 8:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,f(this.endpoint,"signature",a).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",i);return[4,v(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e)}))];case 11:l=i.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:i.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var i=e.value,t=i===void 0?"":i;switch(e.type){case"textbox":switch(e.validator||""){case"email":return x(t);case"phone":return m(t);default:return t!==""}case"signature":return t==="signed";case"initial":return t==="initialed";case"timestamp":return true;case"textarea":case"date":return t!=="";case"attachment":return t==="attached";case"dropdown":return t!=="";case"checkbox":return t==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(i){return i.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));b(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,s,o,a,l,c,d;var h=this;return __generator(this,(function(f){switch(f.label){case 0:if(!this.nextSubmits)return[3,5];f.label=1;case 1:f.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,w(this.endpoint,this.envelopeId,this.roleId)];case 2:t=f.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");u(this.endpoint,this.envelopeId).then((function(e){h.envelope=e})).catch((function(e){console.log("[SIGN] Error reloading envelope",e)}));return[3,4];case 3:n=f.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:r=this.getSortedFillableFields().filter((function(e){return!h.isFieldFilled(e)}));b(r);s=r.findIndex((function(e){return e.name===h.focusedField}));o=s+1;if(o>=r.length){o=0}a=r[o];l=0;if(l<r.length&&["signature","initial"].includes(a.type)&&((i=a.settings)===null||i===void 0?void 0:i.result)==="signed"){l++;o++;if(o>=r.length){o=0}a=r[o]}if(l>=r.length){a=null}if(a){c=A(a);d=document.getElementById(c);d===null||d===void 0?void 0:d.focusField();d===null||d===void 0?void 0:d.scrollTo({behavior:"smooth",top:0});this.focusedField=a.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(i){return i.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var i=this.getRecipientFields().filter((function(i){return!e.isFieldValid(i)}));if(i.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",i);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,i,t){var n=this;t.addEventListener("input",(function(e){console.log("onInput",e.target.type,e.target.name);if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));t.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,y(this.endpoint,this.envelopeId,i.name,e.detail)];case 1:t=n.sent();console.log("upload result",t);this.checkRecipientFields();return[2]}}))}))}));t.addEventListener("remove",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value);S(n.endpoint,n.envelopeId,i.name).then((function(e){console.log("[SIGN] Deleted attachment",e)})).catch((function(e){return console.log("[SIGN] Error deleting attachment",e)}))}));t.addEventListener("focusout",(function(e){if(i.type!=="dropdown"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}}));t.addEventListener("fieldChange",(function(e){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);var r=k(this.recipient);t.setAttribute("initials",N(r));t.setAttribute("name",r)};e.prototype.handlePageRendered=function(e){var i=this;var t=e.detail;var n=this.getSortedFillableFields();console.log("Recipient fields",n);n.forEach((function(e,n){if(e.page!==t.pageNumber){return}var r=E(e,t,{disabled:false,editable:false,draggable:false,done:i.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==i.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){i.getRecipientFields().filter((function(e){return e.page===t.pageNumber})).forEach((function(e){var n=E(e,t,{disabled:true,editable:false,draggable:false,done:i.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){return n(r,null,n("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:function(){window.location.reload()}}))}if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,envelope:this.envelope,onSdkError:function(i){var t;return(t=e.sdkError)===null||t===void 0?void 0:t.emit(i.detail)}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}if(!this.agreed){return n(r,{class:"agreed"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"agree"},n("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),n("ul",null,n("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",n("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),n("li",null,"Agree to Verdocs'"," ",n("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",n("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.kbaStep==="pin"){return n(r,{class:"kba"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},n("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(i){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){I(this.endpoint,this.envelopeId,this.roleId,i.detail).then((function(i){console.log("[SIGN] PIN code submission result",i);if(i.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var i,t;console.log("[SIGN] Error submitting PIN",e);j(((t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}return n(r,null,n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}}),!this.finishLater&&n("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),n("div",{style:{marginLeft:"10px"}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?T:U,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),n("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(i){var t=_(1,i.pages);return n(s,null,t.map((function(t){return n("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:t,onPageRendered:function(i){return e.handlePageRendered(i)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," 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(){e.showDone=false;e.isDone=true}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))};return e}());V.style=R}}}));
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as i,h as t,H as s,F as o}from"./p-5207d80c.js";import{VerdocsEndpoint as n,startSigningSession as l,getKbaStep as a,envelopeRecipientAgree as r,envelopeRecipientDecline as d,getEnvelope as c,updateEnvelopeField as h,createSignature as p,updateEnvelopeFieldSignature as g,createInitials as u,updateEnvelopeFieldInitials as v,isValidPhone as m,isValidEmail as x,sortFields as b,envelopeRecipientSubmit as f,uploadEnvelopeFieldAttachment as w,deleteEnvelopeFieldAttachment as y,formatFullName as k,fullNameToInitials as S,submitKbaPin as N,integerSequence as I}from"@verdocs/js-sdk";import{a as G,u as P,r as F,g as E}from"./p-ddcffa6b.js";import{a as R}from"./p-784ac100.js";import{V as z}from"./p-04c07b7b.js";import{S as D}from"./p-fd97809c.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-d38f1299.js";import"./p-83317d11.js";const A=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],j=[{id:"print",label:"Print"},{id:"download",label:"Download"}],L=class{constructor(t){e(this,t),this.sdkError=i(this,"sdkError",7),this.envelopeLoaded=i(this,"envelopeLoaded",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.recipientIndex=-1,this.endpoint=null,this.envelopeId=null,this.roleId=null,this.inviteCode=null,this.headerTargetId=null,this.envelope=null,this.roleNames=[],this.sortedRecipients=[],this.recipient=null,this.hasSignature=!1,this.nextButtonLabel="Start",this.nextSubmits=!1,this.errorMessage="",this.focusedField="",this.submitting=!1,this.submitted=!1,this.canceled=!1,this.declined=!1,this.isDone=!1,this.showDone=!1,this.showLoadError=!1,this.finishLater=!1,this.showFinishLater=!1,this.agreed=!1,this.documentsSingularPlural="document",this.kbaStep=""}componentWillLoad(){this.endpoint||(console.log("[SIGN] Creating signing endpoint"),this.endpoint=new n({sessionType:"signing"}))}async componentDidLoad(){var e,i,t,s,o,n,r;if(this.envelopeId)if(this.roleId)if(this.inviteCode)try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{envelope:e,recipient:i}=await l(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);console.log("[SIGN] Loaded signing session",e,i),this.recipient=i,this.envelope=e,R(this.envelope),this.sortedRecipients=[...this.envelope.recipients],this.sortedRecipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence)),this.roleNames=this.sortedRecipients.map((e=>e.role_name)),this.envelope.documents.length>0&&(this.documentsSingularPlural="document(s)"),this.recipientIndex=this.roleNames.findIndex((e=>e==this.roleId)),this.recipientIndex>-1?(this.recipient=this.sortedRecipients[this.recipientIndex],this.agreed=this.recipient.agreed):console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients),this.submitted="submitted"===this.recipient.status,this.declined="declined"===this.recipient.status,this.canceled="canceled"===this.envelope.status,this.isDone=this.submitted||this.declined||this.canceled,this.agreed&&(this.nextButtonLabel="Next"),this.checkRecipientFields(),null===(s=this.envelopeLoaded)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope}),this.isDone||a(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] KBA Step",e),this.kbaStep=e.kba_step})).catch((e=>console.log("Error getting KBA step",e)))}catch(e){console.log("[SIGN] Error with signing session",e),null===(o=this.sdkError)||void 0===o||o.emit(new D(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(r=e.response)||void 0===r?void 0:r.data)),this.showLoadError=!0}else null===(t=this.sdkError)||void 0===t||t.emit(new D("[SIGN] Missing required inviteCode",500,""));else null===(i=this.sdkError)||void 0===i||i.emit(new D("[SIGN] Missing required roleId",500,""));else null===(e=this.sdkError)||void 0===e||e.emit(new D("[SIGN] Missing required envelopId",500,""))}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-sign-header");e&&i&&(console.log("[SIGN] Moving header"),i.remove(),e.append(i))}handleClickAgree(){this.submitting=!0,r(this.endpoint,this.envelopeId,this.roleId,!0).then((()=>{var e;this.nextButtonLabel="Next",this.recipient.agreed=!0,this.submitting=!1,this.agreed=!0,null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Update failure",e),this.submitting=!1,null===(i=this.sdkError)||void 0===i||i.emit(new D(e.message,null===(t=e.response)||void 0===t?void 0:t.status,null===(s=e.response)||void 0===s?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,o,n;switch(e.detail.id){case"later":this.finishLater=!0,this.showFinishLater=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":z("This feature will be available in an upcoming release."),null===(t=this.envelopeUpdated)||void 0===t||t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=!0;const e=await d(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Decline result",e),null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"}),this.submitting=!1,this.declined=!0,console.log("[SIGN] Reloading envelope"),c(this.endpoint,this.envelopeId).then((e=>{this.envelope=e,this.isDone=!0})).catch((e=>{this.isDone=!0,console.log("[SIGN] Error reloading envelope",e)}))}break;case"print":window.print(),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>"attachment"===e.type));e&&(G(this.endpoint,this.envelope,e.id).catch((e=>{console.log("[SIGN] Error downloading PDF",e)})),null===(n=this.envelopeUpdated)||void 0===n||n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"}))}}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e),this.getRecipientFields().forEach((t=>{t.name===e&&(t.value=i.value,t.settings=i.settings,P(t),this.checkRecipientFields())}))}saveFieldChange(e,i){console.log("[SIGN] updateRecipientFieldValue",e),h(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,l;401===(null===(i=e.response)||void 0===i?void 0:i.status)&&"jwt expired"===(null===(s=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===s?void 0:s.error)?(console.log("[SIGN] Signing session expired"),this.errorMessage="Signing session expired. Please reload your browser to continue."):console.log("[SIGN] Server error",e),null===(o=this.sdkError)||void 0===o||o.emit(new D(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(l=e.response)||void 0===l?void 0:l.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:!1,value:t});case"checkbox":case"radio":return this.saveFieldChange(e.name,{prepared:!1,value:String(i.target.checked)});case"dropdown":return console.log("Saving dropdown",e.name,i.detail),this.saveFieldChange(e.name,{prepared:!1,value:i.detail});case"initial":if(!i.detail)return;const o=await(await fetch(i.detail)).blob();return u(this.endpoint,"initial",o).then((async i=>{const t=await v(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":if(!i.detail)return;const n=await(await fetch(i.detail)).blob();return p(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await g(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)})).catch((e=>{console.warn("[SIGN] Error updating signature",e)}));case"date":const{formattedDate:l}=i.detail;if(l)return this.saveFieldChange(e.name,{prepared:!1,value:l});break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e)}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textbox":switch(e.validator||""){case"email":return x(i);case"phone":return m(i);default:return""!==i}case"signature":return"signed"===i;case"initial":return"initialed"===i;case"timestamp":return!0;case"textarea":case"date":return""!==i;case"attachment":return"attached"===i;case"dropdown":return""!==i;case"checkbox":return"true"===i;case"radio":return e.group?this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>"true"===e.value)):"true"===e.value;default:return!1}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>"timestamp"!==e.type));return b(e),e}async handleNext(){var e,i;if(this.nextSubmits){try{null===(e=document.getElementById("air-datepicker-global-container"))||void 0===e||e.remove(),this.submitting=!0;const i=await f(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i),this.recipient.status="submitted",this.showDone=!0,console.log("[SIGN] Reloading envelope"),c(this.endpoint,this.envelopeId).then((e=>{this.envelope=e})).catch((e=>{console.log("[SIGN] Error reloading envelope",e)}))}catch(e){console.log("[SIGN] Error submitting",e)}return void(this.submitting=!1)}const t=this.getSortedFillableFields().filter((e=>!this.isFieldFilled(e)));b(t);let s=t.findIndex((e=>e.name===this.focusedField))+1;s>=t.length&&(s=0);let o=t[s],n=0;if(n<t.length&&["signature","initial"].includes(o.type)&&"signed"===(null===(i=o.settings)||void 0===i?void 0:i.result)&&(n++,s++,s>=t.length&&(s=0),o=t[s]),n>=t.length&&(o=null),o){const e=E(o),i=document.getElementById(e);null==i||i.focusField(),null==i||i.scrollTo({behavior:"smooth",top:0}),this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));e.length<1?(this.nextButtonLabel="Finish",this.nextSubmits||(this.nextSubmits=!0)):(console.log("[SIGN] Invalid fields remaining",e),this.nextButtonLabel="Next",this.nextSubmits=!1)}attachFieldAttributes(e,i,t){t.addEventListener("input",(e=>{console.log("onInput",e.target.type,e.target.name),"radio"===e.target.type||"checkbox"===e.target.type?this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())):this.checkRecipientFields()})),t.addEventListener("attached",(async e=>{console.log("[SIGN] onAttached",e.detail,e.target.value);const t=await w(this.endpoint,this.envelopeId,i.name,e.detail);console.log("upload result",t),this.checkRecipientFields()})),t.addEventListener("remove",(e=>{console.log("[SIGN] onRemoved",e.detail,e.target.value),y(this.endpoint,this.envelopeId,i.name).then((e=>{console.log("[SIGN] Deleted attachment",e)})).catch((e=>console.log("[SIGN] Error deleting attachment",e)))})),t.addEventListener("focusout",(e=>{"dropdown"!==i.type&&this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))})),t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))})),t.setAttribute("templateid",this.envelope.template_id),t.setAttribute("fieldname",i.name),t.setAttribute("page",e.pageNumber),t.setAttribute("xScale",e.xScale),t.setAttribute("yScale",e.yScale);const s=k(this.recipient);t.setAttribute("initials",S(s)),t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail,t=this.getSortedFillableFields();console.log("Recipient fields",t),t.forEach(((e,t)=>{if(e.page!==i.pageNumber)return;const s=F(e,i,{disabled:!1,editable:!1,draggable:!1,done:this.isDone},t);s&&(Array.isArray(s)?s.map((t=>this.attachFieldAttributes(i,e,t))):this.attachFieldAttributes(i,e,s))})),this.sortedRecipients.filter((e=>e.role_name!==this.recipient.role_name&&("invited"===e.status||"opened"===e.status||"pending"===e.status))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=F(e,i,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});t&&(Array.isArray(t)?t.map((t=>this.attachFieldAttributes(i,e,t))):this.attachFieldAttributes(i,e,t))}))})),this.checkRecipientFields()}render(){return this.showLoadError?t(s,null,t("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:()=>{window.location.reload()}})):this.envelope?this.isDone?t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,envelope:this.envelope,onSdkError:e=>{var i;return null===(i=this.sdkError)||void 0===i?void 0:i.emit(e.detail)}}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} 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:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):this.agreed?"pin"===this.kbaStep?t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:async e=>{N(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{console.log("[SIGN] PIN code submission result",e),"complete"===e.kba_step&&(this.kbaStep="")})).catch((e=>{var i,t;console.log("[SIGN] Error submitting PIN",e),z((null===(t=null===(i=e.response)||void 0===i?void 0:i.data)||void 0===t?void 0:t.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}))}})))):t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:this.isDone||this.finishLater?j:A,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=I(1,e.pages);return t(o,null,i.map((i=>t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=!1}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} 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:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,{class:"agreed"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:()=>this.handleClickAgree()}),t("ul",null,t("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",t("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),t("li",null,"Agree to Verdocs'"," ",t("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",t("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),"."))))):t(s,null,t("verdocs-loader",null))}};L.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;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}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-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 .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';export{L as verdocs_sign}
|