@verdocs/web-sdk 5.0.75 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/dist/cjs/{Datastore-Dn_pL6x4.js → Datastore-CIzsoGWH.js} +7 -6
  2. package/dist/cjs/Datastore-CIzsoGWH.js.map +1 -0
  3. package/dist/cjs/index-Be9PlTB7.js +10 -10
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
  7. package/dist/cjs/verdocs-build.entry.cjs.js.map +1 -1
  8. package/dist/cjs/verdocs-button.verdocs-help-icon.verdocs-text-input.entry.cjs.js.map +1 -0
  9. package/dist/cjs/verdocs-button_3.cjs.entry.js +177 -0
  10. package/dist/cjs/verdocs-button_3.cjs.entry.js.map +1 -0
  11. package/dist/cjs/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.cjs.js.map +1 -0
  12. package/dist/cjs/{verdocs-checkbox_6.cjs.entry.js → verdocs-checkbox_5.cjs.entry.js} +3 -91
  13. package/dist/{verdocs-web-sdk/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.verdocs-text-input.entry.esm.js.map → cjs/verdocs-checkbox_5.cjs.entry.js.map} +1 -1
  14. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +7 -3
  15. package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
  16. package/dist/cjs/verdocs-contact-picker.entry.cjs.js.map +1 -1
  17. package/dist/cjs/verdocs-envelope-recipient-link.verdocs-envelope-update-recipient.entry.cjs.js.map +1 -0
  18. package/dist/cjs/{verdocs-envelope-recipient-link.cjs.entry.js → verdocs-envelope-recipient-link_2.cjs.entry.js} +91 -4
  19. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js.map +1 -0
  20. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +51 -1
  22. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js.map +1 -1
  23. package/dist/cjs/verdocs-envelope-sidebar.entry.cjs.js.map +1 -1
  24. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
  26. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-kba-dialog_3.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map +1 -1
  30. package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -3
  31. package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
  32. package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-radio-button.cjs.entry.js.map +1 -1
  34. package/dist/cjs/verdocs-radio-button.entry.cjs.js.map +1 -1
  35. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  37. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.css +2 -2
  40. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +4 -4
  41. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
  42. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +8 -10
  43. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  44. package/dist/collection/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.js +1 -1
  45. package/dist/collection/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.js.map +1 -1
  46. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +52 -0
  47. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js.map +1 -1
  48. package/dist/collection/components/envelopes/verdocs-envelope-update-recipient/verdocs-envelope-update-recipient.css +96 -0
  49. package/dist/collection/components/envelopes/verdocs-envelope-update-recipient/verdocs-envelope-update-recipient.js +224 -0
  50. package/dist/collection/components/envelopes/verdocs-envelope-update-recipient/verdocs-envelope-update-recipient.js.map +1 -0
  51. package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.css +2 -2
  52. package/dist/collection/utils/Datastore.js +2 -2
  53. package/dist/collection/utils/Datastore.js.map +1 -1
  54. package/dist/components/index.js +2 -0
  55. package/dist/components/index.js.map +1 -1
  56. package/dist/components/{p-CWHHlD3o.js → p-B3jMBr0M.js} +9 -5
  57. package/dist/components/p-B3jMBr0M.js.map +1 -0
  58. package/dist/components/{p-Cn4wVEX4.js → p-B8nK0hJl.js} +4 -4
  59. package/dist/components/{p-Cn4wVEX4.js.map → p-B8nK0hJl.js.map} +1 -1
  60. package/dist/components/{p-DgfjnZPa.js → p-BGMd4wA7.js} +4 -4
  61. package/dist/components/{p-DgfjnZPa.js.map → p-BGMd4wA7.js.map} +1 -1
  62. package/dist/components/{p-03kDzdlZ.js → p-BHKb3X7a.js} +3 -3
  63. package/dist/components/{p-03kDzdlZ.js.map → p-BHKb3X7a.js.map} +1 -1
  64. package/dist/components/{p-CqQzEyUV.js → p-Bb2F00K4.js} +4 -4
  65. package/dist/components/{p-CqQzEyUV.js.map → p-Bb2F00K4.js.map} +1 -1
  66. package/dist/components/{p-z0ZD30Bi.js → p-BwIyL1sF.js} +4 -4
  67. package/dist/components/{p-z0ZD30Bi.js.map → p-BwIyL1sF.js.map} +1 -1
  68. package/dist/components/{p-Dw5jTBu3.js → p-C2Fb8G6A.js} +4 -4
  69. package/dist/components/{p-Dw5jTBu3.js.map → p-C2Fb8G6A.js.map} +1 -1
  70. package/dist/components/{p-IcjPGPO7.js → p-CPRS8f3I.js} +3 -3
  71. package/dist/components/{p-IcjPGPO7.js.map → p-CPRS8f3I.js.map} +1 -1
  72. package/dist/components/{p-CNJfehtH.js → p-Crehnwtj.js} +4 -4
  73. package/dist/components/{p-CNJfehtH.js.map → p-Crehnwtj.js.map} +1 -1
  74. package/dist/components/{p-B8HdsDVX.js → p-CunjhIft.js} +3 -3
  75. package/dist/components/{p-B8HdsDVX.js.map → p-CunjhIft.js.map} +1 -1
  76. package/dist/components/{p-CDTU_UJD.js → p-D3n1gA61.js} +5 -5
  77. package/dist/components/p-D3n1gA61.js.map +1 -0
  78. package/dist/components/{p-iwNYe5a0.js → p-DB-CFkUZ.js} +4 -4
  79. package/dist/components/{p-iwNYe5a0.js.map → p-DB-CFkUZ.js.map} +1 -1
  80. package/dist/components/{p-Cue-TDgY.js → p-DDAZR40U.js} +3 -3
  81. package/dist/components/{p-Cue-TDgY.js.map → p-DDAZR40U.js.map} +1 -1
  82. package/dist/components/{p-Cfx8TNcj.js → p-DGRiUZlM.js} +15 -15
  83. package/dist/components/{p-Cfx8TNcj.js.map → p-DGRiUZlM.js.map} +1 -1
  84. package/dist/components/{p-CpHTrnj5.js → p-DGiDigbo.js} +4 -6
  85. package/dist/components/p-DGiDigbo.js.map +1 -0
  86. package/dist/components/{p-B6IuryK-.js → p-DQh221R1.js} +4 -4
  87. package/dist/components/{p-B6IuryK-.js.map → p-DQh221R1.js.map} +1 -1
  88. package/dist/components/{p-BPEZpcEQ.js → p-D_x2HuZp.js} +4 -4
  89. package/dist/components/{p-BPEZpcEQ.js.map → p-D_x2HuZp.js.map} +1 -1
  90. package/dist/components/{p-C_IIZj49.js → p-DmsV595e.js} +8 -7
  91. package/dist/components/p-DmsV595e.js.map +1 -0
  92. package/dist/components/p-GUGCYQ6F.js +138 -0
  93. package/dist/components/p-GUGCYQ6F.js.map +1 -0
  94. package/dist/components/{p-De7UWCgq.js → p-WhDWrMQm.js} +4 -4
  95. package/dist/components/{p-De7UWCgq.js.map → p-WhDWrMQm.js.map} +1 -1
  96. package/dist/components/{p-iOb94GB3.js → p-X6ujIO0j.js} +3 -3
  97. package/dist/components/{p-iOb94GB3.js.map → p-X6ujIO0j.js.map} +1 -1
  98. package/dist/components/{p-B6hVXdpp.js → p-XHSVTLB0.js} +4 -4
  99. package/dist/components/{p-B6hVXdpp.js.map → p-XHSVTLB0.js.map} +1 -1
  100. package/dist/components/{p-C3_yeGdH.js → p-dIi8HYZ5.js} +3 -3
  101. package/dist/components/{p-C3_yeGdH.js.map → p-dIi8HYZ5.js.map} +1 -1
  102. package/dist/components/{p-eiHT7SZQ.js → p-kaKbklxN.js} +15 -15
  103. package/dist/components/{p-eiHT7SZQ.js.map → p-kaKbklxN.js.map} +1 -1
  104. package/dist/components/{p-BqWxusTA.js → p-ke4RFlpQ.js} +14 -14
  105. package/dist/components/{p-BqWxusTA.js.map → p-ke4RFlpQ.js.map} +1 -1
  106. package/dist/components/verdocs-build.js +22 -22
  107. package/dist/components/verdocs-build.js.map +1 -1
  108. package/dist/components/verdocs-contact-picker.js +1 -1
  109. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  110. package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
  111. package/dist/components/verdocs-envelope-sidebar.js +65 -8
  112. package/dist/components/verdocs-envelope-sidebar.js.map +1 -1
  113. package/dist/components/verdocs-envelope-update-recipient.d.ts +11 -0
  114. package/dist/components/verdocs-envelope-update-recipient.js +9 -0
  115. package/dist/components/verdocs-envelope-update-recipient.js.map +1 -0
  116. package/dist/components/verdocs-field-attachment.js +1 -1
  117. package/dist/components/verdocs-field-checkbox.js +1 -1
  118. package/dist/components/verdocs-field-date.js +1 -1
  119. package/dist/components/verdocs-field-dropdown.js +1 -1
  120. package/dist/components/verdocs-field-initial.js +1 -1
  121. package/dist/components/verdocs-field-payment.js +2 -2
  122. package/dist/components/verdocs-field-radio.js +1 -1
  123. package/dist/components/verdocs-field-signature.js +1 -1
  124. package/dist/components/verdocs-field-textarea.js +1 -1
  125. package/dist/components/verdocs-field-textbox.js +1 -1
  126. package/dist/components/verdocs-field-timestamp.js +1 -1
  127. package/dist/components/verdocs-preview.js +1 -1
  128. package/dist/components/verdocs-radio-button.js +1 -1
  129. package/dist/components/verdocs-radio-button.js.map +1 -1
  130. package/dist/components/verdocs-send.js +1 -1
  131. package/dist/components/verdocs-sign.js +2 -2
  132. package/dist/components/verdocs-template-attachments.js +1 -1
  133. package/dist/components/verdocs-template-build-tabs.js +1 -1
  134. package/dist/components/verdocs-template-document-page.js +1 -1
  135. package/dist/components/verdocs-template-field-properties.js +1 -1
  136. package/dist/components/verdocs-template-fields.js +1 -1
  137. package/dist/components/verdocs-template-role-properties.js +1 -1
  138. package/dist/components/verdocs-template-roles.js +1 -1
  139. package/dist/components/verdocs-template-settings.js +1 -1
  140. package/dist/components/verdocs-view.js +1 -1
  141. package/dist/custom-elements.json +21 -0
  142. package/dist/esm/{Datastore-C_IIZj49.js → Datastore-DmsV595e.js} +8 -7
  143. package/dist/esm/Datastore-DmsV595e.js.map +1 -0
  144. package/dist/esm/index-CF7i8guW.js +10 -10
  145. package/dist/esm/loader.js +1 -1
  146. package/dist/esm/verdocs-build.entry.js +1 -1
  147. package/dist/esm/verdocs-build.entry.js.map +1 -1
  148. package/dist/esm/verdocs-button.verdocs-help-icon.verdocs-text-input.entry.js.map +1 -0
  149. package/dist/esm/verdocs-button_3.entry.js +173 -0
  150. package/dist/esm/verdocs-button_3.entry.js.map +1 -0
  151. package/dist/esm/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -0
  152. package/dist/esm/{verdocs-checkbox_6.entry.js → verdocs-checkbox_5.entry.js} +4 -91
  153. package/dist/esm/verdocs-checkbox_5.entry.js.map +1 -0
  154. package/dist/esm/verdocs-contact-picker.entry.js +7 -3
  155. package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
  156. package/dist/esm/verdocs-envelope-recipient-link.verdocs-envelope-update-recipient.entry.js.map +1 -0
  157. package/dist/esm/{verdocs-envelope-recipient-link.entry.js → verdocs-envelope-recipient-link_2.entry.js} +91 -5
  158. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js.map +1 -0
  159. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  160. package/dist/esm/verdocs-envelope-sidebar.entry.js +52 -2
  161. package/dist/esm/verdocs-envelope-sidebar.entry.js.map +1 -1
  162. package/dist/esm/verdocs-field-attachment_13.entry.js +2 -2
  163. package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
  164. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  165. package/dist/esm/verdocs-kba-dialog_3.entry.js +1 -1
  166. package/dist/esm/verdocs-menu-panel_2.entry.js +1 -1
  167. package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
  168. package/dist/esm/verdocs-preview_7.entry.js +1 -3
  169. package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
  170. package/dist/esm/verdocs-radio-button.entry.js +1 -1
  171. package/dist/esm/verdocs-radio-button.entry.js.map +1 -1
  172. package/dist/esm/verdocs-sign.entry.js +1 -1
  173. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  174. package/dist/esm/verdocs-web-sdk.js +1 -1
  175. package/dist/esm-es5/Datastore-DmsV595e.js +2 -0
  176. package/dist/esm-es5/Datastore-DmsV595e.js.map +1 -0
  177. package/dist/esm-es5/index-CF7i8guW.js +1 -1
  178. package/dist/esm-es5/loader.js +1 -1
  179. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  180. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  181. package/dist/esm-es5/verdocs-button.verdocs-help-icon.verdocs-text-input.entry.js.map +1 -0
  182. package/dist/esm-es5/verdocs-button_3.entry.js +2 -0
  183. package/dist/esm-es5/verdocs-button_3.entry.js.map +1 -0
  184. package/dist/esm-es5/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -0
  185. package/dist/esm-es5/verdocs-checkbox_5.entry.js +2 -0
  186. package/dist/esm-es5/verdocs-checkbox_5.entry.js.map +1 -0
  187. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  188. package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
  189. package/dist/esm-es5/verdocs-envelope-recipient-link.verdocs-envelope-update-recipient.entry.js.map +1 -0
  190. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +2 -0
  191. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js.map +1 -0
  192. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  193. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  194. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js.map +1 -1
  195. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  196. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  197. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  198. package/dist/esm-es5/verdocs-kba-dialog_3.entry.js +1 -1
  199. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  200. package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
  201. package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
  202. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
  203. package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
  204. package/dist/esm-es5/verdocs-radio-button.entry.js.map +1 -1
  205. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  206. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  207. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  208. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +2 -2
  209. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +3 -3
  210. package/dist/types/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.d.ts +3 -1
  211. package/dist/types/components/envelopes/verdocs-envelope-update-recipient/verdocs-envelope-update-recipient.d.ts +50 -0
  212. package/dist/types/components.d.ts +85 -8
  213. package/dist/types/utils/Datastore.d.ts +1 -1
  214. package/dist/verdocs-web-sdk/{p-a2ba1316.system.entry.js → p-0134d663.system.entry.js} +2 -2
  215. package/dist/verdocs-web-sdk/p-0134d663.system.entry.js.map +1 -0
  216. package/dist/verdocs-web-sdk/p-1c66bd2c.system.entry.js +2 -0
  217. package/dist/verdocs-web-sdk/p-1c66bd2c.system.entry.js.map +1 -0
  218. package/dist/verdocs-web-sdk/p-3aabadbe.entry.js +2 -0
  219. package/dist/verdocs-web-sdk/{p-0bb8015d.entry.js.map → p-3aabadbe.entry.js.map} +1 -1
  220. package/dist/verdocs-web-sdk/{p-1653b309.system.entry.js → p-4175122c.system.entry.js} +3 -3
  221. package/dist/verdocs-web-sdk/p-4175122c.system.entry.js.map +1 -0
  222. package/dist/verdocs-web-sdk/{p-c8369ea0.entry.js → p-45f59906.entry.js} +2 -2
  223. package/dist/verdocs-web-sdk/p-48299322.entry.js +2 -0
  224. package/dist/verdocs-web-sdk/p-48299322.entry.js.map +1 -0
  225. package/dist/verdocs-web-sdk/{p-4b2b090e.entry.js → p-49522ebb.entry.js} +2 -2
  226. package/dist/verdocs-web-sdk/p-49522ebb.entry.js.map +1 -0
  227. package/dist/verdocs-web-sdk/p-50c4a3da.system.entry.js +2 -0
  228. package/dist/verdocs-web-sdk/p-50c4a3da.system.entry.js.map +1 -0
  229. package/dist/verdocs-web-sdk/{p-1d0463ad.system.entry.js → p-65a5d2d4.system.entry.js} +2 -2
  230. package/dist/verdocs-web-sdk/p-69c97fa9.system.entry.js +4 -0
  231. package/dist/verdocs-web-sdk/p-69c97fa9.system.entry.js.map +1 -0
  232. package/dist/verdocs-web-sdk/p-759b5749.entry.js +2 -0
  233. package/dist/verdocs-web-sdk/p-759b5749.entry.js.map +1 -0
  234. package/dist/verdocs-web-sdk/{p-894e2058.entry.js → p-76215a73.entry.js} +2 -2
  235. package/dist/verdocs-web-sdk/{p-caf258c9.entry.js → p-791184e5.entry.js} +2 -2
  236. package/dist/verdocs-web-sdk/p-791184e5.entry.js.map +1 -0
  237. package/dist/verdocs-web-sdk/p-832e4346.entry.js +2 -0
  238. package/dist/verdocs-web-sdk/p-832e4346.entry.js.map +1 -0
  239. package/dist/verdocs-web-sdk/{p-821becae.system.entry.js → p-8c98a765.system.entry.js} +2 -2
  240. package/dist/verdocs-web-sdk/p-9f4c393c.system.entry.js +2 -0
  241. package/dist/verdocs-web-sdk/p-9f4c393c.system.entry.js.map +1 -0
  242. package/dist/verdocs-web-sdk/p-BH-YVoIR.system.js.map +1 -0
  243. package/dist/verdocs-web-sdk/p-BXdHDPn2.system.js.map +1 -0
  244. package/dist/verdocs-web-sdk/p-BsWaGIkx.system.js.map +1 -0
  245. package/dist/verdocs-web-sdk/p-C2JOLTNG.system.js.map +1 -0
  246. package/dist/verdocs-web-sdk/{p-CWs7NRzr.system.js.map → p-CC3tLap5.system.js.map} +1 -1
  247. package/dist/verdocs-web-sdk/{p-DZurf5no.system.js.map → p-CYHTkSId.system.js.map} +1 -1
  248. package/dist/verdocs-web-sdk/p-CmnBGerV.system.js +2 -0
  249. package/dist/verdocs-web-sdk/p-CmnBGerV.system.js.map +1 -0
  250. package/dist/verdocs-web-sdk/p-CwXSduhy.system.js +1 -1
  251. package/dist/verdocs-web-sdk/{p-Cz3XayQm.system.js.map → p-CzcrfRov.system.js.map} +1 -1
  252. package/dist/verdocs-web-sdk/p-Czs72bg4.system.js.map +1 -0
  253. package/dist/verdocs-web-sdk/p-DAWcoDTu.system.js.map +1 -0
  254. package/dist/verdocs-web-sdk/{p-DRzyvgiA.system.js.map → p-DM4F2Fmu.system.js.map} +1 -1
  255. package/dist/verdocs-web-sdk/p-DOuKoKCI.system.js.map +1 -0
  256. package/dist/verdocs-web-sdk/{p-DKkhksIM.system.js.map → p-DR2NwM3E.system.js.map} +1 -1
  257. package/dist/verdocs-web-sdk/p-DmsV595e.js +2 -0
  258. package/dist/verdocs-web-sdk/p-DmsV595e.js.map +1 -0
  259. package/dist/verdocs-web-sdk/p-DyIimYwQ.system.js.map +1 -0
  260. package/dist/verdocs-web-sdk/{p-DjtXr8Iv.system.js.map → p-QrafNGv0.system.js.map} +1 -1
  261. package/dist/verdocs-web-sdk/{p-e5f90a18.system.entry.js → p-a224a4cc.system.entry.js} +2 -2
  262. package/dist/verdocs-web-sdk/{p-6d8c780d.system.entry.js → p-a37e8f84.system.entry.js} +2 -2
  263. package/dist/verdocs-web-sdk/{p-d16c03d8.system.entry.js → p-ac05c34d.system.entry.js} +2 -2
  264. package/dist/verdocs-web-sdk/p-ac60c75d.entry.js +2 -0
  265. package/dist/verdocs-web-sdk/p-ac60c75d.entry.js.map +1 -0
  266. package/dist/verdocs-web-sdk/{p-524c1693.system.entry.js → p-bec52dd1.system.entry.js} +2 -2
  267. package/dist/verdocs-web-sdk/p-c16b24c0.system.entry.js +2 -0
  268. package/dist/verdocs-web-sdk/p-c16b24c0.system.entry.js.map +1 -0
  269. package/dist/verdocs-web-sdk/{p-5d4a9e54.entry.js → p-d0b7bbc5.entry.js} +3 -3
  270. package/dist/verdocs-web-sdk/p-d0b7bbc5.entry.js.map +1 -0
  271. package/dist/verdocs-web-sdk/{p-bb96a9af.entry.js → p-d8b36d95.entry.js} +2 -2
  272. package/dist/verdocs-web-sdk/{p-5355587b.entry.js → p-e15b7c92.entry.js} +2 -2
  273. package/dist/verdocs-web-sdk/{p-a231248c.system.entry.js → p-e63c903a.system.entry.js} +2 -2
  274. package/dist/verdocs-web-sdk/p-e63c903a.system.entry.js.map +1 -0
  275. package/dist/verdocs-web-sdk/p-e8713631.entry.js +3 -0
  276. package/dist/verdocs-web-sdk/p-e8713631.entry.js.map +1 -0
  277. package/dist/verdocs-web-sdk/{p-3b68bc50.entry.js → p-f28a1014.entry.js} +2 -2
  278. package/dist/verdocs-web-sdk/p-f28a1014.entry.js.map +1 -0
  279. package/dist/verdocs-web-sdk/{p-bde78dab.system.entry.js → p-f4a3d054.system.entry.js} +2 -2
  280. package/dist/verdocs-web-sdk/p-f4a3d054.system.entry.js.map +1 -0
  281. package/dist/verdocs-web-sdk/{p-65f4a435.entry.js → p-fb00149a.entry.js} +2 -2
  282. package/dist/verdocs-web-sdk/p-fih-g25U.system.js.map +1 -0
  283. package/dist/verdocs-web-sdk/verdocs-build.entry.esm.js.map +1 -1
  284. package/dist/verdocs-web-sdk/verdocs-button.verdocs-help-icon.verdocs-text-input.entry.esm.js.map +1 -0
  285. package/dist/verdocs-web-sdk/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.esm.js.map +1 -0
  286. package/dist/verdocs-web-sdk/verdocs-contact-picker.entry.esm.js.map +1 -1
  287. package/dist/verdocs-web-sdk/verdocs-envelope-recipient-link.verdocs-envelope-update-recipient.entry.esm.js.map +1 -0
  288. package/dist/verdocs-web-sdk/verdocs-envelope-sidebar.entry.esm.js.map +1 -1
  289. package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.esm.js.map +1 -1
  290. package/dist/verdocs-web-sdk/verdocs-radio-button.entry.esm.js.map +1 -1
  291. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  292. package/package.json +3 -3
  293. package/dist/cjs/Datastore-Dn_pL6x4.js.map +0 -1
  294. package/dist/cjs/verdocs-button.verdocs-help-icon.entry.cjs.js.map +0 -1
  295. package/dist/cjs/verdocs-button_2.cjs.entry.js +0 -89
  296. package/dist/cjs/verdocs-button_2.cjs.entry.js.map +0 -1
  297. package/dist/cjs/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.verdocs-text-input.entry.cjs.js.map +0 -1
  298. package/dist/cjs/verdocs-checkbox_6.cjs.entry.js.map +0 -1
  299. package/dist/cjs/verdocs-envelope-recipient-link.cjs.entry.js.map +0 -1
  300. package/dist/cjs/verdocs-envelope-recipient-link.entry.cjs.js.map +0 -1
  301. package/dist/components/p-CDTU_UJD.js.map +0 -1
  302. package/dist/components/p-CWHHlD3o.js.map +0 -1
  303. package/dist/components/p-C_IIZj49.js.map +0 -1
  304. package/dist/components/p-CpHTrnj5.js.map +0 -1
  305. package/dist/esm/Datastore-C_IIZj49.js.map +0 -1
  306. package/dist/esm/verdocs-button.verdocs-help-icon.entry.js.map +0 -1
  307. package/dist/esm/verdocs-button_2.entry.js +0 -86
  308. package/dist/esm/verdocs-button_2.entry.js.map +0 -1
  309. package/dist/esm/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.verdocs-text-input.entry.js.map +0 -1
  310. package/dist/esm/verdocs-checkbox_6.entry.js.map +0 -1
  311. package/dist/esm/verdocs-envelope-recipient-link.entry.js.map +0 -1
  312. package/dist/esm-es5/Datastore-C_IIZj49.js +0 -2
  313. package/dist/esm-es5/Datastore-C_IIZj49.js.map +0 -1
  314. package/dist/esm-es5/verdocs-button.verdocs-help-icon.entry.js.map +0 -1
  315. package/dist/esm-es5/verdocs-button_2.entry.js +0 -2
  316. package/dist/esm-es5/verdocs-button_2.entry.js.map +0 -1
  317. package/dist/esm-es5/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.verdocs-text-input.entry.js.map +0 -1
  318. package/dist/esm-es5/verdocs-checkbox_6.entry.js +0 -2
  319. package/dist/esm-es5/verdocs-checkbox_6.entry.js.map +0 -1
  320. package/dist/esm-es5/verdocs-envelope-recipient-link.entry.js +0 -2
  321. package/dist/esm-es5/verdocs-envelope-recipient-link.entry.js.map +0 -1
  322. package/dist/verdocs-web-sdk/p-03c76a24.system.entry.js +0 -2
  323. package/dist/verdocs-web-sdk/p-03c76a24.system.entry.js.map +0 -1
  324. package/dist/verdocs-web-sdk/p-0bb8015d.entry.js +0 -2
  325. package/dist/verdocs-web-sdk/p-13c9ac73.entry.js +0 -3
  326. package/dist/verdocs-web-sdk/p-13c9ac73.entry.js.map +0 -1
  327. package/dist/verdocs-web-sdk/p-1653b309.system.entry.js.map +0 -1
  328. package/dist/verdocs-web-sdk/p-255c74a9.entry.js +0 -2
  329. package/dist/verdocs-web-sdk/p-255c74a9.entry.js.map +0 -1
  330. package/dist/verdocs-web-sdk/p-2a183b90.system.entry.js +0 -4
  331. package/dist/verdocs-web-sdk/p-2a183b90.system.entry.js.map +0 -1
  332. package/dist/verdocs-web-sdk/p-3b68bc50.entry.js.map +0 -1
  333. package/dist/verdocs-web-sdk/p-3fc4da27.system.entry.js +0 -2
  334. package/dist/verdocs-web-sdk/p-3fc4da27.system.entry.js.map +0 -1
  335. package/dist/verdocs-web-sdk/p-4b2b090e.entry.js.map +0 -1
  336. package/dist/verdocs-web-sdk/p-5018b5b8.entry.js +0 -2
  337. package/dist/verdocs-web-sdk/p-5018b5b8.entry.js.map +0 -1
  338. package/dist/verdocs-web-sdk/p-5d4a9e54.entry.js.map +0 -1
  339. package/dist/verdocs-web-sdk/p-8c9f35ab.system.entry.js +0 -2
  340. package/dist/verdocs-web-sdk/p-8c9f35ab.system.entry.js.map +0 -1
  341. package/dist/verdocs-web-sdk/p-BZkYMpVF.system.js.map +0 -1
  342. package/dist/verdocs-web-sdk/p-Bh0IfLXk.system.js.map +0 -1
  343. package/dist/verdocs-web-sdk/p-BhRjT9GK.system.js.map +0 -1
  344. package/dist/verdocs-web-sdk/p-C4Tt0CYc.system.js.map +0 -1
  345. package/dist/verdocs-web-sdk/p-CMiFaQiI.system.js +0 -2
  346. package/dist/verdocs-web-sdk/p-CMiFaQiI.system.js.map +0 -1
  347. package/dist/verdocs-web-sdk/p-C_IIZj49.js +0 -2
  348. package/dist/verdocs-web-sdk/p-C_IIZj49.js.map +0 -1
  349. package/dist/verdocs-web-sdk/p-DG0Ibgqe.system.js.map +0 -1
  350. package/dist/verdocs-web-sdk/p-Dgk4ByEW.system.js.map +0 -1
  351. package/dist/verdocs-web-sdk/p-EQbSTcUE.system.js.map +0 -1
  352. package/dist/verdocs-web-sdk/p-UTpMOeny.system.js.map +0 -1
  353. package/dist/verdocs-web-sdk/p-a231248c.system.entry.js.map +0 -1
  354. package/dist/verdocs-web-sdk/p-a2ba1316.system.entry.js.map +0 -1
  355. package/dist/verdocs-web-sdk/p-aaf3cb2c.entry.js +0 -2
  356. package/dist/verdocs-web-sdk/p-aaf3cb2c.entry.js.map +0 -1
  357. package/dist/verdocs-web-sdk/p-bde78dab.system.entry.js.map +0 -1
  358. package/dist/verdocs-web-sdk/p-caf258c9.entry.js.map +0 -1
  359. package/dist/verdocs-web-sdk/p-d0bc16f9.entry.js +0 -2
  360. package/dist/verdocs-web-sdk/p-d0bc16f9.entry.js.map +0 -1
  361. package/dist/verdocs-web-sdk/p-eb539d8f.system.entry.js +0 -2
  362. package/dist/verdocs-web-sdk/p-eb539d8f.system.entry.js.map +0 -1
  363. package/dist/verdocs-web-sdk/p-x6a7ykMn.system.js.map +0 -1
  364. package/dist/verdocs-web-sdk/verdocs-button.verdocs-help-icon.entry.esm.js.map +0 -1
  365. package/dist/verdocs-web-sdk/verdocs-envelope-recipient-link.entry.esm.js.map +0 -1
  366. /package/dist/verdocs-web-sdk/{p-c8369ea0.entry.js.map → p-45f59906.entry.js.map} +0 -0
  367. /package/dist/verdocs-web-sdk/{p-1d0463ad.system.entry.js.map → p-65a5d2d4.system.entry.js.map} +0 -0
  368. /package/dist/verdocs-web-sdk/{p-894e2058.entry.js.map → p-76215a73.entry.js.map} +0 -0
  369. /package/dist/verdocs-web-sdk/{p-821becae.system.entry.js.map → p-8c98a765.system.entry.js.map} +0 -0
  370. /package/dist/verdocs-web-sdk/{p-e5f90a18.system.entry.js.map → p-a224a4cc.system.entry.js.map} +0 -0
  371. /package/dist/verdocs-web-sdk/{p-6d8c780d.system.entry.js.map → p-a37e8f84.system.entry.js.map} +0 -0
  372. /package/dist/verdocs-web-sdk/{p-d16c03d8.system.entry.js.map → p-ac05c34d.system.entry.js.map} +0 -0
  373. /package/dist/verdocs-web-sdk/{p-524c1693.system.entry.js.map → p-bec52dd1.system.entry.js.map} +0 -0
  374. /package/dist/verdocs-web-sdk/{p-bb96a9af.entry.js.map → p-d8b36d95.entry.js.map} +0 -0
  375. /package/dist/verdocs-web-sdk/{p-5355587b.entry.js.map → p-e15b7c92.entry.js.map} +0 -0
  376. /package/dist/verdocs-web-sdk/{p-65f4a435.entry.js.map → p-fb00149a.entry.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,n,i){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i["throw"](t))}catch(t){r(t)}}function l(t){t.done?n(t.value):o(t.value).then(s,a)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];o=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var i=0,o=e.length,r;i<o;i++){if(r||!(i in e)){if(!r)r=Array.prototype.slice.call(e,0,i);r[i]=e[i]}}return t.concat(r||Array.prototype.slice.call(e))};System.register(["./p-gAi_FRvp.system.js","@verdocs/js-sdk","./p-7Iu0_GGa.system.js","./p-CMiFaQiI.system.js","./p-C9y1KCYV.system.js","./p-CrzDCQEM.system.js","./p-Cb4o7DUm.system.js","./p-DmF0GSqu.system.js","./p-DE0Cygqz.system.js","./p-CD5uiThi.system.js","./p-Bzy18UgU.system.js","./p-80p0Fzir.system.js"],(function(t){"use strict";var e,n,i,o,r,s,a,l,c,u,d,f,h,v,p,m,g,b,x,w,y,E,_,k,S,q,C,M,I,T,D,O,L,z,Z,H,N,A,V,j,R;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.H;r=t.F;s=t.g},function(t){a=t.VerdocsEndpoint;l=t.getTemplate;c=t.integerSequence;u=t.getOrganizationContacts;d=t.isValidEmail;f=t.createEnvelope;h=t.formatFullName;v=t.getRGBA;p=t.createTemplateDocument;m=t.deleteTemplateDocument;g=t.updateField;b=t.createField;x=t.updateTemplateRole;w=t.createTemplateRole;y=t.updateTemplate},function(t){E=t.S},function(t){_=t.S},function(t){k=t.D},function(t){S=t.V},function(t){q=t.D;C=t.P;M=t.J;I=t.a;T=t.F;D=t.b;O=t.T},function(t){L=t.d},function(t){z=t.i},function(t){Z=t.g;H=t.e;N=t.f;A=t.h;V=t.i;j=t.j},function(t){R=t.g},null],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-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 B=t("verdocs_preview",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.onTemplateIdChanged=function(t){console.log("[PREVIEW] Template ID changed",t);this.listenToTemplate()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[PREVIEW] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.handlePageRendered=function(t){};t.prototype.render=function(){var t=this;var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}return i(o,null,(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((function(e){var n=c(1,e.pages);return i(r,null,n.map((function(n){var o;var r=((o=e.page_sizes)===null||o===void 0?void 0:o[n])||{width:612,height:792};return i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:n,disabled:true,editable:false,done:false,virtualWidth:r.width,virtualHeight:r.height,onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());B.style=U;var P=function(t){return((t===null||t===void 0?void 0:t.roles)||[]).map((function(t){return t.name}))};var Q=function(t,e){return Math.max(P(t).findIndex((function(t){return t===e})),0)};var F='@-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 G='<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 W='<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 J='<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 K=t("verdocs_send",function(){function t(t){e(this,t);this.beforeSend=n(this,"beforeSend");this.send=n(this,"send");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.searchContacts=n(this,"searchContacts");this.templateListenerId=null;this.endpoint=k;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}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),true,(function(e){console.log("[SEND] Got new template",e);t.template=e;t.loading=false;t.rolesCompleted={};t.recomputeRolesCompleted()}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.rolesCompleted={};return[2]}))}))};t.prototype.onTemplateIdChanged=function(t){console.log("[SEND] Template ID changed",t);this.listenToTemplate()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;var i=this;return __generator(this,(function(o){try{this.endpoint.onSessionChanged((function(t,e,n){if(!n){return}var o={id:n.id,first_name:n.first_name,last_name:n.last_name,email:n.email,phone:n.phone};if(n){i.sessionContacts=[o];u(i.endpoint).then((function(t){console.log("[SEND] Got contacts",t);i.sessionContacts=__spreadArray(__spreadArray([],t,true),[o],false)})).catch((function(t){console.log("[SEND] Error getting contacts",t)}))}}));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(i){console.log("[SEND] Error with send session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.recomputeRolesCompleted=function(){var t=this;var e;this.rolesCompleted={};var n={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){var i=e.sequence;n[i]||(n[i]=[]);var o="r-".concat(i,"-").concat(n[i].length);n[i].push(__assign(__assign({},e),{id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name}));if(e.first_name&&d(e.email)){t.rolesCompleted[o]=__assign(__assign({},e),{id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name})}}))};t.prototype.getSequenceNumbers=function(){var t;var e={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){e[t.sequence]=true}));return Object.keys(e).map((function(t){return+t})).sort((function(t,e){return t-e}))};t.prototype.getRolesAtLevel=function(t){var e;var n=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).filter((function(e){return e.sequence===t})).map((function(e,n){return __assign(__assign({},e),{id:"r-".concat(t,"-").concat(n),role_name:e.name,first_name:e.first_name,last_name:e.last_name})}));return n};t.prototype.getLevelIcon=function(t){if(t==="start"){return i("div",{class:"level-icon",innerHTML:Y})}else if(t==="end"){return i("div",{class:"level-icon",innerHTML:J})}else{return i("div",{class:"level-icon",innerHTML:W})}};t.prototype.handleSelectContact=function(t,e){t.preventDefault();this.rolesCompleted[e.id]=__assign(__assign({},e),t.detail);this.showPickerForId=""};t.prototype.handleClickRole=function(t,e){t.stopPropagation();this.showPickerForId=e.id};t.prototype.handleSend=function(t){var e=this;var n;if(this.sending){console.log("[SEND] Skipping duplicate send",t);return}console.log("[SEND] Sending",t);t.preventDefault();t.stopPropagation();this.sending=true;var i={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:[]};var o=this.beforeSend.emit(__assign(__assign({},i),{name:i.name,template:this.template}));if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",i);this.sending=false;return}console.log("[SEND] Creating envelope",i);f(this.endpoint,i).then((function(t){var n;console.log("[SEND] Send envelope",t);e.reset().catch((function(t){return console.log("Unknown Error",t)}));e.sending=false;(n=e.send)===null||n===void 0?void 0:n.emit(__assign(__assign({},i),{name:i.name,envelope_id:t.id,envelope:t}))})).catch((function(t){var n,i,o;console.log("[SEND] Send error",t);S(((i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.error)||"Error creating envelope, please try again later.");e.sending=false;(o=e.sdkError)===null||o===void 0?void 0:o.emit(t)}))};t.prototype.handleCancel=function(t){var e;t.stopPropagation();(e=this.exit)===null||e===void 0?void 0:e.emit()};t.prototype.render=function(){var t=this;var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=this.getSequenceNumbers();var r=Object.values(this.rolesCompleted).filter((function(t){return d(t.email)&&t.first_name&&t.last_name}));var s=r.length>=P(this.template).length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),n.map((function(e){return i("div",{class:"level level-".concat(e)},t.getLevelIcon("sequence"),t.getRolesAtLevel(e).map((function(e){var n,o,s;var a=!e.email||!e.first_name||!e.last_name;var l=((n=t.rolesCompleted[e.id])===null||n===void 0?void 0:n.first_name)?h(t.rolesCompleted[e.id]):a?e.role_name:h(e);var c="verdocs-send-recipient-".concat(e.role_name);var u=Q(t.template,e.role_name);var d=v(u);var f=r.findIndex((function(t){return t.role_name===e.role_name}))>-1;var p={backgroundColor:d,border:f?"2px solid #55bc81":"2px solid #dddddd"};return a?i("div",{class:"recipient","data-ri":u,"data-rn":e.role_name,style:p,onClick:function(n){return t.handleClickRole(n,e)},id:c},l,i("div",{class:"icon",innerHTML:G}),t.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:function(){return t.showPickerForId=""}},i("verdocs-contact-picker",{onExit:function(){return t.showPickerForId=""},onNext:function(n){return t.handleSelectContact(n,e)},contactSuggestions:t.sessionContacts,templateRole:(o=t.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:function(e){var n;return(n=t.searchContacts)===null||n===void 0?void 0:n.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":u,"data-rn":e.role_name,style:p,onClick:function(n){return t.handleClickRole(n,e)},id:c},l,i("div",{class:"icon",innerHTML:G}),t.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:function(){return t.showPickerForId=""}},i("verdocs-contact-picker",{onExit:function(){return t.showPickerForId=""},onNext:function(n){return t.handleSelectContact(n,e)},contactSuggestions:t.sessionContacts,templateRole:(s=t.rolesCompleted[e.id])!==null&&s!==void 0?s:e,onSearchContacts:function(e){var n;return(n=t.searchContacts)===null||n===void 0?void 0:n.emit(e.detail)}})))})))})),i("div",{class:"level level-done"},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(e){return t.handleCancel(e)},disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!s||this.sending,onClick:function(e){return t.handleSend(e)}}),this.sending&&i("verdocs-spinner",null)))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());K.style=F;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 $=t("verdocs_template_attachments",function(){function t(t){e(this,t);this.exit=n(this,"exit");this.next=n(this,"next");this.templateUpdated=n(this,"templateUpdated");this.sdkError=n(this,"sdkError");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}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[TEMPLATE ATTACHMENTS] Error loading template",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.handleCancel=function(t){t.stopPropagation();this.exit.emit()};t.prototype.handleUploadProgress=function(t){if(t>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=t}};t.prototype.handleUpload=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:t.stopPropagation();r=t.detail.file;if(!r){return[2]}console.log("[ATTACHMENTS] Uploading...",r);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,p(this.endpoint,this.templateId,r,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);(e=this.templateUpdated)===null||e===void 0?void 0:e.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);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new E(l.message,(i=l.response)===null||i===void 0?void 0:i.status,(o=l.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};t.prototype.handleNext=function(t){var e;t.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(e=this.next)===null||e===void 0?void 0:e.emit({template:this.template})};t.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,m(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:e.sent();t=this;return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 2:t.template=e.sent();console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null;return[2]}}))}))};t.prototype.handleDelete=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){if((((e=this.template)===null||e===void 0?void 0:e.documents)||[]).length>1){this.confirmDeleteDocument=t}else{this.showDeleteError=true}return[2]}))}))};t.prototype.getFileIcon=function(t){switch(t.mime){case"application/pdf":return I;case"image/jpeg":return M;case"image/png":return C;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return q}return T};t.prototype.render=function(){var t=this;var e,n;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return i(o,{class:"loading"},i("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return i(o,{class:"empty"})}return i(o,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((function(e){return i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:t.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.pages),i("div",{class:"pages-icon",innerHTML:D})),i("div",{class:"trash-icon",innerHTML:O,onClick:function(){return t.handleDelete(e)}}))}))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:function(e){return t.handleUpload(e)}}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(e){return t.handleCancel(e)},disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:function(e){return t.handleNext(e)},disabled:!(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).length||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return t.showDeleteError=false}}),this.confirmDeleteDocument&&i("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 t.confirmDelete()},showCancel:true,onExit:function(){t.confirmDeleteDocument=null}}))};return t}());$.style=X;var tt='@-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 et='<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 nt='<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 it=["attachments","roles","settings","fields","preview"];var ot=t("verdocs_template_build_tabs",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.stepChanged=n(this,"stepChanged");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.onTemplateIdChanged=function(t){console.log("[BUILD_TABS] Template ID changed",t);this.listenToTemplate()};t.prototype.onStepChanged=function(t){console.log("[BUILD_TABS] Step changed",t)};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[BUILD_TABS] Error loading template",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.setStep=function(t){var e;console.log("[BUILD_TABS] Selected step",t.detail.tab.id);t.stopPropagation();t.preventDefault();this.step=t.detail.tab.id;(e=this.stepChanged)===null||e===void 0?void 0:e.emit(t.detail.tab.id)};t.prototype.copyTemplateId=function(){var t=this;navigator.clipboard.writeText(this.templateId).then((function(){S("Template ID copied",{style:"success",duration:3e3})})).catch((function(e){var n;console.warn("[BUILD_TABS] Error copying to clipboard",e);(n=t.sdkError)===null||n===void 0?void 0:n.emit(e)}))};t.prototype.render=function(){var t=this;var e,n,r,s,a,l,c,u,d;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var f=(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).length>0;var h=f&&(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).length>0;var v=h&&(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).length>0;var p=Math.max(it.indexOf(this.step),0);if(!v&&p>=4){p=3}if(!h&&p>=3){p=1}if(!f&&p>=1){p=0}return i(o,null,i("verdocs-tabs",{onSelectTab:function(e){return t.setStep(e)},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&&i("div",{class:"info"},i("verdocs-button-panel",{icon:et},i("div",{class:"template-details-panel"},i("h6",null,"Template Details"),i("div",{class:"row"},i("label",null,"ID:"),i("div",{class:"value"},this.templateId),i("div",{class:"icon-button",innerHTML:nt,onClick:function(){return t.copyTemplateId()}})),i("div",{class:"row"},i("label",null,"Name:"),i("div",{class:"value"},(s=this.template)===null||s===void 0?void 0:s.name)),i("div",{class:"row"},i("label",null,"Visibility:"),i("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")),i("div",{class:"row"},i("label",null,"Created:"),i("div",{class:"value"},((c=this.template)===null||c===void 0?void 0:c.counter)?L.format(new Date((u=this.template)===null||u===void 0?void 0:u.created_at),"P p"):"")),i("div",{class:"row"},i("label",null,"Used:"),i("div",{class:"value"},(d=this.template)===null||d===void 0?void 0:d.counter," time(s)"))))))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return t}());ot.style=tt;var rt="@-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 st='<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 at='<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 lt='<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 ct='<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 ut='<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 dt='<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 ft='<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 ht='<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 vt='<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 pt='<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 mt=[{id:"signature",tooltip:"Signature",icon:ut,class:"signature"},{id:"initial",tooltip:"Initials",icon:dt,class:"initial"},{id:"sep1",tooltip:"",icon:pt,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:st,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:at,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:lt,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:ht,class:"dropdown"},{id:"sep2",tooltip:"",icon:pt,class:"separator"},{id:"date",tooltip:"Date",icon:ct,class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:ft,class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:vt,class:"attachment"}];var gt=t("verdocs_template_fields",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.templateUpdated=n(this,"templateUpdated");this.fieldsUpdated=n(this,"fieldsUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}t.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.placing=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[FIELDS] Error with fields session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.componentDidRender=function(){z.dynamicDrop(true);var t=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var e=document.getElementById("verdocs-template-fields-toolbar");if(t&&e){console.log("[FIELDS] Moving toolbar");e.remove();t.append(e)}};t.prototype.componentWillUpdate=function(){var t=this;var e,n;var i=((e=this.template)===null||e===void 0?void 0:e.roles)||[];if(!this.selectedRoleName||!i.find((function(e){return e&&e.name===t.selectedRoleName}))){this.selectedRoleName=((n=i[0])===null||n===void 0?void 0:n.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){var n,i;t.template=e;t.loading=false;if(!t.selectedRoleName){t.selectedRoleName=((i=(n=e.roles)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.name)||""}}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.attachFieldAttributes=function(t,e,n){var i=this;n.addEventListener("settingsChanged",(function(){var t;(t=i.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:i.endpoint,template:i.template,event:"added-field"})}));n.addEventListener("deleted",(function(){var t;n.remove();(t=i.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:i.endpoint,template:i.template,event:"updated-field"})}));n.setAttribute("templateid",this.templateId);n.setAttribute("fieldname",e.name);n.setAttribute("pageNumber",String(t.pageNumber));n.setAttribute("xScale",String(t.xScale));n.setAttribute("yScale",String(t.yScale));n.setAttribute("name",e.name)};t.prototype.handlePageRendered=function(t){var e=this;var n;var i=t.detail;this.cachedPageInfo[i.pageNumber]=i;this.pageHeights[i.pageNumber]=i.naturalHeight;(((n=this.template)===null||n===void 0?void 0:n.fields)||[]).filter((function(t){return t&&t.page===i.pageNumber})).forEach((function(t){var n=Z(t);var i=document.getElementById(n);if(i){i.setAttribute("fieldname",t.name);i.setAttribute("pagenumber",String(t.page));e.makeDraggable(i)}}))};t.prototype.makeDraggable=function(t){z(t).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};t.prototype.handleMoveField=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s;return __generator(this,(function(a){e=+(t.target.getAttribute("posX")||0);n=+(t.target.getAttribute("posY")||0);i=+(t.target.getAttribute("xScale")||1);o=+(t.target.getAttribute("yScale")||1);r=t.dx/i+e;s=t.dy/o+n;t.target.setAttribute("posX",r);t.target.setAttribute("posy",s);H(t.target,"translate","".concat(r,"px, ").concat(s,"px"));return[2]}))}))};t.prototype.handleMoveEnd=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s,a,l,c,u,d,f,h,v,p,m,b,x,w,y,k,q,C,M,I,T,D,O,L,z,Z,H,R,U,B,P,Q,F,G;return __generator(this,(function(Y){switch(Y.label){case 0:c=t.target.getAttribute("fieldname");u=(((e=this.template)===null||e===void 0?void 0:e.fields)||[]).find((function(t){return t.name===c}));if(!u){console.log("[FIELDS] Unable to find field",c,t.target);return[2]}d=t.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=t.target.getBoundingClientRect();y=t.target.parentElement;k=y.getBoundingClientRect();q=u.width||j(u.type);C=u.height||V(u.type);M=Math.max(w.left-k.left,0);I=Math.max(x-(k.bottom-w.bottom),0);T=parseInt(d);if(I>x){T=Math.min(T+1,((o=(i=((n=this.template)===null||n===void 0?void 0:n.documents)||[])===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.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})}D=this.viewCoordinatesToPageCoordinates(M,I,d,v-q,m-C),O=D.x,L=D.y;Y.label=1;case 1:Y.trys.push([1,3,,4]);z={x:O,y:L,page:T};return[4,g(this.endpoint,this.templateId,c,z)];case 2:Z=Y.sent();console.log("[FIELDS] Updated",Z);H=JSON.parse(JSON.stringify(this.template));R=H.fields.findIndex((function(t){return t.name===c}));if(R>-1){H.fields[R]=Z}_.updateTemplate(this.templateId,H);t.target.removeAttribute("posX");t.target.removeAttribute("posY");N(t.target);U=this.cachedPageInfo[d],B=U.xScale,P=B===void 0?1:B,Q=U.yScale,F=Q===void 0?1:Q;A(t.target,Z,P,F);(r=this.templateUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,template:H,event:"updated-field"});return[3,4];case 3:G=Y.sent();S("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",G);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new E(G.message,(a=G.response)===null||a===void 0?void 0:a.status,(l=G.response)===null||l===void 0?void 0:l.data));t.target.removeAttribute("posX");t.target.removeAttribute("posY");N(t.target);return[3,4];case 4:return[2]}}))}))};t.prototype.generateFieldName=function(t,e){var n;var i=1;var o;do{o="".concat(t,"P").concat(e,"-").concat(i);i++}while((((n=this.template)===null||n===void 0?void 0:n.fields)||[]).some((function(t){return t&&t.name===o})));return o};t.prototype.viewCoordinatesToPageCoordinates=function(t,e,n,i,o){var r=this.cachedPageInfo[n],s=r.xScale,a=s===void 0?1:s,l=r.yScale,c=l===void 0?1:l,u=r.renderedHeight,d=u===void 0?792:u;var f=Math.floor(Math.min(t/a,i));var h=Math.floor(Math.min(Math.max(d-e,0)/c,o));return{x:f,y:h}};t.prototype.handleClickPage=function(t,e){return __awaiter(this,void 0,void 0,(function(){var n,i,o,r,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];i=t.offsetX;o=t.offsetY;r=j(this.placing);s=V(this.placing);a=this.cachedPageInfo[e];l=a.naturalWidth,c=l===void 0?612:l,u=a.naturalHeight,d=u===void 0?792:u;f=this.viewCoordinatesToPageCoordinates(i,o,e,c-r,d-s);h=Math.floor(f.x);v=Math.floor(f.y);p={name:this.generateFieldName(this.placing,e),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:this.placing!=="radio",page:e,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:r,height:s,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",p);return[4,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);(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:g,event:"added-field"});this.placing=null;x.label=2;case 2:return[2]}}))}))};t.prototype.render=function(){var t;var e=this;var n,r,s;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var a=(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).map((function(t){return{value:t.name,label:t.full_name?"".concat(t.name,": ").concat(t.full_name):t.name}}));return i(o,{class:this.placing?(t={},t["placing-".concat(this.placing)]=true,t):{},onSubmit:function(){}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:a,onInput:function(t){return e.selectedRoleName=t.target.value}}),mt.map((function(t){return i("verdocs-toolbar-icon",{text:t.tooltip,icon:t.icon,class:t.class,onClick:function(){if(t.tooltip){if(e.selectedRoleName){e.placing=t.id}else{e.showMustSelectRole=true}}}})}))),i("div",{class:"pages"},(((r=this.template)===null||r===void 0?void 0:r.documents)||[]).map((function(t){var n=c(1,t.pages);return n.map((function(n){var o=t.page_sizes[n];return i("verdocs-template-document-page",{templateId:e.templateId,documentId:t.id,pageNumber:n,virtualWidth:(o===null||o===void 0?void 0:o.width)||612,virtualHeight:(o===null||o===void 0?void 0:o.height)||792,disabled:true,editable:true,done:false,onClick:function(t){return e.handleClickPage(t,n)},onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&i("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 e.showMustSelectRole=false}}))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());gt.style=rt;var bt={exports:{}};
2
- /*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */var xt=bt.exports;var wt;function yt(){if(wt)return bt.exports;wt=1;(function(t,e){!function(e,n){t.exports=n()}(xt,(function(){function t(t,e){var n,i=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)),i}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),true).forEach((function(t){var n,o;n=e,t=i[o=t],o in n?Object.defineProperty(n,o,{value:t,enumerable:true,configurable:true,writable:true}):n[o]=t})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,i=arguments[e];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function o(t,e){if(null==t)return{};var n,i=function(t,e){if(null==t)return{};for(var n,i={},o=Object.keys(t),r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(t),r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);return i}function r(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var l=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),c=a(/Edge/i),u=a(/firefox/i),d=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),f=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),v={capture:false,passive:false};function p(t,e,n){t.addEventListener(e,n,!l&&v)}function m(t,e,n){t.removeEventListener(e,n,!l&&v)}function g(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function b(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function x(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&g(t,e)||i&&t===n)return t}while(t!==n&&(t=b(t)))}return null}var w,y=/\s+/g;function E(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(y," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(y," ")))}function _(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];i[e=!(e in i||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function k(t,e){var n="";if("string"==typeof t)n=t;else do{var i=_(t,"transform")}while(i&&"none"!==i&&(n=i+" "+n),!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function S(t,e,n){if(t){var i=t.getElementsByTagName(e),o=0,r=i.length;if(n)for(;o<r;o++)n(i[o],o);return i}return[]}function q(){var t=document.scrollingElement;return t||document.documentElement}function C(t,e,n,i,o){if(t.getBoundingClientRect||t===window){var r,s,a,c,u,d,f=t!==window&&t.parentNode&&t!==q()?(s=(r=t.getBoundingClientRect()).top,a=r.left,c=r.bottom,u=r.right,d=r.height,r.width):(a=s=0,c=window.innerHeight,u=window.innerWidth,d=window.innerHeight,window.innerWidth);if((e||n)&&t!==window&&(o=o||t.parentNode,!l))do{if(o&&o.getBoundingClientRect&&("none"!==_(o,"transform")||n&&"static"!==_(o,"position"))){var h=o.getBoundingClientRect();s-=h.top+parseInt(_(o,"border-top-width")),a-=h.left+parseInt(_(o,"border-left-width")),c=s+r.height,u=a+r.width;break}}while(o=o.parentNode);return i&&t!==window&&(i=(e=k(o||t))&&e.a,t=e&&e.d,e&&(c=(s/=t)+(d/=t),u=(a/=i)+(f/=i))),{top:s,left:a,bottom:c,right:u,width:f,height:d}}}function M(t,e,n){for(var i=L(t,true),o=C(t)[e];i;){var r=C(i)[n];if(!(r<=o))return i;if(i===q())break;i=L(i,false)}return false}function I(t,e,n,i){for(var o=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==jt.ghost&&(i||s[r]!==jt.dragged)&&x(s[r],n.draggable,t,false)){if(o===e)return s[r];o++}r++}return null}function T(t,e){for(var n=t.lastElementChild;n&&(n===jt.ghost||"none"===_(n,"display")||e&&!g(n,e));)n=n.previousElementSibling;return n||null}function D(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jt.clone||e&&!g(t,e)||n++;return n}function O(t){var e=0,n=0,i=q();if(t)do{var o=k(t),r=o.a,o=o.d}while(e+=t.scrollLeft*r,n+=t.scrollTop*o,t!==i&&(t=t.parentNode));return[e,n]}function L(t,e){if(!t||!t.getBoundingClientRect)return q();var n=t,i=false;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=_(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return q();if(i||e)return n;i=true}}}while(n=n.parentNode);return q()}function z(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Z(t,e){return function(){var n;w||(1===(n=arguments).length?t.call(this,n[0]):t.apply(this,n),w=setTimeout((function(){w=void 0}),e))}}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function N(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(true):n?n(t).clone(true)[0]:t.cloneNode(true)}function A(t,e){_(t,"position","absolute"),_(t,"top",e.top),_(t,"left",e.left),_(t,"width",e.width),_(t,"height",e.height)}function V(t){_(t,"position",""),_(t,"top",""),_(t,"left",""),_(t,"width",""),_(t,"height","")}function j(t,e,n){var i={};return Array.from(t.children).forEach((function(o){var r;x(o,e.draggable,t,false)&&!o.animated&&o!==n&&(r=C(o),i.left=Math.min(null!==(o=i.left)&&void 0!==o?o:1/0,r.left),i.top=Math.min(null!==(o=i.top)&&void 0!==o?o:1/0,r.top),i.right=Math.max(null!==(o=i.right)&&void 0!==o?o:-1/0,r.right),i.bottom=Math.max(null!==(o=i.bottom)&&void 0!==o?o:-1/0,r.bottom))})),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var R="Sortable"+(new Date).getTime();function U(){var t,n=[];return{captureAnimationState:function(){n=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){var i,o;"none"!==_(t,"display")&&t!==jt.ghost&&(n.push({target:t,rect:C(t)}),i=e({},n[n.length-1].rect),!t.thisAnimationDuration||(o=k(t,true))&&(i.top-=o.f,i.left-=o.e),t.fromRect=i)}))},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n);return-1}(n,{target:t}),1)},animateAll:function(e){var i=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof e&&e());var o=false,r=0;n.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=C(n),l=n.prevFromRect,c=n.prevToRect,u=t.rect,d=k(n,true);d&&(a.top-=d.f,a.left-=d.e),n.toRect=a,n.thisAnimationDuration&&z(l,a)&&!z(s,a)&&(u.top-a.top)/(u.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(t=u,d=l,l=c,c=i.options,e=Math.sqrt(Math.pow(d.top-t.top,2)+Math.pow(d.left-t.left,2))/Math.sqrt(Math.pow(d.top-l.top,2)+Math.pow(d.left-l.left,2))*c.animation),z(a,s)||(n.prevFromRect=s,n.prevToRect=a,e=e||i.options.animation,i.animate(n,u,a,e)),e&&(o=true,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),o?t=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),n=[]},animate:function(t,e,n,i){var o,r;i&&(_(t,"transition",""),_(t,"transform",""),o=(r=k(this.el))&&r.a,r=r&&r.d,o=(e.left-n.left)/(o||1),r=(e.top-n.top)/(r||1),t.animatingX=!!o,t.animatingY=!!r,_(t,"transform","translate3d("+o+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,_(t,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),_(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){_(t,"transition",""),_(t,"transform",""),t.animated=false,t.animatingX=false,t.animatingY=false}),i))}}}var B=[],P={initializeByDefault:true},Q={mount:function(t){for(var e in P)!P.hasOwnProperty(e)||e in t||(t[e]=P[e]);B.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),B.push(t)},pluginEvent:function(t,n,i){var o=this;this.eventCanceled=false,i.cancel=function(){o.eventCanceled=true};var r=t+"Global";B.forEach((function(o){n[o.pluginName]&&(n[o.pluginName][r]&&n[o.pluginName][r](e({sortable:n},i)),n.options[o.pluginName]&&n[o.pluginName][t]&&n[o.pluginName][t](e({sortable:n},i)))}))},initializePlugins:function(t,e,n,o){for(var r in B.forEach((function(o){var r=o.pluginName;(t.options[r]||o.initializeByDefault)&&((o=new o(t,e,t.options)).sortable=t,o.options=t.options,t[r]=o,i(n,o.defaults))})),t.options){var s;t.options.hasOwnProperty(r)&&(void 0!==(s=this.modifyOption(t,r,t.options[r]))&&(t.options[r]=s))}},getEventProperties:function(t,e){var n={};return B.forEach((function(o){"function"==typeof o.eventProperties&&i(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var i;return B.forEach((function(o){t[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[e]&&(i=o.optionListeners[e].call(t[o.pluginName],n))})),i}};function F(t){var n=t.sortable,i=t.rootEl,o=t.name,r=t.targetEl,s=t.cloneEl,a=t.toEl,u=t.fromEl,d=t.oldIndex,f=t.newIndex,h=t.oldDraggableIndex,v=t.newDraggableIndex,p=t.originalEvent,m=t.putSortable,g=t.extraEventProperties;if(n=n||i&&i[R]){var b,x=n.options,t="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||l||c?(b=document.createEvent("Event")).initEvent(o,true,true):b=new CustomEvent(o,{bubbles:true,cancelable:true}),b.to=a||i,b.from=u||i,b.item=r||i,b.clone=s,b.oldIndex=d,b.newIndex=f,b.oldDraggableIndex=h,b.newDraggableIndex=v,b.originalEvent=p,b.pullMode=m?m.lastPutMode:void 0;var w,y=e(e({},g),Q.getEventProperties(o,n));for(w in y)b[w]=y[w];i&&i.dispatchEvent(b),x[t]&&x[t].call(n,b)}}function G(t,n){var i=(r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,r=o(r,Y);Q.pluginEvent.bind(jt)(t,n,e({dragEl:J,parentEl:K,ghostEl:X,rootEl:$,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:it,dragStarted:mt,putSortable:ct,activeSortable:jt.active,originalEvent:i,oldIndex:ot,oldDraggableIndex:st,newIndex:rt,newDraggableIndex:at,hideGhostForTarget:Ht,unhideGhostForTarget:Nt,cloneNowHidden:function(){it=true},cloneNowShown:function(){it=false},dispatchSortableEvent:function(t){W({sortable:n,name:t,originalEvent:i})}},r))}var Y=["evt"];function W(t){F(e({putSortable:ct,cloneEl:nt,targetEl:J,rootEl:$,oldIndex:ot,oldDraggableIndex:st,newIndex:rt,newDraggableIndex:at},t))}var J,K,X,$,tt,et,nt,it,ot,rt,st,at,lt,ct,ut,dt,ft,ht,vt,pt,mt,gt,bt,xt,wt,yt=false,Et=false,_t=[],kt=false,St=false,qt=[],Ct=false,Mt=[],It="undefined"!=typeof document,Tt=f,Dt=c||l?"cssFloat":"float",Ot=It&&!h&&!f&&"draggable"in document.createElement("div"),Lt=function(){if(It){if(l)return false;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),zt=function(t,e){var n=_(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=I(t,0,e),r=I(t,1,e),s=o&&_(o),a=r&&_(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(o).width,t=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&s.float&&"none"!==s.float){e="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==e?"horizontal":"vertical"}return o&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||i<=l&&"none"===n[Dt]||r&&"none"===n[Dt]&&i<l+t)?"vertical":"horizontal"},Zt=function(t){function e(t,n){return function(i,o,r,s){var a=i.options.group.name&&o.options.group.name&&i.options.group.name===o.options.group.name;if(null==t&&(n||a))return true;if(null==t||false===t)return false;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,o,r,s),n)(i,o,r,s);o=(n?i:o).options.group.name;return true===t||"string"==typeof t&&t===o||t.join&&-1<t.indexOf(o)}}var i={},o=t.group;o&&"object"==n(o)||(o={name:o}),i.name=o.name,i.checkPull=e(o.pull,true),i.checkPut=e(o.put),i.revertClone=o.revertClone,t.group=i},Ht=function(){!Lt&&X&&_(X,"display","none")},Nt=function(){!Lt&&X&&_(X,"display","")};It&&!h&&document.addEventListener("click",(function(t){if(Et)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Et=false}),true);function At(t){if(J){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,r=t.clientY,_t.some((function(t){var e=t[R].options.emptyInsertThreshold;if(e&&!T(t)){var n=C(t),i=o>=n.left-e&&o<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return i&&e?s=t:void 0}})),s);if(e){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[R]._onDragOver(i)}}var o,r,s}function Vt(t){J&&J.parentNode[R]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[R]=this;var n,o,r={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function(){return zt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.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:false!==jt.supportPointer&&"PointerEvent"in window&&(!d||f),emptyInsertThreshold:5};for(n in Q.initializePlugins(this,t,r),r)n in e||(e[n]=r[n]);for(o in Zt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&Ot,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?p(t,"pointerdown",this._onTapStart):(p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),_t.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,U())}function Rt(t,e,n,i,o,r,s,a){var u,d,f=t[R],h=f.options.onMove;return!window.CustomEvent||l||c?(u=document.createEvent("Event")).initEvent("move",true,true):u=new CustomEvent("move",{bubbles:true,cancelable:true}),u.to=e,u.from=t,u.dragged=n,u.draggedRect=i,u.related=o||e,u.relatedRect=r||C(e),u.willInsertAfter=a,u.originalEvent=s,t.dispatchEvent(u),d=h?h.call(f,u,s):d}function Ut(t){t.draggable=false}function Bt(){Ct=false}function Pt(t){return setTimeout(t,0)}function Qt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(gt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,J):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,o=i.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(!function(t){Mt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var i=e[n];i.checked&&Mt.push(i)}}(n),!J&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!d||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=x(a,i.draggable,n,false))&&a.animated||et===a)){if(ot=D(a),st=D(a,i.draggable),"function"==typeof c){if(c.call(this,t,a,this))return W({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),G("filter",e,{evt:t}),void(o&&t.preventDefault())}else if(c=c&&c.split(",").some((function(i){if(i=x(l,i.trim(),n,false))return W({sortable:e,rootEl:i,name:"filter",targetEl:a,fromEl:n,toEl:n}),G("filter",e,{evt:t}),true})))return void(o&&t.preventDefault());i.handle&&!x(l,i.handle,n,false)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var i,o=this,r=o.el,s=o.options,a=r.ownerDocument;n&&!J&&n.parentNode===r&&(i=C(n),$=r,K=(J=n).parentNode,tt=J.nextSibling,et=n,lt=s.group,ut={target:jt.dragged=J,clientX:(e||t).clientX,clientY:(e||t).clientY},vt=ut.clientX-i.left,pt=ut.clientY-i.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,J.style["will-change"]="all",i=function(){G("delayEnded",o,{evt:t}),jt.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!u&&o.nativeDraggable&&(J.draggable=true),o._triggerDragStart(t,e),W({sortable:o,name:"choose",originalEvent:t}),E(J,s.chosenClass,true))},s.ignore.split(",").forEach((function(t){S(J,t.trim(),Ut)})),p(a,"dragover",At),p(a,"mousemove",At),p(a,"touchmove",At),s.supportPointer?(p(a,"pointerup",o._onDrop),this.nativeDraggable||p(a,"pointercancel",o._onDrop)):(p(a,"mouseup",o._onDrop),p(a,"touchend",o._onDrop),p(a,"touchcancel",o._onDrop)),u&&this.nativeDraggable&&(this.options.touchStartThreshold=4,J.draggable=true),G("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(c||l)?i():jt.eventCanceled?this._onDrop():(s.supportPointer?(p(a,"pointerup",o._disableDelayedDrag),p(a,"pointercancel",o._disableDelayedDrag)):(p(a,"mouseup",o._disableDelayedDrag),p(a,"touchend",o._disableDelayedDrag),p(a,"touchcancel",o._disableDelayedDrag)),p(a,"mousemove",o._delayedDragTouchMoveHandler),p(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&p(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(i,s.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){J&&Ut(J),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?p(document,"pointermove",this._onTouchMove):p(document,e?"touchmove":"mousemove",this._onTouchMove):(p(J,"dragend",this),p($,"dragstart",this._onDragStart));try{document.selection?Pt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;yt=false,$&&J?(G("dragStarted",this,{evt:e}),this.nativeDraggable&&p(document,"dragover",Vt),n=this.options,t||E(J,n.dragClass,false),E(J,n.ghostClass,true),jt.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Ht();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(J.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R])if(e[R]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=b(t=e));Nt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=X&&k(X,true),s=X&&r&&r.a,a=X&&r&&r.d,e=Tt&&wt&&O(wt),s=(o.clientX-ut.clientX+i.x)/(s||1)+(e?e[0]-qt[0]:0)/(s||1),a=(o.clientY-ut.clientY+i.y)/(a||1)+(e?e[1]-qt[1]:0)/(a||1);if(!jt.active&&!yt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,true)}X&&(r?(r.e+=s-(ft||0),r.f+=a-(ht||0)):r={a:1,b:0,c:0,d:1,e:s,f:a},r="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")"),_(X,"webkitTransform",r),_(X,"mozTransform",r),_(X,"msTransform",r),_(X,"transform",r),ft=s,ht=a,dt=o),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!X){var t=this.options.fallbackOnBody?document.body:$,e=C(J,true,Tt,true,t),n=this.options;if(Tt){for(wt=t;"static"===_(wt,"position")&&"none"===_(wt,"transform")&&wt!==document;)wt=wt.parentNode;wt!==document.body&&wt!==document.documentElement?(wt===document&&(wt=q()),e.top+=wt.scrollTop,e.left+=wt.scrollLeft):wt=q(),qt=O(wt)}E(X=J.cloneNode(true),n.ghostClass,false),E(X,n.fallbackClass,true),E(X,n.dragClass,true),_(X,"transition",""),_(X,"transform",""),_(X,"box-sizing","border-box"),_(X,"margin",0),_(X,"top",e.top),_(X,"left",e.left),_(X,"width",e.width),_(X,"height",e.height),_(X,"opacity","0.8"),_(X,"position",Tt?"absolute":"fixed"),_(X,"zIndex","100000"),_(X,"pointerEvents","none"),jt.ghost=X,t.appendChild(X),_(X,"transform-origin",vt/parseInt(X.style.width)*100+"% "+pt/parseInt(X.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,o=n.options;G("dragStart",this,{evt:t}),jt.eventCanceled?this._onDrop():(G("setupClone",this),jt.eventCanceled||((nt=N(J)).removeAttribute("id"),nt.draggable=false,nt.style["will-change"]="",this._hideClone(),E(nt,this.options.chosenClass,false),jt.clone=nt),n.cloneId=Pt((function(){G("clone",n),jt.eventCanceled||(n.options.removeCloneOnHide||$.insertBefore(nt,J),n._hideClone(),W({sortable:n,name:"clone"}))})),e||E(J,o.dragClass,true),e?(Et=true,n._loopId=setInterval(n._emulateDragOver,50)):(m(document,"mouseup",n._onDrop),m(document,"touchend",n._onDrop),m(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(n,i,J)),p(document,"drop",n),_(J,"transform","translateZ(0)")),yt=true,n._dragStartId=Pt(n._dragStarted.bind(n,e,t)),p(document,"selectstart",n),mt=true,window.getSelection().removeAllRanges(),d&&_(document.body,"user-select","none"))},_onDragOver:function(t){var n,i,o,r,s,a=this.el,l=t.target,c=this.options,u=c.group,d=jt.active,f=lt===u,h=c.sort,v=ct||d,p=this,m=false;if(!Ct){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=x(l,c.draggable,a,true),A("dragOver"),jt.eventCanceled)return m;if(J.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return U(false);if(Et=false,d&&!c.disabled&&(f?h||(i=K!==$):ct===this||(this.lastPutMode=lt.checkPull(this,d,J,t))&&u.checkPut(this,d,J,t))){if(o="vertical"===this._getDirection(t,l),n=C(J),A("dragOverValid"),jt.eventCanceled)return m;if(i)return K=$,V(),this._hideClone(),A("revert"),jt.eventCanceled||(tt?$.insertBefore(J,tt):$.appendChild(J)),U(true);var g=T(a,c.draggable);if(g&&(O=t,u=o,N=C(T((q=this).el,q.options.draggable)),q=j(q.el,q.options,X),!(u?O.clientX>q.right+10||O.clientY>N.bottom&&O.clientX>N.left:O.clientY>q.bottom+10||O.clientX>N.right&&O.clientY>N.top)||g.animated)){if(g&&(r=t,s=o,z=C(I((L=this).el,0,L.options,true)),L=j(L.el,L.options,X),s?r.clientX<L.left-10||r.clientY<z.top&&r.clientX<z.right:r.clientY<L.top-10||r.clientY<z.bottom&&r.clientX<z.left)){var b=I(a,0,c,true);if(b===J)return U(false);if(S=C(l=b),false!==Rt($,a,J,n,l,S,t,false))return V(),a.insertBefore(J,b),K=a,B(),U(true)}else if(l.parentNode===a){var w,y,k,S=C(l),q=J.parentNode!==a,O=(O=J.animated&&J.toRect||n,N=l.animated&&l.toRect||S,L=(s=o)?O.left:O.top,r=s?O.right:O.bottom,z=s?O.width:O.height,b=s?N.left:N.top,O=s?N.right:N.bottom,N=s?N.width:N.height,!(L===b||r===O||L+z/2===b+N/2)),L=o?"top":"left",z=M(l,"top","top")||M(J,"top","top"),b=z?z.scrollTop:void 0;if(gt!==l&&(y=S[L],kt=false,St=!O&&c.invertSwap||q),0!==(w=function(t,e,n,i,o,r,s,a){var l=i?t.clientY:t.clientX,c=i?n.height:n.width,t=i?n.top:n.left,i=i?n.bottom:n.right,n=false;if(!s)if(a&&xt<c*o){if(kt=!kt&&(1===bt?t+c*r/2<l:l<i-c*r/2)?true:kt)n=true;else if(1===bt?l<t+xt:i-xt<l)return-bt}else if(t+c*(1-o)/2<l&&l<i-c*(1-o)/2)return function(t){return D(J)<D(t)?1:-1}(e);if((n=n||s)&&(l<t+c*r/2||i-c*r/2<l))return t+c/2<l?1:-1;return 0}(t,l,S,o,O?1:c.swapThreshold,null==c.invertedSwapThreshold?c.swapThreshold:c.invertedSwapThreshold,St,gt===l)))for(var Z=D(J);(k=K.children[Z-=w])&&("none"===_(k,"display")||k===X););if(0===w||k===l)return U(false);bt=w;var N=(gt=l).nextElementSibling,q=false,O=Rt($,a,J,n,l,S,t,q=1===w);if(false!==O)return 1!==O&&-1!==O||(q=1===O),Ct=true,setTimeout(Bt,30),V(),q&&!N?a.appendChild(J):l.parentNode.insertBefore(J,q?N:l),z&&H(z,0,b-z.scrollTop),K=J.parentNode,void 0===y||St||(xt=Math.abs(y-C(l)[L])),B(),U(true)}}else{if(g===J)return U(false);if((l=g&&a===t.target?g:l)&&(S=C(l)),false!==Rt($,a,J,n,l,S,t,!!l))return V(),g&&g.nextSibling?a.insertBefore(J,g.nextSibling):a.appendChild(J),K=a,B(),U(true)}if(a.contains(J))return U(false)}return false}function A(r,s){G(r,p,e({evt:t,isOwner:f,axis:o?"vertical":"horizontal",revert:i,dragRect:n,targetRect:S,canSort:h,fromSortable:v,target:l,completed:U,onMove:function(e,i){return Rt($,a,J,n,e,C(e),t,i)},changed:B},s))}function V(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==v&&v.captureAnimationState()}function U(e){return A("dragOverCompleted",{insertion:e}),e&&(f?d._hideClone():d._showClone(p),p!==v&&(E(J,(ct||d).options.ghostClass,false),E(J,c.ghostClass,true)),ct!==p&&p!==jt.active?ct=p:p===jt.active&&ct&&(ct=null),v===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==v&&(v.animateAll(),v._ignoreWhileAnimating=null)),(l===J&&!J.animated||l===a&&!l.animated)&&(gt=null),c.dragoverBubble||t.rootEl||l===document||(J.parentNode[R]._isOutsideThisEl(t.target),e||At(t)),!c.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=true}function B(){rt=D(J),at=D(J,c.draggable),W({sortable:p,name:"change",toEl:a,newIndex:rt,newDraggableIndex:at,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",At),m(document,"mousemove",At),m(document,"touchmove",At)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;rt=D(J),at=D(J,n.draggable),G("drop",this,{evt:t}),K=J&&J.parentNode,rt=D(J),at=D(J,n.draggable),jt.eventCanceled||(kt=St=yt=false,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qt(this.cloneId),Qt(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),d&&_(document.body,"user-select",""),_(J,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),X&&X.parentNode&&X.parentNode.removeChild(X),($===K||ct&&"clone"!==ct.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),J&&(this.nativeDraggable&&m(J,"dragend",this),Ut(J),J.style["will-change"]="",mt&&!yt&&E(J,(ct||this).options.ghostClass,false),E(J,this.options.chosenClass,false),W({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:t}),$!==K?(0<=rt&&(W({rootEl:K,name:"add",toEl:K,fromEl:$,originalEvent:t}),W({sortable:this,name:"remove",toEl:K,originalEvent:t}),W({rootEl:K,name:"sort",toEl:K,fromEl:$,originalEvent:t}),W({sortable:this,name:"sort",toEl:K,originalEvent:t})),ct&&ct.save()):rt!==ot&&0<=rt&&(W({sortable:this,name:"update",toEl:K,originalEvent:t}),W({sortable:this,name:"sort",toEl:K,originalEvent:t})),jt.active&&(null!=rt&&-1!==rt||(rt=ot,at=st),W({sortable:this,name:"end",toEl:K,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){G("nulling",this),$=J=K=X=tt=nt=et=it=ut=dt=mt=rt=at=ot=st=gt=bt=ct=lt=jt.dragged=jt.ghost=jt.clone=jt.active=null,Mt.forEach((function(t){t.checked=true})),Mt.length=ft=ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":J&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,i=0,o=n.length,r=this.options;i<o;i++)x(t=n[i],r.draggable,this.el,false)&&e.push(t.getAttribute(r.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;for(;n--;)i+=e.charCodeAt(n);return i.toString(36)}(t));return e},sort:function(t,e){var n={},i=this.el;this.toArray().forEach((function(t,e){e=i.children[e];x(e,this.options.draggable,i,false)&&(n[t]=e)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(i.removeChild(n[t]),i.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return x(t,e||this.options.draggable,this.el,false)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var i=Q.modifyOption(this,t,e);n[t]=void 0!==i?i:e,"group"===t&&Zt(n)},destroy:function(){G("destroy",this);var t=this.el;t[R]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),_t.splice(_t.indexOf(this.el),1),this.el=t=null},_hideClone:function(){it||(G("hideClone",this),jt.eventCanceled||(_(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),it=true))},_showClone:function(t){"clone"===t.lastPutMode?it&&(G("showClone",this),jt.eventCanceled||(J.parentNode!=$||this.options.group.revertClone?tt?$.insertBefore(nt,tt):$.appendChild(nt):$.insertBefore(nt,J),this.options.group.revertClone&&this.animate(J,nt),_(nt,"display",""),it=false)):this._hideClone()}},It&&p(document,"touchmove",(function(t){(jt.active||yt)&&t.cancelable&&t.preventDefault()})),jt.utils={on:p,off:m,css:_,find:S,is:function(t,e){return!!x(t,e,t,false)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Z,closest:x,toggleClass:E,clone:N,index:D,nextTick:Pt,cancelNextTick:Qt,detectDirection:zt,getChild:I,expando:R},jt.get=function(t){return t[R]},jt.mount=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(n=n[0].constructor===Array?n[0]:n).forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(jt.utils=e(e({},jt.utils),t.utils)),Q.mount(t)}))},jt.create=function(t,e){return new jt(t,e)};var Ft,Gt,Yt,Wt,Jt,Kt,Xt=[],$t=!(jt.version="1.15.6");function te(){Xt.forEach((function(t){clearInterval(t.pid)})),Xt=[]}function ee(){clearInterval(Kt)}var ne,ie=Z((function(t,e,n,i){if(e.scroll){var o,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=q(),u=false;Gt!==n&&(Gt=n,te(),Ft=e.scroll,o=e.scrollFn,true===Ft&&(Ft=L(n,true)));var d=0,f=Ft;do{var h=f,v=C(h),p=v.top,m=v.bottom,g=v.left,b=v.right,x=v.width,w=v.height,y=void 0,E=void 0,k=h.scrollWidth,S=h.scrollHeight,M=_(h),I=h.scrollLeft,v=h.scrollTop,E=h===c?(y=x<k&&("auto"===M.overflowX||"scroll"===M.overflowX||"visible"===M.overflowX),w<S&&("auto"===M.overflowY||"scroll"===M.overflowY||"visible"===M.overflowY)):(y=x<k&&("auto"===M.overflowX||"scroll"===M.overflowX),w<S&&("auto"===M.overflowY||"scroll"===M.overflowY)),I=y&&(Math.abs(b-r)<=a&&I+x<k)-(Math.abs(g-r)<=a&&!!I),v=E&&(Math.abs(m-s)<=a&&v+w<S)-(Math.abs(p-s)<=a&&!!v);if(!Xt[d])for(var T=0;T<=d;T++)Xt[T]||(Xt[T]={});Xt[d].vx==I&&Xt[d].vy==v&&Xt[d].el===h||(Xt[d].el=h,Xt[d].vx=I,Xt[d].vy=v,clearInterval(Xt[d].pid),0==I&&0==v||(u=true,Xt[d].pid=setInterval(function(){i&&0===this.layer&&jt.active._onTouchMove(Jt);var e=Xt[this.layer].vy?Xt[this.layer].vy*l:0,n=Xt[this.layer].vx?Xt[this.layer].vx*l:0;"function"==typeof o&&"continue"!==o.call(jt.dragged.parentNode[R],n,e,t,Jt,Xt[this.layer].el)||H(Xt[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&f!==c&&(f=L(f,false)));$t=u}}),30),h=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,o=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(o=n||o,s(),e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY),t(),o&&!o.el.contains(e)&&(r("spill"),this.onSpill({dragEl:i,putSortable:n})))};function oe(){}function re(){}oe.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();t=I(this.sortable.el,this.startIndex,this.options);t?this.sortable.el.insertBefore(e,t):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:h},i(oe,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:h},i(re,{pluginName:"removeOnSpill"});var se,ae,le,ce,ue,de=[],fe=[],he=false,ve=false,pe=false;function me(t,e){fe.forEach((function(n,i){i=e.children[n.sortableIndex+(t?Number(i):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}function ge(){de.forEach((function(t){t!==le&&t.parentNode&&t.parentNode.removeChild(t)}))}return jt.mount(new function(){function t(){for(var t in this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){t=t.originalEvent;this.sortable.nativeDraggable?p(document,"dragover",this._handleAutoScroll):this.options.supportPointer?p(document,"pointermove",this._handleFallbackAutoScroll):t.touches?p(document,"touchmove",this._handleFallbackAutoScroll):p(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(w),w=void 0},nulling:function(){Jt=Gt=Ft=$t=Kt=Yt=Wt=null,Xt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,true)},_handleAutoScroll:function(t,e){var n,i=this,o=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(o,r);Jt=t,e||this.options.forceAutoScrollFallback||c||l||d?(ie(t,this.options,s,e),n=L(s,true),!$t||Kt&&o===Yt&&r===Wt||(Kt&&ee(),Kt=setInterval((function(){var s=L(document.elementFromPoint(o,r),true);s!==n&&(n=s,te()),ie(t,i.options,s,e)}),10),Yt=o,Wt=r)):this.options.bubbleScroll&&L(s,true)!==q()?ie(t,this.options,L(s,false),false):te()}},i(t,{pluginName:"scroll",initializeByDefault:true})}),jt.mount(re,oe),jt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e=t.completed,n=t.target,i=t.onMove,o=t.activeSortable,r=t.changed,s=t.cancel;o.options.swap&&(t=this.sortable.el,o=this.options,n&&n!==t&&(t=ne,ne=false!==i(n)?(E(n,o.swapClass,true),n):null,t&&t!==ne&&E(t,o.swapClass,false)),r(),e(true),s())},drop:function(t){var e,n,i=t.activeSortable,o=t.putSortable,r=t.dragEl,s=o||this.sortable,a=this.options;ne&&E(ne,a.swapClass,false),ne&&(a.swap||o&&o.options.swap)&&r!==ne&&(s.captureAnimationState(),s!==i&&i.captureAnimationState(),n=ne,t=(e=r).parentNode,a=n.parentNode,t&&a&&!t.isEqualNode(n)&&!a.isEqualNode(e)&&(o=D(e),r=D(n),t.isEqualNode(a)&&o<r&&r++,t.insertBefore(n,t.children[o]),a.insertBefore(e,a.children[r])),s.animateAll(),s!==i&&i.animateAll())},nulling:function(){ne=null}},i(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),jt.mount(new function(){function t(t){for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?p(document,"pointerup",this._deselectMultiDrag):(p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag))),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:false,setData:function(e,n){var i="";de.length&&ae===t?de.forEach((function(t,e){i+=(e?", ":"")+t.textContent})):i=n.textContent,e.setData("Text",i)}}}return t.prototype={multiDragKeyDown:false,isMultiDrag:false,delayStartGlobal:function(t){t=t.dragEl;le=t},delayEnded:function(){this.isMultiDrag=~de.indexOf(le)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<de.length;n++)fe.push(N(de[n])),fe[n].sortableIndex=de[n].sortableIndex,fe[n].draggable=false,fe[n].style["will-change"]="",E(fe[n],this.options.selectedClass,false),de[n]===le&&E(fe[n],this.options.chosenClass,false);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.rootEl,i=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||de.length&&ae===e&&(me(true,n),i("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,t=t.cancel;this.isMultiDrag&&(me(false,n),fe.forEach((function(t){_(t,"display","")})),e(),ue=false,t())},hideClone:function(t){var e=this,n=t.cloneNowHidden,t=t.cancel;this.isMultiDrag&&(fe.forEach((function(t){_(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)})),n(),ue=true,t())},dragStartGlobal:function(t){!this.isMultiDrag&&ae&&ae.multiDrag._deselectMultiDrag(),de.forEach((function(t){t.sortableIndex=D(t)})),de=de.sort((function(t,e){return t.sortableIndex-e.sortableIndex})),pe=true},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(de.forEach((function(t){t!==le&&_(t,"position","absolute")})),e=C(le,false,true,true),de.forEach((function(t){t!==le&&A(t,e)})),he=ve=true)),t.animateAll((function(){he=ve=false,n.options.animation&&de.forEach((function(t){V(t)})),n.options.sort&&ge()})))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;ve&&~de.indexOf(e)&&(n(false),t())},revert:function(t){var e,n,i=t.fromSortable,o=t.rootEl,r=t.sortable,s=t.dragRect;1<de.length&&(de.forEach((function(t){r.addAnimationState({target:t,rect:ve?C(t):s}),V(t),t.fromRect=s,i.removeAnimationState(t)})),ve=false,e=!this.options.removeCloneOnHide,n=o,de.forEach((function(t,i){i=n.children[t.sortableIndex+(e?Number(i):0)];i?n.insertBefore(t,i):n.appendChild(t)})))},dragOverCompleted:function(t){var e,n=t.sortable,i=t.isOwner,o=t.insertion,r=t.activeSortable,s=t.parentEl,a=t.putSortable,t=this.options;o&&(i&&r._hideClone(),he=false,t.animation&&1<de.length&&(ve||!i&&!r.options.sort&&!a)&&(e=C(le,false,true,true),de.forEach((function(t){t!==le&&(A(t,e),s.appendChild(t))})),ve=true),i||(ve||ge(),1<de.length?(i=ue,r._showClone(n),r.options.animation&&!ue&&i&&fe.forEach((function(t){r.addAnimationState({target:t,rect:ce}),t.fromRect=ce,t.thisAnimationDuration=null}))):r._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;de.forEach((function(t){t.thisAnimationDuration=null})),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(ce=i({},e),e=k(le,true),ce.top-=e.f,ce.left-=e.e)},dragOverAnimationComplete:function(){ve&&(ve=false,ge())},drop:function(t){var e,n,i,o,r,s,a,l=t.originalEvent,c=t.rootEl,u=t.parentEl,d=t.sortable,f=t.dispatchSortableEvent,h=t.oldIndex,t=t.putSortable,v=t||this.sortable;l&&(e=this.options,n=u.children,pe||(e.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),E(le,e.selectedClass,!~de.indexOf(le)),~de.indexOf(le)?(de.splice(de.indexOf(le),1),se=null,F({sortable:d,rootEl:c,name:"deselect",targetEl:le,originalEvent:l})):(de.push(le),F({sortable:d,rootEl:c,name:"select",targetEl:le,originalEvent:l}),l.shiftKey&&se&&d.el.contains(se)?(i=D(se),o=D(le),~i&&~o&&i!==o&&function(){for(var t,r=i<o?(t=i,o):(t=o,i+1),s=e.filter;t<r;t++)~de.indexOf(n[t])||x(n[t],e.draggable,u,false)&&(s&&("function"==typeof s?s.call(d,l,n[t],d):s.split(",").some((function(e){return x(n[t],e.trim(),u,false)})))||(E(n[t],e.selectedClass,true),de.push(n[t]),F({sortable:d,rootEl:c,name:"select",targetEl:n[t],originalEvent:l})))}()):se=le,ae=v)),pe&&this.isMultiDrag&&(ve=false,(u[R].options.sort||u!==c)&&1<de.length&&(r=C(le),s=D(le,":not(."+this.options.selectedClass+")"),!he&&e.animation&&(le.thisAnimationDuration=null),v.captureAnimationState(),he||(e.animation&&(le.fromRect=r,de.forEach((function(t){var e;t.thisAnimationDuration=null,t!==le&&(e=ve?C(t):r,t.fromRect=e,v.addAnimationState({target:t,rect:e}))}))),ge(),de.forEach((function(t){n[s]?u.insertBefore(t,n[s]):u.appendChild(t),s++})),h===D(le)&&(a=false,de.forEach((function(t){t.sortableIndex!==D(t)&&(a=true)})),a&&(f("update"),f("sort")))),de.forEach((function(t){V(t)})),v.animateAll()),ae=v),(c===u||t&&"clone"!==t.lastPutMode)&&fe.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})))},nullingGlobal:function(){this.isMultiDrag=pe=false,fe.length=0},destroyGlobal:function(){this._deselectMultiDrag(),m(document,"pointerup",this._deselectMultiDrag),m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==pe&&pe||ae!==this.sortable||t&&x(t.target,this.options.draggable,this.sortable.el,false)||t&&0!==t.button))for(;de.length;){var e=de[0];E(e,this.options.selectedClass,false),de.shift(),F({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=true)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=false)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[R];e&&e.options.multiDrag&&!~de.indexOf(t)&&(ae&&ae!==e&&(ae.multiDrag._deselectMultiDrag(),ae=e),E(t,e.options.selectedClass,true),de.push(t))},deselect:function(t){var e=t.parentNode[R],n=de.indexOf(t);e&&e.options.multiDrag&&~n&&(E(t,e.options.selectedClass,false),de.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return de.forEach((function(i){var o;e.push({multiDragElement:i,index:i.sortableIndex}),o=ve&&i!==le?-1:ve?D(i,":not(."+t.options.selectedClass+")"):D(i),n.push({multiDragElement:i,index:o})})),{items:r(de),clones:[].concat(fe),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),jt}))})(bt);return bt.exports}var Et=yt();var _t=R(Et);var kt='@-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;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;-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{opacity:0.3;padding:0 10px;cursor:pointer;background:none;height:32px;border:1px solid #cccccc;border-radius:32px}verdocs-template-roles .add-role:hover{opacity:1}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 .sequence-roles{display:-ms-flexbox;display:flex;max-width:400px}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 St='<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 qt='<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 Ct='<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 Mt='<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 It='<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 Tt=t("verdocs_template_roles",function(){function t(t){e(this,t);this.next=n(this,"next");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.rolesUpdated=n(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId="";this.showingRoleDialog=null;this.sender=null;this.dragging=false;this.loading=true;this.template=null;this.sortableRefs=[]}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate();this.cleanupSortables()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[ROLES] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){console.log("[ROLES] Template Updated",e);t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[ROLES] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.cleanupSortables=function(){this.sortableRefs.forEach((function(t){return t.destroy()}));this.sortableRefs.length=0};t.prototype.componentDidRender=function(){var t=this;this.cleanupSortables();var e=this.getSequenceNumbers();(e||[]).forEach((function(e){var n=document.getElementById("verdocs-roles-sequence-".concat(e));if(n){var i=new _t(n,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:t.handleMoveEnd.bind(t),onChoose:function(){return t.dragging=true},onUnchoose:function(){return t.dragging=false}});t.sortableRefs.push(i)}}));var n=document.getElementById("verdocs-roles-sequence-add-target");if(n){console.log("[ROLES] Applying sortable to add-sequence slot");var i=new _t(n,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:function(){return t.dragging=true},onUnchoose:function(){return t.dragging=false}});this.sortableRefs.push(i)}};t.prototype.handleMoveEnd=function(t){var e=this;var n=+t.from.dataset.sequence;var i=+t.to.dataset.sequence;var o=+t.oldIndex+1;var r=+t.newIndex+1;console.log("Move from ".concat(n,":").concat(o," to ").concat(i,":").concat(r),t.item);var s={};var a=this.getSequenceNumbers();a.forEach((function(t){var n=e.getRolesAtSequence(t);s[String(t)]=JSON.parse(JSON.stringify(n))}));s[a[a.length-1]+1]=[];var l=s[n].splice(o-1,1)[0];s[i]||(s[i]=[]);s[i].splice(r-1,0,l);var c=[];Object.entries(s).forEach((function(t){var n=t[0],i=t[1];i.forEach((function(t,i){if(!t){return}var o=+i+1;if(t.sequence!==+n||t.order!==o){t.sequence=+n;t.order=o;c.push(x(e.endpoint,e.templateId,t.name,{sequence:+n,order:o}).then((function(e){return console.log("[ROLES] Updated role",t.name,e)})).catch((function(t){return console.log("[ROLES] Error updating role",t)})))}}))}));return Promise.all(c).then((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){return[2,console.log("[ROLES] Done renumbering")]}))}))})).catch((function(t){return console.log("[ROLES] Error updating roles",t)}))};t.prototype.handleCancel=function(){var t;(t=this.exit)===null||t===void 0?void 0:t.emit()};t.prototype.handleSubmit=function(){var t;(t=this.next)===null||t===void 0?void 0:t.emit()};t.prototype.getSortedRoles=function(){var t;return(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).sort((function(t,e){return t.sequence===e.sequence?t.order-e.order:t.sequence-e.sequence}))};t.prototype.getSequenceNumbers=function(){var t={};this.getSortedRoles().forEach((function(e){t[e.sequence]=true}));console.log("[ROLES] Sequences",t);return Object.keys(t).map((function(t){return+t})).sort((function(t,e){return t-e}))};t.prototype.getRoleNames=function(){var t=this.getSortedRoles();return t.map((function(t){return t.name}))};t.prototype.getRolesAtSequence=function(t){var e;return(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).filter((function(e){return e&&e.sequence===t}))};t.prototype.renumberTemplateRoles=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n,i;var o=this;return __generator(this,(function(r){switch(r.label){case 0:e={};n=[];i=this.getSequenceNumbers();(i||[]).forEach((function(t){(e[t]||[]).forEach((function(e,i){var r=+i+1;if(e.sequence!==+t||e.order!==r){console.log("[ROLES] Updating role",e.name,"from",e.sequence,e.order,"to",t,r);e.sequence=+t;e.order=r;n.push(x(o.endpoint,o.templateId,e.name,{sequence:+t,order:r}).then((function(t){return console.log("[ROLES] Updated role",e.name,t)})).catch((function(t){return console.log("[ROLES] Error updating role",t)})))}}))}));console.log("[ROLES] Awaiting ".concat(n.length," renumber requests"));return[4,Promise.all(n).then((function(){return __awaiter(o,void 0,void 0,(function(){var t;return __generator(this,(function(n){t=JSON.parse(JSON.stringify(this.template));t.roles=Object.keys(e).reduce((function(t,n){return t.concat(e[n])}),[]);console.log("[ROLES] Done renumbering",t.roles.map((function(t){return{name:t.name,sequence:t.sequence,order:t.order}})));_.updateTemplate(this.templateId,t);return[2]}))}))}))];case 1:r.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))};t.prototype.getNextRoleName=function(){var t,e;var n="";var i=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).length;do{i++;n="Recipient ".concat(i)}while(!n||(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).some((function(t){return t&&t.name===n})));return n};t.prototype.callCreateRole=function(t,e,n){var i=this;console.log("[ROLES] Will create role",{name:t,sequence:e,order:n});w(this.endpoint,this.templateId,{template_id:this.templateId,name:t,sequence:e,message:"",order:n,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(t){return __awaiter(i,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:console.log("[ROLES] Created role",t);console.log("Updating template in data store");return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 1:n.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(t){console.log("[ROLES] Error creating role",t)}))};t.prototype.handleAddRole=function(t,e){t.stopPropagation();var n=this.getRolesAtSequence(e).length+1;var i=this.getNextRoleName();this.callCreateRole(i,e,n)};t.prototype.handleAddStep=function(t,e){t.stopPropagation();var n=1;var i=this.getNextRoleName();this.callCreateRole(i,e,n)};t.prototype.render=function(){var t=this;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(o,{class:"loading"},i("verdocs-loader",null))}var e=this.getRoleNames();var n=this.getSequenceNumbers();var r=n&&n.length>0?(n[n.length-1]||0)+1:1;console.log("[ROLES] Rendering",{roleNames:e,sequences:n,nextSequence:r});return i(o,{class:{dragging:this.dragging}},i("form",{onSubmit:function(t){return t.preventDefault()},onClick:function(t){return t.stopPropagation()},autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"roles"},n.map((function(e,n){return i("div",{class:"sequence"},i("div",{class:"sequence-label no-drag"},n+1,"."),i("div",{class:"sequence-roles",id:"verdocs-roles-sequence-".concat(e),"data-sequence":e},t.getRolesAtSequence(e).map((function(n){var o=!n.email||!n.first_name||!n.last_name;return o?i("div",{class:"role","data-rolename":n.name,"data-sequence":e,"data-order":n.order},i("div",{class:"role-name"},n.name),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:St,onClick:function(){return t.showingRoleDialog=n.name},"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:n.type==="signer"?Ct:n.type==="cc"?It:Mt}))):i("div",{class:"role","data-rolename":n.name,"data-sequence":e,"data-order":n.order},i("div",{class:"role-name"},h(n)),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:St,onClick:function(){return t.showingRoleDialog=n.name},"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:n.type==="signer"?Ct:n.type==="cc"?It:Mt})))}))),i("button",{class:"add-role no-drag",onClick:function(n){return t.handleAddRole(n,e)}},"+ Add Role"))})),i("div",{class:"sequence add-sequence"},i("div",{class:"sequence-label no-drag"},n.length+1,"."),i("div",{class:"sequence-roles",id:"verdocs-roles-sequence-add-target","data-sequence":r}),i("button",{class:"add-role no-drag",onClick:function(e){return t.handleAddRole(e,r)}},"+ Add Role"))),e.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:qt})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return t.handleCancel()}}),i("verdocs-button",{label:"OK",size:"small",onClick:function(){return t.handleSubmit()},disabled:e.length<1}))),this.showingRoleDialog&&i("verdocs-menu-panel",{onClose:function(){return t.showingRoleDialog=null}},i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){var e;(e=document.getElementById("verdocs-menu-panel-overlay"))===null||e===void 0?void 0:e.remove();t.showingRoleDialog=null},onDelete:function(){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:e.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}})))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());Tt.style=kt;var Dt='@-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-settings{display:block;max-width:600px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .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-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}';var Ot=24*60*60*1e3;var Lt=t("verdocs_template_settings",function(){function t(t){e(this,t);this.next=n(this,"next");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.templateUpdated=n(this,"templateUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId="";this.name=null;this.visibility="private";this.sender="envelope_creator";this.sendReminders=false;this.initialReminder=0;this.followupReminders=0;this.dirty=false;this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[SETTINGS] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){console.log("[SETTINGS] Template Updated",e);t.template=e;t.name=e.name;t.visibility=e.visibility;t.sender=e.sender;t.sendReminders=e.initial_reminder!==null;t.initialReminder=e.initial_reminder?Math.floor(e.initial_reminder/Ot):null;t.followupReminders=e.followup_reminders?Math.floor(e.followup_reminders/Ot):null;t.dirty=false;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){try{this.endpoint.loadSession();if(!this.templateId){console.log("[SETTINGS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SETTINGS] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(i){console.log("[SETTINGS] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.handleCancel=function(){var t;(t=this.exit)===null||t===void 0?void 0:t.emit()};t.prototype.handleSubmit=function(){var t=this;y(this.endpoint,this.templateId,{name:this.name,visibility:this.visibility,sender:this.sender,initial_reminder:this.sendReminders?this.initialReminder*Ot:null,followup_reminders:this.sendReminders?this.followupReminders*Ot:null}).then((function(e){var n,i;console.log("[SETTINGS] Template Updated",e);t.dirty=false;t.name=e.name;t.visibility=e.visibility;t.sender=e.sender;t.sendReminders=e.initial_reminder!==null;t.initialReminder=e.initial_reminder?Math.floor(e.initial_reminder/Ot):null;t.followupReminders=e.followup_reminders?Math.floor(e.followup_reminders/Ot):null;(n=t.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:t.endpoint,template:e,event:"update"});(i=t.next)===null||i===void 0?void 0:i.emit()})).catch((function(e){var n,i,o,r,s;console.log("[SETTINGS] Error updating template",e);(n=t.sdkError)===null||n===void 0?void 0:n.emit(new E(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(o=e.response)===null||o===void 0?void 0:o.data));S(((s=(r=e.response)===null||r===void 0?void 0:r.data)===null||s===void 0?void 0:s.error)||"Error updating template, please try again later.")}))};t.prototype.render=function(){var t=this;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(o,{class:"loading"},i("verdocs-loader",null))}return i(o,null,i("form",{onSubmit:function(t){return t.preventDefault()},onClick:function(t){return t.stopPropagation()},autocomplete:"off"},i("h5",null,"Settings"),i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"Template Name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(e){t.name=e.target.value;t.dirty=true}})),i("div",{class:"row"},i("verdocs-select-input",{label:"Visibility",value:this.visibility,onInput:function(e){t.visibility=e.target.value;t.dirty=true},options:[{value:"private",label:"Private"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}]})),i("div",{class:"row"},i("verdocs-select-input",{label:"Owner for envelopes created from this template",value:this.sender,onInput:function(e){t.sender=e.target.value;t.dirty=true},options:[{value:"envelope_creator",label:"Envelope Creator"},{value:"template_owner",label:"Template Owner"}]})),i("div",{class:"row"},i("label",null,"Send Reminders"),i("verdocs-switch",{checked:this.sendReminders,onCheckedChange:function(e){return t.sendReminders=e.detail}})),this.sendReminders&&i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"First Reminder (days)",value:String(this.initialReminder||0),autocomplete:"off",placeholder:"Delay in days...",onInput:function(e){t.initialReminder=+e.target.value;t.dirty=true}})),this.sendReminders&&i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"Follow-up Reminders (days)",value:String(this.followupReminders||0),autocomplete:"off",placeholder:"Delay in days...",onInput:function(e){t.followupReminders=+e.target.value;t.dirty=true}})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return t.handleCancel()}}),i("verdocs-button",{label:"Save",size:"small",onClick:function(){return t.handleSubmit()},disabled:!this.dirty}))))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());Lt.style=Dt}}}));
3
- //# sourceMappingURL=p-1653b309.system.entry.js.map
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,n,i){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i["throw"](t))}catch(t){r(t)}}function l(t){t.done?n(t.value):o(t.value).then(s,a)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];o=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var i=0,o=e.length,r;i<o;i++){if(r||!(i in e)){if(!r)r=Array.prototype.slice.call(e,0,i);r[i]=e[i]}}return t.concat(r||Array.prototype.slice.call(e))};System.register(["./p-gAi_FRvp.system.js","@verdocs/js-sdk","./p-7Iu0_GGa.system.js","./p-CmnBGerV.system.js","./p-C9y1KCYV.system.js","./p-CrzDCQEM.system.js","./p-Cb4o7DUm.system.js","./p-DmF0GSqu.system.js","./p-DE0Cygqz.system.js","./p-CD5uiThi.system.js","./p-Bzy18UgU.system.js","./p-80p0Fzir.system.js"],(function(t){"use strict";var e,n,i,o,r,s,a,l,c,u,d,f,h,v,p,m,g,b,x,w,y,E,_,k,S,q,C,M,T,I,D,O,L,z,Z,H,N,A,V,j,R;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.H;r=t.F;s=t.g},function(t){a=t.VerdocsEndpoint;l=t.getTemplate;c=t.integerSequence;u=t.getOrganizationContacts;d=t.isValidEmail;f=t.createEnvelope;h=t.formatFullName;v=t.getRGBA;p=t.createTemplateDocument;m=t.deleteTemplateDocument;g=t.updateField;b=t.createField;x=t.updateTemplateRole;w=t.createTemplateRole;y=t.updateTemplate},function(t){E=t.S},function(t){_=t.S},function(t){k=t.D},function(t){S=t.V},function(t){q=t.D;C=t.P;M=t.J;T=t.a;I=t.F;D=t.b;O=t.T},function(t){L=t.d},function(t){z=t.i},function(t){Z=t.g;H=t.e;N=t.f;A=t.h;V=t.i;j=t.j},function(t){R=t.g},null],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-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 B=t("verdocs_preview",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.onTemplateIdChanged=function(t){console.log("[PREVIEW] Template ID changed",t);this.listenToTemplate()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[PREVIEW] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.handlePageRendered=function(t){};t.prototype.render=function(){var t=this;var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}return i(o,null,(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((function(e){var n=c(1,e.pages);return i(r,null,n.map((function(n){var o;var r=((o=e.page_sizes)===null||o===void 0?void 0:o[n])||{width:612,height:792};return i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:n,disabled:true,editable:false,done:false,virtualWidth:r.width,virtualHeight:r.height,onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());B.style=U;var P=function(t){return((t===null||t===void 0?void 0:t.roles)||[]).map((function(t){return t.name}))};var Q=function(t,e){return Math.max(P(t).findIndex((function(t){return t===e})),0)};var F='@-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 G='<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 W='<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 J='<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 K=t("verdocs_send",function(){function t(t){e(this,t);this.beforeSend=n(this,"beforeSend");this.send=n(this,"send");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.searchContacts=n(this,"searchContacts");this.templateListenerId=null;this.endpoint=k;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}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),true,(function(e){console.log("[SEND] Got new template",e);t.template=e;t.loading=false;t.rolesCompleted={};t.recomputeRolesCompleted()}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.rolesCompleted={};return[2]}))}))};t.prototype.onTemplateIdChanged=function(t){console.log("[SEND] Template ID changed",t);this.listenToTemplate()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;var i=this;return __generator(this,(function(o){try{this.endpoint.onSessionChanged((function(t,e,n){if(!n){return}var o={id:n.id,first_name:n.first_name,last_name:n.last_name,email:n.email,phone:n.phone};if(n){i.sessionContacts=[o];u(i.endpoint).then((function(t){console.log("[SEND] Got contacts",t);i.sessionContacts=__spreadArray(__spreadArray([],t,true),[o],false)})).catch((function(t){console.log("[SEND] Error getting contacts",t)}))}}));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(i){console.log("[SEND] Error with send session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.recomputeRolesCompleted=function(){var t=this;var e;this.rolesCompleted={};var n={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){var i=e.sequence;n[i]||(n[i]=[]);var o="r-".concat(i,"-").concat(n[i].length);n[i].push(__assign(__assign({},e),{id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name}));if(e.first_name&&d(e.email)){t.rolesCompleted[o]=__assign(__assign({},e),{id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name})}}))};t.prototype.getSequenceNumbers=function(){var t;var e={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){e[t.sequence]=true}));return Object.keys(e).map((function(t){return+t})).sort((function(t,e){return t-e}))};t.prototype.getRolesAtLevel=function(t){var e;var n=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).filter((function(e){return e.sequence===t})).map((function(e,n){return __assign(__assign({},e),{id:"r-".concat(t,"-").concat(n),role_name:e.name,first_name:e.first_name,last_name:e.last_name})}));return n};t.prototype.getLevelIcon=function(t){if(t==="start"){return i("div",{class:"level-icon",innerHTML:Y})}else if(t==="end"){return i("div",{class:"level-icon",innerHTML:J})}else{return i("div",{class:"level-icon",innerHTML:W})}};t.prototype.handleSelectContact=function(t,e){t.preventDefault();this.rolesCompleted[e.id]=__assign(__assign({},e),t.detail);this.showPickerForId=""};t.prototype.handleClickRole=function(t,e){t.stopPropagation();this.showPickerForId=e.id};t.prototype.handleSend=function(t){var e=this;var n;if(this.sending){console.log("[SEND] Skipping duplicate send",t);return}console.log("[SEND] Sending",t);t.preventDefault();t.stopPropagation();this.sending=true;var i={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)};var o=this.beforeSend.emit(__assign(__assign({},i),{name:i.name,template:this.template}));if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",i);this.sending=false;return}console.log("[SEND] Creating envelope",i);f(this.endpoint,i).then((function(t){var n;console.log("[SEND] Send envelope",t);e.reset().catch((function(t){return console.log("Unknown Error",t)}));e.sending=false;(n=e.send)===null||n===void 0?void 0:n.emit(__assign(__assign({},i),{name:i.name,envelope_id:t.id,envelope:t}))})).catch((function(t){var n,i,o;console.log("[SEND] Send error",t);S(((i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.error)||"Error creating envelope, please try again later.");e.sending=false;(o=e.sdkError)===null||o===void 0?void 0:o.emit(t)}))};t.prototype.handleCancel=function(t){var e;t.stopPropagation();(e=this.exit)===null||e===void 0?void 0:e.emit()};t.prototype.render=function(){var t=this;var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=this.getSequenceNumbers();var r=Object.values(this.rolesCompleted).filter((function(t){return d(t.email)&&t.first_name&&t.last_name}));var s=r.length>=P(this.template).length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),n.map((function(e){return i("div",{class:"level level-".concat(e)},t.getLevelIcon("sequence"),t.getRolesAtLevel(e).map((function(e){var n,o,s;var a=!e.email||!e.first_name||!e.last_name;var l=((n=t.rolesCompleted[e.id])===null||n===void 0?void 0:n.first_name)?h(t.rolesCompleted[e.id]):a?e.role_name:h(e);var c="verdocs-send-recipient-".concat(e.role_name);var u=Q(t.template,e.role_name);var d=v(u);var f=r.findIndex((function(t){return t.role_name===e.role_name}))>-1;var p={backgroundColor:d,border:f?"2px solid #55bc81":"2px solid #dddddd"};return a?i("div",{class:"recipient","data-ri":u,"data-rn":e.role_name,style:p,onClick:function(n){return t.handleClickRole(n,e)},id:c},l,i("div",{class:"icon",innerHTML:G}),t.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:function(){return t.showPickerForId=""}},i("verdocs-contact-picker",{onExit:function(){return t.showPickerForId=""},onNext:function(n){return t.handleSelectContact(n,e)},contactSuggestions:t.sessionContacts,templateRole:(o=t.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:function(e){var n;return(n=t.searchContacts)===null||n===void 0?void 0:n.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":u,"data-rn":e.role_name,style:p,onClick:function(n){return t.handleClickRole(n,e)},id:c},l,i("div",{class:"icon",innerHTML:G}),t.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:function(){return t.showPickerForId=""}},i("verdocs-contact-picker",{onExit:function(){return t.showPickerForId=""},onNext:function(n){return t.handleSelectContact(n,e)},contactSuggestions:t.sessionContacts,templateRole:(s=t.rolesCompleted[e.id])!==null&&s!==void 0?s:e,onSearchContacts:function(e){var n;return(n=t.searchContacts)===null||n===void 0?void 0:n.emit(e.detail)}})))})))})),i("div",{class:"level level-done"},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(e){return t.handleCancel(e)},disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!s||this.sending,onClick:function(e){return t.handleSend(e)}}),this.sending&&i("verdocs-spinner",null)))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());K.style=F;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 $=t("verdocs_template_attachments",function(){function t(t){e(this,t);this.exit=n(this,"exit");this.next=n(this,"next");this.templateUpdated=n(this,"templateUpdated");this.sdkError=n(this,"sdkError");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}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[TEMPLATE ATTACHMENTS] Error loading template",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.handleCancel=function(t){t.stopPropagation();this.exit.emit()};t.prototype.handleUploadProgress=function(t){if(t>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=t}};t.prototype.handleUpload=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:t.stopPropagation();r=t.detail.file;if(!r){return[2]}console.log("[ATTACHMENTS] Uploading...",r);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,p(this.endpoint,this.templateId,r,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);(e=this.templateUpdated)===null||e===void 0?void 0:e.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);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new E(l.message,(i=l.response)===null||i===void 0?void 0:i.status,(o=l.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};t.prototype.handleNext=function(t){var e;t.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(e=this.next)===null||e===void 0?void 0:e.emit({template:this.template})};t.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,m(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:e.sent();t=this;return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 2:t.template=e.sent();console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null;return[2]}}))}))};t.prototype.handleDelete=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){if((((e=this.template)===null||e===void 0?void 0:e.documents)||[]).length>1){this.confirmDeleteDocument=t}else{this.showDeleteError=true}return[2]}))}))};t.prototype.getFileIcon=function(t){switch(t.mime){case"application/pdf":return T;case"image/jpeg":return M;case"image/png":return C;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return q}return I};t.prototype.render=function(){var t=this;var e,n;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return i(o,{class:"loading"},i("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return i(o,{class:"empty"})}return i(o,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((function(e){return i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:t.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.pages),i("div",{class:"pages-icon",innerHTML:D})),i("div",{class:"trash-icon",innerHTML:O,onClick:function(){return t.handleDelete(e)}}))}))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:function(e){return t.handleUpload(e)}}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(e){return t.handleCancel(e)},disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:function(e){return t.handleNext(e)},disabled:!(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).length||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return t.showDeleteError=false}}),this.confirmDeleteDocument&&i("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 t.confirmDelete()},showCancel:true,onExit:function(){t.confirmDeleteDocument=null}}))};return t}());$.style=X;var tt='@-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 et='<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 nt='<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 it=["attachments","roles","settings","fields","preview"];var ot=t("verdocs_template_build_tabs",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.stepChanged=n(this,"stepChanged");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.onTemplateIdChanged=function(t){console.log("[BUILD_TABS] Template ID changed",t);this.listenToTemplate()};t.prototype.onStepChanged=function(t){console.log("[BUILD_TABS] Step changed",t)};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[BUILD_TABS] Error loading template",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.setStep=function(t){var e;console.log("[BUILD_TABS] Selected step",t.detail.tab.id);t.stopPropagation();t.preventDefault();this.step=t.detail.tab.id;(e=this.stepChanged)===null||e===void 0?void 0:e.emit(t.detail.tab.id)};t.prototype.copyTemplateId=function(){var t=this;navigator.clipboard.writeText(this.templateId).then((function(){S("Template ID copied",{style:"success",duration:3e3})})).catch((function(e){var n;console.warn("[BUILD_TABS] Error copying to clipboard",e);(n=t.sdkError)===null||n===void 0?void 0:n.emit(e)}))};t.prototype.render=function(){var t=this;var e,n,r,s,a,l,c,u,d;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var f=(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).length>0;var h=f&&(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).length>0;var v=h&&(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).length>0;var p=Math.max(it.indexOf(this.step),0);if(!v&&p>=4){p=3}if(!h&&p>=3){p=1}if(!f&&p>=1){p=0}return i(o,null,i("verdocs-tabs",{onSelectTab:function(e){return t.setStep(e)},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&&i("div",{class:"info"},i("verdocs-button-panel",{icon:et},i("div",{class:"template-details-panel"},i("h6",null,"Template Details"),i("div",{class:"row"},i("label",null,"ID:"),i("div",{class:"value"},this.templateId),i("div",{class:"icon-button",innerHTML:nt,onClick:function(){return t.copyTemplateId()}})),i("div",{class:"row"},i("label",null,"Name:"),i("div",{class:"value"},(s=this.template)===null||s===void 0?void 0:s.name)),i("div",{class:"row"},i("label",null,"Visibility:"),i("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")),i("div",{class:"row"},i("label",null,"Created:"),i("div",{class:"value"},((c=this.template)===null||c===void 0?void 0:c.counter)?L.format(new Date((u=this.template)===null||u===void 0?void 0:u.created_at),"P p"):"")),i("div",{class:"row"},i("label",null,"Used:"),i("div",{class:"value"},(d=this.template)===null||d===void 0?void 0:d.counter," time(s)"))))))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return t}());ot.style=tt;var rt="@-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 st='<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 at='<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 lt='<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 ct='<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 ut='<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 dt='<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 ft='<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 ht='<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 vt='<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 pt='<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 mt=[{id:"signature",tooltip:"Signature",icon:ut,class:"signature"},{id:"initial",tooltip:"Initials",icon:dt,class:"initial"},{id:"sep1",tooltip:"",icon:pt,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:st,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:at,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:lt,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:ht,class:"dropdown"},{id:"sep2",tooltip:"",icon:pt,class:"separator"},{id:"date",tooltip:"Date",icon:ct,class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:ft,class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:vt,class:"attachment"}];var gt=t("verdocs_template_fields",function(){function t(t){e(this,t);this.sdkError=n(this,"sdkError");this.templateUpdated=n(this,"templateUpdated");this.fieldsUpdated=n(this,"fieldsUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}t.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.placing=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[FIELDS] Error with fields session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.componentDidRender=function(){z.dynamicDrop(true);var t=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var e=document.getElementById("verdocs-template-fields-toolbar");if(t&&e){console.log("[FIELDS] Moving toolbar");e.remove();t.append(e)}};t.prototype.componentWillUpdate=function(){var t=this;var e,n;var i=((e=this.template)===null||e===void 0?void 0:e.roles)||[];if(!this.selectedRoleName||!i.find((function(e){return e&&e.name===t.selectedRoleName}))){this.selectedRoleName=((n=i[0])===null||n===void 0?void 0:n.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){var n,i;t.template=e;t.loading=false;if(!t.selectedRoleName){t.selectedRoleName=((i=(n=e.roles)===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.name)||""}}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.attachFieldAttributes=function(t,e,n){var i=this;n.addEventListener("settingsChanged",(function(){var t;(t=i.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:i.endpoint,template:i.template,event:"added-field"})}));n.addEventListener("deleted",(function(){var t;n.remove();(t=i.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:i.endpoint,template:i.template,event:"updated-field"})}));n.setAttribute("templateid",this.templateId);n.setAttribute("fieldname",e.name);n.setAttribute("pageNumber",String(t.pageNumber));n.setAttribute("xScale",String(t.xScale));n.setAttribute("yScale",String(t.yScale));n.setAttribute("name",e.name)};t.prototype.handlePageRendered=function(t){var e=this;var n;var i=t.detail;this.cachedPageInfo[i.pageNumber]=i;this.pageHeights[i.pageNumber]=i.naturalHeight;(((n=this.template)===null||n===void 0?void 0:n.fields)||[]).filter((function(t){return t&&t.page===i.pageNumber})).forEach((function(t){var n=Z(t);var i=document.getElementById(n);if(i){i.setAttribute("fieldname",t.name);i.setAttribute("pagenumber",String(t.page));e.makeDraggable(i)}}))};t.prototype.makeDraggable=function(t){z(t).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};t.prototype.handleMoveField=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s;return __generator(this,(function(a){e=+(t.target.getAttribute("posX")||0);n=+(t.target.getAttribute("posY")||0);i=+(t.target.getAttribute("xScale")||1);o=+(t.target.getAttribute("yScale")||1);r=t.dx/i+e;s=t.dy/o+n;t.target.setAttribute("posX",r);t.target.setAttribute("posy",s);H(t.target,"translate","".concat(r,"px, ").concat(s,"px"));return[2]}))}))};t.prototype.handleMoveEnd=function(t){return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,r,s,a,l,c,u,d,f,h,v,p,m,b,x,w,y,k,q,C,M,T,I,D,O,L,z,Z,H,R,U,B,P,Q,F,G;return __generator(this,(function(Y){switch(Y.label){case 0:c=t.target.getAttribute("fieldname");u=(((e=this.template)===null||e===void 0?void 0:e.fields)||[]).find((function(t){return t.name===c}));if(!u){console.log("[FIELDS] Unable to find field",c,t.target);return[2]}d=t.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=t.target.getBoundingClientRect();y=t.target.parentElement;k=y.getBoundingClientRect();q=u.width||j(u.type);C=u.height||V(u.type);M=Math.max(w.left-k.left,0);T=Math.max(x-(k.bottom-w.bottom),0);I=parseInt(d);if(T>x){I=Math.min(I+1,((o=(i=((n=this.template)===null||n===void 0?void 0:n.documents)||[])===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.pages)||1);T-=x;x=this.cachedPageInfo[I].renderedHeight;console.log("Next page",{newPageNumber:I,newY:T,renderedHeight:x})}else if(T<0){I=Math.max(I-1,1);x=this.cachedPageInfo[I].renderedHeight;T+=x;console.log("[FIELDS] Next page",{newPageNumber:I,newY:T,renderedHeight:x})}D=this.viewCoordinatesToPageCoordinates(M,T,d,v-q,m-C),O=D.x,L=D.y;Y.label=1;case 1:Y.trys.push([1,3,,4]);z={x:O,y:L,page:I};return[4,g(this.endpoint,this.templateId,c,z)];case 2:Z=Y.sent();console.log("[FIELDS] Updated",Z);H=JSON.parse(JSON.stringify(this.template));R=H.fields.findIndex((function(t){return t.name===c}));if(R>-1){H.fields[R]=Z}_.updateTemplate(this.templateId,H);t.target.removeAttribute("posX");t.target.removeAttribute("posY");N(t.target);U=this.cachedPageInfo[d],B=U.xScale,P=B===void 0?1:B,Q=U.yScale,F=Q===void 0?1:Q;A(t.target,Z,P,F);(r=this.templateUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,template:H,event:"updated-field"});return[3,4];case 3:G=Y.sent();S("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",G);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new E(G.message,(a=G.response)===null||a===void 0?void 0:a.status,(l=G.response)===null||l===void 0?void 0:l.data));t.target.removeAttribute("posX");t.target.removeAttribute("posY");N(t.target);return[3,4];case 4:return[2]}}))}))};t.prototype.generateFieldName=function(t,e){var n;var i=1;var o;do{o="".concat(t,"P").concat(e,"-").concat(i);i++}while((((n=this.template)===null||n===void 0?void 0:n.fields)||[]).some((function(t){return t&&t.name===o})));return o};t.prototype.viewCoordinatesToPageCoordinates=function(t,e,n,i,o){var r=this.cachedPageInfo[n],s=r.xScale,a=s===void 0?1:s,l=r.yScale,c=l===void 0?1:l,u=r.renderedHeight,d=u===void 0?792:u;var f=Math.floor(Math.min(t/a,i));var h=Math.floor(Math.min(Math.max(d-e,0)/c,o));return{x:f,y:h}};t.prototype.handleClickPage=function(t,e){return __awaiter(this,void 0,void 0,(function(){var n,i,o,r,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];i=t.offsetX;o=t.offsetY;r=j(this.placing);s=V(this.placing);a=this.cachedPageInfo[e];l=a.naturalWidth,c=l===void 0?612:l,u=a.naturalHeight,d=u===void 0?792:u;f=this.viewCoordinatesToPageCoordinates(i,o,e,c-r,d-s);h=Math.floor(f.x);v=Math.floor(f.y);p={name:this.generateFieldName(this.placing,e),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:this.placing!=="radio",page:e,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:r,height:s,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",p);return[4,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);(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:g,event:"added-field"});this.placing=null;x.label=2;case 2:return[2]}}))}))};t.prototype.render=function(){var t;var e=this;var n,r,s;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var a=(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).map((function(t){return{value:t.name,label:t.full_name?"".concat(t.name,": ").concat(t.full_name):t.name}}));return i(o,{class:this.placing?(t={},t["placing-".concat(this.placing)]=true,t):{},onSubmit:function(){}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:a,onInput:function(t){return e.selectedRoleName=t.target.value}}),mt.map((function(t){return i("verdocs-toolbar-icon",{text:t.tooltip,icon:t.icon,class:t.class,onClick:function(){if(t.tooltip){if(e.selectedRoleName){e.placing=t.id}else{e.showMustSelectRole=true}}}})}))),i("div",{class:"pages"},(((r=this.template)===null||r===void 0?void 0:r.documents)||[]).map((function(t){var n=c(1,t.pages);return n.map((function(n){var o=t.page_sizes[n];return i("verdocs-template-document-page",{templateId:e.templateId,documentId:t.id,pageNumber:n,virtualWidth:(o===null||o===void 0?void 0:o.width)||612,virtualHeight:(o===null||o===void 0?void 0:o.height)||792,disabled:true,editable:true,done:false,onClick:function(t){return e.handleClickPage(t,n)},onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&i("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 e.showMustSelectRole=false}}))};Object.defineProperty(t,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return t}());gt.style=rt;var bt={exports:{}};
2
+ /*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */var xt=bt.exports;var wt;function yt(){if(wt)return bt.exports;wt=1;(function(t,e){!function(e,n){t.exports=n()}(xt,(function(){function t(t,e){var n,i=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)),i}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),true).forEach((function(t){var n,o;n=e,t=i[o=t],o in n?Object.defineProperty(n,o,{value:t,enumerable:true,configurable:true,writable:true}):n[o]=t})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,i=arguments[e];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function o(t,e){if(null==t)return{};var n,i=function(t,e){if(null==t)return{};for(var n,i={},o=Object.keys(t),r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(t),r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);return i}function r(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var l=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),c=a(/Edge/i),u=a(/firefox/i),d=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),f=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),v={capture:false,passive:false};function p(t,e,n){t.addEventListener(e,n,!l&&v)}function m(t,e,n){t.removeEventListener(e,n,!l&&v)}function g(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function b(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function x(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&g(t,e)||i&&t===n)return t}while(t!==n&&(t=b(t)))}return null}var w,y=/\s+/g;function E(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(y," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(y," ")))}function _(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];i[e=!(e in i||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function k(t,e){var n="";if("string"==typeof t)n=t;else do{var i=_(t,"transform")}while(i&&"none"!==i&&(n=i+" "+n),!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function S(t,e,n){if(t){var i=t.getElementsByTagName(e),o=0,r=i.length;if(n)for(;o<r;o++)n(i[o],o);return i}return[]}function q(){var t=document.scrollingElement;return t||document.documentElement}function C(t,e,n,i,o){if(t.getBoundingClientRect||t===window){var r,s,a,c,u,d,f=t!==window&&t.parentNode&&t!==q()?(s=(r=t.getBoundingClientRect()).top,a=r.left,c=r.bottom,u=r.right,d=r.height,r.width):(a=s=0,c=window.innerHeight,u=window.innerWidth,d=window.innerHeight,window.innerWidth);if((e||n)&&t!==window&&(o=o||t.parentNode,!l))do{if(o&&o.getBoundingClientRect&&("none"!==_(o,"transform")||n&&"static"!==_(o,"position"))){var h=o.getBoundingClientRect();s-=h.top+parseInt(_(o,"border-top-width")),a-=h.left+parseInt(_(o,"border-left-width")),c=s+r.height,u=a+r.width;break}}while(o=o.parentNode);return i&&t!==window&&(i=(e=k(o||t))&&e.a,t=e&&e.d,e&&(c=(s/=t)+(d/=t),u=(a/=i)+(f/=i))),{top:s,left:a,bottom:c,right:u,width:f,height:d}}}function M(t,e,n){for(var i=L(t,true),o=C(t)[e];i;){var r=C(i)[n];if(!(r<=o))return i;if(i===q())break;i=L(i,false)}return false}function T(t,e,n,i){for(var o=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==jt.ghost&&(i||s[r]!==jt.dragged)&&x(s[r],n.draggable,t,false)){if(o===e)return s[r];o++}r++}return null}function I(t,e){for(var n=t.lastElementChild;n&&(n===jt.ghost||"none"===_(n,"display")||e&&!g(n,e));)n=n.previousElementSibling;return n||null}function D(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jt.clone||e&&!g(t,e)||n++;return n}function O(t){var e=0,n=0,i=q();if(t)do{var o=k(t),r=o.a,o=o.d}while(e+=t.scrollLeft*r,n+=t.scrollTop*o,t!==i&&(t=t.parentNode));return[e,n]}function L(t,e){if(!t||!t.getBoundingClientRect)return q();var n=t,i=false;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=_(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return q();if(i||e)return n;i=true}}}while(n=n.parentNode);return q()}function z(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Z(t,e){return function(){var n;w||(1===(n=arguments).length?t.call(this,n[0]):t.apply(this,n),w=setTimeout((function(){w=void 0}),e))}}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function N(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(true):n?n(t).clone(true)[0]:t.cloneNode(true)}function A(t,e){_(t,"position","absolute"),_(t,"top",e.top),_(t,"left",e.left),_(t,"width",e.width),_(t,"height",e.height)}function V(t){_(t,"position",""),_(t,"top",""),_(t,"left",""),_(t,"width",""),_(t,"height","")}function j(t,e,n){var i={};return Array.from(t.children).forEach((function(o){var r;x(o,e.draggable,t,false)&&!o.animated&&o!==n&&(r=C(o),i.left=Math.min(null!==(o=i.left)&&void 0!==o?o:1/0,r.left),i.top=Math.min(null!==(o=i.top)&&void 0!==o?o:1/0,r.top),i.right=Math.max(null!==(o=i.right)&&void 0!==o?o:-1/0,r.right),i.bottom=Math.max(null!==(o=i.bottom)&&void 0!==o?o:-1/0,r.bottom))})),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var R="Sortable"+(new Date).getTime();function U(){var t,n=[];return{captureAnimationState:function(){n=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){var i,o;"none"!==_(t,"display")&&t!==jt.ghost&&(n.push({target:t,rect:C(t)}),i=e({},n[n.length-1].rect),!t.thisAnimationDuration||(o=k(t,true))&&(i.top-=o.f,i.left-=o.e),t.fromRect=i)}))},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n);return-1}(n,{target:t}),1)},animateAll:function(e){var i=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof e&&e());var o=false,r=0;n.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=C(n),l=n.prevFromRect,c=n.prevToRect,u=t.rect,d=k(n,true);d&&(a.top-=d.f,a.left-=d.e),n.toRect=a,n.thisAnimationDuration&&z(l,a)&&!z(s,a)&&(u.top-a.top)/(u.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(t=u,d=l,l=c,c=i.options,e=Math.sqrt(Math.pow(d.top-t.top,2)+Math.pow(d.left-t.left,2))/Math.sqrt(Math.pow(d.top-l.top,2)+Math.pow(d.left-l.left,2))*c.animation),z(a,s)||(n.prevFromRect=s,n.prevToRect=a,e=e||i.options.animation,i.animate(n,u,a,e)),e&&(o=true,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),o?t=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),n=[]},animate:function(t,e,n,i){var o,r;i&&(_(t,"transition",""),_(t,"transform",""),o=(r=k(this.el))&&r.a,r=r&&r.d,o=(e.left-n.left)/(o||1),r=(e.top-n.top)/(r||1),t.animatingX=!!o,t.animatingY=!!r,_(t,"transform","translate3d("+o+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,_(t,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),_(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){_(t,"transition",""),_(t,"transform",""),t.animated=false,t.animatingX=false,t.animatingY=false}),i))}}}var B=[],P={initializeByDefault:true},Q={mount:function(t){for(var e in P)!P.hasOwnProperty(e)||e in t||(t[e]=P[e]);B.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),B.push(t)},pluginEvent:function(t,n,i){var o=this;this.eventCanceled=false,i.cancel=function(){o.eventCanceled=true};var r=t+"Global";B.forEach((function(o){n[o.pluginName]&&(n[o.pluginName][r]&&n[o.pluginName][r](e({sortable:n},i)),n.options[o.pluginName]&&n[o.pluginName][t]&&n[o.pluginName][t](e({sortable:n},i)))}))},initializePlugins:function(t,e,n,o){for(var r in B.forEach((function(o){var r=o.pluginName;(t.options[r]||o.initializeByDefault)&&((o=new o(t,e,t.options)).sortable=t,o.options=t.options,t[r]=o,i(n,o.defaults))})),t.options){var s;t.options.hasOwnProperty(r)&&(void 0!==(s=this.modifyOption(t,r,t.options[r]))&&(t.options[r]=s))}},getEventProperties:function(t,e){var n={};return B.forEach((function(o){"function"==typeof o.eventProperties&&i(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var i;return B.forEach((function(o){t[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[e]&&(i=o.optionListeners[e].call(t[o.pluginName],n))})),i}};function F(t){var n=t.sortable,i=t.rootEl,o=t.name,r=t.targetEl,s=t.cloneEl,a=t.toEl,u=t.fromEl,d=t.oldIndex,f=t.newIndex,h=t.oldDraggableIndex,v=t.newDraggableIndex,p=t.originalEvent,m=t.putSortable,g=t.extraEventProperties;if(n=n||i&&i[R]){var b,x=n.options,t="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||l||c?(b=document.createEvent("Event")).initEvent(o,true,true):b=new CustomEvent(o,{bubbles:true,cancelable:true}),b.to=a||i,b.from=u||i,b.item=r||i,b.clone=s,b.oldIndex=d,b.newIndex=f,b.oldDraggableIndex=h,b.newDraggableIndex=v,b.originalEvent=p,b.pullMode=m?m.lastPutMode:void 0;var w,y=e(e({},g),Q.getEventProperties(o,n));for(w in y)b[w]=y[w];i&&i.dispatchEvent(b),x[t]&&x[t].call(n,b)}}function G(t,n){var i=(r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,r=o(r,Y);Q.pluginEvent.bind(jt)(t,n,e({dragEl:J,parentEl:K,ghostEl:X,rootEl:$,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:it,dragStarted:mt,putSortable:ct,activeSortable:jt.active,originalEvent:i,oldIndex:ot,oldDraggableIndex:st,newIndex:rt,newDraggableIndex:at,hideGhostForTarget:Ht,unhideGhostForTarget:Nt,cloneNowHidden:function(){it=true},cloneNowShown:function(){it=false},dispatchSortableEvent:function(t){W({sortable:n,name:t,originalEvent:i})}},r))}var Y=["evt"];function W(t){F(e({putSortable:ct,cloneEl:nt,targetEl:J,rootEl:$,oldIndex:ot,oldDraggableIndex:st,newIndex:rt,newDraggableIndex:at},t))}var J,K,X,$,tt,et,nt,it,ot,rt,st,at,lt,ct,ut,dt,ft,ht,vt,pt,mt,gt,bt,xt,wt,yt=false,Et=false,_t=[],kt=false,St=false,qt=[],Ct=false,Mt=[],Tt="undefined"!=typeof document,It=f,Dt=c||l?"cssFloat":"float",Ot=Tt&&!h&&!f&&"draggable"in document.createElement("div"),Lt=function(){if(Tt){if(l)return false;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),zt=function(t,e){var n=_(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=T(t,0,e),r=T(t,1,e),s=o&&_(o),a=r&&_(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(o).width,t=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&s.float&&"none"!==s.float){e="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==e?"horizontal":"vertical"}return o&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||i<=l&&"none"===n[Dt]||r&&"none"===n[Dt]&&i<l+t)?"vertical":"horizontal"},Zt=function(t){function e(t,n){return function(i,o,r,s){var a=i.options.group.name&&o.options.group.name&&i.options.group.name===o.options.group.name;if(null==t&&(n||a))return true;if(null==t||false===t)return false;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,o,r,s),n)(i,o,r,s);o=(n?i:o).options.group.name;return true===t||"string"==typeof t&&t===o||t.join&&-1<t.indexOf(o)}}var i={},o=t.group;o&&"object"==n(o)||(o={name:o}),i.name=o.name,i.checkPull=e(o.pull,true),i.checkPut=e(o.put),i.revertClone=o.revertClone,t.group=i},Ht=function(){!Lt&&X&&_(X,"display","none")},Nt=function(){!Lt&&X&&_(X,"display","")};Tt&&!h&&document.addEventListener("click",(function(t){if(Et)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Et=false}),true);function At(t){if(J){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,r=t.clientY,_t.some((function(t){var e=t[R].options.emptyInsertThreshold;if(e&&!I(t)){var n=C(t),i=o>=n.left-e&&o<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return i&&e?s=t:void 0}})),s);if(e){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[R]._onDragOver(i)}}var o,r,s}function Vt(t){J&&J.parentNode[R]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[R]=this;var n,o,r={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function(){return zt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.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:false!==jt.supportPointer&&"PointerEvent"in window&&(!d||f),emptyInsertThreshold:5};for(n in Q.initializePlugins(this,t,r),r)n in e||(e[n]=r[n]);for(o in Zt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&Ot,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?p(t,"pointerdown",this._onTapStart):(p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),_t.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,U())}function Rt(t,e,n,i,o,r,s,a){var u,d,f=t[R],h=f.options.onMove;return!window.CustomEvent||l||c?(u=document.createEvent("Event")).initEvent("move",true,true):u=new CustomEvent("move",{bubbles:true,cancelable:true}),u.to=e,u.from=t,u.dragged=n,u.draggedRect=i,u.related=o||e,u.relatedRect=r||C(e),u.willInsertAfter=a,u.originalEvent=s,t.dispatchEvent(u),d=h?h.call(f,u,s):d}function Ut(t){t.draggable=false}function Bt(){Ct=false}function Pt(t){return setTimeout(t,0)}function Qt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(gt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,J):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,o=i.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(!function(t){Mt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var i=e[n];i.checked&&Mt.push(i)}}(n),!J&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!d||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=x(a,i.draggable,n,false))&&a.animated||et===a)){if(ot=D(a),st=D(a,i.draggable),"function"==typeof c){if(c.call(this,t,a,this))return W({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),G("filter",e,{evt:t}),void(o&&t.preventDefault())}else if(c=c&&c.split(",").some((function(i){if(i=x(l,i.trim(),n,false))return W({sortable:e,rootEl:i,name:"filter",targetEl:a,fromEl:n,toEl:n}),G("filter",e,{evt:t}),true})))return void(o&&t.preventDefault());i.handle&&!x(l,i.handle,n,false)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var i,o=this,r=o.el,s=o.options,a=r.ownerDocument;n&&!J&&n.parentNode===r&&(i=C(n),$=r,K=(J=n).parentNode,tt=J.nextSibling,et=n,lt=s.group,ut={target:jt.dragged=J,clientX:(e||t).clientX,clientY:(e||t).clientY},vt=ut.clientX-i.left,pt=ut.clientY-i.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,J.style["will-change"]="all",i=function(){G("delayEnded",o,{evt:t}),jt.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!u&&o.nativeDraggable&&(J.draggable=true),o._triggerDragStart(t,e),W({sortable:o,name:"choose",originalEvent:t}),E(J,s.chosenClass,true))},s.ignore.split(",").forEach((function(t){S(J,t.trim(),Ut)})),p(a,"dragover",At),p(a,"mousemove",At),p(a,"touchmove",At),s.supportPointer?(p(a,"pointerup",o._onDrop),this.nativeDraggable||p(a,"pointercancel",o._onDrop)):(p(a,"mouseup",o._onDrop),p(a,"touchend",o._onDrop),p(a,"touchcancel",o._onDrop)),u&&this.nativeDraggable&&(this.options.touchStartThreshold=4,J.draggable=true),G("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(c||l)?i():jt.eventCanceled?this._onDrop():(s.supportPointer?(p(a,"pointerup",o._disableDelayedDrag),p(a,"pointercancel",o._disableDelayedDrag)):(p(a,"mouseup",o._disableDelayedDrag),p(a,"touchend",o._disableDelayedDrag),p(a,"touchcancel",o._disableDelayedDrag)),p(a,"mousemove",o._delayedDragTouchMoveHandler),p(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&p(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(i,s.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){J&&Ut(J),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?p(document,"pointermove",this._onTouchMove):p(document,e?"touchmove":"mousemove",this._onTouchMove):(p(J,"dragend",this),p($,"dragstart",this._onDragStart));try{document.selection?Pt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;yt=false,$&&J?(G("dragStarted",this,{evt:e}),this.nativeDraggable&&p(document,"dragover",Vt),n=this.options,t||E(J,n.dragClass,false),E(J,n.ghostClass,true),jt.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Ht();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(J.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R])if(e[R]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=b(t=e));Nt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=X&&k(X,true),s=X&&r&&r.a,a=X&&r&&r.d,e=It&&wt&&O(wt),s=(o.clientX-ut.clientX+i.x)/(s||1)+(e?e[0]-qt[0]:0)/(s||1),a=(o.clientY-ut.clientY+i.y)/(a||1)+(e?e[1]-qt[1]:0)/(a||1);if(!jt.active&&!yt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,true)}X&&(r?(r.e+=s-(ft||0),r.f+=a-(ht||0)):r={a:1,b:0,c:0,d:1,e:s,f:a},r="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")"),_(X,"webkitTransform",r),_(X,"mozTransform",r),_(X,"msTransform",r),_(X,"transform",r),ft=s,ht=a,dt=o),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!X){var t=this.options.fallbackOnBody?document.body:$,e=C(J,true,It,true,t),n=this.options;if(It){for(wt=t;"static"===_(wt,"position")&&"none"===_(wt,"transform")&&wt!==document;)wt=wt.parentNode;wt!==document.body&&wt!==document.documentElement?(wt===document&&(wt=q()),e.top+=wt.scrollTop,e.left+=wt.scrollLeft):wt=q(),qt=O(wt)}E(X=J.cloneNode(true),n.ghostClass,false),E(X,n.fallbackClass,true),E(X,n.dragClass,true),_(X,"transition",""),_(X,"transform",""),_(X,"box-sizing","border-box"),_(X,"margin",0),_(X,"top",e.top),_(X,"left",e.left),_(X,"width",e.width),_(X,"height",e.height),_(X,"opacity","0.8"),_(X,"position",It?"absolute":"fixed"),_(X,"zIndex","100000"),_(X,"pointerEvents","none"),jt.ghost=X,t.appendChild(X),_(X,"transform-origin",vt/parseInt(X.style.width)*100+"% "+pt/parseInt(X.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,o=n.options;G("dragStart",this,{evt:t}),jt.eventCanceled?this._onDrop():(G("setupClone",this),jt.eventCanceled||((nt=N(J)).removeAttribute("id"),nt.draggable=false,nt.style["will-change"]="",this._hideClone(),E(nt,this.options.chosenClass,false),jt.clone=nt),n.cloneId=Pt((function(){G("clone",n),jt.eventCanceled||(n.options.removeCloneOnHide||$.insertBefore(nt,J),n._hideClone(),W({sortable:n,name:"clone"}))})),e||E(J,o.dragClass,true),e?(Et=true,n._loopId=setInterval(n._emulateDragOver,50)):(m(document,"mouseup",n._onDrop),m(document,"touchend",n._onDrop),m(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(n,i,J)),p(document,"drop",n),_(J,"transform","translateZ(0)")),yt=true,n._dragStartId=Pt(n._dragStarted.bind(n,e,t)),p(document,"selectstart",n),mt=true,window.getSelection().removeAllRanges(),d&&_(document.body,"user-select","none"))},_onDragOver:function(t){var n,i,o,r,s,a=this.el,l=t.target,c=this.options,u=c.group,d=jt.active,f=lt===u,h=c.sort,v=ct||d,p=this,m=false;if(!Ct){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=x(l,c.draggable,a,true),A("dragOver"),jt.eventCanceled)return m;if(J.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return U(false);if(Et=false,d&&!c.disabled&&(f?h||(i=K!==$):ct===this||(this.lastPutMode=lt.checkPull(this,d,J,t))&&u.checkPut(this,d,J,t))){if(o="vertical"===this._getDirection(t,l),n=C(J),A("dragOverValid"),jt.eventCanceled)return m;if(i)return K=$,V(),this._hideClone(),A("revert"),jt.eventCanceled||(tt?$.insertBefore(J,tt):$.appendChild(J)),U(true);var g=I(a,c.draggable);if(g&&(O=t,u=o,N=C(I((q=this).el,q.options.draggable)),q=j(q.el,q.options,X),!(u?O.clientX>q.right+10||O.clientY>N.bottom&&O.clientX>N.left:O.clientY>q.bottom+10||O.clientX>N.right&&O.clientY>N.top)||g.animated)){if(g&&(r=t,s=o,z=C(T((L=this).el,0,L.options,true)),L=j(L.el,L.options,X),s?r.clientX<L.left-10||r.clientY<z.top&&r.clientX<z.right:r.clientY<L.top-10||r.clientY<z.bottom&&r.clientX<z.left)){var b=T(a,0,c,true);if(b===J)return U(false);if(S=C(l=b),false!==Rt($,a,J,n,l,S,t,false))return V(),a.insertBefore(J,b),K=a,B(),U(true)}else if(l.parentNode===a){var w,y,k,S=C(l),q=J.parentNode!==a,O=(O=J.animated&&J.toRect||n,N=l.animated&&l.toRect||S,L=(s=o)?O.left:O.top,r=s?O.right:O.bottom,z=s?O.width:O.height,b=s?N.left:N.top,O=s?N.right:N.bottom,N=s?N.width:N.height,!(L===b||r===O||L+z/2===b+N/2)),L=o?"top":"left",z=M(l,"top","top")||M(J,"top","top"),b=z?z.scrollTop:void 0;if(gt!==l&&(y=S[L],kt=false,St=!O&&c.invertSwap||q),0!==(w=function(t,e,n,i,o,r,s,a){var l=i?t.clientY:t.clientX,c=i?n.height:n.width,t=i?n.top:n.left,i=i?n.bottom:n.right,n=false;if(!s)if(a&&xt<c*o){if(kt=!kt&&(1===bt?t+c*r/2<l:l<i-c*r/2)?true:kt)n=true;else if(1===bt?l<t+xt:i-xt<l)return-bt}else if(t+c*(1-o)/2<l&&l<i-c*(1-o)/2)return function(t){return D(J)<D(t)?1:-1}(e);if((n=n||s)&&(l<t+c*r/2||i-c*r/2<l))return t+c/2<l?1:-1;return 0}(t,l,S,o,O?1:c.swapThreshold,null==c.invertedSwapThreshold?c.swapThreshold:c.invertedSwapThreshold,St,gt===l)))for(var Z=D(J);(k=K.children[Z-=w])&&("none"===_(k,"display")||k===X););if(0===w||k===l)return U(false);bt=w;var N=(gt=l).nextElementSibling,q=false,O=Rt($,a,J,n,l,S,t,q=1===w);if(false!==O)return 1!==O&&-1!==O||(q=1===O),Ct=true,setTimeout(Bt,30),V(),q&&!N?a.appendChild(J):l.parentNode.insertBefore(J,q?N:l),z&&H(z,0,b-z.scrollTop),K=J.parentNode,void 0===y||St||(xt=Math.abs(y-C(l)[L])),B(),U(true)}}else{if(g===J)return U(false);if((l=g&&a===t.target?g:l)&&(S=C(l)),false!==Rt($,a,J,n,l,S,t,!!l))return V(),g&&g.nextSibling?a.insertBefore(J,g.nextSibling):a.appendChild(J),K=a,B(),U(true)}if(a.contains(J))return U(false)}return false}function A(r,s){G(r,p,e({evt:t,isOwner:f,axis:o?"vertical":"horizontal",revert:i,dragRect:n,targetRect:S,canSort:h,fromSortable:v,target:l,completed:U,onMove:function(e,i){return Rt($,a,J,n,e,C(e),t,i)},changed:B},s))}function V(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==v&&v.captureAnimationState()}function U(e){return A("dragOverCompleted",{insertion:e}),e&&(f?d._hideClone():d._showClone(p),p!==v&&(E(J,(ct||d).options.ghostClass,false),E(J,c.ghostClass,true)),ct!==p&&p!==jt.active?ct=p:p===jt.active&&ct&&(ct=null),v===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==v&&(v.animateAll(),v._ignoreWhileAnimating=null)),(l===J&&!J.animated||l===a&&!l.animated)&&(gt=null),c.dragoverBubble||t.rootEl||l===document||(J.parentNode[R]._isOutsideThisEl(t.target),e||At(t)),!c.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=true}function B(){rt=D(J),at=D(J,c.draggable),W({sortable:p,name:"change",toEl:a,newIndex:rt,newDraggableIndex:at,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",At),m(document,"mousemove",At),m(document,"touchmove",At)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;rt=D(J),at=D(J,n.draggable),G("drop",this,{evt:t}),K=J&&J.parentNode,rt=D(J),at=D(J,n.draggable),jt.eventCanceled||(kt=St=yt=false,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qt(this.cloneId),Qt(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),d&&_(document.body,"user-select",""),_(J,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),X&&X.parentNode&&X.parentNode.removeChild(X),($===K||ct&&"clone"!==ct.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),J&&(this.nativeDraggable&&m(J,"dragend",this),Ut(J),J.style["will-change"]="",mt&&!yt&&E(J,(ct||this).options.ghostClass,false),E(J,this.options.chosenClass,false),W({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:t}),$!==K?(0<=rt&&(W({rootEl:K,name:"add",toEl:K,fromEl:$,originalEvent:t}),W({sortable:this,name:"remove",toEl:K,originalEvent:t}),W({rootEl:K,name:"sort",toEl:K,fromEl:$,originalEvent:t}),W({sortable:this,name:"sort",toEl:K,originalEvent:t})),ct&&ct.save()):rt!==ot&&0<=rt&&(W({sortable:this,name:"update",toEl:K,originalEvent:t}),W({sortable:this,name:"sort",toEl:K,originalEvent:t})),jt.active&&(null!=rt&&-1!==rt||(rt=ot,at=st),W({sortable:this,name:"end",toEl:K,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){G("nulling",this),$=J=K=X=tt=nt=et=it=ut=dt=mt=rt=at=ot=st=gt=bt=ct=lt=jt.dragged=jt.ghost=jt.clone=jt.active=null,Mt.forEach((function(t){t.checked=true})),Mt.length=ft=ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":J&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,i=0,o=n.length,r=this.options;i<o;i++)x(t=n[i],r.draggable,this.el,false)&&e.push(t.getAttribute(r.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;for(;n--;)i+=e.charCodeAt(n);return i.toString(36)}(t));return e},sort:function(t,e){var n={},i=this.el;this.toArray().forEach((function(t,e){e=i.children[e];x(e,this.options.draggable,i,false)&&(n[t]=e)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(i.removeChild(n[t]),i.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return x(t,e||this.options.draggable,this.el,false)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var i=Q.modifyOption(this,t,e);n[t]=void 0!==i?i:e,"group"===t&&Zt(n)},destroy:function(){G("destroy",this);var t=this.el;t[R]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),_t.splice(_t.indexOf(this.el),1),this.el=t=null},_hideClone:function(){it||(G("hideClone",this),jt.eventCanceled||(_(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),it=true))},_showClone:function(t){"clone"===t.lastPutMode?it&&(G("showClone",this),jt.eventCanceled||(J.parentNode!=$||this.options.group.revertClone?tt?$.insertBefore(nt,tt):$.appendChild(nt):$.insertBefore(nt,J),this.options.group.revertClone&&this.animate(J,nt),_(nt,"display",""),it=false)):this._hideClone()}},Tt&&p(document,"touchmove",(function(t){(jt.active||yt)&&t.cancelable&&t.preventDefault()})),jt.utils={on:p,off:m,css:_,find:S,is:function(t,e){return!!x(t,e,t,false)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Z,closest:x,toggleClass:E,clone:N,index:D,nextTick:Pt,cancelNextTick:Qt,detectDirection:zt,getChild:T,expando:R},jt.get=function(t){return t[R]},jt.mount=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(n=n[0].constructor===Array?n[0]:n).forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(jt.utils=e(e({},jt.utils),t.utils)),Q.mount(t)}))},jt.create=function(t,e){return new jt(t,e)};var Ft,Gt,Yt,Wt,Jt,Kt,Xt=[],$t=!(jt.version="1.15.6");function te(){Xt.forEach((function(t){clearInterval(t.pid)})),Xt=[]}function ee(){clearInterval(Kt)}var ne,ie=Z((function(t,e,n,i){if(e.scroll){var o,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=q(),u=false;Gt!==n&&(Gt=n,te(),Ft=e.scroll,o=e.scrollFn,true===Ft&&(Ft=L(n,true)));var d=0,f=Ft;do{var h=f,v=C(h),p=v.top,m=v.bottom,g=v.left,b=v.right,x=v.width,w=v.height,y=void 0,E=void 0,k=h.scrollWidth,S=h.scrollHeight,M=_(h),T=h.scrollLeft,v=h.scrollTop,E=h===c?(y=x<k&&("auto"===M.overflowX||"scroll"===M.overflowX||"visible"===M.overflowX),w<S&&("auto"===M.overflowY||"scroll"===M.overflowY||"visible"===M.overflowY)):(y=x<k&&("auto"===M.overflowX||"scroll"===M.overflowX),w<S&&("auto"===M.overflowY||"scroll"===M.overflowY)),T=y&&(Math.abs(b-r)<=a&&T+x<k)-(Math.abs(g-r)<=a&&!!T),v=E&&(Math.abs(m-s)<=a&&v+w<S)-(Math.abs(p-s)<=a&&!!v);if(!Xt[d])for(var I=0;I<=d;I++)Xt[I]||(Xt[I]={});Xt[d].vx==T&&Xt[d].vy==v&&Xt[d].el===h||(Xt[d].el=h,Xt[d].vx=T,Xt[d].vy=v,clearInterval(Xt[d].pid),0==T&&0==v||(u=true,Xt[d].pid=setInterval(function(){i&&0===this.layer&&jt.active._onTouchMove(Jt);var e=Xt[this.layer].vy?Xt[this.layer].vy*l:0,n=Xt[this.layer].vx?Xt[this.layer].vx*l:0;"function"==typeof o&&"continue"!==o.call(jt.dragged.parentNode[R],n,e,t,Jt,Xt[this.layer].el)||H(Xt[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&f!==c&&(f=L(f,false)));$t=u}}),30),h=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,o=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(o=n||o,s(),e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY),t(),o&&!o.el.contains(e)&&(r("spill"),this.onSpill({dragEl:i,putSortable:n})))};function oe(){}function re(){}oe.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();t=T(this.sortable.el,this.startIndex,this.options);t?this.sortable.el.insertBefore(e,t):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:h},i(oe,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:h},i(re,{pluginName:"removeOnSpill"});var se,ae,le,ce,ue,de=[],fe=[],he=false,ve=false,pe=false;function me(t,e){fe.forEach((function(n,i){i=e.children[n.sortableIndex+(t?Number(i):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}function ge(){de.forEach((function(t){t!==le&&t.parentNode&&t.parentNode.removeChild(t)}))}return jt.mount(new function(){function t(){for(var t in this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){t=t.originalEvent;this.sortable.nativeDraggable?p(document,"dragover",this._handleAutoScroll):this.options.supportPointer?p(document,"pointermove",this._handleFallbackAutoScroll):t.touches?p(document,"touchmove",this._handleFallbackAutoScroll):p(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(w),w=void 0},nulling:function(){Jt=Gt=Ft=$t=Kt=Yt=Wt=null,Xt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,true)},_handleAutoScroll:function(t,e){var n,i=this,o=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(o,r);Jt=t,e||this.options.forceAutoScrollFallback||c||l||d?(ie(t,this.options,s,e),n=L(s,true),!$t||Kt&&o===Yt&&r===Wt||(Kt&&ee(),Kt=setInterval((function(){var s=L(document.elementFromPoint(o,r),true);s!==n&&(n=s,te()),ie(t,i.options,s,e)}),10),Yt=o,Wt=r)):this.options.bubbleScroll&&L(s,true)!==q()?ie(t,this.options,L(s,false),false):te()}},i(t,{pluginName:"scroll",initializeByDefault:true})}),jt.mount(re,oe),jt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e=t.completed,n=t.target,i=t.onMove,o=t.activeSortable,r=t.changed,s=t.cancel;o.options.swap&&(t=this.sortable.el,o=this.options,n&&n!==t&&(t=ne,ne=false!==i(n)?(E(n,o.swapClass,true),n):null,t&&t!==ne&&E(t,o.swapClass,false)),r(),e(true),s())},drop:function(t){var e,n,i=t.activeSortable,o=t.putSortable,r=t.dragEl,s=o||this.sortable,a=this.options;ne&&E(ne,a.swapClass,false),ne&&(a.swap||o&&o.options.swap)&&r!==ne&&(s.captureAnimationState(),s!==i&&i.captureAnimationState(),n=ne,t=(e=r).parentNode,a=n.parentNode,t&&a&&!t.isEqualNode(n)&&!a.isEqualNode(e)&&(o=D(e),r=D(n),t.isEqualNode(a)&&o<r&&r++,t.insertBefore(n,t.children[o]),a.insertBefore(e,a.children[r])),s.animateAll(),s!==i&&i.animateAll())},nulling:function(){ne=null}},i(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),jt.mount(new function(){function t(t){for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?p(document,"pointerup",this._deselectMultiDrag):(p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag))),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:false,setData:function(e,n){var i="";de.length&&ae===t?de.forEach((function(t,e){i+=(e?", ":"")+t.textContent})):i=n.textContent,e.setData("Text",i)}}}return t.prototype={multiDragKeyDown:false,isMultiDrag:false,delayStartGlobal:function(t){t=t.dragEl;le=t},delayEnded:function(){this.isMultiDrag=~de.indexOf(le)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<de.length;n++)fe.push(N(de[n])),fe[n].sortableIndex=de[n].sortableIndex,fe[n].draggable=false,fe[n].style["will-change"]="",E(fe[n],this.options.selectedClass,false),de[n]===le&&E(fe[n],this.options.chosenClass,false);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.rootEl,i=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||de.length&&ae===e&&(me(true,n),i("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,t=t.cancel;this.isMultiDrag&&(me(false,n),fe.forEach((function(t){_(t,"display","")})),e(),ue=false,t())},hideClone:function(t){var e=this,n=t.cloneNowHidden,t=t.cancel;this.isMultiDrag&&(fe.forEach((function(t){_(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)})),n(),ue=true,t())},dragStartGlobal:function(t){!this.isMultiDrag&&ae&&ae.multiDrag._deselectMultiDrag(),de.forEach((function(t){t.sortableIndex=D(t)})),de=de.sort((function(t,e){return t.sortableIndex-e.sortableIndex})),pe=true},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(de.forEach((function(t){t!==le&&_(t,"position","absolute")})),e=C(le,false,true,true),de.forEach((function(t){t!==le&&A(t,e)})),he=ve=true)),t.animateAll((function(){he=ve=false,n.options.animation&&de.forEach((function(t){V(t)})),n.options.sort&&ge()})))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;ve&&~de.indexOf(e)&&(n(false),t())},revert:function(t){var e,n,i=t.fromSortable,o=t.rootEl,r=t.sortable,s=t.dragRect;1<de.length&&(de.forEach((function(t){r.addAnimationState({target:t,rect:ve?C(t):s}),V(t),t.fromRect=s,i.removeAnimationState(t)})),ve=false,e=!this.options.removeCloneOnHide,n=o,de.forEach((function(t,i){i=n.children[t.sortableIndex+(e?Number(i):0)];i?n.insertBefore(t,i):n.appendChild(t)})))},dragOverCompleted:function(t){var e,n=t.sortable,i=t.isOwner,o=t.insertion,r=t.activeSortable,s=t.parentEl,a=t.putSortable,t=this.options;o&&(i&&r._hideClone(),he=false,t.animation&&1<de.length&&(ve||!i&&!r.options.sort&&!a)&&(e=C(le,false,true,true),de.forEach((function(t){t!==le&&(A(t,e),s.appendChild(t))})),ve=true),i||(ve||ge(),1<de.length?(i=ue,r._showClone(n),r.options.animation&&!ue&&i&&fe.forEach((function(t){r.addAnimationState({target:t,rect:ce}),t.fromRect=ce,t.thisAnimationDuration=null}))):r._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;de.forEach((function(t){t.thisAnimationDuration=null})),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(ce=i({},e),e=k(le,true),ce.top-=e.f,ce.left-=e.e)},dragOverAnimationComplete:function(){ve&&(ve=false,ge())},drop:function(t){var e,n,i,o,r,s,a,l=t.originalEvent,c=t.rootEl,u=t.parentEl,d=t.sortable,f=t.dispatchSortableEvent,h=t.oldIndex,t=t.putSortable,v=t||this.sortable;l&&(e=this.options,n=u.children,pe||(e.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),E(le,e.selectedClass,!~de.indexOf(le)),~de.indexOf(le)?(de.splice(de.indexOf(le),1),se=null,F({sortable:d,rootEl:c,name:"deselect",targetEl:le,originalEvent:l})):(de.push(le),F({sortable:d,rootEl:c,name:"select",targetEl:le,originalEvent:l}),l.shiftKey&&se&&d.el.contains(se)?(i=D(se),o=D(le),~i&&~o&&i!==o&&function(){for(var t,r=i<o?(t=i,o):(t=o,i+1),s=e.filter;t<r;t++)~de.indexOf(n[t])||x(n[t],e.draggable,u,false)&&(s&&("function"==typeof s?s.call(d,l,n[t],d):s.split(",").some((function(e){return x(n[t],e.trim(),u,false)})))||(E(n[t],e.selectedClass,true),de.push(n[t]),F({sortable:d,rootEl:c,name:"select",targetEl:n[t],originalEvent:l})))}()):se=le,ae=v)),pe&&this.isMultiDrag&&(ve=false,(u[R].options.sort||u!==c)&&1<de.length&&(r=C(le),s=D(le,":not(."+this.options.selectedClass+")"),!he&&e.animation&&(le.thisAnimationDuration=null),v.captureAnimationState(),he||(e.animation&&(le.fromRect=r,de.forEach((function(t){var e;t.thisAnimationDuration=null,t!==le&&(e=ve?C(t):r,t.fromRect=e,v.addAnimationState({target:t,rect:e}))}))),ge(),de.forEach((function(t){n[s]?u.insertBefore(t,n[s]):u.appendChild(t),s++})),h===D(le)&&(a=false,de.forEach((function(t){t.sortableIndex!==D(t)&&(a=true)})),a&&(f("update"),f("sort")))),de.forEach((function(t){V(t)})),v.animateAll()),ae=v),(c===u||t&&"clone"!==t.lastPutMode)&&fe.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})))},nullingGlobal:function(){this.isMultiDrag=pe=false,fe.length=0},destroyGlobal:function(){this._deselectMultiDrag(),m(document,"pointerup",this._deselectMultiDrag),m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==pe&&pe||ae!==this.sortable||t&&x(t.target,this.options.draggable,this.sortable.el,false)||t&&0!==t.button))for(;de.length;){var e=de[0];E(e,this.options.selectedClass,false),de.shift(),F({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=true)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=false)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[R];e&&e.options.multiDrag&&!~de.indexOf(t)&&(ae&&ae!==e&&(ae.multiDrag._deselectMultiDrag(),ae=e),E(t,e.options.selectedClass,true),de.push(t))},deselect:function(t){var e=t.parentNode[R],n=de.indexOf(t);e&&e.options.multiDrag&&~n&&(E(t,e.options.selectedClass,false),de.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return de.forEach((function(i){var o;e.push({multiDragElement:i,index:i.sortableIndex}),o=ve&&i!==le?-1:ve?D(i,":not(."+t.options.selectedClass+")"):D(i),n.push({multiDragElement:i,index:o})})),{items:r(de),clones:[].concat(fe),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),jt}))})(bt);return bt.exports}var Et=yt();var _t=R(Et);var kt='@-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;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;-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{opacity:0.3;padding:0 10px;cursor:pointer;background:none;height:32px;border:1px solid #cccccc;border-radius:32px}verdocs-template-roles .add-role:hover{opacity:1}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 .sequence-roles{display:-ms-flexbox;display:flex;max-width:400px}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 St='<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 qt='<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 Ct='<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 Mt='<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 Tt='<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 It=t("verdocs_template_roles",function(){function t(t){e(this,t);this.next=n(this,"next");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.rolesUpdated=n(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId="";this.showingRoleDialog=null;this.sender=null;this.dragging=false;this.loading=true;this.template=null;this.sortableRefs=[]}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate();this.cleanupSortables()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[ROLES] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){console.log("[ROLES] Template Updated",e);t.template=e;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){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(i){console.log("[ROLES] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.cleanupSortables=function(){this.sortableRefs.forEach((function(t){return t.destroy()}));this.sortableRefs.length=0};t.prototype.componentDidRender=function(){var t=this;this.cleanupSortables();var e=this.getSequenceNumbers();(e||[]).forEach((function(e){var n=document.getElementById("verdocs-roles-sequence-".concat(e));if(n){var i=new _t(n,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:t.handleMoveEnd.bind(t),onChoose:function(){return t.dragging=true},onUnchoose:function(){return t.dragging=false}});t.sortableRefs.push(i)}}));var n=document.getElementById("verdocs-roles-sequence-add-target");if(n){console.log("[ROLES] Applying sortable to add-sequence slot");var i=new _t(n,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:function(){return t.dragging=true},onUnchoose:function(){return t.dragging=false}});this.sortableRefs.push(i)}};t.prototype.handleMoveEnd=function(t){var e=this;var n=+t.from.dataset.sequence;var i=+t.to.dataset.sequence;var o=+t.oldIndex+1;var r=+t.newIndex+1;console.log("Move from ".concat(n,":").concat(o," to ").concat(i,":").concat(r),t.item);var s={};var a=this.getSequenceNumbers();a.forEach((function(t){var n=e.getRolesAtSequence(t);s[String(t)]=JSON.parse(JSON.stringify(n))}));s[a[a.length-1]+1]=[];var l=s[n].splice(o-1,1)[0];s[i]||(s[i]=[]);s[i].splice(r-1,0,l);var c=[];Object.entries(s).forEach((function(t){var n=t[0],i=t[1];i.forEach((function(t,i){if(!t){return}var o=+i+1;if(t.sequence!==+n||t.order!==o){t.sequence=+n;t.order=o;c.push(x(e.endpoint,e.templateId,t.name,{sequence:+n,order:o}).then((function(e){return console.log("[ROLES] Updated role",t.name,e)})).catch((function(t){return console.log("[ROLES] Error updating role",t)})))}}))}));return Promise.all(c).then((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){return[2,console.log("[ROLES] Done renumbering")]}))}))})).catch((function(t){return console.log("[ROLES] Error updating roles",t)}))};t.prototype.handleCancel=function(){var t;(t=this.exit)===null||t===void 0?void 0:t.emit()};t.prototype.handleSubmit=function(){var t;(t=this.next)===null||t===void 0?void 0:t.emit()};t.prototype.getSortedRoles=function(){var t;return(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).sort((function(t,e){return t.sequence===e.sequence?t.order-e.order:t.sequence-e.sequence}))};t.prototype.getSequenceNumbers=function(){var t={};this.getSortedRoles().forEach((function(e){t[e.sequence]=true}));console.log("[ROLES] Sequences",t);return Object.keys(t).map((function(t){return+t})).sort((function(t,e){return t-e}))};t.prototype.getRoleNames=function(){var t=this.getSortedRoles();return t.map((function(t){return t.name}))};t.prototype.getRolesAtSequence=function(t){var e;return(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).filter((function(e){return e&&e.sequence===t}))};t.prototype.renumberTemplateRoles=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n,i;var o=this;return __generator(this,(function(r){switch(r.label){case 0:e={};n=[];i=this.getSequenceNumbers();(i||[]).forEach((function(t){(e[t]||[]).forEach((function(e,i){var r=+i+1;if(e.sequence!==+t||e.order!==r){console.log("[ROLES] Updating role",e.name,"from",e.sequence,e.order,"to",t,r);e.sequence=+t;e.order=r;n.push(x(o.endpoint,o.templateId,e.name,{sequence:+t,order:r}).then((function(t){return console.log("[ROLES] Updated role",e.name,t)})).catch((function(t){return console.log("[ROLES] Error updating role",t)})))}}))}));console.log("[ROLES] Awaiting ".concat(n.length," renumber requests"));return[4,Promise.all(n).then((function(){return __awaiter(o,void 0,void 0,(function(){var t;return __generator(this,(function(n){t=JSON.parse(JSON.stringify(this.template));t.roles=Object.keys(e).reduce((function(t,n){return t.concat(e[n])}),[]);console.log("[ROLES] Done renumbering",t.roles.map((function(t){return{name:t.name,sequence:t.sequence,order:t.order}})));_.updateTemplate(this.templateId,t);return[2]}))}))}))];case 1:r.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))};t.prototype.getNextRoleName=function(){var t,e;var n="";var i=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).length;do{i++;n="Recipient ".concat(i)}while(!n||(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).some((function(t){return t&&t.name===n})));return n};t.prototype.callCreateRole=function(t,e,n){var i=this;console.log("[ROLES] Will create role",{name:t,sequence:e,order:n});w(this.endpoint,this.templateId,{template_id:this.templateId,name:t,sequence:e,message:"",order:n,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(t){return __awaiter(i,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:console.log("[ROLES] Created role",t);console.log("Updating template in data store");return[4,_.getTemplate(this.endpoint,this.templateId,true)];case 1:n.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(t){console.log("[ROLES] Error creating role",t)}))};t.prototype.handleAddRole=function(t,e){t.stopPropagation();var n=this.getRolesAtSequence(e).length+1;var i=this.getNextRoleName();this.callCreateRole(i,e,n)};t.prototype.handleAddStep=function(t,e){t.stopPropagation();var n=1;var i=this.getNextRoleName();this.callCreateRole(i,e,n)};t.prototype.render=function(){var t=this;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(o,{class:"loading"},i("verdocs-loader",null))}var e=this.getRoleNames();var n=this.getSequenceNumbers();var r=n&&n.length>0?(n[n.length-1]||0)+1:1;console.log("[ROLES] Rendering",{roleNames:e,sequences:n,nextSequence:r});return i(o,{class:{dragging:this.dragging}},i("form",{onSubmit:function(t){return t.preventDefault()},onClick:function(t){return t.stopPropagation()},autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"roles"},n.map((function(e,n){return i("div",{class:"sequence"},i("div",{class:"sequence-label no-drag"},n+1,"."),i("div",{class:"sequence-roles",id:"verdocs-roles-sequence-".concat(e),"data-sequence":e},t.getRolesAtSequence(e).map((function(n){var o=!n.email||!n.first_name||!n.last_name;return o?i("div",{class:"role","data-rolename":n.name,"data-sequence":e,"data-order":n.order},i("div",{class:"role-name"},n.name),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:St,onClick:function(){return t.showingRoleDialog=n.name},"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:n.type==="signer"?Ct:n.type==="cc"?Tt:Mt}))):i("div",{class:"role","data-rolename":n.name,"data-sequence":e,"data-order":n.order},i("div",{class:"role-name"},h(n)),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:St,onClick:function(){return t.showingRoleDialog=n.name},"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:n.type==="signer"?Ct:n.type==="cc"?Tt:Mt})))}))),i("button",{class:"add-role no-drag",onClick:function(n){return t.handleAddRole(n,e)}},"+ Add Role"))})),i("div",{class:"sequence add-sequence"},i("div",{class:"sequence-label no-drag"},n.length+1,"."),i("div",{class:"sequence-roles",id:"verdocs-roles-sequence-add-target","data-sequence":r}),i("button",{class:"add-role no-drag",onClick:function(e){return t.handleAddRole(e,r)}},"+ Add Role"))),e.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:qt})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return t.handleCancel()}}),i("verdocs-button",{label:"OK",size:"small",onClick:function(){return t.handleSubmit()},disabled:e.length<1}))),this.showingRoleDialog&&i("verdocs-menu-panel",{onClose:function(){return t.showingRoleDialog=null}},i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){var e;(e=document.getElementById("verdocs-menu-panel-overlay"))===null||e===void 0?void 0:e.remove();t.showingRoleDialog=null},onDelete:function(){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:e.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}})))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());It.style=kt;var Dt='@-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-settings{display:block;max-width:600px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .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-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}';var Ot=24*60*60*1e3;var Lt=t("verdocs_template_settings",function(){function t(t){e(this,t);this.next=n(this,"next");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.templateUpdated=n(this,"templateUpdated");this.templateListenerId=null;this.endpoint=a.getDefault();this.templateId="";this.name=null;this.visibility="private";this.sender="envelope_creator";this.sendReminders=false;this.initialReminder=0;this.followupReminders=0;this.dirty=false;this.loading=true;this.template=null}t.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};t.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){console.log("[SETTINGS] Loading template",this.templateId);this.unlistenToTemplate();_.subscribe("templates",this.templateId,(function(){return l(t.endpoint,t.templateId)}),false,(function(e){console.log("[SETTINGS] Template Updated",e);t.template=e;t.name=e.name;t.visibility=e.visibility;t.sender=e.sender;t.sendReminders=e.initial_reminder!==null;t.initialReminder=e.initial_reminder?Math.floor(e.initial_reminder/Ot):null;t.followupReminders=e.followup_reminders?Math.floor(e.followup_reminders/Ot):null;t.dirty=false;t.loading=false}));return[2]}))}))};t.prototype.unlistenToTemplate=function(){if(this.templateListenerId){_.store.delListener(this.templateListenerId);this.templateListenerId=null}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){try{this.endpoint.loadSession();if(!this.templateId){console.log("[SETTINGS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SETTINGS] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(i){console.log("[SETTINGS] Error with preview session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};t.prototype.handleCancel=function(){var t;(t=this.exit)===null||t===void 0?void 0:t.emit()};t.prototype.handleSubmit=function(){var t=this;y(this.endpoint,this.templateId,{name:this.name,visibility:this.visibility,sender:this.sender,initial_reminder:this.sendReminders?this.initialReminder*Ot:null,followup_reminders:this.sendReminders?this.followupReminders*Ot:null}).then((function(e){var n,i;console.log("[SETTINGS] Template Updated",e);t.dirty=false;t.name=e.name;t.visibility=e.visibility;t.sender=e.sender;t.sendReminders=e.initial_reminder!==null;t.initialReminder=e.initial_reminder?Math.floor(e.initial_reminder/Ot):null;t.followupReminders=e.followup_reminders?Math.floor(e.followup_reminders/Ot):null;(n=t.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:t.endpoint,template:e,event:"update"});(i=t.next)===null||i===void 0?void 0:i.emit()})).catch((function(e){var n,i,o,r,s;console.log("[SETTINGS] Error updating template",e);(n=t.sdkError)===null||n===void 0?void 0:n.emit(new E(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(o=e.response)===null||o===void 0?void 0:o.data));S(((s=(r=e.response)===null||r===void 0?void 0:r.data)===null||s===void 0?void 0:s.error)||"Error updating template, please try again later.")}))};t.prototype.render=function(){var t=this;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(o,{class:"loading"},i("verdocs-loader",null))}return i(o,null,i("form",{onSubmit:function(t){return t.preventDefault()},onClick:function(t){return t.stopPropagation()},autocomplete:"off"},i("h5",null,"Settings"),i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"Template Name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(e){t.name=e.target.value;t.dirty=true}})),i("div",{class:"row"},i("verdocs-select-input",{label:"Visibility",value:this.visibility,onInput:function(e){t.visibility=e.target.value;t.dirty=true},options:[{value:"private",label:"Private"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}]})),i("div",{class:"row"},i("verdocs-select-input",{label:"Owner for envelopes created from this template",value:this.sender,onInput:function(e){t.sender=e.target.value;t.dirty=true},options:[{value:"envelope_creator",label:"Envelope Creator"},{value:"template_owner",label:"Template Owner"}]})),i("div",{class:"row"},i("label",null,"Send Reminders"),i("verdocs-switch",{checked:this.sendReminders,onCheckedChange:function(e){return t.sendReminders=e.detail}})),this.sendReminders&&i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"First Reminder (days)",value:String(this.initialReminder||0),autocomplete:"off",placeholder:"Delay in days...",onInput:function(e){t.initialReminder=+e.target.value;t.dirty=true}})),this.sendReminders&&i("div",{class:"row"},i("verdocs-text-input",{id:"verdocs-field-name",label:"Follow-up Reminders (days)",value:String(this.followupReminders||0),autocomplete:"off",placeholder:"Delay in days...",onInput:function(e){t.followupReminders=+e.target.value;t.dirty=true}})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return t.handleCancel()}}),i("verdocs-button",{label:"Save",size:"small",onClick:function(){return t.handleSubmit()},disabled:!this.dirty}))))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());Lt.style=Dt}}}));
3
+ //# sourceMappingURL=p-4175122c.system.entry.js.map