@verdocs/web-sdk 2.3.11 → 2.3.12

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 (209) hide show
  1. package/dist/cjs/{EnvelopeStore-f8c301e1.js → EnvelopeStore-efc35530.js} +1 -1
  2. package/dist/cjs/{Envelopes-99ca79fe.js → Envelopes-0b9deb2c.js} +2 -6
  3. package/dist/cjs/{TemplateStore-192c6cf1.js → TemplateStore-17b9fdfe.js} +1 -1
  4. package/dist/cjs/{VerdocsEndpoint-33b643eb.js → VerdocsEndpoint-8f298664.js} +1 -186
  5. package/dist/cjs/ipc-test.cjs.entry.js +2 -2
  6. package/dist/cjs/{utils-a3f0b70a.js → utils-0916d10f.js} +1 -1
  7. package/dist/cjs/verdocs-activity-box.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  10. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-contact-picker_3.cjs.entry.js +3 -3
  12. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +3 -3
  13. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  14. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +3 -3
  15. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +3 -3
  16. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
  23. package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +3 -3
  25. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -3
  26. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
  27. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
  29. package/dist/cjs/verdocs-preview_8.cjs.entry.js +4 -4
  30. package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
  31. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +3 -3
  33. package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-sign.cjs.entry.js +3 -3
  35. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +3 -3
  36. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +4 -4
  37. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  38. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
  40. package/dist/components/Envelopes.js +2 -6
  41. package/dist/components/VerdocsEndpoint.js +1 -186
  42. package/dist/docs.json +1 -1
  43. package/dist/esm/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  44. package/dist/esm/{Envelopes-21ffb899.js → Envelopes-627c5239.js} +2 -6
  45. package/dist/esm/{TemplateStore-7149eda0.js → TemplateStore-ad77a294.js} +1 -1
  46. package/dist/esm/{VerdocsEndpoint-7922d31f.js → VerdocsEndpoint-56fa3371.js} +1 -186
  47. package/dist/esm/ipc-test.entry.js +2 -2
  48. package/dist/esm/{utils-e0ce2c22.js → utils-ca3121df.js} +1 -1
  49. package/dist/esm/verdocs-activity-box.entry.js +2 -2
  50. package/dist/esm/verdocs-auth.entry.js +1 -1
  51. package/dist/esm/verdocs-build.entry.js +2 -2
  52. package/dist/esm/verdocs-button-panel_2.entry.js +2 -2
  53. package/dist/esm/verdocs-contact-picker_3.entry.js +3 -3
  54. package/dist/esm/verdocs-envelope-document-page.entry.js +3 -3
  55. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  56. package/dist/esm/verdocs-envelope-sidebar.entry.js +3 -3
  57. package/dist/esm/verdocs-envelopes-list.entry.js +3 -3
  58. package/dist/esm/verdocs-field-attachment.entry.js +2 -2
  59. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  60. package/dist/esm/verdocs-field-date.entry.js +2 -2
  61. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  62. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  63. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  64. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  65. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  66. package/dist/esm/verdocs-field-textarea.entry.js +3 -3
  67. package/dist/esm/verdocs-field-textbox.entry.js +3 -3
  68. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  69. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  70. package/dist/esm/verdocs-pagination_2.entry.js +2 -2
  71. package/dist/esm/verdocs-preview_8.entry.js +4 -4
  72. package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
  73. package/dist/esm/verdocs-search.entry.js +1 -1
  74. package/dist/esm/verdocs-settings-api-keys_4.entry.js +3 -3
  75. package/dist/esm/verdocs-settings.entry.js +1 -1
  76. package/dist/esm/verdocs-sign.entry.js +3 -3
  77. package/dist/esm/verdocs-template-document-page_2.entry.js +3 -3
  78. package/dist/esm/verdocs-template-fields_4.entry.js +4 -4
  79. package/dist/esm/verdocs-template-star.entry.js +1 -1
  80. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  81. package/dist/esm/verdocs-view.entry.js +3 -3
  82. package/dist/esm-es5/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  83. package/dist/esm-es5/Envelopes-627c5239.js +1 -0
  84. package/dist/esm-es5/{TemplateStore-7149eda0.js → TemplateStore-ad77a294.js} +1 -1
  85. package/dist/esm-es5/VerdocsEndpoint-56fa3371.js +1 -0
  86. package/dist/esm-es5/ipc-test.entry.js +1 -1
  87. package/dist/esm-es5/{utils-e0ce2c22.js → utils-ca3121df.js} +2 -2
  88. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-contact-picker_3.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-settings.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  121. package/dist/verdocs-web-sdk/{p-ee159b14.js → p-02a71e03.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-f49cb84b.entry.js → p-035a3ce2.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/p-035f6b38.js +1 -0
  124. package/dist/verdocs-web-sdk/{p-8f8504e2.entry.js → p-05e6bc91.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-0419a39f.system.entry.js → p-0685d939.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-0c157d55.system.entry.js → p-0abf0058.system.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-9dcb8b6c.system.entry.js → p-17598002.system.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-3f837e30.system.entry.js → p-17bf98f2.system.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-3f5fb65b.entry.js → p-1a7aa04b.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-14b08edd.system.entry.js → p-1c08edf7.system.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-7144ab8e.system.entry.js → p-1cb878c8.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-6d70fc87.system.entry.js → p-1e38b22f.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-ebc4142c.js → p-1f78be32.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-992f92f4.entry.js → p-22e0d2bc.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-73b9ef06.entry.js → p-2ccbf54d.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/p-319c00bd.entry.js +1 -0
  137. package/dist/verdocs-web-sdk/{p-1eb38c2e.entry.js → p-37dfdc84.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-9b66a84a.system.entry.js → p-3f3807b0.system.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-1efd342e.entry.js → p-410c63e6.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-7b3fed68.entry.js → p-46624bec.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-a59064f7.system.entry.js → p-4d98f194.system.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-120f75b1.entry.js → p-4e47ed1c.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-5f736f85.system.entry.js → p-59769c39.system.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-083bdbc6.entry.js → p-6331d113.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-2c47b92e.entry.js → p-637187de.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-4a1bc6e3.system.entry.js → p-6685ff29.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-1a3168af.system.entry.js → p-6dd69d82.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-90d54d8a.system.entry.js → p-736fbb87.system.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-3019b350.entry.js → p-746fce21.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/{p-fdf0a9de.entry.js → p-76f8c30a.entry.js} +1 -1
  151. package/dist/verdocs-web-sdk/{p-9c2bec77.system.entry.js → p-79168c6a.system.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/{p-59c44eee.system.entry.js → p-7b30c523.system.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-1fdb236c.system.js → p-82b5e475.system.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-ce00ee85.entry.js → p-82d4afbf.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-b0bf091c.system.js → p-840827b7.system.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-4a3238f6.entry.js → p-85df0da6.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-0d4739c4.system.entry.js → p-870707e8.system.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/p-8aae8d16.system.js +1 -0
  159. package/dist/verdocs-web-sdk/{p-8e0d6152.system.entry.js → p-8af68516.system.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/{p-7be5cb8c.entry.js → p-8b0a5309.entry.js} +1 -1
  161. package/dist/verdocs-web-sdk/{p-16849f44.system.entry.js → p-9360b085.system.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/{p-e6b68ad5.entry.js → p-94009f45.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/{p-7e8d64fb.system.js → p-9615b087.system.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-5f434764.system.entry.js → p-9a5c0882.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/p-9bf2d124.system.js +1 -0
  166. package/dist/verdocs-web-sdk/{p-345f88a3.system.entry.js → p-9ceff040.system.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-0549358c.entry.js → p-9d2995a9.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-6a13105b.entry.js → p-9fc06f7b.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-2ec8a9be.entry.js → p-a40b3946.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/{p-d7dbeec3.system.entry.js → p-ab98a02d.system.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-026eb575.system.entry.js → p-ac98f6f1.system.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-38679b8e.system.entry.js → p-acc873cf.system.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-6b1735f4.entry.js → p-ae83f4a0.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-39f3f620.system.entry.js → p-b467d981.system.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-7cbe51d8.system.entry.js → p-b6231fd3.system.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-06fb711b.system.entry.js → p-b648ab63.system.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/{p-c58916d2.system.entry.js → p-b7a815e9.system.entry.js} +1 -1
  178. package/dist/verdocs-web-sdk/{p-6827df7b.entry.js → p-b91de346.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/{p-da1c0295.system.entry.js → p-ba653c39.system.entry.js} +1 -1
  180. package/dist/verdocs-web-sdk/{p-f3a1060a.entry.js → p-c80237f9.entry.js} +1 -1
  181. package/dist/verdocs-web-sdk/{p-599fa850.entry.js → p-cf703fe4.entry.js} +1 -1
  182. package/dist/verdocs-web-sdk/{p-974b4c02.entry.js → p-d0a09719.entry.js} +1 -1
  183. package/dist/verdocs-web-sdk/{p-d2cee107.system.entry.js → p-d39e4a26.system.entry.js} +1 -1
  184. package/dist/verdocs-web-sdk/{p-ed639a7c.entry.js → p-d59b6988.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/{p-dd277e69.entry.js → p-d61fda4b.entry.js} +1 -1
  186. package/dist/verdocs-web-sdk/{p-393a9a2a.system.entry.js → p-d99a05e4.system.entry.js} +1 -1
  187. package/dist/verdocs-web-sdk/{p-05b3034f.entry.js → p-da3faf4a.entry.js} +1 -1
  188. package/dist/verdocs-web-sdk/p-dc2ad047.js +1 -0
  189. package/dist/verdocs-web-sdk/{p-686139a0.entry.js → p-dd2c2edc.entry.js} +1 -1
  190. package/dist/verdocs-web-sdk/{p-47460aa0.entry.js → p-e1bc55f8.entry.js} +1 -1
  191. package/dist/verdocs-web-sdk/{p-32b26f8f.system.entry.js → p-e28878eb.system.entry.js} +1 -1
  192. package/dist/verdocs-web-sdk/{p-fa1621c8.system.entry.js → p-e4dc3264.system.entry.js} +1 -1
  193. package/dist/verdocs-web-sdk/{p-ecb7ea02.entry.js → p-e760f894.entry.js} +1 -1
  194. package/dist/verdocs-web-sdk/{p-9aff3ff0.entry.js → p-eeca4c30.entry.js} +1 -1
  195. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  196. package/dist/verdocs-web-sdk/{p-5aee3e25.js → p-f3dde708.js} +1 -1
  197. package/dist/verdocs-web-sdk/{p-a7134b10.entry.js → p-f42c84f1.entry.js} +1 -1
  198. package/dist/verdocs-web-sdk/{p-f83a0c6e.system.entry.js → p-f6b7439f.system.entry.js} +1 -1
  199. package/dist/verdocs-web-sdk/{p-401a49cb.system.entry.js → p-fe67b620.system.entry.js} +1 -1
  200. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  201. package/package.json +2 -2
  202. package/dist/custom-elements.json +0 -2067
  203. package/dist/esm-es5/Envelopes-21ffb899.js +0 -1
  204. package/dist/esm-es5/VerdocsEndpoint-7922d31f.js +0 -1
  205. package/dist/verdocs-web-sdk/p-19ff8f86.system.js +0 -1
  206. package/dist/verdocs-web-sdk/p-2ccbcfeb.system.js +0 -1
  207. package/dist/verdocs-web-sdk/p-2fe75327.entry.js +0 -1
  208. package/dist/verdocs-web-sdk/p-5a91bf23.js +0 -1
  209. package/dist/verdocs-web-sdk/p-b101fae2.js +0 -1
@@ -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,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):o(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(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,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,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=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++;o=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];o=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-05eb4fed.system.js","./p-b0bf091c.system.js","./p-1ba9f457.system.js","./p-2ccbcfeb.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,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;o=e.H},function(e){r=e.g},function(e){s=e.g},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var a='verdocs-field-signature{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:83px;height:36px;display:block;font-size:11px;position:relative;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-signature.disabled{opacity:0.5}verdocs-field-signature.done{border:none;opacity:1}verdocs-field-signature img{display:block;max-width:100%;max-height:100%}verdocs-field-signature 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-signature button.hide{display:none}verdocs-field-signature.required{border:1px solid #cc0000}verdocs-field-signature.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-signature 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-signature verdocs-button-panel[data-active],verdocs-field-signature verdocs-button-panel:hover{opacity:1}verdocs-field-signature verdocs-button-panel .icon svg{fill:#333333}verdocs-field-signature verdocs-button-panel .icon:hover svg{fill:#000000}';var l='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var d=e("verdocs_field_signature",function(){function e(e){t(this,e);this.fieldChange=i(this,"fieldChange",7);this.settingsPress=i(this,"settingsPress",7);this.settingsChanged=i(this,"settingsChanged",7);this.deleted=i(this,"deleted",7);this.templateid="";this.field=null;this.name="";this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.rerender=0;this.tempSignature=""}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.handleShow();console.log("focused",this);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("[SIGNATURE] Adopted signature");this.tempSignature=e.detail;(t=this.fieldChange)===null||t===void 0?void 0:t.emit(this.tempSignature);this.hideDialog()};e.prototype.handleShow=function(){var e=this;this.dialog=document.createElement("verdocs-signature-dialog");this.dialog.setAttribute("name",this.name);this.dialog.setAttribute("roleindex",this.roleindex);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.field.name));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.field.name));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,i,a;var d=s(this.field);var u=d.base64||this.tempSignature;var c=(i=(t=this.disabled)!==null&&t!==void 0?t:d.disabled)!==null&&i!==void 0?i:false;var f=this.field["rgba"]||r(this.roleindex);if(this.done){return n(o,{class:{done:this.done}},u&&n("img",{src:u,alt:"Signature"}))}return n(o,{class:{required:(a=this.field)===null||a===void 0?void 0:a.required,disabled:c},style:{backgroundColor:f}},u?n("img",{src:u,alt:"Signature"}):n("button",{onClick:function(){return!c&&e.handleShow()}},"Signature"),this.editable&&n("verdocs-button-panel",{icon:l,id:"verdocs-settings-panel-".concat(this.field.name)},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:function(){return e.hideSettingsPanel()},onDelete:function(){var t;(t=e.deleted)===null||t===void 0?void 0:t.emit({fieldName:e.field.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()}})))};return e}());d.style=a}}}));
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,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):o(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(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,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,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=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++;o=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];o=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-05eb4fed.system.js","./p-840827b7.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,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;o=e.H},function(e){r=e.g},function(e){s=e.g},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var a='verdocs-field-signature{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:83px;height:36px;display:block;font-size:11px;position:relative;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-signature.disabled{opacity:0.5}verdocs-field-signature.done{border:none;opacity:1}verdocs-field-signature img{display:block;max-width:100%;max-height:100%}verdocs-field-signature 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-signature button.hide{display:none}verdocs-field-signature.required{border:1px solid #cc0000}verdocs-field-signature.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-signature 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-signature verdocs-button-panel[data-active],verdocs-field-signature verdocs-button-panel:hover{opacity:1}verdocs-field-signature verdocs-button-panel .icon svg{fill:#333333}verdocs-field-signature verdocs-button-panel .icon:hover svg{fill:#000000}';var l='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var d=e("verdocs_field_signature",function(){function e(e){t(this,e);this.fieldChange=i(this,"fieldChange",7);this.settingsPress=i(this,"settingsPress",7);this.settingsChanged=i(this,"settingsChanged",7);this.deleted=i(this,"deleted",7);this.templateid="";this.field=null;this.name="";this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.rerender=0;this.tempSignature=""}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.handleShow();console.log("focused",this);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("[SIGNATURE] Adopted signature");this.tempSignature=e.detail;(t=this.fieldChange)===null||t===void 0?void 0:t.emit(this.tempSignature);this.hideDialog()};e.prototype.handleShow=function(){var e=this;this.dialog=document.createElement("verdocs-signature-dialog");this.dialog.setAttribute("name",this.name);this.dialog.setAttribute("roleindex",this.roleindex);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.field.name));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.field.name));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,i,a;var d=s(this.field);var u=d.base64||this.tempSignature;var c=(i=(t=this.disabled)!==null&&t!==void 0?t:d.disabled)!==null&&i!==void 0?i:false;var h=this.field["rgba"]||r(this.roleindex);if(this.done){return n(o,{class:{done:this.done}},u&&n("img",{src:u,alt:"Signature"}))}return n(o,{class:{required:(a=this.field)===null||a===void 0?void 0:a.required,disabled:c},style:{backgroundColor:h}},u?n("img",{src:u,alt:"Signature"}):n("button",{onClick:function(){return!c&&e.handleShow()}},"Signature"),this.editable&&n("verdocs-button-panel",{icon:l,id:"verdocs-settings-panel-".concat(this.field.name)},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:function(){return e.hideSettingsPanel()},onDelete:function(){var t;(t=e.deleted)===null||t===void 0?void 0:t.emit({fieldName:e.field.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()}})))};return e}());d.style=a}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):r(t.value).then(o,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];r=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-2ccbcfeb.system.js","./p-54498887.system.js","./p-19ff8f86.system.js","./p-b0bf091c.system.js","./p-1ba9f457.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(t){"use strict";var e,i,n,r,a,o,s,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;a=t.a},function(t){o=t.m},function(){},function(t){s=t.V},function(t){c=t.t},function(){},function(){},function(){},function(){}],execute:function(){var h="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var u=t("verdocs_envelope_document_page",function(){function t(t){e(this,t);this.pageRendered=i(this,"pageRendered",7);this.endpoint=s.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,o(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(c((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];var a=r.contentRect.width;t.renderedWidth=a;t.renderedHeight=t.virtualHeight*(a/t.virtualWidth)}t.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};t.prototype.render=function(){var t=this;var e="".concat(this.renderedHeight,"px");return n(r,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(t.containerId,"-").concat(i.name),src:t.pageDisplayUri,alt:"Page ".concat(t.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(e){t.naturalWidth=e.target.naturalWidth;t.naturalHeight=e.target.naturalHeight;t.aspectRatio=t.naturalWidth/t.naturalHeight;t.virtualHeight=t.virtualWidth/t.aspectRatio;t.renderedHeight=e.target.offsetWidth/t.aspectRatio}}):n("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());u.style=h}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):r(t.value).then(o,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];r=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-840827b7.system.js","./p-1ba9f457.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(t){"use strict";var e,i,n,r,a,o,s,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;a=t.a},function(t){o=t.m},function(){},function(t){s=t.V},function(t){c=t.t},function(){},function(){},function(){},function(){}],execute:function(){var h="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var u=t("verdocs_envelope_document_page",function(){function t(t){e(this,t);this.pageRendered=i(this,"pageRendered",7);this.endpoint=s.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,o(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(c((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];var a=r.contentRect.width;t.renderedWidth=a;t.renderedHeight=t.virtualHeight*(a/t.virtualWidth)}t.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};t.prototype.render=function(){var t=this;var e="".concat(this.renderedHeight,"px");return n(r,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(t.containerId,"-").concat(i.name),src:t.pageDisplayUri,alt:"Page ".concat(t.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(e){t.naturalWidth=e.target.naturalWidth;t.naturalHeight=e.target.naturalHeight;t.aspectRatio=t.naturalWidth/t.naturalHeight;t.virtualHeight=t.virtualWidth/t.aspectRatio;t.renderedHeight=e.target.offsetWidth/t.aspectRatio}}):n("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());u.style=h}}}));
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as o,F as s,a as l}from"./p-14b44491.js";import{i as r}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-b101fae2.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{b as v,r as m,f as u,h as f,i as g}from"./p-ee159b14.js";import{g as x,a as b}from"./p-5aee3e25.js";import{S as w}from"./p-7a1b2643.js";import{g as y}from"./p-6de76553.js";import"./p-7d5dbd9a.js";import"./p-5a91bf23.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";var k=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/roles/").concat(i),o).then((function(e){return e.data}))};const q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',C=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" 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>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:q},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:q},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],E=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,o,s,l,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loaded template ${this.templateId}`,this.store.state),this.selectedRoleName=(null===(o=null===(i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===i?void 0:i[0])||void 0===o?void 0:o.name)||"",console.log("[FIELDS] Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new w(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){r.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e,t,i,o,s,l;this.selectedRoleName&&((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).find((e=>e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(l=null===(s=null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles)||void 0===s?void 0:s[0])||void 0===l?void 0:l.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}handleFieldSettingsChange(e,t,i,o,s){var l,r,a,n;console.log("[FIELDS] Field settings changed",t.name,s),Object.assign(t,s),o.field=s,this.selectedRoleName=t.role_name,o.setAttribute("roleindex",v(b(this.store),t.role_name)),o.field=null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.fields.find((e=>e.name===t.name)),this.rerender++,o.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(n=this.store)||void 0===n?void 0:n.state,event:"updated-field"}),console.log("[FIELDS] Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),m(t,e,i,{disabled:!0,editable:!0,draggable:!0})}attachFieldAttributes(e,t,i,o){o.addEventListener("input",(e=>this.handleFieldChange(t,e))),o.addEventListener("settingsChanged",(s=>this.handleFieldSettingsChange(e,t,i,o,s.detail.field))),o.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),o.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state,event:"updated-field"})})),o.setAttribute("templateid",this.templateId),o.setAttribute("roleindex",i),o.setAttribute("pageNumber",e.pageNumber),o.setAttribute("xScale",e.xScale),o.setAttribute("yScale",e.yScale),o.setAttribute("name",t.name)}handlePageRendered(e){var t;const i=e.detail;console.log("[FIELDS] Page rendered",i.pageNumber,i),this.cachedPageInfo[i.pageNumber]=i,this.pageHeights[i.pageNumber]=i.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===i.pageNumber))).forEach((e=>this.reRenderField(e,i.pageNumber)))}reRenderField(e,t){const i=this.cachedPageInfo[t],o=v(b(this.store),e.role_name),s=m(e,i,o,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(i,e,o,t),this.makeDraggable(t)})):(this.attachFieldAttributes(i,e,o,s),this.makeDraggable(s)))}makeDraggable(e){r(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/o+t,r=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),u(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t;const i=e.target.getAttribute("name"),o=+(e.target.getAttribute("option")||"0"),s=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===i));if(console.log("Dropped field",i,s),!s)return void console.log("[FIELDS] Unable to find field",i);const l=e.target.getAttribute("pageNumber"),{naturalWidth:r=612,naturalHeight:a=792,renderedHeight:n=792}=this.cachedPageInfo[l],d=e.target.getBoundingClientRect(),c=e.target.parentElement.getBoundingClientRect(),h=s.setting.width||f(s.type),m=s.setting.height||g(s.type),u=Math.max(d.left-c.left,0),x=Math.max(n-(c.bottom-d.bottom),0),{x:w,y}=this.viewCoordinatesToPageCoordinates(u,x,l,r-h,a-m);switch(s.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":s.setting.x=w,s.setting.y=y;break;case"checkbox_group":case"radio_button_group":{const e=s.setting.options[o];e&&(e.x=w,e.y=y)}}console.log("[FIELDS] Will update",i,o,s);const k=await p(this.endpoint,this.templateId,i,s),q=this.cachedPageInfo[l],C=v(b(this.store),s.role_name);this.handleFieldSettingsChange(q,s,C,e.target,k),e.target.removeAttribute("posX"),e.target.removeAttribute("posY")}generateFieldName(e,t){var i;let o,s=1;do{o=`${e}P${t}-${s}`,s++}while(null===(i=this.store)||void 0===i?void 0:i.state.fields.some((e=>e.name===o)));return o}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[i],n=Math.floor(Math.min(e/l,o)),d=Math.floor(Math.min(Math.max(a-t,0)/r,s));return console.log("Computed coordinates",{x:n,y:d,viewX:e,viewY:t,xMax:o,yMax:s}),{x:n,y:d}}async handleClickPage(e,t){var i,o,s;if(this.placing){const l=e.offsetX,r=e.offsetY,a=f(this.placing),n=g(this.placing),d=this.cachedPageInfo[t],{naturalWidth:p=612,naturalHeight:h=792}=d,v=this.viewCoordinatesToPageCoordinates(l,r,t,p-a,h-n),m=Math.floor(v.x),u=Math.floor(v.y),x={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:d.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:u},x:m,y:u,tabindex:0,width:a,height:n};switch(x.type){case"attachment":case"payment":x.setting={x:m,y:u};break;case"initial":case"signature":x.setting={x:m,y:u,result:""};break;case"checkbox_group":x.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${x.name}-1`,value:"Option 1",checked:!1,x:m,y:u}]};break;case"date":x.setting={x:m,y:u,width:a,height:n,result:""};break;case"dropdown":x.required=!1,x.setting={x:m,y:u,width:a,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":x.setting={options:[{id:`${x.name}-1`,value:"Option 1",selected:!1,x:m,y:u}]};break;case"textarea":case"textbox":x.setting={x:m,y:u,width:a,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":x.setting={x:m,y:u,width:a,height:n}}"textarea"===x.type&&(x.setting.leading=16,x.type="textbox");const b=await c(this.endpoint,this.templateId,x);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(i=this.store)||void 0===i?void 0:i.state.fields,b]),this.placing=null,null===(o=this.templateUpdated)||void 0===o||o.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}render(){var e,t,s,l,r,a,n,d;if(console.log("[FIELDS] Rendering",this.selectedRoleName),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const p=null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.roles.map((e=>({value:e.name,label:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:p,onInput:e=>this.selectedRoleName=e.target.value}),C.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:(null===(d=null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.roles)||void 0===d?void 0:d.length)>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};E.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath 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'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const M=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.fullName="",this.email="",this.phone="",this.allowDelegation=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1);const i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.fullName=i.full_name,this.email=i.email,this.phone=i.phone,this.allowDelegation=i.delegator,console.log("[ROLES] Editing role",i))}catch(e){console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,i,o;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,k(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,this.store=await x(this.endpoint,this.templateId,!0),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("Update error",e),this.saving=!1}))}async handleDelete(e){var t,i,o;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,i=this.templateId,o=this.roleName,t.api.delete("/templates/".concat(i,"/roles/").concat(o)).then((function(e){return e.data}))).then((e=>{var t;console.log("Role deleted",e),this.store.state.roles=[...this.store.state.roles.filter((e=>e.name!==this.roleName))],null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){const e=-1!==(this.store.state.fields||[]).findIndex((e=>e.role_name===this.roleName));return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},i("div",{class:"dialog"},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.fullName=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.allowDelegation,onInput:e=>{this.allowDelegation=e.target.checked,this.dirty=!0}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<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>'}),i("div",{style:{flex:"1"}}),i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};M.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;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-template-role-properties .dialog{width:340px;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-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-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-role-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-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-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-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;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-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const L={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},Z='<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>',z='<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>',S='<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>',H='<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>',V='<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>',I=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await this.reloadStore()}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new w(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}async reloadStore(){this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}componentDidRender(){r.dynamicDrop(!0),r(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=e.dx+t,s=e.dy+i;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,i,o,s,l;e.target.classList.remove("active");const r=e.relatedTarget.dataset.rolename,a=+e.target.dataset.sequence,n=+e.target.dataset.order,d=null===(o=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles)||void 0===o?void 0:o.find((e=>e.name===r));d&&(d.sequence=a,d.order=n,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>k(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,i)=>{var o,s;null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,o)=>{e.includes(t.name)||(t.sequence=i+1,t.order=o+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,i,o;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,i){var o,s,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),(o=this.endpoint,s=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:i,full_name:"",email:"",phone:"",type:"signer",delegator:!1},o.api.post("/templates/".concat(s,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t,i;console.log("[ROLES] Created role",e),this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles(),null===(t=this.templateUpdated)||void 0===t||t.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var i;e.stopPropagation();const o=(null===(i=this.store)||void 0===i?void 0:i.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,o)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,r,a,n;if(console.log("[ROLES] Rendering"),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,{class:"loading"},i("verdocs-loader",null));const d=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(r=this.store.state)||void 0===r?void 0:r.updateCount},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",L[null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.sender]," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:z}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,o;return i(s,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles.filter((t=>t.sequence===e)).map((t=>i(s,null,t.email?i("div",{class:"recipient",style:{borderColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.full_name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{backgroundColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),i("button",{class:"add-role",innerHTML:z,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":this.sequences.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("button",{class:"add-step",innerHTML:z,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),d.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:z})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:d.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e,t;await x(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};I.style='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:#46497d;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;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-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;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;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{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}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:2px 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}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var i;console.log("Update result",t),(null===(i=this.store)||void 0===i?void 0:i.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};R.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .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-template-sender .dialog{width:340px;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-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{E as verdocs_template_fields,M as verdocs_template_role_properties,I as verdocs_template_roles,R as verdocs_template_sender}
1
+ import{r as e,c as t,h as i,H as o,F as s,a as l}from"./p-14b44491.js";import{i as r}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-035f6b38.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{b as v,r as m,f as u,h as f,i as g}from"./p-02a71e03.js";import{g as x,a as b}from"./p-f3dde708.js";import{S as w}from"./p-7a1b2643.js";import{g as y}from"./p-6de76553.js";import"./p-7d5dbd9a.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";var k=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/roles/").concat(i),o).then((function(e){return e.data}))};const q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',C=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" 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>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:q},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:q},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],E=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,o,s,l,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loaded template ${this.templateId}`,this.store.state),this.selectedRoleName=(null===(o=null===(i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===i?void 0:i[0])||void 0===o?void 0:o.name)||"",console.log("[FIELDS] Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new w(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){r.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e,t,i,o,s,l;this.selectedRoleName&&((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).find((e=>e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(l=null===(s=null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles)||void 0===s?void 0:s[0])||void 0===l?void 0:l.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}handleFieldSettingsChange(e,t,i,o,s){var l,r,a,n;console.log("[FIELDS] Field settings changed",t.name,s),Object.assign(t,s),o.field=s,this.selectedRoleName=t.role_name,o.setAttribute("roleindex",v(b(this.store),t.role_name)),o.field=null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.fields.find((e=>e.name===t.name)),this.rerender++,o.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(n=this.store)||void 0===n?void 0:n.state,event:"updated-field"}),console.log("[FIELDS] Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),m(t,e,i,{disabled:!0,editable:!0,draggable:!0})}attachFieldAttributes(e,t,i,o){o.addEventListener("input",(e=>this.handleFieldChange(t,e))),o.addEventListener("settingsChanged",(s=>this.handleFieldSettingsChange(e,t,i,o,s.detail.field))),o.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),o.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state,event:"updated-field"})})),o.setAttribute("templateid",this.templateId),o.setAttribute("roleindex",i),o.setAttribute("pageNumber",e.pageNumber),o.setAttribute("xScale",e.xScale),o.setAttribute("yScale",e.yScale),o.setAttribute("name",t.name)}handlePageRendered(e){var t;const i=e.detail;console.log("[FIELDS] Page rendered",i.pageNumber,i),this.cachedPageInfo[i.pageNumber]=i,this.pageHeights[i.pageNumber]=i.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===i.pageNumber))).forEach((e=>this.reRenderField(e,i.pageNumber)))}reRenderField(e,t){const i=this.cachedPageInfo[t],o=v(b(this.store),e.role_name),s=m(e,i,o,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(i,e,o,t),this.makeDraggable(t)})):(this.attachFieldAttributes(i,e,o,s),this.makeDraggable(s)))}makeDraggable(e){r(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/o+t,r=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),u(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t;const i=e.target.getAttribute("name"),o=+(e.target.getAttribute("option")||"0"),s=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===i));if(console.log("Dropped field",i,s),!s)return void console.log("[FIELDS] Unable to find field",i);const l=e.target.getAttribute("pageNumber"),{naturalWidth:r=612,naturalHeight:a=792,renderedHeight:n=792}=this.cachedPageInfo[l],d=e.target.getBoundingClientRect(),c=e.target.parentElement.getBoundingClientRect(),h=s.setting.width||f(s.type),m=s.setting.height||g(s.type),u=Math.max(d.left-c.left,0),x=Math.max(n-(c.bottom-d.bottom),0),{x:w,y}=this.viewCoordinatesToPageCoordinates(u,x,l,r-h,a-m);switch(s.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":s.setting.x=w,s.setting.y=y;break;case"checkbox_group":case"radio_button_group":{const e=s.setting.options[o];e&&(e.x=w,e.y=y)}}console.log("[FIELDS] Will update",i,o,s);const k=await p(this.endpoint,this.templateId,i,s),q=this.cachedPageInfo[l],C=v(b(this.store),s.role_name);this.handleFieldSettingsChange(q,s,C,e.target,k),e.target.removeAttribute("posX"),e.target.removeAttribute("posY")}generateFieldName(e,t){var i;let o,s=1;do{o=`${e}P${t}-${s}`,s++}while(null===(i=this.store)||void 0===i?void 0:i.state.fields.some((e=>e.name===o)));return o}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[i],n=Math.floor(Math.min(e/l,o)),d=Math.floor(Math.min(Math.max(a-t,0)/r,s));return console.log("Computed coordinates",{x:n,y:d,viewX:e,viewY:t,xMax:o,yMax:s}),{x:n,y:d}}async handleClickPage(e,t){var i,o,s;if(this.placing){const l=e.offsetX,r=e.offsetY,a=f(this.placing),n=g(this.placing),d=this.cachedPageInfo[t],{naturalWidth:p=612,naturalHeight:h=792}=d,v=this.viewCoordinatesToPageCoordinates(l,r,t,p-a,h-n),m=Math.floor(v.x),u=Math.floor(v.y),x={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:d.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:u},x:m,y:u,tabindex:0,width:a,height:n};switch(x.type){case"attachment":case"payment":x.setting={x:m,y:u};break;case"initial":case"signature":x.setting={x:m,y:u,result:""};break;case"checkbox_group":x.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${x.name}-1`,value:"Option 1",checked:!1,x:m,y:u}]};break;case"date":x.setting={x:m,y:u,width:a,height:n,result:""};break;case"dropdown":x.required=!1,x.setting={x:m,y:u,width:a,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":x.setting={options:[{id:`${x.name}-1`,value:"Option 1",selected:!1,x:m,y:u}]};break;case"textarea":case"textbox":x.setting={x:m,y:u,width:a,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":x.setting={x:m,y:u,width:a,height:n}}"textarea"===x.type&&(x.setting.leading=16,x.type="textbox");const b=await c(this.endpoint,this.templateId,x);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(i=this.store)||void 0===i?void 0:i.state.fields,b]),this.placing=null,null===(o=this.templateUpdated)||void 0===o||o.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}render(){var e,t,s,l,r,a,n,d;if(console.log("[FIELDS] Rendering",this.selectedRoleName),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const p=null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.roles.map((e=>({value:e.name,label:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:p,onInput:e=>this.selectedRoleName=e.target.value}),C.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:(null===(d=null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.roles)||void 0===d?void 0:d.length)>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};E.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath 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'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const M=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.fullName="",this.email="",this.phone="",this.allowDelegation=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1);const i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.fullName=i.full_name,this.email=i.email,this.phone=i.phone,this.allowDelegation=i.delegator,console.log("[ROLES] Editing role",i))}catch(e){console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,i,o;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,k(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,this.store=await x(this.endpoint,this.templateId,!0),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("Update error",e),this.saving=!1}))}async handleDelete(e){var t,i,o;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,i=this.templateId,o=this.roleName,t.api.delete("/templates/".concat(i,"/roles/").concat(o)).then((function(e){return e.data}))).then((e=>{var t;console.log("Role deleted",e),this.store.state.roles=[...this.store.state.roles.filter((e=>e.name!==this.roleName))],null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){const e=-1!==(this.store.state.fields||[]).findIndex((e=>e.role_name===this.roleName));return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},i("div",{class:"dialog"},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.fullName=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.allowDelegation,onInput:e=>{this.allowDelegation=e.target.checked,this.dirty=!0}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<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>'}),i("div",{style:{flex:"1"}}),i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};M.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;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-template-role-properties .dialog{width:340px;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-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-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-role-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-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-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-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;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-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const L={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},Z='<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>',z='<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>',S='<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>',H='<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>',V='<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>',I=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await this.reloadStore()}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new w(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}async reloadStore(){this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}componentDidRender(){r.dynamicDrop(!0),r(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=e.dx+t,s=e.dy+i;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,i,o,s,l;e.target.classList.remove("active");const r=e.relatedTarget.dataset.rolename,a=+e.target.dataset.sequence,n=+e.target.dataset.order,d=null===(o=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles)||void 0===o?void 0:o.find((e=>e.name===r));d&&(d.sequence=a,d.order=n,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>k(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,i)=>{var o,s;null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,o)=>{e.includes(t.name)||(t.sequence=i+1,t.order=o+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,i,o;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,i){var o,s,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),(o=this.endpoint,s=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:i,full_name:"",email:"",phone:"",type:"signer",delegator:!1},o.api.post("/templates/".concat(s,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t,i;console.log("[ROLES] Created role",e),this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles(),null===(t=this.templateUpdated)||void 0===t||t.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var i;e.stopPropagation();const o=(null===(i=this.store)||void 0===i?void 0:i.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,o)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,r,a,n;if(console.log("[ROLES] Rendering"),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,{class:"loading"},i("verdocs-loader",null));const d=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(r=this.store.state)||void 0===r?void 0:r.updateCount},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",L[null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.sender]," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:z}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,o;return i(s,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles.filter((t=>t.sequence===e)).map((t=>i(s,null,t.email?i("div",{class:"recipient",style:{borderColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.full_name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{backgroundColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),i("button",{class:"add-role",innerHTML:z,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":this.sequences.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("button",{class:"add-step",innerHTML:z,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<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>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),d.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:z})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:d.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e,t;await x(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};I.style='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:#46497d;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;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-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;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;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{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}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:2px 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}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var i;console.log("Update result",t),(null===(i=this.store)||void 0===i?void 0:i.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};R.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .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-template-sender .dialog{width:340px;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-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{E as verdocs_template_fields,M as verdocs_template_role_properties,I as verdocs_template_roles,R as verdocs_template_sender}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):i(t.value).then(s,a)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,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(t){return function(e){return l([t,e])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-19ff8f86.system.js","./p-1fdb236c.system.js","./p-3af6b910.system.js"],(function(t){"use strict";var e,n,r,i,o;return{setters:[function(t){e=t.r;n=t.h;r=t.H},function(){},function(t){i=t.V},function(t){o=t.g},function(){}],execute:function(){var s="ipc-test{max-width:800px;display:block}";var a=t("ipc_test",function(){function t(t){e(this,t);this.store=null;this.endpoint=i.getDefault();this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();t=this;return[4,o(this.endpoint,this.templateId,false)];case 1:t.store=n.sent();return[3,3];case 2:e=n.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",e);return[3,3];case 3:return[2]}}))}))};t.prototype.render=function(){console.log("[IPC] Rendering");return n(r,null,n("div",null,n("pre",null,n("code",null,JSON.stringify(this.store.state,null,2)))),n("verdocs-template-roles",{templateId:this.templateId}),n("verdocs-template-fields",{templateId:this.templateId}))};return t}());a.style=s}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):i(t.value).then(s,a)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,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(t){return function(e){return l([t,e])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-82b5e475.system.js","./p-3af6b910.system.js"],(function(t){"use strict";var e,n,r,i,o;return{setters:[function(t){e=t.r;n=t.h;r=t.H},function(){},function(t){i=t.V},function(t){o=t.g},function(){}],execute:function(){var s="ipc-test{max-width:800px;display:block}";var a=t("ipc_test",function(){function t(t){e(this,t);this.store=null;this.endpoint=i.getDefault();this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();t=this;return[4,o(this.endpoint,this.templateId,false)];case 1:t.store=n.sent();return[3,3];case 2:e=n.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",e);return[3,3];case 3:return[2]}}))}))};t.prototype.render=function(){console.log("[IPC] Rendering");return n(r,null,n("div",null,n("pre",null,n("code",null,JSON.stringify(this.store.state,null,2)))),n("verdocs-template-roles",{templateId:this.templateId}),n("verdocs-template-fields",{templateId:this.templateId}))};return t}());a.style=s}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,r){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):a(t.value).then(i,s)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return l([t,e])}}function l(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;a=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];a=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-19ff8f86.system.js","./p-54498887.system.js"],(function(t){"use strict";var e,n,r,a,o;return{setters:[function(t){e=t.r;n=t.c;r=t.h;a=t.H},function(t){o=t.V},function(){}],execute:function(){var i=function(t,e){return t.api.post("/templates/".concat(e,"/stars/toggle")).then((function(t){return t.data}))};var s='verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';var l='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>';var c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>';var u=t("verdocs_template_star",function(){function t(t){e(this,t);this.starChange=n(this,"starChange",7);this.sdkError=n(this,"sdkError",7);this.endpoint=o.getDefault();this.template=undefined;this.updating=false}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return[2]}return[2]}))}))};t.prototype.toggle=function(t){var e=this;t.stopPropagation();this.updating=true;i(o.getDefault(),this.template.id).then((function(t){e.updating=false;e.template.star_counter=t.star_counter;e.starChange.emit({templateId:e.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((function(t){e.updating=false;console.log("[STAR] Error toggling template star",t.message);e.sdkError.emit(t)}))};t.prototype.render=function(){var t=this;return r(a,null,r("div",{class:"star ".concat(this.updating?"updating":""),innerHTML:this.template.star_counter?c:l,onClick:function(e){return t.toggle(e)}}),r("div",{class:"count"},this.template.star_counter||"--"))};return t}());u.style=s}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,n,r){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):a(t.value).then(i,s)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return l([t,e])}}function l(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;a=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];a=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-9bf2d124.system.js","./p-54498887.system.js"],(function(t){"use strict";var e,n,r,a,o;return{setters:[function(t){e=t.r;n=t.c;r=t.h;a=t.H},function(t){o=t.V},function(){}],execute:function(){var i=function(t,e){return t.api.post("/templates/".concat(e,"/stars/toggle")).then((function(t){return t.data}))};var s='verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';var l='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>';var c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>';var u=t("verdocs_template_star",function(){function t(t){e(this,t);this.starChange=n(this,"starChange",7);this.sdkError=n(this,"sdkError",7);this.endpoint=o.getDefault();this.template=undefined;this.updating=false}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return[2]}return[2]}))}))};t.prototype.toggle=function(t){var e=this;t.stopPropagation();this.updating=true;i(o.getDefault(),this.template.id).then((function(t){e.updating=false;e.template.star_counter=t.star_counter;e.starChange.emit({templateId:e.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((function(t){e.updating=false;console.log("[STAR] Error toggling template star",t.message);e.sdkError.emit(t)}))};t.prototype.render=function(){var t=this;return r(a,null,r("div",{class:"star ".concat(this.updating?"updating":""),innerHTML:this.template.star_counter?c:l,onClick:function(e){return t.toggle(e)}}),r("div",{class:"count"},this.template.star_counter||"--"))};return t}());u.style=s}}}));
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++){n=arguments[i];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))e[r]=n[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,i,t){function r(e){return e instanceof i?e:new i((function(n){n(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{a(t.next(e))}catch(e){o(e)}}function l(e){try{a(t["throw"](e))}catch(e){o(e)}}function a(e){e.done?i(e.value):r(e.value).then(s,l)}a((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,r,o,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(n){return a([e,n])}}function a(s){if(t)throw new TypeError("Generator is already executing.");while(i)try{if(t=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=n.call(e,i)}catch(e){s=[6,e];r=0}finally{t=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-eaf0b189.system.js","./p-19ff8f86.system.js","./p-7e8d64fb.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-1d60151a.system.js","./p-3af6b910.system.js","./p-2ccbcfeb.system.js"],(function(e){"use strict";var n,i,t,r,o,s,l,a,c,p,d;return{setters:[function(e){n=e.r;i=e.c;t=e.h;r=e.H},function(){},function(e){o=e.g},function(e){s=e.V},function(e){l=e.g},function(e){a=e.V},function(e){c=e.S},function(e){p=e.g;d=e.r},function(){},function(){}],execute:function(){var u='verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';var f=e("verdocs_envelope_recipient_link",function(){function e(e){n(this,e);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.store=null;this.recipient=null;this.endpoint=s.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.loading=true;this.gettingLink=true;this.link=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r,o,s,a;var p=this;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENT_LINK] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return[2]}s=this;return[4,l(this.endpoint,this.envelopeId,true)];case 1:s.store=d.sent();this.loading=false;this.gettingLink=true;this.recipient=(i=(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients)===null||i===void 0?void 0:i.find((function(e){return e.role_name===p.roleName}));this.getLink(this.recipient);return[3,3];case 2:a=d.sent();console.log("[RECIPIENT_LINK] Error loading envelope",a);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new c(a.message,(r=a.response)===null||r===void 0?void 0:r.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){navigator.clipboard.writeText(e).then((function(){return a("Link copied to clipboard!",{style:"success",duration:3e3})})).catch((function(e){console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);a("Unable to copy to clipboard: ".concat(e.message),{style:"error"})}))};e.prototype.getLink=function(e){var n=this;this.gettingLink=true;o(this.endpoint,e.envelope_id,e.role_name).then((function(e){n.gettingLink=false;n.link=e.link})).catch((function(e){n.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);a("Unable to get link: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;if(this.loading||!this.recipient){return t(r,null)}return t(r,null,t("div",{class:"summary-content"},t("h1",{class:"summary-title"},"In-Person Signing Link"),t("div",{class:"summary-rows"},t("div",{class:"summary-recipient"},t("div",{class:"role-name"},this.recipient.role_name),t("div",{class:"role-details"},t("div",{class:"role-info"},t("div",{class:"role-full-name"},this.recipient.full_name," (",this.recipient.email||this.recipient.phone,")"),!this.link&&t("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:function(){return e.getLink(e.recipient)}})),this.link&&t("div",{class:"link-wrapper"},t("div",{class:"link"},this.link),t("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(e.link)}}))))),t("div",{class:"buttons"},t("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}());f.style=u;var m='verdocs-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-summary .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-summary .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-summary .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}';var x=e("verdocs_envelope_recipient_summary",function(){function e(e){n(this,e);this.another=i(this,"another",7);this.view=i(this,"view",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.store=null;this.endpoint=s.getDefault();this.envelopeId="";this.canSendAnother=true;this.canView=true;this.canDone=true;this.isOpen=undefined;this.loading=true;this.recipientStatusIcons=[];this.containerId="verdocs-status-indicator-".concat(Math.random().toString(36).substring(2,11));this.gettingLinks={};this.links={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENTS] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENTS] Unable to start session, must be authenticated");return[2]}t=this;return[4,l(this.endpoint,this.envelopeId,true)];case 1:t.store=o.sent();this.sortEnvelopeRecipients();this.loading=false;return[3,3];case 2:r=o.sent();console.log("[RECIPIENTS] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.sortEnvelopeRecipients=function(){var e,n;(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients.sort((function(e,n){return e.sequence===n.sequence?e.order-n.order:e.sequence-n.sequence}))};e.prototype.handleAnother=function(e){var n;e.preventDefault();(n=this.another)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleView=function(e){var n;e.preventDefault();(n=this.view)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){var n=this;navigator.clipboard.writeText(e).then((function(){})).catch((function(e){var i;console.warn("[RECIPIENTS] Error copying to clipboard",e);(i=n.sdkError)===null||i===void 0?void 0:i.emit(e)}))};e.prototype.getLink=function(e){var n;var i=this;this.gettingLinks=__assign(__assign({},this.gettingLinks),(n={},n[e.role_name]=true,n));o(this.endpoint,e.envelope_id,e.role_name).then((function(n){var t,r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));i.links=__assign(__assign({},i.links),(r={},r[e.role_name]=n.link,r));i.copyLink(n.link)})).catch((function(n){var t;var r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));console.log("[RECIPIENTS] Error getting link",n);(r=i.sdkError)===null||r===void 0?void 0:r.emit(n)}))};e.prototype.render=function(){var e=this;var n,i;if(this.loading){return t(r,null)}return t(r,null,t("div",{class:"summary-content"},t("h1",{class:"summary-title"},"Recipient Summary"),t("div",{class:"summary-rows"},(((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.recipients)||[]).map((function(n){var i=p(e.store.state);var r=d(n,i);var o=e.links[n.role_name];var s=e.gettingLinks[n.role_name];return t("div",{class:"summary-recipient"},t("div",{class:"role-name"},n.role_name),t("div",{class:"role-details"},t("div",{class:"role-info"},t("div",{class:"role-full-name"},n.full_name," (",n.email||n.phone,")"),r&&!o&&t("verdocs-button",{size:"small",variant:"outline",label:"Get Link",disabled:s,onClick:function(){return e.getLink(n)}})),o&&t("div",{class:"link-wrapper"},t("div",{class:"link"},o),t("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(o)}}))))}))),(this.canSendAnother||this.canView||this.canDone)&&t("div",{class:"buttons"},this.canSendAnother&&t("verdocs-button",{size:"small",label:"Send Another",onClick:function(n){return e.handleAnother(n)}}),this.canView&&t("verdocs-button",{size:"small",label:"View Now",onClick:function(n){return e.handleView(n)}}),this.canDone&&t("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}());x.style=m}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++){n=arguments[i];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))e[r]=n[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,i,t){function r(e){return e instanceof i?e:new i((function(n){n(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{a(t.next(e))}catch(e){o(e)}}function l(e){try{a(t["throw"](e))}catch(e){o(e)}}function a(e){e.done?i(e.value):r(e.value).then(s,l)}a((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,r,o,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(n){return a([e,n])}}function a(s){if(t)throw new TypeError("Generator is already executing.");while(i)try{if(t=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=n.call(e,i)}catch(e){s=[6,e];r=0}finally{t=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-eaf0b189.system.js","./p-9bf2d124.system.js","./p-9615b087.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-1d60151a.system.js","./p-3af6b910.system.js","./p-8aae8d16.system.js"],(function(e){"use strict";var n,i,t,r,o,s,l,a,c,p,d;return{setters:[function(e){n=e.r;i=e.c;t=e.h;r=e.H},function(){},function(e){o=e.g},function(e){s=e.V},function(e){l=e.g},function(e){a=e.V},function(e){c=e.S},function(e){p=e.g;d=e.r},function(){},function(){}],execute:function(){var u='verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';var f=e("verdocs_envelope_recipient_link",function(){function e(e){n(this,e);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.store=null;this.recipient=null;this.endpoint=s.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.loading=true;this.gettingLink=true;this.link=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r,o,s,a;var p=this;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENT_LINK] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return[2]}s=this;return[4,l(this.endpoint,this.envelopeId,true)];case 1:s.store=d.sent();this.loading=false;this.gettingLink=true;this.recipient=(i=(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients)===null||i===void 0?void 0:i.find((function(e){return e.role_name===p.roleName}));this.getLink(this.recipient);return[3,3];case 2:a=d.sent();console.log("[RECIPIENT_LINK] Error loading envelope",a);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new c(a.message,(r=a.response)===null||r===void 0?void 0:r.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){navigator.clipboard.writeText(e).then((function(){return a("Link copied to clipboard!",{style:"success",duration:3e3})})).catch((function(e){console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);a("Unable to copy to clipboard: ".concat(e.message),{style:"error"})}))};e.prototype.getLink=function(e){var n=this;this.gettingLink=true;o(this.endpoint,e.envelope_id,e.role_name).then((function(e){n.gettingLink=false;n.link=e.link})).catch((function(e){n.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);a("Unable to get link: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;if(this.loading||!this.recipient){return t(r,null)}return t(r,null,t("div",{class:"summary-content"},t("h1",{class:"summary-title"},"In-Person Signing Link"),t("div",{class:"summary-rows"},t("div",{class:"summary-recipient"},t("div",{class:"role-name"},this.recipient.role_name),t("div",{class:"role-details"},t("div",{class:"role-info"},t("div",{class:"role-full-name"},this.recipient.full_name," (",this.recipient.email||this.recipient.phone,")"),!this.link&&t("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:function(){return e.getLink(e.recipient)}})),this.link&&t("div",{class:"link-wrapper"},t("div",{class:"link"},this.link),t("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(e.link)}}))))),t("div",{class:"buttons"},t("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}());f.style=u;var m='verdocs-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-summary .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-summary .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-summary .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}';var x=e("verdocs_envelope_recipient_summary",function(){function e(e){n(this,e);this.another=i(this,"another",7);this.view=i(this,"view",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.store=null;this.endpoint=s.getDefault();this.envelopeId="";this.canSendAnother=true;this.canView=true;this.canDone=true;this.isOpen=undefined;this.loading=true;this.recipientStatusIcons=[];this.containerId="verdocs-status-indicator-".concat(Math.random().toString(36).substring(2,11));this.gettingLinks={};this.links={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENTS] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENTS] Unable to start session, must be authenticated");return[2]}t=this;return[4,l(this.endpoint,this.envelopeId,true)];case 1:t.store=o.sent();this.sortEnvelopeRecipients();this.loading=false;return[3,3];case 2:r=o.sent();console.log("[RECIPIENTS] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.sortEnvelopeRecipients=function(){var e,n;(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients.sort((function(e,n){return e.sequence===n.sequence?e.order-n.order:e.sequence-n.sequence}))};e.prototype.handleAnother=function(e){var n;e.preventDefault();(n=this.another)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleView=function(e){var n;e.preventDefault();(n=this.view)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){var n=this;navigator.clipboard.writeText(e).then((function(){})).catch((function(e){var i;console.warn("[RECIPIENTS] Error copying to clipboard",e);(i=n.sdkError)===null||i===void 0?void 0:i.emit(e)}))};e.prototype.getLink=function(e){var n;var i=this;this.gettingLinks=__assign(__assign({},this.gettingLinks),(n={},n[e.role_name]=true,n));o(this.endpoint,e.envelope_id,e.role_name).then((function(n){var t,r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));i.links=__assign(__assign({},i.links),(r={},r[e.role_name]=n.link,r));i.copyLink(n.link)})).catch((function(n){var t;var r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));console.log("[RECIPIENTS] Error getting link",n);(r=i.sdkError)===null||r===void 0?void 0:r.emit(n)}))};e.prototype.render=function(){var e=this;var n,i;if(this.loading){return t(r,null)}return t(r,null,t("div",{class:"summary-content"},t("h1",{class:"summary-title"},"Recipient Summary"),t("div",{class:"summary-rows"},(((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.recipients)||[]).map((function(n){var i=p(e.store.state);var r=d(n,i);var o=e.links[n.role_name];var s=e.gettingLinks[n.role_name];return t("div",{class:"summary-recipient"},t("div",{class:"role-name"},n.role_name),t("div",{class:"role-details"},t("div",{class:"role-info"},t("div",{class:"role-full-name"},n.full_name," (",n.email||n.phone,")"),r&&!o&&t("verdocs-button",{size:"small",variant:"outline",label:"Get Link",disabled:s,onClick:function(){return e.getLink(n)}})),o&&t("div",{class:"link-wrapper"},t("div",{class:"link"},o),t("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(o)}}))))}))),(this.canSendAnother||this.canView||this.canDone)&&t("div",{class:"buttons"},this.canSendAnother&&t("verdocs-button",{size:"small",label:"Send Another",onClick:function(n){return e.handleAnother(n)}}),this.canView&&t("verdocs-button",{size:"small",label:"View Now",onClick:function(n){return e.handleView(n)}}),this.canDone&&t("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}());x.style=m}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function r(t){try{a(n.next(t))}catch(t){s(t)}}function l(t){try{a(n["throw"](t))}catch(t){s(t)}}function a(t){t.done?i(t.value):o(t.value).then(r,l)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){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:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(t){return function(e){return a([t,e])}}function a(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=e.call(t,i)}catch(t){r=[6,t];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-b0bf091c.system.js","./p-1ba9f457.system.js","./p-2ccbcfeb.system.js","./p-54498887.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(t){"use strict";var e,i,n,o,s,r;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.H},function(t){s=t.g},function(t){r=t.g},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var l='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}';var a='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var d=t("verdocs_field_initial",function(){function t(t){e(this,t);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.templateid="";this.field=null;this.disabled=false;this.initials="";this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.rerender=0;this.tempInitials=""}t.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.handleShow();return[2]}))}))};t.prototype.hideDialog=function(){var t;(t=this.dialog)===null||t===void 0?void 0:t.remove();this.dialog=null};t.prototype.handleAdopt=function(t){var e;console.log("[INITIAL] Adopted initials");this.tempInitials=t.detail;(e=this.fieldChange)===null||e===void 0?void 0:e.emit(this.tempInitials);this.hideDialog()};t.prototype.handleShow=function(){var t=this;this.dialog=document.createElement("verdocs-initial-dialog");this.dialog.setAttribute("initials",this.initials);this.dialog.setAttribute("roleindex",this.roleindex);this.dialog.addEventListener("exit",(function(){return t.hideDialog()}));this.dialog.addEventListener("next",(function(e){return t.handleAdopt(e)}));document.body.append(this.dialog)};t.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(t&&t.showPanel){t.showPanel()}return[2]}))}))};t.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(t&&t.hidePanel){t.hidePanel()}return[2]}))}))};t.prototype.render=function(){var t=this;var e,i,l;var d=r(this.field);var c=d.base64||this.tempInitials;var u=(i=(e=this.disabled)!==null&&e!==void 0?e:d.disabled)!==null&&i!==void 0?i:false;var h=this.field["rgba"]||s(this.roleindex);if(this.done){return n(o,{class:{done:this.done}},c&&n("img",{src:c,alt:"Initials"}))}return n(o,{class:{required:(l=this.field)===null||l===void 0?void 0:l.required,disabled:u},style:{backgroundColor:h}},c?n("img",{src:c,alt:"Initials"}):n("button",{class:{},onClick:function(){return!u&&t.handleShow()}},"Initials"),this.editable&&n("verdocs-button-panel",{icon:a,id:"verdocs-settings-panel-".concat(this.field.name)},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:function(){return t.hideSettingsPanel()},onDelete:function(){var e;(e=t.deleted)===null||e===void 0?void 0:e.emit({fieldName:t.field.name});return t.hideSettingsPanel()},onSettingsChanged:function(e){var i;(i=t.settingsChanged)===null||i===void 0?void 0:i.emit(e.detail);return t.hideSettingsPanel()}})))};return t}());d.style=l}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function r(t){try{a(n.next(t))}catch(t){s(t)}}function l(t){try{a(n["throw"](t))}catch(t){s(t)}}function a(t){t.done?i(t.value):o(t.value).then(r,l)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){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:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(t){return function(e){return a([t,e])}}function a(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=e.call(t,i)}catch(t){r=[6,t];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-840827b7.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(t){"use strict";var e,i,n,o,s,r;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.H},function(t){s=t.g},function(t){r=t.g},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var l='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}';var a='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var d=t("verdocs_field_initial",function(){function t(t){e(this,t);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.templateid="";this.field=null;this.disabled=false;this.initials="";this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.rerender=0;this.tempInitials=""}t.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.handleShow();return[2]}))}))};t.prototype.hideDialog=function(){var t;(t=this.dialog)===null||t===void 0?void 0:t.remove();this.dialog=null};t.prototype.handleAdopt=function(t){var e;console.log("[INITIAL] Adopted initials");this.tempInitials=t.detail;(e=this.fieldChange)===null||e===void 0?void 0:e.emit(this.tempInitials);this.hideDialog()};t.prototype.handleShow=function(){var t=this;this.dialog=document.createElement("verdocs-initial-dialog");this.dialog.setAttribute("initials",this.initials);this.dialog.setAttribute("roleindex",this.roleindex);this.dialog.addEventListener("exit",(function(){return t.hideDialog()}));this.dialog.addEventListener("next",(function(e){return t.handleAdopt(e)}));document.body.append(this.dialog)};t.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(t&&t.showPanel){t.showPanel()}return[2]}))}))};t.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(t&&t.hidePanel){t.hidePanel()}return[2]}))}))};t.prototype.render=function(){var t=this;var e,i,l;var d=r(this.field);var c=d.base64||this.tempInitials;var u=(i=(e=this.disabled)!==null&&e!==void 0?e:d.disabled)!==null&&i!==void 0?i:false;var h=this.field["rgba"]||s(this.roleindex);if(this.done){return n(o,{class:{done:this.done}},c&&n("img",{src:c,alt:"Initials"}))}return n(o,{class:{required:(l=this.field)===null||l===void 0?void 0:l.required,disabled:u},style:{backgroundColor:h}},c?n("img",{src:c,alt:"Initials"}):n("button",{class:{},onClick:function(){return!u&&t.handleShow()}},"Initials"),this.editable&&n("verdocs-button-panel",{icon:a,id:"verdocs-settings-panel-".concat(this.field.name)},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:function(){return t.hideSettingsPanel()},onDelete:function(){var e;(e=t.deleted)===null||e===void 0?void 0:e.emit({fieldName:t.field.name});return t.hideSettingsPanel()},onSettingsChanged:function(e){var i;(i=t.settingsChanged)===null||i===void 0?void 0:i.emit(e.detail);return t.hideSettingsPanel()}})))};return t}());d.style=l}}}));
@@ -1 +1 @@
1
- import{r as t,c as e,h as s,H as i,a as o}from"./p-14b44491.js";import{i as r}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a}from"./p-b101fae2.js";import{u as n}from"./p-feb442b1.js";import{g as d}from"./p-6de76553.js";import{g as l}from"./p-ee159b14.js";import"./p-7d5dbd9a.js";import"./p-5a91bf23.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const h=class{constructor(s){t(this,s),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.endpoint=a.getDefault(),this.templateid="",this.field=null,this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.roleindex=0,this.xscale=1,this.yscale=1,this.rerender=0}async focusField(){this.inputEl.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}componentDidRender(){r.dynamicDrop(!0),this.editable&&r(this.el).resizable({edges:{top:!0,bottom:!0,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={...l(this.field)},[s,i]=t.target.style.transform.split("(")[1].split(")")[0].split(",").map(parseFloat);e.width=Math.round(parseFloat(t.target.style.width)/this.xscale),e.height=Math.round(parseFloat(t.target.style.height)/this.yscale),e.x=Math.round(e.x+s/this.xscale),e.y=Math.round(e.y-i/this.yscale),n(this.endpoint,this.templateid,this.field.name,{setting:e}).then((s=>{var i;null===(i=this.settingsChanged)||void 0===i||i.emit({fieldName:this.field.name,settings:e,field:s}),Object.assign(t.target.dataset,{x:0,y:0,h:0})})).catch((t=>console.log("Field update failed",t)))}render(){var t,e,o,r;const a=l(this.field),n=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:a.disabled)&&void 0!==e&&e,h=(null==a?void 0:a.result)||"",p=this.field.rgba||d(this.roleindex);return this.done?s(i,{class:{done:this.done}},a.value):s(i,{class:{required:null===(o=this.field)||void 0===o?void 0:o.required,disabled:n,done:this.done},style:{backgroundColor:p}},s("textarea",{placeholder:a.placeholder||"",tabIndex:a.order,disabled:n,name:this.field.name,required:null===(r=this.field)||void 0===r?void 0:r.required,ref:t=>this.inputEl=t},h),this.editable&&s("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},s("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:this.field.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()}})))}get el(){return o(this)}};h.style='verdocs-field-textarea{width:150px;height:15px;display:block;font-size:11px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textarea.disabled{opacity:0.5}verdocs-field-textarea textarea{cursor:inherit;width:100%;height:100%;resize:none;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;-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-textarea textarea.hide{display:none}verdocs-field-textarea.required{border:1px solid #cc0000}verdocs-field-textarea.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textarea 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-textarea verdocs-button-panel[data-active],verdocs-field-textarea verdocs-button-panel:hover{opacity:1}verdocs-field-textarea verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textarea verdocs-button-panel .icon:hover svg{fill:#000000}';export{h as verdocs_field_textarea}
1
+ import{r as t,c as e,h as s,H as i,a as o}from"./p-14b44491.js";import{i as r}from"./p-915883e6.js";import"./p-05788c2b.js";import{V as a}from"./p-035f6b38.js";import{u as n}from"./p-feb442b1.js";import{g as d}from"./p-6de76553.js";import{g as l}from"./p-02a71e03.js";import"./p-7d5dbd9a.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const h=class{constructor(s){t(this,s),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.endpoint=a.getDefault(),this.templateid="",this.field=null,this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.roleindex=0,this.xscale=1,this.yscale=1,this.rerender=0}async focusField(){this.inputEl.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}componentDidRender(){r.dynamicDrop(!0),this.editable&&r(this.el).resizable({edges:{top:!0,bottom:!0,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={...l(this.field)},[s,i]=t.target.style.transform.split("(")[1].split(")")[0].split(",").map(parseFloat);e.width=Math.round(parseFloat(t.target.style.width)/this.xscale),e.height=Math.round(parseFloat(t.target.style.height)/this.yscale),e.x=Math.round(e.x+s/this.xscale),e.y=Math.round(e.y-i/this.yscale),n(this.endpoint,this.templateid,this.field.name,{setting:e}).then((s=>{var i;null===(i=this.settingsChanged)||void 0===i||i.emit({fieldName:this.field.name,settings:e,field:s}),Object.assign(t.target.dataset,{x:0,y:0,h:0})})).catch((t=>console.log("Field update failed",t)))}render(){var t,e,o,r;const a=l(this.field),n=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:a.disabled)&&void 0!==e&&e,h=(null==a?void 0:a.result)||"",p=this.field.rgba||d(this.roleindex);return this.done?s(i,{class:{done:this.done}},a.value):s(i,{class:{required:null===(o=this.field)||void 0===o?void 0:o.required,disabled:n,done:this.done},style:{backgroundColor:p}},s("textarea",{placeholder:a.placeholder||"",tabIndex:a.order,disabled:n,name:this.field.name,required:null===(r=this.field)||void 0===r?void 0:r.required,ref:t=>this.inputEl=t},h),this.editable&&s("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},s("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:this.field.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()}})))}get el(){return o(this)}};h.style='verdocs-field-textarea{width:150px;height:15px;display:block;font-size:11px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textarea.disabled{opacity:0.5}verdocs-field-textarea textarea{cursor:inherit;width:100%;height:100%;resize:none;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;-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-textarea textarea.hide{display:none}verdocs-field-textarea.required{border:1px solid #cc0000}verdocs-field-textarea.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textarea 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-textarea verdocs-button-panel[data-active],verdocs-field-textarea verdocs-button-panel:hover{opacity:1}verdocs-field-textarea verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textarea verdocs-button-panel .icon:hover svg{fill:#000000}';export{h as verdocs_field_textarea}