@verdocs/web-sdk 5.0.38 → 5.0.40

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 (447) hide show
  1. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +3 -3
  2. package/dist/cjs/verdocs-button_2.cjs.entry.js +2 -2
  3. package/dist/cjs/verdocs-checkbox_6.cjs.entry.js +8 -8
  4. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +8 -13
  5. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-dialog.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  10. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +2 -2
  12. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +8 -8
  13. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-preview_7.cjs.entry.js +3 -8
  17. package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
  18. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-search-box.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-switch.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-table.cjs.entry.js +2 -2
  26. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  30. package/dist/cjs/verdocs-templates-list.cjs.entry.js +7 -7
  31. package/dist/cjs/verdocs-toggle-button.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  33. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +1 -1
  34. package/dist/collection/components/controls/verdocs-button-panel/verdocs-button-panel.js +2 -2
  35. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.js +1 -1
  36. package/dist/collection/components/controls/verdocs-component-error/verdocs-component-error.js +1 -1
  37. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +1 -1
  38. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.js +1 -1
  39. package/dist/collection/components/controls/verdocs-help-icon/verdocs-help-icon.js +1 -1
  40. package/dist/collection/components/controls/verdocs-loader/verdocs-loader.js +1 -1
  41. package/dist/collection/components/controls/verdocs-menu-panel/verdocs-menu-panel.js +1 -1
  42. package/dist/collection/components/controls/verdocs-multiselect/verdocs-multiselect.js +1 -1
  43. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.js +1 -1
  44. package/dist/collection/components/controls/verdocs-pagination/verdocs-pagination.js +1 -1
  45. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +1 -1
  46. package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.js +1 -1
  47. package/dist/collection/components/controls/verdocs-quick-filter/verdocs-quick-filter.js +1 -1
  48. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.js +1 -1
  49. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.js +1 -1
  50. package/dist/collection/components/controls/verdocs-spinner/verdocs-spinner.js +1 -1
  51. package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js +2 -2
  52. package/dist/collection/components/controls/verdocs-table/verdocs-table.js +2 -2
  53. package/dist/collection/components/controls/verdocs-tabs/verdocs-tabs.js +1 -1
  54. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +4 -4
  55. package/dist/collection/components/controls/verdocs-toggle/verdocs-toggle.js +1 -1
  56. package/dist/collection/components/controls/verdocs-toggle-button/verdocs-toggle-button.js +1 -1
  57. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.js +1 -1
  58. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.js +1 -1
  59. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
  60. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
  61. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
  62. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  63. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  64. package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +1 -1
  65. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  66. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +3 -8
  67. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  68. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +25 -28
  69. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +6 -11
  70. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
  71. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  72. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  73. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  74. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  75. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
  76. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  77. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  78. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +7 -7
  79. package/dist/components/{p-437dbf8a.js → p-044413dc.js} +10 -10
  80. package/dist/components/{p-437dbf8a.js.map → p-044413dc.js.map} +1 -1
  81. package/dist/components/{p-000bd55f.js → p-081465e0.js} +3 -3
  82. package/dist/components/{p-000bd55f.js.map → p-081465e0.js.map} +1 -1
  83. package/dist/components/{p-eebd0f45.js → p-08ddf0b4.js} +6 -6
  84. package/dist/components/{p-eebd0f45.js.map → p-08ddf0b4.js.map} +1 -1
  85. package/dist/components/{p-58e82c41.js → p-0a102a9c.js} +2 -2
  86. package/dist/components/{p-58e82c41.js.map → p-0a102a9c.js.map} +1 -1
  87. package/dist/components/{p-3c5f915c.js → p-1d98c6e0.js} +2 -2
  88. package/dist/components/{p-3c5f915c.js.map → p-1d98c6e0.js.map} +1 -1
  89. package/dist/components/{p-0b294954.js → p-1f5c7534.js} +12 -12
  90. package/dist/components/{p-0b294954.js.map → p-1f5c7534.js.map} +1 -1
  91. package/dist/components/{p-c085ff02.js → p-21fb933f.js} +9 -9
  92. package/dist/components/{p-c085ff02.js.map → p-21fb933f.js.map} +1 -1
  93. package/dist/components/{p-304cc99f.js → p-321e2d4e.js} +2 -2
  94. package/dist/components/{p-304cc99f.js.map → p-321e2d4e.js.map} +1 -1
  95. package/dist/components/{p-03019a61.js → p-39480096.js} +2 -2
  96. package/dist/components/{p-03019a61.js.map → p-39480096.js.map} +1 -1
  97. package/dist/components/{p-2b1f0cee.js → p-3d027cc9.js} +2 -2
  98. package/dist/components/{p-2b1f0cee.js.map → p-3d027cc9.js.map} +1 -1
  99. package/dist/components/{p-e5f47d0c.js → p-3e1e59cb.js} +7 -7
  100. package/dist/components/{p-e5f47d0c.js.map → p-3e1e59cb.js.map} +1 -1
  101. package/dist/components/{p-0e7eb15a.js → p-44e14cb9.js} +2 -2
  102. package/dist/components/{p-0e7eb15a.js.map → p-44e14cb9.js.map} +1 -1
  103. package/dist/components/{p-f1ceb128.js → p-4c08e92a.js} +3 -3
  104. package/dist/components/{p-f1ceb128.js.map → p-4c08e92a.js.map} +1 -1
  105. package/dist/components/{p-afe2384f.js → p-4f0db584.js} +10 -10
  106. package/dist/components/{p-afe2384f.js.map → p-4f0db584.js.map} +1 -1
  107. package/dist/components/{p-da190f9a.js → p-51c8b927.js} +5 -5
  108. package/dist/components/{p-da190f9a.js.map → p-51c8b927.js.map} +1 -1
  109. package/dist/components/{p-ad61d24b.js → p-54e4bcee.js} +2 -2
  110. package/dist/components/{p-ad61d24b.js.map → p-54e4bcee.js.map} +1 -1
  111. package/dist/components/{p-c2860587.js → p-57db7635.js} +3 -3
  112. package/dist/components/{p-c2860587.js.map → p-57db7635.js.map} +1 -1
  113. package/dist/components/{p-765eaeaf.js → p-589c545a.js} +24 -24
  114. package/dist/components/{p-765eaeaf.js.map → p-589c545a.js.map} +1 -1
  115. package/dist/components/{p-d0a95023.js → p-5faeacf0.js} +2 -2
  116. package/dist/components/{p-d0a95023.js.map → p-5faeacf0.js.map} +1 -1
  117. package/dist/components/{p-c6d2c2d3.js → p-61a2c23a.js} +2 -2
  118. package/dist/components/{p-c6d2c2d3.js.map → p-61a2c23a.js.map} +1 -1
  119. package/dist/components/{p-e415c52f.js → p-61cc000e.js} +5 -5
  120. package/dist/components/{p-e415c52f.js.map → p-61cc000e.js.map} +1 -1
  121. package/dist/components/{p-a045acfb.js → p-641e2cc0.js} +3 -3
  122. package/dist/components/{p-a045acfb.js.map → p-641e2cc0.js.map} +1 -1
  123. package/dist/components/{p-97383615.js → p-6cba6eef.js} +8 -8
  124. package/dist/components/{p-97383615.js.map → p-6cba6eef.js.map} +1 -1
  125. package/dist/components/{p-1f3b2431.js → p-80cad481.js} +10 -10
  126. package/dist/components/{p-1f3b2431.js.map → p-80cad481.js.map} +1 -1
  127. package/dist/components/{p-50815f3d.js → p-81979fe6.js} +2 -2
  128. package/dist/components/{p-50815f3d.js.map → p-81979fe6.js.map} +1 -1
  129. package/dist/components/{p-ae6ec4aa.js → p-84929e4a.js} +3 -3
  130. package/dist/components/{p-ae6ec4aa.js.map → p-84929e4a.js.map} +1 -1
  131. package/dist/components/{p-3f7340a9.js → p-8af753b4.js} +2 -2
  132. package/dist/components/{p-3f7340a9.js.map → p-8af753b4.js.map} +1 -1
  133. package/dist/components/{p-0a5c2d5b.js → p-9acf5a7e.js} +11 -11
  134. package/dist/components/{p-0a5c2d5b.js.map → p-9acf5a7e.js.map} +1 -1
  135. package/dist/components/{p-a9cd453d.js → p-a4c3e93a.js} +10 -10
  136. package/dist/components/{p-a9cd453d.js.map → p-a4c3e93a.js.map} +1 -1
  137. package/dist/components/{p-17b8bb5b.js → p-ab71430d.js} +7 -7
  138. package/dist/components/{p-17b8bb5b.js.map → p-ab71430d.js.map} +1 -1
  139. package/dist/components/{p-6e342167.js → p-afd663f1.js} +2 -2
  140. package/dist/components/{p-6e342167.js.map → p-afd663f1.js.map} +1 -1
  141. package/dist/components/{p-ce8eb9b3.js → p-b6d4072e.js} +11 -16
  142. package/dist/components/p-b6d4072e.js.map +1 -0
  143. package/dist/components/{p-96951ede.js → p-bd2df986.js} +2 -2
  144. package/dist/components/{p-96951ede.js.map → p-bd2df986.js.map} +1 -1
  145. package/dist/components/{p-bdf3134d.js → p-bebd9b19.js} +2 -2
  146. package/dist/components/{p-bdf3134d.js.map → p-bebd9b19.js.map} +1 -1
  147. package/dist/components/{p-97323182.js → p-bed9505d.js} +10 -10
  148. package/dist/components/{p-97323182.js.map → p-bed9505d.js.map} +1 -1
  149. package/dist/components/{p-c05c83fd.js → p-c4eab8f0.js} +26 -26
  150. package/dist/components/{p-c05c83fd.js.map → p-c4eab8f0.js.map} +1 -1
  151. package/dist/components/{p-74cd9648.js → p-c6d1cdb7.js} +3 -3
  152. package/dist/components/{p-74cd9648.js.map → p-c6d1cdb7.js.map} +1 -1
  153. package/dist/components/{p-94850428.js → p-ca701f0f.js} +10 -10
  154. package/dist/components/{p-94850428.js.map → p-ca701f0f.js.map} +1 -1
  155. package/dist/components/{p-dfc85c3a.js → p-d0280735.js} +12 -12
  156. package/dist/components/{p-dfc85c3a.js.map → p-d0280735.js.map} +1 -1
  157. package/dist/components/{p-2754edaf.js → p-d13f639e.js} +10 -10
  158. package/dist/components/{p-2754edaf.js.map → p-d13f639e.js.map} +1 -1
  159. package/dist/components/{p-7adcacae.js → p-d20bbc7d.js} +5 -5
  160. package/dist/components/{p-7adcacae.js.map → p-d20bbc7d.js.map} +1 -1
  161. package/dist/components/{p-6971dbe9.js → p-d990000f.js} +2 -2
  162. package/dist/components/{p-6971dbe9.js.map → p-d990000f.js.map} +1 -1
  163. package/dist/components/{p-2b916d4b.js → p-e1b7ca10.js} +3 -3
  164. package/dist/components/{p-2b916d4b.js.map → p-e1b7ca10.js.map} +1 -1
  165. package/dist/components/{p-70ab11ff.js → p-e2f386c6.js} +8 -8
  166. package/dist/components/{p-70ab11ff.js.map → p-e2f386c6.js.map} +1 -1
  167. package/dist/components/{p-558e89e2.js → p-e378a0ae.js} +25 -25
  168. package/dist/components/{p-558e89e2.js.map → p-e378a0ae.js.map} +1 -1
  169. package/dist/components/{p-183981f0.js → p-e6d9cbc0.js} +11 -11
  170. package/dist/components/{p-183981f0.js.map → p-e6d9cbc0.js.map} +1 -1
  171. package/dist/components/{p-3b23adcf.js → p-f007234d.js} +2 -2
  172. package/dist/components/{p-3b23adcf.js.map → p-f007234d.js.map} +1 -1
  173. package/dist/components/{p-d013a90c.js → p-f5ccf125.js} +2 -2
  174. package/dist/components/{p-d013a90c.js.map → p-f5ccf125.js.map} +1 -1
  175. package/dist/components/{p-a901880c.js → p-f776eeae.js} +4 -4
  176. package/dist/components/{p-a901880c.js.map → p-f776eeae.js.map} +1 -1
  177. package/dist/components/{p-29a7261a.js → p-f7dc9e74.js} +2 -2
  178. package/dist/components/{p-29a7261a.js.map → p-f7dc9e74.js.map} +1 -1
  179. package/dist/components/{p-151962d9.js → p-fd4e0e9b.js} +11 -16
  180. package/dist/components/p-fd4e0e9b.js.map +1 -0
  181. package/dist/components/verdocs-auth.js +3 -3
  182. package/dist/components/verdocs-build.js +42 -42
  183. package/dist/components/verdocs-button-panel.js +1 -1
  184. package/dist/components/verdocs-button.js +1 -1
  185. package/dist/components/verdocs-checkbox.js +1 -1
  186. package/dist/components/verdocs-component-error.js +1 -1
  187. package/dist/components/verdocs-contact-picker.js +1 -1
  188. package/dist/components/verdocs-dialog.js +1 -1
  189. package/dist/components/verdocs-dropdown.js +1 -1
  190. package/dist/components/verdocs-envelope-document-page.js +1 -1
  191. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  192. package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
  193. package/dist/components/verdocs-envelope-sidebar.js +8 -8
  194. package/dist/components/verdocs-envelopes-list.js +16 -16
  195. package/dist/components/verdocs-field-attachment.js +1 -1
  196. package/dist/components/verdocs-field-checkbox.js +1 -1
  197. package/dist/components/verdocs-field-date.js +1 -1
  198. package/dist/components/verdocs-field-dropdown.js +1 -1
  199. package/dist/components/verdocs-field-initial.js +1 -1
  200. package/dist/components/verdocs-field-payment.js +9 -9
  201. package/dist/components/verdocs-field-radio.js +1 -1
  202. package/dist/components/verdocs-field-signature.js +1 -1
  203. package/dist/components/verdocs-field-textarea.js +1 -1
  204. package/dist/components/verdocs-field-textbox.js +1 -1
  205. package/dist/components/verdocs-field-timestamp.js +1 -1
  206. package/dist/components/verdocs-file-chooser.js +1 -1
  207. package/dist/components/verdocs-help-icon.js +1 -1
  208. package/dist/components/verdocs-initial-dialog.js +1 -1
  209. package/dist/components/verdocs-kba-dialog.js +1 -1
  210. package/dist/components/verdocs-loader.js +1 -1
  211. package/dist/components/verdocs-menu-panel.js +1 -1
  212. package/dist/components/verdocs-multiselect.js +1 -1
  213. package/dist/components/verdocs-ok-dialog.js +1 -1
  214. package/dist/components/verdocs-organization-card.js +2 -2
  215. package/dist/components/verdocs-pagination.js +1 -1
  216. package/dist/components/verdocs-portal.js +1 -1
  217. package/dist/components/verdocs-preview.js +1 -1
  218. package/dist/components/verdocs-progress-bar.js +1 -1
  219. package/dist/components/verdocs-quick-filter.js +1 -1
  220. package/dist/components/verdocs-quick-functions.js +1 -1
  221. package/dist/components/verdocs-radio-button.js +1 -1
  222. package/dist/components/verdocs-search-box.js +1 -1
  223. package/dist/components/verdocs-search-tabs.js +1 -1
  224. package/dist/components/verdocs-select-input.js +1 -1
  225. package/dist/components/verdocs-send.js +1 -1
  226. package/dist/components/verdocs-sign.js +10 -10
  227. package/dist/components/verdocs-signature-dialog.js +1 -1
  228. package/dist/components/verdocs-spinner.js +1 -1
  229. package/dist/components/verdocs-status-indicator.js +1 -1
  230. package/dist/components/verdocs-switch.js +1 -1
  231. package/dist/components/verdocs-table.js +2 -2
  232. package/dist/components/verdocs-tabs.js +1 -1
  233. package/dist/components/verdocs-template-attachments.js +1 -1
  234. package/dist/components/verdocs-template-build-tabs.js +1 -1
  235. package/dist/components/verdocs-template-card.js +1 -1
  236. package/dist/components/verdocs-template-create.js +4 -4
  237. package/dist/components/verdocs-template-document-page.js +1 -1
  238. package/dist/components/verdocs-template-field-properties.js +1 -1
  239. package/dist/components/verdocs-template-fields.js +1 -1
  240. package/dist/components/verdocs-template-role-properties.js +1 -1
  241. package/dist/components/verdocs-template-roles.js +1 -1
  242. package/dist/components/verdocs-template-settings.js +1 -1
  243. package/dist/components/verdocs-template-star.js +1 -1
  244. package/dist/components/verdocs-template-tags.js +1 -1
  245. package/dist/components/verdocs-templates-list.js +17 -17
  246. package/dist/components/verdocs-text-input.js +1 -1
  247. package/dist/components/verdocs-toggle-button.js +1 -1
  248. package/dist/components/verdocs-toggle.js +1 -1
  249. package/dist/components/verdocs-toolbar-icon.js +1 -1
  250. package/dist/components/verdocs-upload-dialog.js +1 -1
  251. package/dist/components/verdocs-view.js +1 -1
  252. package/dist/esm/verdocs-button-panel_2.entry.js +3 -3
  253. package/dist/esm/verdocs-button_2.entry.js +2 -2
  254. package/dist/esm/verdocs-checkbox_6.entry.js +8 -8
  255. package/dist/esm/verdocs-contact-picker_2.entry.js +8 -13
  256. package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
  257. package/dist/esm/verdocs-dialog.entry.js +1 -1
  258. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  259. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  260. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  261. package/dist/esm/verdocs-field-attachment_13.entry.js +3 -3
  262. package/dist/esm/verdocs-file-chooser_2.entry.js +2 -2
  263. package/dist/esm/verdocs-menu-panel_2.entry.js +8 -8
  264. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  265. package/dist/esm/verdocs-organization-card_2.entry.js +2 -2
  266. package/dist/esm/verdocs-pagination_2.entry.js +2 -2
  267. package/dist/esm/verdocs-preview_7.entry.js +3 -8
  268. package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
  269. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  270. package/dist/esm/verdocs-radio-button.entry.js +1 -1
  271. package/dist/esm/verdocs-search-box.entry.js +1 -1
  272. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  273. package/dist/esm/verdocs-spinner.entry.js +1 -1
  274. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  275. package/dist/esm/verdocs-switch.entry.js +2 -2
  276. package/dist/esm/verdocs-table.entry.js +2 -2
  277. package/dist/esm/verdocs-template-card.entry.js +1 -1
  278. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  279. package/dist/esm/verdocs-template-star.entry.js +1 -1
  280. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  281. package/dist/esm/verdocs-templates-list.entry.js +7 -7
  282. package/dist/esm/verdocs-toggle-button.entry.js +1 -1
  283. package/dist/esm/verdocs-toggle.entry.js +1 -1
  284. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  285. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  286. package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -1
  287. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  288. package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
  289. package/dist/esm-es5/verdocs-dialog.entry.js +1 -1
  290. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  291. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  292. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  293. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  294. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  295. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  296. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  297. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  298. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  299. package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
  300. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
  301. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  302. package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
  303. package/dist/esm-es5/verdocs-search-box.entry.js +1 -1
  304. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  305. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  306. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  307. package/dist/esm-es5/verdocs-switch.entry.js +1 -1
  308. package/dist/esm-es5/verdocs-table.entry.js +1 -1
  309. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  310. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  311. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  312. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  313. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  314. package/dist/esm-es5/verdocs-toggle-button.entry.js +1 -1
  315. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  316. package/dist/verdocs-web-sdk/{p-3db0b317.system.entry.js → p-00b95f75.system.entry.js} +2 -2
  317. package/dist/verdocs-web-sdk/{p-24e23530.entry.js → p-04790b68.entry.js} +2 -2
  318. package/dist/verdocs-web-sdk/{p-c4611444.entry.js → p-0baacb99.entry.js} +2 -2
  319. package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
  320. package/dist/verdocs-web-sdk/{p-82f1d16b.system.entry.js → p-0e485d1a.system.entry.js} +2 -2
  321. package/dist/verdocs-web-sdk/{p-e1f7bad5.system.entry.js → p-195cd4f4.system.entry.js} +2 -2
  322. package/dist/verdocs-web-sdk/{p-5123d213.entry.js → p-2415315d.entry.js} +2 -2
  323. package/dist/verdocs-web-sdk/{p-e310133f.system.entry.js → p-296b3f1d.system.entry.js} +2 -2
  324. package/dist/verdocs-web-sdk/{p-2f67a7eb.entry.js → p-2c9254a9.entry.js} +2 -2
  325. package/dist/verdocs-web-sdk/{p-25b62800.system.entry.js → p-2d33195d.system.entry.js} +2 -2
  326. package/dist/verdocs-web-sdk/{p-46181718.entry.js → p-2df97f4e.entry.js} +2 -2
  327. package/dist/verdocs-web-sdk/{p-40faf935.entry.js → p-2e2e6d95.entry.js} +2 -2
  328. package/dist/verdocs-web-sdk/{p-97f961f6.entry.js → p-2f5b24db.entry.js} +2 -2
  329. package/dist/verdocs-web-sdk/{p-b5bc29df.entry.js → p-330c1f00.entry.js} +2 -2
  330. package/dist/verdocs-web-sdk/{p-eb93d051.entry.js → p-337a452e.entry.js} +2 -2
  331. package/dist/verdocs-web-sdk/{p-de487077.system.entry.js → p-36a10b78.system.entry.js} +2 -2
  332. package/dist/verdocs-web-sdk/{p-3511ef15.entry.js → p-4d240e20.entry.js} +2 -2
  333. package/dist/verdocs-web-sdk/{p-06618ff6.entry.js → p-517a9262.entry.js} +2 -2
  334. package/dist/verdocs-web-sdk/{p-3006405d.system.entry.js → p-5a639d78.system.entry.js} +2 -2
  335. package/dist/verdocs-web-sdk/{p-3f1560d1.system.entry.js → p-5fd67b04.system.entry.js} +2 -2
  336. package/dist/verdocs-web-sdk/{p-13e53d8b.system.entry.js → p-63fe0290.system.entry.js} +2 -2
  337. package/dist/verdocs-web-sdk/p-63fe0290.system.entry.js.map +1 -0
  338. package/dist/verdocs-web-sdk/{p-54fc4cdb.system.entry.js → p-644444fe.system.entry.js} +2 -2
  339. package/dist/verdocs-web-sdk/{p-1257494a.system.entry.js → p-796daf3e.system.entry.js} +2 -2
  340. package/dist/verdocs-web-sdk/{p-a5ce8ad2.system.entry.js → p-79d2f425.system.entry.js} +2 -2
  341. package/dist/verdocs-web-sdk/{p-a557de10.entry.js → p-7b7451fb.entry.js} +2 -2
  342. package/dist/verdocs-web-sdk/{p-0c9a2435.system.entry.js → p-7ba1b23c.system.entry.js} +2 -2
  343. package/dist/verdocs-web-sdk/p-82c88c0f.entry.js +2 -0
  344. package/dist/verdocs-web-sdk/{p-99833353.entry.js.map → p-82c88c0f.entry.js.map} +1 -1
  345. package/dist/verdocs-web-sdk/{p-1606cff5.entry.js → p-84d305e4.entry.js} +2 -2
  346. package/dist/verdocs-web-sdk/{p-6a4e6c08.entry.js → p-866d2139.entry.js} +2 -2
  347. package/dist/verdocs-web-sdk/{p-2472a2c9.entry.js → p-923cc826.entry.js} +2 -2
  348. package/dist/verdocs-web-sdk/{p-5eeaab1b.system.entry.js → p-92d7a42f.system.entry.js} +2 -2
  349. package/dist/verdocs-web-sdk/p-92d7a42f.system.entry.js.map +1 -0
  350. package/dist/verdocs-web-sdk/{p-5ba5db60.system.entry.js → p-94757826.system.entry.js} +2 -2
  351. package/dist/verdocs-web-sdk/{p-247612d3.entry.js → p-96ca1ce2.entry.js} +2 -2
  352. package/dist/verdocs-web-sdk/{p-fc5f4ba3.system.entry.js → p-9a955b58.system.entry.js} +2 -2
  353. package/dist/verdocs-web-sdk/{p-0bb2c05f.entry.js → p-9f2cb0de.entry.js} +2 -2
  354. package/dist/verdocs-web-sdk/{p-55628a5d.system.entry.js → p-a1f9578c.system.entry.js} +2 -2
  355. package/dist/verdocs-web-sdk/{p-f025a0cf.entry.js → p-a678a1f5.entry.js} +2 -2
  356. package/dist/verdocs-web-sdk/p-a678a1f5.entry.js.map +1 -0
  357. package/dist/verdocs-web-sdk/{p-a3b0707c.system.entry.js → p-ac10a0b5.system.entry.js} +2 -2
  358. package/dist/verdocs-web-sdk/{p-58a2db01.system.entry.js → p-ad04e403.system.entry.js} +2 -2
  359. package/dist/verdocs-web-sdk/{p-37257780.system.entry.js → p-add6e890.system.entry.js} +2 -2
  360. package/dist/verdocs-web-sdk/{p-cf22ad7c.entry.js → p-af41b404.entry.js} +2 -2
  361. package/dist/verdocs-web-sdk/{p-efa889fa.entry.js → p-af554563.entry.js} +2 -2
  362. package/dist/verdocs-web-sdk/{p-562cfc4d.entry.js → p-af9cc642.entry.js} +2 -2
  363. package/dist/verdocs-web-sdk/p-b23e0b35.entry.js +2 -0
  364. package/dist/verdocs-web-sdk/p-b23e0b35.entry.js.map +1 -0
  365. package/dist/verdocs-web-sdk/{p-5cc96b67.system.entry.js → p-b4441084.system.entry.js} +2 -2
  366. package/dist/verdocs-web-sdk/{p-49066700.system.entry.js → p-ba7f0fce.system.entry.js} +2 -2
  367. package/dist/verdocs-web-sdk/{p-e4c8f7d0.system.entry.js → p-c397c96b.system.entry.js} +2 -2
  368. package/dist/verdocs-web-sdk/{p-9714d5e1.entry.js → p-ca45c312.entry.js} +2 -2
  369. package/dist/verdocs-web-sdk/{p-861e96ae.system.entry.js → p-d2a9d5cf.system.entry.js} +2 -2
  370. package/dist/verdocs-web-sdk/{p-8c3fd266.entry.js → p-d6f70ede.entry.js} +2 -2
  371. package/dist/verdocs-web-sdk/{p-32408493.entry.js → p-d8e59850.entry.js} +2 -2
  372. package/dist/verdocs-web-sdk/{p-6d2f24a3.system.entry.js → p-dac155a6.system.entry.js} +2 -2
  373. package/dist/verdocs-web-sdk/{p-6c31cfa8.system.entry.js → p-db383816.system.entry.js} +2 -2
  374. package/dist/verdocs-web-sdk/{p-8a726ba0.entry.js → p-df70c2ea.entry.js} +2 -2
  375. package/dist/verdocs-web-sdk/{p-26d1f777.system.entry.js → p-e3687c26.system.entry.js} +2 -2
  376. package/dist/verdocs-web-sdk/{p-ff64d950.entry.js → p-e43a184d.entry.js} +2 -2
  377. package/dist/verdocs-web-sdk/p-efda4a21.entry.js +2 -0
  378. package/dist/verdocs-web-sdk/{p-de127480.system.entry.js → p-f5290d34.system.entry.js} +2 -2
  379. package/dist/verdocs-web-sdk/{p-1267a3e8.system.entry.js → p-f9aaeb81.system.entry.js} +2 -2
  380. package/dist/verdocs-web-sdk/{p-097d1584.entry.js → p-f9d56a3c.entry.js} +2 -2
  381. package/dist/verdocs-web-sdk/{p-ee9478db.system.entry.js → p-fb577d62.system.entry.js} +2 -2
  382. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  383. package/package.json +1 -1
  384. package/dist/components/p-151962d9.js.map +0 -1
  385. package/dist/components/p-ce8eb9b3.js.map +0 -1
  386. package/dist/verdocs-web-sdk/p-06febcca.entry.js +0 -2
  387. package/dist/verdocs-web-sdk/p-13e53d8b.system.entry.js.map +0 -1
  388. package/dist/verdocs-web-sdk/p-5eeaab1b.system.entry.js.map +0 -1
  389. package/dist/verdocs-web-sdk/p-8ced0c16.entry.js +0 -2
  390. package/dist/verdocs-web-sdk/p-8ced0c16.entry.js.map +0 -1
  391. package/dist/verdocs-web-sdk/p-99833353.entry.js +0 -2
  392. package/dist/verdocs-web-sdk/p-f025a0cf.entry.js.map +0 -1
  393. /package/dist/verdocs-web-sdk/{p-3db0b317.system.entry.js.map → p-00b95f75.system.entry.js.map} +0 -0
  394. /package/dist/verdocs-web-sdk/{p-24e23530.entry.js.map → p-04790b68.entry.js.map} +0 -0
  395. /package/dist/verdocs-web-sdk/{p-c4611444.entry.js.map → p-0baacb99.entry.js.map} +0 -0
  396. /package/dist/verdocs-web-sdk/{p-82f1d16b.system.entry.js.map → p-0e485d1a.system.entry.js.map} +0 -0
  397. /package/dist/verdocs-web-sdk/{p-e1f7bad5.system.entry.js.map → p-195cd4f4.system.entry.js.map} +0 -0
  398. /package/dist/verdocs-web-sdk/{p-5123d213.entry.js.map → p-2415315d.entry.js.map} +0 -0
  399. /package/dist/verdocs-web-sdk/{p-e310133f.system.entry.js.map → p-296b3f1d.system.entry.js.map} +0 -0
  400. /package/dist/verdocs-web-sdk/{p-2f67a7eb.entry.js.map → p-2c9254a9.entry.js.map} +0 -0
  401. /package/dist/verdocs-web-sdk/{p-25b62800.system.entry.js.map → p-2d33195d.system.entry.js.map} +0 -0
  402. /package/dist/verdocs-web-sdk/{p-46181718.entry.js.map → p-2df97f4e.entry.js.map} +0 -0
  403. /package/dist/verdocs-web-sdk/{p-40faf935.entry.js.map → p-2e2e6d95.entry.js.map} +0 -0
  404. /package/dist/verdocs-web-sdk/{p-97f961f6.entry.js.map → p-2f5b24db.entry.js.map} +0 -0
  405. /package/dist/verdocs-web-sdk/{p-b5bc29df.entry.js.map → p-330c1f00.entry.js.map} +0 -0
  406. /package/dist/verdocs-web-sdk/{p-eb93d051.entry.js.map → p-337a452e.entry.js.map} +0 -0
  407. /package/dist/verdocs-web-sdk/{p-de487077.system.entry.js.map → p-36a10b78.system.entry.js.map} +0 -0
  408. /package/dist/verdocs-web-sdk/{p-3511ef15.entry.js.map → p-4d240e20.entry.js.map} +0 -0
  409. /package/dist/verdocs-web-sdk/{p-06618ff6.entry.js.map → p-517a9262.entry.js.map} +0 -0
  410. /package/dist/verdocs-web-sdk/{p-3006405d.system.entry.js.map → p-5a639d78.system.entry.js.map} +0 -0
  411. /package/dist/verdocs-web-sdk/{p-3f1560d1.system.entry.js.map → p-5fd67b04.system.entry.js.map} +0 -0
  412. /package/dist/verdocs-web-sdk/{p-54fc4cdb.system.entry.js.map → p-644444fe.system.entry.js.map} +0 -0
  413. /package/dist/verdocs-web-sdk/{p-1257494a.system.entry.js.map → p-796daf3e.system.entry.js.map} +0 -0
  414. /package/dist/verdocs-web-sdk/{p-a5ce8ad2.system.entry.js.map → p-79d2f425.system.entry.js.map} +0 -0
  415. /package/dist/verdocs-web-sdk/{p-a557de10.entry.js.map → p-7b7451fb.entry.js.map} +0 -0
  416. /package/dist/verdocs-web-sdk/{p-0c9a2435.system.entry.js.map → p-7ba1b23c.system.entry.js.map} +0 -0
  417. /package/dist/verdocs-web-sdk/{p-1606cff5.entry.js.map → p-84d305e4.entry.js.map} +0 -0
  418. /package/dist/verdocs-web-sdk/{p-6a4e6c08.entry.js.map → p-866d2139.entry.js.map} +0 -0
  419. /package/dist/verdocs-web-sdk/{p-2472a2c9.entry.js.map → p-923cc826.entry.js.map} +0 -0
  420. /package/dist/verdocs-web-sdk/{p-5ba5db60.system.entry.js.map → p-94757826.system.entry.js.map} +0 -0
  421. /package/dist/verdocs-web-sdk/{p-247612d3.entry.js.map → p-96ca1ce2.entry.js.map} +0 -0
  422. /package/dist/verdocs-web-sdk/{p-fc5f4ba3.system.entry.js.map → p-9a955b58.system.entry.js.map} +0 -0
  423. /package/dist/verdocs-web-sdk/{p-0bb2c05f.entry.js.map → p-9f2cb0de.entry.js.map} +0 -0
  424. /package/dist/verdocs-web-sdk/{p-55628a5d.system.entry.js.map → p-a1f9578c.system.entry.js.map} +0 -0
  425. /package/dist/verdocs-web-sdk/{p-a3b0707c.system.entry.js.map → p-ac10a0b5.system.entry.js.map} +0 -0
  426. /package/dist/verdocs-web-sdk/{p-58a2db01.system.entry.js.map → p-ad04e403.system.entry.js.map} +0 -0
  427. /package/dist/verdocs-web-sdk/{p-37257780.system.entry.js.map → p-add6e890.system.entry.js.map} +0 -0
  428. /package/dist/verdocs-web-sdk/{p-cf22ad7c.entry.js.map → p-af41b404.entry.js.map} +0 -0
  429. /package/dist/verdocs-web-sdk/{p-efa889fa.entry.js.map → p-af554563.entry.js.map} +0 -0
  430. /package/dist/verdocs-web-sdk/{p-562cfc4d.entry.js.map → p-af9cc642.entry.js.map} +0 -0
  431. /package/dist/verdocs-web-sdk/{p-5cc96b67.system.entry.js.map → p-b4441084.system.entry.js.map} +0 -0
  432. /package/dist/verdocs-web-sdk/{p-49066700.system.entry.js.map → p-ba7f0fce.system.entry.js.map} +0 -0
  433. /package/dist/verdocs-web-sdk/{p-e4c8f7d0.system.entry.js.map → p-c397c96b.system.entry.js.map} +0 -0
  434. /package/dist/verdocs-web-sdk/{p-9714d5e1.entry.js.map → p-ca45c312.entry.js.map} +0 -0
  435. /package/dist/verdocs-web-sdk/{p-861e96ae.system.entry.js.map → p-d2a9d5cf.system.entry.js.map} +0 -0
  436. /package/dist/verdocs-web-sdk/{p-8c3fd266.entry.js.map → p-d6f70ede.entry.js.map} +0 -0
  437. /package/dist/verdocs-web-sdk/{p-32408493.entry.js.map → p-d8e59850.entry.js.map} +0 -0
  438. /package/dist/verdocs-web-sdk/{p-6d2f24a3.system.entry.js.map → p-dac155a6.system.entry.js.map} +0 -0
  439. /package/dist/verdocs-web-sdk/{p-6c31cfa8.system.entry.js.map → p-db383816.system.entry.js.map} +0 -0
  440. /package/dist/verdocs-web-sdk/{p-8a726ba0.entry.js.map → p-df70c2ea.entry.js.map} +0 -0
  441. /package/dist/verdocs-web-sdk/{p-26d1f777.system.entry.js.map → p-e3687c26.system.entry.js.map} +0 -0
  442. /package/dist/verdocs-web-sdk/{p-ff64d950.entry.js.map → p-e43a184d.entry.js.map} +0 -0
  443. /package/dist/verdocs-web-sdk/{p-06febcca.entry.js.map → p-efda4a21.entry.js.map} +0 -0
  444. /package/dist/verdocs-web-sdk/{p-de127480.system.entry.js.map → p-f5290d34.system.entry.js.map} +0 -0
  445. /package/dist/verdocs-web-sdk/{p-1267a3e8.system.entry.js.map → p-f9aaeb81.system.entry.js.map} +0 -0
  446. /package/dist/verdocs-web-sdk/{p-097d1584.entry.js.map → p-f9d56a3c.entry.js.map} +0 -0
  447. /package/dist/verdocs-web-sdk/{p-ee9478db.system.entry.js.map → p-fb577d62.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";import{VerdocsEndpoint}from"@verdocs/js-sdk";import{u as unicodeNBSP}from"./Icons-faf0377f.js";var verdocsFileChooserCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}';var VerdocsFileChooserStyle0=verdocsFileChooserCss;var VerdocsFileChooser=function(){function e(e){registerInstance(this,e);this.fileSelected=createEvent(this,"fileSelected",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleFileChanged=function(e){var r,o;this.file=((r=e.target.files)===null||r===void 0?void 0:r[0])||null;(o=this.fileSelected)===null||o===void 0?void 0:o.emit({file:this.file});console.debug("[CHOOSER] Selected file",this.file)};e.prototype.handleSelectFile=function(e){var r,o;e.stopPropagation();this.file=null;(r=this.fileSelected)===null||r===void 0?void 0:r.emit({file:null});(o=document.getElementById("verdocs-file-chooser"))===null||o===void 0?void 0:o.click()};e.prototype.render=function(){var e=this;var r=this.file?"Select a different file":"Select a file from your computer";return h(Host,{key:"193c771d4f6da75c045295ebedadd31b90acee4f"},h("input",{key:"94cc9d419b15de25763b7d6347b8b88a2c54234d",type:"file",multiple:true,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:function(r){return e.handleFileChanged(r)}}),h("div",{key:"befdb80389deef16728b8591400953fdc141f644",class:"upload-box"},h("div",{key:"b065c35caef733d346ac1f788043f0b620a6b503",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),h("div",{key:"acbaa900429925b6a9c416620c82f81f64a2f4eb",class:"or-prefer"},this.file?unicodeNBSP:"Or, if you prefer..."),h("verdocs-button",{key:"2ff422a21e6987e3f348d85acb6394f4bfebbcc0",label:r,size:"small",onClick:function(r){return e.handleSelectFile(r)}})))};return e}();VerdocsFileChooser.style=VerdocsFileChooserStyle0;var verdocsProgressBarCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-progress-bar{font-family:"Inter", "Barlow", sans-serif;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-progress-bar .labels{display:-ms-flexbox;display:flex;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-progress-bar .labels .label{display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin-right:8px;color:#33364b}verdocs-progress-bar .bar{display:-ms-flexbox;display:flex;-ms-flex:0 0 10px;flex:0 0 10px;border-radius:5px;background-color:#cccccc}verdocs-progress-bar .bar .slider{display:-ms-flexbox;display:flex;border-radius:5px;background-color:#55bc81}';var VerdocsProgressBarStyle0=verdocsProgressBarCss;var VerdocsProgressBar=function(){function e(e){registerInstance(this,e);this.label="";this.showPercent=false;this.percent=0}e.prototype.render=function(){var e=Math.ceil(100*Math.min(this.percent,100)/100);console.log("Rendering progress bar",{widthPercent:e,label:this.label,showPercent:this.showPercent,percent:this.percent});return h(Host,{key:"edf1b53f1ef7c559ba3e279661be5f177df81fc3"},h("div",{key:"a94d1b730c9702317f58cafc29de93f9e2d04aa1",class:"labels"},this.label&&h("div",{key:"ebb544b3966ca08d0995c40cdee70fd9eed5df1f",class:"label"},this.label),this.showPercent&&h("div",{key:"e14874dab43de11c3437583d1a4207d9c8b8cee9",class:"label"},this.percent,"%")),h("div",{key:"9df97ccf5639126dc40d42c1c261a40204aa92b0",class:"bar"},h("div",{key:"60b8eaaeb8105899dd30d5f78eda44818309129d",class:"slider",style:{width:"".concat(e,"%")}})))};return e}();VerdocsProgressBar.style=VerdocsProgressBarStyle0;export{VerdocsFileChooser as verdocs_file_chooser,VerdocsProgressBar as verdocs_progress_bar};
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";import{VerdocsEndpoint}from"@verdocs/js-sdk";import{u as unicodeNBSP}from"./Icons-faf0377f.js";var verdocsFileChooserCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}';var VerdocsFileChooserStyle0=verdocsFileChooserCss;var VerdocsFileChooser=function(){function e(e){registerInstance(this,e);this.fileSelected=createEvent(this,"fileSelected",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleFileChanged=function(e){var r,o;this.file=((r=e.target.files)===null||r===void 0?void 0:r[0])||null;(o=this.fileSelected)===null||o===void 0?void 0:o.emit({file:this.file});console.debug("[CHOOSER] Selected file",this.file)};e.prototype.handleSelectFile=function(e){var r,o;e.stopPropagation();this.file=null;(r=this.fileSelected)===null||r===void 0?void 0:r.emit({file:null});(o=document.getElementById("verdocs-file-chooser"))===null||o===void 0?void 0:o.click()};e.prototype.render=function(){var e=this;var r=this.file?"Select a different file":"Select a file from your computer";return h(Host,{key:"8fc35845fc90db5ea86a900353a707136e1688f4"},h("input",{key:"08696432f96839fa186d24a094f1bad719a1e019",type:"file",multiple:true,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:function(r){return e.handleFileChanged(r)}}),h("div",{key:"d52c04ad541fffc0981de9738bf8a4cd181324a7",class:"upload-box"},h("div",{key:"145b2fcf28eb8973703c1ec02eb39a08fd8f67ce",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),h("div",{key:"f4f74ef29fe3415ecbb8f667a2fa33707ace3e09",class:"or-prefer"},this.file?unicodeNBSP:"Or, if you prefer..."),h("verdocs-button",{key:"40b2d48aa5a9ba4d67e2a2512e8f0d9daf2584fe",label:r,size:"small",onClick:function(r){return e.handleSelectFile(r)}})))};return e}();VerdocsFileChooser.style=VerdocsFileChooserStyle0;var verdocsProgressBarCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-progress-bar{font-family:"Inter", "Barlow", sans-serif;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-progress-bar .labels{display:-ms-flexbox;display:flex;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-progress-bar .labels .label{display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin-right:8px;color:#33364b}verdocs-progress-bar .bar{display:-ms-flexbox;display:flex;-ms-flex:0 0 10px;flex:0 0 10px;border-radius:5px;background-color:#cccccc}verdocs-progress-bar .bar .slider{display:-ms-flexbox;display:flex;border-radius:5px;background-color:#55bc81}';var VerdocsProgressBarStyle0=verdocsProgressBarCss;var VerdocsProgressBar=function(){function e(e){registerInstance(this,e);this.label="";this.showPercent=false;this.percent=0}e.prototype.render=function(){var e=Math.ceil(100*Math.min(this.percent,100)/100);console.log("Rendering progress bar",{widthPercent:e,label:this.label,showPercent:this.showPercent,percent:this.percent});return h(Host,{key:"c57b566587b7fe5f95f7082964dc7d27c46008cb"},h("div",{key:"b44243b4c65cdd5ddb7a47028db07e47e1c9373b",class:"labels"},this.label&&h("div",{key:"58715d2cd0a47260618472ed06d3eeda095ea852",class:"label"},this.label),this.showPercent&&h("div",{key:"38b9fa2f2180eee29cdc6aff0562475c9d6cc943",class:"label"},this.percent,"%")),h("div",{key:"1258f3696cb5852865e7d1af59bf2acb7acfda50",class:"bar"},h("div",{key:"eb1346d2b9f7ccce786c358ef247fd3ec62de67f",class:"slider",style:{width:"".concat(e,"%")}})))};return e}();VerdocsProgressBar.style=VerdocsProgressBarStyle0;export{VerdocsFileChooser as verdocs_file_chooser,VerdocsProgressBar as verdocs_progress_bar};
2
2
  //# sourceMappingURL=verdocs-file-chooser_2.entry.js.map
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(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(o.next(e))}catch(e){s(e)}}function a(e){try{l(o["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(e.value).then(n,a)}l((o=o.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:[]},o,r,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(a){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(o=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{o=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";import{VerdocsEndpoint,getTemplate,updateTemplateRole,deleteTemplateRole,isValidEmail}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-1db52f58.js";var verdocsMenuPanelCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}#verdocs-menu-panel-overlay{top:0;left:0;width:100%;height:100%;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.4980392157)}#verdocs-menu-panel{opacity:0;z-index:10001;position:fixed;overflow-y:scroll;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-animation:showVerdocsMenuPanel 0.35s;-webkit-animation-fill-mode:forwards}@-webkit-keyframes showVerdocsMenuPanel{0%{opacity:0;right:-300px}100%{right:0;opacity:1}}';var VerdocsMenuPanelStyle0=verdocsMenuPanelCss;var VerdocsMenuPanel=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.moved=false;this.overlayId="verdocs-menu-panel-overlay";this.panelId="verdocs-menu-panel";this.side="right";this.overlay=true;this.width=300}e.prototype.handleClick=function(e){var t;if(!this.element.contains(e.target)){this.hide();(t=this.close)===null||t===void 0?void 0:t.emit()}};e.prototype.componentWillLoad=function(){this.hide();if(this.overlay){this.portal=document.createElement("div");this.portal.setAttribute("id",this.overlayId);document.body.append(this.portal)}this.portal=document.createElement("div");this.portal.setAttribute("id",this.panelId);this.portal.style.top="0px";this.portal.style.bottom="0px";this.portal.style.width="".concat(this.width,"px");if(this.side==="left"){this.portal.style.left="0px"}else{this.portal.style.right="0px"}document.body.append(this.portal)};e.prototype.componentDidLoad=function(){this.portal.appendChild(this.element)};e.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};e.prototype.hide=function(){var e,t;(e=document.getElementById(this.overlayId))===null||e===void 0?void 0:e.remove();(t=document.getElementById(this.panelId))===null||t===void 0?void 0:t.remove()};e.prototype.render=function(){var e=this;return h(Host,{key:"7af689ac218611d0c7d4674484d86773d3db1d44",ref:function(t){return e.element=t}},h("slot",{key:"77d1b36d9000b0df6d21fc2eee55a97a4181ca47"}))};return e}();VerdocsMenuPanel.style=VerdocsMenuPanelStyle0;var verdocsTemplateRolePropertiesCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}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:justify;justify-content:space-between}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form{gap:15px;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-role-properties form .instructions{margin:7px 0 0 0;font-size:12px;font-style:italic}verdocs-template-role-properties form .input-label{display:block;font-size:14px;-ms-flex:0 0 100px;flex:0 0 100px;font-weight:700;margin:0 0 4px 0;color:#555570}verdocs-template-role-properties form .first-last{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form verdocs-help-icon{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-role-properties verdocs-select-input label{display:block}verdocs-template-role-properties verdocs-text-input{margin:0}verdocs-template-role-properties verdocs-text-input label{display:block}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var VerdocsTemplateRolePropertiesStyle0=verdocsTemplateRolePropertiesCss;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.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.roleName="";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{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]}this.listenToTemplate()}catch(o){console.log("[ROLES Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[ROLES] Loading tempate",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var i;console.log("[BUILD] Template Updated",t);e.template=t;e.loading=false;var o=(i=e.template)===null||i===void 0?void 0:i.roles.find((function(t){return t.name===e.roleName}));if(o){e.name=o.name;e.type=o.type;e.first_name=o.first_name;e.last_name=o.last_name;e.email=o.email;e.phone=o.phone;e.delegator=o.delegator;console.log("[ROLES] Editing role",o)}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.handleCancel=function(e){var t=this;var i,o;e.stopPropagation();var r=(i=this.template)===null||i===void 0?void 0:i.roles.find((function(e){return e.name===t.roleName}));if(r){this.name=r.name;this.type=r.type;this.first_name=r.first_name;this.last_name=r.last_name;this.email=r.email;this.phone=r.phone;this.delegator=r.delegator}this.dirty=false;(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=this;return __generator(this,(function(i){e.stopPropagation();this.saving=true;updateTemplateRole(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t,i,o;var r=this;return __generator(this,(function(s){console.log("[ROLES] Update result",e);this.saving=false;this.dirty=false;i=JSON.parse(JSON.stringify(this.template));o=i.roles.findIndex((function(e){return e.name===r.roleName}));if(o>-1){i.roles[o]=e}Store.updateTemplate(this.templateId,i);(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}))}))})).catch((function(e){console.log("[ROLES 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(i){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.")){deleteTemplateRole(this.endpoint,this.templateId,this.roleName).then((function(){var e,i;var o=JSON.parse(JSON.stringify(t.template));o.roles=o.roles.filter((function(e){return e.name!==t.roleName}));Store.getTemplate(t.endpoint,t.templateId,true);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(i=t.close)===null||i===void 0?void 0:i.emit()})).catch((function(e){console.log("[ROLES Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;var i=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).some((function(t){return t.role_name===e.roleName}));var o=!this.email&&!this.first_name&&!this.last_name||isValidEmail(this.email)&&!!this.first_name&&!!this.last_name;return h(Host,{key:"1ad55cc14a30cd9a7be12d8adf56ce83361ca223"},h("form",{key:"f43ca7546c1d5c28b45dfb17e18cd1b7404601b7",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"8f3248ac163e1b90fd2311cfdbbaaa03f5545981"},h("verdocs-text-input",{key:"a73fce39e7070844da9bda975ac1ebb8ccd21eea",id:"verdocs-role-name",label:"Role Name (Must be unique)",value:this.name,autocomplete:"off",disabled:i,placeholder:"Role Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),i&&h("div",{key:"45e3b1a720d24f6bf80793736f439b25d02cd761",class:"instructions"},"This role has fields assigned and can no longer be renamed.")),h("div",{key:"84e8e7228127c6e7eb0ff988cf101c3b01f94722"},h("div",{key:"54662ff3d0a5299a64f00fce052beb157efbe2c3",class:"input-label"},"Type:"),h("verdocs-select-input",{key:"63f857624912c84d859799c02de0b2cff14201f6",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("div",{key:"6da9230ff385d2c4c4b9e916d2318fbb94a545d0"},h("div",{key:"6d222a2c12182d8c26954c80b5ef493eaf960a53",class:"input-label"},"Default Contact Info:"),h("div",{key:"407e291c353ccfd49f5777ad1bea9c1b3fb2800b",class:"first-last"},h("verdocs-text-input",{key:"6e3a55ff43490e4202293fd4f81e26a7e9897431",id:"verdocs-recipient-first",value:this.first_name,autocomplete:"off",placeholder:"First...",onInput:function(t){e.first_name=t.target.value;e.dirty=true}}),h("verdocs-text-input",{key:"f01e095ddb71525e6c032edebdef106d6b8be46f",id:"verdocs-recipient-first",value:this.last_name,autocomplete:"off",placeholder:"Last...",onInput:function(t){e.last_name=t.target.value;e.dirty=true}}))),h("div",{key:"3ca6ab94243a2841a7e330c48d30a00ff3ab5c18"},h("verdocs-text-input",{key:"28dd98491e99fbea7b140553fdccdc1b783a9d1f",id:"verdocs-recipient-email",value:this.email,autocomplete:"off",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),h("div",{key:"32035f36e92471ff6bd3f9e03c4a40e20856624b",style:{height:"15px"}}),h("div",{key:"c65ed4a1d2c7961303fdf8f72dfaa9921c18cc1c"},h("verdocs-text-input",{key:"55d51882fb166870a57e6761111008ae2a048c9a",id:"verdocs-recipient-phone",value:this.phone,autocomplete:"off",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}))),h("div",{key:"c60f5b4e51021e3ce3d18eb55e17513b6fc836c1",class:"buttons"},h("button",{key:"c81a324c051f6f61988beaef648226a5a688ae60",class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{key:"6b6c1e98202cc6d4ddfa1ebfd371cdbc322ef618",style:{flex:"1"}}),h("verdocs-button",{key:"a2049051f318bc992a6a064d181fc48951c39d2b",size:"small",label:"Save",disabled:!this.dirty||!o,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateRoleProperties.style=VerdocsTemplateRolePropertiesStyle0;export{VerdocsMenuPanel as verdocs_menu_panel,VerdocsTemplateRoleProperties as verdocs_template_role_properties};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(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(o.next(e))}catch(e){s(e)}}function a(e){try{l(o["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(e.value).then(n,a)}l((o=o.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:[]},o,r,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(a){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(o=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{o=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";import{VerdocsEndpoint,getTemplate,updateTemplateRole,deleteTemplateRole,isValidEmail}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-1db52f58.js";var verdocsMenuPanelCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}#verdocs-menu-panel-overlay{top:0;left:0;width:100%;height:100%;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.4980392157)}#verdocs-menu-panel{opacity:0;z-index:10001;position:fixed;overflow-y:scroll;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-animation:showVerdocsMenuPanel 0.35s;-webkit-animation-fill-mode:forwards}@-webkit-keyframes showVerdocsMenuPanel{0%{opacity:0;right:-300px}100%{right:0;opacity:1}}';var VerdocsMenuPanelStyle0=verdocsMenuPanelCss;var VerdocsMenuPanel=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.moved=false;this.overlayId="verdocs-menu-panel-overlay";this.panelId="verdocs-menu-panel";this.side="right";this.overlay=true;this.width=300}e.prototype.handleClick=function(e){var t;if(!this.element.contains(e.target)){this.hide();(t=this.close)===null||t===void 0?void 0:t.emit()}};e.prototype.componentWillLoad=function(){this.hide();if(this.overlay){this.portal=document.createElement("div");this.portal.setAttribute("id",this.overlayId);document.body.append(this.portal)}this.portal=document.createElement("div");this.portal.setAttribute("id",this.panelId);this.portal.style.top="0px";this.portal.style.bottom="0px";this.portal.style.width="".concat(this.width,"px");if(this.side==="left"){this.portal.style.left="0px"}else{this.portal.style.right="0px"}document.body.append(this.portal)};e.prototype.componentDidLoad=function(){this.portal.appendChild(this.element)};e.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};e.prototype.hide=function(){var e,t;(e=document.getElementById(this.overlayId))===null||e===void 0?void 0:e.remove();(t=document.getElementById(this.panelId))===null||t===void 0?void 0:t.remove()};e.prototype.render=function(){var e=this;return h(Host,{key:"8dcf3da4611a3f0b76aa1ee94420324664142a4d",ref:function(t){return e.element=t}},h("slot",{key:"0009e45a7d3e1ecd7552eae299883cb2048f887f"}))};return e}();VerdocsMenuPanel.style=VerdocsMenuPanelStyle0;var verdocsTemplateRolePropertiesCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}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:justify;justify-content:space-between}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form{gap:15px;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-role-properties form .instructions{margin:7px 0 0 0;font-size:12px;font-style:italic}verdocs-template-role-properties form .input-label{display:block;font-size:14px;-ms-flex:0 0 100px;flex:0 0 100px;font-weight:700;margin:0 0 4px 0;color:#555570}verdocs-template-role-properties form .first-last{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form verdocs-help-icon{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-role-properties verdocs-select-input label{display:block}verdocs-template-role-properties verdocs-text-input{margin:0}verdocs-template-role-properties verdocs-text-input label{display:block}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var VerdocsTemplateRolePropertiesStyle0=verdocsTemplateRolePropertiesCss;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.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.roleName="";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{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]}this.listenToTemplate()}catch(o){console.log("[ROLES Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[ROLES] Loading tempate",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var i;console.log("[BUILD] Template Updated",t);e.template=t;e.loading=false;var o=(i=e.template)===null||i===void 0?void 0:i.roles.find((function(t){return t.name===e.roleName}));if(o){e.name=o.name;e.type=o.type;e.first_name=o.first_name;e.last_name=o.last_name;e.email=o.email;e.phone=o.phone;e.delegator=o.delegator;console.log("[ROLES] Editing role",o)}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.handleCancel=function(e){var t=this;var i,o;e.stopPropagation();var r=(i=this.template)===null||i===void 0?void 0:i.roles.find((function(e){return e.name===t.roleName}));if(r){this.name=r.name;this.type=r.type;this.first_name=r.first_name;this.last_name=r.last_name;this.email=r.email;this.phone=r.phone;this.delegator=r.delegator}this.dirty=false;(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=this;return __generator(this,(function(i){e.stopPropagation();this.saving=true;updateTemplateRole(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t,i,o;var r=this;return __generator(this,(function(s){console.log("[ROLES] Update result",e);this.saving=false;this.dirty=false;i=JSON.parse(JSON.stringify(this.template));o=i.roles.findIndex((function(e){return e.name===r.roleName}));if(o>-1){i.roles[o]=e}Store.updateTemplate(this.templateId,i);(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}))}))})).catch((function(e){console.log("[ROLES 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(i){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.")){deleteTemplateRole(this.endpoint,this.templateId,this.roleName).then((function(){var e,i;var o=JSON.parse(JSON.stringify(t.template));o.roles=o.roles.filter((function(e){return e.name!==t.roleName}));Store.getTemplate(t.endpoint,t.templateId,true);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(i=t.close)===null||i===void 0?void 0:i.emit()})).catch((function(e){console.log("[ROLES Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;var i=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).some((function(t){return t.role_name===e.roleName}));var o=!this.email&&!this.first_name&&!this.last_name||isValidEmail(this.email)&&!!this.first_name&&!!this.last_name;return h(Host,{key:"96ce0c97de00a07bed31adc75c7150701578c941"},h("form",{key:"8e0a0b5f7f2bf884d2c88f043136bcfe1bcf2532",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"0b87ecba6384095172fa7391334dd87c851408c8"},h("verdocs-text-input",{key:"4482f18ade6eeb905b9520dc30e856d7713d901c",id:"verdocs-role-name",label:"Role Name (Must be unique)",value:this.name,autocomplete:"off",disabled:i,placeholder:"Role Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),i&&h("div",{key:"a94d2380d66ee407a3c8c50b508f3e886f67a5b5",class:"instructions"},"This role has fields assigned and can no longer be renamed.")),h("div",{key:"d2546f25ccb6d903292ae101017abbe84b4bc89f"},h("div",{key:"5c410df8e359df411121e93fc271a858700d3f60",class:"input-label"},"Type:"),h("verdocs-select-input",{key:"93719bbd38fcdcbf2ff122da5c43358cca2137d8",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("div",{key:"a20f9844b3984c614163301ab0e22b61f18fba2a"},h("div",{key:"877a63a1e7421991e72a45ccbfeb0349aa09dc7f",class:"input-label"},"Default Contact Info:"),h("div",{key:"4450947537ccc4698b4e1f35fd84aa0955131337",class:"first-last"},h("verdocs-text-input",{key:"37fbada4d13c0f5db4054d78bea5883d0995fc75",id:"verdocs-recipient-first",value:this.first_name,autocomplete:"off",placeholder:"First...",onInput:function(t){e.first_name=t.target.value;e.dirty=true}}),h("verdocs-text-input",{key:"32b1e430af0b03351e7aa22cd349b80dae89455e",id:"verdocs-recipient-first",value:this.last_name,autocomplete:"off",placeholder:"Last...",onInput:function(t){e.last_name=t.target.value;e.dirty=true}}))),h("div",{key:"a7cc6719139da5023f78cf23ddc603a437d34e34"},h("verdocs-text-input",{key:"53cc82483504af0726d11615c7ed9481a7a644b3",id:"verdocs-recipient-email",value:this.email,autocomplete:"off",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),h("div",{key:"87a622f513d8a70345b1642a9bd28f6680c0ecdd",style:{height:"15px"}}),h("div",{key:"46f265314b3e55b28c2595ea016ce7dba0ceb752"},h("verdocs-text-input",{key:"6411264bb26c808ad4f588b884657d1331a22195",id:"verdocs-recipient-phone",value:this.phone,autocomplete:"off",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}))),h("div",{key:"79576da9bc2cebe62a89f179f98ca85a5a95c1e2",class:"buttons"},h("button",{key:"14e042f76eea3a5d6ca60044ccfb35d8883467db",class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{key:"d422a670fcae7feb422ae84d5826950e92adb342",style:{flex:"1"}}),h("verdocs-button",{key:"1c3351125d082f12942e12c1448402ed9343220a",size:"small",label:"Save",disabled:!this.dirty||!o,onClick:function(t){return e.handleSave(t)}}))))};return e}();VerdocsTemplateRoleProperties.style=VerdocsTemplateRolePropertiesStyle0;export{VerdocsMenuPanel as verdocs_menu_panel,VerdocsTemplateRoleProperties as verdocs_template_role_properties};
2
2
  //# sourceMappingURL=verdocs-menu-panel_2.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";var verdocsOkDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-ok-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-ok-dialog.closed{display:none}verdocs-ok-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-ok-dialog .dialog{max-width:60%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;-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-ok-dialog .heading{display:-ms-flexbox;display:flex;font-size:16px;-ms-flex-direction:row;flex-direction:row;padding:8px 16px;font-weight:bold;color:#ffffff;background:#46497d}verdocs-ok-dialog .content{font-size:16px;background:#ffffff;padding:20px}verdocs-ok-dialog .buttons{display:-ms-flexbox;display:flex;margin:30px 0 0 0;padding:0 20px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}verdocs-ok-dialog .buttons verdocs-button{margin-left:16px}';var VerdocsOkDialogStyle0=verdocsOkDialogCss;var VerdocsOkDialog=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.exit=createEvent(this,"exit",7);this.heading="";this.message="";this.buttonLabel="OK";this.showCancel=false;this.closed=false}e.prototype.handleOk=function(){this.next.emit()};e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){this.closed=true;if(e.target.className==="background-overlay"){e.preventDefault();this.exit.emit()}};e.prototype.render=function(){var e=this;return h(Host,{key:"c1505d930741a4a0e1eb9a9832de8e55d09b207c",class:this.closed?"closed":""},h("div",{key:"f4c1ce92701f56a3b839bc49a0beb38665a65556",class:"background-overlay",onClick:function(o){return e.handleDismiss(o)}},h("div",{key:"0fe99745209ca40287512f114122d1a0f0c4e597",class:"dialog"},h("div",{key:"93deffa53c92913b65109f3c9826e61561f91c68",class:"heading"},this.heading),h("div",{key:"b0a64c6f2072655ce439d5008ecfe55651d48d8f",class:"content"},h("div",{key:"3f89fd4b54dfa1c8437c2aa7dd21310827516004",class:"message",innerHTML:this.message}),h("div",{key:"a86843d9915f72bcc00810c87f3311c77cf3b566",class:"buttons"},this.showCancel?h("verdocs-button",{label:"CANCEL",variant:"outline",onClick:function(){return e.handleCancel()}}):h("div",{style:{display:"none"}}),h("verdocs-button",{key:"d160170c8a58dde135ba4c5ae4dac35ac79c24a1",label:this.buttonLabel,onClick:function(){return e.handleOk()}}))))))};return e}();VerdocsOkDialog.style=VerdocsOkDialogStyle0;export{VerdocsOkDialog as verdocs_ok_dialog};
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-2cd5f887.js";var verdocsOkDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-ok-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-ok-dialog.closed{display:none}verdocs-ok-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-ok-dialog .dialog{max-width:60%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;-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-ok-dialog .heading{display:-ms-flexbox;display:flex;font-size:16px;-ms-flex-direction:row;flex-direction:row;padding:8px 16px;font-weight:bold;color:#ffffff;background:#46497d}verdocs-ok-dialog .content{font-size:16px;background:#ffffff;padding:20px}verdocs-ok-dialog .buttons{display:-ms-flexbox;display:flex;margin:30px 0 0 0;padding:0 20px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}verdocs-ok-dialog .buttons verdocs-button{margin-left:16px}';var VerdocsOkDialogStyle0=verdocsOkDialogCss;var VerdocsOkDialog=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.exit=createEvent(this,"exit",7);this.heading="";this.message="";this.buttonLabel="OK";this.showCancel=false;this.closed=false}e.prototype.handleOk=function(){this.next.emit()};e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){this.closed=true;if(e.target.className==="background-overlay"){e.preventDefault();this.exit.emit()}};e.prototype.render=function(){var e=this;return h(Host,{key:"f41613ca32a9471277c816d753e7f818ef427fd0",class:this.closed?"closed":""},h("div",{key:"570538e2743b23b5f18a1ec6ea3db51dfd314f02",class:"background-overlay",onClick:function(o){return e.handleDismiss(o)}},h("div",{key:"17bfc3cfaadc8d10fe27211cd4a0eb48083f7a4b",class:"dialog"},h("div",{key:"bc88208d6897a191ef5fda323a74acd3e3c2620e",class:"heading"},this.heading),h("div",{key:"bc794df180672198964f32a6c71eff9dd1180db9",class:"content"},h("div",{key:"d8618e9b479e64b457bca57838437f91a0677560",class:"message",innerHTML:this.message}),h("div",{key:"101f7819fa69c3cf8f8958a5582835b56cf94775",class:"buttons"},this.showCancel?h("verdocs-button",{label:"CANCEL",variant:"outline",onClick:function(){return e.handleCancel()}}):h("div",{style:{display:"none"}}),h("verdocs-button",{key:"e755590fdd93cb9cc7b23a3812377d5216a70aae",label:this.buttonLabel,onClick:function(){return e.handleOk()}}))))))};return e}();VerdocsOkDialog.style=VerdocsOkDialogStyle0;export{VerdocsOkDialog as verdocs_ok_dialog};
2
2
  //# sourceMappingURL=verdocs-ok-dialog.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,h,H as Host,c as createEvent}from"./index-2cd5f887.js";import{f as format}from"./format-b8602175.js";var verdocsOrganizationCardCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-organization-card{font-family:"Inter", "Barlow", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#ffffff;border-radius:8px;padding:7px 15px}verdocs-organization-card .icon{-ms-flex:0;flex:0;height:24px;width:24px;margin:0 14px 0 0}verdocs-organization-card .icon svg{fill:#aeb4bf;height:24px;width:24px}verdocs-organization-card .content{margin-top:2px}.verdocs-org-card-popup{font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border-radius:10px;width:326px;padding:20px 40px 0 40px;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border:1px solid #cccccc}.verdocs-org-card-popup .popup-header-with-logo{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:0 0 20px 0;font-size:21px;line-height:16px;color:#4c56cb}.verdocs-org-card-popup .popup-header-with-logo img{max-width:300px;max-height:50px}.verdocs-org-card-popup .popup-header{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0;gap:20px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;margin:0 0 20px 0;font-size:21px;line-height:16px;color:#4c56cb}.verdocs-org-card-popup .popup-body{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:14px;text-transform:uppercase}.verdocs-org-card-popup .status{-webkit-transform:scale(1.5);transform:scale(1.5);width:24px;height:24px}.verdocs-org-card-popup .field{margin:0 0 20px 0}.verdocs-org-card-popup .field strong{color:#7b7b9a;display:block;margin:0 0 5px 0}.verdocs-org-card-popup .field a{color:#654dcb;text-transform:uppercase}';var VerdocsOrganizationCardStyle0=verdocsOrganizationCardCss;var BusinessIcon='<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" height="24px" viewBox="0 0 24 24" width="24px"><path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"></path></svg>';var VerdocsOrganizationCard=function(){function o(o){registerInstance(this,o);this.hovered=false}o.prototype.onMouseOver=function(){this.hovered=true};o.prototype.onMouseOut=function(){this.hovered=false};o.prototype.render=function(){var o,r,e,a,i,s;console.log("Rendering org card",this.organization.thumbnail_url,this.organization);var c=BusinessIcon;var d="verdocs-org-card-".concat(this.organization.id);return h(Host,{key:"f6c8ad8bc095f37d036de897927380147a001e96",id:d},this.organization.thumbnail_url?h("img",{class:"icon",src:this.organization.thumbnail_url,alt:"Logo"}):h("span",{class:"icon",innerHTML:c}),h("span",{key:"c1dc4462971dd0793ad72d4591f728b7219b4bea",class:"content"},(o=this.organization)===null||o===void 0?void 0:o.name),h("verdocs-portal",{key:"3d99780a747d160548c9cee3dd06d57036cfa93a",anchor:d},h("div",{key:"3cef49c037e17fb62af465b50ef6af0ee860691a",class:"verdocs-org-card-popup",style:{display:this.hovered?"block":"none"}},this.organization.full_logo_url?h("div",{class:"popup-header-with-logo"},h("img",{src:this.organization.full_logo_url,alt:"Logo"}),h("div",{class:"title"},(r=this.organization)===null||r===void 0?void 0:r.name)):h("div",{class:"popup-header"},h("span",{class:"status"},h("span",{class:"icon",innerHTML:c})),h("span",{class:"title"},(e=this.organization)===null||e===void 0?void 0:e.name)),h("div",{key:"3657c41ef18895e4cd0793d1517c71dd5d654cc6",class:"popup-body"},h("div",{key:"cc5ab4e315ab5194cbafe44ce0689f7e5acd1c93",class:"field"},h("strong",{key:"82c91160f7d89d9d2091a2940e200ad955d691a3"},"Joined"),format(new Date(((a=this.organization)===null||a===void 0?void 0:a.created_at)||undefined),"LLL d, Y")),this.organization.url&&h("div",{key:"4b12013323bb47eea919ea0a7ae83828d3c5ee17",class:"field"},h("strong",{key:"8bad90562acaabdc03a6d2809f5cd2e61855b60e"},"Website"),h("a",{key:"305e7ce650997b204a7c38a338297008e031518c",href:(i=this.organization)===null||i===void 0?void 0:i.url,target:"_blank",rel:"nofollow"},(s=this.organization)===null||s===void 0?void 0:s.url))))))};return o}();VerdocsOrganizationCard.style=VerdocsOrganizationCardStyle0;var verdocsPortalCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";var VerdocsPortalStyle0=verdocsPortalCss;var Z_INDEX="10001";var VerdocsPortal=function(){function o(o){registerInstance(this,o);this.clickAway=createEvent(this,"clickAway",7);this.moved=false;this.voffset=0}o.prototype.handleScroll=function(){this.calculatePosition()};o.prototype.handleResize=function(){this.calculatePosition()};o.prototype.handleClick=function(o){var r;if(!this.element.contains(o.target)){(r=this.clickAway)===null||r===void 0?void 0:r.emit()}};o.prototype.calculateLeft=function(){var o;var r=document.getElementById(this.anchor);if(!r)return 0;var e=r.getBoundingClientRect();var a=document.documentElement.clientWidth+document.documentElement.scrollLeft;var i=Math.max(e.left,0);var s=((o=this.element)===null||o===void 0?void 0:o.offsetWidth)||400;var c=i+s>a;return c?a-s-20:i};o.prototype.calculateTop=function(){var o;var r=document.getElementById(this.anchor);if(!r)return 0;var e=r.getBoundingClientRect();var a=document.documentElement.clientHeight+document.documentElement.scrollTop;var i=e.bottom+this.voffset+document.documentElement.scrollTop;var s=((o=this.element)===null||o===void 0?void 0:o.offsetHeight)||300;var c=i+s>a;return c?i-s-e.height:i};o.prototype.calculatePosition=function(){this.portal.style.top="".concat(this.calculateTop(),"px");this.portal.style.left="".concat(this.calculateLeft(),"px")};o.prototype.componentWillLoad=function(){var o;var r="".concat(this.anchor,"-portal");(o=document.getElementById(r))===null||o===void 0?void 0:o.remove();this.portal=document.createElement("div");this.portal.setAttribute("id",r);this.portal.style.zIndex=Z_INDEX;this.portal.style.position="absolute";document.body.append(this.portal)};o.prototype.componentDidLoad=function(){this.portal.appendChild(this.element);this.calculatePosition()};o.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};o.prototype.render=function(){var o=this;return h(Host,{key:"050fd06e144d86e3b1266b22fbfbdd9cf2e9a820",ref:function(r){return o.element=r}},h("slot",{key:"b860298e37d31038c5f3f327e7aad2320aa9e5c8"}))};return o}();VerdocsPortal.style=VerdocsPortalStyle0;export{VerdocsOrganizationCard as verdocs_organization_card,VerdocsPortal as verdocs_portal};
1
+ import{r as registerInstance,h,H as Host,c as createEvent}from"./index-2cd5f887.js";import{f as format}from"./format-b8602175.js";var verdocsOrganizationCardCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-organization-card{font-family:"Inter", "Barlow", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#ffffff;border-radius:8px;padding:7px 15px}verdocs-organization-card .icon{-ms-flex:0;flex:0;height:24px;width:24px;margin:0 14px 0 0}verdocs-organization-card .icon svg{fill:#aeb4bf;height:24px;width:24px}verdocs-organization-card .content{margin-top:2px}.verdocs-org-card-popup{font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border-radius:10px;width:326px;padding:20px 40px 0 40px;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border:1px solid #cccccc}.verdocs-org-card-popup .popup-header-with-logo{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:0 0 20px 0;font-size:21px;line-height:16px;color:#4c56cb}.verdocs-org-card-popup .popup-header-with-logo img{max-width:300px;max-height:50px}.verdocs-org-card-popup .popup-header{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0;gap:20px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;margin:0 0 20px 0;font-size:21px;line-height:16px;color:#4c56cb}.verdocs-org-card-popup .popup-body{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:14px;text-transform:uppercase}.verdocs-org-card-popup .status{-webkit-transform:scale(1.5);transform:scale(1.5);width:24px;height:24px}.verdocs-org-card-popup .field{margin:0 0 20px 0}.verdocs-org-card-popup .field strong{color:#7b7b9a;display:block;margin:0 0 5px 0}.verdocs-org-card-popup .field a{color:#654dcb;text-transform:uppercase}';var VerdocsOrganizationCardStyle0=verdocsOrganizationCardCss;var BusinessIcon='<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" height="24px" viewBox="0 0 24 24" width="24px"><path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"></path></svg>';var VerdocsOrganizationCard=function(){function o(o){registerInstance(this,o);this.hovered=false}o.prototype.onMouseOver=function(){this.hovered=true};o.prototype.onMouseOut=function(){this.hovered=false};o.prototype.render=function(){var o,r,e,a,i,s;console.log("Rendering org card",this.organization.thumbnail_url,this.organization);var d=BusinessIcon;var c="verdocs-org-card-".concat(this.organization.id);return h(Host,{key:"d7b475ffa8a508828c58362f1d132313910db262",id:c},this.organization.thumbnail_url?h("img",{class:"icon",src:this.organization.thumbnail_url,alt:"Logo"}):h("span",{class:"icon",innerHTML:d}),h("span",{key:"41371ad0ece9b5b13c455313658b3983facf5db5",class:"content"},(o=this.organization)===null||o===void 0?void 0:o.name),h("verdocs-portal",{key:"37b667310a2124dc68a88a8b5732ecd4a87f9da1",anchor:c},h("div",{key:"7f72d2f2c25314cdfa81721c6b6653989c7be72b",class:"verdocs-org-card-popup",style:{display:this.hovered?"block":"none"}},this.organization.full_logo_url?h("div",{class:"popup-header-with-logo"},h("img",{src:this.organization.full_logo_url,alt:"Logo"}),h("div",{class:"title"},(r=this.organization)===null||r===void 0?void 0:r.name)):h("div",{class:"popup-header"},h("span",{class:"status"},h("span",{class:"icon",innerHTML:d})),h("span",{class:"title"},(e=this.organization)===null||e===void 0?void 0:e.name)),h("div",{key:"478657fefd75b3adda14550ce7dd8117ee3f519f",class:"popup-body"},h("div",{key:"213022879f5f5d2cab6cf415692e418911e1ee05",class:"field"},h("strong",{key:"3e36b9b9ef2dd6b39dc313c77772b750d7bdb242"},"Joined"),format(new Date(((a=this.organization)===null||a===void 0?void 0:a.created_at)||undefined),"LLL d, Y")),this.organization.url&&h("div",{key:"b28cb49fe0214c3f0851fe4609433ada584bf0be",class:"field"},h("strong",{key:"9cdfd0da0dcb3d51149b1e0bc2f612e0f0edab6d"},"Website"),h("a",{key:"74be8e66995435c5e6a071098ec1d4a6a7ca6f5f",href:(i=this.organization)===null||i===void 0?void 0:i.url,target:"_blank",rel:"nofollow"},(s=this.organization)===null||s===void 0?void 0:s.url))))))};return o}();VerdocsOrganizationCard.style=VerdocsOrganizationCardStyle0;var verdocsPortalCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";var VerdocsPortalStyle0=verdocsPortalCss;var Z_INDEX="10001";var VerdocsPortal=function(){function o(o){registerInstance(this,o);this.clickAway=createEvent(this,"clickAway",7);this.moved=false;this.voffset=0}o.prototype.handleScroll=function(){this.calculatePosition()};o.prototype.handleResize=function(){this.calculatePosition()};o.prototype.handleClick=function(o){var r;if(!this.element.contains(o.target)){(r=this.clickAway)===null||r===void 0?void 0:r.emit()}};o.prototype.calculateLeft=function(){var o;var r=document.getElementById(this.anchor);if(!r)return 0;var e=r.getBoundingClientRect();var a=document.documentElement.clientWidth+document.documentElement.scrollLeft;var i=Math.max(e.left,0);var s=((o=this.element)===null||o===void 0?void 0:o.offsetWidth)||400;var d=i+s>a;return d?a-s-20:i};o.prototype.calculateTop=function(){var o;var r=document.getElementById(this.anchor);if(!r)return 0;var e=r.getBoundingClientRect();var a=document.documentElement.clientHeight+document.documentElement.scrollTop;var i=e.bottom+this.voffset+document.documentElement.scrollTop;var s=((o=this.element)===null||o===void 0?void 0:o.offsetHeight)||300;var d=i+s>a;return d?i-s-e.height:i};o.prototype.calculatePosition=function(){this.portal.style.top="".concat(this.calculateTop(),"px");this.portal.style.left="".concat(this.calculateLeft(),"px")};o.prototype.componentWillLoad=function(){var o;var r="".concat(this.anchor,"-portal");(o=document.getElementById(r))===null||o===void 0?void 0:o.remove();this.portal=document.createElement("div");this.portal.setAttribute("id",r);this.portal.style.zIndex=Z_INDEX;this.portal.style.position="absolute";document.body.append(this.portal)};o.prototype.componentDidLoad=function(){this.portal.appendChild(this.element);this.calculatePosition()};o.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};o.prototype.render=function(){var o=this;return h(Host,{key:"7379bf2578c769bf6112486912c7aa30b429fae1",ref:function(r){return o.element=r}},h("slot",{key:"3b141548481e6dd23f47ed4e0db78e3931a5bdaa"}))};return o}();VerdocsPortal.style=VerdocsPortalStyle0;export{VerdocsOrganizationCard as verdocs_organization_card,VerdocsPortal as verdocs_portal};
2
2
  //# sourceMappingURL=verdocs-organization-card_2.entry.js.map
@@ -1,2 +1,2 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var i,r=1,t=arguments.length;r<t;r++){i=arguments[r];for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o))e[o]=i[o]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,i,r){if(r||arguments.length===2)for(var t=0,o=i.length,s;t<o;t++){if(s||!(t in i)){if(!s)s=Array.prototype.slice.call(i,0,t);s[t]=i[t]}}return e.concat(s||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-2cd5f887.js";import{integerSequence}from"@verdocs/js-sdk";import{i as renderedTextWidth}from"./utils-bd656c37.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsPaginationCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';var VerdocsPaginationStyle0=verdocsPaginationCss;var ChevronDoubleLeft='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>';var ChevronDoubleRight='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>';var VISIBLE_PAGES=5;var PageButton=function(e){var i=e.page,r=e.selected,t=e.onClick;var o;if(i==="first"){o=ChevronDoubleLeft}else if(i==="last"){o=ChevronDoubleRight}else{o=String(i+1)}return h("div",{class:"page-button ".concat(i===r?"selected":""),onClick:function(){return t(i)},innerHTML:o})};var VerdocsQuickFilter$1=function(){function e(e){registerInstance(this,e);this.selectPage=createEvent(this,"selectPage",7);this.selectedPage=0;this.itemCount=1;this.perPage=10}e.prototype.handleSelectPage=function(e){var i;this.selectedPage=e;(i=this.selectPage)===null||i===void 0?void 0:i.emit({selectedPage:e})};e.prototype.render=function(){var e=this;var i=Math.max(0,this.selectedPage-2);var r=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;var t=integerSequence(0,Math.ceil(this.itemCount/this.perPage)).slice(i,i+VISIBLE_PAGES);return h(Host,{key:"358610aeb011220e76bee09fa0d4959f2a887914"},this.selectedPage>0&&h(PageButton,{key:"67e46ca48d09a2c30a366166fb8b11ebc9fa24eb",page:"first",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(0)}}),i>0&&h("div",{key:"5247620dbc930d33c91f147fbbe4fe7bb9b3c487",class:"ellipsis"},"..."),t.map((function(i){return h(PageButton,{page:i,selected:e.selectedPage,onClick:function(i){return e.handleSelectPage(+i)}})})),this.selectedPage<r-1&&h("div",{key:"54504094516e328ea81a01d92d0895777d732b43",class:"ellipsis"},"..."),this.selectedPage<r-1&&h(PageButton,{key:"824d5d8702682563621b663ab86fdb3404e82ffd",page:"last",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(r-1)}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsQuickFilter$1.style=VerdocsPaginationStyle0;var verdocsQuickFilterCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;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:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:rgba(76, 86, 203, 0.2470588235)}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';var VerdocsQuickFilterStyle0=verdocsQuickFilterCss;var DropdownArrow='<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>';var VerdocsQuickFilter=function(){function e(e){registerInstance(this,e);this.optionSelected=createEvent(this,"optionSelected",7);this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.clickListenerSymbol=new AbortController}e.prototype.componentDidLoad=function(){this.popper=createPopper(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var i=!(e.target==this.el||this.el.contains(e.target));if(i){this.hide()}};e.prototype.handleSelectOption=function(e,i){e.stopPropagation();this.optionSelected.emit(i);this.value=i.value;this.hide()};e.prototype.showDropdown=function(){var e,i;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(i=this.popper)===null||i===void 0?void 0:i.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var i,r;if(((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.localName)==="button"&&((r=e===null||e===void 0?void 0:e.target)===null||r===void 0?void 0:r.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var i,r,t;var o=(i=this.options)===null||i===void 0?void 0:i.find((function(i){return i.value===e.value}));var s=(r=this.options)===null||r===void 0?void 0:r.reduce((function(e,i){return e.label.length>i.label.length?e:i}));var n=renderedTextWidth((s===null||s===void 0?void 0:s.label)||"FILLER","14px Inter, Barlow, sans-serif");var a=renderedTextWidth(this.label,"14px Inter, Barlow, sans-serif");var c="".concat(n+a+40,"px");return h(Host,{key:"6f6e71bd0ea76ca6ba26b77fb30c0239fb8bedd5",class:{open:!!this.open},style:{minWidth:c,display:"inline-block"}},h("div",{key:"d81ab2d9e14a0ba69b1080f3dd99a5192cd5e533",class:"control",onClick:function(i){return e.toggleDropdown(i)},onBlur:function(i){return e.handleHideDropdown(i)}},h("div",{key:"6a52a8e2ea889e5814418ca04c034fa6ef0bea25",class:"title",ref:function(i){return e.dropdownButton=i}},h("span",{key:"123f3497307aafb8a2b26acbbfe6d992bc8ee035",class:"prefix"},this.label,":"),o?o.label:this.placeholder),h("div",{key:"b3b3958835e040778ded7d388d588dd61fc071c6",style:{flex:"1"}}),h("div",{key:"e6de6c499d2faaa6ab75b058536ec4f3460cf4a7",class:"separator"}),h("div",{key:"da20248064e549199a0100c02036d6488aa978bb",class:"arrow",innerHTML:DropdownArrow,"aria-label":"Open Menu"})),h("div",{key:"7d72258557bcda6a80bb6f5a9667e47dc89d65ae",class:"items","aria-hidden":!this.open,ref:function(i){return e.dropdownMenu=i},style:{minWidth:c}},(t=this.options)===null||t===void 0?void 0:t.map((function(i){return i.label?h("button",{onClick:function(r){return e.handleSelectOption(r,i)},class:"option ".concat(i.value===e.value?"selected":""),disabled:i.disabled},i.label):h("div",{class:"separator"})}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsQuickFilter.style=VerdocsQuickFilterStyle0;export{VerdocsQuickFilter$1 as verdocs_pagination,VerdocsQuickFilter as verdocs_quick_filter};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var i,r=1,t=arguments.length;r<t;r++){i=arguments[r];for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o))e[o]=i[o]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,i,r){if(r||arguments.length===2)for(var t=0,o=i.length,s;t<o;t++){if(s||!(t in i)){if(!s)s=Array.prototype.slice.call(i,0,t);s[t]=i[t]}}return e.concat(s||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-2cd5f887.js";import{integerSequence}from"@verdocs/js-sdk";import{i as renderedTextWidth}from"./utils-bd656c37.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsPaginationCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';var VerdocsPaginationStyle0=verdocsPaginationCss;var ChevronDoubleLeft='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>';var ChevronDoubleRight='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>';var VISIBLE_PAGES=5;var PageButton=function(e){var i=e.page,r=e.selected,t=e.onClick;var o;if(i==="first"){o=ChevronDoubleLeft}else if(i==="last"){o=ChevronDoubleRight}else{o=String(i+1)}return h("div",{class:"page-button ".concat(i===r?"selected":""),onClick:function(){return t(i)},innerHTML:o})};var VerdocsQuickFilter$1=function(){function e(e){registerInstance(this,e);this.selectPage=createEvent(this,"selectPage",7);this.selectedPage=0;this.itemCount=1;this.perPage=10}e.prototype.handleSelectPage=function(e){var i;this.selectedPage=e;(i=this.selectPage)===null||i===void 0?void 0:i.emit({selectedPage:e})};e.prototype.render=function(){var e=this;var i=Math.max(0,this.selectedPage-2);var r=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;var t=integerSequence(0,Math.ceil(this.itemCount/this.perPage)).slice(i,i+VISIBLE_PAGES);return h(Host,{key:"9cb81ab797997f6bedf65126e759a329e01b5d86"},this.selectedPage>0&&h(PageButton,{key:"a172567f4adbaa02644a3c285344c0de4d2e5a33",page:"first",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(0)}}),i>0&&h("div",{key:"97833b23734e758e9ae5627b756fecad2371037c",class:"ellipsis"},"..."),t.map((function(i){return h(PageButton,{page:i,selected:e.selectedPage,onClick:function(i){return e.handleSelectPage(+i)}})})),this.selectedPage<r-1&&h("div",{key:"20dc5aa9111118ce1df8177d64c6fecff1d497e2",class:"ellipsis"},"..."),this.selectedPage<r-1&&h(PageButton,{key:"04b5d3fce4ba05f3acc2f24927c1bda6be7f34e7",page:"last",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(r-1)}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsQuickFilter$1.style=VerdocsPaginationStyle0;var verdocsQuickFilterCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;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:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:rgba(76, 86, 203, 0.2470588235)}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';var VerdocsQuickFilterStyle0=verdocsQuickFilterCss;var DropdownArrow='<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>';var VerdocsQuickFilter=function(){function e(e){registerInstance(this,e);this.optionSelected=createEvent(this,"optionSelected",7);this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.clickListenerSymbol=new AbortController}e.prototype.componentDidLoad=function(){this.popper=createPopper(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var i=!(e.target==this.el||this.el.contains(e.target));if(i){this.hide()}};e.prototype.handleSelectOption=function(e,i){e.stopPropagation();this.optionSelected.emit(i);this.value=i.value;this.hide()};e.prototype.showDropdown=function(){var e,i;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(i=this.popper)===null||i===void 0?void 0:i.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var i,r;if(((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.localName)==="button"&&((r=e===null||e===void 0?void 0:e.target)===null||r===void 0?void 0:r.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var i,r,t;var o=(i=this.options)===null||i===void 0?void 0:i.find((function(i){return i.value===e.value}));var s=(r=this.options)===null||r===void 0?void 0:r.reduce((function(e,i){return e.label.length>i.label.length?e:i}));var n=renderedTextWidth((s===null||s===void 0?void 0:s.label)||"FILLER","14px Inter, Barlow, sans-serif");var a=renderedTextWidth(this.label,"14px Inter, Barlow, sans-serif");var c="".concat(n+a+40,"px");return h(Host,{key:"2775a9460418249e5830b3acc29bc501dfc0b7e9",class:{open:!!this.open},style:{minWidth:c,display:"inline-block"}},h("div",{key:"a0d32bee5bf3a83860d1ee34b70dd08e14ff6f5a",class:"control",onClick:function(i){return e.toggleDropdown(i)},onBlur:function(i){return e.handleHideDropdown(i)}},h("div",{key:"e28fc8c51bd4913814770bfa3eed9aec685fcdc7",class:"title",ref:function(i){return e.dropdownButton=i}},h("span",{key:"56f45a29290ed821c2260b07e34c76ad6f4b3008",class:"prefix"},this.label,":"),o?o.label:this.placeholder),h("div",{key:"dcc1f197621169c83f7c935bb06f60f992ac3a58",style:{flex:"1"}}),h("div",{key:"059cede12c8b2c1bca6b53f7e1f01b424dd70882",class:"separator"}),h("div",{key:"722b64600dca7b946044a60700b042d61774dabb",class:"arrow",innerHTML:DropdownArrow,"aria-label":"Open Menu"})),h("div",{key:"3988d0fd9076c4bc1bfb9d45d67f9354022a15cd",class:"items","aria-hidden":!this.open,ref:function(i){return e.dropdownMenu=i},style:{minWidth:c}},(t=this.options)===null||t===void 0?void 0:t.map((function(i){return i.label?h("button",{onClick:function(r){return e.handleSelectOption(r,i)},class:"option ".concat(i.value===e.value?"selected":""),disabled:i.disabled},i.label):h("div",{class:"separator"})}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsQuickFilter.style=VerdocsQuickFilterStyle0;export{VerdocsQuickFilter$1 as verdocs_pagination,VerdocsQuickFilter as verdocs_quick_filter};
2
2
  //# sourceMappingURL=verdocs-pagination_2.entry.js.map
@@ -1,4 +1,4 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++){t=arguments[o];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};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(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(o=0)),o)try{if(n=1,r&&(i=l[0]&2?r["return"]:l[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;if(r=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;r=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1];i=l;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(l);break}if(i[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[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,F as Fragment,g as getElement}from"./index-2cd5f887.js";import{VerdocsEndpoint,getTemplate,integerSequence,getOrganizationContacts,isValidEmail,createEnvelope,formatFullName,getRGBA,createTemplateDocument,deleteTemplateDocument,updateField,createField,updateTemplateRole,createTemplateRole,updateTemplate}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-1db52f58.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{D as DocIcon,P as PngIcon,J as JpgIcon,a as PdfIcon,F as FileIcon,b as PageCountIcon,T as TrashIcon}from"./Icons-faf0377f.js";import{f as format}from"./format-b8602175.js";import{i as interact}from"./interact.min-a71beb3d.js";import{b as updateCssTransform,c as removeCssTransform,d as setControlStyles,g as getFieldId,e as defaultWidth,f as defaultHeight}from"./utils-bd656c37.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";var verdocsPreviewCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;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-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreviewStyle0=verdocsPreviewCss;var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[PREVIEW] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(n){console.log("[PREVIEW] Error with preview session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}return h(Host,null,(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){var o=integerSequence(1,t.pages);return h(Fragment,null,o.map((function(o){var n;var r=((n=t.page_sizes)===null||n===void 0?void 0:n[o])||{width:612,height:792};return h("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:o,disabled:true,editable:false,done:false,virtualWidth:r.width,virtualHeight:r.height,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsPreview.style=VerdocsPreviewStyle0;var getRoleNames=function(e){return((e===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.name}))};var getRoleIndex=function(e,t){return Math.max(getRoleNames(e).findIndex((function(e){return e===t})),0)};var verdocsSendCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var VerdocsSendStyle0=verdocsSendCss;var editIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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" tabindex="-1"><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" tabindex="-1"><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 VerdocsSend=function(){function e(e){registerInstance(this,e);this.beforeSend=createEvent(this,"beforeSend",7);this.send=createEvent(this,"send",7);this.exit=createEvent(this,"exit",7);this.sdkError=createEvent(this,"sdkError",7);this.searchContacts=createEvent(this,"searchContacts",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.environment="";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),true,(function(t){console.log("[SEND] Got new template",t);e.template=t;e.loading=false;e.rolesCompleted={};e.recomputeRolesCompleted()}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.onTemplateIdChanged=function(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;var n=this;return __generator(this,(function(r){try{this.endpoint.onSessionChanged((function(e,t,o){if(!o){return}var r={id:o.id,first_name:o.first_name,last_name:o.last_name,email:o.email,phone:o.phone};if(o){n.sessionContacts=[r];getOrganizationContacts(n.endpoint).then((function(e){console.log("[SEND] Got contacts",e);n.sessionContacts=__spreadArray(__spreadArray([],e,true),[r],false)})).catch((function(e){console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return[2]}if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(n){console.log("[SEND] Error with send session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.recomputeRolesCompleted=function(){var e=this;var t;this.rolesCompleted={};var o={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){var n=t.sequence-1;o[n]||(o[n]=[]);var r="r-".concat(n,"-").concat(o[n].length);o[n].push(__assign(__assign({},t),{id:r,role_name:t.name,first_name:t.first_name,last_name:t.last_name}));if(t.first_name&&isValidEmail(t.email)){e.rolesCompleted[r]=__assign(__assign({},t),{id:r,role_name:t.name,first_name:t.first_name,last_name:t.last_name})}}))};e.prototype.getSequenceNumbers=function(){var e;var t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){t[e.sequence]=true}));return Object.keys(t).map((function(e){return+e})).sort((function(e,t){return e-t}))};e.prototype.getRolesAtLevel=function(e){var t;var o=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t.sequence===e})).map((function(t,o){return __assign(__assign({},t),{id:"r-".concat(e,"-").concat(o),role_name:t.name,first_name:t.first_name,last_name:t.last_name})}));return o};e.prototype.getLevelIcon=function(e){if(e==="start"){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e==="end"){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var o;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var n={template_id:this.templateId,name:((o=this.template)===null||o===void 0?void 0:o.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};var r=this.beforeSend.emit(__assign(__assign({},n),{name:n.name,template:this.template}));if(r.defaultPrevented){console.log("[SEND] Send cancelled by parent",n);this.sending=false;return}console.log("[SEND] Creating envelope",n);createEnvelope(this.endpoint,n).then((function(e){var o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},n),{name:n.name,envelope_id:e.id,envelope:e}))})).catch((function(e){var o,n,r;console.log("[SEND] Send error",e);VerdocsToast(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Error creating envelope, please try again later.");t.sending=false;(r=t.sdkError)===null||r===void 0?void 0:r.emit(e)}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,{style:{display:"flex"}},h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var o=this.getSequenceNumbers();console.log("[SEND] Rendering levels",o);var n=Object.values(this.rolesCompleted).filter((function(e){return isValidEmail(e.email)&&e.first_name&&e.last_name}));var r=n.length>=getRoleNames(this.template).length;return h(Host,{class:{sendable:(t=this.template)===null||t===void 0?void 0:t.is_sendable}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon("start"),h("div",{class:"complete"},"Send Envelope")),o.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon("sequence"),e.getRolesAtLevel(t).map((function(t){var o,r,i;var s=!t.email||!t.first_name||!t.last_name;var l=((o=e.rolesCompleted[t.id])===null||o===void 0?void 0:o.first_name)?formatFullName(e.rolesCompleted[t.id]):s?t.role_name:formatFullName(t);var a="verdocs-send-recipient-".concat(t.role_name);var c=getRoleIndex(e.template,t.role_name);var d=getRGBA(c);var u=n.findIndex((function(e){return e.role_name===t.role_name}))>-1;var f={backgroundColor:d,border:u?"2px solid #55bc81":"2px solid #dddddd"};return s?h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(o){return e.handleClickRole(o,t)},id:a},l,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:a,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(o){return e.handleSelectContact(o,t)},contactSuggestions:e.sessionContacts,templateRole:(r=e.rolesCompleted[t.id])!==null&&r!==void 0?r:t,onSearchContacts:function(t){var o;return(o=e.searchContacts)===null||o===void 0?void 0:o.emit(t.detail)}}))):h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(o){return e.handleClickRole(o,t)},id:a},l,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:a,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(o){return e.handleSelectContact(o,t)},contactSuggestions:e.sessionContacts,templateRole:(i=e.rolesCompleted[t.id])!==null&&i!==void 0?i:t,onSearchContacts:function(t){var o;return(o=e.searchContacts)===null||o===void 0?void 0:o.emit(t.detail)}})))})))})),h("div",{class:"level level-done"},this.getLevelIcon("end"),h("div",{class:"complete"},"Signing Complete"))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),h("verdocs-button",{label:"Send",size:"small",disabled:!r||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&h("verdocs-spinner",null)))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsSend.style=VerdocsSendStyle0;var verdocsTemplateAttachmentsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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 VerdocsTemplateAttachmentsStyle0=verdocsTemplateAttachmentsCss;var VerdocsTemplateAttachments=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.sdkError=createEvent(this,"sdkError",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{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]}this.listenToTemplate()}catch(n){console.log("[TEMPLATE ATTACHMENTS] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};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,n,r,i,s,l,a;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();i=e.detail.file;if(!i){return[2]}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,createTemplateDocument(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this))];case 2:s=c.sent();console.log("[ATTACHMENTS] Created attachment",s);l=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 3:l.template=c.sent();console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=c.sent();console.log("[ATTACHMENTS] Error creating template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.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.template})};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,Store.getTemplate(this.endpoint,this.templateId,true)];case 2:e.template=t.sent();console.log("[ATTACHMENTS] New template",this.template);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.template)===null||t===void 0?void 0:t.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};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(this.loading){return h(Host,{class:"loading"},h("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return h(Host,{class:"empty"})}return h(Host,null,h("h5",null,"Existing Attachments"),h("div",{class:"attachments"},(((t=this.template)===null||t===void 0?void 0:t.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.pages),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:!(((o=this.template)===null||o===void 0?void 0:o.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=VerdocsTemplateAttachmentsStyle0;var verdocsTemplateBuildTabsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}';var VerdocsTemplateBuildTabsStyle0=verdocsTemplateBuildTabsCss;var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var CopyIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>';var STEPS=["attachments","roles","settings","fields","preview"];var VerdocsTemplateBuildTabs=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.stepChanged=createEvent(this,"stepChanged",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[BUILD_TABS] Template ID changed",e);this.listenToTemplate()};e.prototype.onStepChanged=function(e){console.log("[BUILD_TABS] Step changed",e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="attachments";console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");return[2]}this.listenToTemplate()}catch(n){console.log("[BUILD_TABS] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.setStep=function(e){var t;console.log("[BUILD_TABS] Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.copyTemplateId=function(){var e=this;navigator.clipboard.writeText(this.templateId).then((function(){VerdocsToast("Template ID copied",{style:"success",duration:3e3})})).catch((function(t){var o;console.warn("[BUILD_TABS] Error copying to clipboard",t);(o=e.sdkError)===null||o===void 0?void 0:o.emit(t)}))};e.prototype.render=function(){var e=this;var t,o,n,r,i,s,l,a,c;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var d=(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>0;var u=d&&(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).length>0;var f=u&&(((n=this.template)===null||n===void 0?void 0:n.fields)||[]).length>0;var v=Math.max(STEPS.indexOf(this.step),0);if(!f&&v>=4){v=3}if(!u&&v>=3){v=1}if(!d&&v>=1){v=0}return h(Host,null,h("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:"Attachment(s)"},{id:"roles",disabled:!d,label:"Roles"},{id:"settings",disabled:!u,label:"Settings"},{id:"fields",disabled:!u,label:"Fields"},{id:"preview",disabled:!f,label:"Preview/Send"}]}),this.templateId&&h("div",{class:"info"},h("verdocs-button-panel",{icon:HelpIcon},h("div",{class:"template-details-panel"},h("h6",null,"Template Details"),h("div",{class:"row"},h("label",null,"ID:"),h("div",{class:"value"},this.templateId),h("div",{class:"icon-button",innerHTML:CopyIcon,onClick:function(){return e.copyTemplateId()}})),h("div",{class:"row"},h("label",null,"Name:"),h("div",{class:"value"},(r=this.template)===null||r===void 0?void 0:r.name)),h("div",{class:"row"},h("label",null,"Visibility:"),h("div",{class:"value"},((i=this.template)===null||i===void 0?void 0:i.is_public)?"Public":((s=this.template)===null||s===void 0?void 0:s.is_personal)?"Private":"Shared")),h("div",{class:"row"},h("label",null,"Created:"),h("div",{class:"value"},((l=this.template)===null||l===void 0?void 0:l.counter)?format(new Date((a=this.template)===null||a===void 0?void 0:a.created_at),"P p"):"")),h("div",{class:"row"},h("label",null,"Used:"),h("div",{class:"value"},(c=this.template)===null||c===void 0?void 0:c.counter," time(s)"))))))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateBuildTabs.style=VerdocsTemplateBuildTabsStyle0;var verdocsTemplateFieldsCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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 rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}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{width:100%;height:50px;display:-ms-flexbox;display:flex;-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}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}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{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{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 VerdocsTemplateFieldsStyle0=verdocsTemplateFieldsCss;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 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 iconAttachment='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></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,class:"signature"},{id:"initial",tooltip:"Initials",icon:iconInitial,class:"initial"},{id:"sep1",tooltip:"",icon:separator,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:iconTextbox,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:iconCheck,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:iconRadio,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:iconDropdown,class:"dropdown"},{id:"sep2",tooltip:"",icon:separator,class:"separator"},{id:"date",tooltip:"Date",icon:iconDatepicker,class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:iconTimestamp,class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:iconAttachment,class:"attachment"}];var VerdocsTemplateFields=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.fieldsUpdated=createEvent(this,"fieldsUpdated",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}e.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{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]}this.listenToTemplate()}catch(n){console.log("[FIELDS] Error with fields session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}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.componentWillUpdate=function(){var e=this;var t,o;var n=((t=this.template)===null||t===void 0?void 0:t.roles)||[];if(!this.selectedRoleName||!n.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((o=n[0])===null||o===void 0?void 0:o.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var o,n;e.template=t;e.loading=false;if(!e.selectedRoleName){e.selectedRoleName=((n=(o=t.roles)===null||o===void 0?void 0:o[0])===null||n===void 0?void 0:n.name)||""}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.attachFieldAttributes=function(e,t,o){var n=this;o.addEventListener("settingsChanged",(function(){var e;(e=n.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:n.template,event:"added-field"})}));o.addEventListener("deleted",(function(){var e;o.remove();(e=n.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:n.template,event:"updated-field"})}));o.setAttribute("templateid",this.templateId);o.setAttribute("fieldname",t.name);o.setAttribute("pageNumber",String(e.pageNumber));o.setAttribute("xScale",String(e.xScale));o.setAttribute("yScale",String(e.yScale));o.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var o;var n=e.detail;this.cachedPageInfo[n.pageNumber]=n;this.pageHeights[n.pageNumber]=n.naturalHeight;(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((function(e){return e&&e.page===n.pageNumber})).forEach((function(e){var o=getFieldId(e);var n=document.getElementById(o);if(n){n.setAttribute("fieldname",e.name);n.setAttribute("pagenumber",String(e.page));t.makeDraggable(n)}}))};e.prototype.makeDraggable=function(e){interact(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,r,i,s;return __generator(this,(function(l){t=+(e.target.getAttribute("posX")||0);o=+(e.target.getAttribute("posY")||0);n=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);i=e.dx/n+t;s=e.dy/r+o;e.target.setAttribute("posX",i);e.target.setAttribute("posy",s);updateCssTransform(e.target,"translate","".concat(i,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,r,i,s,l,a,c,d,u,h,f,v,p,g,m,b,x,E,w,S,_,y,I,k,T,C,D,q,M,R,A,H,P,O,V,L,N;return __generator(this,(function(z){switch(z.label){case 0:c=e.target.getAttribute("fieldname");d=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((function(e){return e.name===c}));if(!d){console.log("[FIELDS] Unable to find field",c,e.target);return[2]}u=e.target.getAttribute("pagenumber");h=this.cachedPageInfo[u],f=h.naturalWidth,v=f===void 0?612:f,p=h.naturalHeight,g=p===void 0?792:p,m=h.renderedHeight,b=m===void 0?792:m;x=e.target.getBoundingClientRect();E=e.target.parentElement;w=E.getBoundingClientRect();S=d.width||defaultWidth(d.type);_=d.height||defaultHeight(d.type);y=Math.max(x.left-w.left,0);I=Math.max(b-(w.bottom-x.bottom),0);k=parseInt(u);if(I>b){k=Math.min(k+1,((r=(n=((o=this.template)===null||o===void 0?void 0:o.documents)||[])===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.pages)||1);I-=b;b=this.cachedPageInfo[k].renderedHeight;console.log("Next page",{newPageNumber:k,newY:I,renderedHeight:b})}else if(I<0){k=Math.max(k-1,1);b=this.cachedPageInfo[k].renderedHeight;I+=b;console.log("[FIELDS] Next page",{newPageNumber:k,newY:I,renderedHeight:b})}T=this.viewCoordinatesToPageCoordinates(y,I,u,v-S,g-_),C=T.x,D=T.y;z.label=1;case 1:z.trys.push([1,3,,4]);q={x:C,y:D,page:k};return[4,updateField(this.endpoint,this.templateId,c,q)];case 2:M=z.sent();console.log("[FIELDS] Updated",M);R=JSON.parse(JSON.stringify(this.template));A=R.fields.findIndex((function(e){return e.name===c}));if(A>-1){R.fields[A]=M}Store.updateTemplate(this.templateId,R);e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);H=this.cachedPageInfo[u],P=H.xScale,O=P===void 0?1:P,V=H.yScale,L=V===void 0?1:V;setControlStyles(e.target,M,O,L);(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:R,event:"updated-field"});return[3,4];case 3:N=z.sent();VerdocsToast("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",N);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(N.message,(l=N.response)===null||l===void 0?void 0:l.status,(a=N.response)===null||a===void 0?void 0:a.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);return[3,4];case 4:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var o;var n=1;var r;do{r="".concat(e,"P").concat(t,"-").concat(n);n++}while((((o=this.template)===null||o===void 0?void 0:o.fields)||[]).some((function(e){return e&&e.name===r})));return r};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,o,n,r){var i=this.cachedPageInfo[o],s=i.xScale,l=s===void 0?1:s,a=i.yScale,c=a===void 0?1:a,d=i.renderedHeight,u=d===void 0?792:d;var h=Math.floor(Math.min(e/l,n));var f=Math.floor(Math.min(Math.max(u-t,0)/c,r));return{x:h,y:f}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,n,r,i,s,l,a,c,d,u,h,f,v,p,g,m;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];n=e.offsetX;r=e.offsetY;i=defaultWidth(this.placing);s=defaultHeight(this.placing);l=this.cachedPageInfo[t];a=l.naturalWidth,c=a===void 0?612:a,d=l.naturalHeight,u=d===void 0?792:d;h=this.viewCoordinatesToPageCoordinates(n,r,t,c-i,u-s);f=Math.floor(h.x);v=Math.floor(h.y);p={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:l.documentId,type:this.placing,required:this.placing!=="radio",page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:f,y:v,width:i,height:s,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",p);return[4,createField(this.endpoint,this.templateId,p)];case 1:g=b.sent();console.log("[FIELDS] Saved field",g);m=JSON.parse(JSON.stringify(this.template));m.fields.push(g);Store.updateTemplate(this.templateId,m);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:m,event:"added-field"});this.placing=null;b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var o,n,r;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return h(Host,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},h("div",{id:"verdocs-template-fields-toolbar"},h("div",{class:"add-for"},"Add field:"),h("verdocs-select-input",{value:this.selectedRoleName,options:i,onInput:function(e){return t.selectedRoleName=e.target.value}}),menuOptions.map((function(e){return h("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),h("div",{class:"pages"},(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).map((function(e){var o=integerSequence(1,e.pages);return o.map((function(o){var n=e.page_sizes[o];return h("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:o,virtualWidth:(n===null||n===void 0?void 0:n.width)||612,virtualHeight:(n===null||n===void 0?void 0:n.height)||792,disabled:true,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,o)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&h("verdocs-ok-dialog",{heading:"Unable to add field",message:(((r=this.template)===null||r===void 0?void 0:r.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:function(){return t.showMustSelectRole=false}}))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateFields.style=VerdocsTemplateFieldsStyle0;
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++){t=arguments[o];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};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(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(o=0)),o)try{if(n=1,r&&(i=l[0]&2?r["return"]:l[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;if(r=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;r=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1];i=l;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(l);break}if(i[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[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,F as Fragment,g as getElement}from"./index-2cd5f887.js";import{VerdocsEndpoint,getTemplate,integerSequence,getOrganizationContacts,isValidEmail,createEnvelope,formatFullName,getRGBA,createTemplateDocument,deleteTemplateDocument,updateField,createField,updateTemplateRole,createTemplateRole,updateTemplate}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-1db52f58.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{D as DocIcon,P as PngIcon,J as JpgIcon,a as PdfIcon,F as FileIcon,b as PageCountIcon,T as TrashIcon}from"./Icons-faf0377f.js";import{f as format}from"./format-b8602175.js";import{i as interact}from"./interact.min-a71beb3d.js";import{b as updateCssTransform,c as removeCssTransform,d as setControlStyles,g as getFieldId,e as defaultWidth,f as defaultHeight}from"./utils-bd656c37.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";var verdocsPreviewCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;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-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreviewStyle0=verdocsPreviewCss;var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[PREVIEW] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(n){console.log("[PREVIEW] Error with preview session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}return h(Host,null,(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){var o=integerSequence(1,t.pages);return h(Fragment,null,o.map((function(o){var n;var r=((n=t.page_sizes)===null||n===void 0?void 0:n[o])||{width:612,height:792};return h("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:o,disabled:true,editable:false,done:false,virtualWidth:r.width,virtualHeight:r.height,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsPreview.style=VerdocsPreviewStyle0;var getRoleNames=function(e){return((e===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.name}))};var getRoleIndex=function(e,t){return Math.max(getRoleNames(e).findIndex((function(e){return e===t})),0)};var verdocsSendCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var VerdocsSendStyle0=verdocsSendCss;var editIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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" tabindex="-1"><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" tabindex="-1"><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 VerdocsSend=function(){function e(e){registerInstance(this,e);this.beforeSend=createEvent(this,"beforeSend",7);this.send=createEvent(this,"send",7);this.exit=createEvent(this,"exit",7);this.sdkError=createEvent(this,"sdkError",7);this.searchContacts=createEvent(this,"searchContacts",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.environment="";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),true,(function(t){console.log("[SEND] Got new template",t);e.template=t;e.loading=false;e.rolesCompleted={};e.recomputeRolesCompleted()}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.onTemplateIdChanged=function(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;var n=this;return __generator(this,(function(r){try{this.endpoint.onSessionChanged((function(e,t,o){if(!o){return}var r={id:o.id,first_name:o.first_name,last_name:o.last_name,email:o.email,phone:o.phone};if(o){n.sessionContacts=[r];getOrganizationContacts(n.endpoint).then((function(e){console.log("[SEND] Got contacts",e);n.sessionContacts=__spreadArray(__spreadArray([],e,true),[r],false)})).catch((function(e){console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return[2]}if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(n){console.log("[SEND] Error with send session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.recomputeRolesCompleted=function(){var e=this;var t;this.rolesCompleted={};var o={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){var n=t.sequence-1;o[n]||(o[n]=[]);var r="r-".concat(n,"-").concat(o[n].length);o[n].push(__assign(__assign({},t),{id:r,role_name:t.name,first_name:t.first_name,last_name:t.last_name}));if(t.first_name&&isValidEmail(t.email)){e.rolesCompleted[r]=__assign(__assign({},t),{id:r,role_name:t.name,first_name:t.first_name,last_name:t.last_name})}}))};e.prototype.getSequenceNumbers=function(){var e;var t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){t[e.sequence]=true}));return Object.keys(t).map((function(e){return+e})).sort((function(e,t){return e-t}))};e.prototype.getRolesAtLevel=function(e){var t;var o=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t.sequence===e})).map((function(t,o){return __assign(__assign({},t),{id:"r-".concat(e,"-").concat(o),role_name:t.name,first_name:t.first_name,last_name:t.last_name})}));return o};e.prototype.getLevelIcon=function(e){if(e==="start"){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e==="end"){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){console.log("hsc",e.detail,t);e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var o;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var n={template_id:this.templateId,name:((o=this.template)===null||o===void 0?void 0:o.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};var r=this.beforeSend.emit(__assign(__assign({},n),{name:n.name,template:this.template}));if(r.defaultPrevented){console.log("[SEND] Send cancelled by parent",n);this.sending=false;return}console.log("[SEND] Creating envelope",n);createEnvelope(this.endpoint,n).then((function(e){var o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},n),{name:n.name,envelope_id:e.id,envelope:e}))})).catch((function(e){var o,n,r;console.log("[SEND] Send error",e);VerdocsToast(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Error creating envelope, please try again later.");t.sending=false;(r=t.sdkError)===null||r===void 0?void 0:r.emit(e)}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,{style:{display:"flex"}},h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var o=this.getSequenceNumbers();console.log("[SEND] Rendering levels",o);var n=Object.values(this.rolesCompleted).filter((function(e){return isValidEmail(e.email)&&e.first_name&&e.last_name}));var r=n.length>=getRoleNames(this.template).length;return h(Host,{class:{sendable:(t=this.template)===null||t===void 0?void 0:t.is_sendable}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon("start"),h("div",{class:"complete"},"Send Envelope")),o.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon("sequence"),e.getRolesAtLevel(t).map((function(t){var o,r,i;var s=!t.email||!t.first_name||!t.last_name;var l=((o=e.rolesCompleted[t.id])===null||o===void 0?void 0:o.first_name)?formatFullName(e.rolesCompleted[t.id]):s?t.role_name:formatFullName(t);var a="verdocs-send-recipient-".concat(t.role_name);var c=getRoleIndex(e.template,t.role_name);var d=getRGBA(c);var u=n.findIndex((function(e){return e.role_name===t.role_name}))>-1;var f={backgroundColor:d,border:u?"2px solid #55bc81":"2px solid #dddddd"};return s?h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(o){return e.handleClickRole(o,t)},id:a},l,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:a,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(o){return e.handleSelectContact(o,t)},contactSuggestions:e.sessionContacts,templateRole:(r=e.rolesCompleted[t.id])!==null&&r!==void 0?r:t,onSearchContacts:function(t){var o;return(o=e.searchContacts)===null||o===void 0?void 0:o.emit(t.detail)}}))):h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(o){return e.handleClickRole(o,t)},id:a},l,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:a,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(o){return e.handleSelectContact(o,t)},contactSuggestions:e.sessionContacts,templateRole:(i=e.rolesCompleted[t.id])!==null&&i!==void 0?i:t,onSearchContacts:function(t){var o;return(o=e.searchContacts)===null||o===void 0?void 0:o.emit(t.detail)}})))})))})),h("div",{class:"level level-done"},this.getLevelIcon("end"),h("div",{class:"complete"},"Signing Complete"))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),h("verdocs-button",{label:"Send",size:"small",disabled:!r||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&h("verdocs-spinner",null)))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsSend.style=VerdocsSendStyle0;var verdocsTemplateAttachmentsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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 VerdocsTemplateAttachmentsStyle0=verdocsTemplateAttachmentsCss;var VerdocsTemplateAttachments=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.sdkError=createEvent(this,"sdkError",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{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]}this.listenToTemplate()}catch(n){console.log("[TEMPLATE ATTACHMENTS] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};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,n,r,i,s,l,a;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();i=e.detail.file;if(!i){return[2]}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,createTemplateDocument(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this))];case 2:s=c.sent();console.log("[ATTACHMENTS] Created attachment",s);l=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 3:l.template=c.sent();console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=c.sent();console.log("[ATTACHMENTS] Error creating template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.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.template})};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,Store.getTemplate(this.endpoint,this.templateId,true)];case 2:e.template=t.sent();console.log("[ATTACHMENTS] New template",this.template);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.template)===null||t===void 0?void 0:t.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};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(this.loading){return h(Host,{class:"loading"},h("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return h(Host,{class:"empty"})}return h(Host,null,h("h5",null,"Existing Attachments"),h("div",{class:"attachments"},(((t=this.template)===null||t===void 0?void 0:t.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.pages),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:!(((o=this.template)===null||o===void 0?void 0:o.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=VerdocsTemplateAttachmentsStyle0;var verdocsTemplateBuildTabsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}';var VerdocsTemplateBuildTabsStyle0=verdocsTemplateBuildTabsCss;var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var CopyIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>';var STEPS=["attachments","roles","settings","fields","preview"];var VerdocsTemplateBuildTabs=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.stepChanged=createEvent(this,"stepChanged",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[BUILD_TABS] Template ID changed",e);this.listenToTemplate()};e.prototype.onStepChanged=function(e){console.log("[BUILD_TABS] Step changed",e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="attachments";console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");return[2]}this.listenToTemplate()}catch(n){console.log("[BUILD_TABS] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.setStep=function(e){var t;console.log("[BUILD_TABS] Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.copyTemplateId=function(){var e=this;navigator.clipboard.writeText(this.templateId).then((function(){VerdocsToast("Template ID copied",{style:"success",duration:3e3})})).catch((function(t){var o;console.warn("[BUILD_TABS] Error copying to clipboard",t);(o=e.sdkError)===null||o===void 0?void 0:o.emit(t)}))};e.prototype.render=function(){var e=this;var t,o,n,r,i,s,l,a,c;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var d=(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>0;var u=d&&(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).length>0;var f=u&&(((n=this.template)===null||n===void 0?void 0:n.fields)||[]).length>0;var v=Math.max(STEPS.indexOf(this.step),0);if(!f&&v>=4){v=3}if(!u&&v>=3){v=1}if(!d&&v>=1){v=0}return h(Host,null,h("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:"Attachment(s)"},{id:"roles",disabled:!d,label:"Roles"},{id:"settings",disabled:!u,label:"Settings"},{id:"fields",disabled:!u,label:"Fields"},{id:"preview",disabled:!f,label:"Preview/Send"}]}),this.templateId&&h("div",{class:"info"},h("verdocs-button-panel",{icon:HelpIcon},h("div",{class:"template-details-panel"},h("h6",null,"Template Details"),h("div",{class:"row"},h("label",null,"ID:"),h("div",{class:"value"},this.templateId),h("div",{class:"icon-button",innerHTML:CopyIcon,onClick:function(){return e.copyTemplateId()}})),h("div",{class:"row"},h("label",null,"Name:"),h("div",{class:"value"},(r=this.template)===null||r===void 0?void 0:r.name)),h("div",{class:"row"},h("label",null,"Visibility:"),h("div",{class:"value"},((i=this.template)===null||i===void 0?void 0:i.is_public)?"Public":((s=this.template)===null||s===void 0?void 0:s.is_personal)?"Private":"Shared")),h("div",{class:"row"},h("label",null,"Created:"),h("div",{class:"value"},((l=this.template)===null||l===void 0?void 0:l.counter)?format(new Date((a=this.template)===null||a===void 0?void 0:a.created_at),"P p"):"")),h("div",{class:"row"},h("label",null,"Used:"),h("div",{class:"value"},(c=this.template)===null||c===void 0?void 0:c.counter," time(s)"))))))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateBuildTabs.style=VerdocsTemplateBuildTabsStyle0;var verdocsTemplateFieldsCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}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 rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}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{width:100%;height:50px;display:-ms-flexbox;display:flex;-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}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}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{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{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 VerdocsTemplateFieldsStyle0=verdocsTemplateFieldsCss;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 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 iconAttachment='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></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,class:"signature"},{id:"initial",tooltip:"Initials",icon:iconInitial,class:"initial"},{id:"sep1",tooltip:"",icon:separator,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:iconTextbox,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:iconCheck,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:iconRadio,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:iconDropdown,class:"dropdown"},{id:"sep2",tooltip:"",icon:separator,class:"separator"},{id:"date",tooltip:"Date",icon:iconDatepicker,class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:iconTimestamp,class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:iconAttachment,class:"attachment"}];var VerdocsTemplateFields=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.fieldsUpdated=createEvent(this,"fieldsUpdated",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}e.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;return __generator(this,(function(n){try{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]}this.listenToTemplate()}catch(n){console.log("[FIELDS] Error with fields session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data))}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.componentWillUpdate=function(){var e=this;var t,o;var n=((t=this.template)===null||t===void 0?void 0:t.roles)||[];if(!this.selectedRoleName||!n.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((o=n[0])===null||o===void 0?void 0:o.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var o,n;e.template=t;e.loading=false;if(!e.selectedRoleName){e.selectedRoleName=((n=(o=t.roles)===null||o===void 0?void 0:o[0])===null||n===void 0?void 0:n.name)||""}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.attachFieldAttributes=function(e,t,o){var n=this;o.addEventListener("settingsChanged",(function(){var e;(e=n.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:n.template,event:"added-field"})}));o.addEventListener("deleted",(function(){var e;o.remove();(e=n.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:n.template,event:"updated-field"})}));o.setAttribute("templateid",this.templateId);o.setAttribute("fieldname",t.name);o.setAttribute("pageNumber",String(e.pageNumber));o.setAttribute("xScale",String(e.xScale));o.setAttribute("yScale",String(e.yScale));o.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var o;var n=e.detail;this.cachedPageInfo[n.pageNumber]=n;this.pageHeights[n.pageNumber]=n.naturalHeight;(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((function(e){return e&&e.page===n.pageNumber})).forEach((function(e){var o=getFieldId(e);var n=document.getElementById(o);if(n){n.setAttribute("fieldname",e.name);n.setAttribute("pagenumber",String(e.page));t.makeDraggable(n)}}))};e.prototype.makeDraggable=function(e){interact(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,r,i,s;return __generator(this,(function(l){t=+(e.target.getAttribute("posX")||0);o=+(e.target.getAttribute("posY")||0);n=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);i=e.dx/n+t;s=e.dy/r+o;e.target.setAttribute("posX",i);e.target.setAttribute("posy",s);updateCssTransform(e.target,"translate","".concat(i,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,r,i,s,l,a,c,d,u,h,f,v,p,g,m,b,x,E,w,S,_,y,I,k,T,C,D,q,M,R,A,H,P,O,V,L,N;return __generator(this,(function(z){switch(z.label){case 0:c=e.target.getAttribute("fieldname");d=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((function(e){return e.name===c}));if(!d){console.log("[FIELDS] Unable to find field",c,e.target);return[2]}u=e.target.getAttribute("pagenumber");h=this.cachedPageInfo[u],f=h.naturalWidth,v=f===void 0?612:f,p=h.naturalHeight,g=p===void 0?792:p,m=h.renderedHeight,b=m===void 0?792:m;x=e.target.getBoundingClientRect();E=e.target.parentElement;w=E.getBoundingClientRect();S=d.width||defaultWidth(d.type);_=d.height||defaultHeight(d.type);y=Math.max(x.left-w.left,0);I=Math.max(b-(w.bottom-x.bottom),0);k=parseInt(u);if(I>b){k=Math.min(k+1,((r=(n=((o=this.template)===null||o===void 0?void 0:o.documents)||[])===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.pages)||1);I-=b;b=this.cachedPageInfo[k].renderedHeight;console.log("Next page",{newPageNumber:k,newY:I,renderedHeight:b})}else if(I<0){k=Math.max(k-1,1);b=this.cachedPageInfo[k].renderedHeight;I+=b;console.log("[FIELDS] Next page",{newPageNumber:k,newY:I,renderedHeight:b})}T=this.viewCoordinatesToPageCoordinates(y,I,u,v-S,g-_),C=T.x,D=T.y;z.label=1;case 1:z.trys.push([1,3,,4]);q={x:C,y:D,page:k};return[4,updateField(this.endpoint,this.templateId,c,q)];case 2:M=z.sent();console.log("[FIELDS] Updated",M);R=JSON.parse(JSON.stringify(this.template));A=R.fields.findIndex((function(e){return e.name===c}));if(A>-1){R.fields[A]=M}Store.updateTemplate(this.templateId,R);e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);H=this.cachedPageInfo[u],P=H.xScale,O=P===void 0?1:P,V=H.yScale,L=V===void 0?1:V;setControlStyles(e.target,M,O,L);(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:R,event:"updated-field"});return[3,4];case 3:N=z.sent();VerdocsToast("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",N);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(N.message,(l=N.response)===null||l===void 0?void 0:l.status,(a=N.response)===null||a===void 0?void 0:a.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);return[3,4];case 4:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var o;var n=1;var r;do{r="".concat(e,"P").concat(t,"-").concat(n);n++}while((((o=this.template)===null||o===void 0?void 0:o.fields)||[]).some((function(e){return e&&e.name===r})));return r};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,o,n,r){var i=this.cachedPageInfo[o],s=i.xScale,l=s===void 0?1:s,a=i.yScale,c=a===void 0?1:a,d=i.renderedHeight,u=d===void 0?792:d;var h=Math.floor(Math.min(e/l,n));var f=Math.floor(Math.min(Math.max(u-t,0)/c,r));return{x:h,y:f}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,n,r,i,s,l,a,c,d,u,h,f,v,p,g,m;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];n=e.offsetX;r=e.offsetY;i=defaultWidth(this.placing);s=defaultHeight(this.placing);l=this.cachedPageInfo[t];a=l.naturalWidth,c=a===void 0?612:a,d=l.naturalHeight,u=d===void 0?792:d;h=this.viewCoordinatesToPageCoordinates(n,r,t,c-i,u-s);f=Math.floor(h.x);v=Math.floor(h.y);p={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:l.documentId,type:this.placing,required:this.placing!=="radio",page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:f,y:v,width:i,height:s,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",p);return[4,createField(this.endpoint,this.templateId,p)];case 1:g=b.sent();console.log("[FIELDS] Saved field",g);m=JSON.parse(JSON.stringify(this.template));m.fields.push(g);Store.updateTemplate(this.templateId,m);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:m,event:"added-field"});this.placing=null;b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var o,n,r;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return h(Host,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},h("div",{id:"verdocs-template-fields-toolbar"},h("div",{class:"add-for"},"Add field:"),h("verdocs-select-input",{value:this.selectedRoleName,options:i,onInput:function(e){return t.selectedRoleName=e.target.value}}),menuOptions.map((function(e){return h("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),h("div",{class:"pages"},(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).map((function(e){var o=integerSequence(1,e.pages);return o.map((function(o){var n=e.page_sizes[o];return h("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:o,virtualWidth:(n===null||n===void 0?void 0:n.width)||612,virtualHeight:(n===null||n===void 0?void 0:n.height)||792,disabled:true,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,o)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&h("verdocs-ok-dialog",{heading:"Unable to add field",message:(((r=this.template)===null||r===void 0?void 0:r.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:function(){return t.showMustSelectRole=false}}))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateFields.style=VerdocsTemplateFieldsStyle0;
2
2
  /**!
3
3
  * Sortable 1.15.6
4
4
  * @author RubaXa <trash@rubaxa.org>