@verdocs/web-sdk 5.0.3 → 5.0.5

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 (309) hide show
  1. package/dist/cjs/{Datastore-b1742da2.js → Datastore-5b860927.js} +2 -2
  2. package/dist/cjs/index-ccac8641.js +4 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-button_2.cjs.entry.js +2 -2
  6. package/dist/cjs/verdocs-checkbox_6.cjs.entry.js +8 -8
  7. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-dialog.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  14. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +4 -4
  15. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +241 -0
  19. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-preview_6.cjs.entry.js +2836 -156
  23. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  28. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
  30. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  31. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  33. package/dist/collection/collection-manifest.json +1 -0
  34. package/dist/collection/components/controls/verdocs-help-icon/verdocs-help-icon.css +1 -1
  35. package/dist/collection/components/controls/verdocs-help-icon/verdocs-help-icon.js +1 -1
  36. package/dist/collection/components/controls/verdocs-menu-panel/verdocs-menu-panel.css +42 -0
  37. package/dist/collection/components/controls/verdocs-menu-panel/verdocs-menu-panel.js +159 -0
  38. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.js +1 -1
  39. package/dist/collection/components/controls/verdocs-pagination/verdocs-pagination.js +1 -1
  40. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +1 -1
  41. package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.js +1 -1
  42. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.js +1 -1
  43. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.css +2 -2
  44. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.js +1 -1
  45. package/dist/collection/components/controls/verdocs-spinner/verdocs-spinner.js +1 -1
  46. package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js +2 -2
  47. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +2 -2
  48. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +4 -4
  49. package/dist/collection/components/controls/verdocs-toggle-button/verdocs-toggle-button.js +1 -1
  50. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.js +1 -1
  51. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.js +1 -1
  52. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
  53. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
  54. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
  55. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  56. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  57. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  58. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  59. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  60. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  61. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  62. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.css +27 -42
  63. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +12 -14
  64. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.css +74 -120
  65. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +118 -101
  66. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  67. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  68. package/dist/collection/utils/Datastore.js +2 -2
  69. package/dist/components/index.js +2 -0
  70. package/dist/components/{p-ed88b8d2.js → p-005c3387.js} +3 -3
  71. package/dist/components/{p-0d063bf9.js → p-052fcdac.js} +4 -4
  72. package/dist/components/{p-0a69031f.js → p-053a0408.js} +6 -6
  73. package/dist/components/{p-1c2cf1be.js → p-15b1e7a0.js} +10 -8
  74. package/dist/components/{p-293ea62f.js → p-1a77c51b.js} +5 -5
  75. package/dist/components/{p-f990140a.js → p-2ef2d490.js} +2 -2
  76. package/dist/components/{p-c8fedb4e.js → p-325b3828.js} +6 -6
  77. package/dist/components/{p-6315b90f.js → p-332a97b3.js} +1 -1
  78. package/dist/components/{p-b0c02eb8.js → p-3a621e5d.js} +7 -7
  79. package/dist/components/{p-18999830.js → p-41a75ad6.js} +1 -1
  80. package/dist/components/{p-5eb45a4f.js → p-44ae3c75.js} +1 -1
  81. package/dist/components/{p-1e2e8b1c.js → p-4d3b9ee9.js} +1 -1
  82. package/dist/components/{p-1e67ebdf.js → p-53585e13.js} +18 -26
  83. package/dist/components/{p-c7b00ce6.js → p-5654568d.js} +1 -1
  84. package/dist/components/{p-ecc818bb.js → p-5df09a0d.js} +6 -6
  85. package/dist/components/{p-315d6592.js → p-62743fd3.js} +2 -2
  86. package/dist/components/{p-dd701894.js → p-6506ddb4.js} +6 -6
  87. package/dist/components/{p-5d4bbcd0.js → p-6719b0d7.js} +1 -1
  88. package/dist/components/{p-d9704a51.js → p-6c18617e.js} +6 -6
  89. package/dist/components/p-6e8464b6.js +3028 -0
  90. package/dist/components/{p-fd96322b.js → p-7246d2ee.js} +6 -6
  91. package/dist/components/{p-0ca7012b.js → p-7f32e087.js} +2 -2
  92. package/dist/components/{p-9b3c58d9.js → p-987a8392.js} +22 -22
  93. package/dist/components/{p-b9034018.js → p-9c0b30f8.js} +3 -3
  94. package/dist/components/{p-b16c202a.js → p-9cfd8022.js} +1 -1
  95. package/dist/components/{p-a3e12c74.js → p-9fb98ea2.js} +1 -1
  96. package/dist/components/{p-f72b9c45.js → p-a2f6d2c6.js} +1 -1
  97. package/dist/components/{p-1ca705bc.js → p-b36c979b.js} +6 -6
  98. package/dist/{esm/Datastore-52fcbac6.js → components/p-b712e729.js} +2 -2
  99. package/dist/components/{p-cf6ea837.js → p-b7d080eb.js} +1 -1
  100. package/dist/components/p-be261487.js +79 -0
  101. package/dist/components/{p-9bb47a5a.js → p-c00770e6.js} +1 -1
  102. package/dist/components/{p-4afcdc84.js → p-c9a4ef35.js} +6 -6
  103. package/dist/components/{p-9c3fd545.js → p-ca8e3721.js} +8 -8
  104. package/dist/components/{p-5a9cea40.js → p-cce871bf.js} +3 -3
  105. package/dist/components/{p-df3afaa8.js → p-cef9df4b.js} +20 -20
  106. package/dist/components/{p-74452a2b.js → p-d9074622.js} +3 -3
  107. package/dist/components/{p-d25cdbff.js → p-f0f1ed82.js} +21 -21
  108. package/dist/components/{p-58c2bd5d.js → p-f0f6e862.js} +2 -2
  109. package/dist/components/{p-49153610.js → p-f21ef4fb.js} +7 -7
  110. package/dist/components/{p-fcad60f5.js → p-f4e068a9.js} +2 -2
  111. package/dist/components/{p-2548f3f0.js → p-f7462b26.js} +1 -1
  112. package/dist/components/verdocs-auth.js +2 -2
  113. package/dist/components/verdocs-build.js +64 -58
  114. package/dist/components/verdocs-contact-picker.js +1 -1
  115. package/dist/components/verdocs-dialog.js +1 -1
  116. package/dist/components/verdocs-dropdown.js +1 -1
  117. package/dist/components/verdocs-envelope-document-page.js +1 -1
  118. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  119. package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
  120. package/dist/components/verdocs-envelope-sidebar.js +8 -8
  121. package/dist/components/verdocs-envelopes-list.js +13 -13
  122. package/dist/components/verdocs-field-attachment.js +1 -1
  123. package/dist/components/verdocs-field-checkbox.js +1 -1
  124. package/dist/components/verdocs-field-date.js +1 -1
  125. package/dist/components/verdocs-field-dropdown.js +1 -1
  126. package/dist/components/verdocs-field-initial.js +1 -1
  127. package/dist/components/verdocs-field-payment.js +6 -6
  128. package/dist/components/verdocs-field-radio.js +1 -1
  129. package/dist/components/verdocs-field-signature.js +1 -1
  130. package/dist/components/verdocs-field-textarea.js +1 -1
  131. package/dist/components/verdocs-field-textbox.js +1 -1
  132. package/dist/components/verdocs-field-timestamp.js +1 -1
  133. package/dist/components/verdocs-help-icon.js +1 -1
  134. package/dist/components/verdocs-initial-dialog.js +1 -1
  135. package/dist/components/verdocs-menu-panel.d.ts +11 -0
  136. package/dist/components/verdocs-menu-panel.js +6 -0
  137. package/dist/components/verdocs-ok-dialog.js +1 -1
  138. package/dist/components/verdocs-organization-card.js +2 -2
  139. package/dist/components/verdocs-pagination.js +1 -1
  140. package/dist/components/verdocs-portal.js +1 -1
  141. package/dist/components/verdocs-preview.js +1 -1
  142. package/dist/components/verdocs-progress-bar.js +1 -1
  143. package/dist/components/verdocs-quick-functions.js +1 -1
  144. package/dist/components/verdocs-radio-button.js +1 -1
  145. package/dist/components/verdocs-search-tabs.js +1 -1
  146. package/dist/components/verdocs-select-input.js +1 -1
  147. package/dist/components/verdocs-send.js +1 -1
  148. package/dist/components/verdocs-sign.js +6 -6
  149. package/dist/components/verdocs-signature-dialog.js +1 -1
  150. package/dist/components/verdocs-spinner.js +1 -1
  151. package/dist/components/verdocs-status-indicator.js +1 -1
  152. package/dist/components/verdocs-switch.js +1 -1
  153. package/dist/components/verdocs-template-attachments.js +1 -1
  154. package/dist/components/verdocs-template-build-tabs.js +1 -1
  155. package/dist/components/verdocs-template-card.js +1 -1
  156. package/dist/components/verdocs-template-create.js +1 -1
  157. package/dist/components/verdocs-template-document-page.js +1 -1
  158. package/dist/components/verdocs-template-field-properties.js +1 -1
  159. package/dist/components/verdocs-template-fields.js +1 -1
  160. package/dist/components/verdocs-template-role-properties.js +1 -1
  161. package/dist/components/verdocs-template-roles.js +1 -1
  162. package/dist/components/verdocs-template-star.js +1 -1
  163. package/dist/components/verdocs-template-tags.js +1 -1
  164. package/dist/components/verdocs-templates-list.js +8 -8
  165. package/dist/components/verdocs-text-input.js +1 -1
  166. package/dist/components/verdocs-toggle-button.js +1 -1
  167. package/dist/components/verdocs-toolbar-icon.js +1 -1
  168. package/dist/components/verdocs-upload-dialog.js +1 -1
  169. package/dist/components/verdocs-view.js +1 -1
  170. package/dist/{components/p-da4d4eed.js → esm/Datastore-d29d4aeb.js} +2 -2
  171. package/dist/esm/index-272d51a4.js +4 -4
  172. package/dist/esm/loader.js +1 -1
  173. package/dist/esm/verdocs-build.entry.js +1 -1
  174. package/dist/esm/verdocs-button_2.entry.js +2 -2
  175. package/dist/esm/verdocs-checkbox_6.entry.js +8 -8
  176. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  177. package/dist/esm/verdocs-dialog.entry.js +1 -1
  178. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  179. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  180. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  181. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
  182. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  183. package/dist/esm/verdocs-field-attachment_13.entry.js +4 -4
  184. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  185. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  186. package/dist/esm/verdocs-kba-dialog_2.entry.js +1 -1
  187. package/dist/esm/verdocs-menu-panel_2.entry.js +236 -0
  188. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  189. package/dist/esm/verdocs-organization-card_2.entry.js +2 -2
  190. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  191. package/dist/esm/verdocs-preview_6.entry.js +2784 -104
  192. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  193. package/dist/esm/verdocs-radio-button.entry.js +1 -1
  194. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  195. package/dist/esm/verdocs-spinner.entry.js +1 -1
  196. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  197. package/dist/esm/verdocs-template-card.entry.js +1 -1
  198. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  199. package/dist/esm/verdocs-template-star.entry.js +1 -1
  200. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  201. package/dist/esm/verdocs-web-sdk.js +1 -1
  202. package/dist/esm-es5/{Datastore-52fcbac6.js → Datastore-d29d4aeb.js} +1 -1
  203. package/dist/esm-es5/index-272d51a4.js +1 -1
  204. package/dist/esm-es5/loader.js +1 -1
  205. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  206. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  207. package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -1
  208. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  209. package/dist/esm-es5/verdocs-dialog.entry.js +1 -1
  210. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  211. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  212. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  213. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  214. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  215. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  216. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  217. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  218. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  219. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -0
  220. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  221. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  222. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  223. package/dist/esm-es5/verdocs-preview_6.entry.js +7 -1
  224. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  225. package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
  226. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  227. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  228. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  229. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  230. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  231. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  232. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  233. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  234. package/dist/types/components/controls/verdocs-menu-panel/verdocs-menu-panel.d.ts +38 -0
  235. package/dist/types/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.d.ts +1 -1
  236. package/dist/types/components/templates/verdocs-template-roles/verdocs-template-roles.d.ts +5 -3
  237. package/dist/types/components.d.ts +101 -8
  238. package/dist/verdocs-web-sdk/{p-65c5398e.entry.js → p-152b9acd.entry.js} +1 -1
  239. package/dist/verdocs-web-sdk/{p-c9f40726.system.entry.js → p-1d5b9103.system.entry.js} +1 -1
  240. package/dist/verdocs-web-sdk/{p-3364cc13.system.entry.js → p-1e191c20.system.entry.js} +1 -1
  241. package/dist/verdocs-web-sdk/{p-7464b84f.entry.js → p-1e495c60.entry.js} +1 -1
  242. package/dist/verdocs-web-sdk/{p-192403ff.entry.js → p-2224ca6d.entry.js} +1 -1
  243. package/dist/verdocs-web-sdk/{p-5b541da2.entry.js → p-27da4a2b.entry.js} +1 -1
  244. package/dist/verdocs-web-sdk/{p-914e131c.system.entry.js → p-2eae32d9.system.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/p-306bde40.system.entry.js +1 -0
  246. package/dist/verdocs-web-sdk/{p-0e9de098.entry.js → p-30c3f624.entry.js} +1 -1
  247. package/dist/verdocs-web-sdk/{p-8d401072.system.entry.js → p-3268dad0.system.entry.js} +1 -1
  248. package/dist/verdocs-web-sdk/p-365ed258.entry.js +1 -0
  249. package/dist/verdocs-web-sdk/{p-ddb17b3e.entry.js → p-39b72c10.entry.js} +1 -1
  250. package/dist/verdocs-web-sdk/{p-f5d01982.system.entry.js → p-417f71da.system.entry.js} +1 -1
  251. package/dist/verdocs-web-sdk/{p-b8737f7b.entry.js → p-42b157d2.entry.js} +1 -1
  252. package/dist/verdocs-web-sdk/{p-771c2f92.entry.js → p-47f32221.entry.js} +1 -1
  253. package/dist/verdocs-web-sdk/p-48ff3cce.system.entry.js +1 -0
  254. package/dist/verdocs-web-sdk/{p-b0b958a0.entry.js → p-51c97029.entry.js} +1 -1
  255. package/dist/verdocs-web-sdk/{p-c18c718f.system.js → p-55de8cd1.system.js} +1 -1
  256. package/dist/verdocs-web-sdk/{p-7c8938e7.system.entry.js → p-5824962b.system.entry.js} +1 -1
  257. package/dist/verdocs-web-sdk/{p-aebb0cd9.system.entry.js → p-5aa76635.system.entry.js} +1 -1
  258. package/dist/verdocs-web-sdk/{p-89cdecac.system.entry.js → p-5b0cd815.system.entry.js} +1 -1
  259. package/dist/verdocs-web-sdk/{p-0950534e.system.entry.js → p-5ce491ac.system.entry.js} +1 -1
  260. package/dist/verdocs-web-sdk/{p-c6fd3e53.system.entry.js → p-6237ce51.system.entry.js} +1 -1
  261. package/dist/verdocs-web-sdk/{p-c7cd6843.entry.js → p-660bda06.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-97b00cae.system.entry.js → p-7e73805f.system.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/{p-8c03fc69.entry.js → p-8025cac7.entry.js} +1 -1
  264. package/dist/verdocs-web-sdk/{p-3dd29b19.entry.js → p-87ac8456.entry.js} +1 -1
  265. package/dist/verdocs-web-sdk/{p-475ea471.system.entry.js → p-899617aa.system.entry.js} +1 -1
  266. package/dist/verdocs-web-sdk/{p-2a1287ec.entry.js → p-899fa588.entry.js} +1 -1
  267. package/dist/verdocs-web-sdk/{p-511a4ecc.system.entry.js → p-90bc3ad0.system.entry.js} +1 -1
  268. package/dist/verdocs-web-sdk/{p-a242aa80.system.entry.js → p-917aab58.system.entry.js} +1 -1
  269. package/dist/verdocs-web-sdk/{p-524f37a0.entry.js → p-92364765.entry.js} +1 -1
  270. package/dist/verdocs-web-sdk/{p-f9b37af2.system.entry.js → p-94fe5817.system.entry.js} +1 -1
  271. package/dist/verdocs-web-sdk/{p-41cbf650.entry.js → p-99b819ad.entry.js} +1 -1
  272. package/dist/verdocs-web-sdk/{p-df04f0ca.entry.js → p-a8809e33.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/{p-a9635106.system.entry.js → p-ac6ecfad.system.entry.js} +1 -1
  274. package/dist/verdocs-web-sdk/{p-62f15675.system.entry.js → p-ad3d07a6.system.entry.js} +1 -1
  275. package/dist/verdocs-web-sdk/p-aeae75a3.system.entry.js +7 -0
  276. package/dist/verdocs-web-sdk/{p-df392ef9.entry.js → p-af1802b6.entry.js} +1 -1
  277. package/dist/verdocs-web-sdk/p-b712e729.js +1 -0
  278. package/dist/verdocs-web-sdk/{p-a165607e.entry.js → p-be4ec401.entry.js} +1 -1
  279. package/dist/verdocs-web-sdk/{p-bcc23811.entry.js → p-bea73364.entry.js} +1 -1
  280. package/dist/verdocs-web-sdk/{p-92153daa.system.entry.js → p-c253ae24.system.entry.js} +1 -1
  281. package/dist/verdocs-web-sdk/{p-92ffc207.entry.js → p-c2766b5a.entry.js} +1 -1
  282. package/dist/verdocs-web-sdk/{p-6ced37ed.entry.js → p-c3593d47.entry.js} +1 -1
  283. package/dist/verdocs-web-sdk/p-c555a700.entry.js +8 -0
  284. package/dist/verdocs-web-sdk/{p-3e7915e9.system.entry.js → p-c60743ac.system.entry.js} +1 -1
  285. package/dist/verdocs-web-sdk/{p-b9b6b3b4.system.entry.js → p-c94b0dc5.system.entry.js} +1 -1
  286. package/dist/verdocs-web-sdk/{p-78191329.system.entry.js → p-cb7aa6b8.system.entry.js} +1 -1
  287. package/dist/verdocs-web-sdk/{p-54f085d1.entry.js → p-db4c36aa.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/{p-d475fff3.entry.js → p-dc558be5.entry.js} +1 -1
  289. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
  290. package/dist/verdocs-web-sdk/{p-80ce3711.system.entry.js → p-e6d711e0.system.entry.js} +1 -1
  291. package/dist/verdocs-web-sdk/{p-ba8f5177.system.entry.js → p-f3b5052f.system.entry.js} +1 -1
  292. package/dist/verdocs-web-sdk/{p-9fb22181.entry.js → p-f40fe8d7.entry.js} +1 -1
  293. package/dist/verdocs-web-sdk/{p-e83cd333.entry.js → p-f6b77cd1.entry.js} +1 -1
  294. package/dist/verdocs-web-sdk/{p-d98cbd0f.system.entry.js → p-f84932fd.system.entry.js} +1 -1
  295. package/dist/verdocs-web-sdk/{p-6330dbef.entry.js → p-fc90cc87.entry.js} +1 -1
  296. package/dist/verdocs-web-sdk/{p-386d789c.system.entry.js → p-ff8143df.system.entry.js} +1 -1
  297. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  298. package/package.json +5 -4
  299. package/dist/cjs/verdocs-template-role-properties.cjs.entry.js +0 -184
  300. package/dist/components/p-8fbc64e9.js +0 -349
  301. package/dist/components/p-ea5954bd.js +0 -4
  302. package/dist/esm/verdocs-template-role-properties.entry.js +0 -180
  303. package/dist/esm-es5/verdocs-template-role-properties.entry.js +0 -1
  304. package/dist/verdocs-web-sdk/p-03244cd1.system.entry.js +0 -1
  305. package/dist/verdocs-web-sdk/p-9567cb7d.system.entry.js +0 -1
  306. package/dist/verdocs-web-sdk/p-982f1b36.system.entry.js +0 -1
  307. package/dist/verdocs-web-sdk/p-bb0effe1.entry.js +0 -1
  308. package/dist/verdocs-web-sdk/p-c33ae58a.entry.js +0 -1
  309. package/dist/verdocs-web-sdk/p-da4d4eed.js +0 -1
@@ -0,0 +1,7 @@
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];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,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=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(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,o;n<r;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-c8a15cb7.system.js","./p-55de8cd1.system.js","./p-9b26e4e0.system.js","./p-cd546dbe.system.js","./p-2c5350ec.system.js","./p-70751089.system.js","./p-736a2c41.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js"],(function(e){"use strict";var t,i,n,r,o,s,a,l,c,u,d,f,h,v,p,m,g,b,x,w,y,_,k,E,q,S,M,C,I,T,L,H,Z,O,z,D,V,N;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;o=e.F;s=e.g},function(e){a=e.VerdocsEndpoint;l=e.getTemplate;c=e.integerSequence;u=e.getOrganizationContacts;d=e.isValidEmail;f=e.createEnvelope;h=e.getRGBA;v=e.formatFullName;p=e.createTemplateDocument;m=e.deleteTemplateDocument;g=e.updateField;b=e.createField;x=e.updateTemplateRole;w=e.createTemplateRole},function(e){y=e.S},function(e){_=e.S},function(e){k=e.V},function(e){E=e.D;q=e.P;S=e.J;M=e.a;C=e.F;I=e.b;T=e.T},function(e){L=e.f},function(e){H=e.i},function(e){Z=e.b;O=e.c;z=e.d;D=e.g;V=e.e;N=e.f},function(){},function(){}],execute:function(){var A='@-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 j=A;var R=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateListenerId=null;this.endpoint=a.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();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.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,i;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 y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){};e.prototype.render=function(){var e=this;var t;if(this.loading){return n(r,null,n("verdocs-loader",null))}return n(r,null,(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){var i=c(1,t.pages);return n(o,null,i.map((function(i){var r;var o=((r=t.page_sizes)===null||r===void 0?void 0:r[i])||{width:612,height:792};return n("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:i,disabled:true,editable:false,done:false,virtualWidth:o.width,virtualHeight:o.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}());R.style=j;var U=function(e){return((e===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.name}))};var B=function(e,t){return Math.max(U(e).findIndex((function(e){return e===t})),0)};var P='@-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 Q=P;var F='<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 Y='<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 J='<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 W='<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 G=e("verdocs_send",function(){function e(e){t(this,e);this.sendingEnvelope=i(this,"sendingEnvelope",7);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.templateListenerId=null;this.endpoint=a.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();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false;e.rolesCompleted={}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.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,i;var n=this;return __generator(this,(function(r){try{this.endpoint.onSessionChanged((function(e,t,i){if(!i){return}var r={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};if(i){n.sessionContacts=[r];u(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 y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.recomputeRolesCompleted=function(){var e=this;var t;this.rolesCompleted={};var i={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){var n=t.sequence-1;i[n]||(i[n]=[]);var r="r-".concat(n,"-").concat(i[n].length);i[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&&d(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.getLevels=function(){var e;var t=__spreadArray([],new Set((((e=this.template)===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.sequence-1}))),true);t.sort((function(e,t){return e-t}));return t};e.prototype.getRolesAtLevel=function(e){var t;var i=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t.sequence-1===e})).map((function(t,i){return __assign(__assign({},t),{id:"r-".concat(e,"-").concat(i),role_name:t.name,first_name:"",last_name:""})}));return i};e.prototype.getLevelIcon=function(e){var t=this.getLevels();if(e<0){return n("div",{class:"level-icon",innerHTML:Y})}else if(e>=t.length){return n("div",{class:"level-icon",innerHTML:W})}else{return n("div",{class:"level-icon",innerHTML:J})}};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 i,n;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;(i=this.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:true});var r={template_id:this.templateId,name:((n=this.template)===null||n===void 0?void 0:n.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};console.log("[SEND] Creating envelope",r);f(this.endpoint,r).then((function(e){var i,n;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false});(n=t.send)===null||n===void 0?void 0:n.emit(__assign(__assign({},r),{name:r.name,envelope_id:e.id,envelope:e}))})).catch((function(e){var i,n,r;console.log("Send error",e);k(((n=(i=e.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)||"Error creating envelope, please try again later.");t.sending=false;(r=t.sendingEnvelope)===null||r===void 0?void 0:r.emit({sending:false})}))};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 n(r,null,n("verdocs-loader",null))}if(!this.endpoint.session){return n(r,{style:{display:"flex"}},n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=this.getLevels();var o=Object.values(this.rolesCompleted).filter((function(e){return d(e.email)}));var s=o.length>=U(this.template).length;return n(r,{class:{sendable:(t=this.template)===null||t===void 0?void 0:t.is_sendable}},n("div",{class:"recipients"},n("div",{class:"left-line"}),n("div",{class:"level level-start"},this.getLevelIcon(-1),n("div",{class:"complete"},"Send Envelope")),i.map((function(t){return n("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.getRolesAtLevel(t).map((function(t){var i,r,o,s;var a=!t.email;var l="verdocs-send-recipient-".concat(t.role_name);var c=B(e.template,t.role_name);var u=h(c);return a?n("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:{backgroundColor:u},onClick:function(i){return e.handleClickRole(i,t)},id:l},((i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.first_name)?v(e.rolesCompleted[t.id]):t.role_name,n("div",{class:"icon",innerHTML:F}),e.showPickerForId===t.id&&n("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},n("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(r=e.rolesCompleted[t.id])!==null&&r!==void 0?r:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):n("div",{class:"recipient",style:{borderColor:u},onClick:function(i){return e.handleClickRole(i,t)},id:l},((o=e.rolesCompleted[t.id])===null||o===void 0?void 0:o.first_name)?v(e.rolesCompleted[t.id]):t.role_name,n("div",{class:"icon",innerHTML:F}),e.showPickerForId===t.id&&n("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},n("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.rolesCompleted[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),n("div",{class:"level level-done"},this.getLevelIcon(i.length),n("div",{class:"complete"},"Signing Complete"))),n("div",{class:"buttons"},n("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),n("verdocs-button",{label:"Send",size:"small",disabled:!s||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&n("verdocs-spinner",null)))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}());G.style=Q;var X='@-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 K=X;var $=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.templateListenerId=null;this.endpoint=a.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,i;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 y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.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){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.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,i,n,r,o,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();o=e.detail.file;if(!o){return[2]}console.log("[ATTACHMENTS] Uploading...",o);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,p(this.endpoint,this.templateId,o,this.handleUploadProgress.bind(this))];case 2:s=c.sent();console.log("[ATTACHMENTS] Created attachment",s);a=this;return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 3:a.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:l=c.sent();console.log("[ATTACHMENTS] Error creating template",l);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new y(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(r=l.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,m(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,_.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(i){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 M;case"image/jpeg":return S;case"image/png":return q;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return E}return C};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return n(r,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return n(r,{class:"loading"},n("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return n(r,{class:"empty"})}return n(r,null,n("h5",null,"Existing Attachments"),n("div",{class:"attachments"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){return n("div",{class:"attachment"},n("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),n("div",{class:"filename",title:t.name},t.name),n("div",{class:"pages"},n("div",{class:"count"},t.pages),n("div",{class:"pages-icon",innerHTML:I})),n("div",{class:"trash-icon",innerHTML:T,onClick:function(){return e.handleDelete(t)}}))}))),n("h5",null,"Attach a New Document"),this.uploading?n("div",{class:"loader-wrapper"},n("verdocs-loader",null),this.progressLabel&&n("div",{class:"progress-wrapper"},n("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):n("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!(((i=this.template)===null||i===void 0?void 0:i.documents)||[]).length||this.uploading})),this.showDeleteError&&n("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&n("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}());$.style=K;var ee='@-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 te=ee;var ie='<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 ne='<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 re=["attachments","roles","settings","fields","preview"];var oe=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.templateListenerId=null;this.endpoint=a.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();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.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,i;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 y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.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(){k("Template ID copied",{style:"success",duration:3e3})})).catch((function(t){var i;console.warn("[BUILD_TABS] Error copying to clipboard",t);(i=e.sdkError)===null||i===void 0?void 0:i.emit(t)}))};e.prototype.render=function(){var e=this;var t,i,o,s,a,l,c,u,d;if(this.loading){return n(r,null,n("verdocs-loader",null))}if(!this.endpoint.session){return n(r,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var f=(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>0;var h=f&&(((i=this.template)===null||i===void 0?void 0:i.roles)||[]).length>0;var v=h&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).length>0;var p=Math.max(re.indexOf(this.step),0);if(!v&&p>=4){p=3}if(!h&&p>=3){p=1}if(!f&&p>=1){p=0}return n(r,null,n("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:p,tabs:[{id:"attachments",disabled:false,label:"Attachment(s)"},{id:"roles",disabled:!f,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!v,label:"Preview/Send"}]}),this.templateId&&n("div",{class:"info"},n("verdocs-button-panel",{icon:ie},n("div",{class:"template-details-panel"},n("h6",null,"Template Details"),n("div",{class:"row"},n("label",null,"ID:"),n("div",{class:"value"},this.templateId),n("div",{class:"icon-button",innerHTML:ne,onClick:function(){return e.copyTemplateId()}})),n("div",{class:"row"},n("label",null,"Name:"),n("div",{class:"value"},(s=this.template)===null||s===void 0?void 0:s.name)),n("div",{class:"row"},n("label",null,"Visibility:"),n("div",{class:"value"},((a=this.template)===null||a===void 0?void 0:a.is_public)?"Public":((l=this.template)===null||l===void 0?void 0:l.is_personal)?"Private":"Shared")),n("div",{class:"row"},n("label",null,"Created:"),n("div",{class:"value"},((c=this.template)===null||c===void 0?void 0:c.counter)?L(new Date((u=this.template)===null||u===void 0?void 0:u.created_at),"P p"):"")),n("div",{class:"row"},n("label",null,"Used:"),n("div",{class:"value"},(d=this.template)===null||d===void 0?void 0:d.counter," time(s)"))))))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());oe.style=te;var se="@-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 ae=se;var le='<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 ce='<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 ue='<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 de='<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 fe='<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 he='<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 ve='<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 pe='<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 me='<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 ge='<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 be=[{id:"signature",tooltip:"Signature",icon:fe,class:"signature"},{id:"initial",tooltip:"Initials",icon:he,class:"initial"},{id:"sep1",tooltip:"",icon:ge,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:le,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:ce,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:ue,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:pe,class:"dropdown"},{id:"sep2",tooltip:"",icon:ge,class:"separator"},{id:"date",tooltip:"Date",icon:de,class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:ve,class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:me,class:"attachment"}];var xe=e("verdocs_template_fields",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.fieldsUpdated=i(this,"fieldsUpdated",7);this.templateListenerId=null;this.pageHeights={};this.cachedPageInfo={};this.endpoint=a.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null}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,i;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 y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.componentDidRender=function(){H.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,i;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=((i=n[0])===null||i===void 0?void 0:i.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();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){var i,n;e.template=t;e.loading=false;e.selectedRoleName=((n=(i=t.roles)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.name)||""}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;i.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"})}));i.addEventListener("deleted",(function(){var e;i.remove();(e=n.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:n.template,event:"updated-field"})}));i.setAttribute("templateid",this.templateId);i.setAttribute("fieldname",t.name);i.setAttribute("pageNumber",String(e.pageNumber));i.setAttribute("xScale",String(e.xScale));i.setAttribute("yScale",String(e.yScale));i.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var i;var n=e.detail;this.cachedPageInfo[n.pageNumber]=n;this.pageHeights[n.pageNumber]=n.naturalHeight;(((i=this.template)===null||i===void 0?void 0:i.fields)||[]).filter((function(e){return e&&e.page===n.pageNumber})).forEach((function(e){var i=D(e);var n=document.getElementById(i);if(n){n.setAttribute("fieldname",e.name);n.setAttribute("pagenumber",String(e.page));t.makeDraggable(n)}}))};e.prototype.makeDraggable=function(e){H(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,i,n,r,o,s;return __generator(this,(function(a){t=+(e.target.getAttribute("posX")||0);i=+(e.target.getAttribute("posY")||0);n=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);o=e.dx/n+t;s=e.dy/r+i;e.target.setAttribute("posX",o);e.target.setAttribute("posy",s);Z(e.target,"translate","".concat(o,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,o,s,a,l,c,u,d,f,h,v,p,m,b,x,w,E,q,S,M,C,I,T,L,H,Z,D,A,j,R,U,B,P,Q,F,Y;return __generator(this,(function(J){switch(J.label){case 0:c=e.target.getAttribute("fieldname");u=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((function(e){return e.name===c}));if(!u){console.log("[FIELDS] Unable to find field",c,e.target);return[2]}d=e.target.getAttribute("pagenumber");f=this.cachedPageInfo[d],h=f.naturalWidth,v=h===void 0?612:h,p=f.naturalHeight,m=p===void 0?792:p,b=f.renderedHeight,x=b===void 0?792:b;w=e.target.getBoundingClientRect();E=e.target.parentElement;q=E.getBoundingClientRect();S=u.width||V(u.type);M=u.height||N(u.type);C=Math.max(w.left-q.left,0);I=Math.max(x-(q.bottom-w.bottom),0);T=parseInt(d);if(I>x){T=Math.min(T+1,((r=(n=((i=this.template)===null||i===void 0?void 0:i.documents)||[])===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.pages)||1);I-=x;x=this.cachedPageInfo[T].renderedHeight;console.log("Next page",{newPageNumber:T,newY:I,renderedHeight:x})}else if(I<0){T=Math.max(T-1,1);x=this.cachedPageInfo[T].renderedHeight;I+=x;console.log("[FIELDS] Next page",{newPageNumber:T,newY:I,renderedHeight:x})}L=this.viewCoordinatesToPageCoordinates(C,I,d,v-S,m-M),H=L.x,Z=L.y;J.label=1;case 1:J.trys.push([1,3,,4]);D={x:H,y:Z,page:T};return[4,g(this.endpoint,this.templateId,c,D)];case 2:A=J.sent();console.log("[FIELDS] Updated",A);j=JSON.parse(JSON.stringify(this.template));R=j.fields.findIndex((function(e){return e.name===c}));if(R>-1){j.fields[R]=A}_.updateTemplate(this.templateId,j);e.target.removeAttribute("posX");e.target.removeAttribute("posY");O(e.target);U=this.cachedPageInfo[d],B=U.xScale,P=B===void 0?1:B,Q=U.yScale,F=Q===void 0?1:Q;z(e.target,A,P,F);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:j,event:"updated-field"});return[3,4];case 3:Y=J.sent();k("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",Y);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new y(Y.message,(a=Y.response)===null||a===void 0?void 0:a.status,(l=Y.response)===null||l===void 0?void 0:l.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");O(e.target);return[3,4];case 4:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var i;var n=1;var r;do{r="".concat(e,"P").concat(t,"-").concat(n);n++}while((((i=this.template)===null||i===void 0?void 0:i.fields)||[]).some((function(e){return e&&e.name===r})));return r};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,i,n,r){var o=this.cachedPageInfo[i],s=o.xScale,a=s===void 0?1:s,l=o.yScale,c=l===void 0?1:l,u=o.renderedHeight,d=u===void 0?792:u;var f=Math.floor(Math.min(e/a,n));var h=Math.floor(Math.min(Math.max(d-t,0)/c,r));return{x:f,y:h}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,r,o,s,a,l,c,u,d,f,h,v,p,m,g;return __generator(this,(function(x){switch(x.label){case 0:if(!this.placing)return[3,2];n=e.offsetX;r=e.offsetY;o=V(this.placing);s=N(this.placing);a=this.cachedPageInfo[t];l=a.naturalWidth,c=l===void 0?612:l,u=a.naturalHeight,d=u===void 0?792:u;f=this.viewCoordinatesToPageCoordinates(n,r,t,c-o,d-s);h=Math.floor(f.x);v=Math.floor(f.y);p={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:this.placing!=="radio",page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:o,height:s,multiline:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",p);return[4,b(this.endpoint,this.templateId,p)];case 1:m=x.sent();console.log("[FIELDS] Saved field",m);g=JSON.parse(JSON.stringify(this.template));g.fields.push(m);_.updateTemplate(this.templateId,g);(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:g,event:"added-field"});this.placing=null;x.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var i,o,s;if(this.loading){return n(r,null,n("verdocs-loader",null))}if(!this.endpoint.session){return n(r,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var a=(((i=this.template)===null||i===void 0?void 0:i.roles)||[]).map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return n(r,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},n("div",{id:"verdocs-template-fields-toolbar"},n("div",{class:"add-for"},"Add field:"),n("verdocs-select-input",{value:this.selectedRoleName,options:a,onInput:function(e){return t.selectedRoleName=e.target.value}}),be.map((function(e){return n("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}}}})}))),n("div",{class:"pages"},(((o=this.template)===null||o===void 0?void 0:o.documents)||[]).map((function(e){var i=c(1,e.pages);return i.map((function(i){var r=e.page_sizes[i];return n("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:i,virtualWidth:(r===null||r===void 0?void 0:r.width)||612,virtualHeight:(r===null||r===void 0?void 0:r.height)||792,disabled:true,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,i)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&n("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.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}());xe.style=ae;
2
+ /**!
3
+ * Sortable 1.15.6
4
+ * @author RubaXa <trash@rubaxa.org>
5
+ * @author owenm <owen23355@gmail.com>
6
+ * @license MIT
7
+ */function we(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}i.push.apply(i,n)}return i}function ye(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};if(t%2){we(Object(i),true).forEach((function(t){ke(e,t,i[t])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(i))}else{we(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}}return e}function _e(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_e=function(e){return typeof e}}else{_e=function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _e(e)}function ke(e,t,i){if(t in e){Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true})}else{e[t]=i}return e}function Ee(){Ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i){if(Object.prototype.hasOwnProperty.call(i,n)){e[n]=i[n]}}}return e};return Ee.apply(this,arguments)}function qe(e,t){if(e==null)return{};var i={};var n=Object.keys(e);var r,o;for(o=0;o<n.length;o++){r=n[o];if(t.indexOf(r)>=0)continue;i[r]=e[r]}return i}function Se(e,t){if(e==null)return{};var i=qe(e,t);var n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++){n=o[r];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;i[n]=e[n]}}return i}var Me="1.15.6";function Ce(e){if(typeof window!=="undefined"&&window.navigator){return!!navigator.userAgent.match(e)}}var Ie=Ce(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);var Te=Ce(/Edge/i);var Le=Ce(/firefox/i);var He=Ce(/safari/i)&&!Ce(/chrome/i)&&!Ce(/android/i);var Ze=Ce(/iP(ad|od|hone)/i);var Oe=Ce(/chrome/i)&&Ce(/android/i);var ze={capture:false,passive:false};function De(e,t,i){e.addEventListener(t,i,!Ie&&ze)}function Ve(e,t,i){e.removeEventListener(t,i,!Ie&&ze)}function Ne(e,t){if(!t)return;t[0]===">"&&(t=t.substring(1));if(e){try{if(e.matches){return e.matches(t)}else if(e.msMatchesSelector){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector){return e.webkitMatchesSelector(t)}}catch(e){return false}}return false}function Ae(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function je(e,t,i,n){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&Ne(e,t):Ne(e,t))||n&&e===i){return e}if(e===i)break}while(e=Ae(e))}return null}var Re=/\s+/g;function Ue(e,t,i){if(e&&t){if(e.classList){e.classList[i?"add":"remove"](t)}else{var n=(" "+e.className+" ").replace(Re," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Re," ")}}}function Be(e,t,i){var n=e&&e.style;if(n){if(i===void 0){if(document.defaultView&&document.defaultView.getComputedStyle){i=document.defaultView.getComputedStyle(e,"")}else if(e.currentStyle){i=e.currentStyle}return t===void 0?i:i[t]}else{if(!(t in n)&&t.indexOf("webkit")===-1){t="-webkit-"+t}n[t]=i+(typeof i==="string"?"":"px")}}}function Pe(e,t){var i="";if(typeof e==="string"){i=e}else{do{var n=Be(e,"transform");if(n&&n!=="none"){i=n+" "+i}}while(!t&&(e=e.parentNode))}var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function Qe(e,t,i){if(e){var n=e.getElementsByTagName(t),r=0,o=n.length;if(i){for(;r<o;r++){i(n[r],r)}}return n}return[]}function Fe(){var e=document.scrollingElement;if(e){return e}else{return document.documentElement}}function Ye(e,t,i,n,r){if(!e.getBoundingClientRect&&e!==window)return;var o,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==Fe()){o=e.getBoundingClientRect();s=o.top;a=o.left;l=o.bottom;c=o.right;u=o.height;d=o.width}else{s=0;a=0;l=window.innerHeight;c=window.innerWidth;u=window.innerHeight;d=window.innerWidth}if((t||i)&&e!==window){r=r||e.parentNode;if(!Ie){do{if(r&&r.getBoundingClientRect&&(Be(r,"transform")!=="none"||i&&Be(r,"position")!=="static")){var f=r.getBoundingClientRect();s-=f.top+parseInt(Be(r,"border-top-width"));a-=f.left+parseInt(Be(r,"border-left-width"));l=s+o.height;c=a+o.width;break}}while(r=r.parentNode)}}if(n&&e!==window){var h=Pe(r||e),v=h&&h.a,p=h&&h.d;if(h){s/=p;a/=v;d/=v;u/=p;l=s+u;c=a+d}}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}function Je(e,t,i){var n=et(e,true),r=Ye(e)[t];while(n){var o=Ye(n)[i],s=void 0;if(i==="top"||i==="left"){s=r>=o}else{s=r<=o}if(!s)return n;if(n===Fe())break;n=et(n,false)}return false}function We(e,t,i,n){var r=0,o=0,s=e.children;while(o<s.length){if(s[o].style.display!=="none"&&s[o]!==fi.ghost&&(n||s[o]!==fi.dragged)&&je(s[o],i.draggable,e,false)){if(r===t){return s[o]}r++}o++}return null}function Ge(e,t){var i=e.lastElementChild;while(i&&(i===fi.ghost||Be(i,"display")==="none"||t&&!Ne(i,t))){i=i.previousElementSibling}return i||null}function Xe(e,t){var i=0;if(!e||!e.parentNode){return-1}while(e=e.previousElementSibling){if(e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==fi.clone&&(!t||Ne(e,t))){i++}}return i}function Ke(e){var t=0,i=0,n=Fe();if(e){do{var r=Pe(e),o=r.a,s=r.d;t+=e.scrollLeft*o;i+=e.scrollTop*s}while(e!==n&&(e=e.parentNode))}return[t,i]}function $e(e,t){for(var i in e){if(!e.hasOwnProperty(i))continue;for(var n in t){if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i)}}return-1}function et(e,t){if(!e||!e.getBoundingClientRect)return Fe();var i=e;var n=false;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=Be(i);if(i.clientWidth<i.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return Fe();if(n||t)return i;n=true}}}while(i=i.parentNode);return Fe()}function tt(e,t){if(e&&t){for(var i in t){if(t.hasOwnProperty(i)){e[i]=t[i]}}}return e}function it(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var nt;function rt(e,t){return function(){if(!nt){var i=arguments,n=this;if(i.length===1){e.call(n,i[0])}else{e.apply(n,i)}nt=setTimeout((function(){nt=void 0}),t)}}}function ot(){clearTimeout(nt);nt=void 0}function st(e,t,i){e.scrollLeft+=t;e.scrollTop+=i}function at(e){var t=window.Polymer;var i=window.jQuery||window.Zepto;if(t&&t.dom){return t.dom(e).cloneNode(true)}else if(i){return i(e).clone(true)[0]}else{return e.cloneNode(true)}}function lt(e,t,i){var n={};Array.from(e.children).forEach((function(r){var o,s,a,l;if(!je(r,t.draggable,e,false)||r.animated||r===i)return;var c=Ye(r);n.left=Math.min((o=n.left)!==null&&o!==void 0?o:Infinity,c.left);n.top=Math.min((s=n.top)!==null&&s!==void 0?s:Infinity,c.top);n.right=Math.max((a=n.right)!==null&&a!==void 0?a:-Infinity,c.right);n.bottom=Math.max((l=n.bottom)!==null&&l!==void 0?l:-Infinity,c.bottom)}));n.width=n.right-n.left;n.height=n.bottom-n.top;n.x=n.left;n.y=n.top;return n}var ct="Sortable"+(new Date).getTime();function ut(){var e=[],t;return{captureAnimationState:function t(){e=[];if(!this.options.animation)return;var i=[].slice.call(this.el.children);i.forEach((function(t){if(Be(t,"display")==="none"||t===fi.ghost)return;e.push({target:t,rect:Ye(t)});var i=ye({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=Pe(t,true);if(n){i.top-=n.f;i.left-=n.e}}t.fromRect=i}))},addAnimationState:function t(i){e.push(i)},removeAnimationState:function t(i){e.splice($e(e,{target:i}),1)},animateAll:function i(n){var r=this;if(!this.options.animation){clearTimeout(t);if(typeof n==="function")n();return}var o=false,s=0;e.forEach((function(e){var t=0,i=e.target,n=i.fromRect,a=Ye(i),l=i.prevFromRect,c=i.prevToRect,u=e.rect,d=Pe(i,true);if(d){a.top-=d.f;a.left-=d.e}i.toRect=a;if(i.thisAnimationDuration){if(it(l,a)&&!it(n,a)&&(u.top-a.top)/(u.left-a.left)===(n.top-a.top)/(n.left-a.left)){t=ft(u,l,c,r.options)}}if(!it(a,n)){i.prevFromRect=n;i.prevToRect=a;if(!t){t=r.options.animation}r.animate(i,u,a,t)}if(t){o=true;s=Math.max(s,t);clearTimeout(i.animationResetTimer);i.animationResetTimer=setTimeout((function(){i.animationTime=0;i.prevFromRect=null;i.fromRect=null;i.prevToRect=null;i.thisAnimationDuration=null}),t);i.thisAnimationDuration=t}}));clearTimeout(t);if(!o){if(typeof n==="function")n()}else{t=setTimeout((function(){if(typeof n==="function")n()}),s)}e=[]},animate:function e(t,i,n,r){if(r){Be(t,"transition","");Be(t,"transform","");var o=Pe(this.el),s=o&&o.a,a=o&&o.d,l=(i.left-n.left)/(s||1),c=(i.top-n.top)/(a||1);t.animatingX=!!l;t.animatingY=!!c;Be(t,"transform","translate3d("+l+"px,"+c+"px,0)");this.forRepaintDummy=dt(t);Be(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:""));Be(t,"transform","translate3d(0,0,0)");typeof t.animated==="number"&&clearTimeout(t.animated);t.animated=setTimeout((function(){Be(t,"transition","");Be(t,"transform","");t.animated=false;t.animatingX=false;t.animatingY=false}),r)}}}}function dt(e){return e.offsetWidth}function ft(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}var ht=[];var vt={initializeByDefault:true};var pt={mount:function e(t){for(var i in vt){if(vt.hasOwnProperty(i)&&!(i in t)){t[i]=vt[i]}}ht.forEach((function(e){if(e.pluginName===t.pluginName){throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}}));ht.push(t)},pluginEvent:function e(t,i,n){var r=this;this.eventCanceled=false;n.cancel=function(){r.eventCanceled=true};var o=t+"Global";ht.forEach((function(e){if(!i[e.pluginName])return;if(i[e.pluginName][o]){i[e.pluginName][o](ye({sortable:i},n))}if(i.options[e.pluginName]&&i[e.pluginName][t]){i[e.pluginName][t](ye({sortable:i},n))}}))},initializePlugins:function e(t,i,n,r){ht.forEach((function(e){var r=e.pluginName;if(!t.options[r]&&!e.initializeByDefault)return;var o=new e(t,i,t.options);o.sortable=t;o.options=t.options;t[r]=o;Ee(n,o.defaults)}));for(var o in t.options){if(!t.options.hasOwnProperty(o))continue;var s=this.modifyOption(t,o,t.options[o]);if(typeof s!=="undefined"){t.options[o]=s}}},getEventProperties:function e(t,i){var n={};ht.forEach((function(e){if(typeof e.eventProperties!=="function")return;Ee(n,e.eventProperties.call(i[e.pluginName],t))}));return n},modifyOption:function e(t,i,n){var r;ht.forEach((function(e){if(!t[e.pluginName])return;if(e.optionListeners&&typeof e.optionListeners[i]==="function"){r=e.optionListeners[i].call(t[e.pluginName],n)}}));return r}};function mt(e){var t=e.sortable,i=e.rootEl,n=e.name,r=e.targetEl,o=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,h=e.putSortable,v=e.extraEventProperties;t=t||i&&i[ct];if(!t)return;var p,m=t.options,g="on"+n.charAt(0).toUpperCase()+n.substr(1);if(window.CustomEvent&&!Ie&&!Te){p=new CustomEvent(n,{bubbles:true,cancelable:true})}else{p=document.createEvent("Event");p.initEvent(n,true,true)}p.to=s||i;p.from=a||i;p.item=r||i;p.clone=o;p.oldIndex=l;p.newIndex=c;p.oldDraggableIndex=u;p.newDraggableIndex=d;p.originalEvent=f;p.pullMode=h?h.lastPutMode:undefined;var b=ye(ye({},v),pt.getEventProperties(n,t));for(var x in b){p[x]=b[x]}if(i){i.dispatchEvent(p)}if(m[g]){m[g].call(t,p)}}var gt=["evt"];var bt=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},r=n.evt,o=Se(n,gt);pt.pluginEvent.bind(fi)(t,i,ye({dragEl:wt,parentEl:yt,ghostEl:_t,rootEl:kt,nextEl:Et,lastDownEl:qt,cloneEl:St,cloneHidden:Mt,dragStarted:Bt,putSortable:Zt,activeSortable:fi.active,originalEvent:r,oldIndex:Ct,oldDraggableIndex:Tt,newIndex:It,newDraggableIndex:Lt,hideGhostForTarget:li,unhideGhostForTarget:ci,cloneNowHidden:function e(){Mt=true},cloneNowShown:function e(){Mt=false},dispatchSortableEvent:function e(t){xt({sortable:i,name:t,originalEvent:r})}},o))};function xt(e){mt(ye({putSortable:Zt,cloneEl:St,targetEl:wt,rootEl:kt,oldIndex:Ct,oldDraggableIndex:Tt,newIndex:It,newDraggableIndex:Lt},e))}var wt,yt,_t,kt,Et,qt,St,Mt,Ct,It,Tt,Lt,Ht,Zt,Ot=false,zt=false,Dt=[],Vt,Nt,At,jt,Rt,Ut,Bt,Pt,Qt,Ft=false,Yt=false,Jt,Wt,Gt=[],Xt=false,Kt=[];var $t=typeof document!=="undefined",ei=Ze,ti=Te||Ie?"cssFloat":"float",ii=$t&&!Oe&&!Ze&&"draggable"in document.createElement("div"),ni=function(){if(!$t)return;if(Ie){return false}var e=document.createElement("x");e.style.cssText="pointer-events:auto";return e.style.pointerEvents==="auto"}(),ri=function e(t,i){var n=Be(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=We(t,0,i),s=We(t,1,i),a=o&&Be(o),l=s&&Be(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ye(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ye(s).width;if(n.display==="flex"){return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal"}if(n.display==="grid"){return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal"}if(o&&a["float"]&&a["float"]!=="none"){var d=a["float"]==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=r&&n[ti]==="none"||s&&n[ti]==="none"&&c+u>r)?"vertical":"horizontal"},oi=function e(t,i,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,s=n?t.width:t.height,a=n?i.left:i.top,l=n?i.right:i.bottom,c=n?i.width:i.height;return r===a||o===l||r+s/2===a+c/2},si=function e(t,i){var n;Dt.some((function(e){var r=e[ct].options.emptyInsertThreshold;if(!r||Ge(e))return;var o=Ye(e),s=t>=o.left-r&&t<=o.right+r,a=i>=o.top-r&&i<=o.bottom+r;if(s&&a){return n=e}}));return n},ai=function e(t){function i(e,t){return function(n,r,o,s){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(e==null&&(t||a)){return true}else if(e==null||e===false){return false}else if(t&&e==="clone"){return e}else if(typeof e==="function"){return i(e(n,r,o,s),t)(n,r,o,s)}else{var l=(t?n:r).options.group.name;return e===true||typeof e==="string"&&e===l||e.join&&e.indexOf(l)>-1}}}var n={};var r=t.group;if(!r||_e(r)!="object"){r={name:r}}n.name=r.name;n.checkPull=i(r.pull,true);n.checkPut=i(r.put);n.revertClone=r.revertClone;t.group=n},li=function e(){if(!ni&&_t){Be(_t,"display","none")}},ci=function e(){if(!ni&&_t){Be(_t,"display","")}};if($t&&!Oe){document.addEventListener("click",(function(e){if(zt){e.preventDefault();e.stopPropagation&&e.stopPropagation();e.stopImmediatePropagation&&e.stopImmediatePropagation();zt=false;return false}}),true)}var ui=function e(t){if(wt){t=t.touches?t.touches[0]:t;var i=si(t.clientX,t.clientY);if(i){var n={};for(var r in t){if(t.hasOwnProperty(r)){n[r]=t[r]}}n.target=n.rootEl=i;n.preventDefault=void 0;n.stopPropagation=void 0;i[ct]._onDragOver(n)}}};var di=function e(t){if(wt){wt.parentNode[ct]._isOutsideThisEl(t.target)}};function fi(e,t){if(!(e&&e.nodeType&&e.nodeType===1)){throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e))}this.el=e;this.options=t=Ee({},t);e[ct]=this;var i={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function t(){return ri(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function e(t,i){t.setData("Text",i.textContent)},dropBubble:false,dragoverBubble:false,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:false,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:false,fallbackClass:"sortable-fallback",fallbackOnBody:false,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:fi.supportPointer!==false&&"PointerEvent"in window&&(!He||Ze),emptyInsertThreshold:5};pt.initializePlugins(this,e,i);for(var n in i){!(n in t)&&(t[n]=i[n])}ai(t);for(var r in this){if(r.charAt(0)==="_"&&typeof this[r]==="function"){this[r]=this[r].bind(this)}}this.nativeDraggable=t.forceFallback?false:ii;if(this.nativeDraggable){this.options.touchStartThreshold=1}if(t.supportPointer){De(e,"pointerdown",this._onTapStart)}else{De(e,"mousedown",this._onTapStart);De(e,"touchstart",this._onTapStart)}if(this.nativeDraggable){De(e,"dragover",this);De(e,"dragenter",this)}Dt.push(this.el);t.store&&t.store.get&&this.sort(t.store.get(this)||[]);Ee(this,ut())}fi.prototype={constructor:fi,_isOutsideThisEl:function e(t){if(!this.el.contains(t)&&t!==this.el){Pt=null}},_getDirection:function e(t,i){return typeof this.options.direction==="function"?this.options.direction.call(this,t,i,wt):this.options.direction},_onTapStart:function e(t){if(!t.cancelable)return;var i=this,n=this.el,r=this.options,o=r.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=r.filter;_i(n);if(wt){return}if(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled){return}if(c.isContentEditable){return}if(!this.nativeDraggable&&He&&l&&l.tagName.toUpperCase()==="SELECT"){return}l=je(l,r.draggable,n,false);if(l&&l.animated){return}if(qt===l){return}Ct=Xe(l);Tt=Xe(l,r.draggable);if(typeof u==="function"){if(u.call(this,t,l,this)){xt({sortable:i,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n});bt("filter",i,{evt:t});o&&t.preventDefault();return}}else if(u){u=u.split(",").some((function(e){e=je(c,e.trim(),n,false);if(e){xt({sortable:i,rootEl:e,name:"filter",targetEl:l,fromEl:n,toEl:n});bt("filter",i,{evt:t});return true}}));if(u){o&&t.preventDefault();return}}if(r.handle&&!je(c,r.handle,n,false)){return}this._prepareDragStart(t,a,l)},_prepareDragStart:function e(t,i,n){var r=this,o=r.el,s=r.options,a=o.ownerDocument,l;if(n&&!wt&&n.parentNode===o){var c=Ye(n);kt=o;wt=n;yt=wt.parentNode;Et=wt.nextSibling;qt=n;Ht=s.group;fi.dragged=wt;Vt={target:wt,clientX:(i||t).clientX,clientY:(i||t).clientY};Rt=Vt.clientX-c.left;Ut=Vt.clientY-c.top;this._lastX=(i||t).clientX;this._lastY=(i||t).clientY;wt.style["will-change"]="all";l=function e(){bt("delayEnded",r,{evt:t});if(fi.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents();if(!Le&&r.nativeDraggable){wt.draggable=true}r._triggerDragStart(t,i);xt({sortable:r,name:"choose",originalEvent:t});Ue(wt,s.chosenClass,true)};s.ignore.split(",").forEach((function(e){Qe(wt,e.trim(),pi)}));De(a,"dragover",ui);De(a,"mousemove",ui);De(a,"touchmove",ui);if(s.supportPointer){De(a,"pointerup",r._onDrop);!this.nativeDraggable&&De(a,"pointercancel",r._onDrop)}else{De(a,"mouseup",r._onDrop);De(a,"touchend",r._onDrop);De(a,"touchcancel",r._onDrop)}if(Le&&this.nativeDraggable){this.options.touchStartThreshold=4;wt.draggable=true}bt("delayStart",this,{evt:t});if(s.delay&&(!s.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Te||Ie))){if(fi.eventCanceled){this._onDrop();return}if(s.supportPointer){De(a,"pointerup",r._disableDelayedDrag);De(a,"pointercancel",r._disableDelayedDrag)}else{De(a,"mouseup",r._disableDelayedDrag);De(a,"touchend",r._disableDelayedDrag);De(a,"touchcancel",r._disableDelayedDrag)}De(a,"mousemove",r._delayedDragTouchMoveHandler);De(a,"touchmove",r._delayedDragTouchMoveHandler);s.supportPointer&&De(a,"pointermove",r._delayedDragTouchMoveHandler);r._dragStartTimer=setTimeout(l,s.delay)}else{l()}}},_delayedDragTouchMoveHandler:function e(t){var i=t.touches?t.touches[0]:t;if(Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))){this._disableDelayedDrag()}},_disableDelayedDrag:function e(){wt&&pi(wt);clearTimeout(this._dragStartTimer);this._disableDelayedDragEvents()},_disableDelayedDragEvents:function e(){var t=this.el.ownerDocument;Ve(t,"mouseup",this._disableDelayedDrag);Ve(t,"touchend",this._disableDelayedDrag);Ve(t,"touchcancel",this._disableDelayedDrag);Ve(t,"pointerup",this._disableDelayedDrag);Ve(t,"pointercancel",this._disableDelayedDrag);Ve(t,"mousemove",this._delayedDragTouchMoveHandler);Ve(t,"touchmove",this._delayedDragTouchMoveHandler);Ve(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function e(t,i){i=i||t.pointerType=="touch"&&t;if(!this.nativeDraggable||i){if(this.options.supportPointer){De(document,"pointermove",this._onTouchMove)}else if(i){De(document,"touchmove",this._onTouchMove)}else{De(document,"mousemove",this._onTouchMove)}}else{De(wt,"dragend",this);De(kt,"dragstart",this._onDragStart)}try{if(document.selection){ki((function(){document.selection.empty()}))}else{window.getSelection().removeAllRanges()}}catch(e){}},_dragStarted:function e(t,i){Ot=false;if(kt&&wt){bt("dragStarted",this,{evt:i});if(this.nativeDraggable){De(document,"dragover",di)}var n=this.options;!t&&Ue(wt,n.dragClass,false);Ue(wt,n.ghostClass,true);fi.active=this;t&&this._appendGhost();xt({sortable:this,name:"start",originalEvent:i})}else{this._nulling()}},_emulateDragOver:function e(){if(Nt){this._lastX=Nt.clientX;this._lastY=Nt.clientY;li();var t=document.elementFromPoint(Nt.clientX,Nt.clientY);var i=t;while(t&&t.shadowRoot){t=t.shadowRoot.elementFromPoint(Nt.clientX,Nt.clientY);if(t===i)break;i=t}wt.parentNode[ct]._isOutsideThisEl(t);if(i){do{if(i[ct]){var n=void 0;n=i[ct]._onDragOver({clientX:Nt.clientX,clientY:Nt.clientY,target:t,rootEl:i});if(n&&!this.options.dragoverBubble){break}}t=i}while(i=Ae(i))}ci()}},_onTouchMove:function e(t){if(Vt){var i=this.options,n=i.fallbackTolerance,r=i.fallbackOffset,o=t.touches?t.touches[0]:t,s=_t&&Pe(_t,true),a=_t&&s&&s.a,l=_t&&s&&s.d,c=ei&&Wt&&Ke(Wt),u=(o.clientX-Vt.clientX+r.x)/(a||1)+(c?c[0]-Gt[0]:0)/(a||1),d=(o.clientY-Vt.clientY+r.y)/(l||1)+(c?c[1]-Gt[1]:0)/(l||1);if(!fi.active&&!Ot){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n){return}this._onDragStart(t,true)}if(_t){if(s){s.e+=u-(At||0);s.f+=d-(jt||0)}else{s={a:1,b:0,c:0,d:1,e:u,f:d}}var f="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");Be(_t,"webkitTransform",f);Be(_t,"mozTransform",f);Be(_t,"msTransform",f);Be(_t,"transform",f);At=u;jt=d;Nt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function e(){if(!_t){var t=this.options.fallbackOnBody?document.body:kt,i=Ye(wt,true,ei,true,t),n=this.options;if(ei){Wt=t;while(Be(Wt,"position")==="static"&&Be(Wt,"transform")==="none"&&Wt!==document){Wt=Wt.parentNode}if(Wt!==document.body&&Wt!==document.documentElement){if(Wt===document)Wt=Fe();i.top+=Wt.scrollTop;i.left+=Wt.scrollLeft}else{Wt=Fe()}Gt=Ke(Wt)}_t=wt.cloneNode(true);Ue(_t,n.ghostClass,false);Ue(_t,n.fallbackClass,true);Ue(_t,n.dragClass,true);Be(_t,"transition","");Be(_t,"transform","");Be(_t,"box-sizing","border-box");Be(_t,"margin",0);Be(_t,"top",i.top);Be(_t,"left",i.left);Be(_t,"width",i.width);Be(_t,"height",i.height);Be(_t,"opacity","0.8");Be(_t,"position",ei?"absolute":"fixed");Be(_t,"zIndex","100000");Be(_t,"pointerEvents","none");fi.ghost=_t;t.appendChild(_t);Be(_t,"transform-origin",Rt/parseInt(_t.style.width)*100+"% "+Ut/parseInt(_t.style.height)*100+"%")}},_onDragStart:function e(t,i){var n=this;var r=t.dataTransfer;var o=n.options;bt("dragStart",this,{evt:t});if(fi.eventCanceled){this._onDrop();return}bt("setupClone",this);if(!fi.eventCanceled){St=at(wt);St.removeAttribute("id");St.draggable=false;St.style["will-change"]="";this._hideClone();Ue(St,this.options.chosenClass,false);fi.clone=St}n.cloneId=ki((function(){bt("clone",n);if(fi.eventCanceled)return;if(!n.options.removeCloneOnHide){kt.insertBefore(St,wt)}n._hideClone();xt({sortable:n,name:"clone"})}));!i&&Ue(wt,o.dragClass,true);if(i){zt=true;n._loopId=setInterval(n._emulateDragOver,50)}else{Ve(document,"mouseup",n._onDrop);Ve(document,"touchend",n._onDrop);Ve(document,"touchcancel",n._onDrop);if(r){r.effectAllowed="move";o.setData&&o.setData.call(n,r,wt)}De(document,"drop",n);Be(wt,"transform","translateZ(0)")}Ot=true;n._dragStartId=ki(n._dragStarted.bind(n,i,t));De(document,"selectstart",n);Bt=true;window.getSelection().removeAllRanges();if(He){Be(document.body,"user-select","none")}},_onDragOver:function e(t){var i=this.el,n=t.target,r,o,s,a=this.options,l=a.group,c=fi.active,u=Ht===l,d=a.sort,f=Zt||c,h,v=this,p=false;if(Xt)return;function m(e,a){bt(e,v,ye({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:d,fromSortable:f,target:n,completed:b,onMove:function e(n,o){return vi(kt,i,wt,r,n,Ye(n),t,o)},changed:x},a))}function g(){m("dragOverAnimationCapture");v.captureAnimationState();if(v!==f){f.captureAnimationState()}}function b(e){m("dragOverCompleted",{insertion:e});if(e){if(u){c._hideClone()}else{c._showClone(v)}if(v!==f){Ue(wt,Zt?Zt.options.ghostClass:c.options.ghostClass,false);Ue(wt,a.ghostClass,true)}if(Zt!==v&&v!==fi.active){Zt=v}else if(v===fi.active&&Zt){Zt=null}if(f===v){v._ignoreWhileAnimating=n}v.animateAll((function(){m("dragOverAnimationComplete");v._ignoreWhileAnimating=null}));if(v!==f){f.animateAll();f._ignoreWhileAnimating=null}}if(n===wt&&!wt.animated||n===i&&!n.animated){Pt=null}if(!a.dragoverBubble&&!t.rootEl&&n!==document){wt.parentNode[ct]._isOutsideThisEl(t.target);!e&&ui(t)}!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation();return p=true}function x(){It=Xe(wt);Lt=Xe(wt,a.draggable);xt({sortable:v,name:"change",toEl:i,newIndex:It,newDraggableIndex:Lt,originalEvent:t})}if(t.preventDefault!==void 0){t.cancelable&&t.preventDefault()}n=je(n,a.draggable,i,true);m("dragOver");if(fi.eventCanceled)return p;if(wt.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||v._ignoreWhileAnimating===n){return b(false)}zt=false;if(c&&!a.disabled&&(u?d||(s=yt!==kt):Zt===this||(this.lastPutMode=Ht.checkPull(this,c,wt,t))&&l.checkPut(this,c,wt,t))){h=this._getDirection(t,n)==="vertical";r=Ye(wt);m("dragOverValid");if(fi.eventCanceled)return p;if(s){yt=kt;g();this._hideClone();m("revert");if(!fi.eventCanceled){if(Et){kt.insertBefore(wt,Et)}else{kt.appendChild(wt)}}return b(true)}var w=Ge(i,a.draggable);if(!w||bi(t,h,this)&&!w.animated){if(w===wt){return b(false)}if(w&&i===t.target){n=w}if(n){o=Ye(n)}if(vi(kt,i,wt,r,n,o,t,!!n)!==false){g();if(w&&w.nextSibling){i.insertBefore(wt,w.nextSibling)}else{i.appendChild(wt)}yt=i;x();return b(true)}}else if(w&&gi(t,h,this)){var y=We(i,0,a,true);if(y===wt){return b(false)}n=y;o=Ye(n);if(vi(kt,i,wt,r,n,o,t,false)!==false){g();i.insertBefore(wt,y);yt=i;x();return b(true)}}else if(n.parentNode===i){o=Ye(n);var _=0,k,E=wt.parentNode!==i,q=!oi(wt.animated&&wt.toRect||r,n.animated&&n.toRect||o,h),S=h?"top":"left",M=Je(n,"top","top")||Je(wt,"top","top"),C=M?M.scrollTop:void 0;if(Pt!==n){k=o[S];Ft=false;Yt=!q&&a.invertSwap||E}_=xi(t,n,o,h,q?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Yt,Pt===n);var I;if(_!==0){var T=Xe(wt);do{T-=_;I=yt.children[T]}while(I&&(Be(I,"display")==="none"||I===_t))}if(_===0||I===n){return b(false)}Pt=n;Qt=_;var L=n.nextElementSibling,H=false;H=_===1;var Z=vi(kt,i,wt,r,n,o,t,H);if(Z!==false){if(Z===1||Z===-1){H=Z===1}Xt=true;setTimeout(mi,30);g();if(H&&!L){i.appendChild(wt)}else{n.parentNode.insertBefore(wt,H?L:n)}if(M){st(M,0,C-M.scrollTop)}yt=wt.parentNode;if(k!==undefined&&!Yt){Jt=Math.abs(k-Ye(n)[S])}x();return b(true)}}if(i.contains(wt)){return b(false)}}return false},_ignoreWhileAnimating:null,_offMoveEvents:function e(){Ve(document,"mousemove",this._onTouchMove);Ve(document,"touchmove",this._onTouchMove);Ve(document,"pointermove",this._onTouchMove);Ve(document,"dragover",ui);Ve(document,"mousemove",ui);Ve(document,"touchmove",ui)},_offUpEvents:function e(){var t=this.el.ownerDocument;Ve(t,"mouseup",this._onDrop);Ve(t,"touchend",this._onDrop);Ve(t,"pointerup",this._onDrop);Ve(t,"pointercancel",this._onDrop);Ve(t,"touchcancel",this._onDrop);Ve(document,"selectstart",this)},_onDrop:function e(t){var i=this.el,n=this.options;It=Xe(wt);Lt=Xe(wt,n.draggable);bt("drop",this,{evt:t});yt=wt&&wt.parentNode;It=Xe(wt);Lt=Xe(wt,n.draggable);if(fi.eventCanceled){this._nulling();return}Ot=false;Yt=false;Ft=false;clearInterval(this._loopId);clearTimeout(this._dragStartTimer);Ei(this.cloneId);Ei(this._dragStartId);if(this.nativeDraggable){Ve(document,"drop",this);Ve(i,"dragstart",this._onDragStart)}this._offMoveEvents();this._offUpEvents();if(He){Be(document.body,"user-select","")}Be(wt,"transform","");if(t){if(Bt){t.cancelable&&t.preventDefault();!n.dropBubble&&t.stopPropagation()}_t&&_t.parentNode&&_t.parentNode.removeChild(_t);if(kt===yt||Zt&&Zt.lastPutMode!=="clone"){St&&St.parentNode&&St.parentNode.removeChild(St)}if(wt){if(this.nativeDraggable){Ve(wt,"dragend",this)}pi(wt);wt.style["will-change"]="";if(Bt&&!Ot){Ue(wt,Zt?Zt.options.ghostClass:this.options.ghostClass,false)}Ue(wt,this.options.chosenClass,false);xt({sortable:this,name:"unchoose",toEl:yt,newIndex:null,newDraggableIndex:null,originalEvent:t});if(kt!==yt){if(It>=0){xt({rootEl:yt,name:"add",toEl:yt,fromEl:kt,originalEvent:t});xt({sortable:this,name:"remove",toEl:yt,originalEvent:t});xt({rootEl:yt,name:"sort",toEl:yt,fromEl:kt,originalEvent:t});xt({sortable:this,name:"sort",toEl:yt,originalEvent:t})}Zt&&Zt.save()}else{if(It!==Ct){if(It>=0){xt({sortable:this,name:"update",toEl:yt,originalEvent:t});xt({sortable:this,name:"sort",toEl:yt,originalEvent:t})}}}if(fi.active){if(It==null||It===-1){It=Ct;Lt=Tt}xt({sortable:this,name:"end",toEl:yt,originalEvent:t});this.save()}}}this._nulling()},_nulling:function e(){bt("nulling",this);kt=wt=yt=_t=Et=St=qt=Mt=Vt=Nt=Bt=It=Lt=Ct=Tt=Pt=Qt=Zt=Ht=fi.dragged=fi.ghost=fi.clone=fi.active=null;Kt.forEach((function(e){e.checked=true}));Kt.length=At=jt=0},handleEvent:function e(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":if(wt){this._onDragOver(t);hi(t)}break;case"selectstart":t.preventDefault();break}},toArray:function e(){var t=[],i,n=this.el.children,r=0,o=n.length,s=this.options;for(;r<o;r++){i=n[r];if(je(i,s.draggable,this.el,false)){t.push(i.getAttribute(s.dataIdAttr)||yi(i))}}return t},sort:function e(t,i){var n={},r=this.el;this.toArray().forEach((function(e,t){var i=r.children[t];if(je(i,this.options.draggable,r,false)){n[e]=i}}),this);i&&this.captureAnimationState();t.forEach((function(e){if(n[e]){r.removeChild(n[e]);r.appendChild(n[e])}}));i&&this.animateAll()},save:function e(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function e(t,i){return je(t,i||this.options.draggable,this.el,false)},option:function e(t,i){var n=this.options;if(i===void 0){return n[t]}else{var r=pt.modifyOption(this,t,i);if(typeof r!=="undefined"){n[t]=r}else{n[t]=i}if(t==="group"){ai(n)}}},destroy:function e(){bt("destroy",this);var t=this.el;t[ct]=null;Ve(t,"mousedown",this._onTapStart);Ve(t,"touchstart",this._onTapStart);Ve(t,"pointerdown",this._onTapStart);if(this.nativeDraggable){Ve(t,"dragover",this);Ve(t,"dragenter",this)}Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")}));this._onDrop();this._disableDelayedDragEvents();Dt.splice(Dt.indexOf(this.el),1);this.el=t=null},_hideClone:function e(){if(!Mt){bt("hideClone",this);if(fi.eventCanceled)return;Be(St,"display","none");if(this.options.removeCloneOnHide&&St.parentNode){St.parentNode.removeChild(St)}Mt=true}},_showClone:function e(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Mt){bt("showClone",this);if(fi.eventCanceled)return;if(wt.parentNode==kt&&!this.options.group.revertClone){kt.insertBefore(St,wt)}else if(Et){kt.insertBefore(St,Et)}else{kt.appendChild(St)}if(this.options.group.revertClone){this.animate(wt,St)}Be(St,"display","");Mt=false}}};function hi(e){if(e.dataTransfer){e.dataTransfer.dropEffect="move"}e.cancelable&&e.preventDefault()}function vi(e,t,i,n,r,o,s,a){var l,c=e[ct],u=c.options.onMove,d;if(window.CustomEvent&&!Ie&&!Te){l=new CustomEvent("move",{bubbles:true,cancelable:true})}else{l=document.createEvent("Event");l.initEvent("move",true,true)}l.to=t;l.from=e;l.dragged=i;l.draggedRect=n;l.related=r||t;l.relatedRect=o||Ye(t);l.willInsertAfter=a;l.originalEvent=s;e.dispatchEvent(l);if(u){d=u.call(c,l,s)}return d}function pi(e){e.draggable=false}function mi(){Xt=false}function gi(e,t,i){var n=Ye(We(i.el,0,i.options,true));var r=lt(i.el,i.options,_t);var o=10;return t?e.clientX<r.left-o||e.clientY<n.top&&e.clientX<n.right:e.clientY<r.top-o||e.clientY<n.bottom&&e.clientX<n.left}function bi(e,t,i){var n=Ye(Ge(i.el,i.options.draggable));var r=lt(i.el,i.options,_t);var o=10;return t?e.clientX>r.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>r.bottom+o||e.clientX>n.right&&e.clientY>n.top}function xi(e,t,i,n,r,o,s,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,u=n?i.top:i.left,d=n?i.bottom:i.right,f=false;if(!s){if(a&&Jt<c*r){if(!Ft&&(Qt===1?l>u+c*o/2:l<d-c*o/2)){Ft=true}if(!Ft){if(Qt===1?l<u+Jt:l>d-Jt){return-Qt}}else{f=true}}else{if(l>u+c*(1-r)/2&&l<d-c*(1-r)/2){return wi(t)}}}f=f||s;if(f){if(l<u+c*o/2||l>d-c*o/2){return l>u+c/2?1:-1}}return 0}function wi(e){if(Xe(wt)<Xe(e)){return 1}else{return-1}}function yi(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;while(i--){n+=t.charCodeAt(i)}return n.toString(36)}function _i(e){Kt.length=0;var t=e.getElementsByTagName("input");var i=t.length;while(i--){var n=t[i];n.checked&&Kt.push(n)}}function ki(e){return setTimeout(e,0)}function Ei(e){return clearTimeout(e)}if($t){De(document,"touchmove",(function(e){if((fi.active||Ot)&&e.cancelable){e.preventDefault()}}))}fi.utils={on:De,off:Ve,css:Be,find:Qe,is:function e(t,i){return!!je(t,i,t,false)},extend:tt,throttle:rt,closest:je,toggleClass:Ue,clone:at,index:Xe,nextTick:ki,cancelNextTick:Ei,detectDirection:ri,getChild:We,expando:ct};fi.get=function(e){return e[ct]};fi.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++){t[i]=arguments[i]}if(t[0].constructor===Array)t=t[0];t.forEach((function(e){if(!e.prototype||!e.prototype.constructor){throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e))}if(e.utils)fi.utils=ye(ye({},fi.utils),e.utils);pt.mount(e)}))};fi.create=function(e,t){return new fi(e,t)};fi.version=Me;var qi=[],Si,Mi,Ci=false,Ii,Ti,Li,Hi;function Zi(){function e(){this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true};for(var e in this){if(e.charAt(0)==="_"&&typeof this[e]==="function"){this[e]=this[e].bind(this)}}}e.prototype={dragStarted:function e(t){var i=t.originalEvent;if(this.sortable.nativeDraggable){De(document,"dragover",this._handleAutoScroll)}else{if(this.options.supportPointer){De(document,"pointermove",this._handleFallbackAutoScroll)}else if(i.touches){De(document,"touchmove",this._handleFallbackAutoScroll)}else{De(document,"mousemove",this._handleFallbackAutoScroll)}}},dragOverCompleted:function e(t){var i=t.originalEvent;if(!this.options.dragOverBubble&&!i.rootEl){this._handleAutoScroll(i)}},drop:function e(){if(this.sortable.nativeDraggable){Ve(document,"dragover",this._handleAutoScroll)}else{Ve(document,"pointermove",this._handleFallbackAutoScroll);Ve(document,"touchmove",this._handleFallbackAutoScroll);Ve(document,"mousemove",this._handleFallbackAutoScroll)}zi();Oi();ot()},nulling:function e(){Li=Mi=Si=Ci=Hi=Ii=Ti=null;qi.length=0},_handleFallbackAutoScroll:function e(t){this._handleAutoScroll(t,true)},_handleAutoScroll:function e(t,i){var n=this;var r=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(r,o);Li=t;if(i||this.options.forceAutoScrollFallback||Te||Ie||He){Di(t,this.options,s,i);var a=et(s,true);if(Ci&&(!Hi||r!==Ii||o!==Ti)){Hi&&zi();Hi=setInterval((function(){var e=et(document.elementFromPoint(r,o),true);if(e!==a){a=e;Oi()}Di(t,n.options,e,i)}),10);Ii=r;Ti=o}}else{if(!this.options.bubbleScroll||et(s,true)===Fe()){Oi();return}Di(t,this.options,et(s,false),false)}}};return Ee(e,{pluginName:"scroll",initializeByDefault:true})}function Oi(){qi.forEach((function(e){clearInterval(e.pid)}));qi=[]}function zi(){clearInterval(Hi)}var Di=rt((function(e,t,i,n){if(!t.scroll)return;var r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=Fe();var c=false,u;if(Mi!==i){Mi=i;Oi();Si=t.scroll;u=t.scrollFn;if(Si===true){Si=et(i,true)}}var d=0;var f=Si;do{var h=f,v=Ye(h),p=v.top,m=v.bottom,g=v.left,b=v.right,x=v.width,w=v.height,y=void 0,_=void 0,k=h.scrollWidth,E=h.scrollHeight,q=Be(h),S=h.scrollLeft,M=h.scrollTop;if(h===l){y=x<k&&(q.overflowX==="auto"||q.overflowX==="scroll"||q.overflowX==="visible");_=w<E&&(q.overflowY==="auto"||q.overflowY==="scroll"||q.overflowY==="visible")}else{y=x<k&&(q.overflowX==="auto"||q.overflowX==="scroll");_=w<E&&(q.overflowY==="auto"||q.overflowY==="scroll")}var C=y&&(Math.abs(b-r)<=s&&S+x<k)-(Math.abs(g-r)<=s&&!!S);var I=_&&(Math.abs(m-o)<=s&&M+w<E)-(Math.abs(p-o)<=s&&!!M);if(!qi[d]){for(var T=0;T<=d;T++){if(!qi[T]){qi[T]={}}}}if(qi[d].vx!=C||qi[d].vy!=I||qi[d].el!==h){qi[d].el=h;qi[d].vx=C;qi[d].vy=I;clearInterval(qi[d].pid);if(C!=0||I!=0){c=true;qi[d].pid=setInterval(function(){if(n&&this.layer===0){fi.active._onTouchMove(Li)}var t=qi[this.layer].vy?qi[this.layer].vy*a:0;var i=qi[this.layer].vx?qi[this.layer].vx*a:0;if(typeof u==="function"){if(u.call(fi.dragged.parentNode[ct],i,t,e,Li,qi[this.layer].el)!=="continue"){return}}st(qi[this.layer].el,i,t)}.bind({layer:d}),24)}}d++}while(t.bubbleScroll&&f!==l&&(f=et(f,false)));Ci=c}),30);var Vi=function e(t){var i=t.originalEvent,n=t.putSortable,r=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(!i)return;var c=n||o;a();var u=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i;var d=document.elementFromPoint(u.clientX,u.clientY);l();if(c&&!c.el.contains(d)){s("spill");this.onSpill({dragEl:r,putSortable:n})}};function Ni(){}Ni.prototype={startIndex:null,dragStart:function e(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function e(t){var i=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState();if(n){n.captureAnimationState()}var r=We(this.sortable.el,this.startIndex,this.options);if(r){this.sortable.el.insertBefore(i,r)}else{this.sortable.el.appendChild(i)}this.sortable.animateAll();if(n){n.animateAll()}},drop:Vi};Ee(Ni,{pluginName:"revertOnSpill"});function Ai(){}Ai.prototype={onSpill:function e(t){var i=t.dragEl,n=t.putSortable;var r=n||this.sortable;r.captureAnimationState();i.parentNode&&i.parentNode.removeChild(i);r.animateAll()},drop:Vi};Ee(Ai,{pluginName:"removeOnSpill"});fi.mount(new Zi);fi.mount(Ai,Ni);var ji='@-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-roles{display:block;max-width:600px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles .roles{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:10px;margin-top:10px}verdocs-template-roles .roles .sequence{gap:10px;height:34px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;font-weight:500;padding:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;border-bottom:1px dotted #e3e3e3}verdocs-template-roles .roles .sequence.add-sequence{color:#777777;line-height:34px}verdocs-template-roles .roles .sequence-label{font-size:18px;line-height:32px}verdocs-template-roles .roles .sequence-roles{gap:10px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-wrap:wrap;flex-wrap:wrap;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .roles .role{height:32px;cursor:move;display:-ms-flexbox;display:flex;max-width:200px;position:relative;border-radius:32px;background-color:#eff7fb;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 14px 0 34px;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column}verdocs-template-roles .roles .role .role-name{font-size:14px;overflow:hidden;font-weight:400;line-height:30px;white-space:nowrap;text-overflow:ellipsis}verdocs-template-roles .roles .role .icons{position:absolute;left:1px;top:-3px;cursor:pointer;padding:5px;z-index:10}verdocs-template-roles .roles .role .icons .gear-button{display:none;-webkit-transform:scale(1.1);transform:scale(1.1);margin:4px 0 0 1px}verdocs-template-roles .roles .role .icons .type-icon{opacity:0.6;display:block;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-roles .roles .role .icons:hover .gear-button{display:block}verdocs-template-roles .roles .role .icons:hover .type-icon{display:none}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.3;cursor:pointer;background:none;-webkit-transform:scale(0.75);transform:scale(0.75)}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles.dragging .roles .sequence.add-sequence .add-role,verdocs-template-roles.dragging .roles .sequence.add-sequence .add-step-label{display:none}verdocs-template-roles.dragging .roles .sequence.add-sequence .sequence-roles{display:-ms-flexbox;display:flex;min-width:150px;background:#e0e0e0}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';var Ri=ji;var Ui='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var Bi='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var Pi='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var Qi='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var Fi='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var Yi=e("verdocs_template_roles",function(){function e(e){t(this,e);this.next=i(this,"next",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.rolesUpdated=i(this,"rolesUpdated",7);this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId="";this.showingRoleDialog=null;this.sender=null;this.dragging=false;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("[ROLES] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){console.log("[ROLES] Template Updated",t);e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;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("[FIELDS] Error with preview session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new y(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.componentDidRender=function(){var e=this;var t=this.getSequenceNumbers();(t||[]).forEach((function(t){var i=document.getElementById("verdocs-roles-sequence-".concat(t));if(i){new fi(i,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:e.handleMoveEnd.bind(e),onChoose:function(){return e.dragging=true},onUnchoose:function(){return e.dragging=false}})}}));var i=document.getElementById("verdocs-roles-sequence-".concat(t.length+1));if(i){new fi(i,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:function(){return e.dragging=true},onUnchoose:function(){return e.dragging=false}})}};e.prototype.handleMoveEnd=function(e){var t=this;var i=+e.from.id.split("-").pop();var n=+e.to.id.split("-").pop();var r=+e.oldIndex+1;var o=+e.newIndex+1;var s={};var a=this.getSequenceNumbers();a.forEach((function(e){s[e]=JSON.parse(JSON.stringify(t.getRolesAtSequence(e)))}));s[a.length+1]=[];var l=s[i].splice(r-1,1)[0];s[n].splice(o-1,0,l);var c=[];Object.entries(s).forEach((function(e){var i=e[0],n=e[1];n.forEach((function(e,n){console.log("Evaluating role",e.name,e.sequence,e.order);var r=+n+1;if(e.sequence!==+i||e.order!==r){e.sequence=+i;e.order=r;c.push(x(t.endpoint,t.templateId,e.name,{sequence:+i,order:r}).then((function(t){return console.log("[ROLES] Updated role",e.name,t)})).catch((function(e){return console.log("[ROLES] Error updating role",e)})))}}))}));console.log("[ROLES] Awaiting ".concat(c.length," renumber requests"),c);return Promise.all(c).then((function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=JSON.parse(JSON.stringify(this.template));e.roles=Object.keys(s).reduce((function(e,t){return e.concat(s[t])}),[]);return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 1:t.sent();return[2]}}))}))}))};e.prototype.handleCancel=function(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()};e.prototype.handleSubmit=function(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()};e.prototype.getSortedRoles=function(){var e;return(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.getSequenceNumbers=function(){var e;var t=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.sequence}));var i=__spreadArray([],new Set(t),true);i.sort((function(e,t){return e-t}));return i};e.prototype.getRoleNames=function(){var e=this.getSortedRoles();return e.map((function(e){return e.name}))};e.prototype.getRolesAtSequence=function(e){var t;return(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t&&t.sequence===e}))};e.prototype.renumberTemplateRoles=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n;var r=this;return __generator(this,(function(o){switch(o.label){case 0:t={};i=[];n=this.getSequenceNumbers();console.log("Sorting sequences",n);(n||[]).forEach((function(e){(t[e]||[]).forEach((function(t,n){var o=+n+1;if(t.sequence!==+e||t.order!==o){console.log("[ROLES] Updating role",t.name,"from",t.sequence,t.order,"to",e,o);t.sequence=+e;t.order=o;i.push(x(r.endpoint,r.templateId,t.name,{sequence:+e,order:o}).then((function(e){return console.log("[ROLES] Updated role",t.name,e)})).catch((function(e){return console.log("[ROLES] Error updating role",e)})))}}))}));console.log("Sortable Roles",t);console.log("[ROLES] Awaiting ".concat(i.length," renumber requests"));return[4,Promise.all(i).then((function(){return __awaiter(r,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=JSON.parse(JSON.stringify(this.template));e.roles=Object.keys(t).reduce((function(e,i){return e.concat(t[i])}),[]);console.log("[ROLES] Done renumbering",e.roles.map((function(e){return{name:e.name,sequence:e.sequence,order:e.order}})));_.updateTemplate(this.templateId,e);return[2]}))}))}))];case 1:o.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))};e.prototype.getNextRoleName=function(){var e,t;var i="";var n=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).length;do{n++;i="Recipient ".concat(n)}while(!i||(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).some((function(e){return e&&e.name===i})));return i};e.prototype.callCreateRole=function(e,t,i){var n=this;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i});w(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:false,kba_method:null}).then((function(e){return __awaiter(n,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){switch(n.label){case 0:console.log("[ROLES] Created role",e);i=JSON.parse(JSON.stringify(this.template));i.roles.push(e);console.log("Updating template in data store");_.updateTemplate(this.templateId,i);return[4,this.renumberTemplateRoles()];case 1:n.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(e){console.log("[ROLES] Error creating role",e)}))};e.prototype.handleAddRole=function(e,t){e.stopPropagation();var i=this.getRolesAtSequence(t).length+1;var n=this.getNextRoleName();this.callCreateRole(n,t,i)};e.prototype.handleAddStep=function(e,t){e.stopPropagation();var i=1;var n=this.getNextRoleName();this.callCreateRole(n,t,i)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(r,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return n(r,{class:"loading"},n("verdocs-loader",null))}console.log("[ROLES] Rendering",this.template.roles.map((function(e){return{name:e.name,sequence:e.sequence,order:e.order}})));var t=this.getRoleNames();var i=this.getSequenceNumbers();console.log("Rendering sequences",i,t);return n(r,{class:{dragging:this.dragging}},n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("h5",null,"Roles and Workflow"),n("div",{class:"roles"},i.map((function(t){return n("div",{class:"sequence"},n("div",{class:"sequence-label no-drag"},t,"."),n("div",{class:"sequence-roles",id:"verdocs-roles-sequence-".concat(t),"data-sequence":t},e.getRolesAtSequence(t).map((function(i){var r=!i.email;return r?n("div",{class:"role","data-rolename":i.name,"data-sequence":t,"data-order":i.order},n("div",{class:"role-name"},i.name),n("div",{class:"icons"},n("div",{class:"gear-button",innerHTML:Ui,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"}),n("span",{class:"type-icon",innerHTML:i.type==="signer"?Pi:i.type==="cc"?Fi:Qi}))):n("div",{class:"role","data-rolename":i.name,"data-sequence":t,"data-order":i.order},n("div",{class:"role-name"},v(i)),n("div",{class:"icons"},n("div",{class:"gear-button",innerHTML:Ui,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"}),n("span",{class:"type-icon",innerHTML:i.type==="signer"?Pi:i.type==="cc"?Fi:Qi})))}))),n("button",{class:"add-role no-drag",innerHTML:Bi,onClick:function(i){return e.handleAddRole(i,t)}}))})),n("div",{class:"sequence add-sequence"},n("div",{class:"sequence-label no-drag"},i.length+1,"."),n("div",{class:"sequence-roles",id:"verdocs-roles-sequence-".concat(i.length+1),"data-sequence":i.length+1},n("div",{class:"role-name add-step-label"},"Add Step.")),n("button",{class:"add-role no-drag",innerHTML:Bi,onClick:function(t){return e.handleAddRole(t,i.length+1)}}))),t.length<1&&n("div",{class:"empty"},"You must add at least one Role before proceeding.",n("br",null)," Click the ",n("span",{innerHTML:Bi})," Add button above to get started."),n("div",{class:"buttons"},n("div",{class:"flex-fill"}),n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return e.handleCancel()}}),n("verdocs-button",{label:"OK",size:"small",onClick:function(){return e.handleSubmit()},disabled:t.length<1}))),this.showingRoleDialog&&n("verdocs-menu-panel",{onClose:function(){return e.showingRoleDialog=null}},n("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){var t;(t=document.getElementById("verdocs-menu-panel-overlay"))===null||t===void 0?void 0:t.remove();e.showingRoleDialog=null},onDelete:function(){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:t.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}})))};Object.defineProperty(e.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());Yi.style=Ri}}}));
@@ -1 +1 @@
1
- import{r as e,c as o,h as r,H as s}from"./p-b9654a5e.js";import{VerdocsEndpoint as l}from"@verdocs/js-sdk";import{u as c}from"./p-b0766439.js";const d=class{constructor(r){e(this,r),this.fileSelected=o(this,"fileSelected",7),this.endpoint=l.getDefault(),this.file=void 0}handleFileChanged(e){var o,r;this.file=(null===(o=e.target.files)||void 0===o?void 0:o[0])||null,null===(r=this.fileSelected)||void 0===r||r.emit({file:this.file}),console.debug("[CHOOSER] Selected file",this.file)}handleSelectFile(e){var o,r;e.stopPropagation(),this.file=null,null===(o=this.fileSelected)||void 0===o||o.emit({file:null}),null===(r=document.getElementById("verdocs-file-chooser"))||void 0===r||r.click()}render(){const e=this.file?"Select a different file":"Select a file from your computer";return r(s,{key:"be9ae4e6e32d7c284001b7fea41d96f39b642005"},r("input",{key:"0bc7cd1766b630372ea380300575dfd239bc86e4",type:"file",multiple:!0,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),r("div",{key:"dbd3aa4e9d64b4bd427f4c6e198d92b10e94dfff",class:"upload-box"},r("div",{key:"41a10b9ffbe862bedc300cdbb8d2a366dc00414e",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),r("div",{key:"128679d890e1c68ff1c7fb47abd4f638db453b87",class:"or-prefer"},this.file?c:"Or, if you prefer..."),r("verdocs-button",{key:"277c4246513e40dc2bc5e7f0f7d7130d52904813",label:e,size:"small",onClick:e=>this.handleSelectFile(e)})))}};d.style='@-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}';const i=class{constructor(o){e(this,o),this.label="",this.showPercent=!1,this.percent=0}render(){const e=Math.ceil(100*Math.min(this.percent,100)/100);return console.log("Rendering progress bar",{widthPercent:e,label:this.label,showPercent:this.showPercent,percent:this.percent}),r(s,{key:"c57b566587b7fe5f95f7082964dc7d27c46008cb"},r("div",{key:"b44243b4c65cdd5ddb7a47028db07e47e1c9373b",class:"labels"},this.label&&r("div",{key:"58715d2cd0a47260618472ed06d3eeda095ea852",class:"label"},this.label),this.showPercent&&r("div",{key:"38b9fa2f2180eee29cdc6aff0562475c9d6cc943",class:"label"},this.percent,"%")),r("div",{key:"1258f3696cb5852865e7d1af59bf2acb7acfda50",class:"bar"},r("div",{key:"eb1346d2b9f7ccce786c358ef247fd3ec62de67f",class:"slider",style:{width:`${e}%`}})))}};i.style='@-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}';export{d as verdocs_file_chooser,i as verdocs_progress_bar}
1
+ import{r as e,c as o,h as r,H as s}from"./p-b9654a5e.js";import{VerdocsEndpoint as l}from"@verdocs/js-sdk";import{u as c}from"./p-b0766439.js";const i=class{constructor(r){e(this,r),this.fileSelected=o(this,"fileSelected",7),this.endpoint=l.getDefault(),this.file=void 0}handleFileChanged(e){var o,r;this.file=(null===(o=e.target.files)||void 0===o?void 0:o[0])||null,null===(r=this.fileSelected)||void 0===r||r.emit({file:this.file}),console.debug("[CHOOSER] Selected file",this.file)}handleSelectFile(e){var o,r;e.stopPropagation(),this.file=null,null===(o=this.fileSelected)||void 0===o||o.emit({file:null}),null===(r=document.getElementById("verdocs-file-chooser"))||void 0===r||r.click()}render(){const e=this.file?"Select a different file":"Select a file from your computer";return r(s,{key:"be9ae4e6e32d7c284001b7fea41d96f39b642005"},r("input",{key:"0bc7cd1766b630372ea380300575dfd239bc86e4",type:"file",multiple:!0,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),r("div",{key:"dbd3aa4e9d64b4bd427f4c6e198d92b10e94dfff",class:"upload-box"},r("div",{key:"41a10b9ffbe862bedc300cdbb8d2a366dc00414e",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),r("div",{key:"128679d890e1c68ff1c7fb47abd4f638db453b87",class:"or-prefer"},this.file?c:"Or, if you prefer..."),r("verdocs-button",{key:"277c4246513e40dc2bc5e7f0f7d7130d52904813",label:e,size:"small",onClick:e=>this.handleSelectFile(e)})))}};i.style='@-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}';const a=class{constructor(o){e(this,o),this.label="",this.showPercent=!1,this.percent=0}render(){const e=Math.ceil(100*Math.min(this.percent,100)/100);return console.log("Rendering progress bar",{widthPercent:e,label:this.label,showPercent:this.showPercent,percent:this.percent}),r(s,{key:"14a4f7cd07957fee25343222ec781ba6e6304059"},r("div",{key:"07dfc3395766807af984d521f2b2be8eea1a27d4",class:"labels"},this.label&&r("div",{key:"26dd439a1506bff22f4b8568f40a2a4e597b556e",class:"label"},this.label),this.showPercent&&r("div",{key:"f73d067c6b6b5afcd7b3f703b5e6055c703bb3c0",class:"label"},this.percent,"%")),r("div",{key:"1a95c48e82676e63edc1a190911c4f9823681612",class:"bar"},r("div",{key:"505638049abc86f9516b37644a883f7bd1e8a232",class:"slider",style:{width:`${e}%`}})))}};a.style='@-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}';export{i as verdocs_file_chooser,a as verdocs_progress_bar}
@@ -0,0 +1 @@
1
+ import{getTemplate as e}from"@verdocs/js-sdk";const t=e=>typeof e,s="",n=t(s),l=t(!0),a=t(0),o=t(t),r="type",c="default",i="Has",u="Ids",d="Table",h=d+"s",f=d+u,b="Row",g=b+"Count",T=b+u,_="Cell",p=_+u,v="Value",S=v+"s",w=v+u,m=e=>s+e,C=isFinite,V=e=>null==e,I=(e,t,s)=>V(e)?s?.():t(e),y=e=>e==n||e==l,R=e=>t(e)==o,J=e=>Array.isArray(e),L=(e,t,s)=>e.slice(t,s),E=e=>e.length,O=(e,t)=>e.forEach(t),j=(e,t)=>e.map(t),N=(e,...t)=>e.push(...t),F=Object,M=e=>F.getPrototypeOf(e),$=F.entries,x=F.isFrozen,A=e=>!V(e)&&I(M(e),(e=>e==F.prototype||V(M(e))),(()=>!0)),D=F.keys,P=F.freeze,k=(e,t)=>t in e,z=(e,t)=>(delete e[t],e),H=(e,t)=>j($(e),(([e,s])=>t(s,e))),W=e=>A(e)&&0==(e=>E(D(e)))(e),q=(e,t,s,n=0)=>V(e)||!A(e)||!n&&W(e)||x(e)?(s?.(),!1):(H(e,((s,n)=>{t(s,n)||z(e,n)})),!!n||!W(e)),B=e=>t=>Z(t).reduce(((t,s)=>t+e(s)),0),G=e=>e?.size??0,K=B(G),Q=B(K),U=B(Q),X=(e,t)=>e?.has(t)??!1,Y=e=>V(e)||0==G(e),Z=e=>[...e?.values()??[]],ee=e=>e.clear(),te=(e,t)=>e?.forEach(t),se=(e,t)=>e?.delete(t),ne=e=>new Map(e),le=e=>[...e?.keys()??[]],ae=(e,t)=>e?.get(t),oe=(e,t)=>te(e,((e,s)=>t(s,e))),re=(e,t,s)=>V(s)?(se(e,t),e):e?.set(t,s),ce=(e,t,s,n)=>(X(e,t)?n?.(ae(e,t)):re(e,t,s()),ae(e,t)),ie=(e,t,s,n=re)=>(H(t,((t,n)=>s(e,n,t))),oe(e,(s=>k(t,s)?0:n(e,s))),e),ue=(e,t,s,n)=>{const l={};return te(e,((e,a)=>{if(!s?.(e,a)){const s=t?t(e,a):e;n?.(s)||(l[a]=s)}})),l},de=(e,t,s)=>ue(e,(e=>ue(e,t,s)),Y,W),he=(e,t,s)=>ue(e,(e=>de(e,t,s)),Y,W),fe=(e,t)=>{const s=ne();return te(e,((e,n)=>s.set(n,t?.(e)??e))),s},be=e=>fe(e,fe),ge=e=>fe(e,be),Te=(e,t,s,n,l=0)=>I((s?ce:ae)(e,t[l],l>E(t)-2?s:ne),(a=>{if(l>E(t)-2)return n?.(a)&&re(e,t[l]),a;const o=Te(a,t,s,n,l+1);return Y(a)&&re(e,t[l]),o})),_e=e=>{const s=t(e);return y(s)||s==a&&C(e)?s:void 0},pe=(e,t,s,n,l)=>V(l)?e.delCell(t,s,n,!0):e.setCell(t,s,n,l),ve=(e,t,s)=>V(s)?e.delValue(t):e.setValue(t,s),Se=e=>new Set(J(e)||V(e)?e:[e]),we=(e,t)=>e?.add(t),me=/^\d+$/,Ce=()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??s+t++,t=>{me.test(t)&&E(e)<1e3&&N(e,t)}]},Ve=e=>[e,e],Ie=(e,t=K)=>t(e[0])+t(e[1]),ye=()=>[ne(),ne()],Re=e=>[...e],Je=([e,t])=>e===t,Le=JSON.stringify,Ee=JSON.parse,Oe=e=>Le(e,((e,t)=>t instanceof Map?F.fromEntries([...t]):t)),je=(e,t,s)=>re(e,t,ae(e,t)==-s?void 0:s),Ne=()=>{let e,t,n=!1,l=!1,o=0,u=[];const C=ne(),F=ne(),M=ne(),$=ne(),x=ne(),A=ne(),D=ne(),B=ne(),Z=ne(),me=ne(),Le=ne(),Fe=ne(),Me=ne(),$e=ne(),xe=Se(),Ae=ne(),De=ne(),Pe=ne(),ke=ne(),ze=ye(),He=ye(),We=ye(),qe=ye(),Be=ye(),Ge=ye(),Ke=ye(),Qe=ye(),Ue=ye(),Xe=ye(),Ye=ye(),Ze=ye(),et=ye(),tt=ye(),st=ye(),nt=ye(),lt=ye(),at=ye(),ot=ye(),rt=ye(),ct=ye(),it=ye(),ut=ne(),dt=ye(),[ht,ft,bt,gt]=(e=>{let t;const[n,l]=Ce(),a=ne();return[(l,o,r,c=[],i=(()=>[]))=>{t??=e();const u=n(1);return re(a,u,[l,o,r,c,i]),we(Te(o,r??[s],Se),u),u},(e,n,...l)=>O(((e,t=[s])=>{const n=[],l=(e,s)=>s==E(t)?N(n,e):null===t[s]?te(e,(e=>l(e,s+1))):O([t[s],null],(t=>l(ae(e,t),s+1)));return l(e,0),n})(e,n),(e=>te(e,(e=>ae(a,e)[0](t,...n??[],...l))))),e=>I(ae(a,e),(([,t,n])=>(Te(t,n??[s],void 0,(t=>(se(t,e),Y(t)?1:0))),re(a,e),l(e),n))),e=>I(ae(a,e),(([e,,s=[],n,l])=>{const a=(...o)=>{const r=E(o);r==E(s)?e(t,...o,...l(o)):V(s[r])?O(n[r]?.(...o)??[],(e=>a(...o,e))):a(...o,s[r])};a()}))]})((()=>Ms)),Tt=e=>{if(!q(e,((e,t)=>[r,c].includes(t))))return!1;const t=e[r];return!(!y(t)&&t!=a||(_e(e[c])!=t&&z(e,c),0))},_t=J,pt=(t,s)=>(!e||X(Le,s)||Gt(s))&&q(t,((e,t)=>vt(s,t,e)),(()=>Gt(s))),vt=(e,t,s,n)=>q(n?s:Ct(s,e,t),((n,l)=>I(St(e,t,l,n),(e=>(s[l]=e,!0)),(()=>!1))),(()=>Gt(e,t))),St=(t,s,n,l)=>e?I(ae(ae(Le,t),n),(e=>_e(l)!=e[r]?Gt(t,s,n,l,e[c]):l),(()=>Gt(t,s,n,l))):V(_e(l))?Gt(t,s,n,l):l,wt=(e,t)=>q(t?e:Vt(e),((t,s)=>I(mt(s,t),(t=>(e[s]=t,!0)),(()=>!1))),(()=>Kt())),mt=(e,s)=>t?I(ae(Me,e),(t=>_e(s)!=t[r]?Kt(e,s,t[c]):s),(()=>Kt(e,s))):V(_e(s))?Kt(e,s):s,Ct=(e,t,s)=>(I(ae(Fe,t),(([n,l])=>{te(n,((t,s)=>{k(e,s)||(e[s]=t)})),te(l,(n=>{k(e,n)||Gt(t,s,n)}))})),e),Vt=e=>(t&&(te($e,((t,s)=>{k(e,s)||(e[s]=t)})),te(xe,(t=>{k(e,t)||Kt(t)}))),e),It=e=>ie(Le,e,((e,t,s)=>{const n=ne(),l=Se();ie(ce(Le,t,ne),s,((e,t,s)=>{re(e,t,s),I(s[c],(e=>re(n,t,e)),(()=>we(l,t)))})),re(Fe,t,[n,l])}),((e,t)=>{re(Le,t),re(Fe,t)})),yt=e=>ie(Me,e,((e,t,s)=>{re(Me,t,s),I(s[c],(e=>re($e,t,e)),(()=>we(xe,t)))}),((e,t)=>{re(Me,t),re($e,t),se(xe,t)})),Rt=e=>W(e)?ys():ws(e),Jt=e=>ie(Pe,e,((e,t,s)=>Lt(t,s)),((e,t)=>xt(t))),Lt=(e,t)=>ie(ce(Pe,e,(()=>(kt(e,1),re(Ae,e,Ce()),re(De,e,ne()),ne()))),t,((t,s,n)=>Et(e,t,s,n)),((t,s)=>At(e,t,s))),Et=(e,t,s,n,l)=>ie(ce(t,s,(()=>(zt(e,s,1),ne()))),n,((t,n,l)=>Ot(e,s,t,n,l)),((n,a)=>Dt(e,t,s,n,a,l))),Ot=(e,t,s,n,l)=>{X(s,n)||Ht(e,t,n,1);const a=ae(s,n);l!==a&&(Wt(e,t,n,a,l),re(s,n,l))},jt=(e,t,s,n,l)=>I(ae(t,s),(t=>Ot(e,s,t,n,l)),(()=>Et(e,t,s,Ct({[n]:l},e,s)))),Nt=e=>W(e)?Ls():ms(e),Ft=e=>ie(ke,e,((e,t,s)=>Mt(t,s)),((e,t)=>Pt(t))),Mt=(e,t)=>{X(ke,e)||qt(e,1);const s=ae(ke,e);t!==s&&(Bt(e,s,t),re(ke,e,t))},$t=e=>ae(Pe,e)??Lt(e,{}),xt=e=>Lt(e,{}),At=(e,t,s)=>{const[,n]=ae(Ae,e);n(s),Et(e,t,s,{},!0)},Dt=(e,t,s,n,l,a)=>{const o=ae(ae(Fe,e)?.[0],l);if(!V(o)&&!a)return Ot(e,s,n,l,o);const r=t=>{Wt(e,s,t,ae(n,t)),Ht(e,s,t,-1),re(n,t)};V(o)?r(l):oe(n,r),Y(n)&&(zt(e,s,-1),Y(re(t,s))&&(kt(e,-1),re(Pe,e),re(Ae,e),re(De,e)))},Pt=e=>{const t=ae($e,e);if(!V(t))return Mt(e,t);Bt(e,ae(ke,e)),qt(e,-1),re(ke,e)},kt=(e,t)=>je(C,e,t),zt=(e,t,s)=>je(ce($,e,ne),t,s)&&re(M,e,ce(M,e,(()=>0))+s),Ht=(e,t,s,n)=>{const l=ae(De,e),a=ae(l,s)??0;(0==a&&1==n||1==a&&-1==n)&&je(ce(F,e,ne),s,n),re(l,s,a!=-n?a+n:null),je(ce(ce(x,e,ne),t,ne),s,n)},Wt=(e,t,s,n,l)=>{ce(ce(ce(A,e,ne),t,ne),s,(()=>[n,0]))[1]=l,u[3]?.(e,t,s,l)},qt=(e,t)=>je(D,e,t),Bt=(e,t,s)=>{ce(B,e,(()=>[t,0]))[1]=s,u[4]?.(e,s)},Gt=(e,t,s,n,l)=>(N(ce(ce(ce(Z,e,ne),t,ne),s,(()=>[])),n),l),Kt=(e,t,s)=>(N(ce(me,e,(()=>[])),t),s),Qt=(e,t,s)=>I(ae(ae(ae(A,e),t),s),(([e,t])=>[!0,e,t]),(()=>[!1,...Ve(us(e,t,s))])),Ut=e=>I(ae(B,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Ve(fs(e))])),Xt=e=>Y(Z)||Y(nt[e])?0:te(e?ge(Z):Z,((t,s)=>te(t,((t,n)=>te(t,((t,l)=>ft(nt[e],[s,n,l],t))))))),Yt=e=>Y(me)||Y(lt[e])?0:te(e?fe(me):me,((t,s)=>ft(lt[e],[s],t))),Zt=(e,t,s,n)=>{if(!Y(e))return ft(t,n,(()=>ue(e))),oe(e,((e,t)=>ft(s,[...n??[],e],1==t))),1},es=e=>{const t=bs();t!=n&&ft(ze[e],void 0,t);const s=Y(Xe[e]),l=Y(et[e])&&Y(tt[e])&&Y(Ue[e])&&Y(Ye[e])&&Y(Ge[e])&&Y(Ke[e])&&Y(Qe[e])&&s&&Y(We[e])&&Y(qe[e]),a=Y(st[e])&&Y(Ze[e])&&Y(Be[e])&&Y(He[e]);if(!l||!a){const t=e?[fe(C),be(F),fe(M),be($),ge(x),ge(A)]:[C,F,M,$,x,A];if(!l){Zt(t[0],We[e],qe[e]),te(t[1],((t,s)=>Zt(t,Ge[e],Ke[e],[s]))),te(t[2],((t,s)=>{0!=t&&ft(Qe[e],[s],os(s))}));const n=Se();te(t[3],((t,l)=>{Zt(t,Ue[e],Ye[e],[l])&&!s&&(ft(Xe[e],[l,null]),we(n,l))})),s||te(t[5],((t,s)=>{if(!X(n,s)){const n=Se();te(t,(e=>te(e,(([t,s],l)=>s!==t?we(n,l):se(e,l))))),te(n,(t=>ft(Xe[e],[s,t])))}})),te(t[4],((t,s)=>te(t,((t,n)=>Zt(t,et[e],tt[e],[s,n])))))}if(!a){let s;te(t[5],((t,n)=>{let l;te(t,((t,a)=>{let o;te(t,(([t,r],c)=>{r!==t&&(ft(st[e],[n,a,c],r,t,Qt),s=l=o=1)})),o&&ft(Ze[e],[n,a],Qt)})),l&&ft(Be[e],[n],Qt)})),s&&ft(He[e],void 0,Qt)}}},ts=e=>{const t=vs();t!=l&&ft(at[e],void 0,t);const s=Y(rt[e])&&Y(ct[e]),n=Y(it[e])&&Y(ot[e]);if(!s||!n){const t=e?[fe(D),fe(B)]:[D,B];if(s||Zt(t[0],rt[e],ct[e]),!n){let s;te(t[1],(([t,n],l)=>{n!==t&&(ft(it[e],[l],n,t,Ut),s=1)})),s&&ft(ot[e],void 0,Ut)}}},ss=(e,...t)=>(js((()=>e(...j(t,m)))),Ms),ns=()=>he(Pe),ls=()=>le(Pe),as=e=>le(ae(De,m(e))),os=e=>G(ae(Pe,m(e))),rs=e=>le(ae(Pe,m(e))),cs=(e,t,s,n=0,l)=>{return j(L((a=ae(Pe,m(e)),o=(e,s)=>[V(t)?s:ae(e,m(t)),s],j([...a?.entries()??[]],(([e,t])=>o(t,e))).sort((([e],[t])=>((e??0)<(t??0)?-1:1)*(s?-1:1)))),n,V(l)?l:n+l),(([,e])=>e));var a,o},is=(e,t)=>le(ae(ae(Pe,m(e)),m(t))),us=(e,t,s)=>ae(ae(ae(Pe,m(e)),m(t)),m(s)),ds=()=>ue(ke),hs=()=>le(ke),fs=e=>ae(ke,m(e)),bs=()=>!Y(Pe),gs=e=>X(Pe,m(e)),Ts=(e,t)=>X(ae(De,m(e)),m(t)),_s=(e,t)=>X(ae(Pe,m(e)),m(t)),ps=(e,t,s)=>X(ae(ae(Pe,m(e)),m(t)),m(s)),vs=()=>!Y(ke),Ss=e=>X(ke,m(e)),ws=e=>ss((()=>(e=>q(e,pt,Gt))(e)?Jt(e):0)),ms=e=>ss((()=>wt(e)?Ft(e):0)),Cs=e=>{try{Rt(Ee(e))}catch{}return Ms},Vs=t=>ss((()=>{if((e=q(t,(e=>q(e,Tt))))&&(It(t),!Y(Pe))){const e=ns();ys(),ws(e)}})),Is=e=>ss((()=>{if(t=(e=>q(e,Tt))(e)){const s=ds();Os(),Ls(),t=!0,yt(e),ms(s)}})),ys=()=>ss((()=>Jt({}))),Rs=e=>ss((e=>X(Pe,e)?xt(e):0),e),Js=(e,t)=>ss(((e,t)=>I(ae(Pe,e),(s=>X(s,t)?At(e,s,t):0))),e,t),Ls=()=>ss((()=>Ft({}))),Es=()=>ss((()=>{It({}),e=!1})),Os=()=>ss((()=>{yt({}),t=!1})),js=(e,t)=>{if(-1!=o){Ns();const s=e();return Fs(t),s}},Ns=()=>(-1!=o&&o++,1==o&&(u[0]?.(),ft(ut)),Ms),Fs=e=>(o>0&&(o--,0==o&&(o=1,Xt(1),Y(A)||es(1),Yt(1),Y(B)||ts(1),e?.(Ms)&&(te(A,((e,t)=>te(e,((e,s)=>te(e,(([e],n)=>pe(Ms,t,s,n,e))))))),ee(A),te(B,(([e],t)=>ve(Ms,t,e))),ee(B)),ft(dt[0],void 0),o=-1,Xt(0),Y(A)||es(0),Yt(0),Y(B)||ts(0),u[1]?.(),ft(dt[1],void 0),u[2]?.(),o=0,n=bs(),l=vs(),O([C,F,M,$,x,A,Z,D,B,me],ee))),Ms),Ms={getContent:()=>[ns(),ds()],getTables:ns,getTableIds:ls,getTable:e=>de(ae(Pe,m(e))),getTableCellIds:as,getRowCount:os,getRowIds:rs,getSortedRowIds:cs,getRow:(e,t)=>ue(ae(ae(Pe,m(e)),m(t))),getCellIds:is,getCell:us,getValues:ds,getValueIds:hs,getValue:fs,hasTables:bs,hasTable:gs,hasTableCell:Ts,hasRow:_s,hasCell:ps,hasValues:vs,hasValue:Ss,getTablesJson:()=>Oe(Pe),getValuesJson:()=>Oe(ke),getJson:()=>Oe([Pe,ke]),getTablesSchemaJson:()=>Oe(Le),getValuesSchemaJson:()=>Oe(Me),getSchemaJson:()=>Oe([Le,Me]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>ss((()=>_t(e)?(([e,t])=>{(W(e)?ys:ws)(e),(W(t)?Ls:ms)(t)})(e):0)),setTables:ws,setTable:(e,t)=>ss((e=>pt(t,e)?Lt(e,t):0),e),setRow:(e,t,s)=>ss(((e,t)=>vt(e,t,s)?Et(e,$t(e),t,s):0),e,t),addRow:(e,t,s=!0)=>js((()=>{let n;return vt(e,n,t)&&(e=m(e),Et(e,$t(e),n=((e,t)=>{const[s]=ae(Ae,e);let n;do{n=s(t)}while(X(ae(Pe,e),n));return n})(e,s?1:0),t)),n})),setPartialRow:(e,t,s)=>ss(((e,t)=>{if(vt(e,t,s,1)){const n=$t(e);H(s,((s,l)=>jt(e,n,t,l,s)))}}),e,t),setCell:(e,t,s,n)=>ss(((e,t,s)=>I(St(e,t,s,R(n)?n(us(e,t,s)):n),(n=>jt(e,$t(e),t,s,n)))),e,t,s),setValues:ms,setPartialValues:e=>ss((()=>wt(e,1)?H(e,((e,t)=>Mt(t,e))):0)),setValue:(e,t)=>ss((e=>I(mt(e,R(t)?t(fs(e)):t),(t=>Mt(e,t)))),e),applyChanges:e=>ss((()=>{H(e[0],((e,t)=>V(e)?Rs(t):H(e,((e,s)=>V(e)?Js(t,s):H(e,((e,n)=>pe(Ms,t,s,n,e))))))),H(e[1],((e,t)=>ve(Ms,t,e)))})),setTablesJson:Cs,setValuesJson:e=>{try{Nt(Ee(e))}catch{}return Ms},setJson:e=>ss((()=>{try{const[t,s]=Ee(e);Rt(t),Nt(s)}catch{Cs(e)}})),setTablesSchema:Vs,setValuesSchema:Is,setSchema:(e,t)=>ss((()=>{Vs(e),Is(t)})),delTables:ys,delTable:Rs,delRow:Js,delCell:(e,t,s,n)=>ss(((e,t,s)=>I(ae(Pe,e),(l=>I(ae(l,t),(a=>X(a,s)?Dt(e,l,t,a,s,n):0))))),e,t,s),delValues:Ls,delValue:e=>ss((e=>X(ke,e)?Pt(e):0),e),delTablesSchema:Es,delValuesSchema:Os,delSchema:()=>ss((()=>{Es(),Os()})),transaction:js,startTransaction:Ns,getTransactionChanges:()=>[ue(A,((e,t)=>-1===ae(C,t)?void 0:ue(e,((e,s)=>-1===ae(ae($,t),s)?void 0:ue(e,(([,e])=>e),(e=>Je(e)))),Y,W)),Y,W),ue(B,(([,e])=>e),(e=>Je(e))),1],getTransactionLog:()=>[!Y(A),!Y(B),he(A,Re,Je),he(Z),ue(B,Re,Je),ue(me),ue(C),de($),he(x),ue(D)],finishTransaction:Fs,forEachTable:e=>te(Pe,((t,s)=>e(s,(e=>te(t,((t,s)=>e(s,(e=>oe(t,e))))))))),forEachTableCell:(e,t)=>oe(ae(De,m(e)),t),forEachRow:(e,t)=>te(ae(Pe,m(e)),((e,s)=>t(s,(t=>oe(e,t))))),forEachCell:(e,t,s)=>oe(ae(ae(Pe,m(e)),m(t)),s),forEachValue:e=>oe(ke,e),addSortedRowIdsListener:(e,t,s,n,l,a,o)=>{let r=cs(e,t,s,n,l);return ht((()=>{const o=cs(e,t,s,n,l);var c,i;i=r,E(c=o)===E(i)&&c.every(((e,t)=>i[t]===e))||(r=o,a(Ms,e,t,s,n,l,r))}),Xe[o?1:0],[e,t],[ls])},addStartTransactionListener:e=>ht(e,ut),addWillFinishTransactionListener:e=>ht(e,dt[0]),addDidFinishTransactionListener:e=>ht(e,dt[1]),callListener:e=>(gt(e),Ms),delListener:e=>(bt(e),Ms),getListenerStats:()=>({hasTables:Ie(ze),tables:Ie(He),tableIds:Ie(We),hasTable:Ie(qe),table:Ie(Be),tableCellIds:Ie(Ge),hasTableCell:Ie(Ke,Q),rowCount:Ie(Qe),rowIds:Ie(Ue),sortedRowIds:Ie(Xe),hasRow:Ie(Ye,Q),row:Ie(Ze,Q),cellIds:Ie(et,Q),hasCell:Ie(tt,U),cell:Ie(st,U),invalidCell:Ie(nt,U),hasValues:Ie(at),values:Ie(ot),valueIds:Ie(rt),hasValue:Ie(ct),value:Ie(it),invalidValue:Ie(lt),transaction:K(ut)+Ie(dt)}),isMergeable:()=>!1,createStore:Ne,addListener:ht,callListeners:ft,setInternalListeners:(e,t,s,n,l)=>u=[e,t,s,n,l]};return H({[i+h]:[0,ze,[],()=>[bs()]],[h]:[0,He],[f]:[0,We],[i+d]:[1,qe,[ls],e=>[gs(...e)]],[d]:[1,Be,[ls]],[d+p]:[1,Ge,[ls]],[i+d+_]:[2,Ke,[ls,as],e=>[Ts(...e)]],[g]:[1,Qe,[ls]],[T]:[1,Ue,[ls]],[i+b]:[2,Ye,[ls,rs],e=>[_s(...e)]],[b]:[2,Ze,[ls,rs]],[p]:[2,et,[ls,rs]],[i+_]:[3,tt,[ls,rs,is],e=>[ps(...e)]],[_]:[3,st,[ls,rs,is],e=>Ve(us(...e))],InvalidCell:[3,nt],[i+S]:[0,at,[],()=>[vs()]],[S]:[0,ot],[w]:[0,rt],[i+v]:[1,ct,[hs],e=>[Ss(...e)]],[v]:[1,it,[hs],e=>Ve(fs(e[0]))],InvalidValue:[1,lt]},(([e,t,s,n],l)=>{Ms["add"+l+"Listener"]=(...l)=>ht(l[e],t[l[e+1]?1:0],e>0?L(l,0,e):void 0,s,n)})),P(Ms)},Fe=Ne();Fe.delTables(),Fe.delValues(),console.log("[STORE] Data store initialized.");const Me=(e,t)=>{try{return JSON.parse(e)}catch(e){return t||null}},$e=e=>{const t={};for(let s in e)"string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t[s]=e[s]:null===e[s]?t[`__null__${s}`]="":Array.isArray(e[s])?t[`__array__${s}`]=JSON.stringify(e[s]):"object"==typeof e[s]&&(t[`__object__${s}`]=JSON.stringify(e[s]));return t},xe=e=>{const t={};for(let s in e)s.startsWith("__null__")?t[s.replace("__null__","")]=null:"string"==typeof e[s]&&s.startsWith("__array__")?t[s.replace("__array__","")]=Me(e[s]):"string"==typeof e[s]&&s.startsWith("__object__")?t[s.replace("__object__","")]=Me(e[s]):t[s]=e[s];return t},Ae={store:Fe,subscribe(e,t,s,n,l){Fe.hasRow(e,t)&&l(xe(Fe.getRow(e,t)));const a=Fe.addRowListener(e,t,(()=>{const s=Fe.getRow(e,t);l(xe(s))}));return Fe.hasRow(e,t)&&!n||(console.log("[STORE] Loading/reloading",{tableId:e,rowId:t}),s().then((s=>{Fe.setRow(e,t,$e(s))})).catch((s=>{console.error("[STORE] Error getting row",{tableId:e,rowId:t,forceReload:n},s)}))),a},unsubscribe(e){Fe.delListener(e)},async getTemplate(t,s,n=!1){if(!n){if(!Fe.hasRow("templates",s))return null;const e=Fe.getRow("templates",s);return xe(e)}const l=await e(t,s);return console.log("[STORE] Reloading template",l),Fe.setRow("templates",s,$e(l)),l},updateTemplate:(e,t)=>(Fe.setRow("templates",e,$e(t)),t),async getEnvelope(t,s,n=!1){if(!n){if(!Fe.hasRow("envelopes",s))return null;const e=Fe.getRow("envelopes",s);return xe(e)}const l=await e(t,s);return Fe.setRow("envelopes",s,$e(l)),l},updateEnvelope:(e,t)=>(Fe.setRow("envelopes",e,$e(t)),t),getField(e,t,s){if("template"===e){const e=Fe.getRow("templates",t),n=xe(e),l=(n.fields||[]).find((e=>e.name===s)),a=(n.roles||[]).map((e=>e.name)).findIndex((e=>e===l.role_name));return{index:Math.max(a,0),field:l}}{const e=Fe.getRow("envelopes",t),n=xe(e),l=(n.fields||[]).find((e=>e.name===s));return{index:(n.recipients||[]).map((e=>e.role_name)).findIndex((e=>e===l.role_name)),field:l}}}};export{Ae as S}
@@ -1 +1 @@
1
- import{r as e,h as r,H as t}from"./p-b9654a5e.js";const i={border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff"},s={border:"3px solid rgba(0, 0, 0, 0.3)",borderTopColor:"#333"},o=class{constructor(r){e(this,r),this.size=32,this.mode="light"}render(){return r(t,{key:"b71bb590c4c908d7b0c9b6483ee8def10f327d2f",style:{width:`${this.size}px`,height:`${this.size}px`,flex:`0 0 ${this.size}px`,..."light"===this.mode?i:s}})}};o.style="verdocs-spinner{display:inline-block;border-radius:50%;-webkit-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";export{o as verdocs_spinner}
1
+ import{r as e,h as r,H as t}from"./p-b9654a5e.js";const i={border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff"},s={border:"3px solid rgba(0, 0, 0, 0.3)",borderTopColor:"#333"},o=class{constructor(r){e(this,r),this.size=32,this.mode="light"}render(){return r(t,{key:"3b572b396105d7ce43dc68782775180136627e78",style:{width:`${this.size}px`,height:`${this.size}px`,flex:`0 0 ${this.size}px`,..."light"===this.mode?i:s}})}};o.style="verdocs-spinner{display:inline-block;border-radius:50%;-webkit-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";export{o as verdocs_spinner}
@@ -1 +1 @@
1
- import{r as e,c as i,h as s,F as t,H as n}from"./p-b9654a5e.js";import{VerdocsEndpoint as o,getEnvelope as l,resendInvitation as a,cancelEnvelope as r,formatFullName as d,updateEnvelope as c,userIsEnvelopeOwner as v,capitalize as p}from"@verdocs/js-sdk";import{F as h}from"./p-c7ee88c7.js";import{V as m}from"./p-04c07b7b.js";import{S as w}from"./p-fd97809c.js";import{S as g}from"./p-da4d4eed.js";import{f as b}from"./p-12bab948.js";const x=864e5,f={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-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.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>'},u=class{constructor(s){e(this,s),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.toggle=i(this,"toggle",7),this.another=i(this,"another",7),this.envelopeListenerId=null,this.endpoint=o.getDefault(),this.envelopeId="",this.activeTab=1,this.panelOpen=!1,this.showRecipientDialog="",this.showCancelDialog=!1,this.remindersEnabled=!1,this.updatingReminders=!1,this.initialReminder=null,this.followupReminders=null,this.loading=!0,this.envelope=null}async componentWillLoad(){var e,i,s;try{if(this.endpoint.loadSession(),!this.envelopeId)return void console.log(`[SIDEBAR] Missing required envelope ID ${this.envelopeId}`);if(!this.endpoint.session)return void console.log("[SIDEBAR] Unable to start session, must be authenticated");this.listenToEnvelope()}catch(t){console.log("[SIDEBAR] Error loading envelope",t),null===(e=this.sdkError)||void 0===e||e.emit(new w(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(s=t.response)||void 0===s?void 0:s.data))}}disconnectedCallback(){this.unlistenToEnvelope()}async listenToEnvelope(){console.log("[SIDEBAR] Loading envelope",this.envelopeId),this.unlistenToEnvelope(),g.subscribe("envelopes",this.envelopeId,(()=>l(this.endpoint,this.envelopeId)),!1,(e=>{var i,s;this.envelope=e,this.loading=!1,this.sortEnvelopeRecipients(),this.initialReminder=null===(i=this.envelope)||void 0===i?void 0:i.initial_reminder,this.followupReminders=null===(s=this.envelope)||void 0===s?void 0:s.followup_reminders,this.remindersEnabled=!!this.initialReminder}))}unlistenToEnvelope(){this.envelopeListenerId&&(g.store.delListener(this.envelopeListenerId),this.envelopeListenerId=null)}sortEnvelopeRecipients(){var e;((null===(e=this.envelope)||void 0===e?void 0:e.recipients)||[]).sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}setTab(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen,null===(i=this.toggle)||void 0===i||i.emit({open:this.panelOpen}),this.activeTab=e}canResendRecipient(e){var i;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes(null===(i=this.envelope)||void 0===i?void 0:i.status)}handleRecipientAction(e,i){var s;switch(console.log("[SIDEBAR] Recipient action",i,e),i){case"reminder":a(this.endpoint,this.envelopeId,e.role_name).then((()=>{m("Reminder Sent",{style:"success"})})).catch((e=>{console.log("[SIDEBAR] Error resending invitation",e),m("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":case"details":m("This feature will be enabled in a future release. Please try again later.",{style:"info"})}null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:i})}handleCancelEnvelope(){this.loading=!0,r(this.endpoint,this.envelopeId).then((async e=>{var i;console.log("[SIDEBAR] Envelope canceled",e),m("Envelope canceled",{style:"success"});const s=JSON.parse(JSON.stringify(this.envelope));s.status="canceled",g.updateEnvelope(this.envelopeId,s),this.loading=!1,this.panelOpen=!1,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:s,event:"canceled"})})).catch((e=>{console.log("[SIDEBAR] Error canceling envelope",e),this.loading=!1,m("Error canceling envelope: "+e.message,{style:"error"})}))}prepareHistoryEntries(){var e,i,s,t,n,o;const l=[],a=(null===(e=this.envelope)||void 0===e?void 0:e.history_entries)||[];l.push({icon:"pencil",message:"Envelope created.",date:new Date(null===(i=this.envelope)||void 0===i?void 0:i.created_at)}),"complete"===(null===(s=this.envelope)||void 0===s?void 0:s.status)&&l.push({icon:"pencil",message:"Envelope completed.",date:new Date(null===(t=this.envelope)||void 0===t?void 0:t.updated_at)});const r=a.some((e=>"owner:canceled"===e.event));return"canceled"!==(null===(n=this.envelope)||void 0===n?void 0:n.status)||r||l.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date(null===(o=this.envelope)||void 0===o?void 0:o.canceled_at)}),a.forEach((e=>{var i;const s=((null===(i=this.envelope)||void 0===i?void 0:i.recipients)||[]).find((i=>i.role_name===e.role_name)),t=d(s);switch(e.event.toLowerCase()){case"recipient:signed":l.push({icon:"gesture",message:`Signed by ${t}.`,date:new Date(e.created_at)});break;case"recipient:declined":l.push({icon:"clear",message:`Declined by ${t}.`,date:new Date(e.created_at)});break;case"recipient:opened":switch(e.event_detail){case"email":case"mail":l.push({icon:"visibility",message:`Opened by ${t}, via email.`,date:new Date(e.created_at)});break;case"sms":l.push({icon:"visibility",message:`Opened by ${t}, via SMS.`,date:new Date(e.created_at)});break;case"in_person_link":l.push({icon:"visibility",message:`Opened by ${t}, via In-person link.`,date:new Date(e.created_at)});break;case"in_app":l.push({icon:"visibility",message:`Opened by ${t}, via dashboard.`,date:new Date(e.created_at)});break;default:l.push({icon:"visibility",message:`Opened by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:submitted":l.push("approver"===e.event_detail?{icon:"check_circle",message:`Approved by ${t}.`,date:new Date(e.created_at)}:{icon:"send",message:`Submitted by ${t}.`,date:new Date(e.created_at)});break;case"recipient:prepared":l.push({icon:"send",message:`Prepared by ${t}.`,date:new Date(e.created_at)});break;case"recipient:claimed":"guest"===e.event_detail?l.push({icon:"account_circle",message:`${t} claimed the Envelope as a guest.`,date:new Date(e.created_at)}):"profile"===e.event_detail&&l.push({icon:"verified_user",message:`${t} claimed the Envelope as a verified user.`,date:new Date(e.created_at)});break;case"recipient:agreed":l.push({icon:"done",message:`${t} agreed to use electronic records and signatures.`,date:new Date(e.created_at)});break;case"recipient:invited":l.push("sms"===e.event_detail?{icon:"textsms",message:`${t} has been invited via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} has been invited via email.`,date:new Date(e.created_at)});break;case"recipient:reminder":l.push("sms"===e.event_detail?{icon:"textsms",message:`${t} sent a reminder via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} sent a reminder via email.`,date:new Date(e.created_at)});break;case"invitation:resent":l.push({icon:"mail",message:`Invitation was resent to ${t}${"reminder"===e.event_detail?" by reminder":""}.`,date:new Date(e.created_at)});break;case"envelope:cc":l.push({icon:"contact_mail",message:`A copy has been sent to ${t}.`,date:new Date(e.created_at)});break;case"recipient:delegated":l.push({icon:"people",message:e.event_detail,date:new Date(e.created_at)});break;case"recipient:updated_info":case"owner:updated_recipient_info":l.push({icon:"perm_identity",message:e.event_detail,date:new Date(e.created_at)});break;case"created":l.push({icon:"create",message:"Envelope was created.",date:new Date(e.created_at)});break;case"completed":l.push({icon:"done_all",message:"Envelope was completed.",date:new Date(e.created_at)});break;case"envelope:canceled":case"envelope_canceled":case"canceled":case"owner:canceled":l.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(e.created_at)});break;case"owner:get_in_person_link":l.push({icon:"link",message:`Owner accessed the In-person link for ${s}.`,date:new Date(e.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",e)}})),l.sort(((e,i)=>i.date.getTime()-e.date.getTime())),l}handleToggleReminders(){return this.remindersEnabled?this.handleSetReminders(null,null):this.handleSetReminders(x,2592e5)}handleSetReminders(e,i){console.log("Updating reminders..."),this.updatingReminders=!0,c(this.endpoint,this.envelopeId,{initial_reminder:e,followup_reminders:i}).then((e=>{console.log("Updated",e),g.updateEnvelope(this.envelopeId,e),this.initialReminder=e.initial_reminder,this.followupReminders=e.followup_reminders,this.remindersEnabled=!!e.initial_reminder,this.updatingReminders=!1})).catch((e=>{var i,s,t;console.log("Error updating envelope",e),this.initialReminder=null===(i=this.envelope)||void 0===i?void 0:i.initial_reminder,this.followupReminders=null===(s=this.envelope)||void 0===s?void 0:s.followup_reminders,this.remindersEnabled=!!(null===(t=this.envelope)||void 0===t?void 0:t.initial_reminder),this.updatingReminders=!1,alert(e.response.data.error)}))}render(){var e,i,o,l,a,r,c,m,w,g,u,y;if(this.loading)return s(n,null);const k=v(this.endpoint.profile,this.envelope),z=this.prepareHistoryEntries(),M="pending"!==(null===(e=this.envelope)||void 0===e?void 0:e.status)&&"in progress"!==(null===(i=this.envelope)||void 0===i?void 0:i.status);return s(n,{class:this.panelOpen?"open":""},s("div",{class:"side-buttons"},s("button",{class:1===this.activeTab?"active":"",onClick:()=>this.setTab(1),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>'}),s("button",{class:2===this.activeTab?"active":"",onClick:()=>this.setTab(2),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>'}),s("button",{class:3===this.activeTab?"active":"",onClick:()=>this.setTab(3),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>'})),1===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Details"),s("div",{class:"label"},"Envelope ID"),s("div",{class:"value"},null===(o=this.envelope)||void 0===o?void 0:o.id),s("div",{class:"label"},"Date Created"),s("div",{class:"value"},b(new Date(null===(l=this.envelope)||void 0===l?void 0:l.created_at),h)),s("div",{class:"label"},"Last Modified"),s("div",{class:"value"},b(new Date(null===(a=this.envelope)||void 0===a?void 0:a.updated_at),h)),s("div",{class:"label"},"Status"),s("div",{class:"value"},p(null===(r=this.envelope)||void 0===r?void 0:r.status)),s("div",{class:"label"},"Owner ID"),s("div",{class:"value"},null===(c=this.envelope)||void 0===c?void 0:c.profile_id),s("div",{class:"label"},"Owner Name"),s("div",{class:"value"},d(null===(m=this.envelope)||void 0===m?void 0:m.profile)),s("div",{class:"label"},"Owner Email"),s("div",{class:"value"},null===(g=null===(w=this.envelope)||void 0===w?void 0:w.profile)||void 0===g?void 0:g.email)),2===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Recipients"),null===(u=this.envelope)||void 0===u?void 0:u.recipients.map(((e,i)=>{const t="submitted"!==e.status&&"canceled"!==e.status&&"declined"!==e.status,n=this.canResendRecipient(e),o=d(e);return s("div",{class:"recipient-detail"},s("div",{class:"recipient-header"},s("div",{class:"recipient-number"},i+1),s("div",{class:"recipient-name"},e.role_name),s("div",{class:{"recipient-status":!0,[e.status]:!0}},e.status),k&&!M&&s("verdocs-dropdown",{onOptionSelected:i=>this.handleRecipientAction(e,i.detail.id),options:[{id:"reminder",label:"Send Reminder",disabled:!n},{id:"inperson",label:"Get In-Person Link",disabled:!t}]})),s("dic",{class:"recipient-content"},s("div",{class:"recipient-name"},o),s("div",{class:"recipient-name"},e.email),s("div",{class:"recipient-name"},e.phone)))})),k&&s("div",{class:"reminders"},s("div",{class:"form-row"},s("div",{class:"reminders-label"},"Reminders"),s("verdocs-switch",{disabled:M||this.updatingReminders,checked:this.remindersEnabled,onCheckedChange:()=>this.handleToggleReminders()})),this.remindersEnabled&&s(t,null,s("div",{class:"form-row"},"NOTE: Reminders will only be sent for up to 14 days."),s("div",{class:"form-row"},s("div",{class:"form-label"},"Initial Reminder (days):"),s("verdocs-text-input",{placeholder:"In hours...",disabled:M||this.updatingReminders,value:String(Math.floor(this.initialReminder/x)),onBlur:e=>{this.initialReminder=Number(e.target.value)*x,this.handleSetReminders(this.initialReminder,this.followupReminders)}})),s("div",{class:"form-row"},s("div",{class:"form-label"},"Follow-up Reminders:"),s("verdocs-text-input",{placeholder:"In hours...",disabled:M||this.updatingReminders,value:String(Math.floor(this.followupReminders/x)),onBlur:e=>{this.followupReminders=Number(e.target.value)*x,this.handleSetReminders(this.initialReminder,this.followupReminders)}})),s("div",{class:"form-row"},s("div",{class:"form-label"},"Next Reminder:"),s("div",{style:{color:"#dddddd"}},b(new Date(null===(y=this.envelope)||void 0===y?void 0:y.next_reminder),"P p"))))),k&&s("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Envelope",onClick:()=>this.showCancelDialog=!M,disabled:M})),3===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"History"),z.map((e=>s("div",{class:"history-entry"},s("div",{class:"activity-icon",innerHTML:f[e.icon]||e.icon}),s("div",{class:"activity-details"},s("div",{class:"activity-text"},e.message),s("div",{class:"activity-date"},b(e.date,h))))))),this.showRecipientDialog&&s("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:()=>this.showRecipientDialog=""}),this.showCancelDialog&&s("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:()=>{this.showCancelDialog=!1,this.handleCancelEnvelope()}}))}};u.style='@-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-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;font-size:14px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:6px;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-name{-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:0 0 100px;flex:0 0 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}verdocs-envelope-sidebar .reminders{margin:15px 0 30px 0}verdocs-envelope-sidebar .reminders .form-row{margin:8px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-sidebar .reminders .form-row .reminders-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row .form-label{-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row verdocs-text-input{margin:0;width:100px}';export{u as verdocs_envelope_sidebar}
1
+ import{r as e,c as i,h as s,F as t,H as n}from"./p-b9654a5e.js";import{VerdocsEndpoint as o,getEnvelope as l,resendInvitation as a,cancelEnvelope as r,formatFullName as d,updateEnvelope as c,userIsEnvelopeOwner as v,capitalize as p}from"@verdocs/js-sdk";import{F as h}from"./p-c7ee88c7.js";import{V as m}from"./p-04c07b7b.js";import{S as w}from"./p-fd97809c.js";import{S as g}from"./p-b712e729.js";import{f as b}from"./p-12bab948.js";const x=864e5,f={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-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.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>'},u=class{constructor(s){e(this,s),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.toggle=i(this,"toggle",7),this.another=i(this,"another",7),this.envelopeListenerId=null,this.endpoint=o.getDefault(),this.envelopeId="",this.activeTab=1,this.panelOpen=!1,this.showRecipientDialog="",this.showCancelDialog=!1,this.remindersEnabled=!1,this.updatingReminders=!1,this.initialReminder=null,this.followupReminders=null,this.loading=!0,this.envelope=null}async componentWillLoad(){var e,i,s;try{if(this.endpoint.loadSession(),!this.envelopeId)return void console.log(`[SIDEBAR] Missing required envelope ID ${this.envelopeId}`);if(!this.endpoint.session)return void console.log("[SIDEBAR] Unable to start session, must be authenticated");this.listenToEnvelope()}catch(t){console.log("[SIDEBAR] Error loading envelope",t),null===(e=this.sdkError)||void 0===e||e.emit(new w(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(s=t.response)||void 0===s?void 0:s.data))}}disconnectedCallback(){this.unlistenToEnvelope()}async listenToEnvelope(){console.log("[SIDEBAR] Loading envelope",this.envelopeId),this.unlistenToEnvelope(),g.subscribe("envelopes",this.envelopeId,(()=>l(this.endpoint,this.envelopeId)),!1,(e=>{var i,s;this.envelope=e,this.loading=!1,this.sortEnvelopeRecipients(),this.initialReminder=null===(i=this.envelope)||void 0===i?void 0:i.initial_reminder,this.followupReminders=null===(s=this.envelope)||void 0===s?void 0:s.followup_reminders,this.remindersEnabled=!!this.initialReminder}))}unlistenToEnvelope(){this.envelopeListenerId&&(g.store.delListener(this.envelopeListenerId),this.envelopeListenerId=null)}sortEnvelopeRecipients(){var e;((null===(e=this.envelope)||void 0===e?void 0:e.recipients)||[]).sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}setTab(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen,null===(i=this.toggle)||void 0===i||i.emit({open:this.panelOpen}),this.activeTab=e}canResendRecipient(e){var i;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes(null===(i=this.envelope)||void 0===i?void 0:i.status)}handleRecipientAction(e,i){var s;switch(console.log("[SIDEBAR] Recipient action",i,e),i){case"reminder":a(this.endpoint,this.envelopeId,e.role_name).then((()=>{m("Reminder Sent",{style:"success"})})).catch((e=>{console.log("[SIDEBAR] Error resending invitation",e),m("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":case"details":m("This feature will be enabled in a future release. Please try again later.",{style:"info"})}null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:i})}handleCancelEnvelope(){this.loading=!0,r(this.endpoint,this.envelopeId).then((async e=>{var i;console.log("[SIDEBAR] Envelope canceled",e),m("Envelope canceled",{style:"success"});const s=JSON.parse(JSON.stringify(this.envelope));s.status="canceled",g.updateEnvelope(this.envelopeId,s),this.loading=!1,this.panelOpen=!1,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:s,event:"canceled"})})).catch((e=>{console.log("[SIDEBAR] Error canceling envelope",e),this.loading=!1,m("Error canceling envelope: "+e.message,{style:"error"})}))}prepareHistoryEntries(){var e,i,s,t,n,o;const l=[],a=(null===(e=this.envelope)||void 0===e?void 0:e.history_entries)||[];l.push({icon:"pencil",message:"Envelope created.",date:new Date(null===(i=this.envelope)||void 0===i?void 0:i.created_at)}),"complete"===(null===(s=this.envelope)||void 0===s?void 0:s.status)&&l.push({icon:"pencil",message:"Envelope completed.",date:new Date(null===(t=this.envelope)||void 0===t?void 0:t.updated_at)});const r=a.some((e=>"owner:canceled"===e.event));return"canceled"!==(null===(n=this.envelope)||void 0===n?void 0:n.status)||r||l.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date(null===(o=this.envelope)||void 0===o?void 0:o.canceled_at)}),a.forEach((e=>{var i;const s=((null===(i=this.envelope)||void 0===i?void 0:i.recipients)||[]).find((i=>i.role_name===e.role_name)),t=d(s);switch(e.event.toLowerCase()){case"recipient:signed":l.push({icon:"gesture",message:`Signed by ${t}.`,date:new Date(e.created_at)});break;case"recipient:declined":l.push({icon:"clear",message:`Declined by ${t}.`,date:new Date(e.created_at)});break;case"recipient:opened":switch(e.event_detail){case"email":case"mail":l.push({icon:"visibility",message:`Opened by ${t}, via email.`,date:new Date(e.created_at)});break;case"sms":l.push({icon:"visibility",message:`Opened by ${t}, via SMS.`,date:new Date(e.created_at)});break;case"in_person_link":l.push({icon:"visibility",message:`Opened by ${t}, via In-person link.`,date:new Date(e.created_at)});break;case"in_app":l.push({icon:"visibility",message:`Opened by ${t}, via dashboard.`,date:new Date(e.created_at)});break;default:l.push({icon:"visibility",message:`Opened by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:submitted":l.push("approver"===e.event_detail?{icon:"check_circle",message:`Approved by ${t}.`,date:new Date(e.created_at)}:{icon:"send",message:`Submitted by ${t}.`,date:new Date(e.created_at)});break;case"recipient:prepared":l.push({icon:"send",message:`Prepared by ${t}.`,date:new Date(e.created_at)});break;case"recipient:claimed":"guest"===e.event_detail?l.push({icon:"account_circle",message:`${t} claimed the Envelope as a guest.`,date:new Date(e.created_at)}):"profile"===e.event_detail&&l.push({icon:"verified_user",message:`${t} claimed the Envelope as a verified user.`,date:new Date(e.created_at)});break;case"recipient:agreed":l.push({icon:"done",message:`${t} agreed to use electronic records and signatures.`,date:new Date(e.created_at)});break;case"recipient:invited":l.push("sms"===e.event_detail?{icon:"textsms",message:`${t} has been invited via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} has been invited via email.`,date:new Date(e.created_at)});break;case"recipient:reminder":l.push("sms"===e.event_detail?{icon:"textsms",message:`${t} sent a reminder via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} sent a reminder via email.`,date:new Date(e.created_at)});break;case"invitation:resent":l.push({icon:"mail",message:`Invitation was resent to ${t}${"reminder"===e.event_detail?" by reminder":""}.`,date:new Date(e.created_at)});break;case"envelope:cc":l.push({icon:"contact_mail",message:`A copy has been sent to ${t}.`,date:new Date(e.created_at)});break;case"recipient:delegated":l.push({icon:"people",message:e.event_detail,date:new Date(e.created_at)});break;case"recipient:updated_info":case"owner:updated_recipient_info":l.push({icon:"perm_identity",message:e.event_detail,date:new Date(e.created_at)});break;case"created":l.push({icon:"create",message:"Envelope was created.",date:new Date(e.created_at)});break;case"completed":l.push({icon:"done_all",message:"Envelope was completed.",date:new Date(e.created_at)});break;case"envelope:canceled":case"envelope_canceled":case"canceled":case"owner:canceled":l.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(e.created_at)});break;case"owner:get_in_person_link":l.push({icon:"link",message:`Owner accessed the In-person link for ${s}.`,date:new Date(e.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",e)}})),l.sort(((e,i)=>i.date.getTime()-e.date.getTime())),l}handleToggleReminders(){return this.remindersEnabled?this.handleSetReminders(null,null):this.handleSetReminders(x,2592e5)}handleSetReminders(e,i){console.log("Updating reminders..."),this.updatingReminders=!0,c(this.endpoint,this.envelopeId,{initial_reminder:e,followup_reminders:i}).then((e=>{console.log("Updated",e),g.updateEnvelope(this.envelopeId,e),this.initialReminder=e.initial_reminder,this.followupReminders=e.followup_reminders,this.remindersEnabled=!!e.initial_reminder,this.updatingReminders=!1})).catch((e=>{var i,s,t;console.log("Error updating envelope",e),this.initialReminder=null===(i=this.envelope)||void 0===i?void 0:i.initial_reminder,this.followupReminders=null===(s=this.envelope)||void 0===s?void 0:s.followup_reminders,this.remindersEnabled=!!(null===(t=this.envelope)||void 0===t?void 0:t.initial_reminder),this.updatingReminders=!1,alert(e.response.data.error)}))}render(){var e,i,o,l,a,r,c,m,w,g,u,y;if(this.loading)return s(n,null);const k=v(this.endpoint.profile,this.envelope),z=this.prepareHistoryEntries(),M="pending"!==(null===(e=this.envelope)||void 0===e?void 0:e.status)&&"in progress"!==(null===(i=this.envelope)||void 0===i?void 0:i.status);return s(n,{class:this.panelOpen?"open":""},s("div",{class:"side-buttons"},s("button",{class:1===this.activeTab?"active":"",onClick:()=>this.setTab(1),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>'}),s("button",{class:2===this.activeTab?"active":"",onClick:()=>this.setTab(2),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>'}),s("button",{class:3===this.activeTab?"active":"",onClick:()=>this.setTab(3),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>'})),1===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Details"),s("div",{class:"label"},"Envelope ID"),s("div",{class:"value"},null===(o=this.envelope)||void 0===o?void 0:o.id),s("div",{class:"label"},"Date Created"),s("div",{class:"value"},b(new Date(null===(l=this.envelope)||void 0===l?void 0:l.created_at),h)),s("div",{class:"label"},"Last Modified"),s("div",{class:"value"},b(new Date(null===(a=this.envelope)||void 0===a?void 0:a.updated_at),h)),s("div",{class:"label"},"Status"),s("div",{class:"value"},p(null===(r=this.envelope)||void 0===r?void 0:r.status)),s("div",{class:"label"},"Owner ID"),s("div",{class:"value"},null===(c=this.envelope)||void 0===c?void 0:c.profile_id),s("div",{class:"label"},"Owner Name"),s("div",{class:"value"},d(null===(m=this.envelope)||void 0===m?void 0:m.profile)),s("div",{class:"label"},"Owner Email"),s("div",{class:"value"},null===(g=null===(w=this.envelope)||void 0===w?void 0:w.profile)||void 0===g?void 0:g.email)),2===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Recipients"),null===(u=this.envelope)||void 0===u?void 0:u.recipients.map(((e,i)=>{const t="submitted"!==e.status&&"canceled"!==e.status&&"declined"!==e.status,n=this.canResendRecipient(e),o=d(e);return s("div",{class:"recipient-detail"},s("div",{class:"recipient-header"},s("div",{class:"recipient-number"},i+1),s("div",{class:"recipient-name"},e.role_name),s("div",{class:{"recipient-status":!0,[e.status]:!0}},e.status),k&&!M&&s("verdocs-dropdown",{onOptionSelected:i=>this.handleRecipientAction(e,i.detail.id),options:[{id:"reminder",label:"Send Reminder",disabled:!n},{id:"inperson",label:"Get In-Person Link",disabled:!t}]})),s("dic",{class:"recipient-content"},s("div",{class:"recipient-name"},o),s("div",{class:"recipient-name"},e.email),s("div",{class:"recipient-name"},e.phone)))})),k&&s("div",{class:"reminders"},s("div",{class:"form-row"},s("div",{class:"reminders-label"},"Reminders"),s("verdocs-switch",{disabled:M||this.updatingReminders,checked:this.remindersEnabled,onCheckedChange:()=>this.handleToggleReminders()})),this.remindersEnabled&&s(t,null,s("div",{class:"form-row"},"NOTE: Reminders will only be sent for up to 14 days."),s("div",{class:"form-row"},s("div",{class:"form-label"},"Initial Reminder (days):"),s("verdocs-text-input",{placeholder:"In hours...",disabled:M||this.updatingReminders,value:String(Math.floor(this.initialReminder/x)),onBlur:e=>{this.initialReminder=Number(e.target.value)*x,this.handleSetReminders(this.initialReminder,this.followupReminders)}})),s("div",{class:"form-row"},s("div",{class:"form-label"},"Follow-up Reminders:"),s("verdocs-text-input",{placeholder:"In hours...",disabled:M||this.updatingReminders,value:String(Math.floor(this.followupReminders/x)),onBlur:e=>{this.followupReminders=Number(e.target.value)*x,this.handleSetReminders(this.initialReminder,this.followupReminders)}})),s("div",{class:"form-row"},s("div",{class:"form-label"},"Next Reminder:"),s("div",{style:{color:"#dddddd"}},b(new Date(null===(y=this.envelope)||void 0===y?void 0:y.next_reminder),"P p"))))),k&&s("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Envelope",onClick:()=>this.showCancelDialog=!M,disabled:M})),3===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"History"),z.map((e=>s("div",{class:"history-entry"},s("div",{class:"activity-icon",innerHTML:f[e.icon]||e.icon}),s("div",{class:"activity-details"},s("div",{class:"activity-text"},e.message),s("div",{class:"activity-date"},b(e.date,h))))))),this.showRecipientDialog&&s("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:()=>this.showRecipientDialog=""}),this.showCancelDialog&&s("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:()=>{this.showCancelDialog=!1,this.handleCancelEnvelope()}}))}};u.style='@-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-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;font-size:14px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:6px;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-name{-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:0 0 100px;flex:0 0 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}verdocs-envelope-sidebar .reminders{margin:15px 0 30px 0}verdocs-envelope-sidebar .reminders .form-row{margin:8px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-sidebar .reminders .form-row .reminders-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row .form-label{-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row verdocs-text-input{margin:0;width:100px}';export{u as verdocs_envelope_sidebar}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):r(t.value).then(o,a)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return c([t,e])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=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=e.call(t,i)}catch(t){a=[6,t];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-736a2c41.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js","./p-2c5350ec.system.js"],(function(t){"use strict";var e,i,n,r,s,o,a,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;s=t.g},function(t){o=t.VerdocsEndpoint;a=t.getEnvelopeDocumentPageDisplayUri},function(t){c=t.t},function(){},function(){},function(){}],execute:function(){var u="@-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-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var h=u;var d=t("verdocs_envelope_document_page",function(){function t(t){e(this,t);this.pageRendered=i(this,"pageRendered",7);this.endpoint=o.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,a(this.endpoint,this.documentId,this.pageNumber,this.type)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(c((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];var s=r.contentRect.width;t.renderedWidth=s;t.renderedHeight=t.virtualHeight*(s/t.virtualWidth)}t.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};t.prototype.render=function(){var t=this;var e="".concat(this.renderedHeight,"px");return n(r,{key:"219a7af5090d897342b5013084a0ee40d2336d83",id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(t.containerId,"-").concat(i.name),src:t.pageDisplayUri,alt:"Page ".concat(t.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(e){t.naturalWidth=e.target.naturalWidth;t.naturalHeight=e.target.naturalHeight;t.aspectRatio=t.naturalWidth/t.naturalHeight;t.virtualHeight=t.virtualWidth/t.aspectRatio;t.renderedHeight=e.target.offsetWidth/t.aspectRatio}}):n("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());d.style=h}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n["throw"](e))}catch(e){s(e)}}function c(e){e.done?i(e.value):r(e.value).then(o,a)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=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{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-736a2c41.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js","./p-2c5350ec.system.js"],(function(e){"use strict";var t,i,n,r,s,o,a,c;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g},function(e){o=e.VerdocsEndpoint;a=e.getEnvelopeDocumentPageDisplayUri},function(e){c=e.t},function(){},function(){},function(){}],execute:function(){var u="@-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-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var h=u;var d=e("verdocs_envelope_document_page",function(){function e(e){t(this,e);this.pageRendered=i(this,"pageRendered",7);this.endpoint=o.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,a(this.endpoint,this.documentId,this.pageNumber,this.type)];case 1:e.pageDisplayUri=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(c((function(t){for(var i=0,n=t;i<n.length;i++){var r=n[i];var s=r.contentRect.width;e.renderedWidth=s;e.renderedHeight=e.virtualHeight*(s/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return n(r,{key:"d461f16d93680ee69b93258d9985e7e24599acbd",id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}}):e.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):n("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());d.style=h}}}));