@verdocs/web-sdk 6.10.6 → 6.10.7
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/Environment-C3P2cz0J.js +14 -0
- package/dist/cjs/Environment-C3P2cz0J.js.map +1 -0
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +12 -14
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +2 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +12 -14
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/utils/Environment.js +4 -7
- package/dist/collection/utils/Environment.js.map +1 -1
- package/dist/components/{p-DCZz2B7h.js → p-6RWROB9R.js} +2 -2
- package/dist/components/p-6RWROB9R.js.map +1 -0
- package/dist/components/{p-i3o08M2d.js → p-B1UVXqFA.js} +2 -2
- package/dist/components/{p-C43B3SP_.js → p-BYVQkYYg.js} +2 -2
- package/dist/components/{p-zTcSNwsp.js → p-Ck4pdoyc.js} +2 -2
- package/dist/components/{p-DZa0rMk2.js → p-CsF979IT.js} +2 -2
- package/dist/components/{p-DiwfOWXt.js → p-DJMr11ue.js} +2 -2
- package/dist/components/p-DavVixMP.js +2 -0
- package/dist/components/p-DavVixMP.js.map +1 -0
- package/dist/components/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/components/p-b2u0_wDk.js.map +1 -0
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-delegate-dialog.js +1 -1
- package/dist/components/verdocs-otp-dialog.js +1 -1
- package/dist/components/verdocs-passcode-dialog.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-toolbar-icon.js +1 -1
- package/dist/esm/Environment-b2u0_wDk.js +12 -0
- package/dist/esm/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +12 -14
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/{Environment-Dy2CRiH8.js → Environment-b2u0_wDk.js} +1 -1
- package/dist/esm-es5/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-46e52384.system.entry.js → p-39c54b65.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-255e1915.entry.js → p-4e0788f9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-4e0788f9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js → p-4e091415.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js → p-4ea0632f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js.map → p-4ea0632f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-C96xjMgt.system.js → p-COHG5J4h.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-COHG5J4h.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/verdocs-web-sdk/p-b2u0_wDk.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js → p-ba0d4ff5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js → p-ceda04bc.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1df29abb.entry.js → p-ee92c074.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js → p-fad90cf9.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/Environment-CUCX3aWX.js +0 -17
- package/dist/cjs/Environment-CUCX3aWX.js.map +0 -1
- package/dist/components/p-CYqVJ_kJ.js +0 -2
- package/dist/components/p-CYqVJ_kJ.js.map +0 -1
- package/dist/components/p-DCZz2B7h.js.map +0 -1
- package/dist/components/p-Dy2CRiH8.js.map +0 -1
- package/dist/esm/Environment-Dy2CRiH8.js +0 -15
- package/dist/esm/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/esm-es5/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/verdocs-web-sdk/p-255e1915.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-46e52384.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-C96xjMgt.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Dy2CRiH8.js.map +0 -1
- /package/dist/components/{p-i3o08M2d.js.map → p-B1UVXqFA.js.map} +0 -0
- /package/dist/components/{p-C43B3SP_.js.map → p-BYVQkYYg.js.map} +0 -0
- /package/dist/components/{p-zTcSNwsp.js.map → p-Ck4pdoyc.js.map} +0 -0
- /package/dist/components/{p-DZa0rMk2.js.map → p-CsF979IT.js.map} +0 -0
- /package/dist/components/{p-DiwfOWXt.js.map → p-DJMr11ue.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js.map → p-4e091415.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js.map → p-ceda04bc.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1df29abb.entry.js.map → p-ee92c074.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js.map → p-fad90cf9.system.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as s,d as o,F as n,t as a}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as r,DEFAULT_DISCLOSURES as l,startSigningSession as d,getEnvelope as c,envelopeRecipientAgree as h,updateEnvelopeField as p,createSignature as u,createInitials as g,sortFields as v,envelopeRecipientSubmit as f,isFieldValid as m,isFieldFilled as b,uploadEnvelopeFieldAttachment as x,deleteEnvelopeFieldAttachment as w,formatFullName as y,fullNameToInitials as k,verifySigner as C,getEnvelopesZip as S,getEnvelopeDocumentDownloadLink as I,getCombinedEnvelopeDocumentDownloadLink as N,delegateRecipient as z,envelopeRecipientDecline as E,integerSequence as G,askQuestion as L}from"@verdocs/js-sdk";import{u as j,g as D,r as H,a as F,d as T}from"./p-BCwFpXpV.js";import{D as M}from"./p-17OorOnH.js";import{D as V,C as q}from"./p-BDv5kBUR.js";import{V as P}from"./p-D97GxsI-.js";import{S as U}from"./p-C1sRVZWv.js";import{S as R}from"./p-C7hFgM52.js";import{d as O}from"./p-CZwyK_uo.js";import{d as A}from"./p-C0SHIuoK.js";import{d as Z}from"./p-DVx4efoX.js";import{d as B}from"./p-DiwfOWXt.js";import{d as $}from"./p-JGWMBIGy.js";import{d as Y}from"./p-CVF-R2yg.js";import{d as _}from"./p-DTE1GYJt.js";import{d as W}from"./p-D17kbVUt.js";import{d as K}from"./p-Dj-aIazM.js";import{d as J}from"./p-D9yawpPk.js";import{d as Q}from"./p-CxIhMndz.js";import{d as X}from"./p-rasc67fl.js";import{d as ee}from"./p-vimrvRye.js";import{d as te}from"./p-Dc3BDcaU.js";import{d as ie}from"./p-DZa0rMk2.js";import{d as se}from"./p-i3o08M2d.js";import{d as oe}from"./p-CIgqf7hj.js";import{d as ne}from"./p-aj0qlBQ1.js";import{d as ae}from"./p-F1PgSiVa.js";import{d as re}from"./p-u9H54zUE.js";import{d as le}from"./p-CLtldaUs.js";import{d as de}from"./p-CoeB7U-_.js";import{d as ce}from"./p-BMGs9CCD.js";import{d as he}from"./p-Cujbc8tg.js";const pe=()=>`verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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 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)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-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);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;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 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}`;const ue=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>`;const ge=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>`;const ve=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>`;const fe=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>`;const me=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=new r({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=l;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=async()=>{this.showDone=false;if(!this.isDone){this.prepareForViewTransition();await new Promise((e=>requestAnimationFrame((()=>e()))));this.isDone=true}}}async componentDidLoad(){var e,t,i,s,o,n;this.updateZoomFromWindow();window.addEventListener("resize",(()=>this.updateZoomFromWindow()));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new U("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new U("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new U("[SIGN] Missing required inviteCode",500,""));return}try{await this.initSigningSession()}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new U(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}async initSigningSession(){console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await d(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}async retrySigningSession(){var e,t,i;this.showLoadError=false;this.loading=true;try{await this.initSigningSession()}catch(s){console.log("[SIGN] Error with signing session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new U(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false}}prepareForViewTransition(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()}async handleSubmitSuccess(){var e,t;this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";try{const i=await c(this.endpoint,this.envelopeId);this.envelope=i;R.updateEnvelope(this.envelopeId,i);const s=(e=i.recipients)===null||e===void 0?void 0:e.find((e=>{var t;return e.role_name===((t=this.recipient)===null||t===void 0?void 0:t.role_name)}));if(s){this.recipient=s}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"})}catch(e){console.warn("[SIGN] Error refreshing envelope after submit",e)}this.showDone=true}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()}disconnectedCallback(){var e,t,i;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();window.removeEventListener("resize",(()=>this.updateZoomFromWindow()));(t=document.getElementById(this.getOrgStyleOverridesId()))===null||t===void 0?void 0:t.remove();(i=document.getElementById(this.getBrandStyleOverridesId()))===null||i===void 0?void 0:i.remove()}updateZoomFromWindow(){const e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}}setupIntersectionObserver(){const e=this.el.querySelectorAll("verdocs-envelope-document-page");if(e.length===0)return;if(this.observer){this.observer.disconnect()}const t=this.el.querySelector(".signed-document-container");const i={root:t,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;const i=parseInt(t.replace("page-",""),10);if(!isNaN(i)&&this.pageNumber!==i){this.pageNumber=i}}}))}),i);e.forEach((e=>this.observer.observe(e)))}getOrgStyleOverridesId(){return`verdocs-org-style-overrides-${this.envelopeId}`}getBrandStyleOverridesId(){return`verdocs-brand-style-overrides-${this.envelopeId}`}applyOrgStyleOverrides(){var e,t;const i=this.getOrgStyleOverridesId();const s=document.getElementById(i);const o=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof o==="string"){const e=s||document.createElement("style");e.id=i;e.textContent=o;if(!s){document.head.appendChild(e)}}else if(s){s.remove()}}applyBrandStyleOverrides(e){const t=this.getBrandStyleOverridesId();const i=document.getElementById(t);const s=e===null||e===void 0?void 0:e.style_overrides;if(typeof s==="string"&&s.length>0){const e=i||document.createElement("style");e.id=t;e.textContent=s;if(!i){document.head.appendChild(e)}}else if(i){i.remove()}}processAuthResponse(e){var t,i,s,o;const{envelope:n,recipient:a,brand:r}=e;(t=n.documents)===null||t===void 0?void 0:t.sort(((e,t)=>e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)));const{auth_step:d}=a;this.recipient=a;this.envelope=n;this.disclosures=((s=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||s===void 0?void 0:s.disclaimer)||l;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(r);this.authStep=d;this.delegated=!!a.delegated_to;this.agreed=a.agreed;this.signatureId=null;this.initialId=null;this.submitted=a.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;R.updateEnvelope(this.envelopeId,n);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=a.auth_method_states||{};this.kbaQuestions=a.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(a.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(o=this.envelopeLoaded)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);const e=Intl.DateTimeFormat().resolvedOptions();h(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:e.locale,timezone:e.timeZone}).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var t,i,s;console.log("[SIGN] Unable to accept disclosures",e);P("Unable to accept disclosures, please try again later",{style:"error"});(t=this.sdkError)===null||t===void 0?void 0:t.emit(new U(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(s=e.response)===null||s===void 0?void 0:s.data));this.submitting=false}))}handlePageSelect(e){const t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;const e=this.el.querySelector(".signed-document-container");const i=this.el.querySelector(`#page-${t}`);if(e&&i){const t=i.offsetTop-20;e.scrollTo({top:t,behavior:"smooth"})}}}async handleOptionSelected(e){var t,i;switch(e.detail.id){case"later":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"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}}startPolling(){this.stopPolling();const e=()=>{var e,t,i,s,o,n;const a=((e=this.envelope)===null||e===void 0?void 0:e.status)==="complete"||!!((t=this.envelope)===null||t===void 0?void 0:t.signed);const r=(s=(i=this.envelope)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.some((e=>e.type==="certificate"));const l=(n=(o=this.envelope)===null||o===void 0?void 0:o.recipients)===null||n===void 0?void 0:n.every((e=>e.status==="submitted"));if(a&&r)return false;if(!l)return false;return true};if(!e()){return}this.polling=true;this.pollingInterval=setInterval((async()=>{try{const t=await c(this.endpoint,this.envelopeId);this.envelope=t;R.updateEnvelope(this.envelopeId,t);this.checkRecipientFields();if(!e()){this.stopPolling()}}catch(e){console.error("[SIGN] Polling error",e);this.stopPolling()}}),5e3)}stopPolling(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false}handleZoomIn(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}}handleZoomOut(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}}updateRecipientFieldValue(e,t){console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((i=>{if(i.name===e){i.value=t.value;i.settings=t.settings;j(i);this.fieldUpdateCounter++;this.markEnvelopeStarted();this.checkRecipientFields()}}))}getStartedKey(){var e;return`${this.envelopeId}:${((e=this.recipient)===null||e===void 0?void 0:e.role_name)||""}`}markEnvelopeStarted(){const e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}}saveFieldChange(e,t,i){const s=this.getRecipientFields().find((t=>t.name===e));if(s===null||s===void 0?void 0:s.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});p(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((t=>this.updateRecipientFieldValue(e,t))).catch((e=>{var t,i,s,o,n,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);P("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new U(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,t){if(!t.target){return}const{value:i,checked:s}=t.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,i,false);case"checkbox":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"radio":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"dropdown":console.log("Saving dropdown",e.name,t.detail);return this.saveFieldChange(e.name,t.detail,false);case"initial":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing initial");const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.initialId){console.log("[SIGN] Reusing initial",this.initialId);const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing initial",t.detail);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.initialId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const o=await(await fetch(t.detail)).blob();return g(this.endpoint,"initial",o).then((async t=>{const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);P("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing signature");const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.signatureId){console.log("[SIGN] Reusing signature",this.signatureId);const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing signature",t.detail);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.signatureId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const n=await(await fetch(t.detail)).blob();console.log("[SIGN] Creating new signature");return u(this.endpoint,"signature",n).then((async t=>{console.log("Signature update result",t);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);P("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=t.detail;if(a){return this.saveFieldChange(e.name,a,false)}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:i,checked:s},e);break}}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"&&!e.readonly));v(e);return e}getSortedDisplayableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){if(this.submitted){return}try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const t=Intl.DateTimeFormat().resolvedOptions();const i=await f(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone});console.log("[SIGN] Submitted successfully",i);await this.handleSubmitSuccess()}catch(e){console.log("[SIGN] Error submitting",e);this.submitting=false;P("Unable to submit document, please try again.",{style:"error"})}return}const t=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));const i=this.getNextFieldFromList(t);if(i){const e=D(i);const t=document.getElementById(e);t===null||t===void 0?void 0:t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});t===null||t===void 0?void 0:t.focusField();this.focusedField=i.name}}handleNextOptional(){const e=this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e)));const t=this.getNextFieldFromList(e);if(t){const e=D(t);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});i===null||i===void 0?void 0:i.focusField();this.focusedField=t.name}}getRecipientFields(){var e;return((e=this.envelope)===null||e===void 0?void 0:e.fields.filter((e=>e.role_name===this.recipient.role_name)))||[]}getRequiredTotalCount(){return this.getSortedFillableFields().filter((e=>e.required)).length}getRequiredFilledCount(){return this.getSortedFillableFields().filter((e=>e.required&&this.isFieldActuallyFilled(e))).length}getOptionalUnfilledCount(){return this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e))).length}checkRecipientFields(){if(this.submitted||this.isDone){return}const e=this.getRecipientFields().filter((e=>!m(e,this.getRecipientFields())));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();const t=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const i=t.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(i){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}}isFieldActuallyFilled(e){if(e.type==="radio"&&e.group){const t=this.getRecipientFields().some((t=>t.group===e.group&&t.value==="true"));if(t){return true}}return b(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")}getNextRequiredField(){const e=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldActuallyFilled(e)));v(e);if(e.length===0){const e=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));v(e);if(e.length>0){return this.getNextFieldFromList(e)}return null}return this.getNextFieldFromList(e)}getNextFieldFromList(e){const t=e.findIndex((e=>e.name===this.focusedField));let i=t+1;if(i>=e.length){i=0}return e[i]}handlePrev(){var e;const t=this.getSortedFillableFields();const i=t.findIndex((e=>e.name===this.focusedField));if(i>0){const s=t[i-1];const o=D(s);const n=document.getElementById(o);n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth",block:"center"});(e=n===null||n===void 0?void 0:n.focusField)===null||e===void 0?void 0:e.call(n);this.focusedField=s.name}}updateAllFlags(){Object.values(this.renderedPages).forEach((e=>{this.updateFlagsForPage(e)}))}updateFlagsForPage(e){if(!e)return;const t=document.getElementById(e.containerId+"-controls");if(!t)return;const i=t.querySelectorAll(".verdocs-flag-instance");i.forEach((e=>e.remove()));let s=this.getNextRequiredField();const o=this.getRecipientFields().find((e=>e.name===this.focusedField));if(o&&!b(o,this.getRecipientFields())){s=o}if(s&&s.page===e.pageNumber&&s.document_id===e.documentId){const t="fill";let i="FILL";let o=false;switch(s.type){case"signature":i="SIGN";break;case"initial":i="INITIAL";break;case"checkbox":i="CHECK";break;case"radio":i="SELECT";break;case"date":case"dropdown":i="SELECT";break;case"attachment":i="ATTACH";break;case"payment":i="PAY";break}if(!s.required){o=true}H(e,s.y,s.height||T(s.type),{variant:t,label:i,showSkip:o,onSkip:()=>{this.handleNext()},onClick:()=>{var e;const t=D(s);const i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}}attachFieldAttributes(e,t,i){if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));i.addEventListener("attached",(async i=>{console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;try{const s=await x(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail);this.updateRecipientFieldValue(t.name,s);this.checkRecipientFields();const o=F("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,o);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("deleted",(async i=>{console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;try{const i=await w(this.endpoint,this.envelopeId,this.roleId,t.name);console.log("[SIGN] Deleted attachment",i);this.updateRecipientFieldValue(t.name,i);this.checkRecipientFields();const s=F("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("focusout",(e=>{if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}}));i.addEventListener("fieldChange",(e=>{this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}));i.addEventListener("adopt",(()=>{this.focusedField=t.name;this.adoptingSignature=true}));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);const s=y(this.recipient);i.setAttribute("initials",k(s));i.setAttribute("name",s);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}}handlePageRendered(e){const t=e.detail;this.renderedPages[`${t.documentId}:${t.pageNumber}`]=t;const i=this.getSortedDisplayableFields();i.filter((e=>e&&e.document_id===t.documentId&&e.page===t.pageNumber)).forEach(((e,i)=>{const s=F("envelope",e,t,{disabled:false,editable:false,draggable:false,done:this.isDone},i);if(!s){return}if(Array.isArray(s)){s.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.document_id===t.documentId&&e.page===t.pageNumber)).forEach((e=>{const i=F("envelope",e,t,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!i){return}if(Array.isArray(i)){i.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,i)}}))}));this.checkRecipientFields();this.updateFlagsForPage(t)}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);C(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var t,i,s,o,n,a;console.log("[SIGN] Error submitting authentication step",e);console.log((t=e.response)===null||t===void 0?void 0:t.data);if((o=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)===null||o===void 0?void 0:o.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{P(((a=(n=e.response)===null||n===void 0?void 0:n.data)===null||a===void 0?void 0:a.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}async handleOnDownload(e){var t,i;const{action:s,documentId:o}=e.detail;console.log("[SIGN] Download action selected:",s,o);try{switch(s){case M.certificate:const e=this.envelope.documents.find((e=>e.type==="certificate"));if(e){const t=await I(this.endpoint,e.id);window.open(t,"_blank")}else{P("Certificate not yet available.",{style:"info"})}break;case M.combined:const s=o||((t=this.envelope.documents.find((e=>e.type==="certificate")))===null||t===void 0?void 0:t.id);const n=await N(this.endpoint,s);window.open(n,"_blank");break;case M.document:const a=o||((i=this.envelope.documents.find((e=>e.type==="attachment")))===null||i===void 0?void 0:i.id);if(a){const e=await I(this.endpoint,a);window.open(e,"_blank")}break;case M.zip:const r=await S(this.endpoint,[this.envelopeId]);const l=window.URL.createObjectURL(r.data);const d=document.createElement("a");d.href=l;d.download=`${this.envelope.name}.zip`;document.body.appendChild(d);d.click();d.remove();window.URL.revokeObjectURL(l);break}}catch(e){console.error("Download error",e);P("Unable to complete download request.",{style:"error"})}}render(){var e;if(this.showLoadError){return s(o,null,s("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:()=>{this.retrySigningSession()}}))}if(!this.envelope){return s(o,null,s("verdocs-loader",null))}if(this.fatalErrorMessage){return s(o,{class:{agreed:this.agreed}},s("div",{class:"fatal-error"},s("div",{class:"message"},s("div",{class:"header"},this.fatalErrorHeader),s("p",null,this.fatalErrorMessage))))}if(this.delegated){return s(o,{class:{agreed:false}},s("div",{class:"fatal-error"},s("div",{class:"message"},s("div",{class:"header"},"Delegated Signing Request"),s("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return s(o,{class:{agreed:this.agreed}},s("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var t;return(t=this.sdkError)===null||t===void 0?void 0:t.emit(e.detail)}}),this.showDone&&s("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:e=>{e.preventDefault();e.stopPropagation();this.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.submitting&&s("div",{class:"loading-indicator"},s("verdocs-loader",null)))}if(this.delegating){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{z(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{P("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);P("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{E(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);this.declining=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);P("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return s("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:e=>this.processAuthResponse(e.detail.response)})}if(this.authStep==="sms"){return s("verdocs-otp-dialog",{endpoint:this.endpoint,method:"sms",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="email"){return s("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return s(o,{class:"kba"},s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),s("div",{class:"title"},this.envelope.name))),s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("div",{class:"cover"},s("div",{class:"kba"},s("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const t=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:t.first_name,last_name:t.last_name,address:t.address,city:t.city,state:t.state,zip:t.zip,dob:t.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const t=this.kbaQuestions[e];return s(o,{class:"kba"},s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),s("div",{class:"title"},this.envelope.name))),s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("div",{class:"cover"},s("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?s("verdocs-spinner",null):s("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(t===null||t===void 0?void 0:t.prompt)||"Please select one of the options below.",choices:(t===null||t===void 0?void 0:t.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const t=e.detail;this.kbaChoices=[...this.kbaChoices,t];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,t)=>({type:e.type,answer:this.kbaChoices[t]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const t=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){t.unshift({id:"delegate",label:"Delegate"})}const a=this.getRecipientFields().filter((e=>!m(e,this.getRecipientFields())));a.length>0?console.log("[SIGN] Invalid fields remaining",a.map((e=>e.name))):console.log("[SIGN] All field valid");const r=this.envelope.documents.reduce(((e,t)=>e+t.pages),0);const l=G(1,r).map((e=>({label:e.toString(),value:e.toString()})));let d=0;return s(o,null,this.toolbarStyle==="menu"&&s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("div",{class:"title"},this.envelope.name),s("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&(()=>{const e=this.getRequiredTotalCount()-this.getRequiredFilledCount();const t=this.getOptionalUnfilledCount();if(e>0){return s("span",{class:"remaining-count"},e," required field",e===1?"":"s"," left")}return s("span",{class:"remaining-count"},s("span",{class:"check-icon",innerHTML:q}),"All required fields complete",t>0&&s("div",{class:"review-optional"},s("span",{class:"separator"},"| "),s("span",{onClick:()=>this.handleNextOptional()},"Review ",t," optional")))})(),!this.finishLater&&!this.submitted&&s("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:()=>this.handleNext()}),s("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:ue,onClick:()=>this.handleZoomOut()}),s("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:ge,onClick:()=>this.handleZoomIn()}),s("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?t:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),this.toolbarStyle==="controls"&&s("div",{class:"controls-toolbar"},s("div",{class:"left-controls"},s("div",{class:"title"},this.envelope.name)),s("div",{class:"center-controls"},s("span",{class:"label"},"Page"),s("div",{class:"select-wrapper"},s("verdocs-select-input",{options:l,value:this.pageNumber.toString(),onInput:e=>this.handlePageSelect(e)})),s("span",{class:"count"},"of ",r)),s("div",{class:"right-controls"},!this.submitted&&s("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),s("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:ue,onClick:()=>this.handleZoomOut()}),s("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:ge,onClick:()=>this.handleZoomIn()}),s("div",{class:"icon-button download",innerHTML:ve,onClick:()=>this.handleOptionSelected({detail:{id:"download"}})}),s("div",{class:"icon-button print",innerHTML:fe,onClick:()=>this.handleOptionSelected({detail:{id:"print"}})}))),s("div",{class:`document signed-document-container zoom-${this.zoomLevel}`},(this.envelope.documents||[]).map((e=>{const t=G(1,e.pages);return s(n,null,this.envelope.documents.length>1&&s("div",{class:"document-separator"},s("div",{innerHTML:V}),s("span",null,e.name)),t.map((t=>{var i;const o=((i=e.page_sizes)===null||i===void 0?void 0:i[t])||{width:612,height:792};d++;return s("verdocs-envelope-document-page",{id:`page-${d}`,envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:t,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&s("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.isDone=true;this.showFinishLater=false}}),this.showDone&&s("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.adoptingSignature&&s("verdocs-adopt-signature-dialog",{name:y(this.recipient),nameLocked:!!((e=this.recipient)===null||e===void 0?void 0:e.name_locked),onNext:async e=>{console.log("[SIGN] Adopting signature/initials block",e.detail);this.showSpinner=true;const t=await(await fetch(e.detail.signature)).blob();const i=await(await fetch(e.detail.initials)).blob();const s=await u(this.endpoint,"signature",t);console.log("[SIGN] Created signature",s);this.signatureId=s.id;const o=await g(this.endpoint,"initial",i);console.log("[SIGN] Created initials",o);this.initialId=o.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(this.focusedField){const e=this.getRecipientFields().find((e=>e.name===this.focusedField));if(e){const t=e.type==="signature"?this.signatureId:e.type==="initial"?this.initialId:null;if(t){const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t,false);this.updateRecipientFieldValue(e.name,i)}}this.focusedField=""}const n=this.el.querySelectorAll("verdocs-field-signature");n.forEach((e=>e.setAttribute("signatureid",this.signatureId)));const a=this.el.querySelectorAll("verdocs-field-initial");a.forEach((e=>e.setAttribute("initialid",this.initialId)));this.checkRecipientFields()},onExit:()=>this.adoptingSignature=false}),(this.submitting||this.showSpinner)&&s("verdocs-portal",null,s("div",{class:"spinner-overlay"},s("verdocs-spinner",null))),this.showDownloadDialog&&s("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:()=>{this.showDownloadDialog=false;this.stopPolling()},onDownload:e=>this.handleOnDownload(e)}),!this.loading&&!this.isDone&&!this.submitted&&s("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:e=>{L(this.endpoint,this.envelopeId,this.roleId,{question:e.detail.question}).then((()=>P("Your question has been sent.",{style:"success"}))).catch((e=>{console.log("Error asking question",e);P("Unable to send question, please try again later.",{style:"error"})}))},onDecline:()=>this.declining=true,onFinishLater:()=>this.showFinishLater=true}))}get el(){return this}static get style(){return pe()}},[0,"verdocs-sign",{endpoint:[1040],envelopeId:[513,"envelope-id"],roleId:[513,"role-id"],inviteCode:[513,"invite-code"],headerTargetId:[1,"header-target-id"],toolbarStyle:[1,"toolbar-style"],recipient:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],fatalErrorHeader:[32],fatalErrorMessage:[32],focusedField:[32],disclosures:[32],fieldUpdateCounter:[32],submitting:[32],submitted:[32],isDone:[32],showDone:[32],adoptingSignature:[32],showLoadError:[32],finishLater:[32],showFinishLater:[32],agreed:[32],signatureId:[32],initialId:[32],documentsSingularPlural:[32],authStep:[32],authMethodStates:[32],pageNumber:[32],kbaQuestions:[32],showSpinner:[32],declining:[32],delegating:[32],delegated:[32],kbaChoices:[32],showDownloadDialog:[32],loading:[32],envelope:[32],zoomLevel:[32],signingProgressMode:[32],polling:[32]}]);function be(){if(typeof customElements==="undefined"){return}const e=["verdocs-sign","verdocs-adopt-signature-dialog","verdocs-button","verdocs-checkbox","verdocs-delegate-dialog","verdocs-dialog","verdocs-disclosure-dialog","verdocs-download-dialog","verdocs-dropdown","verdocs-envelope-document-page","verdocs-flag","verdocs-help-icon","verdocs-kba-dialog","verdocs-loader","verdocs-ok-dialog","verdocs-otp-dialog","verdocs-passcode-dialog","verdocs-portal","verdocs-question-dialog","verdocs-radio-button","verdocs-select-input","verdocs-sign-footer","verdocs-spinner","verdocs-text-input","verdocs-view"];e.forEach((e=>{switch(e){case"verdocs-sign":if(!customElements.get(a(e))){customElements.define(a(e),me)}break;case"verdocs-adopt-signature-dialog":if(!customElements.get(a(e))){O()}break;case"verdocs-button":if(!customElements.get(a(e))){A()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){Z()}break;case"verdocs-delegate-dialog":if(!customElements.get(a(e))){B()}break;case"verdocs-dialog":if(!customElements.get(a(e))){$()}break;case"verdocs-disclosure-dialog":if(!customElements.get(a(e))){Y()}break;case"verdocs-download-dialog":if(!customElements.get(a(e))){_()}break;case"verdocs-dropdown":if(!customElements.get(a(e))){W()}break;case"verdocs-envelope-document-page":if(!customElements.get(a(e))){K()}break;case"verdocs-flag":if(!customElements.get(a(e))){J()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){Q()}break;case"verdocs-kba-dialog":if(!customElements.get(a(e))){X()}break;case"verdocs-loader":if(!customElements.get(a(e))){ee()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){te()}break;case"verdocs-otp-dialog":if(!customElements.get(a(e))){ie()}break;case"verdocs-passcode-dialog":if(!customElements.get(a(e))){se()}break;case"verdocs-portal":if(!customElements.get(a(e))){oe()}break;case"verdocs-question-dialog":if(!customElements.get(a(e))){ne()}break;case"verdocs-radio-button":if(!customElements.get(a(e))){ae()}break;case"verdocs-select-input":if(!customElements.get(a(e))){re()}break;case"verdocs-sign-footer":if(!customElements.get(a(e))){le()}break;case"verdocs-spinner":if(!customElements.get(a(e))){de()}break;case"verdocs-text-input":if(!customElements.get(a(e))){ce()}break;case"verdocs-view":if(!customElements.get(a(e))){he()}break}}))}const xe=me;const we=be;export{xe as VerdocsSign,we as defineCustomElement};
|
|
1
|
+
import{p as e,H as t,c as i,h as s,d as o,F as n,t as a}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as r,DEFAULT_DISCLOSURES as l,startSigningSession as d,getEnvelope as c,envelopeRecipientAgree as h,updateEnvelopeField as p,createSignature as u,createInitials as g,sortFields as v,envelopeRecipientSubmit as f,isFieldValid as m,isFieldFilled as b,uploadEnvelopeFieldAttachment as x,deleteEnvelopeFieldAttachment as w,formatFullName as y,fullNameToInitials as k,verifySigner as C,getEnvelopesZip as S,getEnvelopeDocumentDownloadLink as I,getCombinedEnvelopeDocumentDownloadLink as N,delegateRecipient as z,envelopeRecipientDecline as E,integerSequence as G,askQuestion as L}from"@verdocs/js-sdk";import{u as j,g as D,r as F,a as H,d as T}from"./p-BCwFpXpV.js";import{D as M}from"./p-17OorOnH.js";import{D as V,C as q}from"./p-BDv5kBUR.js";import{V as P}from"./p-D97GxsI-.js";import{S as U}from"./p-C1sRVZWv.js";import{S as R}from"./p-C7hFgM52.js";import{d as A}from"./p-CZwyK_uo.js";import{d as O}from"./p-C0SHIuoK.js";import{d as B}from"./p-DVx4efoX.js";import{d as Z}from"./p-DJMr11ue.js";import{d as $}from"./p-JGWMBIGy.js";import{d as Y}from"./p-CVF-R2yg.js";import{d as _}from"./p-DTE1GYJt.js";import{d as K}from"./p-D17kbVUt.js";import{d as W}from"./p-Dj-aIazM.js";import{d as J}from"./p-D9yawpPk.js";import{d as Q}from"./p-CxIhMndz.js";import{d as X}from"./p-rasc67fl.js";import{d as ee}from"./p-vimrvRye.js";import{d as te}from"./p-Dc3BDcaU.js";import{d as ie}from"./p-CsF979IT.js";import{d as se}from"./p-B1UVXqFA.js";import{d as oe}from"./p-CIgqf7hj.js";import{d as ne}from"./p-aj0qlBQ1.js";import{d as ae}from"./p-F1PgSiVa.js";import{d as re}from"./p-u9H54zUE.js";import{d as le}from"./p-CLtldaUs.js";import{d as de}from"./p-CoeB7U-_.js";import{d as ce}from"./p-BMGs9CCD.js";import{d as he}from"./p-Cujbc8tg.js";const pe=()=>`verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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 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)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-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);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;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 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}`;const ue=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>`;const ge=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>`;const ve=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>`;const fe=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>`;const me=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=new r({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=l;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=async()=>{this.showDone=false;if(!this.isDone){this.prepareForViewTransition();await new Promise((e=>requestAnimationFrame((()=>e()))));this.isDone=true}}}async componentDidLoad(){var e,t,i,s,o,n;this.updateZoomFromWindow();window.addEventListener("resize",(()=>this.updateZoomFromWindow()));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new U("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new U("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new U("[SIGN] Missing required inviteCode",500,""));return}try{await this.initSigningSession()}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new U(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}async initSigningSession(){console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await d(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}async retrySigningSession(){var e,t,i;this.showLoadError=false;this.loading=true;try{await this.initSigningSession()}catch(s){console.log("[SIGN] Error with signing session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new U(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false}}prepareForViewTransition(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()}async handleSubmitSuccess(){var e,t;this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";try{const i=await c(this.endpoint,this.envelopeId);this.envelope=i;R.updateEnvelope(this.envelopeId,i);const s=(e=i.recipients)===null||e===void 0?void 0:e.find((e=>{var t;return e.role_name===((t=this.recipient)===null||t===void 0?void 0:t.role_name)}));if(s){this.recipient=s}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"})}catch(e){console.warn("[SIGN] Error refreshing envelope after submit",e)}this.showDone=true}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()}disconnectedCallback(){var e,t,i;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();window.removeEventListener("resize",(()=>this.updateZoomFromWindow()));(t=document.getElementById(this.getOrgStyleOverridesId()))===null||t===void 0?void 0:t.remove();(i=document.getElementById(this.getBrandStyleOverridesId()))===null||i===void 0?void 0:i.remove()}updateZoomFromWindow(){const e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}}setupIntersectionObserver(){const e=this.el.querySelectorAll("verdocs-envelope-document-page");if(e.length===0)return;if(this.observer){this.observer.disconnect()}const t=this.el.querySelector(".signed-document-container");const i={root:t,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;const i=parseInt(t.replace("page-",""),10);if(!isNaN(i)&&this.pageNumber!==i){this.pageNumber=i}}}))}),i);e.forEach((e=>this.observer.observe(e)))}getOrgStyleOverridesId(){return`verdocs-org-style-overrides-${this.envelopeId}`}getBrandStyleOverridesId(){return`verdocs-brand-style-overrides-${this.envelopeId}`}applyOrgStyleOverrides(){var e,t;const i=this.getOrgStyleOverridesId();const s=document.getElementById(i);const o=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof o==="string"){const e=s||document.createElement("style");e.id=i;e.textContent=o;if(!s){document.head.appendChild(e)}}else if(s){s.remove()}}applyBrandStyleOverrides(e){const t=this.getBrandStyleOverridesId();const i=document.getElementById(t);const s=e===null||e===void 0?void 0:e.style_overrides;if(typeof s==="string"&&s.length>0){const e=i||document.createElement("style");e.id=t;e.textContent=s;if(!i){document.head.appendChild(e)}}else if(i){i.remove()}}processAuthResponse(e){var t,i,s,o;const{envelope:n,recipient:a,brand:r}=e;(t=n.documents)===null||t===void 0?void 0:t.sort(((e,t)=>e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)));const{auth_step:d}=a;this.recipient=a;this.envelope=n;this.disclosures=((s=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||s===void 0?void 0:s.disclaimer)||l;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(r);this.authStep=d;this.delegated=!!a.delegated_to;this.agreed=a.agreed;this.signatureId=null;this.initialId=null;this.submitted=a.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;R.updateEnvelope(this.envelopeId,n);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=a.auth_method_states||{};this.kbaQuestions=a.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(a.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(o=this.envelopeLoaded)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);const e=Intl.DateTimeFormat().resolvedOptions();h(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:e.locale,timezone:e.timeZone}).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var t,i,s;console.log("[SIGN] Unable to accept disclosures",e);P("Unable to accept disclosures, please try again later",{style:"error"});(t=this.sdkError)===null||t===void 0?void 0:t.emit(new U(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(s=e.response)===null||s===void 0?void 0:s.data));this.submitting=false}))}handlePageSelect(e){const t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;const e=this.el.querySelector(".signed-document-container");const i=this.el.querySelector(`#page-${t}`);if(e&&i){const t=i.offsetTop-20;e.scrollTo({top:t,behavior:"smooth"})}}}async handleOptionSelected(e){var t,i;switch(e.detail.id){case"later":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"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}}startPolling(){this.stopPolling();const e=()=>{var e,t,i,s,o,n;const a=((e=this.envelope)===null||e===void 0?void 0:e.status)==="complete"||!!((t=this.envelope)===null||t===void 0?void 0:t.signed);const r=(s=(i=this.envelope)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.some((e=>e.type==="certificate"));const l=(n=(o=this.envelope)===null||o===void 0?void 0:o.recipients)===null||n===void 0?void 0:n.every((e=>e.status==="submitted"));if(a&&r)return false;if(!l)return false;return true};if(!e()){return}this.polling=true;this.pollingInterval=setInterval((async()=>{try{const t=await c(this.endpoint,this.envelopeId);this.envelope=t;R.updateEnvelope(this.envelopeId,t);this.checkRecipientFields();if(!e()){this.stopPolling()}}catch(e){console.error("[SIGN] Polling error",e);this.stopPolling()}}),5e3)}stopPolling(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false}handleZoomIn(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}}handleZoomOut(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}}updateRecipientFieldValue(e,t){console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((i=>{if(i.name===e){i.value=t.value;i.settings=t.settings;j(i);this.fieldUpdateCounter++;this.markEnvelopeStarted();this.checkRecipientFields()}}))}getStartedKey(){var e;return`${this.envelopeId}:${((e=this.recipient)===null||e===void 0?void 0:e.role_name)||""}`}markEnvelopeStarted(){const e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}}saveFieldChange(e,t,i){const s=this.getRecipientFields().find((t=>t.name===e));if(s===null||s===void 0?void 0:s.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});p(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((t=>this.updateRecipientFieldValue(e,t))).catch((e=>{var t,i,s,o,n,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);P("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new U(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,t){if(!t.target){return}const{value:i,checked:s}=t.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,i,false);case"checkbox":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"radio":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"dropdown":console.log("Saving dropdown",e.name,t.detail);return this.saveFieldChange(e.name,t.detail,false);case"initial":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing initial");const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.initialId){console.log("[SIGN] Reusing initial",this.initialId);const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing initial",t.detail);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.initialId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const o=await(await fetch(t.detail)).blob();return g(this.endpoint,"initial",o).then((async t=>{const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);P("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing signature");const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.signatureId){console.log("[SIGN] Reusing signature",this.signatureId);const t=await p(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing signature",t.detail);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.signatureId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const n=await(await fetch(t.detail)).blob();console.log("[SIGN] Creating new signature");return u(this.endpoint,"signature",n).then((async t=>{console.log("Signature update result",t);const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);P("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=t.detail;if(a){return this.saveFieldChange(e.name,a,false)}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:i,checked:s},e);break}}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"&&!e.readonly));v(e);return e}getSortedDisplayableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){if(this.submitted){return}try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const t=Intl.DateTimeFormat().resolvedOptions();const i=await f(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone});console.log("[SIGN] Submitted successfully",i);await this.handleSubmitSuccess()}catch(e){console.log("[SIGN] Error submitting",e);this.submitting=false;P("Unable to submit document, please try again.",{style:"error"})}return}const t=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));const i=this.getNextFieldFromList(t);if(i){const e=D(i);const t=document.getElementById(e);t===null||t===void 0?void 0:t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});t===null||t===void 0?void 0:t.focusField();this.focusedField=i.name}}handleNextOptional(){const e=this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e)));const t=this.getNextFieldFromList(e);if(t){const e=D(t);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});i===null||i===void 0?void 0:i.focusField();this.focusedField=t.name}}getRecipientFields(){var e;return((e=this.envelope)===null||e===void 0?void 0:e.fields.filter((e=>e.role_name===this.recipient.role_name)))||[]}getRequiredTotalCount(){return this.getSortedFillableFields().filter((e=>e.required)).length}getRequiredFilledCount(){return this.getSortedFillableFields().filter((e=>e.required&&this.isFieldActuallyFilled(e))).length}getOptionalUnfilledCount(){return this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e))).length}checkRecipientFields(){if(this.submitted||this.isDone){return}const e=this.getRecipientFields().filter((e=>!m(e,this.getRecipientFields())));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();const t=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const i=t.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(i){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}}isFieldActuallyFilled(e){if(e.type==="radio"&&e.group){const t=this.getRecipientFields().some((t=>t.group===e.group&&t.value==="true"));if(t){return true}}return b(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")}getNextRequiredField(){const e=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldActuallyFilled(e)));v(e);if(e.length===0){const e=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));v(e);if(e.length>0){return this.getNextFieldFromList(e)}return null}return this.getNextFieldFromList(e)}getNextFieldFromList(e){const t=e.findIndex((e=>e.name===this.focusedField));let i=t+1;if(i>=e.length){i=0}return e[i]}handlePrev(){var e;const t=this.getSortedFillableFields();const i=t.findIndex((e=>e.name===this.focusedField));if(i>0){const s=t[i-1];const o=D(s);const n=document.getElementById(o);n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth",block:"center"});(e=n===null||n===void 0?void 0:n.focusField)===null||e===void 0?void 0:e.call(n);this.focusedField=s.name}}updateAllFlags(){Object.values(this.renderedPages).forEach((e=>{this.updateFlagsForPage(e)}))}updateFlagsForPage(e){if(!e)return;const t=document.getElementById(e.containerId+"-controls");if(!t)return;const i=t.querySelectorAll(".verdocs-flag-instance");i.forEach((e=>e.remove()));let s=this.getNextRequiredField();const o=this.getRecipientFields().find((e=>e.name===this.focusedField));if(o&&!b(o,this.getRecipientFields())){s=o}if(s&&s.page===e.pageNumber&&s.document_id===e.documentId){const t="fill";let i="FILL";let o=false;switch(s.type){case"signature":i="SIGN";break;case"initial":i="INITIAL";break;case"checkbox":i="CHECK";break;case"radio":i="SELECT";break;case"date":case"dropdown":i="SELECT";break;case"attachment":i="ATTACH";break;case"payment":i="PAY";break}if(!s.required){o=true}F(e,s.y,s.height||T(s.type),{variant:t,label:i,showSkip:o,onSkip:()=>{this.handleNext()},onClick:()=>{var e;const t=D(s);const i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}}attachFieldAttributes(e,t,i){if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));i.addEventListener("attached",(async i=>{console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;try{const s=await x(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail);this.updateRecipientFieldValue(t.name,s);this.checkRecipientFields();const o=H("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,o);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("deleted",(async i=>{console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;try{const i=await w(this.endpoint,this.envelopeId,this.roleId,t.name);console.log("[SIGN] Deleted attachment",i);this.updateRecipientFieldValue(t.name,i);this.checkRecipientFields();const s=H("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("focusout",(e=>{if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}}));i.addEventListener("fieldChange",(e=>{this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}));i.addEventListener("adopt",(()=>{this.focusedField=t.name;this.adoptingSignature=true}));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);const s=y(this.recipient);i.setAttribute("initials",k(s));i.setAttribute("name",s);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}}handlePageRendered(e){const t=e.detail;this.renderedPages[`${t.documentId}:${t.pageNumber}`]=t;const i=this.getSortedDisplayableFields();i.filter((e=>e&&e.document_id===t.documentId&&e.page===t.pageNumber)).forEach(((e,i)=>{const s=H("envelope",e,t,{disabled:false,editable:false,draggable:false,done:this.isDone},i);if(!s){return}if(Array.isArray(s)){s.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.document_id===t.documentId&&e.page===t.pageNumber)).forEach((e=>{const i=H("envelope",e,t,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!i){return}if(Array.isArray(i)){i.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,i)}}))}));this.checkRecipientFields();this.updateFlagsForPage(t)}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);C(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var t,i,s,o,n,a;console.log("[SIGN] Error submitting authentication step",e);console.log((t=e.response)===null||t===void 0?void 0:t.data);if((o=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)===null||o===void 0?void 0:o.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{P(((a=(n=e.response)===null||n===void 0?void 0:n.data)===null||a===void 0?void 0:a.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}async handleOnDownload(e){var t,i;const{action:s,documentId:o}=e.detail;console.log("[SIGN] Download action selected:",s,o);try{switch(s){case M.certificate:const e=this.envelope.documents.find((e=>e.type==="certificate"));if(e){const t=await I(this.endpoint,e.id);window.open(t,"_blank")}else{P("Certificate not yet available.",{style:"info"})}break;case M.combined:const s=o||((t=this.envelope.documents.find((e=>e.type==="certificate")))===null||t===void 0?void 0:t.id);const n=await N(this.endpoint,s);window.open(n,"_blank");break;case M.document:const a=o||((i=this.envelope.documents.find((e=>e.type==="attachment")))===null||i===void 0?void 0:i.id);if(a){const e=await I(this.endpoint,a);window.open(e,"_blank")}break;case M.zip:const r=await S(this.endpoint,[this.envelopeId]);const l=window.URL.createObjectURL(r.data);const d=document.createElement("a");d.href=l;d.download=`${this.envelope.name}.zip`;document.body.appendChild(d);d.click();d.remove();window.URL.revokeObjectURL(l);break}}catch(e){console.error("Download error",e);P("Unable to complete download request.",{style:"error"})}}render(){var e;if(this.showLoadError){return s(o,null,s("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:()=>{this.retrySigningSession()}}))}if(!this.envelope){return s(o,null,s("verdocs-loader",null))}if(this.fatalErrorMessage){return s(o,{class:{agreed:this.agreed}},s("div",{class:"fatal-error"},s("div",{class:"message"},s("div",{class:"header"},this.fatalErrorHeader),s("p",null,this.fatalErrorMessage))))}if(this.delegated){return s(o,{class:{agreed:false}},s("div",{class:"fatal-error"},s("div",{class:"message"},s("div",{class:"header"},"Delegated Signing Request"),s("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return s(o,{class:{agreed:this.agreed}},s("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var t;return(t=this.sdkError)===null||t===void 0?void 0:t.emit(e.detail)}}),this.showDone&&s("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:e=>{e.preventDefault();e.stopPropagation();this.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.submitting&&s("div",{class:"loading-indicator"},s("verdocs-loader",null)))}if(this.delegating){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{z(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{P("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);P("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{E(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);this.declining=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);P("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return s(o,{class:"agreed"},s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return s("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:e=>this.processAuthResponse(e.detail.response)})}if(this.authStep==="sms"){return s("verdocs-otp-dialog",{endpoint:this.endpoint,method:"sms",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="email"){return s("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return s(o,{class:"kba"},s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),s("div",{class:"title"},this.envelope.name))),s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("div",{class:"cover"},s("div",{class:"kba"},s("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const t=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:t.first_name,last_name:t.last_name,address:t.address,city:t.city,state:t.state,zip:t.zip,dob:t.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const t=this.kbaQuestions[e];return s(o,{class:"kba"},s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),s("div",{class:"title"},this.envelope.name))),s("div",{class:"document",style:{paddingTop:"15px"}},s("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"})),s("div",{class:"cover"},s("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?s("verdocs-spinner",null):s("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(t===null||t===void 0?void 0:t.prompt)||"Please select one of the options below.",choices:(t===null||t===void 0?void 0:t.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const t=e.detail;this.kbaChoices=[...this.kbaChoices,t];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,t)=>({type:e.type,answer:this.kbaChoices[t]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const t=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){t.unshift({id:"delegate",label:"Delegate"})}const a=this.getRecipientFields().filter((e=>!m(e,this.getRecipientFields())));a.length>0?console.log("[SIGN] Invalid fields remaining",a.map((e=>e.name))):console.log("[SIGN] All field valid");const r=this.envelope.documents.reduce(((e,t)=>e+t.pages),0);const l=G(1,r).map((e=>({label:e.toString(),value:e.toString()})));let d=0;return s(o,null,this.toolbarStyle==="menu"&&s("div",{id:"verdocs-sign-header"},s("div",{class:"inner"},s("div",{class:"title"},this.envelope.name),s("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&(()=>{const e=this.getRequiredTotalCount()-this.getRequiredFilledCount();const t=this.getOptionalUnfilledCount();if(e>0){return s("span",{class:"remaining-count"},e," required field",e===1?"":"s"," left")}return s("span",{class:"remaining-count"},s("span",{class:"check-icon",innerHTML:q}),"All required fields complete",t>0&&s("div",{class:"review-optional"},s("span",{class:"separator"},"| "),s("span",{onClick:()=>this.handleNextOptional()},"Review ",t," optional")))})(),!this.finishLater&&!this.submitted&&s("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:()=>this.handleNext()}),s("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:ue,onClick:()=>this.handleZoomOut()}),s("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:ge,onClick:()=>this.handleZoomIn()}),s("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?t:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),this.toolbarStyle==="controls"&&s("div",{class:"controls-toolbar"},s("div",{class:"left-controls"},s("div",{class:"title"},this.envelope.name)),s("div",{class:"center-controls"},s("span",{class:"label"},"Page"),s("div",{class:"select-wrapper"},s("verdocs-select-input",{options:l,value:this.pageNumber.toString(),onInput:e=>this.handlePageSelect(e)})),s("span",{class:"count"},"of ",r)),s("div",{class:"right-controls"},!this.submitted&&s("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),s("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:ue,onClick:()=>this.handleZoomOut()}),s("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:ge,onClick:()=>this.handleZoomIn()}),s("div",{class:"icon-button download",innerHTML:ve,onClick:()=>this.handleOptionSelected({detail:{id:"download"}})}),s("div",{class:"icon-button print",innerHTML:fe,onClick:()=>this.handleOptionSelected({detail:{id:"print"}})}))),s("div",{class:`document signed-document-container zoom-${this.zoomLevel}`},(this.envelope.documents||[]).map((e=>{const t=G(1,e.pages);return s(n,null,this.envelope.documents.length>1&&s("div",{class:"document-separator"},s("div",{innerHTML:V}),s("span",null,e.name)),t.map((t=>{var i;const o=((i=e.page_sizes)===null||i===void 0?void 0:i[t])||{width:612,height:792};d++;return s("verdocs-envelope-document-page",{id:`page-${d}`,envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:t,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&s("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.isDone=true;this.showFinishLater=false}}),this.showDone&&s("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.adoptingSignature&&s("verdocs-adopt-signature-dialog",{name:y(this.recipient),nameLocked:!!((e=this.recipient)===null||e===void 0?void 0:e.name_locked),onNext:async e=>{console.log("[SIGN] Adopting signature/initials block",e.detail);this.showSpinner=true;const t=await(await fetch(e.detail.signature)).blob();const i=await(await fetch(e.detail.initials)).blob();const s=await u(this.endpoint,"signature",t);console.log("[SIGN] Created signature",s);this.signatureId=s.id;const o=await g(this.endpoint,"initial",i);console.log("[SIGN] Created initials",o);this.initialId=o.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(this.focusedField){const e=this.getRecipientFields().find((e=>e.name===this.focusedField));if(e){const t=e.type==="signature"?this.signatureId:e.type==="initial"?this.initialId:null;if(t){const i=await p(this.endpoint,this.envelopeId,this.roleId,e.name,t,false);this.updateRecipientFieldValue(e.name,i)}}this.focusedField=""}const n=this.el.querySelectorAll("verdocs-field-signature");n.forEach((e=>e.setAttribute("signatureid",this.signatureId)));const a=this.el.querySelectorAll("verdocs-field-initial");a.forEach((e=>e.setAttribute("initialid",this.initialId)));this.checkRecipientFields()},onExit:()=>this.adoptingSignature=false}),(this.submitting||this.showSpinner)&&s("verdocs-portal",null,s("div",{class:"spinner-overlay"},s("verdocs-spinner",null))),this.showDownloadDialog&&s("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:()=>{this.showDownloadDialog=false;this.stopPolling()},onDownload:e=>this.handleOnDownload(e)}),!this.loading&&!this.isDone&&!this.submitted&&s("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:e=>{L(this.endpoint,this.envelopeId,this.roleId,{question:e.detail.question}).then((()=>P("Your question has been sent.",{style:"success"}))).catch((e=>{console.log("Error asking question",e);P("Unable to send question, please try again later.",{style:"error"})}))},onDecline:()=>this.declining=true,onFinishLater:()=>this.showFinishLater=true}))}get el(){return this}static get style(){return pe()}},[0,"verdocs-sign",{endpoint:[1040],envelopeId:[513,"envelope-id"],roleId:[513,"role-id"],inviteCode:[513,"invite-code"],headerTargetId:[1,"header-target-id"],toolbarStyle:[1,"toolbar-style"],recipient:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],fatalErrorHeader:[32],fatalErrorMessage:[32],focusedField:[32],disclosures:[32],fieldUpdateCounter:[32],submitting:[32],submitted:[32],isDone:[32],showDone:[32],adoptingSignature:[32],showLoadError:[32],finishLater:[32],showFinishLater:[32],agreed:[32],signatureId:[32],initialId:[32],documentsSingularPlural:[32],authStep:[32],authMethodStates:[32],pageNumber:[32],kbaQuestions:[32],showSpinner:[32],declining:[32],delegating:[32],delegated:[32],kbaChoices:[32],showDownloadDialog:[32],loading:[32],envelope:[32],zoomLevel:[32],signingProgressMode:[32],polling:[32]}]);function be(){if(typeof customElements==="undefined"){return}const e=["verdocs-sign","verdocs-adopt-signature-dialog","verdocs-button","verdocs-checkbox","verdocs-delegate-dialog","verdocs-dialog","verdocs-disclosure-dialog","verdocs-download-dialog","verdocs-dropdown","verdocs-envelope-document-page","verdocs-flag","verdocs-help-icon","verdocs-kba-dialog","verdocs-loader","verdocs-ok-dialog","verdocs-otp-dialog","verdocs-passcode-dialog","verdocs-portal","verdocs-question-dialog","verdocs-radio-button","verdocs-select-input","verdocs-sign-footer","verdocs-spinner","verdocs-text-input","verdocs-view"];e.forEach((e=>{switch(e){case"verdocs-sign":if(!customElements.get(a(e))){customElements.define(a(e),me)}break;case"verdocs-adopt-signature-dialog":if(!customElements.get(a(e))){A()}break;case"verdocs-button":if(!customElements.get(a(e))){O()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){B()}break;case"verdocs-delegate-dialog":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){$()}break;case"verdocs-disclosure-dialog":if(!customElements.get(a(e))){Y()}break;case"verdocs-download-dialog":if(!customElements.get(a(e))){_()}break;case"verdocs-dropdown":if(!customElements.get(a(e))){K()}break;case"verdocs-envelope-document-page":if(!customElements.get(a(e))){W()}break;case"verdocs-flag":if(!customElements.get(a(e))){J()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){Q()}break;case"verdocs-kba-dialog":if(!customElements.get(a(e))){X()}break;case"verdocs-loader":if(!customElements.get(a(e))){ee()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){te()}break;case"verdocs-otp-dialog":if(!customElements.get(a(e))){ie()}break;case"verdocs-passcode-dialog":if(!customElements.get(a(e))){se()}break;case"verdocs-portal":if(!customElements.get(a(e))){oe()}break;case"verdocs-question-dialog":if(!customElements.get(a(e))){ne()}break;case"verdocs-radio-button":if(!customElements.get(a(e))){ae()}break;case"verdocs-select-input":if(!customElements.get(a(e))){re()}break;case"verdocs-sign-footer":if(!customElements.get(a(e))){le()}break;case"verdocs-spinner":if(!customElements.get(a(e))){de()}break;case"verdocs-text-input":if(!customElements.get(a(e))){ce()}break;case"verdocs-view":if(!customElements.get(a(e))){he()}break}}))}const xe=me;const we=be;export{xe as VerdocsSign,we as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-sign.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-BYVQkYYg.js";const t=o;const p=s;export{t as VerdocsTemplateFields,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-template-fields.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-DavVixMP.js";const t=o;const a=s;export{t as VerdocsToolbarIcon,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-toolbar-icon.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
2
|
+
|
|
3
|
+
// NOTE: Do not call setBaseURL(). The constructor already does, but more important, in most environments
|
|
4
|
+
// this particular code block is lazily loaded and gets run on a component render. That creates a race
|
|
5
|
+
// condition that silently overwrites a host-app preference and is hard to track down. (Definitely breaks
|
|
6
|
+
// the Teams app, among other things.)
|
|
7
|
+
const DefaultEndpoint = VerdocsEndpoint.getDefault();
|
|
8
|
+
|
|
9
|
+
export { DefaultEndpoint as D };
|
|
10
|
+
//# sourceMappingURL=Environment-b2u0_wDk.js.map
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Environment-b2u0_wDk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Environment-b2u0_wDk.js","sources":["src/utils/Environment.ts"],"sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\n\nexport const BETA_ORIGINS = ['https://beta.verdocs.com', 'https://stage.verdocs.com', 'http://localhost:6006', 'http://localhost:5173'];\n\nexport const IS_BETA = BETA_ORIGINS.includes(window.location.origin);\n\nexport const API_URL = IS_BETA ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';\n\n// NOTE: Do not call setBaseURL(). The constructor already does, but more important, in most environments\n// this particular code block is lazily loaded and gets run on a component render. That creates a race\n// condition that silently overwrites a host-app preference and is hard to track down. (Definitely breaks\n// the Teams app, among other things.)\nexport const DefaultEndpoint = VerdocsEndpoint.getDefault();\n"],"names":[],"mappings":";;AAQA;AACA;AACA;AACA;MACa,eAAe,GAAG,eAAe,CAAC,UAAU;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-CjTHbolG.js';
|
|
2
2
|
import { d as SignatureXIcon } from './Icons-BU5rnXp2.js';
|
|
3
|
-
import { D as DefaultEndpoint } from './Environment-
|
|
3
|
+
import { D as DefaultEndpoint } from './Environment-b2u0_wDk.js';
|
|
4
4
|
import { DEFAULT_DISCLOSURES, verifySigner, VerdocsEndpoint, getEnvelope, getEnvelopesZip, getEnvelopeDocumentDownloadLink, cancelEnvelope, getCombinedEnvelopeDocumentDownloadLink, getMyRecipient, integerSequence } from '@verdocs/js-sdk';
|
|
5
5
|
import { V as VerdocsToast } from './Toast-D97GxsI-.js';
|
|
6
6
|
import { D as DownloadAction } from './Types-CIxfEdV7.js';
|
|
@@ -58,10 +58,8 @@ const VerdocsContactPicker = class {
|
|
|
58
58
|
this.auth_methods = this.templateRole.auth_methods || [];
|
|
59
59
|
this.passcode = this.templateRole.passcode || '';
|
|
60
60
|
}
|
|
61
|
-
// Entitlements only gate
|
|
62
|
-
//
|
|
63
|
-
// authMethodsLoading stays true forever, and the user sees a spinner where every verification
|
|
64
|
-
// option should be. Degrade to "no optional entitlements" instead.
|
|
61
|
+
// Entitlements only gate optional methods like KBA. We need error handling here in case the getActiveEntitlements
|
|
62
|
+
// call fails or we stay loading forever.
|
|
65
63
|
this.activeEntitlements = await getActiveEntitlements(this.endpoint).catch(e => {
|
|
66
64
|
console.warn('[CONTACT PICKER] Unable to load entitlements, continuing with base auth methods only', e);
|
|
67
65
|
return {};
|
|
@@ -135,46 +133,46 @@ const VerdocsContactPicker = class {
|
|
|
135
133
|
if (!!this.activeEntitlements.id_auth) {
|
|
136
134
|
verificationOptions.push({ label: 'ID Check', value: 'id' });
|
|
137
135
|
}
|
|
138
|
-
return (h("form", { key: '
|
|
136
|
+
return (h("form", { key: '6709871235915b9c57af981cb4ab8560c040c29f', onSubmit: e => e.preventDefault(),
|
|
139
137
|
// onClick={e => e.stopPropagation()}
|
|
140
|
-
autocomplete: "off" }, h("div", { key: '
|
|
138
|
+
autocomplete: "off" }, h("div", { key: 'b4792f8bf7a38bd1eca0a684da63e06607b29d4a', class: "row" }, h("label", { key: '75f1386774dcf2dba1ae074e2ef86b9d04525763', htmlFor: this.firstNameFieldId }, "Name:"), h("div", { key: '36916fdd64584ef209620a6311c4db381e55ea82', class: "names-row" }, h("input", { key: '8ab3867864dad6e2726a09666e8c3334f6bbc713', id: this.firstNameFieldId, name: this.firstNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", "aria-autocomplete": "none", value: this.first_name, placeholder: "First...", onFocus: () => {
|
|
141
139
|
// Give the blur event a chance to hide it first if going between first/last
|
|
142
140
|
setTimeout(() => {
|
|
143
141
|
var _a;
|
|
144
142
|
this.showSuggestions = ((_a = this.contactSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
145
143
|
}, 100);
|
|
146
|
-
}, onInput: e => this.handleFirstNameChange(e) }), h("input", { key: '
|
|
144
|
+
}, onInput: e => this.handleFirstNameChange(e) }), h("input", { key: '000acb6f26cfa8a78105b211df519ef3851dc474', id: this.lastNameFieldId, name: this.lastNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", "aria-autocomplete": "none", value: this.last_name, placeholder: "Last...", onFocus: () => {
|
|
147
145
|
// Give the blur event a chance to hide it first if going between first/last
|
|
148
146
|
setTimeout(() => {
|
|
149
147
|
var _a;
|
|
150
148
|
this.showSuggestions = ((_a = this.contactSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
151
149
|
}, 100);
|
|
152
|
-
}, onInput: e => this.handleLastNameChange(e) })), this.showSuggestions && (h("verdocs-portal", { key: '
|
|
150
|
+
}, onInput: e => this.handleLastNameChange(e) })), this.showSuggestions && (h("verdocs-portal", { key: '4e9c8ee57f464fcf09578430e1fe09981e87bafc', anchor: this.firstNameFieldId, onClickAway: () => {
|
|
153
151
|
this.showSuggestions = false;
|
|
154
152
|
document.querySelectorAll(`.verdocs-portal-wrapper`).forEach(el => el.remove());
|
|
155
|
-
}, id: "verdocs-contact-picker-suggestions" }, h("div", { key: '
|
|
153
|
+
}, id: "verdocs-contact-picker-suggestions" }, h("div", { key: '5cbf60f0f1186f318f686ef6bdc8d791072e4d41', class: "dropdown" }, this.contactSuggestions
|
|
156
154
|
.filter(suggestion => { var _a; return !this.first_name || ((_a = suggestion.first_name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(this.first_name.toLowerCase())); })
|
|
157
155
|
.map(suggestion => {
|
|
158
156
|
var _a;
|
|
159
157
|
return (h("div", { key: (_a = suggestion.id) !== null && _a !== void 0 ? _a : suggestion.email, class: "suggestion", onClick: e => this.handleSelectSuggestion(e, suggestion) }, suggestion.picture ? h("img", { alt: "Avatar", class: "avatar", src: suggestion.picture }) : h("div", { class: "avatar", innerHTML: addrBookIcon }), h("div", { class: "details" }, h("div", { class: "name" }, formatFullName(suggestion)), suggestion.email && h("div", { class: "destination" }, suggestion.email), suggestion.phone && h("div", { class: "destination" }, suggestion.phone))));
|
|
160
|
-
}))))), h("div", { key: '
|
|
158
|
+
}))))), h("div", { key: '3d6aaa5e5bd3f0bc5681c4b788f222b6dfb45584', class: "row" }, h("label", { key: '67e9b6d47602d8c455a46e47b94bf008d2ac3a4e', htmlFor: this.emailFieldId }, "Email:"), h("input", { key: 'b65569322f9a9864fe82ac3371ffcf4e769b69f1', id: this.emailFieldId, name: this.emailFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", "aria-autocomplete": "none", value: this.email, placeholder: "Invite/verify via email...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.email = e.target.value) })), hasSMSAuth && (h("div", { key: 'defed17223c457db6eea0aff5c13598a70882157', class: "row" }, h("label", { key: '7a06bd13e92cd70c51f23228bbe4ed5be59919bb', htmlFor: this.phoneFieldId }, "Phone:"), h("input", { key: '770012fd3d838449afa88309f7b003c600e10a1c', id: this.phoneFieldId, name: this.phoneFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", "aria-autocomplete": "none", value: this.phone, placeholder: "Invite/verify via SMS...", onFocus: () => (this.showSuggestions = false), onInput: (e) => {
|
|
161
159
|
this.phone = convertToE164(e.target.value);
|
|
162
|
-
} }))), h(Fragment, { key: '
|
|
160
|
+
} }))), h(Fragment, { key: 'e0071e7e2fb5521685c8863dab279f31089bf20e' }, verificationOptions.length > 0 && (h("div", { key: '7f769fdb13d206c769b813eef2c68e810bc635f3', class: "row pin-code" }, h("label", { key: '4ebf33f0821f3b1f2a63ac918d3d2923b8f38e38' }, "Verification Methods:"), this.authMethodsLoading ? (h("verdocs-spinner", { size: 10, mode: "dark", style: { margin: 'auto' } })) : (h("div", null, verificationOptions.map((option, i) => (h("div", { class: "option" }, h("verdocs-checkbox", { size: "small", id: `verdocs-multi-select-opt-${i}`, value: option.value, checked: this.auth_methods.includes(option.value), onInput: (e) => {
|
|
163
161
|
if (e.target.checked) {
|
|
164
162
|
this.auth_methods = [...this.auth_methods, option.value];
|
|
165
163
|
}
|
|
166
164
|
else {
|
|
167
165
|
this.auth_methods = this.auth_methods.filter(selected => selected !== option.value);
|
|
168
166
|
}
|
|
169
|
-
} }), h("label", { htmlFor: `verdocs-multi-select-option-${i}` }, option.label)))))))), this.auth_methods.includes('passcode') && (h("div", { key: '
|
|
167
|
+
} }), h("label", { htmlFor: `verdocs-multi-select-option-${i}` }, option.label)))))))), this.auth_methods.includes('passcode') && (h("div", { key: '79feab0e29cbfbbb825f285a995d21576732bb8a', class: "row pin-code" }, h("label", { key: '7fd8dd8c3f254e9d6eba0e657f3a02f0fd47b05e', htmlFor: this.phoneFieldId }, "Passcode:"), h("input", { key: 'a9d0055ca2669776bc465ed4d7a1ce414bb628a4', id: "verdocs-passcode", name: "verdocs-passcode", type: "text", "data-lpignore": "true", autocomplete: "blocked", "aria-autocomplete": "none", value: this.passcode, placeholder: "4-8 digits recommended...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.passcode = e.target.value) })))), h("div", { key: '71101e3ae9adab93ffde79f43431ab91657df8cd', class: "row pin-code" }, h("label", { key: '312a0dafe35171d1ebc61e62f868e2fdcd8a8e8d', style: { marginTop: '6px' } }, "Options:"), h("div", { key: '38341490838ffe88ee03800e886d46b163f1d21a' }, h("div", { key: '68fbb6b02029ba082da5db49687989e2d0228235', class: "option" }, h("verdocs-checkbox", { key: '57c933a6ebc171d8a0c86452ff26504270175463', size: "small", id: "verdocs-delegator", checked: this.delegator, disabled: this.name_locked, onInput: (e) => {
|
|
170
168
|
this.delegator = e.target.checked;
|
|
171
169
|
if (this.delegator)
|
|
172
170
|
this.name_locked = false;
|
|
173
|
-
} }), h("label", { key: '
|
|
171
|
+
} }), h("label", { key: '8d4bbaef0ca5cea8100777fa37d520f1bd5a1d1e', htmlFor: "verdocs-delegator" }, "May delegate signing")), h("div", { key: 'd1278133af51917475ae1778c28da315072ca4a6', class: "option" }, h("verdocs-checkbox", { key: '32f6401902c5f850f52c58fb06def2d16fc65e99', size: "small", id: "verdocs-name-locked", checked: this.name_locked, disabled: this.delegator, onInput: (e) => {
|
|
174
172
|
this.name_locked = e.target.checked;
|
|
175
173
|
if (this.name_locked)
|
|
176
174
|
this.delegator = false;
|
|
177
|
-
} }), h("label", { key: '
|
|
175
|
+
} }), h("label", { key: '82d3cb3a2c48c66e8dd4bf917e35ed85327d994d', htmlFor: "verdocs-name-locked" }, "Name locked")))), h("div", { key: '01f4e93445daee8493eb67f41640865753db54bb', class: "row message" }, h("label", { key: '499b65b9368abe5f355ece31825fdd6b92905b55', htmlFor: "verdocs-contact-picker-message" }, "Message:"), h("textarea", { key: '817c16d982edb9af18f8ebee829ed77068d431b5', id: "verdocs-contact-picker-message", name: "verdocs-contact-picker-message", "data-lpignore": "true", autocomplete: "blocked", placeholder: "Optional message to include in invitation...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.message = e.target.value) }, this.message)), h("div", { key: '044a45c3a9ba57334c6e10f12e0b1f19ce5c3403', class: "buttons" }, h("div", { key: '6aa3536c73eef3852f7d483deee3773413167f5d', class: "flex-fill" }), h("verdocs-button", { key: '7dc65ba7bcb927c9822cc19d00b3a74278db8688', variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: '7f3434aa2547d87ad2a54610374bec0511aa7940', label: "OK", size: "small", disabled: !canSubmit, onClick: !canSubmit ? () => { } : e => this.handleSubmit(e) }))));
|
|
178
176
|
}
|
|
179
177
|
};
|
|
180
178
|
VerdocsContactPicker.style = verdocsContactPickerCss();
|