@verdocs/web-sdk 1.13.6 → 1.13.10

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 (348) hide show
  1. package/dist/cjs/Icons-a11fb3fc.js +84 -0
  2. package/dist/cjs/TemplateDocuments-e2e0e6b7.js +93 -0
  3. package/dist/cjs/{TemplateStore-df478971.js → TemplateStore-97e0b3f3.js} +1 -1
  4. package/dist/cjs/{index-67233b76.js → index-5e786db9.js} +10 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/verdocs-auth.cjs.entry.js +2 -2
  7. package/dist/cjs/verdocs-build.cjs.entry.js +5 -7
  8. package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +2 -2
  9. package/dist/cjs/verdocs-button.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-field-signature.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +56 -0
  26. package/dist/cjs/verdocs-floating-menu.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-loader.cjs.entry.js +1 -1
  30. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +2 -2
  31. package/dist/cjs/verdocs-organization-card.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-preview.cjs.entry.js +2 -2
  33. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
  35. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  37. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  38. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +1 -1
  40. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +1 -1
  41. package/dist/cjs/{verdocs-template-create_3.cjs.entry.js → verdocs-template-attachments_4.cjs.entry.js} +161 -22
  42. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  43. package/dist/cjs/verdocs-template-document-page.cjs.entry.js +3 -53
  44. package/dist/cjs/verdocs-template-name.cjs.entry.js +3 -3
  45. package/dist/cjs/verdocs-template-properties.cjs.entry.js +3 -3
  46. package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -2
  47. package/dist/cjs/verdocs-template-role-properties_2.cjs.entry.js +20 -17
  48. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  49. package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
  50. package/dist/cjs/verdocs-toggle-button.cjs.entry.js +1 -1
  51. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  52. package/dist/cjs/verdocs-toolbar-icon.cjs.entry.js +1 -1
  53. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +1 -1
  54. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  55. package/dist/cjs/verdocs-web-sdk.cjs.js +2 -2
  56. package/dist/collection/collection-manifest.json +1 -0
  57. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.css +27 -0
  58. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.js +93 -0
  59. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.stories.js +10 -0
  60. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -1
  61. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +4 -3
  62. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +22 -8
  63. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.css +91 -5
  64. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.js +140 -10
  65. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.stories.js +2 -3
  66. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
  67. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.stories.js +2 -3
  68. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +14 -13
  69. package/dist/collection/components/templates/verdocs-template-name/verdocs-template-name.css +0 -40
  70. package/dist/collection/components/templates/verdocs-template-name/verdocs-template-name.stories.js +1 -2
  71. package/dist/collection/components/templates/verdocs-template-properties/verdocs-template-properties.js +1 -1
  72. package/dist/collection/components/templates/verdocs-template-properties/verdocs-template-properties.stories.js +1 -1
  73. package/dist/collection/components/templates/verdocs-template-reminders/verdocs-template-reminders.stories.js +1 -2
  74. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +18 -15
  75. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +7 -4
  76. package/dist/collection/utils/Icons.js +73 -0
  77. package/dist/components/Primitives.js +20 -0
  78. package/dist/components/TemplateDocuments.js +89 -0
  79. package/dist/components/index.d.ts +1 -0
  80. package/dist/components/index.js +1 -0
  81. package/dist/components/verdocs-auth.js +1 -1
  82. package/dist/components/verdocs-build.js +38 -23
  83. package/dist/components/verdocs-file-chooser.d.ts +11 -0
  84. package/dist/components/verdocs-file-chooser.js +6 -0
  85. package/dist/components/verdocs-file-chooser2.js +132 -0
  86. package/dist/components/verdocs-ok-dialog2.js +1 -1
  87. package/dist/components/verdocs-sign.js +2 -1
  88. package/dist/components/verdocs-template-attachments.js +1 -87
  89. package/dist/components/verdocs-template-attachments2.js +200 -0
  90. package/dist/components/verdocs-template-create2.js +2 -2
  91. package/dist/components/verdocs-template-document-page2.js +1 -51
  92. package/dist/components/verdocs-template-fields2.js +14 -13
  93. package/dist/components/verdocs-template-name.js +1 -1
  94. package/dist/components/verdocs-template-properties.js +1 -1
  95. package/dist/components/verdocs-template-role-properties2.js +18 -15
  96. package/dist/components/verdocs-template-roles2.js +7 -4
  97. package/dist/components/verdocs-view2.js +2 -20
  98. package/dist/docs.json +171 -8
  99. package/dist/esm/Icons-c29eb0fa.js +75 -0
  100. package/dist/esm/TemplateDocuments-6fd2f4e2.js +89 -0
  101. package/dist/esm/{TemplateStore-373c72a8.js → TemplateStore-17fa95d5.js} +1 -1
  102. package/dist/esm/{index-5260ed60.js → index-9ee0ca9f.js} +10 -0
  103. package/dist/esm/loader.js +2 -2
  104. package/dist/esm/verdocs-auth.entry.js +2 -2
  105. package/dist/esm/verdocs-build.entry.js +5 -7
  106. package/dist/esm/verdocs-button-panel_3.entry.js +2 -2
  107. package/dist/esm/verdocs-button.entry.js +1 -1
  108. package/dist/esm/verdocs-checkbox_4.entry.js +1 -1
  109. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  110. package/dist/esm/verdocs-dropdown_2.entry.js +1 -1
  111. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
  112. package/dist/esm/verdocs-field-attachment.entry.js +1 -1
  113. package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
  114. package/dist/esm/verdocs-field-date.entry.js +1 -1
  115. package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
  116. package/dist/esm/verdocs-field-initial.entry.js +1 -1
  117. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  118. package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
  119. package/dist/esm/verdocs-field-signature.entry.js +1 -1
  120. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  121. package/dist/esm/verdocs-field-textbox.entry.js +1 -1
  122. package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
  123. package/dist/esm/verdocs-file-chooser_2.entry.js +51 -0
  124. package/dist/esm/verdocs-floating-menu.entry.js +1 -1
  125. package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
  126. package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
  127. package/dist/esm/verdocs-loader.entry.js +1 -1
  128. package/dist/esm/verdocs-ok-dialog.entry.js +2 -2
  129. package/dist/esm/verdocs-organization-card.entry.js +1 -1
  130. package/dist/esm/verdocs-preview.entry.js +2 -2
  131. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  132. package/dist/esm/verdocs-radio-button.entry.js +1 -1
  133. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  134. package/dist/esm/verdocs-search.entry.js +1 -1
  135. package/dist/esm/verdocs-send.entry.js +2 -2
  136. package/dist/esm/verdocs-sign.entry.js +1 -1
  137. package/dist/esm/verdocs-signature-dialog.entry.js +1 -1
  138. package/dist/esm/verdocs-status-indicator.entry.js +1 -1
  139. package/dist/esm/{verdocs-template-create_3.entry.js → verdocs-template-attachments_4.entry.js} +161 -23
  140. package/dist/esm/verdocs-template-card.entry.js +1 -1
  141. package/dist/esm/verdocs-template-document-page.entry.js +2 -52
  142. package/dist/esm/verdocs-template-name.entry.js +3 -3
  143. package/dist/esm/verdocs-template-properties.entry.js +3 -3
  144. package/dist/esm/verdocs-template-reminders.entry.js +2 -2
  145. package/dist/esm/verdocs-template-role-properties_2.entry.js +20 -17
  146. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  147. package/dist/esm/verdocs-template-visibility.entry.js +2 -2
  148. package/dist/esm/verdocs-toggle-button.entry.js +1 -1
  149. package/dist/esm/verdocs-toggle.entry.js +1 -1
  150. package/dist/esm/verdocs-toolbar-icon.entry.js +1 -1
  151. package/dist/esm/verdocs-upload-dialog.entry.js +1 -1
  152. package/dist/esm/verdocs-view.entry.js +1 -1
  153. package/dist/esm/verdocs-web-sdk.js +2 -2
  154. package/dist/esm-es5/Icons-c29eb0fa.js +1 -0
  155. package/dist/esm-es5/TemplateDocuments-6fd2f4e2.js +1 -0
  156. package/dist/esm-es5/{TemplateStore-373c72a8.js → TemplateStore-17fa95d5.js} +1 -1
  157. package/dist/esm-es5/{index-5260ed60.js → index-9ee0ca9f.js} +1 -1
  158. package/dist/esm-es5/loader.js +1 -1
  159. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  160. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  161. package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
  162. package/dist/esm-es5/verdocs-button.entry.js +1 -1
  163. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -1
  164. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  165. package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
  166. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  167. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  168. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  169. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  170. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  171. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  172. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  173. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  174. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  175. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  176. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  177. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  178. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -0
  179. package/dist/esm-es5/verdocs-floating-menu.entry.js +1 -1
  180. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  181. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  182. package/dist/esm-es5/verdocs-loader.entry.js +1 -1
  183. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  184. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
  185. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  186. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  187. package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
  188. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  189. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  190. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  191. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  192. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  193. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  194. package/dist/esm-es5/verdocs-template-attachments_4.entry.js +1 -0
  195. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  196. package/dist/esm-es5/verdocs-template-document-page.entry.js +1 -1
  197. package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
  198. package/dist/esm-es5/verdocs-template-properties.entry.js +1 -1
  199. package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
  200. package/dist/esm-es5/verdocs-template-role-properties_2.entry.js +1 -1
  201. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  202. package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
  203. package/dist/esm-es5/verdocs-toggle-button.entry.js +1 -1
  204. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  205. package/dist/esm-es5/verdocs-toolbar-icon.entry.js +1 -1
  206. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
  207. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  208. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  209. package/dist/types/components/controls/verdocs-file-chooser/verdocs-file-chooser.d.ts +23 -0
  210. package/dist/types/components/controls/verdocs-file-chooser/verdocs-file-chooser.stories.d.ts +6 -0
  211. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +3 -2
  212. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +8 -5
  213. package/dist/types/components/templates/verdocs-template-attachments/verdocs-template-attachments.d.ts +27 -2
  214. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +2 -2
  215. package/dist/types/components.d.ts +49 -4
  216. package/dist/types/utils/Icons.d.ts +8 -0
  217. package/dist/verdocs-web-sdk/p-01a240ac.system.js +1 -0
  218. package/dist/verdocs-web-sdk/{p-527f15bb.system.entry.js → p-056bec65.system.entry.js} +1 -1
  219. package/dist/verdocs-web-sdk/{p-1fc2dcb7.entry.js → p-07715513.entry.js} +1 -1
  220. package/dist/verdocs-web-sdk/{p-d4f2c4cd.entry.js → p-09382df0.entry.js} +1 -1
  221. package/dist/verdocs-web-sdk/{p-ad6e9a9a.system.entry.js → p-09f756a2.system.entry.js} +1 -1
  222. package/dist/verdocs-web-sdk/p-1025430e.entry.js +1 -0
  223. package/dist/verdocs-web-sdk/{p-614368ee.system.entry.js → p-116c6981.system.entry.js} +1 -1
  224. package/dist/verdocs-web-sdk/{p-499022e8.entry.js → p-12aac44a.entry.js} +1 -1
  225. package/dist/verdocs-web-sdk/{p-42fa6b2f.entry.js → p-13f80bb2.entry.js} +1 -1
  226. package/dist/verdocs-web-sdk/{p-d595eba2.system.entry.js → p-149f9430.system.entry.js} +1 -1
  227. package/dist/verdocs-web-sdk/p-1738fd08.entry.js +1 -0
  228. package/dist/verdocs-web-sdk/{p-6b693508.system.entry.js → p-18658f1f.system.entry.js} +1 -1
  229. package/dist/verdocs-web-sdk/{p-7464fd3c.system.entry.js → p-1900bbbb.system.entry.js} +1 -1
  230. package/dist/verdocs-web-sdk/{p-d1f80bd5.entry.js → p-1a666173.entry.js} +1 -1
  231. package/dist/verdocs-web-sdk/{p-2287f1bc.system.entry.js → p-237975c0.system.entry.js} +1 -1
  232. package/dist/verdocs-web-sdk/{p-3ca6f68d.entry.js → p-263acb59.entry.js} +1 -1
  233. package/dist/verdocs-web-sdk/{p-5e3893ec.system.entry.js → p-26801979.system.entry.js} +1 -1
  234. package/dist/verdocs-web-sdk/{p-16f3cd2d.system.entry.js → p-27c96690.system.entry.js} +1 -1
  235. package/dist/verdocs-web-sdk/{p-07dac8d8.entry.js → p-29f2dfc9.entry.js} +1 -1
  236. package/dist/verdocs-web-sdk/{p-0464731b.system.entry.js → p-2d31b931.system.entry.js} +1 -1
  237. package/dist/verdocs-web-sdk/{p-798c0134.system.entry.js → p-2d36f297.system.entry.js} +1 -1
  238. package/dist/verdocs-web-sdk/{p-e59061aa.system.entry.js → p-2d40f2ba.system.entry.js} +1 -1
  239. package/dist/verdocs-web-sdk/{p-77a2ec7e.entry.js → p-2d73b96f.entry.js} +1 -1
  240. package/dist/verdocs-web-sdk/{p-1edbfaf5.entry.js → p-2e1b6646.entry.js} +1 -1
  241. package/dist/verdocs-web-sdk/p-2fa6de11.system.entry.js +1 -0
  242. package/dist/verdocs-web-sdk/p-3186b008.system.entry.js +1 -0
  243. package/dist/verdocs-web-sdk/p-32547cde.entry.js +1 -0
  244. package/dist/verdocs-web-sdk/{p-ebce4300.entry.js → p-385c9366.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/{p-71a1576a.system.entry.js → p-3d521eb4.system.entry.js} +1 -1
  246. package/dist/verdocs-web-sdk/{p-97be89cf.entry.js → p-3fa5ce6b.entry.js} +1 -1
  247. package/dist/verdocs-web-sdk/{p-1c75e276.entry.js → p-452d6537.entry.js} +1 -1
  248. package/dist/verdocs-web-sdk/p-455d16dc.system.js +1 -0
  249. package/dist/verdocs-web-sdk/{p-f201e410.system.entry.js → p-4b7996e8.system.entry.js} +1 -1
  250. package/dist/verdocs-web-sdk/{p-ac61df73.system.entry.js → p-4fdf4196.system.entry.js} +1 -1
  251. package/dist/verdocs-web-sdk/{p-603db817.entry.js → p-4ff16721.entry.js} +1 -1
  252. package/dist/verdocs-web-sdk/{p-d714a804.system.entry.js → p-5544bdd4.system.entry.js} +1 -1
  253. package/dist/verdocs-web-sdk/{p-068e6212.entry.js → p-55a13b01.entry.js} +1 -1
  254. package/dist/verdocs-web-sdk/p-567a6e7c.js +1 -0
  255. package/dist/verdocs-web-sdk/{p-2fc46a8b.js → p-59a88b20.js} +1 -1
  256. package/dist/verdocs-web-sdk/{p-a5970648.system.entry.js → p-5a851a3b.system.entry.js} +1 -1
  257. package/dist/verdocs-web-sdk/{p-895ca90d.system.entry.js → p-5d755377.system.entry.js} +1 -1
  258. package/dist/verdocs-web-sdk/{p-da129971.entry.js → p-5e292135.entry.js} +1 -1
  259. package/dist/verdocs-web-sdk/p-637fee9b.js +1 -0
  260. package/dist/verdocs-web-sdk/{p-82854066.entry.js → p-63d89af6.entry.js} +1 -1
  261. package/dist/verdocs-web-sdk/{p-34eb8a38.entry.js → p-681c7361.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-438a5bfb.system.entry.js → p-6a26b4fd.system.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/{p-db2b75bc.system.entry.js → p-6b3dd926.system.entry.js} +1 -1
  264. package/dist/verdocs-web-sdk/{p-21ad4745.entry.js → p-6c12d567.entry.js} +1 -1
  265. package/dist/verdocs-web-sdk/{p-7ba0c530.system.entry.js → p-6c1817fa.system.entry.js} +1 -1
  266. package/dist/verdocs-web-sdk/p-6e9af353.system.js +1 -0
  267. package/dist/verdocs-web-sdk/{p-78f732f3.system.entry.js → p-71de1985.system.entry.js} +1 -1
  268. package/dist/verdocs-web-sdk/{p-6ea848fe.system.entry.js → p-73875e21.system.entry.js} +1 -1
  269. package/dist/verdocs-web-sdk/{p-a5f3f29c.entry.js → p-73b44d44.entry.js} +1 -1
  270. package/dist/verdocs-web-sdk/{p-e9751ec7.entry.js → p-7416b77f.entry.js} +1 -1
  271. package/dist/verdocs-web-sdk/{p-658c3ab7.entry.js → p-7500179f.entry.js} +1 -1
  272. package/dist/verdocs-web-sdk/{p-fc67ddc9.entry.js → p-753cdc95.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/{p-756d5c24.entry.js → p-7aeb1f15.entry.js} +1 -1
  274. package/dist/verdocs-web-sdk/{p-66c74103.system.js → p-7b2ca8ef.system.js} +1 -1
  275. package/dist/verdocs-web-sdk/{p-d643db3b.entry.js → p-7ef23636.entry.js} +1 -1
  276. package/dist/verdocs-web-sdk/{p-809947d4.system.entry.js → p-8ac409c5.system.entry.js} +1 -1
  277. package/dist/verdocs-web-sdk/{p-0f065d24.system.entry.js → p-8c8960a3.system.entry.js} +1 -1
  278. package/dist/verdocs-web-sdk/{p-227d07a2.entry.js → p-8d998322.entry.js} +1 -1
  279. package/dist/verdocs-web-sdk/{p-e352d3f8.system.entry.js → p-8ebf7d74.system.entry.js} +1 -1
  280. package/dist/verdocs-web-sdk/{p-37dd3108.system.entry.js → p-9258d861.system.entry.js} +1 -1
  281. package/dist/verdocs-web-sdk/{p-eff8b358.entry.js → p-944996b2.entry.js} +1 -1
  282. package/dist/verdocs-web-sdk/p-95119614.system.entry.js +1 -0
  283. package/dist/verdocs-web-sdk/{p-f0d1c6bd.system.entry.js → p-9a4124dd.system.entry.js} +1 -1
  284. package/dist/verdocs-web-sdk/p-9bafdd9f.entry.js +1 -0
  285. package/dist/verdocs-web-sdk/{p-07d80297.entry.js → p-a490803a.entry.js} +1 -1
  286. package/dist/verdocs-web-sdk/{p-137664e4.system.entry.js → p-a6da9fa8.system.entry.js} +1 -1
  287. package/dist/verdocs-web-sdk/{p-60548c5f.entry.js → p-a75f3b9a.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/{p-f2f3583f.system.entry.js → p-a77f4093.system.entry.js} +1 -1
  289. package/dist/verdocs-web-sdk/{p-1db79af9.system.entry.js → p-a9e063bc.system.entry.js} +1 -1
  290. package/dist/verdocs-web-sdk/{p-1e782b9d.entry.js → p-aabfb02a.entry.js} +1 -1
  291. package/dist/verdocs-web-sdk/p-acb5e932.entry.js +1 -0
  292. package/dist/verdocs-web-sdk/{p-87f428fb.entry.js → p-ad7caefa.entry.js} +1 -1
  293. package/dist/verdocs-web-sdk/{p-1ea3753f.system.entry.js → p-adb73796.system.entry.js} +1 -1
  294. package/dist/verdocs-web-sdk/{p-a8003a10.system.entry.js → p-b2cb8889.system.entry.js} +1 -1
  295. package/dist/verdocs-web-sdk/{p-d936d293.system.entry.js → p-b3c3b7e8.system.entry.js} +1 -1
  296. package/dist/verdocs-web-sdk/{p-e035df4b.js → p-b3dfe499.js} +2 -2
  297. package/dist/verdocs-web-sdk/{p-c2b91d4d.system.entry.js → p-bc7c1b67.system.entry.js} +1 -1
  298. package/dist/verdocs-web-sdk/{p-920fd6d9.system.entry.js → p-be05977e.system.entry.js} +1 -1
  299. package/dist/verdocs-web-sdk/{p-9cbe4bc7.system.entry.js → p-c42b7ca2.system.entry.js} +1 -1
  300. package/dist/verdocs-web-sdk/{p-a3282274.system.entry.js → p-c45ee88f.system.entry.js} +1 -1
  301. package/dist/verdocs-web-sdk/{p-ab6bd525.entry.js → p-c54d05db.entry.js} +1 -1
  302. package/dist/verdocs-web-sdk/{p-47bba747.entry.js → p-c5fb045c.entry.js} +1 -1
  303. package/dist/verdocs-web-sdk/{p-e16ad8fe.entry.js → p-c6547da0.entry.js} +1 -1
  304. package/dist/verdocs-web-sdk/{p-3ef23762.system.entry.js → p-c8a56083.system.entry.js} +1 -1
  305. package/dist/verdocs-web-sdk/{p-60b59333.system.entry.js → p-df691d95.system.entry.js} +1 -1
  306. package/dist/verdocs-web-sdk/p-e312fbab.entry.js +1 -0
  307. package/dist/verdocs-web-sdk/{p-9b9c0ae7.entry.js → p-e5fda62a.entry.js} +1 -1
  308. package/dist/verdocs-web-sdk/{p-0714e785.entry.js → p-e78b7f2f.entry.js} +1 -1
  309. package/dist/verdocs-web-sdk/p-ec7fc148.system.entry.js +1 -0
  310. package/dist/verdocs-web-sdk/{p-bd8ff2a6.entry.js → p-ed3d86cd.entry.js} +1 -1
  311. package/dist/verdocs-web-sdk/{p-86e507c1.entry.js → p-ed6bc1ce.entry.js} +1 -1
  312. package/dist/verdocs-web-sdk/{p-9c36aaaa.entry.js → p-ed6c5982.entry.js} +1 -1
  313. package/dist/verdocs-web-sdk/p-f1350ea7.system.entry.js +1 -0
  314. package/dist/verdocs-web-sdk/{p-e9c9cdf5.entry.js → p-f1a773bf.entry.js} +1 -1
  315. package/dist/verdocs-web-sdk/p-f1c98c73.system.entry.js +1 -0
  316. package/dist/verdocs-web-sdk/{p-ec6c0c40.system.entry.js → p-f23e0059.system.entry.js} +1 -1
  317. package/dist/verdocs-web-sdk/{p-8a84234f.entry.js → p-f6306a21.entry.js} +1 -1
  318. package/dist/verdocs-web-sdk/{p-7f13e92e.entry.js → p-f63b71ae.entry.js} +1 -1
  319. package/dist/verdocs-web-sdk/{p-a5a530fa.entry.js → p-f71a30f6.entry.js} +1 -1
  320. package/dist/verdocs-web-sdk/{p-6f511c7b.entry.js → p-fa0123d2.entry.js} +1 -1
  321. package/dist/verdocs-web-sdk/{p-56bea00a.system.entry.js → p-fbee0760.system.entry.js} +1 -1
  322. package/dist/verdocs-web-sdk/{p-aa3e3ffc.system.entry.js → p-fc64e091.system.entry.js} +1 -1
  323. package/dist/verdocs-web-sdk/{p-871407e9.system.js → p-fd374620.system.js} +1 -1
  324. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  325. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  326. package/package.json +2 -2
  327. package/dist/cjs/verdocs-progress-bar.cjs.entry.js +0 -23
  328. package/dist/cjs/verdocs-template-attachments.cjs.entry.js +0 -64
  329. package/dist/esm/verdocs-progress-bar.entry.js +0 -19
  330. package/dist/esm/verdocs-template-attachments.entry.js +0 -60
  331. package/dist/esm-es5/verdocs-progress-bar.entry.js +0 -1
  332. package/dist/esm-es5/verdocs-template-attachments.entry.js +0 -1
  333. package/dist/esm-es5/verdocs-template-create_3.entry.js +0 -1
  334. package/dist/verdocs-web-sdk/p-126c0301.system.entry.js +0 -1
  335. package/dist/verdocs-web-sdk/p-2413519c.system.entry.js +0 -1
  336. package/dist/verdocs-web-sdk/p-27332125.entry.js +0 -1
  337. package/dist/verdocs-web-sdk/p-5bb80e03.system.entry.js +0 -1
  338. package/dist/verdocs-web-sdk/p-6caf1137.system.js +0 -1
  339. package/dist/verdocs-web-sdk/p-7e8fe43e.entry.js +0 -1
  340. package/dist/verdocs-web-sdk/p-82512045.system.entry.js +0 -1
  341. package/dist/verdocs-web-sdk/p-879e9572.entry.js +0 -1
  342. package/dist/verdocs-web-sdk/p-91f062a8.entry.js +0 -1
  343. package/dist/verdocs-web-sdk/p-ba591e02.entry.js +0 -1
  344. package/dist/verdocs-web-sdk/p-bcc9c2d8.entry.js +0 -1
  345. package/dist/verdocs-web-sdk/p-bd35fd77.system.entry.js +0 -1
  346. package/dist/verdocs-web-sdk/p-c9ff6acb.system.entry.js +0 -1
  347. package/dist/verdocs-web-sdk/p-d28acca1.entry.js +0 -1
  348. package/dist/verdocs-web-sdk/p-d67b2a26.system.entry.js +0 -1
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function n(e){try{l(r["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):i(e.value).then(a,n)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,i&&(s=a[0]&2?i["return"]:a[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;if(i=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;i=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];i=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++){if(s||!(r in t)){if(!s)s=Array.prototype.slice.call(t,0,r);s[r]=t[r]}}return e.concat(s||Array.prototype.slice.call(t))};var _h;import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,a as getElement}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{c as createTemplateDocument,d as deleteTemplateDocument}from"./TemplateDocuments-6fd2f4e2.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-4367eb13.js";import{D as DocIcon,P as PngIcon,J as JpgIcon,a as PdfIcon,F as FileIcon$1,b as PageCountIcon,T as TrashIcon}from"./Icons-c29eb0fa.js";import{g as getTemplateStore,a as getRoleNames}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";import{c as createTemplate}from"./Templates-67172396.js";import{i as interact}from"./interact.min-cf83fa88.js";import{u as updateField,c as createField}from"./Fields-c82e6df3.js";import{i as integerSequence}from"./Primitives-054bc6e5.js";import{a as getRoleIndex,r as renderDocumentField,c as updateCssTransform,d as defaultWidth,e as defaultHeight}from"./utils-78a752e0.js";import{u as updateRole,c as createRole}from"./Roles-6eb459df.js";import{g as getRGBA}from"./Colors-1b298092.js";import"./_commonjsHelpers-5ec8f9b7.js";import"./Envelopes-921cd9d0.js";import"./Files-70a192df.js";import"./index-d264c496.js";var verdocsTemplateAttachmentsCss='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-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;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var VerdocsTemplateAttachments=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.templateUpdate=createEvent(this,"templateUpdate",7);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=s.sent();return[3,3];case 2:i=s.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,r,i,s,a,n;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();i=e.detail.file;if(!i){return[2]}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,4,,5]);return[4,createTemplateDocument(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this))];case 2:s=l.sent();console.log("[ATTACHMENTS] Created attachment",s);a=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 3:a.store=l.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:n=l.sent();console.log("[ATTACHMENTS] Error creating template",n);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,deleteTemplateDocument(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return PdfIcon;case"image/jpeg":return JpgIcon;case"image/png":return PngIcon;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return DocIcon}return FileIcon$1};e.prototype.render=function(){var e=this;var t,o,r;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=(t=this.store)===null||t===void 0?void 0:t.state;if(!i.isLoaded){return h(Host,{class:"loading"},h("verdocs-loader",null))}if(!this.endpoint.session||!i.profile_id){return h(Host,{class:"empty"})}return h(Host,null,h("h5",null,"Existing Attachments"),h("div",{class:"attachments"},(o=this.store)===null||o===void 0?void 0:o.state.template_documents.map((function(t){return h("div",{class:"attachment"},h("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),h("div",{class:"filename",title:t.name},t.name),h("div",{class:"pages"},h("div",{class:"count"},t.page_numbers),h("div",{class:"pages-icon",innerHTML:PageCountIcon})),h("div",{class:"trash-icon",innerHTML:TrashIcon,onClick:function(){return e.handleDelete(t)}}))}))),h("h5",null,"Attach a New Document"),this.uploading?h("div",{class:"loader-wrapper"},h("verdocs-loader",null),this.progressLabel&&h("div",{class:"progress-wrapper"},h("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):h("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),h("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((r=this.store)===null||r===void 0?void 0:r.state.template_documents.length)||this.uploading})),this.showDeleteError&&h("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&h("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}();VerdocsTemplateAttachments.style=verdocsTemplateAttachmentsCss;var verdocsTemplateCreateCss='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var unicodeNBSP=" ";var FileIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var VerdocsTemplateCreate=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,r,i,s,a;var n=this;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,3,,4]);return[4,createTemplate(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){n.progressLabel="Processing...";n.progressPercent=100}else{n.progressPercent=e}}))];case 2:s=l.sent();console.log("[CREATE] Created template",s);(t=this.next)===null||t===void 0?void 0:t.emit(s);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,4];case 3:a=l.sent();console.log("[CREATE] Error creating template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(a.message,(r=a.response)===null||r===void 0?void 0:r.status,(i=a.response)===null||i===void 0?void 0:i.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?h("div",{class:"loader-wrapper"},h("verdocs-loader",null),this.progressLabel&&h("div",{class:"progress-wrapper"},h("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):h("div",{class:"upload-box"},h("div",null,h("span",{innerHTML:FileIcon})),h("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),h("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?unicodeNBSP:"Or, if you prefer..."),h("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),h("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}();VerdocsTemplateCreate.style=verdocsTemplateCreateCss;var verdocsTemplateFieldsCss="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}";var iconTextbox='<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>';var iconTextarea='<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>';var iconCheck='<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>';var iconRadio='<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>';var iconDatepicker='<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>';var iconSignature='<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>';var iconInitial='<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>';var iconTimestamp='<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>';var iconDropdown='<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>';var separator='<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>';var menuOptions=[{id:"signature",tooltip:"Signature",icon:iconSignature},{id:"initial",tooltip:"Initials",icon:iconInitial},{id:"sep1",tooltip:"",icon:separator},{id:"textbox",tooltip:"Text Box",icon:iconTextbox},{id:"textarea",tooltip:"Text Area",icon:iconTextarea},{id:"checkbox_group",tooltip:"Check Box",icon:iconCheck},{id:"radio_button_group",tooltip:"Radio Button",icon:iconRadio},{id:"dropdown",tooltip:"Dropdown",icon:iconDropdown},{id:"sep2",tooltip:"",icon:separator},{id:"date",tooltip:"Date",icon:iconDatepicker},{id:"timestamp",tooltip:"Timestamp",icon:iconTimestamp}];var VerdocsTemplateFields=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.pageHeights={};this.store=null;this.cachedPageInfo={};this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.selectedRoleName="";this.rerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i,s,a,n,l;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:n.store=d.sent();console.log("[FIELDS] Loaded template ".concat(this.templateId),this.store.state);this.selectedRoleName=((r=(o=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.name)||"";console.log("[FIELDS] Starting with role",this.selectedRoleName);return[3,3];case 2:l=d.sent();console.log("[FIELDS] Error with preview session",l);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(l.message,(s=l.response)===null||s===void 0?void 0:s.status,(a=l.response)===null||a===void 0?void 0:a.data));return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidRender=function(){interact.dynamicDrop(true);var e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){console.log("[FIELDS] Moving toolbar");t.remove();e.append(t)}};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.handleFieldChange=function(e,t,o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){console.log("[FIELDS] handleFieldChange",e,t,o);this.rerender++;return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,o,r){var i=this;r.addEventListener("input",(function(e){return i.handleFieldChange(t,e)}));r.addEventListener("settingsChanged",(function(){var s,a,n,l;i.selectedRoleName=t.role_name;console.log("settings changed",i.selectedRoleName,t);r.setAttribute("roleindex",getRoleIndex(getRoleNames(i.store),t.role_name));r.field=(a=(s=i.store)===null||s===void 0?void 0:s.state)===null||a===void 0?void 0:a.fields.find((function(e){return e.name===t.name}));i.rerender++;r.setAttribute("rerender",i.rerender);(n=i.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:i.endpoint,template:(l=i.store)===null||l===void 0?void 0:l.state,event:"updated-field"});console.log("Re-rendering field",t.name,e.pageNumber);i.reRenderField(t,e.pageNumber);var d=renderDocumentField(t,e,o,{disabled:true,editable:true,draggable:true});if(!d){return}}));r.addEventListener("deleted",(function(){var e,o;console.log("deleted",i,t);r.remove();i.rerender++;(e=i.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:i.endpoint,template:(o=i.store)===null||o===void 0?void 0:o.state,event:"updated-field"})}));r.setAttribute("templateid",this.templateId);r.setAttribute("roleindex",o);r.setAttribute("pageNumber",e.pageNumber);r.setAttribute("xScale",e.xScale);r.setAttribute("yScale",e.yScale);r.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var o;var r=e.detail;console.log("[FIELDS] Page rendered",r.pageNumber,r);this.cachedPageInfo[r.pageNumber]=r;this.pageHeights[r.pageNumber]=r.naturalHeight;var i=(o=this.store)===null||o===void 0?void 0:o.state.fields.filter((function(e){return e.page_sequence===r.pageNumber}));i.forEach((function(e){return t.reRenderField(e,r.pageNumber)}))};e.prototype.reRenderField=function(e,t){var o=this;var r=this.cachedPageInfo[t];var i=getRoleIndex(getRoleNames(this.store),e.role_name);var s=renderDocumentField(e,r,i,{disabled:true,editable:true,draggable:true});if(!s){return}if(Array.isArray(s)){s.forEach((function(t){o.attachFieldAttributes(r,e,i,t);interact(t).draggable({listeners:{start:function(e){console.log("[FIELDS] Drag started",e.type,e.target)},move:function(e){var t=+(e.target.getAttribute("posX")||0);var o=+(e.target.getAttribute("posY")||0);var r=+(e.target.getAttribute("xScale")||1);var i=+(e.target.getAttribute("yScale")||1);var s=e.dx/r+t;var a=e.dy/i+o;e.target.setAttribute("posX",s);e.target.setAttribute("posy",a);updateCssTransform(e.target,"translate","".concat(s,"px, ").concat(a,"px"))},end:o.handleMoveField.bind(o)}})}))}else{this.attachFieldAttributes(r,e,i,s);interact(s).draggable({listeners:{start:function(e){console.log("[FIELDS] Drag started",e.type,e.target)},move:function(e){var t=+(e.target.getAttribute("posX")||0);var o=+(e.target.getAttribute("posY")||0);var r=+(e.target.getAttribute("xScale")||1);var i=+(e.target.getAttribute("yScale")||1);var s=e.dx/r+t;var a=e.dy/i+o;e.target.setAttribute("posX",s);e.target.setAttribute("posy",a);updateCssTransform(e.target,"translate","".concat(s,"px, ").concat(a,"px"))},end:this.handleMoveField.bind(this)}})}};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,r,i,s,a,n,l,d,c,p,h,u,m,g,v,f,x,b,w,y;return __generator(this,(function(E){switch(E.label){case 0:o=e.target.getAttribute("pageNumber");r=this.cachedPageInfo[o],i=r.naturalWidth,s=i===void 0?612:i,a=r.naturalHeight,n=a===void 0?792:a,l=r.renderedHeight,d=l===void 0?792:l;console.log("[FIELDS] Drag ended",o,e.target);c=e.target.getBoundingClientRect();p=e.target.parentElement;h=p.getBoundingClientRect();u=Math.max(c.left-h.left,0);m=Math.max(d-(h.bottom-c.bottom),0);g=this.viewCoordinatesToPageCoordinates(u,m,o,s-e.rect.width,n-e.rect.height),v=g.x,f=g.y;x=e.target.getAttribute("name");b=+(e.target.getAttribute("option")||"0");w=(t=this.store)===null||t===void 0?void 0:t.state.fields.find((function(e){return e.name===x}));console.log("Will update",x,b,w);if(!w)return[3,2];switch(w.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":w.setting.x=v;w.setting.y=f;break;case"checkbox_group":case"radio_button_group":{y=w.setting.options[b];if(y){y.x=v;y.y=f}}break}return[4,updateField(this.endpoint,this.templateId,x,w)];case 1:E.sent();this.handlePageRendered({detail:this.cachedPageInfo[o]});E.label=2;case 2:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var o,r;var i=1;var s;do{s="".concat(e,"P").concat(t,"-").concat(i);console.log("testing field",s);i++}while((o=this.store)===null||o===void 0?void 0:o.state.fields.some((function(e){return e.name===s})));console.log("Will use field name",s,(r=this.store)===null||r===void 0?void 0:r.state.fields);return s};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,o,r,i){var s=this.cachedPageInfo[o],a=s.xScale,n=a===void 0?1:a,l=s.yScale,d=l===void 0?1:l,c=s.renderedHeight,p=c===void 0?792:c;var h=Math.floor(Math.min(e/n,r));var u=Math.floor(Math.min(Math.max(p-t,0)/d,i));return{x:h,y:u}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,r,i,s,a,n,l,d,c,p,h,u,m,g,v,f,x;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];console.log("Placing field",this.placing,t,e.offsetX,e.offsetY);s=e.offsetX;a=e.offsetY;n=defaultWidth(this.placing);l=defaultHeight(this.placing);d=this.cachedPageInfo[t];c=d.naturalWidth,p=c===void 0?612:c,h=d.naturalHeight,u=h===void 0?792:h;m=this.viewCoordinatesToPageCoordinates(s,a,t,p-n,u-l);g=Math.floor(m.x);v=Math.floor(m.y);f={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:true,page_sequence:t,validator:null,setting:{x:g,y:v},x:g,y:v,tabindex:0,width:n,height:l};switch(f.type){case"attachment":case"payment":f.setting={x:g,y:v};break;case"initial":case"signature":f.setting={x:g,y:v,result:""};break;case"checkbox_group":f.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:"".concat(f.name,"-1"),value:"Option 1",checked:false,x:g,y:v}]};break;case"date":f.setting={x:g,y:v,width:n,height:l,result:""};break;case"dropdown":f.required=false;f.setting={x:g,y:v,width:n,height:l,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":f.setting={options:[{id:"".concat(f.name,"-1"),value:"Option 1",selected:false,x:g,y:v}]};break;case"textarea":case"textbox":f.setting={x:g,y:v,width:n,height:l,result:"",leading:0,alignment:0,upperCase:false};break;case"timestamp":f.setting={x:g,y:v,width:n,height:l};break}if(f.type==="textarea"){f.type="textbox"}return[4,createField(this.endpoint,this.templateId,f)];case 1:x=b.sent();console.log("Saved field",x);if(this.store.state){this.store.state.fields=__spreadArray(__spreadArray([],(o=this.store)===null||o===void 0?void 0:o.state.fields,true),[x],false)}this.placing=null;(r=this.templateUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,template:(i=this.store)===null||i===void 0?void 0:i.state,event:"added-field"});this.handlePageRendered({detail:this.cachedPageInfo[t]});b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var o,r,i,s,a;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!((o=this.store)===null||o===void 0?void 0:o.state.isLoaded)){return h(Host,null,h("verdocs-loader",null))}var n=(i=(r=this.store)===null||r===void 0?void 0:r.state)===null||i===void 0?void 0:i.roles.map((function(e){return{value:e.name,label:e.name}}));return h(Host,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},"data-r":this.rerender,onSubmit:function(){console.log("onSubmit")}},h("div",{id:"verdocs-template-fields-toolbar"},h("div",{class:"add-for"},"Add field:"),h("verdocs-select-input",{value:this.selectedRoleName,options:n,onInput:function(e){return t.selectedRoleName=e.target.value}}),menuOptions.map((function(e){return h("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:function(){if(e.tooltip){t.placing=e.id}}})}))),h("div",{class:"pages"},(((a=(s=this.store)===null||s===void 0?void 0:s.state)===null||a===void 0?void 0:a.template_documents)||[]).map((function(e){var o=integerSequence(1,e.page_numbers);return o.map((function(o){return h("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:o,virtualWidth:612,virtualHeight:792,onClick:function(e){return t.handleClickPage(e,o)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))))};return e}();VerdocsTemplateFields.style=verdocsTemplateFieldsCss;var verdocsTemplateRolesCss='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;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}';var senderLabels=(_h={},_h[TemplateSenderTypes.EVERYONE]="Everyone",_h[TemplateSenderTypes.EVERYONE_AS_CREATOR]="Everyone as Me",_h[TemplateSenderTypes.ORGANIZATION_MEMBER]="Organization member",_h[TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",_h[TemplateSenderTypes.CREATOR]="Me",_h);var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var stepIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var doneIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var plusIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var iconSigner='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var iconApprover='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var iconCC='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var VerdocsTemplateRoles=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.exit=createEvent(this,"exit",7);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.sequences=[];this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:r.store=s.sent();this.sortTemplateRoles();this.renumberTemplateRoles();return[3,3];case 2:i=s.sent();console.log("[FIELDS] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidRender=function(){interact.dynamicDrop(true);interact(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var o=+(t.target.getAttribute("posX")||0);var r=+(t.target.getAttribute("posY")||0);var i=t.dx+o;var s=t.dy+r;t.target.setAttribute("posX",i);t.target.setAttribute("posy",s);t.target.style.transform="translate(".concat(i+100,"px, ").concat(s-40,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.setAttribute("posX",0);t.target.setAttribute("posy",0);t.target.style.transform="translate(0px, 0px)"}.bind(this)}});interact(".dropzone").dropzone({overlap:.05,ondrop:function e(t){var o=this;var r,i,s,a,n;t.target.classList.remove("active");var l=t.relatedTarget.dataset.rolename;var d=+t.target.dataset.sequence;var c=+t.target.dataset.order;var p=(s=(i=(r=this.store)===null||r===void 0?void 0:r.state)===null||i===void 0?void 0:i.roles)===null||s===void 0?void 0:s.find((function(e){return e.name===l}));if(p){p.sequence=d;p.order=c;this.sortTemplateRoles();this.renumberTemplateRoles();this.forceRerender++;Promise.all((n=(a=this.store)===null||a===void 0?void 0:a.state)===null||n===void 0?void 0:n.roles.map((function(e){return updateRole(o.endpoint,o.templateId,e.name,{sequence:e.sequence,order:e.order})}))).then((function(){var e,t;console.log("[ROLES] Updated roles");(e=o.templateUpdated)===null||e===void 0?void 0:e.emit({event:"updated-role",endpoint:o.endpoint,template:(t=o.store)===null||t===void 0?void 0:t.state})})).catch((function(e){return console.log("[ROLES] Role updates failed",e)}))}}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()};e.prototype.handleSubmit=function(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()};e.prototype.sortTemplateRoles=function(){var e,t;(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.extractSequenceNumbers=function(){var e=this;var t,o;this.sequences=[];(o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.roles.forEach((function(t){if(!e.sequences.includes(t.sequence)){e.sequences.push(t.sequence)}}))};e.prototype.renumberTemplateRoles=function(){var e=this;this.extractSequenceNumbers();var t=[];this.sequences.sort((function(e,t){return e-t}));this.sequences.forEach((function(o,r){var i,s;(s=(i=e.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.roles.filter((function(e){return e.sequence===o})).forEach((function(e,o){if(!t.includes(e.name)){e.sequence=r+1;e.order=o+1;t.push(e.name)}}))}));this.extractSequenceNumbers()};e.prototype.getNextRoleName=function(){var e,t,o,r;var i="";var s=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles.length;do{s++;i="Recipient ".concat(s)}while(!i||((r=(o=this.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.roles.some((function(e){return e.name===i}))));return i};e.prototype.callCreateRole=function(e,t,o){var r=this;console.log("[ROLES] Will create role",{name:e,sequence:t,order:o});createRole(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,order:o,full_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(e){return __awaiter(r,void 0,void 0,(function(){var t,o,r;return __generator(this,(function(i){switch(i.label){case 0:console.log("[ROLES] Created role",e);r=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:r.store=i.sent();this.sortTemplateRoles();this.renumberTemplateRoles();(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({event:"created-role",endpoint:this.endpoint,template:(o=this.store)===null||o===void 0?void 0:o.state});return[2]}}))}))})).catch((function(e){console.log("[ROLES] Error creating role",e)}))};e.prototype.handleAddRole=function(e,t){var o;e.stopPropagation();var r=((o=this.store)===null||o===void 0?void 0:o.state.roles.filter((function(e){return e.sequence===t})).length)+1;var i=this.getNextRoleName();this.callCreateRole(i,t,r)};e.prototype.handleAddStep=function(e,t){e.stopPropagation();var o=1;var r=this.getNextRoleName();this.callCreateRole(r,t,o)};e.prototype.render=function(){var e=this;var t,o,r,i,s,a;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!((t=this.store)===null||t===void 0?void 0:t.state.isLoaded)){return h(Host,{class:"loading"},h("verdocs-loader",null))}var n=(((r=(o=this.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.roles)||[]).map((function(e){return e.name}));return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off","data-r":(i=this.store.state)===null||i===void 0?void 0:i.updateCount},h("h5",null,"Roles and Workflow"),h("div",{class:"participants"},h("div",{class:"left-line"}),h("div",{class:"row"},h("div",{class:"icon",innerHTML:startIcon}),h("div",{class:"row-roles"},h("div",{class:"sender"},h("span",{class:"label"},"Sender:")," ",senderLabels[(a=(s=this.store)===null||s===void 0?void 0:s.state)===null||a===void 0?void 0:a.sender]," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),h("div",{class:"row add-sequence","data-sequence":0},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((function(t){var o,r;return h(Fragment,null,h("div",{class:"row"},h("div",{class:"icon",innerHTML:stepIcon}),h("div",{class:"row-roles"},h("div",{class:"dropzone","data-order":.5,"data-sequence":t}),(r=(o=e.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.roles.filter((function(e){return e.sequence===t})).map((function(o){var r=!o.email;return r?h(Fragment,null,h("div",{class:"recipient",style:{backgroundColor:getRGBA(getRoleIndex(n,o.name))},"data-rolename":o.name},h("span",{class:"type-icon",innerHTML:o.type==="signer"?iconSigner:o.type==="cc"?iconCC:iconApprover}),o.name," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingRoleDialog=o.name},"aria-role":"button"})),h("div",{class:"dropzone","data-order":o.order+.5,"data-sequence":t})):h(Fragment,null,h("div",{class:"recipient",style:{borderColor:getRGBA(getRoleIndex(n,o.name))},"data-rolename":o.name},h("span",{class:"type-icon",innerHTML:o.type==="signer"?iconSigner:o.type==="cc"?iconCC:iconApprover}),o.full_name," ",h("div",{class:"settings-button",innerHTML:settingsIcon,onClick:function(){return e.showingRoleDialog=o.name},"aria-role":"button"})),h("div",{class:"dropzone","data-order":o.order+.5,"data-sequence":t}))})),h("button",{class:"add-role",innerHTML:plusIcon,onClick:function(o){return e.handleAddRole(o,t)}}))),e.sequences.length>0&&h("div",{class:"row add-sequence","data-sequence":t},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),h("div",{class:"row","data-sequence":this.sequences.length+1},h("div",{class:"row-roles"},h("div",{class:"icon",innerHTML:plusIcon}),h("button",{class:"add-step",innerHTML:plusIcon,onClick:function(t){return e.handleAddStep(t,e.sequences.length+1)}}))),h("div",{class:"row"},h("div",{class:"icon",innerHTML:doneIcon}),h("div",{class:"row-roles"},h("div",{class:"complete"},"Document Complete")))),n.length<1&&h("div",{class:"empty"},"You must add at least one Role before proceeding.",h("br",null)," Click the ",h("span",{innerHTML:plusIcon})," Add button above to get started."),h("div",{class:"buttons"},h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return e.handleCancel()}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(){return e.handleSubmit()},disabled:n.length<1}))),this.showingRoleDialog&&h("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null},onDelete:function(){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(o){switch(o.label){case 0:return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:o.sent();this.renumberTemplateRoles();this.showingRoleDialog=null;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({event:"deleted-role",endpoint:this.endpoint,template:(t=this.store)===null||t===void 0?void 0:t.state});return[2]}}))}))}}),this.showingSenderDialog&&h("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateRoles.style=verdocsTemplateRolesCss;export{VerdocsTemplateAttachments as verdocs_template_attachments,VerdocsTemplateCreate as verdocs_template_create,VerdocsTemplateFields as verdocs_template_fields,VerdocsTemplateRoles as verdocs_template_roles};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-5260ed60.js";var verdocsTemplateCardCss='verdocs-template-card{font-family:"Barlow", sans-serif;width:320px;height:320px;display:-ms-flexbox;display:flex;padding:25px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;-webkit-box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05);box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05)}verdocs-template-card .thumbnail{width:272px;height:158px;-o-object-fit:cover;object-fit:cover;margin-bottom:22px;-o-object-position:-20% 0;object-position:-20% 0}verdocs-template-card .name{font-size:18px;font-weight:700;margin-bottom:7px}verdocs-template-card .org-name{font-size:14px;font-weight:700;margin-bottom:6px}verdocs-template-card hr{width:100%;margin-bottom:17px;background-color:#aeb4bf}verdocs-template-card .controls{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;text-align:center;font-size:16px}verdocs-template-card .controls .control{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;margin-right:8px;-ms-flex-align:start;align-items:flex-start;border-right:1px solid #aeb4bf}verdocs-template-card .controls .control.secondary{-ms-flex-pack:center;justify-content:center}verdocs-template-card .controls .control svg{fill:#aeb4bf;height:16px;max-width:16px;margin:0 8px -2px 0}verdocs-template-card .additional-controls svg{margin-right:0;fill:#654dcb}';var ActionsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>';var EmailIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>';var PagesIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"/></svg>';var StarIcon='<svg width="31" height="29" viewBox="0 0 31 29" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_31553_1553)"><path d="M30.886 11.4917C30.8916 11.0917 30.753 10.7034 30.4962 10.3993C30.2394 10.0953 29.882 9.8964 29.4908 9.83995L29.5182 9.65005L29.4908 9.83995L21.0938 8.60261L17.3412 0.912551C17.2067 0.638179 16.9992 0.407285 16.7421 0.245866C16.485 0.0844465 16.1885 -0.00111389 15.886 -0.00111389C15.5835 -0.00111389 15.287 0.0844465 15.0299 0.245866C14.7728 0.407285 14.5653 0.638179 14.4308 0.912551L10.6781 8.60261L2.28121 9.8392C1.89206 9.89475 1.53611 10.0916 1.2796 10.3931C1.02308 10.6945 0.88348 11.08 0.886776 11.4779C0.886447 11.6961 0.929977 11.912 1.01472 12.1125C1.09946 12.3131 1.22363 12.4941 1.37968 12.6445L7.45563 18.5744L6.01943 27.0241C6.00289 27.1258 5.99449 27.2287 5.99435 27.3317C5.99313 27.7717 6.16395 28.1943 6.4695 28.5071C6.77505 28.82 7.19045 28.9976 7.62496 29.0013C7.88846 29.0008 8.14779 28.9345 8.37992 28.8083L15.8883 24.8217L23.3967 28.8114C23.6287 28.9361 23.8873 29.0015 24.15 29.002C24.5752 28.9998 24.9832 28.8318 25.2893 28.5329C25.4452 28.3832 25.5695 28.2029 25.6544 28.003C25.7392 27.8031 25.783 27.5878 25.783 27.3702C25.7827 27.2731 25.7743 27.176 25.7579 27.0803L24.3209 18.6296L30.3931 12.7022C30.7094 12.3809 30.8867 11.9454 30.886 11.4917ZM22.0759 17.53L21.9437 17.3916L22.0759 17.53C22.0072 17.5977 21.9525 17.6787 21.9152 17.7681C21.8779 17.8575 21.8587 17.9536 21.8587 18.0506L21.8693 18.1737L23.2037 26.0237L16.2164 22.3148C16.1136 22.2602 15.9994 22.2317 15.8833 22.2317C15.7673 22.2317 15.653 22.2602 15.5503 22.3148L8.57132 26.0245L9.90651 18.1745L9.91712 18.0506C9.91696 17.9536 9.89768 17.8576 9.86038 17.7682C9.82308 17.6788 9.76851 17.5978 9.6999 17.53L4.05538 11.9724L11.8576 10.8258C11.9725 10.8088 12.0816 10.7638 12.1755 10.6947C12.2695 10.6256 12.3454 10.5344 12.3969 10.429L15.886 3.27721L19.3797 10.429C19.4313 10.5344 19.5074 10.6256 19.6014 10.6948C19.6955 10.7639 19.8047 10.8088 19.9197 10.8258L27.7197 11.9747L22.0759 17.53Z" fill="#ADB6BD"/></g><defs><clipPath id="clip0_31553_1553"><rect width="30" height="29" fill="white" transform="translate(0.886719)"/></clipPath></defs></svg>';var VerdocsTemplateCard=function(){function t(t){registerInstance(this,t);this.template=undefined}t.prototype.render=function(){var t,e,a,o,s;return h(Host,null,h("img",{src:((e=(t=this.template)===null||t===void 0?void 0:t.template_document)===null||e===void 0?void 0:e.thumbnail_url)||"",alt:"Template Thumbnail",class:"thumbnail"}),h("span",{class:"name"},this.template.name),h("span",{class:"org-name"},((a=this.template.organization)===null||a===void 0?void 0:a.name)||"Public"),h("hr",null),h("div",{class:"controls"},h("div",{class:"control"},h("span",{class:"icon",innerHTML:StarIcon}),h("span",{class:"value"},this.template.star_counter)),h("div",{class:"control secondary"},h("span",{class:"icon",innerHTML:PagesIcon}),h("span",{class:"value"},((s=(o=this.template)===null||o===void 0?void 0:o.template_document)===null||s===void 0?void 0:s.page_numbers)||1)),h("div",{class:"control secondary"},h("span",{class:"icon",innerHTML:EmailIcon}),h("span",{class:"value"},this.template.counter)),h("span",{class:"additional-controls",innerHTML:ActionsIcon})))};return t}();VerdocsTemplateCard.style=verdocsTemplateCardCss;export{VerdocsTemplateCard as verdocs_template_card};
1
+ import{r as registerInstance,h,H as Host}from"./index-9ee0ca9f.js";var verdocsTemplateCardCss='verdocs-template-card{font-family:"Barlow", sans-serif;width:320px;height:320px;display:-ms-flexbox;display:flex;padding:25px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;-webkit-box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05);box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05)}verdocs-template-card .thumbnail{width:272px;height:158px;-o-object-fit:cover;object-fit:cover;margin-bottom:22px;-o-object-position:-20% 0;object-position:-20% 0}verdocs-template-card .name{font-size:18px;font-weight:700;margin-bottom:7px}verdocs-template-card .org-name{font-size:14px;font-weight:700;margin-bottom:6px}verdocs-template-card hr{width:100%;margin-bottom:17px;background-color:#aeb4bf}verdocs-template-card .controls{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;text-align:center;font-size:16px}verdocs-template-card .controls .control{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;margin-right:8px;-ms-flex-align:start;align-items:flex-start;border-right:1px solid #aeb4bf}verdocs-template-card .controls .control.secondary{-ms-flex-pack:center;justify-content:center}verdocs-template-card .controls .control svg{fill:#aeb4bf;height:16px;max-width:16px;margin:0 8px -2px 0}verdocs-template-card .additional-controls svg{margin-right:0;fill:#654dcb}';var ActionsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>';var EmailIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>';var PagesIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"/></svg>';var StarIcon='<svg width="31" height="29" viewBox="0 0 31 29" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_31553_1553)"><path d="M30.886 11.4917C30.8916 11.0917 30.753 10.7034 30.4962 10.3993C30.2394 10.0953 29.882 9.8964 29.4908 9.83995L29.5182 9.65005L29.4908 9.83995L21.0938 8.60261L17.3412 0.912551C17.2067 0.638179 16.9992 0.407285 16.7421 0.245866C16.485 0.0844465 16.1885 -0.00111389 15.886 -0.00111389C15.5835 -0.00111389 15.287 0.0844465 15.0299 0.245866C14.7728 0.407285 14.5653 0.638179 14.4308 0.912551L10.6781 8.60261L2.28121 9.8392C1.89206 9.89475 1.53611 10.0916 1.2796 10.3931C1.02308 10.6945 0.88348 11.08 0.886776 11.4779C0.886447 11.6961 0.929977 11.912 1.01472 12.1125C1.09946 12.3131 1.22363 12.4941 1.37968 12.6445L7.45563 18.5744L6.01943 27.0241C6.00289 27.1258 5.99449 27.2287 5.99435 27.3317C5.99313 27.7717 6.16395 28.1943 6.4695 28.5071C6.77505 28.82 7.19045 28.9976 7.62496 29.0013C7.88846 29.0008 8.14779 28.9345 8.37992 28.8083L15.8883 24.8217L23.3967 28.8114C23.6287 28.9361 23.8873 29.0015 24.15 29.002C24.5752 28.9998 24.9832 28.8318 25.2893 28.5329C25.4452 28.3832 25.5695 28.2029 25.6544 28.003C25.7392 27.8031 25.783 27.5878 25.783 27.3702C25.7827 27.2731 25.7743 27.176 25.7579 27.0803L24.3209 18.6296L30.3931 12.7022C30.7094 12.3809 30.8867 11.9454 30.886 11.4917ZM22.0759 17.53L21.9437 17.3916L22.0759 17.53C22.0072 17.5977 21.9525 17.6787 21.9152 17.7681C21.8779 17.8575 21.8587 17.9536 21.8587 18.0506L21.8693 18.1737L23.2037 26.0237L16.2164 22.3148C16.1136 22.2602 15.9994 22.2317 15.8833 22.2317C15.7673 22.2317 15.653 22.2602 15.5503 22.3148L8.57132 26.0245L9.90651 18.1745L9.91712 18.0506C9.91696 17.9536 9.89768 17.8576 9.86038 17.7682C9.82308 17.6788 9.76851 17.5978 9.6999 17.53L4.05538 11.9724L11.8576 10.8258C11.9725 10.8088 12.0816 10.7638 12.1755 10.6947C12.2695 10.6256 12.3454 10.5344 12.3969 10.429L15.886 3.27721L19.3797 10.429C19.4313 10.5344 19.5074 10.6256 19.6014 10.6948C19.6955 10.7639 19.8047 10.8088 19.9197 10.8258L27.7197 11.9747L22.0759 17.53Z" fill="#ADB6BD"/></g><defs><clipPath id="clip0_31553_1553"><rect width="30" height="29" fill="white" transform="translate(0.886719)"/></clipPath></defs></svg>';var VerdocsTemplateCard=function(){function t(t){registerInstance(this,t);this.template=undefined}t.prototype.render=function(){var t,e,a,o,s;return h(Host,null,h("img",{src:((e=(t=this.template)===null||t===void 0?void 0:t.template_document)===null||e===void 0?void 0:e.thumbnail_url)||"",alt:"Template Thumbnail",class:"thumbnail"}),h("span",{class:"name"},this.template.name),h("span",{class:"org-name"},((a=this.template.organization)===null||a===void 0?void 0:a.name)||"Public"),h("hr",null),h("div",{class:"controls"},h("div",{class:"control"},h("span",{class:"icon",innerHTML:StarIcon}),h("span",{class:"value"},this.template.star_counter)),h("div",{class:"control secondary"},h("span",{class:"icon",innerHTML:PagesIcon}),h("span",{class:"value"},((s=(o=this.template)===null||o===void 0?void 0:o.template_document)===null||s===void 0?void 0:s.page_numbers)||1)),h("div",{class:"control secondary"},h("span",{class:"icon",innerHTML:EmailIcon}),h("span",{class:"value"},this.template.counter)),h("span",{class:"additional-controls",innerHTML:ActionsIcon})))};return t}();VerdocsTemplateCard.style=verdocsTemplateCardCss;export{VerdocsTemplateCard as verdocs_template_card};
@@ -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}}};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{t as throttle}from"./utils-78a752e0.js";import"./_commonjsHelpers-5ec8f9b7.js";import"./Envelopes-921cd9d0.js";import"./Files-70a192df.js";import"./index-d264c496.js";var __awaiter=undefined&&undefined.__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=undefined&&undefined.__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(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=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(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var getTemplateDocumentPageDisplayUri=function(t,e,i,n){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,t.api.get("/templates/".concat(e,"/documents/").concat(i,"/pages/").concat(n,"/image")).then((function(t){return t.data}))]}))}))};var verdocsTemplateDocumentPageCss="verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";var VerdocsTemplateDocumentPage=function(){function t(t){registerInstance(this,t);this.pageRendered=createEvent(this,"pageRendered",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri=""}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,getTemplateDocumentPageDisplayUri(this.endpoint,this.templateId,this.documentId,this.pageNumber)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(throttle((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,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 h(Host,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?h("img",{class:"verdocs-template-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}}):h("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();VerdocsTemplateDocumentPage.style=verdocsTemplateDocumentPageCss;export{VerdocsTemplateDocumentPage as verdocs_template_document_page};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,r){function a(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,n){function o(t){try{c(r.next(t))}catch(t){n(t)}}function s(t){try{c(r["throw"](t))}catch(t){n(t)}}function c(t){t.done?i(t.value):a(t.value).then(o,s)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,a,n,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(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,a&&(n=o[0]&2?a["return"]:o[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;if(a=0,n)o=[o[0]&2,n.value];switch(o[0]){case 0:case 1:n=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;a=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(o[0]===6&&i.label<n[1]){i.label=n[1];n=o;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(o);break}if(n[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];a=0}finally{r=n=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{g as getTemplateDocumentPageDisplayUri}from"./TemplateDocuments-6fd2f4e2.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{t as throttle}from"./utils-78a752e0.js";import"./_commonjsHelpers-5ec8f9b7.js";import"./Envelopes-921cd9d0.js";import"./Files-70a192df.js";import"./index-d264c496.js";var verdocsTemplateDocumentPageCss="verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";var VerdocsTemplateDocumentPage=function(){function t(t){registerInstance(this,t);this.pageRendered=createEvent(this,"pageRendered",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri=""}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,getTemplateDocumentPageDisplayUri(this.endpoint,this.templateId,this.documentId,this.pageNumber)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(throttle((function(e){for(var i=0,r=e;i<r.length;i++){var a=r[i];var n=a.contentRect.width;t.renderedWidth=n;t.renderedHeight=t.virtualHeight*(n/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,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 h(Host,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?h("img",{class:"verdocs-template-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}}):h("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();VerdocsTemplateDocumentPage.style=verdocsTemplateDocumentPageCss;export{VerdocsTemplateDocumentPage as verdocs_template_document_page};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,n){function a(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function i(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):a(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,a&&(r=i[0]&2?a["return"]:i[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,i[1])).done)return r;if(a=0,r)i=[i[0]&2,r.value];switch(i[0]){case 0:case 1:r=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;a=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(i[0]===6&&o.label<r[1]){o.label=r[1];r=i;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(i);break}if(r[2])o.ops.pop();o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e];a=0}finally{n=r=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{u as updateTemplate}from"./Templates-67172396.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-373c72a8.js";import{S as SDKError}from"./errors-9b5498c8.js";var verdocsTemplateNameCss='verdocs-template-name{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-name.loading{min-height:300px;position:relative;display:block}verdocs-template-name.empty{display:none}verdocs-template-name form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-name form label{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-name form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-name form input:focus{outline:none}verdocs-template-name .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-name ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-name ::-moz-placeholder{color:#aaaaaa}verdocs-template-name :-ms-input-placeholder{color:#aaaaaa}verdocs-template-name ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-name ::placeholder{color:#aaaaaa}';var VerdocsTemplateName=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,a,r,i;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=s.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:i=s.sent();console.log("[TEMPLATE NAME] Error loading template",i);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(i.message,(n=i.response)===null||n===void 0?void 0:n.status,(a=i.response)===null||a===void 0?void 0:a.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,o,n;e.stopPropagation();this.name=(o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.name;this.dirty=false;console.log("Closing");(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:e.stopPropagation();return[4,updateTemplate(this.endpoint,this.templateId,{name:this.name})];case 1:n.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,o;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.isLoading){return h(Host,{class:"loading"},h("verdocs-loader",null))}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("label",{htmlFor:"verdocs-template-name"},"Template Name"),h("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var o,n;e.name=t.target.value;e.dirty=e.name!==((n=(o=e.store)===null||o===void 0?void 0:o.state)===null||n===void 0?void 0:n.name)}}),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateName.style=verdocsTemplateNameCss;export{VerdocsTemplateName as verdocs_template_name};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,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(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{u as updateTemplate}from"./Templates-67172396.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";var verdocsTemplateNameCss="";var VerdocsTemplateName=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,o,r,i,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:i.store=a.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:s=a.sent();console.log("[TEMPLATE NAME] Error loading template",s);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(s.message,(o=s.response)===null||o===void 0?void 0:o.status,(r=s.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,n,o;e.stopPropagation();this.name=(n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,updateTemplate(this.endpoint,this.templateId,{name:this.name})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;console.log("Closing");(n=this.close)===null||n===void 0?void 0:n.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,n;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.isLoading){return h(Host,{class:"loading"},h("verdocs-loader",null))}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("label",{htmlFor:"verdocs-template-name"},"Template Name"),h("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var n,o;e.name=t.target.value;e.dirty=e.name!==((o=(n=e.store)===null||n===void 0?void 0:n.state)===null||o===void 0?void 0:o.name)}}),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateName.style=verdocsTemplateNameCss;export{VerdocsTemplateName as verdocs_template_name};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,r){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function n(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):o(e.value).then(n,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return l([e,t])}}function l(n){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,o&&(s=n[0]&2?o["return"]:n[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;if(o=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;o=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){i.label=n[1];break}if(n[0]===6&&i.label<s[1]){i.label=s[1];s=n;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(n);break}if(s[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];o=0}finally{r=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-373c72a8.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Templates-67172396.js";var verdocsTemplatePropertiesCss='verdocs-template-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-properties form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form h5{font-size:14px;font-weight:400;margin:0 0 6px 0}verdocs-template-properties form .row{display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form fieldset{width:440px;border:none;max-width:100%;margin:0 0 20px 0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:20px 20px 10px 20px;background-color:#ffffff;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-template-properties form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-properties form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-properties form input:focus{outline:none}verdocs-template-properties form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-properties form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-properties form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-properties form .input-row verdocs-text-input input{text-align:center}verdocs-template-properties form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-properties form .radio-row{display:-ms-flexbox;display:flex;position:relative;margin:0 0 10px 0;-ms-flex-direction:row;flex-direction:row}verdocs-template-properties form .radio-row verdocs-radio-button{display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px}verdocs-template-properties form .radio-row label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form .radio-row label .title{font-size:16px;font-weight:500}verdocs-template-properties form .radio-row label .description{font-size:14px;font-weight:400}verdocs-template-properties .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-properties .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-properties ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-properties ::-moz-placeholder{color:#aaaaaa}verdocs-template-properties :-ms-input-placeholder{color:#aaaaaa}verdocs-template-properties ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-properties ::placeholder{color:#aaaaaa}';var VerdocsTemplateProperties=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.name="";this.visibility="";this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,r,o,s,n,a,l;return __generator(this,(function(p){switch(p.label){case 0:p.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PROPERTIES] Unable to start builder session, must be authenticated");return[2]}a=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:a.store=p.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.sendReminders=((r=(i=this.store)===null||i===void 0?void 0:i.state)===null||r===void 0?void 0:r.reminder_id)!==null;return[3,3];case 2:l=p.sent();console.log("[PROPERTIES] Error loading template",l);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(l.message,(s=l.response)===null||s===void 0?void 0:s.status,(n=l.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();(t=this.next)===null||t===void 0?void 0:t.emit({name:this.name,firstReminderDays:+this.firstReminderDays,reminderDays:+this.reminderDays,sendReminders:this.sendReminders})};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Template Name"),h("fieldset",null,h("verdocs-text-input",{value:this.name,autocomplete:"off",onInput:function(t){return e.name=t.target.value}})),h("h5",null,"Reminders"),h("fieldset",null,h("div",{class:"input-row"},h("label",null,"Send Automatic Reminders"),h("verdocs-checkbox",{name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){return e.sendReminders=t.target.checked}})),h("div",{class:"input-row"},h("label",null,"Days Before First Reminder"),h("verdocs-text-input",{value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value}})),h("div",{class:"input-row"},h("label",null,"Days Between Reminders"),h("verdocs-text-input",{value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value}}))),h("h5",null,"Template Visibility"),h("fieldset",null,h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"private",onChange:function(){return e.visibility="private"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-private"},h("div",{class:"title"},"Private"),h("div",{class:"description"},"Only you can share and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"shared",onChange:function(){return e.visibility="shared"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-shared"},h("div",{class:"title"},"Shared to your organization"),h("div",{class:"description"},"Give access to your organization to share and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"shared_public",onChange:function(){return e.visibility="shared_public"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-shared_public"},h("div",{class:"title"},"Shared to your organization and Public"),h("div",{class:"description"},"Give access to your organization to share this template, and anyone on the Web can find and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:this.visibility==="public",value:"public",onChange:function(){return e.visibility="public"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-public"},h("div",{class:"title"},"Public"),h("div",{class:"description"},"Anyone on the Web can find and use this template")))),h("div",{class:"buttons"},h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsTemplateProperties.style=verdocsTemplatePropertiesCss;export{VerdocsTemplateProperties as verdocs_template_properties};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,i){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?r(e.value):o(e.value).then(n,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return l([e,t])}}function l(n){if(i)throw new TypeError("Generator is already executing.");while(r)try{if(i=1,o&&(s=n[0]&2?o["return"]:n[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;if(o=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;o=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){r.label=n[1];break}if(n[0]===6&&r.label<s[1]){r.label=s[1];s=n;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(n);break}if(s[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];o=0}finally{i=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Templates-67172396.js";var verdocsTemplatePropertiesCss='verdocs-template-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-properties form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form h5{font-size:14px;font-weight:400;margin:0 0 6px 0}verdocs-template-properties form .row{display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form fieldset{width:440px;border:none;max-width:100%;margin:0 0 20px 0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:20px 20px 10px 20px;background-color:#ffffff;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-template-properties form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-properties form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-properties form input:focus{outline:none}verdocs-template-properties form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-properties form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-properties form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-properties form .input-row verdocs-text-input input{text-align:center}verdocs-template-properties form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-properties form .radio-row{display:-ms-flexbox;display:flex;position:relative;margin:0 0 10px 0;-ms-flex-direction:row;flex-direction:row}verdocs-template-properties form .radio-row verdocs-radio-button{display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px}verdocs-template-properties form .radio-row label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-properties form .radio-row label .title{font-size:16px;font-weight:500}verdocs-template-properties form .radio-row label .description{font-size:14px;font-weight:400}verdocs-template-properties .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-properties .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-properties ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-properties ::-moz-placeholder{color:#aaaaaa}verdocs-template-properties :-ms-input-placeholder{color:#aaaaaa}verdocs-template-properties ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-properties ::placeholder{color:#aaaaaa}';var VerdocsTemplateProperties=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.name="";this.visibility="";this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i,o,s,n,a,l;return __generator(this,(function(p){switch(p.label){case 0:p.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PROPERTIES] Unable to start builder session, must be authenticated");return[2]}a=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:a.store=p.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.sendReminders=((i=(r=this.store)===null||r===void 0?void 0:r.state)===null||i===void 0?void 0:i.reminder_id)!==null;return[3,3];case 2:l=p.sent();console.log("[PROPERTIES] Error loading template",l);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(l.message,(s=l.response)===null||s===void 0?void 0:s.status,(n=l.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();(t=this.next)===null||t===void 0?void 0:t.emit({name:this.name,firstReminderDays:+this.firstReminderDays,reminderDays:+this.reminderDays,sendReminders:this.sendReminders})};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Template Name"),h("fieldset",null,h("verdocs-text-input",{value:this.name,autocomplete:"off",onInput:function(t){return e.name=t.target.value}})),h("h5",null,"Reminders"),h("fieldset",null,h("div",{class:"input-row"},h("label",null,"Send Automatic Reminders"),h("verdocs-checkbox",{name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){return e.sendReminders=t.target.checked}})),h("div",{class:"input-row"},h("label",null,"Days Before First Reminder"),h("verdocs-text-input",{value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value}})),h("div",{class:"input-row"},h("label",null,"Days Between Reminders"),h("verdocs-text-input",{value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value}}))),h("h5",null,"Template Visibility"),h("fieldset",null,h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"private",onChange:function(){return e.visibility="private"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-private"},h("div",{class:"title"},"Private"),h("div",{class:"description"},"Only you can share and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"shared",onChange:function(){return e.visibility="shared"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-shared"},h("div",{class:"title"},"Shared to your organization"),h("div",{class:"description"},"Give access to your organization to share and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:true,value:"shared_public",onChange:function(){return e.visibility="shared_public"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-shared_public"},h("div",{class:"title"},"Shared to your organization and Public"),h("div",{class:"description"},"Give access to your organization to share this template, and anyone on the Web can find and use this template"))),h("div",{class:"radio-row"},h("verdocs-radio-button",{name:"visibility",checked:this.visibility==="public",value:"public",onChange:function(){return e.visibility="public"}}),h("label",{htmlFor:"verdocs-radio-button-visibility-public"},h("div",{class:"title"},"Public"),h("div",{class:"description"},"Anyone on the Web can find and use this template")))),h("div",{class:"buttons"},h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsTemplateProperties.style=verdocsTemplatePropertiesCss;export{VerdocsTemplateProperties as verdocs_template_properties};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?r(e.value):i(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(s=o[0]&2?i["return"]:o[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,o[1])).done)return s;if(i=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(o[0]===6&&r.label<s[1]){r.label=s[1];s=o;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(o);break}if(s[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];i=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-373c72a8.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Templates-67172396.js";var createReminder=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var updateReminder=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var deleteReminder=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var verdocsTemplateRemindersCss='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .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-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var VerdocsTemplateReminders=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,s,o;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:s.store=a.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:o=a.sent();console.log("[TEMPLATE REMINDERS] Error loading template",o);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(o.message,(n=o.response)===null||n===void 0?void 0:n.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,r,n;e.stopPropagation();this.sendReminders=!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id);this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,s,o;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();if(!this.sendReminders)return[3,5];o={setup_time:864e5*+this.firstReminderDays,interval_time:864e5*+this.reminderDays};if(!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id))return[3,2];return[4,createReminder(this.endpoint,this.templateId,o)];case 1:a.sent();return[3,4];case 2:return[4,updateReminder(this.endpoint,this.templateId,(n=this.store)===null||n===void 0?void 0:n.state.reminder_id,o)];case 3:a.sent();a.label=4;case 4:return[3,7];case 5:return[4,deleteReminder(this.endpoint,this.templateId,(i=this.store)===null||i===void 0?void 0:i.state.reminder_id)];case 6:a.sent();a.label=7;case 7:this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,r;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.isLoaded)){return h(Host,{class:"empty"})}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Reminders"),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),h("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.showPlanBlocker=true;t.target.checked=false}})),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),h("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value},disabled:!this.sendReminders})),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),h("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value},disabled:!this.sendReminders})),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&h("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}();VerdocsTemplateReminders.style=verdocsTemplateRemindersCss;export{VerdocsTemplateReminders as verdocs_template_reminders};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?r(e.value):i(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(s=o[0]&2?i["return"]:o[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,o[1])).done)return s;if(i=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(o[0]===6&&r.label<s[1]){r.label=s[1];s=o;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(o);break}if(s[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];i=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Templates-67172396.js";var createReminder=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var updateReminder=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var deleteReminder=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var verdocsTemplateRemindersCss='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .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-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var VerdocsTemplateReminders=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,s,o;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:s.store=a.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:o=a.sent();console.log("[TEMPLATE REMINDERS] Error loading template",o);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(o.message,(n=o.response)===null||n===void 0?void 0:n.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,r,n;e.stopPropagation();this.sendReminders=!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id);this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,s,o;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();if(!this.sendReminders)return[3,5];o={setup_time:864e5*+this.firstReminderDays,interval_time:864e5*+this.reminderDays};if(!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id))return[3,2];return[4,createReminder(this.endpoint,this.templateId,o)];case 1:a.sent();return[3,4];case 2:return[4,updateReminder(this.endpoint,this.templateId,(n=this.store)===null||n===void 0?void 0:n.state.reminder_id,o)];case 3:a.sent();a.label=4;case 4:return[3,7];case 5:return[4,deleteReminder(this.endpoint,this.templateId,(i=this.store)===null||i===void 0?void 0:i.state.reminder_id)];case 6:a.sent();a.label=7;case 7:this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,r;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.isLoaded)){return h(Host,{class:"empty"})}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Reminders"),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),h("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.showPlanBlocker=true;t.target.checked=false}})),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),h("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value},disabled:!this.sendReminders})),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),h("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value},disabled:!this.sendReminders})),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&h("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}();VerdocsTemplateReminders.style=verdocsTemplateRemindersCss;export{VerdocsTemplateReminders as verdocs_template_reminders};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,n){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function l(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?o(e.value):r(e.value).then(s,l)}a((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return e.concat(i||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{u as updateRole,d as deleteRole}from"./Roles-6eb459df.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-373c72a8.js";import{S as SDKError}from"./errors-9b5498c8.js";import{u as updateTemplate}from"./Templates-67172396.js";var verdocsTemplateRolePropertiesCss='verdocs-template-role-properties{font-family:"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: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-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;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:active{background:#f3f3f3}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}';var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var VerdocsTemplateRoleProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.roleName="";this.sender=TemplateSenderTypes.EVERYONE;this.dirty=false;this.saving=false;this.name="";this.type="signer";this.fullName="";this.email="";this.phone="";this.allowDelegation=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,r,i,s,l;var a=this;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:i.store=d.sent();s=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles.find((function(e){return e.name===a.roleName}));if(s){this.name=s.name;this.type=s.type;this.fullName=s.full_name;this.email=s.email;this.phone=s.phone;this.allowDelegation=s.delegator;console.log("Got role",s)}return[3,3];case 2:l=d.sent();console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",l);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(r=l.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,o,n;e.stopPropagation();this.name=(o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.name;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();this.saving=true;updateRole(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((function(e){var o;console.log("Update result",e);t.saving=false;t.dirty=false;var n=__spreadArray([],t.store.state.roles,true);n.forEach((function(e){if(e.name===t.roleName){e.name=t.name;e.type=t.type;e.full_name=t.fullName;e.email=t.email;e.phone=t.phone;e.delegator=t.allowDelegation}}));t.store.state.roles=n;(o=t.close)===null||o===void 0?void 0:o.emit()})).catch((function(e){console.log("Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){deleteRole(this.endpoint,this.templateId,this.roleName).then((function(e){var o;console.log("Role deleted",e);t.store.state.roles=__spreadArray([],t.store.state.roles.filter((function(e){return e.name!==t.roleName})),true);(o=t.delete)===null||o===void 0?void 0:o.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},h("div",{class:"dialog"},h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",helpText:"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"Type:"),h("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),h("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."})),h("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:function(t){e.fullName=t.target.value;e.dirty=true}}),h("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:function(t){e.email=t.target.value;e.dirty=true}}),h("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:function(t){e.phone=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"May Delegate:"),h("div",{class:"checkbox-wrapper"},h("verdocs-checkbox",{checked:this.allowDelegation,onInput:function(t){e.allowDelegation=t.target.checked;e.dirty=true}})),h("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}();VerdocsTemplateRoleProperties.style=verdocsTemplateRolePropertiesCss;var verdocsTemplateSenderCss='verdocs-template-sender{font-family:"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}';var VerdocsTemplateSender=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.sender=TemplateSenderTypes.EVERYONE;this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,r,i,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:i.store=l.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:s=l.sent();console.log("[SENDER] Error with preview session",s);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(s.message,(n=s.response)===null||n===void 0?void 0:n.status,(r=s.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){this.saving=true;updateTemplate(this.endpoint,this.templateId,{sender:e}).then((function(o){var n;console.log("Update result",o);if((n=t.store)===null||n===void 0?void 0:n.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},h("div",{class:"dialog"},h("div",{class:"options"},h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE,checked:this.sender===TemplateSenderTypes.EVERYONE,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web"),h("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE_AS_CREATOR,checked:this.sender===TemplateSenderTypes.EVERYONE_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web as me"),h("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization as me"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.CREATOR,checked:this.sender===TemplateSenderTypes.CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Me"),h("verdocs-help-icon",{text:"Only I can use this template."})))),h("div",{class:"buttons"},h("verdocs-button",{label:"Close",onClick:function(){return e.handleClose()}})))))};return e}();VerdocsTemplateSender.style=verdocsTemplateSenderCss;export{VerdocsTemplateRoleProperties as verdocs_template_role_properties,VerdocsTemplateSender as verdocs_template_sender};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,n){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function l(e){try{a(n["throw"](e))}catch(e){r(e)}}function a(e){e.done?o(e.value):i(e.value).then(s,l)}a((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;i=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];i=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{u as updateRole,d as deleteRole}from"./Roles-6eb459df.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";import{u as updateTemplate}from"./Templates-67172396.js";var verdocsTemplateRolePropertiesCss='verdocs-template-role-properties{font-family:"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: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-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;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:active{background:#f3f3f3}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}';var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var VerdocsTemplateRoleProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.roleName="";this.sender=TemplateSenderTypes.EVERYONE;this.dirty=false;this.saving=false;this.name="";this.type="signer";this.fullName="";this.email="";this.phone="";this.allowDelegation=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,i,r,s,l;var a=this;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=d.sent();s=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles.find((function(e){return e.name===a.roleName}));if(s){this.name=s.name;this.type=s.type;this.fullName=s.full_name;this.email=s.email;this.phone=s.phone;this.allowDelegation=s.delegator;console.log("[ROLES] Editing role",s)}return[3,3];case 2:l=d.sent();console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",l);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(i=l.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,o,n;e.stopPropagation();this.name=(o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.name;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();this.saving=true;updateRole(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((function(e){return __awaiter(t,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:console.log("[ROLE_PROPERTIES] Update result",e);this.saving=false;this.dirty=false;o=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:o.store=n.sent();(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))})).catch((function(e){console.log("Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){deleteRole(this.endpoint,this.templateId,this.roleName).then((function(e){var o;console.log("Role deleted",e);t.store.state.roles=__spreadArray([],t.store.state.roles.filter((function(e){return e.name!==t.roleName})),true);(o=t.delete)===null||o===void 0?void 0:o.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},h("div",{class:"dialog"},h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",helpText:"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"Type:"),h("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),h("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."})),h("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:function(t){e.fullName=t.target.value;e.dirty=true}}),h("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:function(t){e.email=t.target.value;e.dirty=true}}),h("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:function(t){e.phone=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"May Delegate:"),h("div",{class:"checkbox-wrapper"},h("verdocs-checkbox",{checked:this.allowDelegation,onInput:function(t){e.allowDelegation=t.target.checked;e.dirty=true}})),h("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}();VerdocsTemplateRoleProperties.style=verdocsTemplateRolePropertiesCss;var verdocsTemplateSenderCss='verdocs-template-sender{font-family:"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}';var VerdocsTemplateSender=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.sender=TemplateSenderTypes.EVERYONE;this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,i,r,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=l.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:s=l.sent();console.log("[SENDER] Error with preview session",s);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(s.message,(n=s.response)===null||n===void 0?void 0:n.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){this.saving=true;updateTemplate(this.endpoint,this.templateId,{sender:e}).then((function(o){var n;console.log("Update result",o);if((n=t.store)===null||n===void 0?void 0:n.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},h("div",{class:"dialog"},h("div",{class:"options"},h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE,checked:this.sender===TemplateSenderTypes.EVERYONE,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web"),h("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE_AS_CREATOR,checked:this.sender===TemplateSenderTypes.EVERYONE_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web as me"),h("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization as me"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.CREATOR,checked:this.sender===TemplateSenderTypes.CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Me"),h("verdocs-help-icon",{text:"Only I can use this template."})))),h("div",{class:"buttons"},h("verdocs-button",{label:"Close",onClick:function(){return e.handleClose()}})))))};return e}();VerdocsTemplateSender.style=verdocsTemplateSenderCss;export{VerdocsTemplateRoleProperties as verdocs_template_role_properties,VerdocsTemplateSender as verdocs_template_sender};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-5260ed60.js";var verdocsTemplateTagsCss='verdocs-template-tags{font-family:"Barlow", sans-serif}verdocs-template-tags span{margin:0 4px;height:28px;font-size:12px;font-weight:600;padding:5px 12px 7px;border-radius:5px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:uppercase;color:#33364b;border:1px solid #707ae5;background-color:#f5f5fa}';var VerdocsTemplateTags=function(){function e(e){registerInstance(this,e);this.tags=undefined}e.prototype.render=function(){var e;return h(Host,null,(e=this.tags)===null||e===void 0?void 0:e.map((function(e){return h("span",null,e)})))};return e}();VerdocsTemplateTags.style=verdocsTemplateTagsCss;export{VerdocsTemplateTags as verdocs_template_tags};
1
+ import{r as registerInstance,h,H as Host}from"./index-9ee0ca9f.js";var verdocsTemplateTagsCss='verdocs-template-tags{font-family:"Barlow", sans-serif}verdocs-template-tags span{margin:0 4px;height:28px;font-size:12px;font-weight:600;padding:5px 12px 7px;border-radius:5px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:uppercase;color:#33364b;border:1px solid #707ae5;background-color:#f5f5fa}';var VerdocsTemplateTags=function(){function e(e){registerInstance(this,e);this.tags=undefined}e.prototype.render=function(){var e;return h(Host,null,(e=this.tags)===null||e===void 0?void 0:e.map((function(e){return h("span",null,e)})))};return e}();VerdocsTemplateTags.style=verdocsTemplateTagsCss;export{VerdocsTemplateTags as verdocs_template_tags};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function l(e){try{a(o.next(e))}catch(e){r(e)}}function n(e){try{a(o["throw"](e))}catch(e){r(e)}}function a(e){e.done?i(e.value):s(e.value).then(l,n)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,s,r,l;return l={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function n(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(r=l[0]&2?s["return"]:l[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,l[1])).done)return r;if(s=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;s=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(l[0]===6&&i.label<r[1]){i.label=r[1];r=l;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(l);break}if(r[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];s=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";import"./Types-5f31149e.js";import{u as updateTemplate}from"./Templates-67172396.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-373c72a8.js";import{S as SDKError}from"./errors-9b5498c8.js";var verdocsTemplateVisibilityCss='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var VerdocsTemplateVisibility=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,r,l,n,a;return __generator(this,(function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:n.store=c.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=c.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(a.message,(r=a.response)===null||r===void 0?void 0:r.status,(l=a.response)===null||l===void 0?void 0:l.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,r;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;this.dirty=false;(r=this.close)===null||r===void 0?void 0:r.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,updateTemplate(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return h(Host,{class:"empty"})}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Visibility"),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-is-shared"},"Shared"),h("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),h("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-is-public"},"Public"),h("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),h("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateVisibility.style=verdocsTemplateVisibilityCss;export{VerdocsTemplateVisibility as verdocs_template_visibility};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function l(e){try{a(o.next(e))}catch(e){r(e)}}function n(e){try{a(o["throw"](e))}catch(e){r(e)}}function a(e){e.done?i(e.value):s(e.value).then(l,n)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,s,r,l;return l={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function n(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(r=l[0]&2?s["return"]:l[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,l[1])).done)return r;if(s=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;s=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(l[0]===6&&i.label<r[1]){i.label=r[1];r=l;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(l);break}if(r[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];s=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";import"./Types-5f31149e.js";import{u as updateTemplate}from"./Templates-67172396.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-4367eb13.js";import{g as getTemplateStore}from"./TemplateStore-17fa95d5.js";import{S as SDKError}from"./errors-9b5498c8.js";var verdocsTemplateVisibilityCss='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var VerdocsTemplateVisibility=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,r,l,n,a;return __generator(this,(function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:n.store=c.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=c.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(a.message,(r=a.response)===null||r===void 0?void 0:r.status,(l=a.response)===null||l===void 0?void 0:l.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,r;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;this.dirty=false;(r=this.close)===null||r===void 0?void 0:r.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,updateTemplate(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return h(Host,{class:"empty"})}return h(Host,null,h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("h5",null,"Visibility"),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-is-shared"},"Shared"),h("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),h("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),h("div",{class:"input-row"},h("label",{htmlFor:"verdocs-is-public"},"Public"),h("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),h("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),h("div",{class:"buttons"},h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateVisibility.style=verdocsTemplateVisibilityCss;export{VerdocsTemplateVisibility as verdocs_template_visibility};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-5260ed60.js";var verdocsToggleButtonCss='verdocs-toggle-button{font-family:"Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButton=function(){function t(t){registerInstance(this,t);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}t.prototype.componentWillLoad=function(){this._active=this.active};t.prototype.handleToggle=function(t){var e;t.stopPropagation();var o=!this._active;this._active=o;(e=this.toggle)===null||e===void 0?void 0:e.emit({active:o})};t.prototype.render=function(){var t=this;return h(Host,{class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(e){return t.handleToggle(e)}}):h("button",{class:{active:this._active},onClick:function(e){return t.handleToggle(e)}},this.label))};return t}();VerdocsToggleButton.style=verdocsToggleButtonCss;export{VerdocsToggleButton as verdocs_toggle_button};
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9ee0ca9f.js";var verdocsToggleButtonCss='verdocs-toggle-button{font-family:"Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButton=function(){function t(t){registerInstance(this,t);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}t.prototype.componentWillLoad=function(){this._active=this.active};t.prototype.handleToggle=function(t){var e;t.stopPropagation();var o=!this._active;this._active=o;(e=this.toggle)===null||e===void 0?void 0:e.emit({active:o})};t.prototype.render=function(){var t=this;return h(Host,{class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(e){return t.handleToggle(e)}}):h("button",{class:{active:this._active},onClick:function(e){return t.handleToggle(e)}},this.label))};return t}();VerdocsToggleButton.style=verdocsToggleButtonCss;export{VerdocsToggleButton as verdocs_toggle_button};
@@ -1 +1 @@
1
- import{r as registerInstance,h}from"./index-5260ed60.js";var verdocsToggleCss='verdocs-toggle{font-family:"Barlow", sans-serif}verdocs-toggle .container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background-color:#f5f5fa}verdocs-toggle .label{font-size:24px;font-weight:700;color:#33354c;-ms-flex-item-align:center;align-self:center;margin-right:27px;font-family:sans-serif}verdocs-toggle .buttons{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap}verdocs-toggle .buttons button{width:60px;height:60px;border:2px solid #654dcb;border-radius:5px;cursor:pointer}verdocs-toggle .buttons button:not(:last-child){margin-right:11px}verdocs-toggle .buttons svg{width:30px;height:30px}verdocs-toggle .buttons button:hover{background-color:#654dcb;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .buttons button:hover svg{fill:#f5f5fa;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .selected{background-color:#707ae5;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .selected svg{fill:#ffffff;-webkit-transition:0.25s;transition:0.25s}';var VerdocsToggle=function(){function o(o){registerInstance(this,o);this.options=undefined;this.theme=undefined;this.selectedOption=0}o.prototype.componentWillLoad=function(){var o;this.selectedOption=((o=this.options)===null||o===void 0?void 0:o.defaultSelection)||0};o.prototype.render=function(){var o=this;return h("div",{class:"container"},h("span",{class:"label"},"".concat(this.options.label,":")),h("div",{class:"buttons"},this.options.buttons.map((function(e,t){return h("button",{id:e.id,key:e.id,innerHTML:e.icon,class:t===o.selectedOption?"selected":"",onClick:function(){console.log("clicked",t);o.selectedOption=t}})}))))};return o}();VerdocsToggle.style=verdocsToggleCss;export{VerdocsToggle as verdocs_toggle};
1
+ import{r as registerInstance,h}from"./index-9ee0ca9f.js";var verdocsToggleCss='verdocs-toggle{font-family:"Barlow", sans-serif}verdocs-toggle .container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background-color:#f5f5fa}verdocs-toggle .label{font-size:24px;font-weight:700;color:#33354c;-ms-flex-item-align:center;align-self:center;margin-right:27px;font-family:sans-serif}verdocs-toggle .buttons{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap}verdocs-toggle .buttons button{width:60px;height:60px;border:2px solid #654dcb;border-radius:5px;cursor:pointer}verdocs-toggle .buttons button:not(:last-child){margin-right:11px}verdocs-toggle .buttons svg{width:30px;height:30px}verdocs-toggle .buttons button:hover{background-color:#654dcb;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .buttons button:hover svg{fill:#f5f5fa;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .selected{background-color:#707ae5;-webkit-transition:0.25s;transition:0.25s}verdocs-toggle .selected svg{fill:#ffffff;-webkit-transition:0.25s;transition:0.25s}';var VerdocsToggle=function(){function o(o){registerInstance(this,o);this.options=undefined;this.theme=undefined;this.selectedOption=0}o.prototype.componentWillLoad=function(){var o;this.selectedOption=((o=this.options)===null||o===void 0?void 0:o.defaultSelection)||0};o.prototype.render=function(){var o=this;return h("div",{class:"container"},h("span",{class:"label"},"".concat(this.options.label,":")),h("div",{class:"buttons"},this.options.buttons.map((function(e,t){return h("button",{id:e.id,key:e.id,innerHTML:e.icon,class:t===o.selectedOption?"selected":"",onClick:function(){console.log("clicked",t);o.selectedOption=t}})}))))};return o}();VerdocsToggle.style=verdocsToggleCss;export{VerdocsToggle as verdocs_toggle};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-5260ed60.js";import{c as createPopper}from"./popper-bfa25c7f.js";var verdocsToolbarIconCss='verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIcon=function(){function o(o){registerInstance(this,o);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}o.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};o.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};o.prototype.show=function(){var o,t;(o=this.tooltip)===null||o===void 0?void 0:o.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};o.prototype.hide=function(){var o;(o=this.tooltip)===null||o===void 0?void 0:o.removeAttribute("data-show")};o.prototype.render=function(){var o=this;return h(Host,{class:{}},h("div",{"aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return o.show()},onFocus:function(){return o.show()},onMouseLeave:function(){return o.hide()},onBlur:function(){return o.hide()},ref:function(t){return o.iconEl=t}}),h("div",{id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return o.tooltip=t}},this.text,h("div",{"data-popper-arrow":"true",class:"arrow"})))};return o}();VerdocsToolbarIcon.style=verdocsToolbarIconCss;export{VerdocsToolbarIcon as verdocs_toolbar_icon};
1
+ import{r as registerInstance,h,H as Host}from"./index-9ee0ca9f.js";import{c as createPopper}from"./popper-bfa25c7f.js";var verdocsToolbarIconCss='verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIcon=function(){function o(o){registerInstance(this,o);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}o.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};o.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};o.prototype.show=function(){var o,t;(o=this.tooltip)===null||o===void 0?void 0:o.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};o.prototype.hide=function(){var o;(o=this.tooltip)===null||o===void 0?void 0:o.removeAttribute("data-show")};o.prototype.render=function(){var o=this;return h(Host,{class:{}},h("div",{"aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return o.show()},onFocus:function(){return o.show()},onMouseLeave:function(){return o.hide()},onBlur:function(){return o.hide()},ref:function(t){return o.iconEl=t}}),h("div",{id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return o.tooltip=t}},this.text,h("div",{"data-popper-arrow":"true",class:"arrow"})))};return o}();VerdocsToolbarIcon.style=verdocsToolbarIconCss;export{VerdocsToolbarIcon as verdocs_toolbar_icon};