@verdocs/web-sdk 1.11.11 → 1.12.1

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 (161) hide show
  1. package/dist/cjs/verdocs-build.cjs.entry.js +1 -9
  2. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +2 -2
  3. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  5. package/dist/cjs/verdocs-field-signature.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +2 -2
  7. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +3 -3
  9. package/dist/cjs/verdocs-send.cjs.entry.js +3 -3
  10. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-template-create_2.cjs.entry.js +21 -17
  12. package/dist/cjs/verdocs-template-properties.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-template-roles.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +2 -2
  15. package/dist/collection/collection-manifest.json +1 -1
  16. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +4 -4
  17. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.stories.js +3 -3
  18. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js +4 -4
  19. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.js +4 -4
  20. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +5 -5
  21. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.stories.js +3 -3
  22. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +4 -4
  23. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.stories.js +3 -3
  24. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +4 -4
  25. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.stories.js +4 -6
  26. package/dist/collection/components/elements/verdocs-contact-picker/verdocs-contact-picker.js +4 -4
  27. package/dist/collection/components/elements/verdocs-contact-picker/verdocs-contact-picker.stories.js +2 -2
  28. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +1 -9
  29. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +5 -5
  30. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +1 -1
  31. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +4 -4
  32. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +1 -1
  33. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +4 -21
  34. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.stories.js +2 -2
  35. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +19 -45
  36. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +5 -8
  37. package/dist/collection/components/templates/verdocs-template-properties/verdocs-template-properties.js +4 -4
  38. package/dist/collection/components/templates/verdocs-template-properties/verdocs-template-properties.stories.js +2 -2
  39. package/dist/collection/components/templates/{verdocs-template-recipients → verdocs-template-roles}/verdocs-template-roles.js +4 -4
  40. package/dist/collection/components/templates/{verdocs-template-recipients → verdocs-template-roles}/verdocs-template-roles.stories.js +2 -2
  41. package/dist/components/index.d.ts +1 -1
  42. package/dist/components/verdocs-build.js +1 -9
  43. package/dist/components/verdocs-contact-picker2.js +2 -2
  44. package/dist/components/verdocs-field-attachment.js +1 -1
  45. package/dist/components/verdocs-field-initial.js +2 -2
  46. package/dist/components/verdocs-field-signature.js +1 -1
  47. package/dist/components/verdocs-initial-dialog2.js +2 -2
  48. package/dist/components/verdocs-kba-dialog.js +2 -2
  49. package/dist/components/verdocs-ok-dialog2.js +3 -3
  50. package/dist/components/verdocs-send.js +3 -3
  51. package/dist/components/verdocs-signature-dialog2.js +2 -2
  52. package/dist/components/verdocs-template-create2.js +2 -5
  53. package/dist/components/verdocs-template-fields2.js +19 -12
  54. package/dist/components/verdocs-template-properties.js +2 -2
  55. package/dist/components/verdocs-template-roles.js +2 -2
  56. package/dist/components/verdocs-upload-dialog2.js +2 -2
  57. package/dist/docs.json +28 -55
  58. package/dist/esm/verdocs-build.entry.js +1 -9
  59. package/dist/esm/verdocs-contact-picker.entry.js +2 -2
  60. package/dist/esm/verdocs-field-attachment.entry.js +1 -1
  61. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  62. package/dist/esm/verdocs-field-signature.entry.js +1 -1
  63. package/dist/esm/verdocs-initial-dialog.entry.js +2 -2
  64. package/dist/esm/verdocs-kba-dialog.entry.js +2 -2
  65. package/dist/esm/verdocs-ok-dialog.entry.js +3 -3
  66. package/dist/esm/verdocs-send.entry.js +3 -3
  67. package/dist/esm/verdocs-signature-dialog.entry.js +2 -2
  68. package/dist/esm/verdocs-template-create_2.entry.js +21 -17
  69. package/dist/esm/verdocs-template-properties.entry.js +2 -2
  70. package/dist/esm/verdocs-template-roles.entry.js +2 -2
  71. package/dist/esm/verdocs-upload-dialog.entry.js +2 -2
  72. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  73. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-template-properties.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-template-roles.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
  86. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.d.ts +2 -2
  87. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.stories.d.ts +2 -2
  88. package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.d.ts +2 -2
  89. package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.d.ts +2 -2
  90. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +2 -2
  91. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.stories.d.ts +2 -2
  92. package/dist/types/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.d.ts +2 -2
  93. package/dist/types/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.stories.d.ts +2 -2
  94. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.d.ts +2 -2
  95. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.stories.d.ts +2 -2
  96. package/dist/types/components/elements/verdocs-contact-picker/verdocs-contact-picker.d.ts +2 -2
  97. package/dist/types/components/elements/verdocs-contact-picker/verdocs-contact-picker.stories.d.ts +2 -2
  98. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +0 -2
  99. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +2 -2
  100. package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +2 -2
  101. package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.d.ts +2 -6
  102. package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.stories.d.ts +2 -2
  103. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +0 -8
  104. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.stories.d.ts +1 -3
  105. package/dist/types/components/templates/verdocs-template-properties/verdocs-template-properties.d.ts +2 -2
  106. package/dist/types/components/templates/verdocs-template-properties/verdocs-template-properties.stories.d.ts +2 -2
  107. package/dist/types/components/templates/{verdocs-template-recipients → verdocs-template-roles}/verdocs-template-roles.d.ts +2 -2
  108. package/dist/types/components/templates/{verdocs-template-recipients → verdocs-template-roles}/verdocs-template-roles.stories.d.ts +2 -2
  109. package/dist/types/components.d.ts +24 -36
  110. package/dist/typings.d.ts +4 -0
  111. package/dist/verdocs-web-sdk/p-04ca7746.entry.js +1 -0
  112. package/dist/verdocs-web-sdk/p-062bd1d6.entry.js +1 -0
  113. package/dist/verdocs-web-sdk/p-07d519e8.entry.js +1 -0
  114. package/dist/verdocs-web-sdk/p-0bb87b59.entry.js +1 -0
  115. package/dist/verdocs-web-sdk/p-24266b55.entry.js +1 -0
  116. package/dist/verdocs-web-sdk/p-257d232d.system.entry.js +1 -0
  117. package/dist/verdocs-web-sdk/p-25c56686.entry.js +1 -0
  118. package/dist/verdocs-web-sdk/p-2ac6b090.entry.js +1 -0
  119. package/dist/verdocs-web-sdk/p-30f1611a.system.entry.js +1 -0
  120. package/dist/verdocs-web-sdk/p-3bc39719.entry.js +1 -0
  121. package/dist/verdocs-web-sdk/{p-7b82f0f2.system.entry.js → p-504d51c9.system.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-a72e49c5.system.entry.js → p-55610f09.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-7b4d7756.system.entry.js → p-5659c4bb.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/p-607b66bb.entry.js +1 -0
  125. package/dist/verdocs-web-sdk/p-619f9cc7.system.entry.js +1 -0
  126. package/dist/verdocs-web-sdk/p-79b5b76f.entry.js +1 -0
  127. package/dist/verdocs-web-sdk/p-7e6d7c07.system.js +1 -1
  128. package/dist/verdocs-web-sdk/{p-2a5c1eb7.entry.js → p-95171474.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-a62755ba.system.entry.js → p-a0fd3c9b.system.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/p-a2c3458c.system.entry.js +1 -0
  131. package/dist/verdocs-web-sdk/{p-4faa7ff3.system.entry.js → p-a8ff2439.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/p-d0fc924d.entry.js +1 -0
  133. package/dist/verdocs-web-sdk/{p-5fa9dd45.system.entry.js → p-da81a310.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/p-dfe6f5d9.entry.js +1 -0
  135. package/dist/verdocs-web-sdk/p-e897e87a.system.entry.js +1 -0
  136. package/dist/verdocs-web-sdk/{p-7be5af5d.system.entry.js → p-e9f06aab.system.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-457d3af9.system.entry.js → p-f1863a57.system.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/p-f75b2973.entry.js +1 -0
  139. package/dist/verdocs-web-sdk/p-fc57a027.system.entry.js +1 -0
  140. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  141. package/package.json +1 -1
  142. package/dist/verdocs-web-sdk/p-0048af58.system.entry.js +0 -1
  143. package/dist/verdocs-web-sdk/p-0e58db22.entry.js +0 -1
  144. package/dist/verdocs-web-sdk/p-1178d7a5.entry.js +0 -1
  145. package/dist/verdocs-web-sdk/p-5342a0bb.entry.js +0 -1
  146. package/dist/verdocs-web-sdk/p-5659eb9b.entry.js +0 -1
  147. package/dist/verdocs-web-sdk/p-5737eeb5.entry.js +0 -1
  148. package/dist/verdocs-web-sdk/p-5e932394.entry.js +0 -1
  149. package/dist/verdocs-web-sdk/p-75c744e0.entry.js +0 -1
  150. package/dist/verdocs-web-sdk/p-772ca02c.entry.js +0 -1
  151. package/dist/verdocs-web-sdk/p-99f4242f.system.entry.js +0 -1
  152. package/dist/verdocs-web-sdk/p-a275f3b8.system.entry.js +0 -1
  153. package/dist/verdocs-web-sdk/p-a38a4e2d.entry.js +0 -1
  154. package/dist/verdocs-web-sdk/p-a8a3bcb0.entry.js +0 -1
  155. package/dist/verdocs-web-sdk/p-a8b3e594.system.entry.js +0 -1
  156. package/dist/verdocs-web-sdk/p-b154b9b9.entry.js +0 -1
  157. package/dist/verdocs-web-sdk/p-b71f26f2.entry.js +0 -1
  158. package/dist/verdocs-web-sdk/p-c5be2c0f.entry.js +0 -1
  159. package/dist/verdocs-web-sdk/p-ecd33c4e.system.entry.js +0 -1
  160. package/dist/verdocs-web-sdk/p-f2ff8d0e.system.entry.js +0 -1
  161. /package/dist/collection/components/templates/{verdocs-template-recipients → verdocs-template-roles}/verdocs-template-roles.css +0 -0
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,r){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function a(e){try{i(r.next(e))}catch(e){s(e)}}function l(e){try{i(r["throw"](e))}catch(e){s(e)}}function i(e){e.done?o(e.value):n(e.value).then(a,l)}i((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return i([e,t])}}function i(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var _g;import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,a as getElement}from"./index-e64d45e2.js";import{i as interact}from"./interact.min-6417b511.js";import{u as updateRole,c as createRole}from"./Roles-6eb459df.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-d50a8d28.js";import{g as getRGBA}from"./Colors-1b298092.js";import{s as state}from"./templateStore-5cb73464.js";import{l as loadTemplate}from"./Templates-f8a6628a.js";import{a as getRoleIndex}from"./utils-e9a6b9e4.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Token-54690789.js";import"./index-24fd1580.js";import"./Primitives-054bc6e5.js";import"./Templates-8e4ab976.js";import"./Envelopes-eb3eef02.js";import"./Files-70a192df.js";import"./index-d264c496.js";var verdocsTemplateRolesCss='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{margin:0 0 0 9px;cursor:pointer}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';var senderLabels=(_g={},_g[TemplateSenderTypes.EVERYONE]="Everyone",_g[TemplateSenderTypes.EVERYONE_AS_CREATOR]="Everyone as Me",_g[TemplateSenderTypes.ORGANIZATION_MEMBER]="Organization member",_g[TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",_g[TemplateSenderTypes.CREATOR]="Me",_g);var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var stepIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var doneIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var plusIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var iconSigner='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var iconApprover='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var iconCC='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var VerdocsTemplateRoles=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.cancel=createEvent(this,"cancel",7);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.sequences=[];this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.forceRerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,n,s,a,l;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,,6]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}i.label=1;case 1:i.trys.push([1,3,,4]);console.log("[ROLES] Loading template ".concat(this.templateId),this.endpoint.session);return[4,loadTemplate(this.endpoint,this.templateId,true)];case 2:i.sent();return[3,4];case 3:a=i.sent();console.log("[ROLES] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:this.sortTemplateRoles();this.renumberTemplateRoles();return[3,6];case 5:l=i.sent();console.log("[FIELDS] Error with preview session",l);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(s=l.response)===null||s===void 0?void 0:s.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){interact.dynamicDrop(true);interact(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var o=+(t.target.getAttribute("posX")||0);var r=+(t.target.getAttribute("posY")||0);var n=t.dx+o;var s=t.dy+r;t.target.setAttribute("posX",n);t.target.setAttribute("posy",s);t.target.style.transform="translate(".concat(n+100,"px, ").concat(s-40,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.setAttribute("posX",0);t.target.setAttribute("posy",0);t.target.style.transform="translate(0px, 0px)"}.bind(this)}});interact(".dropzone").dropzone({overlap:.05,ondrop:function e(t){var o=this;var r,n;t.target.classList.remove("active");var s=t.relatedTarget.dataset.rolename;var a=+t.target.dataset.sequence;var l=+t.target.dataset.order;var i=(r=state.template)===null||r===void 0?void 0:r.roles.find((function(e){return e.name===s}));if(i){i.sequence=a;i.order=l;this.sortTemplateRoles();this.renumberTemplateRoles();this.forceRerender++;Promise.all((n=state.template)===null||n===void 0?void 0:n.roles.map((function(e){return updateRole(o.endpoint,o.templateId,e.name,{sequence:e.sequence,order:e.order})}))).then((function(){return console.log("[ROLES] Updated roles")})).catch((function(e){return console.log("[ROLES] Role updates failed",e)}))}}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();(t=this.next)===null||t===void 0?void 0:t.emit()};e.prototype.sortTemplateRoles=function(){var e;(e=state.template)===null||e===void 0?void 0:e.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.extractSequenceNumbers=function(){var e=this;var t;this.sequences=[];(t=state.template)===null||t===void 0?void 0:t.roles.forEach((function(t){if(!e.sequences.includes(t.sequence)){e.sequences.push(t.sequence)}}))};e.prototype.renumberTemplateRoles=function(){this.extractSequenceNumbers();var e=[];this.sequences.sort((function(e,t){return e-t}));this.sequences.forEach((function(t,o){var r;(r=state.template)===null||r===void 0?void 0:r.roles.filter((function(e){return e.sequence===t})).forEach((function(t,r){if(!e.includes(t.name)){t.sequence=o+1;t.order=r+1;e.push(t.name)}}))}));this.extractSequenceNumbers()};e.prototype.getNextRoleName=function(){var e,t;var o="";var r=(e=state.template)===null||e===void 0?void 0:e.roles.length;do{r++;o="Recipient ".concat(r)}while(!o||((t=state.template)===null||t===void 0?void 0:t.roles.some((function(e){return e.name===o}))));return o};e.prototype.handleAddRole=function(e,t){var o=this;e.stopPropagation();var r=state.template.roles.filter((function(e){return e.sequence===t})).length+1;var n=this.getNextRoleName();console.log("Will create",n,t,r);createRole(this.endpoint,this.templateId,{template_id:this.templateId,name:n,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){console.log("Created role",e);state.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.handleAddStep=function(e,t){var o=this;e.stopPropagation();var r=1;var n=this.getNextRoleName();console.log("Will create",n,t,r);createRole(this.endpoint,this.templateId,{template_id:this.templateId,name:n,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){console.log("Created role",e);state.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(state.loading||!state.template){return h(Host,null,h("verdocs-loader",null))}var o=(((t=state.template)===null||t===void 0?void 0:t.roles)||[]).map((function(e){return e.name}));return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off","data-r":this.forceRerender},h("h5",null,"Roles"),h("div",{class:"participants"},h("div",{class:"left-line"}),h("div",{class:"row"},h("div",{class:"icon",innerHTML:startIcon}),h("div",{class:"row-roles"},h("div",{class:"sender"},h("span",{class:"label"},"Sender:")," ",senderLabels[state.template.sender]," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),h("div",{class:"row add-sequence","data-sequence":0},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((function(t){return h(Fragment,null,h("div",{class:"row"},h("div",{class:"icon",innerHTML:stepIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-order":.5,"data-sequence":t}),state.template.roles.filter((function(e){return e.sequence===t})).map((function(r){return h(Fragment,null,h("div",{class:"recipient",style:{backgroundColor:getRGBA(getRoleIndex(o,r.name))},"data-rolename":r.name},h("span",{class:"type-icon",innerHTML:r.type==="signer"?iconSigner:r.type==="cc"?iconCC:iconApprover}),r.name," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingRoleDialog=r.name},"aria-role":"button"})),h("div",{class:"dropzone","data-order":r.order+.5,"data-sequence":t}))})),h("button",{class:"add-role",innerHTML:plusIcon,onClick:function(o){return e.handleAddRole(o,t)}}))),e.sequences.length>0&&h("div",{class:"row add-sequence","data-sequence":t},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),h("div",{class:"row","data-sequence":this.sequences.length+1},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("button",{class:"add-step",innerHTML:plusIcon,onClick:function(t){return e.handleAddStep(t,e.sequences.length+1)}}))),h("div",{class:"row"},h("div",{class:"icon",innerHTML:doneIcon}),h("div",{class:"row-roles"},h("div",{class:"complete"},"Document Complete")))),o.length<1&&h("div",{class:"empty"},"You must add at least one Role before proceeding.",h("br",null)," Click the ",h("span",{innerHTML:plusIcon})," Add button above to get started."),h("div",{class:"buttons"},h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:o.length<1}))),this.showingRoleDialog&&h("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null;e.forceRerender++},onDelete:function(t){console.log("deleted",t.detail);e.renumberTemplateRoles();e.showingRoleDialog=null;e.forceRerender++}}),this.showingSenderDialog&&h("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateRoles.style=verdocsTemplateRolesCss;export{VerdocsTemplateRoles as verdocs_template_roles};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,r){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function a(e){try{i(r.next(e))}catch(e){s(e)}}function l(e){try{i(r["throw"](e))}catch(e){s(e)}}function i(e){e.done?o(e.value):n(e.value).then(a,l)}i((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return i([e,t])}}function i(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var _g;import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,a as getElement}from"./index-e64d45e2.js";import{i as interact}from"./interact.min-6417b511.js";import{u as updateRole,c as createRole}from"./Roles-6eb459df.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-d50a8d28.js";import{g as getRGBA}from"./Colors-1b298092.js";import{s as state}from"./templateStore-5cb73464.js";import{l as loadTemplate}from"./Templates-f8a6628a.js";import{a as getRoleIndex}from"./utils-e9a6b9e4.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Token-54690789.js";import"./index-24fd1580.js";import"./Primitives-054bc6e5.js";import"./Templates-8e4ab976.js";import"./Envelopes-eb3eef02.js";import"./Files-70a192df.js";import"./index-d264c496.js";var verdocsTemplateRolesCss='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{margin:0 0 0 9px;cursor:pointer}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';var senderLabels=(_g={},_g[TemplateSenderTypes.EVERYONE]="Everyone",_g[TemplateSenderTypes.EVERYONE_AS_CREATOR]="Everyone as Me",_g[TemplateSenderTypes.ORGANIZATION_MEMBER]="Organization member",_g[TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",_g[TemplateSenderTypes.CREATOR]="Me",_g);var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var stepIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var doneIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var plusIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var iconSigner='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var iconApprover='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var iconCC='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var VerdocsTemplateRoles=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.exit=createEvent(this,"exit",7);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.sequences=[];this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.forceRerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,n,s,a,l;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,,6]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}i.label=1;case 1:i.trys.push([1,3,,4]);console.log("[ROLES] Loading template ".concat(this.templateId),this.endpoint.session);return[4,loadTemplate(this.endpoint,this.templateId,true)];case 2:i.sent();return[3,4];case 3:a=i.sent();console.log("[ROLES] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:this.sortTemplateRoles();this.renumberTemplateRoles();return[3,6];case 5:l=i.sent();console.log("[FIELDS] Error with preview session",l);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(s=l.response)===null||s===void 0?void 0:s.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){interact.dynamicDrop(true);interact(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var o=+(t.target.getAttribute("posX")||0);var r=+(t.target.getAttribute("posY")||0);var n=t.dx+o;var s=t.dy+r;t.target.setAttribute("posX",n);t.target.setAttribute("posy",s);t.target.style.transform="translate(".concat(n+100,"px, ").concat(s-40,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.setAttribute("posX",0);t.target.setAttribute("posy",0);t.target.style.transform="translate(0px, 0px)"}.bind(this)}});interact(".dropzone").dropzone({overlap:.05,ondrop:function e(t){var o=this;var r,n;t.target.classList.remove("active");var s=t.relatedTarget.dataset.rolename;var a=+t.target.dataset.sequence;var l=+t.target.dataset.order;var i=(r=state.template)===null||r===void 0?void 0:r.roles.find((function(e){return e.name===s}));if(i){i.sequence=a;i.order=l;this.sortTemplateRoles();this.renumberTemplateRoles();this.forceRerender++;Promise.all((n=state.template)===null||n===void 0?void 0:n.roles.map((function(e){return updateRole(o.endpoint,o.templateId,e.name,{sequence:e.sequence,order:e.order})}))).then((function(){return console.log("[ROLES] Updated roles")})).catch((function(e){return console.log("[ROLES] Role updates failed",e)}))}}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();(t=this.next)===null||t===void 0?void 0:t.emit()};e.prototype.sortTemplateRoles=function(){var e;(e=state.template)===null||e===void 0?void 0:e.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.extractSequenceNumbers=function(){var e=this;var t;this.sequences=[];(t=state.template)===null||t===void 0?void 0:t.roles.forEach((function(t){if(!e.sequences.includes(t.sequence)){e.sequences.push(t.sequence)}}))};e.prototype.renumberTemplateRoles=function(){this.extractSequenceNumbers();var e=[];this.sequences.sort((function(e,t){return e-t}));this.sequences.forEach((function(t,o){var r;(r=state.template)===null||r===void 0?void 0:r.roles.filter((function(e){return e.sequence===t})).forEach((function(t,r){if(!e.includes(t.name)){t.sequence=o+1;t.order=r+1;e.push(t.name)}}))}));this.extractSequenceNumbers()};e.prototype.getNextRoleName=function(){var e,t;var o="";var r=(e=state.template)===null||e===void 0?void 0:e.roles.length;do{r++;o="Recipient ".concat(r)}while(!o||((t=state.template)===null||t===void 0?void 0:t.roles.some((function(e){return e.name===o}))));return o};e.prototype.handleAddRole=function(e,t){var o=this;e.stopPropagation();var r=state.template.roles.filter((function(e){return e.sequence===t})).length+1;var n=this.getNextRoleName();console.log("Will create",n,t,r);createRole(this.endpoint,this.templateId,{template_id:this.templateId,name:n,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){console.log("Created role",e);state.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.handleAddStep=function(e,t){var o=this;e.stopPropagation();var r=1;var n=this.getNextRoleName();console.log("Will create",n,t,r);createRole(this.endpoint,this.templateId,{template_id:this.templateId,name:n,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){console.log("Created role",e);state.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(state.loading||!state.template){return h(Host,null,h("verdocs-loader",null))}var o=(((t=state.template)===null||t===void 0?void 0:t.roles)||[]).map((function(e){return e.name}));return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off","data-r":this.forceRerender},h("h5",null,"Roles"),h("div",{class:"participants"},h("div",{class:"left-line"}),h("div",{class:"row"},h("div",{class:"icon",innerHTML:startIcon}),h("div",{class:"row-roles"},h("div",{class:"sender"},h("span",{class:"label"},"Sender:")," ",senderLabels[state.template.sender]," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),h("div",{class:"row add-sequence","data-sequence":0},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((function(t){return h(Fragment,null,h("div",{class:"row"},h("div",{class:"icon",innerHTML:stepIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-order":.5,"data-sequence":t}),state.template.roles.filter((function(e){return e.sequence===t})).map((function(r){return h(Fragment,null,h("div",{class:"recipient",style:{backgroundColor:getRGBA(getRoleIndex(o,r.name))},"data-rolename":r.name},h("span",{class:"type-icon",innerHTML:r.type==="signer"?iconSigner:r.type==="cc"?iconCC:iconApprover}),r.name," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingRoleDialog=r.name},"aria-role":"button"})),h("div",{class:"dropzone","data-order":r.order+.5,"data-sequence":t}))})),h("button",{class:"add-role",innerHTML:plusIcon,onClick:function(o){return e.handleAddRole(o,t)}}))),e.sequences.length>0&&h("div",{class:"row add-sequence","data-sequence":t},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),h("div",{class:"row","data-sequence":this.sequences.length+1},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("button",{class:"add-step",innerHTML:plusIcon,onClick:function(t){return e.handleAddStep(t,e.sequences.length+1)}}))),h("div",{class:"row"},h("div",{class:"icon",innerHTML:doneIcon}),h("div",{class:"row-roles"},h("div",{class:"complete"},"Document Complete")))),o.length<1&&h("div",{class:"empty"},"You must add at least one Role before proceeding.",h("br",null)," Click the ",h("span",{innerHTML:plusIcon})," Add button above to get started."),h("div",{class:"buttons"},h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:o.length<1}))),this.showingRoleDialog&&h("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null;e.forceRerender++},onDelete:function(t){console.log("deleted",t.detail);e.renumberTemplateRoles();e.showingRoleDialog=null;e.forceRerender++}}),this.showingSenderDialog&&h("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateRoles.style=verdocsTemplateRolesCss;export{VerdocsTemplateRoles as verdocs_template_roles};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):r(e.value).then(i,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(a=i[0]&2?r["return"]:i[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;if(r=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;r=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];r=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++){if(a||!(o in t)){if(!a)a=Array.prototype.slice.call(t,0,o);a[o]=t[o]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-e64d45e2.js";import{f as fileToDataUrl}from"./Files-70a192df.js";var verdocsUploadDialogCss='verdocs-upload-dialog{font-family:"Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-upload-dialog .dialog{width:300px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-upload-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-upload-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-upload-dialog .buttons verdocs-button{margin-left:16px}verdocs-upload-dialog .drop-target{padding:30px 15px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5f5;border:2px dashed #979797;min-height:260px;text-align:center;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:rgba(0, 0, 0, 0.54);opacity:1;margin:20px 0}verdocs-upload-dialog .drop-target p{margin:12px 0}verdocs-upload-dialog .drop-target.dragging-over{border:5px solid #4c56cb}verdocs-upload-dialog .drop-target>verdocs-button{margin:12px 0;display:inline-block}verdocs-upload-dialog .attachments{height:56px;font-size:0;margin:20px 0;padding:0 16px;line-height:56px;white-space:normal;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-upload-dialog .attachments .attachment{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .attachments .attachment .icon{width:18px;height:18px;line-height:18px}verdocs-upload-dialog .attachments .attachment .icon.trash{cursor:pointer}verdocs-upload-dialog .attachments .attachment .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;padding:0 8px;font-size:14px;font-weight:400}';var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>';var PaperclipIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>';var VerdocsUploadDialog=function(){function e(e){registerInstance(this,e);this.cancel=createEvent(this,"cancel",7);this.next=createEvent(this,"next",7);this.draggingOver=false;this.decodedFiles=[]}e.prototype.handleCancel=function(){this.cancel.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleCancel()}};e.prototype.handleDone=function(){this.next.emit(this.decodedFiles)};e.prototype.handleDragOver=function(e){e.preventDefault();this.draggingOver=true};e.prototype.handleDragLeave=function(e){e.preventDefault();this.draggingOver=false};e.prototype.handleDrop=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,o,r;return __generator(this,(function(a){switch(a.label){case 0:e.preventDefault();this.draggingOver=false;t=[];if(e.dataTransfer.items){for(n=0;n<e.dataTransfer.items.length;n++){if(e.dataTransfer.items[n].kind==="file"){o=e.dataTransfer.items[n].getAsFile();t.push(o)}}}else{t=e.dataTransfer.files}r=this;return[4,Promise.all(t.map(fileToDataUrl))];case 1:r.decodedFiles=a.sent();return[2]}}))}))};e.prototype.handleRemoveAttachment=function(e){var t=__spreadArray([],this.decodedFiles,true);t.splice(e,1);this.decodedFiles=t};e.prototype.handleSelectFile=function(){var e;(e=this.fileInput)===null||e===void 0?void 0:e.click()};e.prototype.handleFileChange=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,o,r;return __generator(this,(function(a){switch(a.label){case 0:n=[];for(o=0;o<((e=this.fileInput)===null||e===void 0?void 0:e.files.length);o++){n.push((t=this.fileInput)===null||t===void 0?void 0:t.files[o])}r=this;return[4,Promise.all(n.map(fileToDataUrl))];case 1:r.decodedFiles=a.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Upload attachment"),this.decodedFiles.length<1?h("div",{class:{"drop-target":true,"dragging-over":this.draggingOver},onDragOver:function(t){return e.handleDragOver(t)},onDragLeave:function(t){return e.handleDragLeave(t)},onDrop:function(t){return e.handleDrop(t)}},h("p",null,"Drag and drop a file here..."),h("p",null,"- or -"),h("verdocs-button",{label:"Select a file...",onClick:function(){return e.handleSelectFile()}}),h("input",{type:"file",ref:function(t){return e.fileInput=t},style:{display:"none"},onChange:function(){return e.handleFileChange()}})):h("div",{class:"attachments"},this.decodedFiles.map((function(t,n){return h("div",{class:"attachment"},h("div",{class:"icon",innerHTML:PaperclipIcon}),h("div",{class:"name"},t.name),h("div",{class:"icon trash",innerHTML:TrashIcon,onClick:function(){return e.handleRemoveAttachment(n)}}))}))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return e.handleCancel()}}),h("verdocs-button",{label:"Done",onClick:function(){return e.handleDone()},disabled:this.decodedFiles.length<1})))))};return e}();VerdocsUploadDialog.style=verdocsUploadDialogCss;export{VerdocsUploadDialog as verdocs_upload_dialog};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):r(e.value).then(i,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(a=i[0]&2?r["return"]:i[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;if(r=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;r=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];r=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++){if(a||!(o in t)){if(!a)a=Array.prototype.slice.call(t,0,o);a[o]=t[o]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-e64d45e2.js";import{f as fileToDataUrl}from"./Files-70a192df.js";var verdocsUploadDialogCss='verdocs-upload-dialog{font-family:"Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-upload-dialog .dialog{width:300px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-upload-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-upload-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-upload-dialog .buttons verdocs-button{margin-left:16px}verdocs-upload-dialog .drop-target{padding:30px 15px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5f5;border:2px dashed #979797;min-height:260px;text-align:center;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:rgba(0, 0, 0, 0.54);opacity:1;margin:20px 0}verdocs-upload-dialog .drop-target p{margin:12px 0}verdocs-upload-dialog .drop-target.dragging-over{border:5px solid #4c56cb}verdocs-upload-dialog .drop-target>verdocs-button{margin:12px 0;display:inline-block}verdocs-upload-dialog .attachments{height:56px;font-size:0;margin:20px 0;padding:0 16px;line-height:56px;white-space:normal;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-upload-dialog .attachments .attachment{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .attachments .attachment .icon{width:18px;height:18px;line-height:18px}verdocs-upload-dialog .attachments .attachment .icon.trash{cursor:pointer}verdocs-upload-dialog .attachments .attachment .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;padding:0 8px;font-size:14px;font-weight:400}';var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>';var PaperclipIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>';var VerdocsUploadDialog=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.draggingOver=false;this.decodedFiles=[]}e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleCancel()}};e.prototype.handleDone=function(){this.next.emit(this.decodedFiles)};e.prototype.handleDragOver=function(e){e.preventDefault();this.draggingOver=true};e.prototype.handleDragLeave=function(e){e.preventDefault();this.draggingOver=false};e.prototype.handleDrop=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,o,r;return __generator(this,(function(a){switch(a.label){case 0:e.preventDefault();this.draggingOver=false;t=[];if(e.dataTransfer.items){for(n=0;n<e.dataTransfer.items.length;n++){if(e.dataTransfer.items[n].kind==="file"){o=e.dataTransfer.items[n].getAsFile();t.push(o)}}}else{t=e.dataTransfer.files}r=this;return[4,Promise.all(t.map(fileToDataUrl))];case 1:r.decodedFiles=a.sent();return[2]}}))}))};e.prototype.handleRemoveAttachment=function(e){var t=__spreadArray([],this.decodedFiles,true);t.splice(e,1);this.decodedFiles=t};e.prototype.handleSelectFile=function(){var e;(e=this.fileInput)===null||e===void 0?void 0:e.click()};e.prototype.handleFileChange=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,o,r;return __generator(this,(function(a){switch(a.label){case 0:n=[];for(o=0;o<((e=this.fileInput)===null||e===void 0?void 0:e.files.length);o++){n.push((t=this.fileInput)===null||t===void 0?void 0:t.files[o])}r=this;return[4,Promise.all(n.map(fileToDataUrl))];case 1:r.decodedFiles=a.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Upload attachment"),this.decodedFiles.length<1?h("div",{class:{"drop-target":true,"dragging-over":this.draggingOver},onDragOver:function(t){return e.handleDragOver(t)},onDragLeave:function(t){return e.handleDragLeave(t)},onDrop:function(t){return e.handleDrop(t)}},h("p",null,"Drag and drop a file here..."),h("p",null,"- or -"),h("verdocs-button",{label:"Select a file...",onClick:function(){return e.handleSelectFile()}}),h("input",{type:"file",ref:function(t){return e.fileInput=t},style:{display:"none"},onChange:function(){return e.handleFileChange()}})):h("div",{class:"attachments"},this.decodedFiles.map((function(t,n){return h("div",{class:"attachment"},h("div",{class:"icon",innerHTML:PaperclipIcon}),h("div",{class:"name"},t.name),h("div",{class:"icon trash",innerHTML:TrashIcon,onClick:function(){return e.handleRemoveAttachment(n)}}))}))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return e.handleCancel()}}),h("verdocs-button",{label:"Done",onClick:function(){return e.handleDone()},disabled:this.decodedFiles.length<1})))))};return e}();VerdocsUploadDialog.style=verdocsUploadDialogCss;export{VerdocsUploadDialog as verdocs_upload_dialog};
@@ -14,9 +14,9 @@ export declare class VerdocsInitialDialog {
14
14
  */
15
15
  next: EventEmitter<string>;
16
16
  /**
17
- * Event fired when the step is cancelled.
17
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
18
18
  */
19
- cancel: EventEmitter;
19
+ exit: EventEmitter;
20
20
  fontLoaded: boolean;
21
21
  enteredInitials: string;
22
22
  mode: string;
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const InitialDialog: ({ initials, onNext, onCancel }: {
4
+ export declare const InitialDialog: ({ initials, onNext, onExit }: {
5
5
  initials: any;
6
6
  onNext: any;
7
- onCancel: any;
7
+ onExit: any;
8
8
  }) => import("lit-html").TemplateResult<1>;
@@ -38,9 +38,9 @@ export declare class VerdocsKbaDialog {
38
38
  */
39
39
  choices: string[];
40
40
  /**
41
- * Event fired when the dialog is closed. The event data will contain the closure reason.
41
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
42
42
  */
43
- cancel: EventEmitter;
43
+ exit: EventEmitter;
44
44
  /**
45
45
  * Event fired when the dialog is closed. The event data will contain the value selected.
46
46
  */
@@ -1,7 +1,7 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const KBADialog: ({ helptitle, helptext, label, placeholder, mode, step, steps, choices, onNext, onCancel }: {
4
+ export declare const KBADialog: ({ helptitle, helptext, label, placeholder, mode, step, steps, choices, onNext, onExit }: {
5
5
  helptitle: any;
6
6
  helptext: any;
7
7
  label: any;
@@ -11,5 +11,5 @@ export declare const KBADialog: ({ helptitle, helptext, label, placeholder, mode
11
11
  steps: any;
12
12
  choices: any;
13
13
  onNext: any;
14
- onCancel: any;
14
+ onExit: any;
15
15
  }) => import("lit-html").TemplateResult<1>;
@@ -23,9 +23,9 @@ export declare class VerdocsOkDialog {
23
23
  */
24
24
  next: EventEmitter;
25
25
  /**
26
- * Event fired when the user clicks the background overlay or Cancel button.
26
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
27
27
  */
28
- cancel: EventEmitter;
28
+ exit: EventEmitter;
29
29
  handleOk(): void;
30
30
  handleCancel(): void;
31
31
  handleDismiss(e: any): void;
@@ -1,10 +1,10 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const OkDialog: ({ heading, message, showCancel, onNext, onCancel }: {
4
+ export declare const OkDialog: ({ heading, message, showCancel, onNext, onExit }: {
5
5
  heading: any;
6
6
  message: any;
7
7
  showCancel: any;
8
8
  onNext: any;
9
- onCancel: any;
9
+ onExit: any;
10
10
  }) => import("lit-html").TemplateResult<1>;
@@ -15,9 +15,9 @@ export declare class VerdocsSignatureDialog {
15
15
  */
16
16
  next: EventEmitter<string>;
17
17
  /**
18
- * Fired if the user cancels the dialog.
18
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
19
19
  */
20
- cancel: EventEmitter;
20
+ exit: EventEmitter;
21
21
  fontLoaded: boolean;
22
22
  enteredName: string;
23
23
  mode: string;
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const SignatureDialog: ({ name, onCancel, onNext }: {
4
+ export declare const SignatureDialog: ({ name, onCancel, onExit }: {
5
5
  name: any;
6
6
  onCancel: any;
7
- onNext: any;
7
+ onExit: any;
8
8
  }) => import("lit-html").TemplateResult<1>;
@@ -8,9 +8,9 @@ import { FileWithData } from '@verdocs/js-sdk/Utils/Files';
8
8
  export declare class VerdocsUploadDialog {
9
9
  private fileInput?;
10
10
  /**
11
- * Event fired when the dialog is cancelled.
11
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
12
12
  */
13
- cancel: EventEmitter;
13
+ exit: EventEmitter;
14
14
  /**
15
15
  * Event fired when the dialog is closed. The event data will contain the file selected.
16
16
  */
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const UploadDialog: ({ message, open, closed }: {
4
+ export declare const UploadDialog: ({ message, open, onExit }: {
5
5
  message: any;
6
6
  open: any;
7
- closed: any;
7
+ onExit: any;
8
8
  }) => import("lit-html").TemplateResult<1>;
@@ -56,9 +56,9 @@ export declare class VerdocsContactPicker {
56
56
  */
57
57
  searchContacts: EventEmitter<IContactSearchEvent>;
58
58
  /**
59
- * Event fired when the user cancels the dialog.
59
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
60
60
  */
61
- cancel: EventEmitter;
61
+ exit: EventEmitter;
62
62
  /**
63
63
  * Event fired when the user changes the type.
64
64
  */
@@ -1,10 +1,10 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const ContactPicker: ({ templateRole, contactSuggestions, searchContacts, onCancel, onNext }: {
4
+ export declare const ContactPicker: ({ templateRole, contactSuggestions, searchContacts, onExit, onNext }: {
5
5
  templateRole: any;
6
6
  contactSuggestions: any;
7
7
  searchContacts: any;
8
- onCancel: any;
8
+ onExit: any;
9
9
  onNext: any;
10
10
  }) => import("lit-html").TemplateResult<1>;
@@ -26,7 +26,5 @@ export declare class VerdocsBuild {
26
26
  componentWillLoad(): Promise<void>;
27
27
  handleCancel(e: any): void;
28
28
  handleTemplateCreated(e: any): void;
29
- handlePropertiesUpdated(e: any): void;
30
- handleRecipientsUpdated(e: any): void;
31
29
  render(): any;
32
30
  }
@@ -29,9 +29,9 @@ export declare class VerdocsSend {
29
29
  template_id: string;
30
30
  }>;
31
31
  /**
32
- * The user canceled the process.
32
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
33
33
  */
34
- cancel: EventEmitter;
34
+ exit: EventEmitter;
35
35
  /**
36
36
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will
37
37
  * terminate the process, and the calling application should correct the condition and re-render the component.
@@ -40,9 +40,9 @@ export declare class VerdocsFieldInitial {
40
40
  */
41
41
  adopt: EventEmitter<string>;
42
42
  /**
43
- * Event emitted when the user cancels the process.
43
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
44
44
  */
45
- cancel: EventEmitter;
45
+ exit: EventEmitter;
46
46
  /**
47
47
  * Event fired when the input field value changes. Note that this will only be fired on blur, tab-out, ENTER key press, etc.
48
48
  * It is generally the best event to subscribe to than `input` for most cases EXCEPT autocomplete fields that need to see every
@@ -12,13 +12,9 @@ export declare class VerdocsTemplateCreate {
12
12
  */
13
13
  endpoint: VerdocsEndpoint;
14
14
  /**
15
- * Event fired when the user cancels the dialog.
15
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
16
16
  */
17
- cancel: EventEmitter;
18
- /**
19
- * Test event for debugging
20
- */
21
- testev: EventEmitter;
17
+ exit: EventEmitter;
22
18
  /**
23
19
  * Event fired when the user changes the type.
24
20
  */
@@ -1,7 +1,7 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const Create: ({ onCancel, onNext }: {
5
- onCancel: any;
4
+ export declare const Create: ({ onExit, onNext }: {
5
+ onExit: any;
6
6
  onNext: any;
7
7
  }) => import("lit-html").TemplateResult<1>;
@@ -23,14 +23,6 @@ export declare class VerdocsTemplateFields {
23
23
  * This allows the parent application to more easily control its placement and scroll effects.
24
24
  */
25
25
  toolbarTargetId: string | null;
26
- /**
27
- * Event fired when the user completes the step.
28
- */
29
- next: EventEmitter<ITemplate>;
30
- /**
31
- * Event fired when the user cancels the dialog.
32
- */
33
- cancel: EventEmitter;
34
26
  /**
35
27
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will
36
28
  * terminate the process, and the calling application should correct the condition and re-render the component.
@@ -1,8 +1,6 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const Fields: ({ templateId, onCancel, onNext }: {
4
+ export declare const Fields: ({ templateId }: {
5
5
  templateId: any;
6
- onCancel: any;
7
- onNext: any;
8
6
  }) => import("lit-html").TemplateResult<1>;
@@ -15,9 +15,9 @@ export declare class VerdocsTemplateProperties {
15
15
  */
16
16
  templateId: string;
17
17
  /**
18
- * Event fired when the user cancels the dialog.
18
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
19
19
  */
20
- cancel: EventEmitter;
20
+ exit: EventEmitter;
21
21
  /**
22
22
  * Event fired when the user completes the step.
23
23
  */
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const Properties: ({ onCancel, onNext, templateId }: {
5
- onCancel: any;
4
+ export declare const Properties: ({ onExit, onNext, templateId }: {
5
+ onExit: any;
6
6
  onNext: any;
7
7
  templateId: any;
8
8
  }) => import("lit-html").TemplateResult<1>;
@@ -20,9 +20,9 @@ export declare class VerdocsTemplateRoles {
20
20
  */
21
21
  next: EventEmitter;
22
22
  /**
23
- * Event fired when the user cancels the dialog.
23
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
24
24
  */
25
- cancel: EventEmitter;
25
+ exit: EventEmitter;
26
26
  /**
27
27
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will
28
28
  * terminate the process, and the calling application should correct the condition and re-render the component.
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/web-components';
2
2
  declare const _default: Meta<import("@storybook/web-components").Args>;
3
3
  export default _default;
4
- export declare const Roles: ({ templateId, onCancel, onSave }: {
4
+ export declare const Roles: ({ templateId, onExit, onSave }: {
5
5
  templateId: any;
6
- onCancel: any;
6
+ onExit: any;
7
7
  onSave: any;
8
8
  }) => import("lit-html").TemplateResult<1>;
@@ -1652,9 +1652,9 @@ declare namespace LocalJSX {
1652
1652
  */
1653
1653
  "endpoint"?: VerdocsEndpoint;
1654
1654
  /**
1655
- * Event fired when the user cancels the dialog.
1655
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
1656
1656
  */
1657
- "onCancel"?: (event: VerdocsContactPickerCustomEvent<any>) => void;
1657
+ "onExit"?: (event: VerdocsContactPickerCustomEvent<any>) => void;
1658
1658
  /**
1659
1659
  * Event fired when the user changes the type.
1660
1660
  */
@@ -1871,14 +1871,14 @@ declare namespace LocalJSX {
1871
1871
  * Event emitted when an initial block is adopted by the user. The event detail will contain the base64 string of the initial image.
1872
1872
  */
1873
1873
  "onAdopt"?: (event: VerdocsFieldInitialCustomEvent<string>) => void;
1874
- /**
1875
- * Event emitted when the user cancels the process.
1876
- */
1877
- "onCancel"?: (event: VerdocsFieldInitialCustomEvent<any>) => void;
1878
1874
  /**
1879
1875
  * Event fired when the field is deleted.
1880
1876
  */
1881
1877
  "onDeleted"?: (event: VerdocsFieldInitialCustomEvent<{fieldName: string}>) => void;
1878
+ /**
1879
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
1880
+ */
1881
+ "onExit"?: (event: VerdocsFieldInitialCustomEvent<any>) => void;
1882
1882
  /**
1883
1883
  * Event fired when the input field value changes. Note that this will only be fired on blur, tab-out, ENTER key press, etc. It is generally the best event to subscribe to than `input` for most cases EXCEPT autocomplete fields that need to see every keypress.
1884
1884
  */
@@ -2141,9 +2141,9 @@ declare namespace LocalJSX {
2141
2141
  */
2142
2142
  "initials"?: string;
2143
2143
  /**
2144
- * Event fired when the step is cancelled.
2144
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2145
2145
  */
2146
- "onCancel"?: (event: VerdocsInitialDialogCustomEvent<any>) => void;
2146
+ "onExit"?: (event: VerdocsInitialDialogCustomEvent<any>) => void;
2147
2147
  /**
2148
2148
  * Event fired when the initials are adopted.
2149
2149
  */
@@ -2171,9 +2171,9 @@ declare namespace LocalJSX {
2171
2171
  */
2172
2172
  "mode"?: 'text' | 'choice';
2173
2173
  /**
2174
- * Event fired when the dialog is closed. The event data will contain the closure reason.
2174
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2175
2175
  */
2176
- "onCancel"?: (event: VerdocsKbaDialogCustomEvent<any>) => void;
2176
+ "onExit"?: (event: VerdocsKbaDialogCustomEvent<any>) => void;
2177
2177
  /**
2178
2178
  * Event fired when the dialog is closed. The event data will contain the value selected.
2179
2179
  */
@@ -2203,9 +2203,9 @@ declare namespace LocalJSX {
2203
2203
  */
2204
2204
  "message"?: string;
2205
2205
  /**
2206
- * Event fired when the user clicks the background overlay or Cancel button.
2206
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2207
2207
  */
2208
- "onCancel"?: (event: VerdocsOkDialogCustomEvent<any>) => void;
2208
+ "onExit"?: (event: VerdocsOkDialogCustomEvent<any>) => void;
2209
2209
  /**
2210
2210
  * Event fired when the user clicks the OK button.
2211
2211
  */
@@ -2345,9 +2345,9 @@ declare namespace LocalJSX {
2345
2345
  */
2346
2346
  "endpoint"?: VerdocsEndpoint;
2347
2347
  /**
2348
- * The user canceled the process.
2348
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2349
2349
  */
2350
- "onCancel"?: (event: VerdocsSendCustomEvent<any>) => void;
2350
+ "onExit"?: (event: VerdocsSendCustomEvent<any>) => void;
2351
2351
  /**
2352
2352
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2353
2353
  */
@@ -2393,9 +2393,9 @@ declare namespace LocalJSX {
2393
2393
  */
2394
2394
  "name"?: string;
2395
2395
  /**
2396
- * Fired if the user cancels the dialog.
2396
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2397
2397
  */
2398
- "onCancel"?: (event: VerdocsSignatureDialogCustomEvent<any>) => void;
2398
+ "onExit"?: (event: VerdocsSignatureDialogCustomEvent<any>) => void;
2399
2399
  /**
2400
2400
  * Fired when the user completes the dialog and clicks Adopt. The event detail will contain a base64-encoded string representation of the signature adopted.
2401
2401
  */
@@ -2449,9 +2449,9 @@ declare namespace LocalJSX {
2449
2449
  */
2450
2450
  "endpoint"?: VerdocsEndpoint;
2451
2451
  /**
2452
- * Event fired when the user cancels the dialog.
2452
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2453
2453
  */
2454
- "onCancel"?: (event: VerdocsTemplateCreateCustomEvent<any>) => void;
2454
+ "onExit"?: (event: VerdocsTemplateCreateCustomEvent<any>) => void;
2455
2455
  /**
2456
2456
  * Event fired when the user changes the type.
2457
2457
  */
@@ -2460,10 +2460,6 @@ declare namespace LocalJSX {
2460
2460
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2461
2461
  */
2462
2462
  "onSdkError"?: (event: VerdocsTemplateCreateCustomEvent<SDKError>) => void;
2463
- /**
2464
- * Test event for debugging
2465
- */
2466
- "onTestev"?: (event: VerdocsTemplateCreateCustomEvent<any>) => void;
2467
2463
  }
2468
2464
  interface VerdocsTemplateDocumentPage {
2469
2465
  /**
@@ -2534,14 +2530,6 @@ declare namespace LocalJSX {
2534
2530
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
2535
2531
  */
2536
2532
  "endpoint"?: VerdocsEndpoint;
2537
- /**
2538
- * Event fired when the user cancels the dialog.
2539
- */
2540
- "onCancel"?: (event: VerdocsTemplateFieldsCustomEvent<any>) => void;
2541
- /**
2542
- * Event fired when the user completes the step.
2543
- */
2544
- "onNext"?: (event: VerdocsTemplateFieldsCustomEvent<ITemplate>) => void;
2545
2533
  /**
2546
2534
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2547
2535
  */
@@ -2583,9 +2571,9 @@ declare namespace LocalJSX {
2583
2571
  */
2584
2572
  "endpoint"?: VerdocsEndpoint;
2585
2573
  /**
2586
- * Event fired when the user cancels the dialog.
2574
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2587
2575
  */
2588
- "onCancel"?: (event: VerdocsTemplatePropertiesCustomEvent<any>) => void;
2576
+ "onExit"?: (event: VerdocsTemplatePropertiesCustomEvent<any>) => void;
2589
2577
  /**
2590
2578
  * Event fired when the user completes the step.
2591
2579
  */
@@ -2653,9 +2641,9 @@ declare namespace LocalJSX {
2653
2641
  */
2654
2642
  "endpoint"?: VerdocsEndpoint;
2655
2643
  /**
2656
- * Event fired when the user cancels the dialog.
2644
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2657
2645
  */
2658
- "onCancel"?: (event: VerdocsTemplateRolesCustomEvent<any>) => void;
2646
+ "onExit"?: (event: VerdocsTemplateRolesCustomEvent<any>) => void;
2659
2647
  /**
2660
2648
  * Event fired when the user clicks to proceed.
2661
2649
  */
@@ -2794,9 +2782,9 @@ declare namespace LocalJSX {
2794
2782
  }
2795
2783
  interface VerdocsUploadDialog {
2796
2784
  /**
2797
- * Event fired when the dialog is cancelled.
2785
+ * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved "cancel" event name.
2798
2786
  */
2799
- "onCancel"?: (event: VerdocsUploadDialogCustomEvent<any>) => void;
2787
+ "onExit"?: (event: VerdocsUploadDialogCustomEvent<any>) => void;
2800
2788
  /**
2801
2789
  * Event fired when the dialog is closed. The event data will contain the file selected.
2802
2790
  */