@verdocs/web-sdk 2.3.45 → 2.3.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/cjs/{TemplateFieldStore-fbc03ef8.js → TemplateFieldStore-43a0b60d.js} +0 -4
  2. package/dist/cjs/{TemplateRoleStore-3b2ea92e.js → TemplateRoleStore-df60674d.js} +0 -4
  3. package/dist/cjs/{TemplateStore-42660916.js → TemplateStore-2432259f.js} +2 -2
  4. package/dist/cjs/ipc-test.cjs.entry.js +3 -3
  5. package/dist/cjs/{utils-ac526133.js → utils-108da29c.js} +5 -0
  6. package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
  7. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +3 -3
  12. package/dist/cjs/verdocs-field-date.cjs.entry.js +3 -3
  13. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +3 -3
  14. package/dist/cjs/verdocs-field-initial.cjs.entry.js +3 -3
  15. package/dist/cjs/verdocs-field-payment.cjs.entry.js +3 -3
  16. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +3 -3
  17. package/dist/cjs/verdocs-field-signature.cjs.entry.js +3 -3
  18. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +3 -3
  19. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -3
  20. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +3 -3
  21. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-portal_2.cjs.entry.js +3 -3
  23. package/dist/cjs/verdocs-preview_8.cjs.entry.js +4 -4
  24. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-sign.cjs.entry.js +2 -2
  26. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +10 -7
  28. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  29. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +3 -1
  30. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +4 -3
  31. package/dist/collection/utils/TemplateFieldStore.js +0 -4
  32. package/dist/collection/utils/TemplateRoleStore.js +0 -4
  33. package/dist/collection/utils/utils.js +4 -0
  34. package/dist/components/TemplateFieldStore.js +0 -4
  35. package/dist/components/TemplateRoleStore.js +0 -4
  36. package/dist/components/utils.js +5 -1
  37. package/dist/components/verdocs-template-fields2.js +3 -1
  38. package/dist/components/verdocs-template-roles2.js +4 -3
  39. package/dist/docs.json +1 -1
  40. package/dist/esm/{TemplateFieldStore-76da1f7c.js → TemplateFieldStore-211c1ed4.js} +0 -4
  41. package/dist/esm/{TemplateRoleStore-8c34bafd.js → TemplateRoleStore-ab81bc7d.js} +0 -4
  42. package/dist/esm/{TemplateStore-0804c8ee.js → TemplateStore-e58662d8.js} +2 -2
  43. package/dist/esm/ipc-test.entry.js +3 -3
  44. package/dist/esm/{utils-d081a2b9.js → utils-dc2f3ad4.js} +5 -1
  45. package/dist/esm/verdocs-build.entry.js +3 -3
  46. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  47. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  48. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  49. package/dist/esm/verdocs-field-attachment.entry.js +3 -3
  50. package/dist/esm/verdocs-field-checkbox.entry.js +3 -3
  51. package/dist/esm/verdocs-field-date.entry.js +3 -3
  52. package/dist/esm/verdocs-field-dropdown.entry.js +3 -3
  53. package/dist/esm/verdocs-field-initial.entry.js +3 -3
  54. package/dist/esm/verdocs-field-payment.entry.js +3 -3
  55. package/dist/esm/verdocs-field-radio-button.entry.js +3 -3
  56. package/dist/esm/verdocs-field-signature.entry.js +3 -3
  57. package/dist/esm/verdocs-field-textarea.entry.js +3 -3
  58. package/dist/esm/verdocs-field-textbox.entry.js +3 -3
  59. package/dist/esm/verdocs-field-timestamp.entry.js +3 -3
  60. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  61. package/dist/esm/verdocs-portal_2.entry.js +3 -3
  62. package/dist/esm/verdocs-preview_8.entry.js +4 -4
  63. package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
  64. package/dist/esm/verdocs-sign.entry.js +2 -2
  65. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  66. package/dist/esm/verdocs-template-fields_4.entry.js +10 -7
  67. package/dist/esm/verdocs-view.entry.js +1 -1
  68. package/dist/esm-es5/TemplateFieldStore-211c1ed4.js +1 -0
  69. package/dist/esm-es5/TemplateRoleStore-ab81bc7d.js +1 -0
  70. package/dist/esm-es5/{TemplateStore-0804c8ee.js → TemplateStore-e58662d8.js} +1 -1
  71. package/dist/esm-es5/ipc-test.entry.js +1 -1
  72. package/dist/esm-es5/{utils-d081a2b9.js → utils-dc2f3ad4.js} +1 -1
  73. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-portal_2.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  96. package/dist/types/utils/utils.d.ts +1 -0
  97. package/dist/verdocs-web-sdk/p-023ef227.entry.js +1 -0
  98. package/dist/verdocs-web-sdk/{p-9a0033f3.entry.js → p-04c052bf.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-e016c0e3.entry.js → p-089094e0.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/{p-97c56d75.entry.js → p-09ba2b4f.entry.js} +1 -1
  101. package/dist/verdocs-web-sdk/{p-a8c434e9.system.entry.js → p-14cf3ed7.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-16872e35.entry.js +1 -0
  103. package/dist/verdocs-web-sdk/{p-a3326659.entry.js → p-1a9b8d76.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-140b8c97.entry.js → p-1c2f221f.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-c3c142f0.entry.js → p-1d361830.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-b30e52a0.entry.js → p-237531a1.entry.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-7ae877b4.system.entry.js → p-254ca470.system.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/{p-a7efa1e6.entry.js → p-30050536.entry.js} +1 -1
  109. package/dist/verdocs-web-sdk/{p-1c902325.entry.js → p-30bd29d5.entry.js} +1 -1
  110. package/dist/verdocs-web-sdk/{p-34f03fee.js → p-3627f343.js} +1 -1
  111. package/dist/verdocs-web-sdk/{p-15259f81.system.entry.js → p-38b38563.system.entry.js} +1 -1
  112. package/dist/verdocs-web-sdk/{p-07c30f7e.entry.js → p-3b6cab15.entry.js} +1 -1
  113. package/dist/verdocs-web-sdk/p-3b6fe397.system.entry.js +1 -0
  114. package/dist/verdocs-web-sdk/{p-03fac9a1.entry.js → p-3bf9449c.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/{p-369872ec.entry.js → p-3fa5aef1.entry.js} +1 -1
  116. package/dist/verdocs-web-sdk/{p-0a57cd5a.system.entry.js → p-430d815e.system.entry.js} +1 -1
  117. package/dist/verdocs-web-sdk/{p-302ab247.js → p-4381d111.js} +1 -1
  118. package/dist/verdocs-web-sdk/{p-343663c3.system.entry.js → p-45a858a9.system.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/{p-1429091f.entry.js → p-480f7293.entry.js} +1 -1
  120. package/dist/verdocs-web-sdk/{p-b9f41d37.system.entry.js → p-4fe45c9e.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-8fede0de.system.entry.js → p-55358ff3.system.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-d12fa095.system.entry.js → p-5af8ef19.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-d72dc783.system.entry.js → p-5d3b02f0.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-ba2aa74b.entry.js → p-5e036d10.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-3077ba78.system.entry.js → p-65801cec.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/p-6eb2ce21.js +1 -0
  127. package/dist/verdocs-web-sdk/{p-ac6d0fb0.entry.js → p-707f16df.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-419cd79c.system.js → p-7e327308.system.js} +1 -1
  129. package/dist/verdocs-web-sdk/p-7e4bacc0.js +1 -0
  130. package/dist/verdocs-web-sdk/p-7f0cc488.entry.js +1 -0
  131. package/dist/verdocs-web-sdk/{p-1a70513e.system.entry.js → p-7f62674b.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-123295a7.system.entry.js → p-80c21ffe.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-1a18f140.system.entry.js → p-81581a72.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-a91615c2.system.entry.js → p-86899b9e.system.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-14743452.system.entry.js → p-897aa7f9.system.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-56da687c.system.entry.js → p-91ee960b.system.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-84103d7c.system.entry.js → p-94ea0135.system.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-8b111775.system.entry.js → p-9a897be3.system.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-7d5cb7b6.entry.js → p-a1107387.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-69e79511.system.entry.js → p-ab3ad894.system.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-25363d68.entry.js → p-affa9578.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-ef23ce26.entry.js → p-b26e1fd0.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-da9462c7.entry.js → p-bf8d6a0f.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/p-c152dbfa.system.js +1 -0
  145. package/dist/verdocs-web-sdk/{p-93ae0f2d.system.entry.js → p-c2bbccaf.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-0c65ed0b.system.entry.js → p-cf1a8e32.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-f1a1a107.entry.js → p-da5aee2a.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-c2edd338.system.entry.js → p-daa16d84.system.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-ec53b7b6.system.entry.js → p-eb8fdc4a.system.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  151. package/dist/verdocs-web-sdk/p-f69790c5.system.js +1 -0
  152. package/dist/verdocs-web-sdk/{p-d30ee1f8.entry.js → p-f6a6efa5.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-c90481a4.system.js → p-fa4bc1ec.system.js} +1 -1
  154. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  155. package/package.json +1 -1
  156. package/dist/custom-elements.json +0 -2091
  157. package/dist/esm-es5/TemplateFieldStore-76da1f7c.js +0 -1
  158. package/dist/esm-es5/TemplateRoleStore-8c34bafd.js +0 -1
  159. package/dist/verdocs-web-sdk/p-0282f68e.js +0 -1
  160. package/dist/verdocs-web-sdk/p-09525dd7.entry.js +0 -1
  161. package/dist/verdocs-web-sdk/p-2e7f6f8c.system.js +0 -1
  162. package/dist/verdocs-web-sdk/p-35d995a5.entry.js +0 -1
  163. package/dist/verdocs-web-sdk/p-560c15d7.js +0 -1
  164. package/dist/verdocs-web-sdk/p-700bd5d3.system.js +0 -1
  165. package/dist/verdocs-web-sdk/p-a8221209.entry.js +0 -1
  166. package/dist/verdocs-web-sdk/p-a966d17b.system.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,f as s,h as i,H as l,a as o}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{g as a}from"./p-302ab247.js";import{S as n}from"./p-7a1b2643.js";import"./p-7648c449.js";import"./p-560c15d7.js";import"./p-0282f68e.js";const r=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.send=t(this,"send",7),this.templateUpdated=t(this,"templateUpdated",7),this.templateCreated=t(this,"templateCreated",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.endpoint=d.getDefault(),this.templateId=null,this.step="preview",this.store=null}onTemplateIdChanged(e){console.log("Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return console.log("[BUILD] No template ID, activating upload mode"),void(this.step="attachments");if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(i){console.log("[BUILD] Error loading template",i),null===(e=this.sdkError)||void 0===e||e.emit(new n(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}async loadTemplate(e){e&&(console.log("Loading store",e),this.store=await a(this.endpoint,e,!1),s(this.el))}handleCancel(e){console.log("Cancel",e.detail),this.step="preview"}async handleTemplateCreated(e){var t;await this.loadTemplate(e),this.templateId=e,this.step="roles",null===(t=this.stepChanged)||void 0===t||t.emit("roles")}async handleRolesUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}async handleTemplateUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles",null===(e=this.stepChanged)||void 0===e||e.emit("roles")}handleRolesNext(){var e;this.step="fields",null===(e=this.stepChanged)||void 0===e||e.emit("fields")}handleStepChanged(e){var t;console.log("osc",e),this.step=e,null===(t=this.stepChanged)||void 0===t||t.emit(e)}render(){return this.endpoint.session?this.store?(console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step)),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),"attachments"===this.step&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"roles"===this.step&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),"settings"===this.step&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)})),"fields"===this.step&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"preview"===this.step&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var t;return null===(t=this.send)||void 0===t?void 0:t.emit(e.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))):(console.log("[BUILD] No template ID, rendering created view"),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateCreated:e=>this.handleTemplateCreated(e.detail.templateId)})))):i(l,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return o(this)}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};r.style='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';export{r as verdocs_build}
1
+ import{r as e,c as t,f as s,h as i,H as l,a as o}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{g as a}from"./p-4381d111.js";import{S as n}from"./p-7a1b2643.js";import"./p-7648c449.js";import"./p-7e4bacc0.js";import"./p-6eb2ce21.js";const r=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.send=t(this,"send",7),this.templateUpdated=t(this,"templateUpdated",7),this.templateCreated=t(this,"templateCreated",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.endpoint=d.getDefault(),this.templateId=null,this.step="preview",this.store=null}onTemplateIdChanged(e){console.log("Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return console.log("[BUILD] No template ID, activating upload mode"),void(this.step="attachments");if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(i){console.log("[BUILD] Error loading template",i),null===(e=this.sdkError)||void 0===e||e.emit(new n(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}async loadTemplate(e){e&&(console.log("Loading store",e),this.store=await a(this.endpoint,e,!1),s(this.el))}handleCancel(e){console.log("Cancel",e.detail),this.step="preview"}async handleTemplateCreated(e){var t;await this.loadTemplate(e),this.templateId=e,this.step="roles",null===(t=this.stepChanged)||void 0===t||t.emit("roles")}async handleRolesUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}async handleTemplateUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles",null===(e=this.stepChanged)||void 0===e||e.emit("roles")}handleRolesNext(){var e;this.step="fields",null===(e=this.stepChanged)||void 0===e||e.emit("fields")}handleStepChanged(e){var t;console.log("osc",e),this.step=e,null===(t=this.stepChanged)||void 0===t||t.emit(e)}render(){return this.endpoint.session?this.store?(console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step)),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),"attachments"===this.step&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"roles"===this.step&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),"settings"===this.step&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)})),"fields"===this.step&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"preview"===this.step&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var t;return null===(t=this.send)||void 0===t?void 0:t.emit(e.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))):(console.log("[BUILD] No template ID, rendering created view"),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateCreated:e=>this.handleTemplateCreated(e.detail.templateId)})))):i(l,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return o(this)}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};r.style='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';export{r as verdocs_build}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];o=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-05eb4fed.system.js","./p-700bd5d3.system.js","./p-2e7f6f8c.system.js","./p-c90481a4.system.js","./p-3f628837.system.js","./p-3af6b910.system.js","./p-1ba9f457.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,n,o,s,r,a,l,d,c,f;return{setters:[function(e){t=e.r;i=e.c;n=e.h;o=e.H;s=e.F},function(e){r=e.g},function(e){a=e.g;l=e.a},function(e){d=e.g},function(e){c=e.g},function(e){f=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var u='verdocs-field-initial{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:83px;height:36px;display:block;font-size:11px;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-initial.disabled{opacity:0.5}verdocs-field-initial.done{border:none;opacity:1}verdocs-field-initial img{display:block;max-width:100%;max-height:100%}verdocs-field-initial button{cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-initial button.hide{display:none}verdocs-field-initial.required{border:1px solid #cc0000}verdocs-field-initial.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-initial verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-initial verdocs-button-panel[data-active],verdocs-field-initial verdocs-button-panel:hover{opacity:1}verdocs-field-initial verdocs-button-panel .icon svg{fill:#333333}verdocs-field-initial verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-initial .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.6}verdocs-field-initial .settings-icon svg{fill:#707ae5}verdocs-field-initial .settings-icon:hover{opacity:1}';var h=e("verdocs_field_initial",function(){function e(e){t(this,e);this.adopt=i(this,"adopt",7);this.exit=i(this,"exit",7);this.fieldChange=i(this,"fieldChange",7);this.settingsChanged=i(this,"settingsChanged",7);this.settingsPress=i(this,"settingsPress",7);this.deleted=i(this,"deleted",7);this.fieldStore=null;this.roleStore=null;this.templateid="";this.fieldname="";this.disabled=false;this.initials="";this.editable=false;this.moveable=false;this.done=false;this.xscale=1;this.yscale=1;this.showingProperties=false;this.tempInitials=""}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.handleShow();return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.fieldStore=d(this.templateid);this.roleStore=a(this.templateid);return[2]}))}))};e.prototype.hideDialog=function(){var e;(e=this.dialog)===null||e===void 0?void 0:e.remove();this.dialog=null};e.prototype.handleAdopt=function(e){var t;console.log("[INITIAL] Adopted initials");this.tempInitials=e.detail;(t=this.fieldChange)===null||t===void 0?void 0:t.emit(this.tempInitials);this.hideDialog()};e.prototype.handleShow=function(){var e=this;this.dialog=document.createElement("verdocs-initial-dialog");this.dialog.setAttribute("initials",this.initials);this.dialog.addEventListener("exit",(function(){return e.hideDialog()}));this.dialog.addEventListener("next",(function(t){return e.handleAdopt(t)}));document.body.append(this.dialog)};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,i;var a=this.fieldStore.get("fields").find((function(t){return t.name===e.fieldname}));var d=l(this.roleStore,a.role_name);var u=a["rgba"]||r(d);if(!a){return n(s,null)}var h=c(a);var p=h.base64||this.tempInitials;var v=(i=(t=this.disabled)!==null&&t!==void 0?t:h.disabled)!==null&&i!==void 0?i:false;if(this.done){return n(o,{class:{done:this.done}},p&&n("img",{src:p,alt:"Initials"}))}return n(o,{class:{required:a===null||a===void 0?void 0:a.required,disabled:v},style:{backgroundColor:u}},p?n("img",{src:p,alt:"Initials"}):n("button",{class:{},onClick:function(){return!v&&e.handleShow()}},"Initials"),this.editable&&n(s,null,n("div",{id:"verdocs-settings-panel-trigger-".concat(a.name),style:{transform:"scale(".concat(Math.floor(1/this.xscale*1e3)/1e3,", ").concat(Math.floor(1/this.yscale*1e3)/1e3,")")},class:"settings-icon",innerHTML:f,onClick:function(t){t.stopPropagation();e.showingProperties=!e.showingProperties}}),this.showingProperties&&n("verdocs-portal",{anchor:"verdocs-settings-panel-trigger-".concat(this.fieldname),onClickAway:function(){return e.showingProperties=false}},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:a.name,onClose:function(){return e.showingProperties=false},onDelete:function(){var t;(t=e.deleted)===null||t===void 0?void 0:t.emit({fieldName:a.name});return e.hideSettingsPanel()},onSettingsChanged:function(t){var i;(i=e.settingsChanged)===null||i===void 0?void 0:i.emit(t.detail);return e.hideSettingsPanel()},helpText:"initial fields capture the recipient's initials on a clause or page."}))))};return e}());h.style=u}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];o=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-05eb4fed.system.js","./p-c152dbfa.system.js","./p-f69790c5.system.js","./p-fa4bc1ec.system.js","./p-3f628837.system.js","./p-3af6b910.system.js","./p-1ba9f457.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,n,o,s,r,a,l,d,c,f;return{setters:[function(e){t=e.r;i=e.c;n=e.h;o=e.H;s=e.F},function(e){r=e.g},function(e){a=e.g;l=e.a},function(e){d=e.g},function(e){c=e.g},function(e){f=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var u='verdocs-field-initial{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:83px;height:36px;display:block;font-size:11px;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-initial.disabled{opacity:0.5}verdocs-field-initial.done{border:none;opacity:1}verdocs-field-initial img{display:block;max-width:100%;max-height:100%}verdocs-field-initial button{cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-initial button.hide{display:none}verdocs-field-initial.required{border:1px solid #cc0000}verdocs-field-initial.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-initial verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-initial verdocs-button-panel[data-active],verdocs-field-initial verdocs-button-panel:hover{opacity:1}verdocs-field-initial verdocs-button-panel .icon svg{fill:#333333}verdocs-field-initial verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-initial .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.6}verdocs-field-initial .settings-icon svg{fill:#707ae5}verdocs-field-initial .settings-icon:hover{opacity:1}';var h=e("verdocs_field_initial",function(){function e(e){t(this,e);this.adopt=i(this,"adopt",7);this.exit=i(this,"exit",7);this.fieldChange=i(this,"fieldChange",7);this.settingsChanged=i(this,"settingsChanged",7);this.settingsPress=i(this,"settingsPress",7);this.deleted=i(this,"deleted",7);this.fieldStore=null;this.roleStore=null;this.templateid="";this.fieldname="";this.disabled=false;this.initials="";this.editable=false;this.moveable=false;this.done=false;this.xscale=1;this.yscale=1;this.showingProperties=false;this.tempInitials=""}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.handleShow();return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.fieldStore=d(this.templateid);this.roleStore=a(this.templateid);return[2]}))}))};e.prototype.hideDialog=function(){var e;(e=this.dialog)===null||e===void 0?void 0:e.remove();this.dialog=null};e.prototype.handleAdopt=function(e){var t;console.log("[INITIAL] Adopted initials");this.tempInitials=e.detail;(t=this.fieldChange)===null||t===void 0?void 0:t.emit(this.tempInitials);this.hideDialog()};e.prototype.handleShow=function(){var e=this;this.dialog=document.createElement("verdocs-initial-dialog");this.dialog.setAttribute("initials",this.initials);this.dialog.addEventListener("exit",(function(){return e.hideDialog()}));this.dialog.addEventListener("next",(function(t){return e.handleAdopt(t)}));document.body.append(this.dialog)};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,i;var a=this.fieldStore.get("fields").find((function(t){return t.name===e.fieldname}));var d=l(this.roleStore,a.role_name);var u=a["rgba"]||r(d);if(!a){return n(s,null)}var h=c(a);var p=h.base64||this.tempInitials;var v=(i=(t=this.disabled)!==null&&t!==void 0?t:h.disabled)!==null&&i!==void 0?i:false;if(this.done){return n(o,{class:{done:this.done}},p&&n("img",{src:p,alt:"Initials"}))}return n(o,{class:{required:a===null||a===void 0?void 0:a.required,disabled:v},style:{backgroundColor:u}},p?n("img",{src:p,alt:"Initials"}):n("button",{class:{},onClick:function(){return!v&&e.handleShow()}},"Initials"),this.editable&&n(s,null,n("div",{id:"verdocs-settings-panel-trigger-".concat(a.name),style:{transform:"scale(".concat(Math.floor(1/this.xscale*1e3)/1e3,", ").concat(Math.floor(1/this.yscale*1e3)/1e3,")")},class:"settings-icon",innerHTML:f,onClick:function(t){t.stopPropagation();e.showingProperties=!e.showingProperties}}),this.showingProperties&&n("verdocs-portal",{anchor:"verdocs-settings-panel-trigger-".concat(this.fieldname),onClickAway:function(){return e.showingProperties=false}},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:a.name,onClose:function(){return e.showingProperties=false},onDelete:function(){var t;(t=e.deleted)===null||t===void 0?void 0:t.emit({fieldName:a.name});return e.hideSettingsPanel()},onSettingsChanged:function(t){var i;(i=e.settingsChanged)===null||i===void 0?void 0:i.emit(t.detail);return e.hideSettingsPanel()},helpText:"initial fields capture the recipient's initials on a clause or page."}))))};return e}());h.style=u}}}));
@@ -1 +1 @@
1
- import{r as t,c as e,h as s,F as i,H as o,a as r}from"./p-14b44491.js";import{i as n}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a}from"./p-035f6b38.js";import{u as l}from"./p-feb442b1.js";import{g as d}from"./p-6de76553.js";import{g as p,a as h}from"./p-560c15d7.js";import{g as c}from"./p-0282f68e.js";import{g as b}from"./p-34f03fee.js";import{S as f}from"./p-029ae656.js";import"./p-7d5dbd9a.js";import"./p-7648c449.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const x=class{constructor(s){t(this,s),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateid="",this.fieldname="",this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.xscale=1,this.yscale=1,this.showingProperties=!1}async focusField(){this.inputEl.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);t&&t.hidePanel&&t.hidePanel()}async componentWillLoad(){this.fieldStore=c(this.templateid),this.roleStore=p(this.templateid)}componentDidRender(){n.dynamicDrop(!0),this.editable&&n(this.el).resizable({edges:{top:!1,bottom:!1,left:!0,right:!0},listeners:{start:this.handleResizeStart.bind(this),move:this.handleResize.bind(this),end:this.handleResizeEnd.bind(this)}})}handleResizeStart(t){t.preventDefault(),t.stopPropagation()}handleResize(t){let{x:e=0,y:s=0,h:i=0}=t.target.dataset,{width:o,height:r}=t.rect;e=(parseFloat(e)||0)+t.deltaRect.left,s=(parseFloat(s)||0)+t.deltaRect.top,i=(parseFloat(i)||0)+t.deltaRect.height,Object.assign(t.target.style,{width:`${o}px`,height:`${r}px`,transform:`translate(${e}px, ${s+i}px)`}),Object.assign(t.target.dataset,{x:e,y:s,h:i})}handleResizeEnd(t){const e=this.fieldStore.get("fields").find((t=>t.name===this.fieldname)),s={...b(e)},[i,o]=t.target.style.transform.split("(")[1].split(")")[0].split(",").map(parseFloat);s.width=Math.round(parseFloat(t.target.style.width)/this.xscale),s.height=Math.round(parseFloat(t.target.style.height)/this.yscale),s.x=Math.round(s.x+i/this.xscale),s.y=Math.round(s.y-o/this.yscale),l(this.endpoint,this.templateid,this.fieldname,{setting:s}).then((e=>{var i;console.log("Update result",e),null===(i=this.settingsChanged)||void 0===i||i.emit({fieldName:e.name,settings:s,field:e}),Object.assign(t.target.dataset,{x:0,y:0,h:0})})).catch((t=>console.log("Field update failed",t)))}render(){var t,e;const r=this.fieldStore.get("fields").find((t=>t.name===this.fieldname));console.log("Rendering tb",this.fieldname,r);const n=h(this.roleStore,r.role_name),a=r.rgba||d(n);if(!r)return s(i,null);const l=b(r);let p=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:l.disabled)&&void 0!==e&&e;const c=(null==l?void 0:l.result)||"",x=(l.width||150)/5;return this.done?s(o,{class:{done:this.done}},c):s(o,{class:{required:r.required,disabled:p,done:this.done},style:{backgroundColor:a}},s("input",{type:"text",name:r.name,placeholder:null==l?void 0:l.placeholder,tabIndex:null==l?void 0:l.order,value:c,disabled:p,required:null==r?void 0:r.required,ref:t=>this.inputEl=t,maxlength:x}),this.editable&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${r.name}`,style:{transform:`scale(${Math.floor(1/this.xscale*1e3)/1e3}, ${Math.floor(1/this.yscale*1e3)/1e3})`},class:"settings-icon",innerHTML:f,onClick:t=>{t.stopPropagation(),this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${r.name}`,onClickAway:()=>this.showingProperties=!1},s("verdocs-template-field-properties",{templateId:this.templateid,fieldName:r.name,onClose:()=>this.showingProperties=!1,onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:r.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()},helpText:'Text boxes may be used to capture simple text input. Participant-entered values will be stored for later retrieval via the "name" field.<br /><br />If marked required, the participant must complete the field before proceeding.'}))))}get el(){return r(this)}};x.style='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;width:150px;height:15px;display:block;font-size:11px;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{cursor:inherit;width:100%;height:100%;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;position:absolute;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}verdocs-field-textbox .settings-icon{position:absolute;top:-4px;left:-20px;display:inline-block;cursor:pointer;opacity:0.6}verdocs-field-textbox .settings-icon svg{fill:#707ae5}verdocs-field-textbox .settings-icon:hover{opacity:1}';export{x as verdocs_field_textbox}
1
+ import{r as t,c as e,h as s,F as i,H as o,a as r}from"./p-14b44491.js";import{i as n}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a}from"./p-035f6b38.js";import{u as l}from"./p-feb442b1.js";import{g as d}from"./p-6de76553.js";import{g as p,a as h}from"./p-7e4bacc0.js";import{g as c}from"./p-6eb2ce21.js";import{g as b}from"./p-3627f343.js";import{S as f}from"./p-029ae656.js";import"./p-7d5dbd9a.js";import"./p-7648c449.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const x=class{constructor(s){t(this,s),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateid="",this.fieldname="",this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.xscale=1,this.yscale=1,this.showingProperties=!1}async focusField(){this.inputEl.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);t&&t.hidePanel&&t.hidePanel()}async componentWillLoad(){this.fieldStore=c(this.templateid),this.roleStore=p(this.templateid)}componentDidRender(){n.dynamicDrop(!0),this.editable&&n(this.el).resizable({edges:{top:!1,bottom:!1,left:!0,right:!0},listeners:{start:this.handleResizeStart.bind(this),move:this.handleResize.bind(this),end:this.handleResizeEnd.bind(this)}})}handleResizeStart(t){t.preventDefault(),t.stopPropagation()}handleResize(t){let{x:e=0,y:s=0,h:i=0}=t.target.dataset,{width:o,height:r}=t.rect;e=(parseFloat(e)||0)+t.deltaRect.left,s=(parseFloat(s)||0)+t.deltaRect.top,i=(parseFloat(i)||0)+t.deltaRect.height,Object.assign(t.target.style,{width:`${o}px`,height:`${r}px`,transform:`translate(${e}px, ${s+i}px)`}),Object.assign(t.target.dataset,{x:e,y:s,h:i})}handleResizeEnd(t){const e=this.fieldStore.get("fields").find((t=>t.name===this.fieldname)),s={...b(e)},[i,o]=t.target.style.transform.split("(")[1].split(")")[0].split(",").map(parseFloat);s.width=Math.round(parseFloat(t.target.style.width)/this.xscale),s.height=Math.round(parseFloat(t.target.style.height)/this.yscale),s.x=Math.round(s.x+i/this.xscale),s.y=Math.round(s.y-o/this.yscale),l(this.endpoint,this.templateid,this.fieldname,{setting:s}).then((e=>{var i;console.log("Update result",e),null===(i=this.settingsChanged)||void 0===i||i.emit({fieldName:e.name,settings:s,field:e}),Object.assign(t.target.dataset,{x:0,y:0,h:0})})).catch((t=>console.log("Field update failed",t)))}render(){var t,e;const r=this.fieldStore.get("fields").find((t=>t.name===this.fieldname));console.log("Rendering tb",this.fieldname,r);const n=h(this.roleStore,r.role_name),a=r.rgba||d(n);if(!r)return s(i,null);const l=b(r);let p=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:l.disabled)&&void 0!==e&&e;const c=(null==l?void 0:l.result)||"",x=(l.width||150)/5;return this.done?s(o,{class:{done:this.done}},c):s(o,{class:{required:r.required,disabled:p,done:this.done},style:{backgroundColor:a}},s("input",{type:"text",name:r.name,placeholder:null==l?void 0:l.placeholder,tabIndex:null==l?void 0:l.order,value:c,disabled:p,required:null==r?void 0:r.required,ref:t=>this.inputEl=t,maxlength:x}),this.editable&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${r.name}`,style:{transform:`scale(${Math.floor(1/this.xscale*1e3)/1e3}, ${Math.floor(1/this.yscale*1e3)/1e3})`},class:"settings-icon",innerHTML:f,onClick:t=>{t.stopPropagation(),this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${r.name}`,onClickAway:()=>this.showingProperties=!1},s("verdocs-template-field-properties",{templateId:this.templateid,fieldName:r.name,onClose:()=>this.showingProperties=!1,onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:r.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()},helpText:'Text boxes may be used to capture simple text input. Participant-entered values will be stored for later retrieval via the "name" field.<br /><br />If marked required, the participant must complete the field before proceeding.'}))))}get el(){return r(this)}};x.style='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;width:150px;height:15px;display:block;font-size:11px;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{cursor:inherit;width:100%;height:100%;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;position:absolute;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}verdocs-field-textbox .settings-icon{position:absolute;top:-4px;left:-20px;display:inline-block;cursor:pointer;opacity:0.6}verdocs-field-textbox .settings-icon svg{fill:#707ae5}verdocs-field-textbox .settings-icon:hover{opacity:1}';export{x as verdocs_field_textbox}
@@ -1 +1 @@
1
- import{r as t,h as s,H as e}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as i}from"./p-035f6b38.js";import{g as o}from"./p-302ab247.js";import"./p-7648c449.js";import"./p-560c15d7.js";import"./p-0282f68e.js";const l=class{constructor(s){t(this,s),this.store=null,this.endpoint=i.getDefault(),this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}async componentWillLoad(){try{this.endpoint.loadSession(),this.store=await o(this.endpoint,this.templateId,!1)}catch(t){console.log("[TEMPLATE VISIBILITY] Error loading template",t)}}render(){return console.log("[IPC] Rendering"),s(e,null,s("div",null,s("pre",null,s("code",null,JSON.stringify(this.store.state,null,2)))),s("verdocs-template-roles",{templateId:this.templateId}),s("verdocs-template-fields",{templateId:this.templateId}))}};l.style="ipc-test{max-width:800px;display:block}";export{l as ipc_test}
1
+ import{r as t,h as s,H as e}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as i}from"./p-035f6b38.js";import{g as o}from"./p-4381d111.js";import"./p-7648c449.js";import"./p-7e4bacc0.js";import"./p-6eb2ce21.js";const l=class{constructor(s){t(this,s),this.store=null,this.endpoint=i.getDefault(),this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}async componentWillLoad(){try{this.endpoint.loadSession(),this.store=await o(this.endpoint,this.templateId,!1)}catch(t){console.log("[TEMPLATE VISIBILITY] Error loading template",t)}}render(){return console.log("[IPC] Rendering"),s(e,null,s("div",null,s("pre",null,s("code",null,JSON.stringify(this.store.state,null,2)))),s("verdocs-template-roles",{templateId:this.templateId}),s("verdocs-template-fields",{templateId:this.templateId}))}};l.style="ipc-test{max-width:800px;display:block}";export{l as ipc_test}
@@ -1 +1 @@
1
- import{r as e,c as s,h as i,H as l}from"./p-14b44491.js";import{l as t,c as a}from"./p-dc2ad047.js";import{g as o,a as n,b as r}from"./p-29f64c27.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{i as p}from"./p-5e808a0b.js";import{s as c}from"./p-34f03fee.js";import{V as h}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import"./p-7d5dbd9a.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const x=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}],m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}],f=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}],u=class{constructor(i){e(this,i),this.changeView=s(this,"changeView",7),this.changeStatus=s(this,"changeStatus",7),this.changeSort=s(this,"changeSort",7),this.changeMatch=s(this,"changeMatch",7),this.sdkError=s(this,"sdkError",7),this.viewEnvelope=s(this,"viewEnvelope",7),this.finishEnvelope=s(this,"finishEnvelope",7),this.endpoint=d.getDefault(),this.view=void 0,this.status="all",this.sort="created_at",this.match="",this.showPagination=!0,this.rowsPerPage=10,this.selectedPage=0,this.count=0,this.initiallyLoaded=!1,this.loading=!0,this.selectedEnvelopes=[],this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[ENVELOPES] Must be authenticated")}async componentDidLoad(){await this.queryEnvelopes(),this.initiallyLoaded=!0}async queryEnvelopes(){var e,s,i;try{this.loading=!0;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e,is_owner:!0};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,is_owner:!0,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]}}"all"===this.view&&"all"!==this.status&&(e.status=[this.status]),this.match.trim();const s=await t(this.endpoint,e);this.envelopes=s.envelopes,this.count=s.total,this.loading=!1}catch(l){this.loading=!1,console.log("[ENVELOPES] Error listing envelopes",l),null===(e=this.sdkError)||void 0===e||e.emit(new v(l.message,null===(s=l.response)||void 0===s?void 0:s.status,null===(i=l.response)||void 0===i?void 0:i.data))}}handleDownload(){c(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){c(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}render(){return i(l,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.match,clearable:!0,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim(),null===(s=this.changeMatch)||void 0===s||s.emit(this.match)}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:x,onOptionSelected:e=>{this.view=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:f,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=o(e),t=r(this.endpoint.session,e),d=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!(l.find((e=>{var s;return e.email===(null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||""}))&&t&&n((null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||"",l))},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return null===(s=this.viewEnvelope)||void 0===s?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:-1!==this.selectedEnvelopes.findIndex((s=>s.id===e.id)),onClick:e=>e.stopPropagation(),onInput:s=>{this.selectedEnvelopes=s.target.checked?[...this.selectedEnvelopes,e]:this.selectedEnvelopes.filter((s=>s.id!==e.id))}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>',class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,":  ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>e.full_name)).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:d,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":null===(i=this.viewEnvelope)||void 0===i||i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":null===(l=this.finishEnvelope)||void 0===l||l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":window.confirm("Are you sure you want to cancel this envelope?")&&(a(this.endpoint,e.id).then((()=>h("Envelope canceled"))).catch((e=>h("Unable to cancel envelope: "+e.messabge,{style:"error"}))),this.queryEnvelopes().catch((()=>{})))}}})))})),!this.initiallyLoaded&&i("div",{style:{width:"100%"}},p(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};u.style='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';export{u as verdocs_envelopes_list}
1
+ import{r as e,c as s,h as i,H as l}from"./p-14b44491.js";import{l as t,c as a}from"./p-dc2ad047.js";import{g as o,a as n,b as r}from"./p-29f64c27.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{i as p}from"./p-5e808a0b.js";import{s as c}from"./p-3627f343.js";import{V as h}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import"./p-7d5dbd9a.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const x=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}],m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}],f=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}],u=class{constructor(i){e(this,i),this.changeView=s(this,"changeView",7),this.changeStatus=s(this,"changeStatus",7),this.changeSort=s(this,"changeSort",7),this.changeMatch=s(this,"changeMatch",7),this.sdkError=s(this,"sdkError",7),this.viewEnvelope=s(this,"viewEnvelope",7),this.finishEnvelope=s(this,"finishEnvelope",7),this.endpoint=d.getDefault(),this.view=void 0,this.status="all",this.sort="created_at",this.match="",this.showPagination=!0,this.rowsPerPage=10,this.selectedPage=0,this.count=0,this.initiallyLoaded=!1,this.loading=!0,this.selectedEnvelopes=[],this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[ENVELOPES] Must be authenticated")}async componentDidLoad(){await this.queryEnvelopes(),this.initiallyLoaded=!0}async queryEnvelopes(){var e,s,i;try{this.loading=!0;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e,is_owner:!0};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,is_owner:!0,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]}}"all"===this.view&&"all"!==this.status&&(e.status=[this.status]),this.match.trim();const s=await t(this.endpoint,e);this.envelopes=s.envelopes,this.count=s.total,this.loading=!1}catch(l){this.loading=!1,console.log("[ENVELOPES] Error listing envelopes",l),null===(e=this.sdkError)||void 0===e||e.emit(new v(l.message,null===(s=l.response)||void 0===s?void 0:s.status,null===(i=l.response)||void 0===i?void 0:i.data))}}handleDownload(){c(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){c(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}render(){return i(l,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.match,clearable:!0,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim(),null===(s=this.changeMatch)||void 0===s||s.emit(this.match)}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:x,onOptionSelected:e=>{this.view=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:f,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=o(e),t=r(this.endpoint.session,e),d=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!(l.find((e=>{var s;return e.email===(null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||""}))&&t&&n((null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||"",l))},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return null===(s=this.viewEnvelope)||void 0===s?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:-1!==this.selectedEnvelopes.findIndex((s=>s.id===e.id)),onClick:e=>e.stopPropagation(),onInput:s=>{this.selectedEnvelopes=s.target.checked?[...this.selectedEnvelopes,e]:this.selectedEnvelopes.filter((s=>s.id!==e.id))}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>',class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,":  ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>e.full_name)).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:d,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":null===(i=this.viewEnvelope)||void 0===i||i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":null===(l=this.finishEnvelope)||void 0===l||l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":window.confirm("Are you sure you want to cancel this envelope?")&&(a(this.endpoint,e.id).then((()=>h("Envelope canceled"))).catch((e=>h("Unable to cancel envelope: "+e.messabge,{style:"error"}))),this.queryEnvelopes().catch((()=>{})))}}})))})),!this.initiallyLoaded&&i("div",{style:{width:"100%"}},p(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};u.style='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';export{u as verdocs_envelopes_list}
@@ -0,0 +1 @@
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))r[a]=t[a]}return r};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++){if(s||!(n in t)){if(!s)s=Array.prototype.slice.call(t,0,n);s[n]=t[n]}}return r.concat(s||Array.prototype.slice.call(t))};System.register(["./p-3af6b910.system.js"],(function(r){"use strict";var t;return{setters:[function(r){t=r.c}],execute:function(){var e={};var n=r("g",(function(r){if(!e[r]){e[r]=t({roles:[]})}return e[r]}));var a=r("c",(function(r){var a=n(r.id);if(!a){console.log("Creating template role store for template",r);a=t({roles:[]});e[r.id]=a}a.set("roles",__spreadArray([],r.roles,true));return a}));var s=r("u",(function(r,t,e){var n=__spreadArray([],r.get("roles").map((function(r){if(r.name!==t){return r}return __assign(__assign({},r),e)})),true);r.set("roles",n)}));var i=r("d",(function(r,t){var e=__spreadArray([],r.get("roles").filter((function(r){return r.name!==t})),true);r.set("roles",e)}));var o=r("b",(function(r){return r.get("roles").map((function(r){return r.name}))}));var u=r("a",(function(r,t){return o(r).findIndex((function(r){return r===t}))}))}}}));
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function l(e){try{a(o["throw"](e))}catch(e){r(e)}}function a(e){e.done?i(e.value):n(e.value).then(s,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];n=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,n=t.length,r;o<n;o++){if(r||!(o in t)){if(!r)r=Array.prototype.slice.call(t,0,o);r[o]=t[o]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-1ba9f457.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-b1288daf.system.js","./p-2e7f6f8c.system.js","./p-700bd5d3.system.js","./p-419cd79c.system.js","./p-187b20b7.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,o,n,r,s,l,a,d,p,c,u,f,h;return{setters:[function(e){t=e.r;i=e.c;o=e.h;n=e.H;r=e.a},function(e){s=e.a},function(){},function(e){l=e.V},function(e){a=e.u;d=e.d},function(e){p=e.g;c=e.u},function(e){u=e.g},function(e){f=e.g},function(e){h=e.S},function(){}],execute:function(){var m="";var v="10001";var g=e("verdocs_portal",function(){function e(e){t(this,e);this.clickAway=i(this,"clickAway",7);this.moved=false;this.anchor=undefined;this.voffset=0;this.align="left"}e.prototype.handleScroll=function(){this.calculatePosition()};e.prototype.handleResize=function(){this.calculatePosition()};e.prototype.handleClick=function(e){var t;if(!this.element.contains(e.target)){(t=this.clickAway)===null||t===void 0?void 0:t.emit()}};e.prototype.calculateLeft=function(){var e=document.getElementById(this.anchor);if(!e)return 0;var t=e.getBoundingClientRect();if(this.align==="left"){return Math.max(t.left,0)}if(this.align==="right"){return Math.max(t.left+t.width-this.portal.offsetWidth,0)}return Math.max(t.left-this.portal.offsetWidth/2+t.width/2,0)};e.prototype.calculateTop=function(){var e=document.getElementById(this.anchor);if(!e)return 0;var t=e.getBoundingClientRect();return t.bottom+this.voffset};e.prototype.calculatePosition=function(){this.portal.style.top="".concat(this.calculateTop(),"px");this.portal.style.left="".concat(this.calculateLeft(),"px")};e.prototype.componentWillLoad=function(){var e;var t="".concat(this.anchor,"-portal");(e=document.getElementById(t))===null||e===void 0?void 0:e.remove();this.portal=document.createElement("div");this.portal.setAttribute("id",t);this.portal.style.zIndex=v;this.portal.style.position="absolute";document.body.append(this.portal)};e.prototype.componentDidLoad=function(){this.portal.appendChild(this.element);this.calculatePosition()};e.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};e.prototype.render=function(){var e=this;return o(n,{ref:function(t){return e.element=t}},o("slot",null))};return e}());g.style=m;var x;var y=typeof s!=="undefined"&&(s.crypto||s.msCrypto);if(y&&y.getRandomValues){var b=new Uint8Array(16);x=function e(){y.getRandomValues(b);return b}}if(!x){var w=new Array(16);x=function(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;w[e]=t>>>((e&3)<<3)&255}return w}}var _=x;var k=[];for(var I=0;I<256;++I){k[I]=(I+256).toString(16).substr(1)}function q(e,t){var i=t||0;var o=k;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}var S=q;var N=_();var T=[N[0]|1,N[1],N[2],N[3],N[4],N[5]];var E=(N[6]<<8|N[7])&16383;var P=0,C=0;function A(e,t,i){var o=t&&i||0;var n=t||[];e=e||{};var r=e.clockseq!==undefined?e.clockseq:E;var s=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:C+1;var a=s-P+(l-C)/1e4;if(a<0&&e.clockseq===undefined){r=r+1&16383}if((a<0||s>P)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}P=s;C=l;E=r;s+=122192928e5;var d=((s&268435455)*1e4+l)%4294967296;n[o++]=d>>>24&255;n[o++]=d>>>16&255;n[o++]=d>>>8&255;n[o++]=d&255;var p=s/4294967296*1e4&268435455;n[o++]=p>>>8&255;n[o++]=p&255;n[o++]=p>>>24&15|16;n[o++]=p>>>16&255;n[o++]=r>>>8|128;n[o++]=r&255;var c=e.node||T;for(var u=0;u<6;++u){n[o+u]=c[u]}return t?t:S(n)}var L=A;function O(e,t,i){var o=t&&i||0;if(typeof e=="string"){t=e=="binary"?new Array(16):null;e=null}e=e||{};var n=e.random||(e.rng||_)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(t){for(var r=0;r<16;++r){t[o+r]=n[r]}}return t||S(n)}var R=O;var j=R;j.v1=L;j.v4=R;var D=j;var M='verdocs-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0px #0000001f;box-shadow:2px 2px 10px 0px #0000001f}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-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}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var F=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var H='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var z='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var B=e("verdocs_template_field_properties",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.delete=i(this,"delete",7);this.settingsChanged=i(this,"settingsChanged",7);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.setting=null;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,n,r,s,l,a,d,c,m;var v=this;return __generator(this,(function(g){switch(g.label){case 0:g.trys.push([0,4,,5]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,f(this.endpoint,this.templateId)];case 1:l.templateStore=g.sent();a=this;return[4,p(this.templateId)];case 2:a.fieldStore=g.sent();d=this;return[4,u(this.templateId)];case 3:d.roleStore=g.sent();c=this.fieldStore.get("fields").find((function(e){return e.name===v.fieldName}));if(!c){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'))}else{console.log("props",c)}this.type=c.type;this.name=c.name;this.label=c.label;this.group=c.name;this.roleName=c.role_name;this.required=c.required;this.fieldType=c.type;this.placeholder=((e=c.setting)===null||e===void 0?void 0:e.placeholder)||"";this.value=((t=c.setting)===null||t===void 0?void 0:t.result)||"";this.leading=((i=c.setting)===null||i===void 0?void 0:i.leading)||0;this.setting=c.setting||{};this.options=((o=c.setting)===null||o===void 0?void 0:o.options)||[];this.dirty=false;this.loading=false;console.log("Displaying settings for",this.setting);return[3,5];case 4:m=g.sent();console.log("[FIELD PROPERTIES] Error loading template",m);this.loading=false;(n=this.sdkError)===null||n===void 0?void 0:n.emit(new h(m.message,(r=m.response)===null||r===void 0?void 0:r.status,(s=m.response)===null||s===void 0?void 0:s.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var i,o,n,r;e.stopPropagation();var s=this.fieldStore.get("fields").find((function(e){return e.name===t.fieldName}));if(s){this.name=s.name;this.label=s.label;this.roleName=s.role_name;this.required=s.required;this.placeholder=((i=s.setting)===null||i===void 0?void 0:i.placeholder)||"";this.value=((o=s.setting)===null||o===void 0?void 0:o.result)||"";this.leading=((n=s.setting)===null||n===void 0?void 0:n.leading)||0}this.dirty=false;(r=this.close)===null||r===void 0?void 0:r.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var i={name:this.name,label:this.label||null,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){i.setting=this.setting;i.setting.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){i.setting=__assign({},this.setting);i.setting.result=(this.value||"").trim()}else if(this.type==="dropdown"){i.setting={x:this.setting.x,y:this.setting.y,options:this.options}}console.log("FP: Will update",this.fieldName,i);a(this.endpoint,this.templateId,this.fieldName,i).then((function(e){var o,n;t.dirty=false;var r=__spreadArray([],t.fieldStore.get("fields").map((function(i){if(i.name!==t.fieldName){return i}return __assign(__assign({},i),e)})),true);t.fieldStore.set("fields",r);(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,settings:i,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var i={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:D(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:D(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});i.setting=__assign({},this.setting);delete i.setting.result;i.setting.options=__spreadArray([],this.options,true);a(this.endpoint,this.templateId,this.fieldName,i).then((function(e){var o,n;t.dirty=false;c(t.fieldStore,t.fieldName,e);t.fieldName=e.name;(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,settings:i,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){d(this.endpoint,this.templateId,this.fieldName).then((function(){var e,i;t.fieldStore.set("fields",t.fieldStore.get("fields").filter((function(e){return e.name!==t.fieldName})));(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(i=document.getElementById("verdocs-template-field-properties"))===null||i===void 0?void 0:i.remove()})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return o(n,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get("fields").some((function(t){return t.name===e.fieldName}))){return o(n,{class:"empty"})}if(this.helpText&&this.showingHelp){return o(n,null,o("h6",null,F(this.fieldType)," Settings ",o("div",{style:{flex:"1"}}),o("div",{class:"help-icon",innerHTML:z,onClick:function(){return e.showingHelp=false}})),o("p",{class:"instructions",innerHTML:this.helpText}))}return o(n,{id:"verdocs-template-field-properties"},o("h6",null,F(this.fieldType.replace(/_/g," "))," Settings ",o("div",{style:{flex:"1"}}),this.helpText&&o("div",{class:"help-icon",innerHTML:z,onClick:function(){return e.showingHelp=true}})),o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("div",{class:"row"},o("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),o("div",{class:"row"},o("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),o("div",{class:"row"},o("div",{class:"input-label"},"Role:"),o("verdocs-select-input",{value:this.roleName,options:(t=this.roleStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&o("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},o("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&o("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},o("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},o("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),o("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&o("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&o("div",{class:"options"},o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),o("div",{class:"row-header"},o("h6",null,"ID"),o("h6",null,"Label"),o("div",{style:{width:"34px"}})),this.options.map((function(t,i){return o("div",{class:"row option-row",key:i},o("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[i].id=t.target.value;e.dirty=true}}),o("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[i].value=t.target.value;e.dirty=true}}),o("button",{innerHTML:H,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),o("div",{class:"row-header"},o("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),o("div",{class:"buttons"},o("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:H}),o("div",{style:{flex:"1"}}),o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());B.style=M}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function l(e){try{a(o["throw"](e))}catch(e){r(e)}}function a(e){e.done?i(e.value):n(e.value).then(s,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];n=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,n=t.length,r;o<n;o++){if(r||!(o in t)){if(!r)r=Array.prototype.slice.call(t,0,o);r[o]=t[o]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-1ba9f457.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-b1288daf.system.js","./p-f69790c5.system.js","./p-c152dbfa.system.js","./p-7e327308.system.js","./p-187b20b7.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,o,n,r,s,l,a,d,p,c,u,f,h;return{setters:[function(e){t=e.r;i=e.c;o=e.h;n=e.H;r=e.a},function(e){s=e.a},function(){},function(e){l=e.V},function(e){a=e.u;d=e.d},function(e){p=e.g;c=e.u},function(e){u=e.g},function(e){f=e.g},function(e){h=e.S},function(){}],execute:function(){var m="";var v="10001";var g=e("verdocs_portal",function(){function e(e){t(this,e);this.clickAway=i(this,"clickAway",7);this.moved=false;this.anchor=undefined;this.voffset=0;this.align="left"}e.prototype.handleScroll=function(){this.calculatePosition()};e.prototype.handleResize=function(){this.calculatePosition()};e.prototype.handleClick=function(e){var t;if(!this.element.contains(e.target)){(t=this.clickAway)===null||t===void 0?void 0:t.emit()}};e.prototype.calculateLeft=function(){var e=document.getElementById(this.anchor);if(!e)return 0;var t=e.getBoundingClientRect();if(this.align==="left"){return Math.max(t.left,0)}if(this.align==="right"){return Math.max(t.left+t.width-this.portal.offsetWidth,0)}return Math.max(t.left-this.portal.offsetWidth/2+t.width/2,0)};e.prototype.calculateTop=function(){var e=document.getElementById(this.anchor);if(!e)return 0;var t=e.getBoundingClientRect();return t.bottom+this.voffset};e.prototype.calculatePosition=function(){this.portal.style.top="".concat(this.calculateTop(),"px");this.portal.style.left="".concat(this.calculateLeft(),"px")};e.prototype.componentWillLoad=function(){var e;var t="".concat(this.anchor,"-portal");(e=document.getElementById(t))===null||e===void 0?void 0:e.remove();this.portal=document.createElement("div");this.portal.setAttribute("id",t);this.portal.style.zIndex=v;this.portal.style.position="absolute";document.body.append(this.portal)};e.prototype.componentDidLoad=function(){this.portal.appendChild(this.element);this.calculatePosition()};e.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};e.prototype.render=function(){var e=this;return o(n,{ref:function(t){return e.element=t}},o("slot",null))};return e}());g.style=m;var x;var y=typeof s!=="undefined"&&(s.crypto||s.msCrypto);if(y&&y.getRandomValues){var b=new Uint8Array(16);x=function e(){y.getRandomValues(b);return b}}if(!x){var w=new Array(16);x=function(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;w[e]=t>>>((e&3)<<3)&255}return w}}var _=x;var k=[];for(var I=0;I<256;++I){k[I]=(I+256).toString(16).substr(1)}function q(e,t){var i=t||0;var o=k;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}var S=q;var N=_();var T=[N[0]|1,N[1],N[2],N[3],N[4],N[5]];var E=(N[6]<<8|N[7])&16383;var P=0,C=0;function A(e,t,i){var o=t&&i||0;var n=t||[];e=e||{};var r=e.clockseq!==undefined?e.clockseq:E;var s=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:C+1;var a=s-P+(l-C)/1e4;if(a<0&&e.clockseq===undefined){r=r+1&16383}if((a<0||s>P)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}P=s;C=l;E=r;s+=122192928e5;var d=((s&268435455)*1e4+l)%4294967296;n[o++]=d>>>24&255;n[o++]=d>>>16&255;n[o++]=d>>>8&255;n[o++]=d&255;var p=s/4294967296*1e4&268435455;n[o++]=p>>>8&255;n[o++]=p&255;n[o++]=p>>>24&15|16;n[o++]=p>>>16&255;n[o++]=r>>>8|128;n[o++]=r&255;var c=e.node||T;for(var u=0;u<6;++u){n[o+u]=c[u]}return t?t:S(n)}var L=A;function O(e,t,i){var o=t&&i||0;if(typeof e=="string"){t=e=="binary"?new Array(16):null;e=null}e=e||{};var n=e.random||(e.rng||_)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(t){for(var r=0;r<16;++r){t[o+r]=n[r]}}return t||S(n)}var R=O;var j=R;j.v1=L;j.v4=R;var D=j;var M='verdocs-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0px #0000001f;box-shadow:2px 2px 10px 0px #0000001f}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-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}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var F=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var H='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var z='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var B=e("verdocs_template_field_properties",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.delete=i(this,"delete",7);this.settingsChanged=i(this,"settingsChanged",7);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.setting=null;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,n,r,s,l,a,d,c,m;var v=this;return __generator(this,(function(g){switch(g.label){case 0:g.trys.push([0,4,,5]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,f(this.endpoint,this.templateId)];case 1:l.templateStore=g.sent();a=this;return[4,p(this.templateId)];case 2:a.fieldStore=g.sent();d=this;return[4,u(this.templateId)];case 3:d.roleStore=g.sent();c=this.fieldStore.get("fields").find((function(e){return e.name===v.fieldName}));if(!c){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'))}else{console.log("props",c)}this.type=c.type;this.name=c.name;this.label=c.label;this.group=c.name;this.roleName=c.role_name;this.required=c.required;this.fieldType=c.type;this.placeholder=((e=c.setting)===null||e===void 0?void 0:e.placeholder)||"";this.value=((t=c.setting)===null||t===void 0?void 0:t.result)||"";this.leading=((i=c.setting)===null||i===void 0?void 0:i.leading)||0;this.setting=c.setting||{};this.options=((o=c.setting)===null||o===void 0?void 0:o.options)||[];this.dirty=false;this.loading=false;console.log("Displaying settings for",this.setting);return[3,5];case 4:m=g.sent();console.log("[FIELD PROPERTIES] Error loading template",m);this.loading=false;(n=this.sdkError)===null||n===void 0?void 0:n.emit(new h(m.message,(r=m.response)===null||r===void 0?void 0:r.status,(s=m.response)===null||s===void 0?void 0:s.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var i,o,n,r;e.stopPropagation();var s=this.fieldStore.get("fields").find((function(e){return e.name===t.fieldName}));if(s){this.name=s.name;this.label=s.label;this.roleName=s.role_name;this.required=s.required;this.placeholder=((i=s.setting)===null||i===void 0?void 0:i.placeholder)||"";this.value=((o=s.setting)===null||o===void 0?void 0:o.result)||"";this.leading=((n=s.setting)===null||n===void 0?void 0:n.leading)||0}this.dirty=false;(r=this.close)===null||r===void 0?void 0:r.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var i={name:this.name,label:this.label||null,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){i.setting=this.setting;i.setting.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){i.setting=__assign({},this.setting);i.setting.result=(this.value||"").trim()}else if(this.type==="dropdown"){i.setting={x:this.setting.x,y:this.setting.y,options:this.options}}console.log("FP: Will update",this.fieldName,i);a(this.endpoint,this.templateId,this.fieldName,i).then((function(e){var o,n;t.dirty=false;var r=__spreadArray([],t.fieldStore.get("fields").map((function(i){if(i.name!==t.fieldName){return i}return __assign(__assign({},i),e)})),true);t.fieldStore.set("fields",r);(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,settings:i,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var i={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:D(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:D(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});i.setting=__assign({},this.setting);delete i.setting.result;i.setting.options=__spreadArray([],this.options,true);a(this.endpoint,this.templateId,this.fieldName,i).then((function(e){var o,n;t.dirty=false;c(t.fieldStore,t.fieldName,e);t.fieldName=e.name;(o=t.settingsChanged)===null||o===void 0?void 0:o.emit({fieldName:t.fieldName,settings:i,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){d(this.endpoint,this.templateId,this.fieldName).then((function(){var e,i;t.fieldStore.set("fields",t.fieldStore.get("fields").filter((function(e){return e.name!==t.fieldName})));(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(i=document.getElementById("verdocs-template-field-properties"))===null||i===void 0?void 0:i.remove()})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return o(n,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get("fields").some((function(t){return t.name===e.fieldName}))){return o(n,{class:"empty"})}if(this.helpText&&this.showingHelp){return o(n,null,o("h6",null,F(this.fieldType)," Settings ",o("div",{style:{flex:"1"}}),o("div",{class:"help-icon",innerHTML:z,onClick:function(){return e.showingHelp=false}})),o("p",{class:"instructions",innerHTML:this.helpText}))}return o(n,{id:"verdocs-template-field-properties"},o("h6",null,F(this.fieldType.replace(/_/g," "))," Settings ",o("div",{style:{flex:"1"}}),this.helpText&&o("div",{class:"help-icon",innerHTML:z,onClick:function(){return e.showingHelp=true}})),o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("div",{class:"row"},o("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),o("div",{class:"row"},o("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),o("div",{class:"row"},o("div",{class:"input-label"},"Role:"),o("verdocs-select-input",{value:this.roleName,options:(t=this.roleStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&o("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},o("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&o("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},o("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},o("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),o("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&o("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&o("div",{class:"options"},o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),o("div",{class:"row-header"},o("h6",null,"ID"),o("h6",null,"Label"),o("div",{style:{width:"34px"}})),this.options.map((function(t,i){return o("div",{class:"row option-row",key:i},o("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[i].id=t.target.value;e.dirty=true}}),o("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[i].value=t.target.value;e.dirty=true}}),o("button",{innerHTML:H,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),o("div",{class:"row-header"},o("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),o("div",{class:"buttons"},o("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:H}),o("div",{style:{flex:"1"}}),o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());B.style=M}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];r=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,o;n<r;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-eaf0b189.system.js","./p-9bf2d124.system.js","./p-877c2b06.system.js","./p-3bcd86ea.system.js","./p-c90481a4.system.js","./p-2e7f6f8c.system.js","./p-d8cd6b59.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-dc9c4361.system.js","./p-1ba9f457.system.js","./p-327858f0.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,n,r,o,s,a,l,d,c,u,h,p,f,v,g,m,b,x,y,w,k,I,_,F,S,N,E,R;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;o=e.F},function(e){s=e.e;a=e.a;l=e.u;d=e.f;c=e.h;u=e.i},function(e){h=e.R},function(e){p=e.e;f=e.a;v=e.b},function(e){g=e.V},function(e){m=e.i;b=e.a},function(e){x=e.f;y=e.i},function(e){w=e.a;k=e.u;I=e.r;_=e.b},function(e){F=e.a},function(e){S=e.a},function(e){N=e.V},function(e){E=e.S},function(e){R=e.f},function(){},function(){},function(){}],execute:function(){var L=function(e,t,i){var n=new FormData;n.append("signature",i,t);return e.api.post("/signatures",n).then((function(e){return e.data}))};var D=function(e,t,i){var n=new FormData;n.append("initial",i,t);return e.api.post("/initials",n).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var C=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var G=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var P=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new g({sessionType:"signing"})};e.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,l,d,c,u,h,p,f,v;var g=this;return __generator(this,(function(m){switch(m.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new E("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new E("[SIGN] Missing required inviteCode",500,""));return[2]}m.label=1;case 1:m.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:d=m.sent(),c=d.session,u=d.recipient,h=d.signerToken;console.log("[SIGN] Loaded signing session ".concat(c.email," / ").concat(c.profile_id));this.recipient=u;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=h;this.endpoint.setToken(h);if(this.agreed){this.nextButtonLabel="Next"}p=this;return[4,a(this.endpoint,this.envelopeId)];case 3:p.envelope=m.sent();f=F(this.envelope);console.log("made fs",f);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==g.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,5];case 4:v=m.sent();console.log("Error with signing session",v);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new E(v.message,(o=v.response)===null||o===void 0?void 0:o.status,(l=v.response)===null||l===void 0?void 0:l.data));this.showLoadError=true;return[3,5];case 5:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;p(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,r;console.log("Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new E(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,o,s,a;return __generator(this,(function(l){switch(l.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:N("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,f(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:w(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"});return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.settings=t.settings;k(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);l(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=i.sdkError)===null||o===void 0?void 0:o.emit(new E(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,r,o,s,s,a,l,u,h;var p=this;return __generator(this,(function(f){switch(f.label){case 0:i=t.target,n=i.value,r=i.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}f.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}f.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 6:return[4,f.sent().blob()];case 7:a=f.sent();return[2,D(this.endpoint,"initial",a).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,c(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))}))];case 8:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 9:return[4,f.sent().blob()];case 10:l=f.sent();return[2,L(this.endpoint,"signature",l).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))})).catch((function(e){console.warn("Error updating signature",e)}))];case 11:u=t.target.getAttribute("iso");h=R(new Date(u),S);if(h!=="1970-12-31"){return[2,this.saveFieldChange(e.name,{prepared:false,value:h})]}return[3,14];case 12:console.log("Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,i,n,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,h=u===void 0?"":u,p=c.value,f=p===void 0?"":p,v=c.base64,g=v===void 0?"":v;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return b(h);case"phone":return m(h);default:return!d||h!==""}case"signature":case"initial":return!d||g!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":console.log("Date-type field valid",{required:d,result:h,output:!d||h!==""});return!d||h!=="";case"dropdown":return!d||f!=="";case"checkbox_group":var x=(((n=(i=e.settings)===null||i===void 0?void 0:i.options)===null||n===void 0?void 0:n.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,s,a,l,d;var c=this;return __generator(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);this.submitting=true;return[4,v(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;return[3,4];case 3:i=u.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:this.submitting=false;return[2];case 5:n=this.getRecipientFields().filter((function(e){return e.required}));r=n.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=n.length){o=0}s=n[o];a=0;if(a<n.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=n.length){o=0}s=n[o]}if(a>=n.length){s=null}if(s){l=_(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.recipient_role===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;var r;i.addEventListener("input",(function(e){console.log("[SIGN] onfieldInput",e.detail,e.target.value);if(e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")){console.log("CB",e.target);n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,u(this.endpoint,this.envelopeId,this.roleId,t.name,e.detail)];case 1:i=n.sent();console.log("upload result",i);this.checkRecipientFields();return[2]}}))}))}));i.addEventListener("removed",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value)}));i.addEventListener("focusout",(function(e){return n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?x(this.recipient.full_name):"");i.setAttribute("name",((r=this.recipient)===null||r===void 0?void 0:r.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;console.log("hpr",this.recipient,this.envelope.fields.filter((function(e){return e.recipient_role===t.recipient.role_name})));var n=this.getRecipientFields().filter((function(e){return e.page===i.pageNumber}));n.filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=I(e,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status===h.INVITED||e.status===h.OPENED||e.status===h.PENDING)})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=I(e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}return n(r,{class:{agreed:this.agreed}},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}}),!this.finishLater&&n("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),n("div",{style:{marginLeft:"10px"}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?C:G,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),n("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((function(t){var i=y(1,t.page_numbers);return n(o,null,i.map((function(i){return n("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.showLoadError&&n("verdocs-ok-dialog",{heading:"Error Loading Document",message:"Please check with the sender to ensure it has not been canceled, and try again later.",buttonLabel:"Retry",onNext:function(){e.showLoadError=false;window.location.reload()}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)),!this.agreed&&n("div",{class:"cover"},n("div",{class:"agree"},n("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),n("ul",null,n("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",n("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),n("li",null,"Agree to Verdocs"," ",n("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",n("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))};return e}());P.style=A}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];r=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,o;n<r;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-eaf0b189.system.js","./p-9bf2d124.system.js","./p-877c2b06.system.js","./p-3bcd86ea.system.js","./p-fa4bc1ec.system.js","./p-f69790c5.system.js","./p-d8cd6b59.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-dc9c4361.system.js","./p-1ba9f457.system.js","./p-327858f0.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,n,r,o,s,a,l,d,c,u,h,p,f,v,g,m,b,x,y,w,k,I,_,F,S,N,E,R;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;o=e.F},function(e){s=e.e;a=e.a;l=e.u;d=e.f;c=e.h;u=e.i},function(e){h=e.R},function(e){p=e.e;f=e.a;v=e.b},function(e){g=e.V},function(e){m=e.i;b=e.a},function(e){x=e.f;y=e.i},function(e){w=e.a;k=e.u;I=e.r;_=e.b},function(e){F=e.a},function(e){S=e.a},function(e){N=e.V},function(e){E=e.S},function(e){R=e.f},function(){},function(){},function(){}],execute:function(){var L=function(e,t,i){var n=new FormData;n.append("signature",i,t);return e.api.post("/signatures",n).then((function(e){return e.data}))};var D=function(e,t,i){var n=new FormData;n.append("initial",i,t);return e.api.post("/initials",n).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var C=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var G=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var P=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new g({sessionType:"signing"})};e.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,l,d,c,u,h,p,f,v;var g=this;return __generator(this,(function(m){switch(m.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new E("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new E("[SIGN] Missing required inviteCode",500,""));return[2]}m.label=1;case 1:m.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:d=m.sent(),c=d.session,u=d.recipient,h=d.signerToken;console.log("[SIGN] Loaded signing session ".concat(c.email," / ").concat(c.profile_id));this.recipient=u;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=h;this.endpoint.setToken(h);if(this.agreed){this.nextButtonLabel="Next"}p=this;return[4,a(this.endpoint,this.envelopeId)];case 3:p.envelope=m.sent();f=F(this.envelope);console.log("made fs",f);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==g.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,5];case 4:v=m.sent();console.log("Error with signing session",v);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new E(v.message,(o=v.response)===null||o===void 0?void 0:o.status,(l=v.response)===null||l===void 0?void 0:l.data));this.showLoadError=true;return[3,5];case 5:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;p(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,r;console.log("Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new E(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,o,s,a;return __generator(this,(function(l){switch(l.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:N("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,f(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:w(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"});return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.settings=t.settings;k(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);l(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=i.sdkError)===null||o===void 0?void 0:o.emit(new E(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,r,o,s,s,a,l,u,h;var p=this;return __generator(this,(function(f){switch(f.label){case 0:i=t.target,n=i.value,r=i.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}f.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}f.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 6:return[4,f.sent().blob()];case 7:a=f.sent();return[2,D(this.endpoint,"initial",a).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,c(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))}))];case 8:if(!t.detail){return[2]}return[4,fetch(t.detail)];case 9:return[4,f.sent().blob()];case 10:l=f.sent();return[2,L(this.endpoint,"signature",l).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))})).catch((function(e){console.warn("Error updating signature",e)}))];case 11:u=t.target.getAttribute("iso");h=R(new Date(u),S);if(h!=="1970-12-31"){return[2,this.saveFieldChange(e.name,{prepared:false,value:h})]}return[3,14];case 12:console.log("Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,i,n,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,h=u===void 0?"":u,p=c.value,f=p===void 0?"":p,v=c.base64,g=v===void 0?"":v;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return b(h);case"phone":return m(h);default:return!d||h!==""}case"signature":case"initial":return!d||g!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":console.log("Date-type field valid",{required:d,result:h,output:!d||h!==""});return!d||h!=="";case"dropdown":return!d||f!=="";case"checkbox_group":var x=(((n=(i=e.settings)===null||i===void 0?void 0:i.options)===null||n===void 0?void 0:n.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,o,s,a,l,d;var c=this;return __generator(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);this.submitting=true;return[4,v(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;return[3,4];case 3:i=u.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:this.submitting=false;return[2];case 5:n=this.getRecipientFields().filter((function(e){return e.required}));r=n.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=n.length){o=0}s=n[o];a=0;if(a<n.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=n.length){o=0}s=n[o]}if(a>=n.length){s=null}if(s){l=_(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.recipient_role===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;var r;i.addEventListener("input",(function(e){console.log("[SIGN] onfieldInput",e.detail,e.target.value);if(e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")){console.log("CB",e.target);n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,u(this.endpoint,this.envelopeId,this.roleId,t.name,e.detail)];case 1:i=n.sent();console.log("upload result",i);this.checkRecipientFields();return[2]}}))}))}));i.addEventListener("removed",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value)}));i.addEventListener("focusout",(function(e){return n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?x(this.recipient.full_name):"");i.setAttribute("name",((r=this.recipient)===null||r===void 0?void 0:r.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;console.log("hpr",this.recipient,this.envelope.fields.filter((function(e){return e.recipient_role===t.recipient.role_name})));var n=this.getRecipientFields().filter((function(e){return e.page===i.pageNumber}));n.filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=I(e,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status===h.INVITED||e.status===h.OPENED||e.status===h.PENDING)})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=I(e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}return n(r,{class:{agreed:this.agreed}},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}}),!this.finishLater&&n("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),n("div",{style:{marginLeft:"10px"}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?C:G,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),n("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((function(t){var i=y(1,t.page_numbers);return n(o,null,i.map((function(i){return n("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.showLoadError&&n("verdocs-ok-dialog",{heading:"Error Loading Document",message:"Please check with the sender to ensure it has not been canceled, and try again later.",buttonLabel:"Retry",onNext:function(){e.showLoadError=false;window.location.reload()}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)),!this.agreed&&n("div",{class:"cover"},n("div",{class:"agree"},n("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),n("ul",null,n("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",n("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),n("li",null,"Agree to Verdocs"," ",n("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",n("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))};return e}());P.style=A}}}));