@verdocs/web-sdk 4.2.158 → 5.0.0

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 (514) hide show
  1. package/dist/cjs/Datastore-b1742da2.js +1783 -0
  2. package/dist/cjs/Icons-02a47df1.js +7 -0
  3. package/dist/cjs/{index-2589e4d1.js → index-ccac8641.js} +19 -31
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{utils-6d673ca1.js → utils-ba1e95e0.js} +3 -2
  6. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-build.cjs.entry.js +22 -13
  8. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +1 -1
  9. package/dist/cjs/{verdocs-button_3.cjs.entry.js → verdocs-button_2.cjs.entry.js} +1 -56
  10. package/dist/cjs/{verdocs-checkbox_4.cjs.entry.js → verdocs-checkbox_6.cjs.entry.js} +115 -24
  11. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +2 -2
  12. package/dist/cjs/verdocs-dialog.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +30 -15
  16. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +32 -17
  17. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +64 -45
  18. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +105 -156
  20. package/dist/cjs/verdocs-field-payment.cjs.entry.js +38 -25
  21. package/dist/cjs/{verdocs-file-chooser_2.cjs.entry.js → verdocs-file-chooser.cjs.entry.js} +2 -21
  22. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +27 -5
  23. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
  26. package/dist/cjs/{verdocs-preview_9.cjs.entry.js → verdocs-preview_5.cjs.entry.js} +219 -591
  27. package/dist/cjs/verdocs-progress-bar.cjs.entry.js +25 -0
  28. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
  30. package/dist/cjs/verdocs-search-box.cjs.entry.js +1 -1
  31. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-sign.cjs.entry.js +11 -12
  33. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +1 -1
  35. package/dist/cjs/verdocs-table.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  37. package/dist/cjs/verdocs-template-create.cjs.entry.js +108 -0
  38. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +78 -63
  39. package/dist/cjs/verdocs-template-role-properties.cjs.entry.js +58 -37
  40. package/dist/cjs/verdocs-template-star.cjs.entry.js +2 -2
  41. package/dist/cjs/verdocs-template-tags.cjs.entry.js +2 -2
  42. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  43. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  44. package/dist/cjs/verdocs-web-sdk.cjs.js +3 -3
  45. package/dist/collection/collection-manifest.json +2 -5
  46. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +5 -21
  47. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +27 -40
  48. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +27 -28
  49. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +45 -44
  50. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +12 -11
  51. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +28 -28
  52. package/dist/collection/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.js +34 -15
  53. package/dist/collection/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.js +35 -17
  54. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +67 -45
  55. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +29 -18
  56. package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js +30 -20
  57. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +30 -22
  58. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +29 -17
  59. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +30 -18
  60. package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js +192 -139
  61. package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.js +30 -20
  62. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +30 -18
  63. package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +31 -19
  64. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +31 -0
  65. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +44 -44
  66. package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +29 -17
  67. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js +37 -32
  68. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +7 -15
  69. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.css +6 -0
  70. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +79 -61
  71. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +48 -24
  72. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +63 -61
  73. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +61 -36
  74. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +63 -46
  75. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  76. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  77. package/dist/collection/utils/Datastore.js +141 -0
  78. package/dist/collection/utils/Templates.js +2 -0
  79. package/dist/collection/utils/utils.js +3 -2
  80. package/dist/components/index.js +1 -7
  81. package/dist/components/{p-3044c9cb.js → p-070bebd7.js} +1 -1
  82. package/dist/components/{p-69881420.js → p-0ca7012b.js} +1 -1
  83. package/dist/components/{p-b2bf338f.js → p-0d063bf9.js} +65 -35
  84. package/dist/components/{p-ac7578f6.js → p-0e332769.js} +1 -1
  85. package/dist/components/{p-12594438.js → p-1030e0b1.js} +32 -32
  86. package/dist/components/{p-a655b737.js → p-15d530b8.js} +6 -6
  87. package/dist/components/{p-71dd305b.js → p-18999830.js} +2 -2
  88. package/dist/components/{p-90540412.js → p-1ae5d7e0.js} +1 -1
  89. package/dist/components/{p-4d2f2954.js → p-1e2e8b1c.js} +1 -1
  90. package/dist/components/{p-c7a21595.js → p-1e67ebdf.js} +67 -42
  91. package/dist/components/{p-72e959a7.js → p-1fc15f94.js} +31 -32
  92. package/dist/components/{p-85ef4d07.js → p-2548f3f0.js} +49 -38
  93. package/dist/components/{p-fe533b11.js → p-258c3c53.js} +125 -101
  94. package/dist/components/{p-263dc67d.js → p-315d6592.js} +1 -1
  95. package/dist/components/{p-4dc4418a.js → p-3201d529.js} +1 -1
  96. package/dist/components/{p-7786799a.js → p-324ed895.js} +8 -4
  97. package/dist/components/{p-b0af9b72.js → p-4bc5ac82.js} +3 -2
  98. package/dist/components/{p-ffe8b41d.js → p-4dd750e9.js} +1 -1
  99. package/dist/components/{p-b679d760.js → p-4e08dcdd.js} +33 -32
  100. package/dist/components/{p-82fb3284.js → p-58c2bd5d.js} +1 -1
  101. package/dist/components/{p-d3170dcd.js → p-5a9cea40.js} +4 -4
  102. package/dist/components/{p-c7db1c7d.js → p-5d1dec61.js} +52 -53
  103. package/dist/components/{p-8b27ce22.js → p-5d4bbcd0.js} +1 -1
  104. package/dist/components/{p-1e66385b.js → p-5d82a9f3.js} +64 -57
  105. package/dist/components/{p-877eaf65.js → p-5eb45a4f.js} +1 -1
  106. package/dist/components/{p-62f8b36c.js → p-6400f542.js} +36 -14
  107. package/dist/components/{p-6e8c00bc.js → p-642af221.js} +32 -31
  108. package/dist/components/{p-03660739.js → p-649a2ae7.js} +31 -32
  109. package/dist/components/{p-e4ac6259.js → p-6fcd99d1.js} +2 -2
  110. package/dist/components/p-7e9c499e.js +4 -0
  111. package/dist/components/{p-cdf871dd.js → p-81794664.js} +30 -29
  112. package/dist/components/{p-1b60debe.js → p-82a3f92e.js} +30 -29
  113. package/dist/components/{p-921297ba.js → p-84ae0283.js} +1 -1
  114. package/dist/components/{p-7927a846.js → p-8d3c0b4c.js} +2 -2
  115. package/dist/components/{p-83a2fa2f.js → p-8fbc64e9.js} +72 -55
  116. package/dist/components/{p-945d225a.js → p-94065def.js} +90 -88
  117. package/dist/components/{p-0e64ccc3.js → p-9bb47a5a.js} +1 -1
  118. package/dist/components/{p-df4ac086.js → p-a3e12c74.js} +2 -2
  119. package/dist/components/{p-6b369b14.js → p-b16c202a.js} +1 -1
  120. package/dist/components/{p-3518350d.js → p-b9034018.js} +4 -4
  121. package/dist/components/{p-b8cd75c0.js → p-b9a18099.js} +56 -46
  122. package/dist/components/{p-8f942993.js → p-bdc03b91.js} +32 -31
  123. package/dist/components/{p-4535a9fd.js → p-c7b00ce6.js} +36 -17
  124. package/dist/components/{p-e4a852b5.js → p-c8fedb4e.js} +7 -6
  125. package/dist/components/{p-0162bdd3.js → p-caa41754.js} +31 -34
  126. package/dist/components/{p-83245875.js → p-cf6ea837.js} +2 -2
  127. package/dist/components/p-da4d4eed.js +1781 -0
  128. package/dist/components/p-ea5954bd.js +4 -0
  129. package/dist/components/{p-42a676b7.js → p-ec894daf.js} +2 -2
  130. package/dist/components/{p-556596e4.js → p-f72b9c45.js} +1 -1
  131. package/dist/components/{p-a7bbe96b.js → p-f990140a.js} +3 -3
  132. package/dist/components/{p-db4a15fd.js → p-fcad60f5.js} +1 -1
  133. package/dist/components/verdocs-auth.js +4 -4
  134. package/dist/components/verdocs-build.js +93 -115
  135. package/dist/components/verdocs-button-panel.js +1 -1
  136. package/dist/components/verdocs-button.js +1 -1
  137. package/dist/components/verdocs-checkbox.js +1 -1
  138. package/dist/components/verdocs-component-error.js +1 -1
  139. package/dist/components/verdocs-contact-picker.js +1 -1
  140. package/dist/components/verdocs-dialog.js +1 -1
  141. package/dist/components/verdocs-dropdown.js +1 -1
  142. package/dist/components/verdocs-envelope-document-page.js +1 -1
  143. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  144. package/dist/components/verdocs-envelope-recipient-summary.js +37 -19
  145. package/dist/components/verdocs-envelope-sidebar.js +76 -54
  146. package/dist/components/verdocs-envelopes-list.js +12 -12
  147. package/dist/components/verdocs-field-attachment.js +1 -1
  148. package/dist/components/verdocs-field-checkbox.js +1 -1
  149. package/dist/components/verdocs-field-date.js +1 -1
  150. package/dist/components/verdocs-field-dropdown.js +1 -1
  151. package/dist/components/verdocs-field-initial.js +1 -1
  152. package/dist/components/verdocs-field-payment.js +106 -33
  153. package/dist/components/verdocs-field-radio.js +1 -1
  154. package/dist/components/verdocs-field-signature.js +1 -1
  155. package/dist/components/verdocs-field-textarea.js +1 -1
  156. package/dist/components/verdocs-field-textbox.js +1 -1
  157. package/dist/components/verdocs-field-timestamp.js +1 -1
  158. package/dist/components/verdocs-file-chooser.js +56 -1
  159. package/dist/components/verdocs-help-icon.js +1 -1
  160. package/dist/components/verdocs-initial-dialog.js +1 -1
  161. package/dist/components/verdocs-kba-dialog.js +1 -1
  162. package/dist/components/verdocs-loader.js +1 -1
  163. package/dist/components/verdocs-ok-dialog.js +1 -1
  164. package/dist/components/verdocs-organization-card.js +2 -2
  165. package/dist/components/verdocs-pagination.js +1 -1
  166. package/dist/components/verdocs-portal.js +1 -1
  167. package/dist/components/verdocs-preview.js +1 -1
  168. package/dist/components/verdocs-progress-bar.js +1 -1
  169. package/dist/components/verdocs-quick-filter.js +1 -1
  170. package/dist/components/verdocs-quick-functions.js +1 -1
  171. package/dist/components/verdocs-radio-button.js +1 -1
  172. package/dist/components/verdocs-search-box.js +1 -1
  173. package/dist/components/verdocs-search-tabs.js +1 -1
  174. package/dist/components/verdocs-select-input.js +1 -1
  175. package/dist/components/verdocs-send.js +1 -1
  176. package/dist/components/verdocs-sign.js +24 -23
  177. package/dist/components/verdocs-signature-dialog.js +1 -1
  178. package/dist/components/verdocs-spinner.js +1 -1
  179. package/dist/components/verdocs-status-indicator.js +1 -1
  180. package/dist/components/verdocs-switch.js +1 -1
  181. package/dist/components/verdocs-table.js +1 -1
  182. package/dist/components/verdocs-tabs.js +1 -1
  183. package/dist/components/verdocs-template-build-tabs.js +1 -1
  184. package/dist/components/verdocs-template-card.js +1 -1
  185. package/dist/components/verdocs-template-create.js +148 -1
  186. package/dist/components/verdocs-template-document-page.js +1 -1
  187. package/dist/components/verdocs-template-field-properties.js +1 -1
  188. package/dist/components/verdocs-template-fields.js +1 -1
  189. package/dist/components/verdocs-template-role-properties.js +1 -1
  190. package/dist/components/verdocs-template-roles.js +1 -1
  191. package/dist/components/verdocs-template-star.js +1 -1
  192. package/dist/components/verdocs-template-tags.js +2 -2
  193. package/dist/components/verdocs-templates-list.js +11 -11
  194. package/dist/components/verdocs-text-input.js +1 -1
  195. package/dist/components/verdocs-toggle-button.js +1 -1
  196. package/dist/components/verdocs-toggle.js +1 -1
  197. package/dist/components/verdocs-toolbar-icon.js +1 -1
  198. package/dist/components/verdocs-upload-dialog.js +1 -1
  199. package/dist/components/verdocs-view.js +1 -1
  200. package/dist/custom-elements.json +2114 -0
  201. package/dist/esm/Datastore-52fcbac6.js +1781 -0
  202. package/dist/esm/Icons-190fd11d.js +4 -0
  203. package/dist/esm/{index-c8587076.js → index-272d51a4.js} +20 -30
  204. package/dist/esm/loader.js +3 -3
  205. package/dist/esm/{utils-27fa12eb.js → utils-47de6f79.js} +3 -2
  206. package/dist/esm/verdocs-auth.entry.js +1 -1
  207. package/dist/esm/verdocs-build.entry.js +23 -14
  208. package/dist/esm/verdocs-button-panel_2.entry.js +1 -1
  209. package/dist/esm/{verdocs-button_3.entry.js → verdocs-button_2.entry.js} +2 -56
  210. package/dist/esm/{verdocs-checkbox_4.entry.js → verdocs-checkbox_6.entry.js} +115 -26
  211. package/dist/esm/verdocs-contact-picker_2.entry.js +2 -2
  212. package/dist/esm/verdocs-dialog.entry.js +1 -1
  213. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  214. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  215. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +31 -16
  216. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +33 -18
  217. package/dist/esm/verdocs-envelope-sidebar.entry.js +65 -46
  218. package/dist/esm/verdocs-envelopes-list.entry.js +2 -2
  219. package/dist/esm/verdocs-field-attachment_13.entry.js +105 -156
  220. package/dist/esm/verdocs-field-payment.entry.js +38 -25
  221. package/dist/{components/p-fe2dca8c.js → esm/verdocs-file-chooser.entry.js} +8 -31
  222. package/dist/esm/verdocs-kba-dialog_2.entry.js +27 -5
  223. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  224. package/dist/esm/verdocs-organization-card_2.entry.js +1 -1
  225. package/dist/esm/verdocs-pagination_2.entry.js +2 -2
  226. package/dist/esm/{verdocs-preview_9.entry.js → verdocs-preview_5.entry.js} +221 -589
  227. package/dist/esm/verdocs-progress-bar.entry.js +21 -0
  228. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  229. package/dist/esm/verdocs-radio-button.entry.js +1 -1
  230. package/dist/esm/verdocs-search-box.entry.js +1 -1
  231. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  232. package/dist/esm/verdocs-sign.entry.js +11 -12
  233. package/dist/esm/verdocs-spinner.entry.js +1 -1
  234. package/dist/esm/verdocs-status-indicator.entry.js +1 -1
  235. package/dist/esm/verdocs-table.entry.js +1 -1
  236. package/dist/esm/verdocs-template-card.entry.js +1 -1
  237. package/dist/{components/p-f9cc62a7.js → esm/verdocs-template-create.entry.js} +15 -69
  238. package/dist/esm/verdocs-template-document-page_2.entry.js +79 -64
  239. package/dist/esm/verdocs-template-role-properties.entry.js +59 -38
  240. package/dist/esm/verdocs-template-star.entry.js +2 -2
  241. package/dist/esm/verdocs-template-tags.entry.js +2 -2
  242. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  243. package/dist/esm/verdocs-toggle.entry.js +1 -1
  244. package/dist/esm/verdocs-web-sdk.js +4 -4
  245. package/dist/esm-es5/Datastore-52fcbac6.js +1 -0
  246. package/dist/esm-es5/Icons-190fd11d.js +1 -0
  247. package/dist/esm-es5/index-272d51a4.js +1 -0
  248. package/dist/esm-es5/loader.js +1 -1
  249. package/dist/esm-es5/{utils-27fa12eb.js → utils-47de6f79.js} +1 -1
  250. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  251. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  252. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  253. package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
  254. package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -0
  255. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  256. package/dist/esm-es5/verdocs-dialog.entry.js +1 -1
  257. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  258. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  259. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  260. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  261. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  262. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  263. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  264. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  265. package/dist/esm-es5/verdocs-file-chooser.entry.js +1 -0
  266. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  267. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  268. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  269. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  270. package/dist/esm-es5/verdocs-preview_5.entry.js +1 -0
  271. package/dist/esm-es5/verdocs-progress-bar.entry.js +1 -0
  272. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  273. package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
  274. package/dist/esm-es5/verdocs-search-box.entry.js +1 -1
  275. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  276. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  277. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  278. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  279. package/dist/esm-es5/verdocs-table.entry.js +1 -1
  280. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  281. package/dist/esm-es5/verdocs-template-create.entry.js +1 -0
  282. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  283. package/dist/esm-es5/verdocs-template-role-properties.entry.js +1 -1
  284. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  285. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  286. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  287. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  288. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  289. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +0 -2
  290. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +8 -32
  291. package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +6 -8
  292. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +7 -6
  293. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +3 -3
  294. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +6 -5
  295. package/dist/types/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.d.ts +6 -3
  296. package/dist/types/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.d.ts +6 -3
  297. package/dist/types/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.d.ts +8 -4
  298. package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +6 -7
  299. package/dist/types/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.d.ts +6 -7
  300. package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +6 -7
  301. package/dist/types/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +6 -7
  302. package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +6 -7
  303. package/dist/types/components/fields/verdocs-field-payment/verdocs-field-payment.d.ts +44 -30
  304. package/dist/types/components/fields/verdocs-field-radio/verdocs-field-radio.d.ts +6 -7
  305. package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +6 -7
  306. package/dist/types/components/fields/verdocs-field-textarea/verdocs-field-textarea.d.ts +6 -7
  307. package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +5 -12
  308. package/dist/types/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.d.ts +6 -7
  309. package/dist/types/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.d.ts +7 -4
  310. package/dist/types/components/templates/verdocs-template-document-page/verdocs-template-document-page.d.ts +7 -4
  311. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +7 -8
  312. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +6 -8
  313. package/dist/types/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.d.ts +7 -7
  314. package/dist/types/components/templates/verdocs-template-roles/verdocs-template-roles.d.ts +7 -6
  315. package/dist/types/components.d.ts +176 -409
  316. package/dist/types/utils/Datastore.d.ts +24 -0
  317. package/dist/types/utils/Templates.d.ts +3 -0
  318. package/dist/types/utils/utils.d.ts +1 -1
  319. package/dist/verdocs-web-sdk/{p-98c5f5a5.entry.js → p-0ca1e87c.entry.js} +1 -1
  320. package/dist/verdocs-web-sdk/{p-fc053d00.entry.js → p-167e3d7e.entry.js} +1 -1
  321. package/dist/verdocs-web-sdk/p-1efce6e0.entry.js +1 -0
  322. package/dist/verdocs-web-sdk/{p-7bd37bca.entry.js → p-2a1287ec.entry.js} +1 -1
  323. package/dist/verdocs-web-sdk/{p-6419b913.system.js → p-2be751c4.system.js} +1 -1
  324. package/dist/verdocs-web-sdk/{p-cb30f11e.entry.js → p-2f73c9de.entry.js} +1 -1
  325. package/dist/verdocs-web-sdk/p-3364cc13.system.entry.js +1 -0
  326. package/dist/verdocs-web-sdk/{p-196bc80f.system.entry.js → p-37d747fb.system.entry.js} +1 -1
  327. package/dist/verdocs-web-sdk/p-386d789c.system.entry.js +1 -0
  328. package/dist/verdocs-web-sdk/p-3a1fa556.system.entry.js +1 -0
  329. package/dist/verdocs-web-sdk/{p-0fd57194.entry.js → p-41cbf650.entry.js} +1 -1
  330. package/dist/verdocs-web-sdk/{p-26715b8b.entry.js → p-4b36ca30.entry.js} +1 -1
  331. package/dist/verdocs-web-sdk/{p-98501408.system.entry.js → p-4e9e154f.system.entry.js} +1 -1
  332. package/dist/verdocs-web-sdk/{p-a3778013.system.entry.js → p-511a4ecc.system.entry.js} +1 -1
  333. package/dist/verdocs-web-sdk/{p-65a4e01e.entry.js → p-524f37a0.entry.js} +1 -1
  334. package/dist/verdocs-web-sdk/{p-13fe8650.system.entry.js → p-53f4c7c3.system.entry.js} +1 -1
  335. package/dist/verdocs-web-sdk/p-54f085d1.entry.js +1 -0
  336. package/dist/verdocs-web-sdk/{p-cca517dc.entry.js → p-584113d1.entry.js} +1 -1
  337. package/dist/verdocs-web-sdk/{p-f8cad58e.entry.js → p-5f1a000c.entry.js} +1 -1
  338. package/dist/verdocs-web-sdk/{p-256f07fd.system.entry.js → p-62f15675.system.entry.js} +1 -1
  339. package/dist/verdocs-web-sdk/{p-9b921211.js → p-650697bd.js} +1 -1
  340. package/dist/verdocs-web-sdk/{p-c06d2604.entry.js → p-65c5398e.entry.js} +1 -1
  341. package/dist/verdocs-web-sdk/p-6a95ce12.system.entry.js +1 -0
  342. package/dist/verdocs-web-sdk/{p-0446030b.entry.js → p-6ced37ed.entry.js} +1 -1
  343. package/dist/verdocs-web-sdk/{p-16619383.entry.js → p-7464b84f.entry.js} +1 -1
  344. package/dist/verdocs-web-sdk/{p-6e3fa0c4.system.entry.js → p-761f6656.system.entry.js} +1 -1
  345. package/dist/verdocs-web-sdk/{p-30bc5986.entry.js → p-76cc40fe.entry.js} +1 -1
  346. package/dist/verdocs-web-sdk/{p-c45dc777.entry.js → p-771c2f92.entry.js} +1 -1
  347. package/dist/verdocs-web-sdk/p-78191329.system.entry.js +1 -0
  348. package/dist/verdocs-web-sdk/p-79f842b4.system.entry.js +1 -0
  349. package/dist/verdocs-web-sdk/{p-f3c995d8.system.entry.js → p-7c8938e7.system.entry.js} +1 -1
  350. package/dist/verdocs-web-sdk/p-7e9c499e.js +1 -0
  351. package/dist/verdocs-web-sdk/p-8221a48f.entry.js +1 -0
  352. package/dist/verdocs-web-sdk/p-860b9f94.system.entry.js +1 -0
  353. package/dist/verdocs-web-sdk/p-89cdecac.system.entry.js +1 -0
  354. package/dist/verdocs-web-sdk/p-8a2ff048.entry.js +1 -0
  355. package/dist/verdocs-web-sdk/{p-921b56fd.system.entry.js → p-914e131c.system.entry.js} +1 -1
  356. package/dist/verdocs-web-sdk/{p-5737f0ae.system.js → p-9186f42e.system.js} +1 -1
  357. package/dist/verdocs-web-sdk/{p-8e233a6b.system.entry.js → p-9227d400.system.entry.js} +1 -1
  358. package/dist/verdocs-web-sdk/p-92ce6180.entry.js +1 -0
  359. package/dist/verdocs-web-sdk/p-9567cb7d.system.entry.js +1 -0
  360. package/dist/verdocs-web-sdk/p-9812e99d.system.entry.js +1 -0
  361. package/dist/verdocs-web-sdk/{p-4b4801ad.system.entry.js → p-982f1b36.system.entry.js} +1 -1
  362. package/dist/verdocs-web-sdk/{p-1b6736fe.system.entry.js → p-9d0b0e36.system.entry.js} +1 -1
  363. package/dist/verdocs-web-sdk/{p-6d1d86ff.system.entry.js → p-a08886c1.system.entry.js} +1 -1
  364. package/dist/verdocs-web-sdk/{p-e25e1dcf.entry.js → p-a165607e.entry.js} +1 -1
  365. package/dist/verdocs-web-sdk/p-a242aa80.system.entry.js +1 -0
  366. package/dist/verdocs-web-sdk/p-a7db9f1f.system.entry.js +1 -0
  367. package/dist/verdocs-web-sdk/{p-5d6a2fda.system.entry.js → p-a9635106.system.entry.js} +1 -1
  368. package/dist/verdocs-web-sdk/p-aebb0cd9.system.entry.js +1 -0
  369. package/dist/verdocs-web-sdk/p-b00ef194.system.entry.js +1 -0
  370. package/dist/verdocs-web-sdk/p-b0b958a0.entry.js +1 -0
  371. package/dist/verdocs-web-sdk/p-b8737f7b.entry.js +1 -0
  372. package/dist/verdocs-web-sdk/{p-49988769.js → p-b9654a5e.js} +2 -2
  373. package/dist/verdocs-web-sdk/p-bb0effe1.entry.js +1 -0
  374. package/dist/verdocs-web-sdk/p-bcc23811.entry.js +1 -0
  375. package/dist/verdocs-web-sdk/{p-0c3a471b.entry.js → p-bd7406ae.entry.js} +1 -1
  376. package/dist/verdocs-web-sdk/{p-e8d91957.entry.js → p-bdd7b3d3.entry.js} +1 -1
  377. package/dist/verdocs-web-sdk/{p-c5818330.entry.js → p-c1728f5c.entry.js} +1 -1
  378. package/dist/verdocs-web-sdk/p-c18c718f.system.js +1 -0
  379. package/dist/verdocs-web-sdk/{p-731066de.system.entry.js → p-c6fd3e53.system.entry.js} +1 -1
  380. package/dist/verdocs-web-sdk/p-c7cd6843.entry.js +1 -0
  381. package/dist/verdocs-web-sdk/{p-4f7c72f9.system.entry.js → p-c9f40726.system.entry.js} +1 -1
  382. package/dist/verdocs-web-sdk/p-ca712f40.system.entry.js +1 -0
  383. package/dist/verdocs-web-sdk/p-cbb75c5e.system.entry.js +1 -0
  384. package/dist/verdocs-web-sdk/{p-751b0280.entry.js → p-d475fff3.entry.js} +1 -1
  385. package/dist/verdocs-web-sdk/{p-91c4298b.system.entry.js → p-d5870e33.system.entry.js} +1 -1
  386. package/dist/verdocs-web-sdk/{p-e5126f26.system.entry.js → p-d8dae4e9.system.entry.js} +1 -1
  387. package/dist/verdocs-web-sdk/p-d93c7661.entry.js +1 -0
  388. package/dist/verdocs-web-sdk/{p-93093a7a.system.entry.js → p-d98cbd0f.system.entry.js} +1 -1
  389. package/dist/verdocs-web-sdk/p-da4d4eed.js +1 -0
  390. package/dist/verdocs-web-sdk/{p-2298c22e.entry.js → p-ddb17b3e.entry.js} +1 -1
  391. package/dist/verdocs-web-sdk/p-df04f0ca.entry.js +1 -0
  392. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -0
  393. package/dist/verdocs-web-sdk/{p-2aea0c7b.system.entry.js → p-e438bd02.system.entry.js} +1 -1
  394. package/dist/verdocs-web-sdk/p-e5044463.entry.js +1 -0
  395. package/dist/verdocs-web-sdk/{p-0c42cb22.system.entry.js → p-e5d291f3.system.entry.js} +1 -1
  396. package/dist/verdocs-web-sdk/{p-7f1e0c5e.entry.js → p-e6dbb0f7.entry.js} +1 -1
  397. package/dist/verdocs-web-sdk/{p-c4d61c66.entry.js → p-e83cd333.entry.js} +1 -1
  398. package/dist/verdocs-web-sdk/p-efd8149f.system.js +1 -0
  399. package/dist/verdocs-web-sdk/p-f4fcf7a5.entry.js +1 -0
  400. package/dist/verdocs-web-sdk/{p-97b951e6.system.entry.js → p-f5d01982.system.entry.js} +1 -1
  401. package/dist/verdocs-web-sdk/p-f65a9b03.entry.js +1 -0
  402. package/dist/verdocs-web-sdk/p-f7abe6e2.entry.js +1 -0
  403. package/dist/verdocs-web-sdk/{p-6e55af26.system.entry.js → p-f9b37af2.system.entry.js} +1 -1
  404. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  405. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  406. package/package.json +3 -3
  407. package/dist/cjs/EnvelopeStore-f1cd9bd3.js +0 -96
  408. package/dist/cjs/Icons-9a6f2f7c.js +0 -86
  409. package/dist/cjs/TemplateFieldStore-7bcc0f7a.js +0 -44
  410. package/dist/cjs/TemplateRoleStore-e8bb00ec.js +0 -51
  411. package/dist/cjs/TemplateStore-db21be4d.js +0 -99
  412. package/dist/cjs/index-2a189d85.js +0 -3721
  413. package/dist/cjs/index-76d03a35.js +0 -196
  414. package/dist/cjs/verdocs-loader.cjs.entry.js +0 -20
  415. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.css +0 -120
  416. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.js +0 -284
  417. package/dist/collection/components/templates/verdocs-template-name/verdocs-template-name.css +0 -0
  418. package/dist/collection/components/templates/verdocs-template-name/verdocs-template-name.js +0 -196
  419. package/dist/collection/components/templates/verdocs-template-visibillity/verdocs-template-visibility.css +0 -86
  420. package/dist/collection/components/templates/verdocs-template-visibillity/verdocs-template-visibility.js +0 -203
  421. package/dist/collection/utils/EnvelopeStore.js +0 -90
  422. package/dist/collection/utils/TemplateFieldStore.js +0 -36
  423. package/dist/collection/utils/TemplateRoleStore.js +0 -41
  424. package/dist/collection/utils/TemplateStore.js +0 -94
  425. package/dist/components/p-00d39dca.js +0 -39
  426. package/dist/components/p-0933fb2d.js +0 -127
  427. package/dist/components/p-09d28afd.js +0 -97
  428. package/dist/components/p-3555cef1.js +0 -122
  429. package/dist/components/p-474b6663.js +0 -1314
  430. package/dist/components/p-821f2345.js +0 -93
  431. package/dist/components/p-9b5a4f9e.js +0 -44
  432. package/dist/components/p-a706bac9.js +0 -3719
  433. package/dist/components/p-b0766439.js +0 -76
  434. package/dist/components/p-ed9a1a21.js +0 -200
  435. package/dist/components/verdocs-template-attachments.d.ts +0 -11
  436. package/dist/components/verdocs-template-attachments.js +0 -6
  437. package/dist/components/verdocs-template-name.d.ts +0 -11
  438. package/dist/components/verdocs-template-name.js +0 -6
  439. package/dist/components/verdocs-template-visibility.d.ts +0 -11
  440. package/dist/components/verdocs-template-visibility.js +0 -6
  441. package/dist/esm/EnvelopeStore-4599b7d3.js +0 -93
  442. package/dist/esm/Icons-faf0377f.js +0 -76
  443. package/dist/esm/TemplateFieldStore-909147d8.js +0 -39
  444. package/dist/esm/TemplateRoleStore-2fef1fdb.js +0 -44
  445. package/dist/esm/TemplateStore-ace14a8b.js +0 -97
  446. package/dist/esm/index-24d8ae6a.js +0 -194
  447. package/dist/esm/index-7588a071.js +0 -3719
  448. package/dist/esm/verdocs-file-chooser_2.entry.js +0 -53
  449. package/dist/esm/verdocs-loader.entry.js +0 -16
  450. package/dist/esm-es5/EnvelopeStore-4599b7d3.js +0 -1
  451. package/dist/esm-es5/Icons-faf0377f.js +0 -1
  452. package/dist/esm-es5/TemplateFieldStore-909147d8.js +0 -1
  453. package/dist/esm-es5/TemplateRoleStore-2fef1fdb.js +0 -1
  454. package/dist/esm-es5/TemplateStore-ace14a8b.js +0 -1
  455. package/dist/esm-es5/index-24d8ae6a.js +0 -1
  456. package/dist/esm-es5/index-7588a071.js +0 -1
  457. package/dist/esm-es5/index-c8587076.js +0 -1
  458. package/dist/esm-es5/verdocs-button_3.entry.js +0 -1
  459. package/dist/esm-es5/verdocs-checkbox_4.entry.js +0 -1
  460. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +0 -1
  461. package/dist/esm-es5/verdocs-loader.entry.js +0 -1
  462. package/dist/esm-es5/verdocs-preview_9.entry.js +0 -1
  463. package/dist/types/components/templates/verdocs-template-attachments/verdocs-template-attachments.d.ts +0 -56
  464. package/dist/types/components/templates/verdocs-template-name/verdocs-template-name.d.ts +0 -41
  465. package/dist/types/components/templates/verdocs-template-visibillity/verdocs-template-visibility.d.ts +0 -42
  466. package/dist/types/utils/EnvelopeStore.d.ts +0 -12
  467. package/dist/types/utils/TemplateFieldStore.d.ts +0 -9
  468. package/dist/types/utils/TemplateRoleStore.d.ts +0 -11
  469. package/dist/types/utils/TemplateStore.d.ts +0 -16
  470. package/dist/verdocs-web-sdk/p-0c51c5be.entry.js +0 -1
  471. package/dist/verdocs-web-sdk/p-194f9f4d.entry.js +0 -1
  472. package/dist/verdocs-web-sdk/p-1bb57e5d.entry.js +0 -1
  473. package/dist/verdocs-web-sdk/p-1ce2f724.system.entry.js +0 -1
  474. package/dist/verdocs-web-sdk/p-2211234d.system.js +0 -1
  475. package/dist/verdocs-web-sdk/p-2305c1e8.system.entry.js +0 -1
  476. package/dist/verdocs-web-sdk/p-341d540f.system.entry.js +0 -1
  477. package/dist/verdocs-web-sdk/p-368a36ea.system.js +0 -1
  478. package/dist/verdocs-web-sdk/p-36b5d46e.entry.js +0 -1
  479. package/dist/verdocs-web-sdk/p-483f3d7f.entry.js +0 -1
  480. package/dist/verdocs-web-sdk/p-569434fb.system.js +0 -1
  481. package/dist/verdocs-web-sdk/p-56c1ebd6.entry.js +0 -1
  482. package/dist/verdocs-web-sdk/p-5bf2910c.system.entry.js +0 -1
  483. package/dist/verdocs-web-sdk/p-60da2bbe.system.entry.js +0 -1
  484. package/dist/verdocs-web-sdk/p-6fda3817.js +0 -1
  485. package/dist/verdocs-web-sdk/p-79e222f8.entry.js +0 -1
  486. package/dist/verdocs-web-sdk/p-7d18cb23.system.entry.js +0 -1
  487. package/dist/verdocs-web-sdk/p-7d593603.system.js +0 -1
  488. package/dist/verdocs-web-sdk/p-9515e206.system.entry.js +0 -1
  489. package/dist/verdocs-web-sdk/p-9fabdbb1.system.entry.js +0 -1
  490. package/dist/verdocs-web-sdk/p-9ff1be63.entry.js +0 -1
  491. package/dist/verdocs-web-sdk/p-a04aac80.entry.js +0 -1
  492. package/dist/verdocs-web-sdk/p-a706bac9.js +0 -1
  493. package/dist/verdocs-web-sdk/p-b0766439.js +0 -1
  494. package/dist/verdocs-web-sdk/p-b17843d9.system.js +0 -1
  495. package/dist/verdocs-web-sdk/p-b56793c4.entry.js +0 -1
  496. package/dist/verdocs-web-sdk/p-b7a9f07d.system.entry.js +0 -1
  497. package/dist/verdocs-web-sdk/p-b84d1a25.system.entry.js +0 -1
  498. package/dist/verdocs-web-sdk/p-bb253149.js +0 -1
  499. package/dist/verdocs-web-sdk/p-bd642df2.js +0 -1
  500. package/dist/verdocs-web-sdk/p-c7115b35.system.entry.js +0 -1
  501. package/dist/verdocs-web-sdk/p-cd546dbe.system.js +0 -1
  502. package/dist/verdocs-web-sdk/p-cde4c155.js +0 -1
  503. package/dist/verdocs-web-sdk/p-d86c8c1a.entry.js +0 -1
  504. package/dist/verdocs-web-sdk/p-dbddb752.system.entry.js +0 -1
  505. package/dist/verdocs-web-sdk/p-dcd3eb1b.js +0 -1
  506. package/dist/verdocs-web-sdk/p-e123f19c.entry.js +0 -1
  507. package/dist/verdocs-web-sdk/p-e294b6c2.system.entry.js +0 -1
  508. package/dist/verdocs-web-sdk/p-e48b387d.system.entry.js +0 -1
  509. package/dist/verdocs-web-sdk/p-e83a163d.entry.js +0 -1
  510. package/dist/verdocs-web-sdk/p-e952ab89.system.entry.js +0 -1
  511. package/dist/verdocs-web-sdk/p-f08eb8bf.entry.js +0 -1
  512. package/dist/verdocs-web-sdk/p-f5064e0c.system.js +0 -1
  513. package/dist/verdocs-web-sdk/p-f79b8537.system.js +0 -1
  514. package/dist/verdocs-web-sdk/p-fa06e241.entry.js +0 -1
@@ -1 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var e=function(n,t){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return e(n,t)};return function(n,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))e[i]=n[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function u(e){try{o(r["throw"](e))}catch(e){a(e)}}function o(e){e.done?t(e.value):i(e.value).then(s,u)}o((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(e){return function(n){return o([e,n])}}function o(u){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(t=0)),t)try{if(r=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1];a=u;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(u);break}if(a[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var r=0,i=n.length,a;r<i;r++){if(a||!(r in n)){if(!a)a=Array.prototype.slice.call(n,0,r);a[r]=n[r]}}return e.concat(a||Array.prototype.slice.call(n))};System.register([],(function(e){"use strict";return{execute:function(){var n;(function(e){e.assertEqual=function(e){return e};function n(e){}e.assertIs=n;function t(e){throw new Error}e.assertNever=t;e.arrayToEnum=function(e){var n={};for(var t=0,r=e;t<r.length;t++){var i=r[t];n[i]=i}return n};e.getValidEnumValues=function(n){var t=e.objectKeys(n).filter((function(e){return typeof n[n[e]]!=="number"}));var r={};for(var i=0,a=t;i<a.length;i++){var s=a[i];r[s]=n[s]}return e.objectValues(r)};e.objectValues=function(n){return e.objectKeys(n).map((function(e){return n[e]}))};e.objectKeys=typeof Object.keys==="function"?function(e){return Object.keys(e)}:function(e){var n=[];for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t)){n.push(t)}}return n};e.find=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(n(i))return i}return undefined};e.isInteger=typeof Number.isInteger==="function"?function(e){return Number.isInteger(e)}:function(e){return typeof e==="number"&&isFinite(e)&&Math.floor(e)===e};function r(e,n){if(n===void 0){n=" | "}return e.map((function(e){return typeof e==="string"?"'".concat(e,"'"):e})).join(n)}e.joinValues=r;e.jsonStringifyReplacer=function(e,n){if(typeof n==="bigint"){return n.toString()}return n}})(n||(n={}));var t;(function(e){e.mergeShapes=function(e,n){return __assign(__assign({},e),n)}})(t||(t={}));var r=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var i=function(e){var n=typeof e;switch(n){case"undefined":return r.undefined;case"string":return r.string;case"number":return isNaN(e)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":if(Array.isArray(e)){return r.array}if(e===null){return r.null}if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function"){return r.promise}if(typeof Map!=="undefined"&&e instanceof Map){return r.map}if(typeof Set!=="undefined"&&e instanceof Set){return r.set}if(typeof Date!=="undefined"&&e instanceof Date){return r.date}return r.object;default:return r.unknown}};var a=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var s=function(e){__extends(t,e);function t(n){var t=this.constructor;var r=e.call(this)||this;r.issues=[];r.addIssue=function(e){r.issues=__spreadArray(__spreadArray([],r.issues,true),[e],false)};r.addIssues=function(e){if(e===void 0){e=[]}r.issues=__spreadArray(__spreadArray([],r.issues,true),e,true)};var i=t.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(r,i)}else{r.__proto__=i}r.name="ZodError";r.issues=n;return r}Object.defineProperty(t.prototype,"errors",{get:function(){return this.issues},enumerable:false,configurable:true});t.prototype.format=function(e){var n=e||function(e){return e.message};var t={_errors:[]};var r=function(e){for(var i=0,a=e.issues;i<a.length;i++){var s=a[i];if(s.code==="invalid_union"){s.unionErrors.map(r)}else if(s.code==="invalid_return_type"){r(s.returnTypeError)}else if(s.code==="invalid_arguments"){r(s.argumentsError)}else if(s.path.length===0){t._errors.push(n(s))}else{var u=t;var o=0;while(o<s.path.length){var f=s.path[o];var c=o===s.path.length-1;if(!c){u[f]=u[f]||{_errors:[]}}else{u[f]=u[f]||{_errors:[]};u[f]._errors.push(n(s))}u=u[f];o++}}}};r(this);return t};t.assert=function(e){if(!(e instanceof t)){throw new Error("Not a ZodError: ".concat(e))}};t.prototype.toString=function(){return this.message};Object.defineProperty(t.prototype,"message",{get:function(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.issues.length===0},enumerable:false,configurable:true});t.prototype.flatten=function(e){if(e===void 0){e=function(e){return e.message}}var n={};var t=[];for(var r=0,i=this.issues;r<i.length;r++){var a=i[r];if(a.path.length>0){n[a.path[0]]=n[a.path[0]]||[];n[a.path[0]].push(e(a))}else{t.push(e(a))}}return{formErrors:t,fieldErrors:n}};Object.defineProperty(t.prototype,"formErrors",{get:function(){return this.flatten()},enumerable:false,configurable:true});return t}(Error);s.create=function(e){var n=new s(e);return n};var u=function(e,t){var i;switch(e.code){case a.invalid_type:if(e.received===r.undefined){i="Required"}else{i="Expected ".concat(e.expected,", received ").concat(e.received)}break;case a.invalid_literal:i="Invalid literal value, expected ".concat(JSON.stringify(e.expected,n.jsonStringifyReplacer));break;case a.unrecognized_keys:i="Unrecognized key(s) in object: ".concat(n.joinValues(e.keys,", "));break;case a.invalid_union:i="Invalid input";break;case a.invalid_union_discriminator:i="Invalid discriminator value. Expected ".concat(n.joinValues(e.options));break;case a.invalid_enum_value:i="Invalid enum value. Expected ".concat(n.joinValues(e.options),", received '").concat(e.received,"'");break;case a.invalid_arguments:i="Invalid function arguments";break;case a.invalid_return_type:i="Invalid function return type";break;case a.invalid_date:i="Invalid date";break;case a.invalid_string:if(typeof e.validation==="object"){if("includes"in e.validation){i='Invalid input: must include "'.concat(e.validation.includes,'"');if(typeof e.validation.position==="number"){i="".concat(i," at one or more positions greater than or equal to ").concat(e.validation.position)}}else if("startsWith"in e.validation){i='Invalid input: must start with "'.concat(e.validation.startsWith,'"')}else if("endsWith"in e.validation){i='Invalid input: must end with "'.concat(e.validation.endsWith,'"')}else{n.assertNever(e.validation)}}else if(e.validation!=="regex"){i="Invalid ".concat(e.validation)}else{i="Invalid"}break;case a.too_small:if(e.type==="array")i="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)");else if(e.type==="string")i="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)");else if(e.type==="number")i="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum);else if(e.type==="date")i="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum)));else i="Invalid input";break;case a.too_big:if(e.type==="array")i="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)");else if(e.type==="string")i="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)");else if(e.type==="number")i="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum);else if(e.type==="bigint")i="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum);else if(e.type==="date")i="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum)));else i="Invalid input";break;case a.custom:i="Invalid input";break;case a.invalid_intersection_types:i="Intersection results could not be merged";break;case a.not_multiple_of:i="Number must be a multiple of ".concat(e.multipleOf);break;case a.not_finite:i="Number must be finite";break;default:i=t.defaultError;n.assertNever(e)}return{message:i}};var o=u;function f(){return o}var c=function(e){var n=e.data,t=e.path,r=e.errorMaps,i=e.issueData;var a=__spreadArray(__spreadArray([],t,true),i.path||[],true);var s=__assign(__assign({},i),{path:a});if(i.message!==undefined){return __assign(__assign({},i),{path:a,message:i.message})}var u="";var o=r.filter((function(e){return!!e})).slice().reverse();for(var f=0,c=o;f<c.length;f++){var l=c[f];u=l(s,{data:n,defaultError:u}).message}return __assign(__assign({},i),{path:a,message:u})};function l(e,n){var t=f();var r=c({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,t,t===u?undefined:u].filter((function(e){return!!e}))});e.common.issues.push(r)}var h=function(){function e(){this.value="valid"}e.prototype.dirty=function(){if(this.value==="valid")this.value="dirty"};e.prototype.abort=function(){if(this.value!=="aborted")this.value="aborted"};e.mergeArray=function(e,n){var t=[];for(var r=0,i=n;r<i.length;r++){var a=i[r];if(a.status==="aborted")return d;if(a.status==="dirty")e.dirty();t.push(a.value)}return{status:e.value,value:t}};e.mergeObjectAsync=function(n,t){return __awaiter(this,void 0,void 0,(function(){var r,i,a,s,u,o;return __generator(this,(function(f){switch(f.label){case 0:r=[];i=0,a=t;f.label=1;case 1:if(!(i<a.length))return[3,5];s=a[i];return[4,s.key];case 2:u=f.sent();return[4,s.value];case 3:o=f.sent();r.push({key:u,value:o});f.label=4;case 4:i++;return[3,1];case 5:return[2,e.mergeObjectSync(n,r)]}}))}))};e.mergeObjectSync=function(e,n){var t={};for(var r=0,i=n;r<i.length;r++){var a=i[r];var s=a.key,u=a.value;if(s.status==="aborted")return d;if(u.status==="aborted")return d;if(s.status==="dirty")e.dirty();if(u.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof u.value!=="undefined"||a.alwaysSet)){t[s.value]=u.value}}return{status:e.value,value:t}};return e}();var d=Object.freeze({status:"aborted"});var v=function(e){return{status:"dirty",value:e}};var _=function(e){return{status:"valid",value:e}};var m=function(e){return e.status==="aborted"};var g=function(e){return e.status==="dirty"};var p=function(e){return e.status==="valid"};var y=function(e){return typeof Promise!=="undefined"&&e instanceof Promise};function b(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n==="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)}function w(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof n==="function"?e!==n||!i:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t}typeof SuppressedError==="function"?SuppressedError:function(e,n,t){var r=new Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};var x;(function(e){e.errToObj=function(e){return typeof e==="string"?{message:e}:e||{}};e.toString=function(e){return typeof e==="string"?e:e===null||e===void 0?void 0:e.message}})(x||(x={}));var k,N;var j=function(){function e(e,n,t,r){this._cachedPath=[];this.parent=e;this.data=n;this._path=t;this._key=r}Object.defineProperty(e.prototype,"path",{get:function(){var e,n;if(!this._cachedPath.length){if(this._key instanceof Array){(e=this._cachedPath).push.apply(e,__spreadArray(__spreadArray([],this._path,false),this._key,false))}else{(n=this._cachedPath).push.apply(n,__spreadArray(__spreadArray([],this._path,false),[this._key],false))}}return this._cachedPath},enumerable:false,configurable:true});return e}();var O=function(e,n){if(p(n)){return{success:true,data:n.value}}else{if(!e.common.issues.length){throw new Error("Validation failed but no issues detected.")}return{success:false,get error(){if(this._error)return this._error;var n=new s(e.common.issues);this._error=n;return this._error}}}};function A(e){if(!e)return{};var n=e.errorMap,t=e.invalid_type_error,r=e.required_error,i=e.description;if(n&&(t||r)){throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.')}if(n)return{errorMap:n,description:i};var a=function(n,i){var a,s;var u=e.message;if(n.code==="invalid_enum_value"){return{message:u!==null&&u!==void 0?u:i.defaultError}}if(typeof i.data==="undefined"){return{message:(a=u!==null&&u!==void 0?u:r)!==null&&a!==void 0?a:i.defaultError}}if(n.code!=="invalid_type")return{message:i.defaultError};return{message:(s=u!==null&&u!==void 0?u:t)!==null&&s!==void 0?s:i.defaultError}};return{errorMap:a,description:i}}var E=function(){function e(e){this.spa=this.safeParseAsync;this._def=e;this.parse=this.parse.bind(this);this.safeParse=this.safeParse.bind(this);this.parseAsync=this.parseAsync.bind(this);this.safeParseAsync=this.safeParseAsync.bind(this);this.spa=this.spa.bind(this);this.refine=this.refine.bind(this);this.refinement=this.refinement.bind(this);this.superRefine=this.superRefine.bind(this);this.optional=this.optional.bind(this);this.nullable=this.nullable.bind(this);this.nullish=this.nullish.bind(this);this.array=this.array.bind(this);this.promise=this.promise.bind(this);this.or=this.or.bind(this);this.and=this.and.bind(this);this.transform=this.transform.bind(this);this.brand=this.brand.bind(this);this.default=this.default.bind(this);this.catch=this.catch.bind(this);this.describe=this.describe.bind(this);this.pipe=this.pipe.bind(this);this.readonly=this.readonly.bind(this);this.isNullable=this.isNullable.bind(this);this.isOptional=this.isOptional.bind(this)}Object.defineProperty(e.prototype,"description",{get:function(){return this._def.description},enumerable:false,configurable:true});e.prototype._getType=function(e){return i(e.data)};e.prototype._getOrReturnCtx=function(e,n){return n||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}};e.prototype._processInputParams=function(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}};e.prototype._parseSync=function(e){var n=this._parse(e);if(y(n)){throw new Error("Synchronous parse encountered promise.")}return n};e.prototype._parseAsync=function(e){var n=this._parse(e);return Promise.resolve(n)};e.prototype.parse=function(e,n){var t=this.safeParse(e,n);if(t.success)return t.data;throw t.error};e.prototype.safeParse=function(e,n){var t;var r={common:{issues:[],async:(t=n===null||n===void 0?void 0:n.async)!==null&&t!==void 0?t:false,contextualErrorMap:n===null||n===void 0?void 0:n.errorMap},path:(n===null||n===void 0?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};var a=this._parseSync({data:e,path:r.path,parent:r});return O(r,a)};e.prototype.parseAsync=function(e,n){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.safeParseAsync(e,n)];case 1:t=r.sent();if(t.success)return[2,t.data];throw t.error}}))}))};e.prototype.safeParseAsync=function(e,n){return __awaiter(this,void 0,void 0,(function(){var t,r,a;return __generator(this,(function(s){switch(s.label){case 0:t={common:{issues:[],contextualErrorMap:n===null||n===void 0?void 0:n.errorMap,async:true},path:(n===null||n===void 0?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};r=this._parse({data:e,path:t.path,parent:t});return[4,y(r)?r:Promise.resolve(r)];case 1:a=s.sent();return[2,O(t,a)]}}))}))};e.prototype.refine=function(e,n){var t=function(e){if(typeof n==="string"||typeof n==="undefined"){return{message:n}}else if(typeof n==="function"){return n(e)}else{return n}};return this._refinement((function(n,r){var i=e(n);var s=function(){return r.addIssue(__assign({code:a.custom},t(n)))};if(typeof Promise!=="undefined"&&i instanceof Promise){return i.then((function(e){if(!e){s();return false}else{return true}}))}if(!i){s();return false}else{return true}}))};e.prototype.refinement=function(e,n){return this._refinement((function(t,r){if(!e(t)){r.addIssue(typeof n==="function"?n(t,r):n);return false}else{return true}}))};e.prototype._refinement=function(e){return new we({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:e}})};e.prototype.superRefine=function(e){return this._refinement(e)};e.prototype.optional=function(){return xe.create(this,this._def)};e.prototype.nullable=function(){return ke.create(this,this._def)};e.prototype.nullish=function(){return this.nullable().optional()};e.prototype.array=function(){return se.create(this,this._def)};e.prototype.promise=function(){return be.create(this,this._def)};e.prototype.or=function(e){return fe.create([this,e],this._def)};e.prototype.and=function(e){return le.create(this,e,this._def)};e.prototype.transform=function(e){return new we(__assign(__assign({},A(this._def)),{schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:e}}))};e.prototype.default=function(e){var n=typeof e==="function"?e:function(){return e};return new Ne(__assign(__assign({},A(this._def)),{innerType:this,defaultValue:n,typeName:Ie.ZodDefault}))};e.prototype.brand=function(){return new Ae(__assign({typeName:Ie.ZodBranded,type:this},A(this._def)))};e.prototype.catch=function(e){var n=typeof e==="function"?e:function(){return e};return new je(__assign(__assign({},A(this._def)),{innerType:this,catchValue:n,typeName:Ie.ZodCatch}))};e.prototype.describe=function(e){var n=this.constructor;return new n(__assign(__assign({},this._def),{description:e}))};e.prototype.pipe=function(e){return Ee.create(this,e)};e.prototype.readonly=function(){return Ze.create(this)};e.prototype.isOptional=function(){return this.safeParse(undefined).success};e.prototype.isNullable=function(){return this.safeParse(null).success};return e}();var Z=/^c[^\s-]{8,}$/i;var I=/^[0-9a-z]+$/;var S=/^[0-9A-HJKMNP-TV-Z]{26}$/;var P=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;var D=/^[a-z0-9_-]{21}$/i;var T=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;var M=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;var $="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";var U;var L=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;var z=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;var B=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;var C="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))";var V=new RegExp("^".concat(C,"$"));function W(e){var n="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(e.precision){n="".concat(n,"\\.\\d{").concat(e.precision,"}")}else if(e.precision==null){n="".concat(n,"(\\.\\d+)?")}return n}function q(e){return new RegExp("^".concat(W(e),"$"))}function K(e){var n="".concat(C,"T").concat(W(e));var t=[];t.push(e.local?"Z?":"Z");if(e.offset)t.push("([+-]\\d{2}:?\\d{2})");n="".concat(n,"(").concat(t.join("|"),")");return new RegExp("^".concat(n,"$"))}function R(e,n){if((n==="v4"||!n)&&L.test(e)){return true}if((n==="v6"||!n)&&z.test(e)){return true}return false}var F=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(this._def.coerce){e.data=String(e.data)}var t=this._getType(e);if(t!==r.string){var i=this._getOrReturnCtx(e);l(i,{code:a.invalid_type,expected:r.string,received:i.parsedType});return d}var s=new h;var u=undefined;for(var o=0,f=this._def.checks;o<f.length;o++){var c=f[o];if(c.kind==="min"){if(e.data.length<c.value){u=this._getOrReturnCtx(e,u);l(u,{code:a.too_small,minimum:c.value,type:"string",inclusive:true,exact:false,message:c.message});s.dirty()}}else if(c.kind==="max"){if(e.data.length>c.value){u=this._getOrReturnCtx(e,u);l(u,{code:a.too_big,maximum:c.value,type:"string",inclusive:true,exact:false,message:c.message});s.dirty()}}else if(c.kind==="length"){var v=e.data.length>c.value;var _=e.data.length<c.value;if(v||_){u=this._getOrReturnCtx(e,u);if(v){l(u,{code:a.too_big,maximum:c.value,type:"string",inclusive:true,exact:true,message:c.message})}else if(_){l(u,{code:a.too_small,minimum:c.value,type:"string",inclusive:true,exact:true,message:c.message})}s.dirty()}}else if(c.kind==="email"){if(!M.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"email",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="emoji"){if(!U){U=new RegExp($,"u")}if(!U.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"emoji",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="uuid"){if(!P.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"uuid",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="nanoid"){if(!D.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"nanoid",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="cuid"){if(!Z.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"cuid",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="cuid2"){if(!I.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"cuid2",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="ulid"){if(!S.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"ulid",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="url"){try{new URL(e.data)}catch(n){u=this._getOrReturnCtx(e,u);l(u,{validation:"url",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="regex"){c.regex.lastIndex=0;var m=c.regex.test(e.data);if(!m){u=this._getOrReturnCtx(e,u);l(u,{validation:"regex",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="trim"){e.data=e.data.trim()}else if(c.kind==="includes"){if(!e.data.includes(c.value,c.position)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:{includes:c.value,position:c.position},message:c.message});s.dirty()}}else if(c.kind==="toLowerCase"){e.data=e.data.toLowerCase()}else if(c.kind==="toUpperCase"){e.data=e.data.toUpperCase()}else if(c.kind==="startsWith"){if(!e.data.startsWith(c.value)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:{startsWith:c.value},message:c.message});s.dirty()}}else if(c.kind==="endsWith"){if(!e.data.endsWith(c.value)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:{endsWith:c.value},message:c.message});s.dirty()}}else if(c.kind==="datetime"){var g=K(c);if(!g.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:"datetime",message:c.message});s.dirty()}}else if(c.kind==="date"){var g=V;if(!g.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:"date",message:c.message});s.dirty()}}else if(c.kind==="time"){var g=q(c);if(!g.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{code:a.invalid_string,validation:"time",message:c.message});s.dirty()}}else if(c.kind==="duration"){if(!T.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"duration",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="ip"){if(!R(e.data,c.version)){u=this._getOrReturnCtx(e,u);l(u,{validation:"ip",code:a.invalid_string,message:c.message});s.dirty()}}else if(c.kind==="base64"){if(!B.test(e.data)){u=this._getOrReturnCtx(e,u);l(u,{validation:"base64",code:a.invalid_string,message:c.message});s.dirty()}}else{n.assertNever(c)}}return{status:s.value,value:e.data}};t.prototype._regex=function(e,n,t){return this.refinement((function(n){return e.test(n)}),__assign({validation:n,code:a.invalid_string},x.errToObj(t)))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.email=function(e){return this._addCheck(__assign({kind:"email"},x.errToObj(e)))};t.prototype.url=function(e){return this._addCheck(__assign({kind:"url"},x.errToObj(e)))};t.prototype.emoji=function(e){return this._addCheck(__assign({kind:"emoji"},x.errToObj(e)))};t.prototype.uuid=function(e){return this._addCheck(__assign({kind:"uuid"},x.errToObj(e)))};t.prototype.nanoid=function(e){return this._addCheck(__assign({kind:"nanoid"},x.errToObj(e)))};t.prototype.cuid=function(e){return this._addCheck(__assign({kind:"cuid"},x.errToObj(e)))};t.prototype.cuid2=function(e){return this._addCheck(__assign({kind:"cuid2"},x.errToObj(e)))};t.prototype.ulid=function(e){return this._addCheck(__assign({kind:"ulid"},x.errToObj(e)))};t.prototype.base64=function(e){return this._addCheck(__assign({kind:"base64"},x.errToObj(e)))};t.prototype.ip=function(e){return this._addCheck(__assign({kind:"ip"},x.errToObj(e)))};t.prototype.datetime=function(e){var n,t;if(typeof e==="string"){return this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e})}return this._addCheck(__assign({kind:"datetime",precision:typeof(e===null||e===void 0?void 0:e.precision)==="undefined"?null:e===null||e===void 0?void 0:e.precision,offset:(n=e===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:false,local:(t=e===null||e===void 0?void 0:e.local)!==null&&t!==void 0?t:false},x.errToObj(e===null||e===void 0?void 0:e.message)))};t.prototype.date=function(e){return this._addCheck({kind:"date",message:e})};t.prototype.time=function(e){if(typeof e==="string"){return this._addCheck({kind:"time",precision:null,message:e})}return this._addCheck(__assign({kind:"time",precision:typeof(e===null||e===void 0?void 0:e.precision)==="undefined"?null:e===null||e===void 0?void 0:e.precision},x.errToObj(e===null||e===void 0?void 0:e.message)))};t.prototype.duration=function(e){return this._addCheck(__assign({kind:"duration"},x.errToObj(e)))};t.prototype.regex=function(e,n){return this._addCheck(__assign({kind:"regex",regex:e},x.errToObj(n)))};t.prototype.includes=function(e,n){return this._addCheck(__assign({kind:"includes",value:e,position:n===null||n===void 0?void 0:n.position},x.errToObj(n===null||n===void 0?void 0:n.message)))};t.prototype.startsWith=function(e,n){return this._addCheck(__assign({kind:"startsWith",value:e},x.errToObj(n)))};t.prototype.endsWith=function(e,n){return this._addCheck(__assign({kind:"endsWith",value:e},x.errToObj(n)))};t.prototype.min=function(e,n){return this._addCheck(__assign({kind:"min",value:e},x.errToObj(n)))};t.prototype.max=function(e,n){return this._addCheck(__assign({kind:"max",value:e},x.errToObj(n)))};t.prototype.length=function(e,n){return this._addCheck(__assign({kind:"length",value:e},x.errToObj(n)))};t.prototype.nonempty=function(e){return this.min(1,x.errToObj(e))};t.prototype.trim=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"trim"}],false)}))};t.prototype.toLowerCase=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"toLowerCase"}],false)}))};t.prototype.toUpperCase=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"toUpperCase"}],false)}))};Object.defineProperty(t.prototype,"isDatetime",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="datetime"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDate",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="date"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTime",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="time"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDuration",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="duration"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmail",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="email"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isURL",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="url"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmoji",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="emoji"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isUUID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="uuid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isNANOID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="nanoid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isCUID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="cuid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isCUID2",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="cuid2"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isULID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="ulid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isIP",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="ip"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isBase64",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="base64"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"minLength",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="min"){if(e===null||r.value>e)e=r.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxLength",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="max"){if(e===null||r.value<e)e=r.value}}return e},enumerable:false,configurable:true});return t}(E);F.create=function(e){var n;return new F(__assign({checks:[],typeName:Ie.ZodString,coerce:(n=e===null||e===void 0?void 0:e.coerce)!==null&&n!==void 0?n:false},A(e)))};function H(e,n){var t=(e.toString().split(".")[1]||"").length;var r=(n.toString().split(".")[1]||"").length;var i=t>r?t:r;var a=parseInt(e.toFixed(i).replace(".",""));var s=parseInt(n.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}var J=function(e){__extends(t,e);function t(){var n=e.apply(this,arguments)||this;n.min=n.gte;n.max=n.lte;n.step=n.multipleOf;return n}t.prototype._parse=function(e){if(this._def.coerce){e.data=Number(e.data)}var t=this._getType(e);if(t!==r.number){var i=this._getOrReturnCtx(e);l(i,{code:a.invalid_type,expected:r.number,received:i.parsedType});return d}var s=undefined;var u=new h;for(var o=0,f=this._def.checks;o<f.length;o++){var c=f[o];if(c.kind==="int"){if(!n.isInteger(e.data)){s=this._getOrReturnCtx(e,s);l(s,{code:a.invalid_type,expected:"integer",received:"float",message:c.message});u.dirty()}}else if(c.kind==="min"){var v=c.inclusive?e.data<c.value:e.data<=c.value;if(v){s=this._getOrReturnCtx(e,s);l(s,{code:a.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:false,message:c.message});u.dirty()}}else if(c.kind==="max"){var _=c.inclusive?e.data>c.value:e.data>=c.value;if(_){s=this._getOrReturnCtx(e,s);l(s,{code:a.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:false,message:c.message});u.dirty()}}else if(c.kind==="multipleOf"){if(H(e.data,c.value)!==0){s=this._getOrReturnCtx(e,s);l(s,{code:a.not_multiple_of,multipleOf:c.value,message:c.message});u.dirty()}}else if(c.kind==="finite"){if(!Number.isFinite(e.data)){s=this._getOrReturnCtx(e,s);l(s,{code:a.not_finite,message:c.message});u.dirty()}}else{n.assertNever(c)}}return{status:u.value,value:e.data}};t.prototype.gte=function(e,n){return this.setLimit("min",e,true,x.toString(n))};t.prototype.gt=function(e,n){return this.setLimit("min",e,false,x.toString(n))};t.prototype.lte=function(e,n){return this.setLimit("max",e,true,x.toString(n))};t.prototype.lt=function(e,n){return this.setLimit("max",e,false,x.toString(n))};t.prototype.setLimit=function(e,n,r,i){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:e,value:n,inclusive:r,message:x.toString(i)}],false)}))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.int=function(e){return this._addCheck({kind:"int",message:x.toString(e)})};t.prototype.positive=function(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:x.toString(e)})};t.prototype.negative=function(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:x.toString(e)})};t.prototype.nonpositive=function(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:x.toString(e)})};t.prototype.nonnegative=function(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:x.toString(e)})};t.prototype.multipleOf=function(e,n){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(n)})};t.prototype.finite=function(e){return this._addCheck({kind:"finite",message:x.toString(e)})};t.prototype.safe=function(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})};Object.defineProperty(t.prototype,"minValue",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="min"){if(e===null||r.value>e)e=r.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxValue",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="max"){if(e===null||r.value<e)e=r.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isInt",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="int"||e.kind==="multipleOf"&&n.isInteger(e.value)}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFinite",{get:function(){var e=null,n=null;for(var t=0,r=this._def.checks;t<r.length;t++){var i=r[t];if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf"){return true}else if(i.kind==="min"){if(n===null||i.value>n)n=i.value}else if(i.kind==="max"){if(e===null||i.value<e)e=i.value}}return Number.isFinite(n)&&Number.isFinite(e)},enumerable:false,configurable:true});return t}(E);J.create=function(e){return new J(__assign({checks:[],typeName:Ie.ZodNumber,coerce:(e===null||e===void 0?void 0:e.coerce)||false},A(e)))};var Y=function(e){__extends(t,e);function t(){var n=e.apply(this,arguments)||this;n.min=n.gte;n.max=n.lte;return n}t.prototype._parse=function(e){if(this._def.coerce){e.data=BigInt(e.data)}var t=this._getType(e);if(t!==r.bigint){var i=this._getOrReturnCtx(e);l(i,{code:a.invalid_type,expected:r.bigint,received:i.parsedType});return d}var s=undefined;var u=new h;for(var o=0,f=this._def.checks;o<f.length;o++){var c=f[o];if(c.kind==="min"){var v=c.inclusive?e.data<c.value:e.data<=c.value;if(v){s=this._getOrReturnCtx(e,s);l(s,{code:a.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message});u.dirty()}}else if(c.kind==="max"){var _=c.inclusive?e.data>c.value:e.data>=c.value;if(_){s=this._getOrReturnCtx(e,s);l(s,{code:a.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message});u.dirty()}}else if(c.kind==="multipleOf"){if(e.data%c.value!==BigInt(0)){s=this._getOrReturnCtx(e,s);l(s,{code:a.not_multiple_of,multipleOf:c.value,message:c.message});u.dirty()}}else{n.assertNever(c)}}return{status:u.value,value:e.data}};t.prototype.gte=function(e,n){return this.setLimit("min",e,true,x.toString(n))};t.prototype.gt=function(e,n){return this.setLimit("min",e,false,x.toString(n))};t.prototype.lte=function(e,n){return this.setLimit("max",e,true,x.toString(n))};t.prototype.lt=function(e,n){return this.setLimit("max",e,false,x.toString(n))};t.prototype.setLimit=function(e,n,r,i){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:e,value:n,inclusive:r,message:x.toString(i)}],false)}))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.positive=function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:x.toString(e)})};t.prototype.negative=function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:x.toString(e)})};t.prototype.nonpositive=function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:x.toString(e)})};t.prototype.nonnegative=function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:x.toString(e)})};t.prototype.multipleOf=function(e,n){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(n)})};Object.defineProperty(t.prototype,"minValue",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="min"){if(e===null||r.value>e)e=r.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxValue",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="max"){if(e===null||r.value<e)e=r.value}}return e},enumerable:false,configurable:true});return t}(E);Y.create=function(e){var n;return new Y(__assign({checks:[],typeName:Ie.ZodBigInt,coerce:(n=e===null||e===void 0?void 0:e.coerce)!==null&&n!==void 0?n:false},A(e)))};var G=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){if(this._def.coerce){e.data=Boolean(e.data)}var n=this._getType(e);if(n!==r.boolean){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.boolean,received:t.parsedType});return d}return _(e.data)};return n}(E);G.create=function(e){return new G(__assign({typeName:Ie.ZodBoolean,coerce:(e===null||e===void 0?void 0:e.coerce)||false},A(e)))};var Q=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(this._def.coerce){e.data=new Date(e.data)}var t=this._getType(e);if(t!==r.date){var i=this._getOrReturnCtx(e);l(i,{code:a.invalid_type,expected:r.date,received:i.parsedType});return d}if(isNaN(e.data.getTime())){var s=this._getOrReturnCtx(e);l(s,{code:a.invalid_date});return d}var u=new h;var o=undefined;for(var f=0,c=this._def.checks;f<c.length;f++){var v=c[f];if(v.kind==="min"){if(e.data.getTime()<v.value){o=this._getOrReturnCtx(e,o);l(o,{code:a.too_small,message:v.message,inclusive:true,exact:false,minimum:v.value,type:"date"});u.dirty()}}else if(v.kind==="max"){if(e.data.getTime()>v.value){o=this._getOrReturnCtx(e,o);l(o,{code:a.too_big,message:v.message,inclusive:true,exact:false,maximum:v.value,type:"date"});u.dirty()}}else{n.assertNever(v)}}return{status:u.value,value:new Date(e.data.getTime())}};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.min=function(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(n)})};t.prototype.max=function(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(n)})};Object.defineProperty(t.prototype,"minDate",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="min"){if(e===null||r.value>e)e=r.value}}return e!=null?new Date(e):null},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxDate",{get:function(){var e=null;for(var n=0,t=this._def.checks;n<t.length;n++){var r=t[n];if(r.kind==="max"){if(e===null||r.value<e)e=r.value}}return e!=null?new Date(e):null},enumerable:false,configurable:true});return t}(E);Q.create=function(e){return new Q(__assign({checks:[],coerce:(e===null||e===void 0?void 0:e.coerce)||false,typeName:Ie.ZodDate},A(e)))};var X=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n!==r.symbol){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.symbol,received:t.parsedType});return d}return _(e.data)};return n}(E);X.create=function(e){return new X(__assign({typeName:Ie.ZodSymbol},A(e)))};var ee=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n!==r.undefined){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.undefined,received:t.parsedType});return d}return _(e.data)};return n}(E);ee.create=function(e){return new ee(__assign({typeName:Ie.ZodUndefined},A(e)))};var ne=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n!==r.null){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.null,received:t.parsedType});return d}return _(e.data)};return n}(E);ne.create=function(e){return new ne(__assign({typeName:Ie.ZodNull},A(e)))};var te=function(e){__extends(n,e);function n(){var n=e.apply(this,arguments)||this;n._any=true;return n}n.prototype._parse=function(e){return _(e.data)};return n}(E);te.create=function(e){return new te(__assign({typeName:Ie.ZodAny},A(e)))};var re=function(e){__extends(n,e);function n(){var n=e.apply(this,arguments)||this;n._unknown=true;return n}n.prototype._parse=function(e){return _(e.data)};return n}(E);re.create=function(e){return new re(__assign({typeName:Ie.ZodUnknown},A(e)))};var ie=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getOrReturnCtx(e);l(n,{code:a.invalid_type,expected:r.never,received:n.parsedType});return d};return n}(E);ie.create=function(e){return new ie(__assign({typeName:Ie.ZodNever},A(e)))};var ae=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n!==r.undefined){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.void,received:t.parsedType});return d}return _(e.data)};return n}(E);ae.create=function(e){return new ae(__assign({typeName:Ie.ZodVoid},A(e)))};var se=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._processInputParams(e),t=n.ctx,i=n.status;var s=this._def;if(t.parsedType!==r.array){l(t,{code:a.invalid_type,expected:r.array,received:t.parsedType});return d}if(s.exactLength!==null){var u=t.data.length>s.exactLength.value;var o=t.data.length<s.exactLength.value;if(u||o){l(t,{code:u?a.too_big:a.too_small,minimum:o?s.exactLength.value:undefined,maximum:u?s.exactLength.value:undefined,type:"array",inclusive:true,exact:true,message:s.exactLength.message});i.dirty()}}if(s.minLength!==null){if(t.data.length<s.minLength.value){l(t,{code:a.too_small,minimum:s.minLength.value,type:"array",inclusive:true,exact:false,message:s.minLength.message});i.dirty()}}if(s.maxLength!==null){if(t.data.length>s.maxLength.value){l(t,{code:a.too_big,maximum:s.maxLength.value,type:"array",inclusive:true,exact:false,message:s.maxLength.message});i.dirty()}}if(t.common.async){return Promise.all(__spreadArray([],t.data,true).map((function(e,n){return s.type._parseAsync(new j(t,e,t.path,n))}))).then((function(e){return h.mergeArray(i,e)}))}var f=__spreadArray([],t.data,true).map((function(e,n){return s.type._parseSync(new j(t,e,t.path,n))}));return h.mergeArray(i,f)};Object.defineProperty(n.prototype,"element",{get:function(){return this._def.type},enumerable:false,configurable:true});n.prototype.min=function(e,t){return new n(__assign(__assign({},this._def),{minLength:{value:e,message:x.toString(t)}}))};n.prototype.max=function(e,t){return new n(__assign(__assign({},this._def),{maxLength:{value:e,message:x.toString(t)}}))};n.prototype.length=function(e,t){return new n(__assign(__assign({},this._def),{exactLength:{value:e,message:x.toString(t)}}))};n.prototype.nonempty=function(e){return this.min(1,e)};return n}(E);se.create=function(e,n){return new se(__assign({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray},A(n)))};function ue(e){if(e instanceof oe){var n={};for(var t in e.shape){var r=e.shape[t];n[t]=xe.create(ue(r))}return new oe(__assign(__assign({},e._def),{shape:function(){return n}}))}else if(e instanceof se){return new se(__assign(__assign({},e._def),{type:ue(e.element)}))}else if(e instanceof xe){return xe.create(ue(e.unwrap()))}else if(e instanceof ke){return ke.create(ue(e.unwrap()))}else if(e instanceof he){return he.create(e.items.map((function(e){return ue(e)})))}else{return e}}var oe=function(e){__extends(t,e);function t(){var n=e.apply(this,arguments)||this;n._cached=null;n.nonstrict=n.passthrough;n.augment=n.extend;return n}t.prototype._getCached=function(){if(this._cached!==null)return this._cached;var e=this._def.shape();var t=n.objectKeys(e);return this._cached={shape:e,keys:t}};t.prototype._parse=function(e){var n=this;var t=this._getType(e);if(t!==r.object){var i=this._getOrReturnCtx(e);l(i,{code:a.invalid_type,expected:r.object,received:i.parsedType});return d}var s=this._processInputParams(e),u=s.status,o=s.ctx;var f=this._getCached(),c=f.shape,v=f.keys;var _=[];if(!(this._def.catchall instanceof ie&&this._def.unknownKeys==="strip")){for(var m in o.data){if(!v.includes(m)){_.push(m)}}}var g=[];for(var p=0,y=v;p<y.length;p++){var m=y[p];var b=c[m];var w=o.data[m];g.push({key:{status:"valid",value:m},value:b._parse(new j(o,w,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof ie){var x=this._def.unknownKeys;if(x==="passthrough"){for(var k=0,N=_;k<N.length;k++){var m=N[k];g.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}})}}else if(x==="strict"){if(_.length>0){l(o,{code:a.unrecognized_keys,keys:_});u.dirty()}}else if(x==="strip");else{throw new Error("Internal ZodObject error: invalid unknownKeys value.")}}else{var O=this._def.catchall;for(var A=0,E=_;A<E.length;A++){var m=E[A];var w=o.data[m];g.push({key:{status:"valid",value:m},value:O._parse(new j(o,w,o.path,m)),alwaysSet:m in o.data})}}if(o.common.async){return Promise.resolve().then((function(){return __awaiter(n,void 0,void 0,(function(){var e,n,t,r,i,a;return __generator(this,(function(s){switch(s.label){case 0:e=[];n=0,t=g;s.label=1;case 1:if(!(n<t.length))return[3,5];r=t[n];return[4,r.key];case 2:i=s.sent();return[4,r.value];case 3:a=s.sent();e.push({key:i,value:a,alwaysSet:r.alwaysSet});s.label=4;case 4:n++;return[3,1];case 5:return[2,e]}}))}))})).then((function(e){return h.mergeObjectSync(u,e)}))}else{return h.mergeObjectSync(u,g)}};Object.defineProperty(t.prototype,"shape",{get:function(){return this._def.shape()},enumerable:false,configurable:true});t.prototype.strict=function(e){var n=this;return new t(__assign(__assign(__assign({},this._def),{unknownKeys:"strict"}),e!==undefined?{errorMap:function(t,r){var i,a,s,u;var o=(s=(a=(i=n._def).errorMap)===null||a===void 0?void 0:a.call(i,t,r).message)!==null&&s!==void 0?s:r.defaultError;if(t.code==="unrecognized_keys")return{message:(u=x.errToObj(e).message)!==null&&u!==void 0?u:o};return{message:o}}}:{}))};t.prototype.strip=function(){return new t(__assign(__assign({},this._def),{unknownKeys:"strip"}))};t.prototype.passthrough=function(){return new t(__assign(__assign({},this._def),{unknownKeys:"passthrough"}))};t.prototype.extend=function(e){var n=this;return new t(__assign(__assign({},this._def),{shape:function(){return __assign(__assign({},n._def.shape()),e)}}))};t.prototype.merge=function(e){var n=this;var r=new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:function(){return __assign(__assign({},n._def.shape()),e._def.shape())},typeName:Ie.ZodObject});return r};t.prototype.setKey=function(e,n){var t;return this.augment((t={},t[e]=n,t))};t.prototype.catchall=function(e){return new t(__assign(__assign({},this._def),{catchall:e}))};t.prototype.pick=function(e){var r=this;var i={};n.objectKeys(e).forEach((function(n){if(e[n]&&r.shape[n]){i[n]=r.shape[n]}}));return new t(__assign(__assign({},this._def),{shape:function(){return i}}))};t.prototype.omit=function(e){var r=this;var i={};n.objectKeys(this.shape).forEach((function(n){if(!e[n]){i[n]=r.shape[n]}}));return new t(__assign(__assign({},this._def),{shape:function(){return i}}))};t.prototype.deepPartial=function(){return ue(this)};t.prototype.partial=function(e){var r=this;var i={};n.objectKeys(this.shape).forEach((function(n){var t=r.shape[n];if(e&&!e[n]){i[n]=t}else{i[n]=t.optional()}}));return new t(__assign(__assign({},this._def),{shape:function(){return i}}))};t.prototype.required=function(e){var r=this;var i={};n.objectKeys(this.shape).forEach((function(n){if(e&&!e[n]){i[n]=r.shape[n]}else{var t=r.shape[n];var a=t;while(a instanceof xe){a=a._def.innerType}i[n]=a}}));return new t(__assign(__assign({},this._def),{shape:function(){return i}}))};t.prototype.keyof=function(){return ge(n.objectKeys(this.shape))};return t}(E);oe.create=function(e,n){return new oe(__assign({shape:function(){return e},unknownKeys:"strip",catchall:ie.create(),typeName:Ie.ZodObject},A(n)))};oe.strictCreate=function(e,n){return new oe(__assign({shape:function(){return e},unknownKeys:"strict",catchall:ie.create(),typeName:Ie.ZodObject},A(n)))};oe.lazycreate=function(e,n){return new oe(__assign({shape:e,unknownKeys:"strip",catchall:ie.create(),typeName:Ie.ZodObject},A(n)))};var fe=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n;var t=this;var r=this._processInputParams(e).ctx;var i=this._def.options;function u(e){var n;for(var t=0,i=e;t<i.length;t++){var u=i[t];if(u.result.status==="valid"){return u.result}}for(var o=0,f=e;o<f.length;o++){var u=f[o];if(u.result.status==="dirty"){(n=r.common.issues).push.apply(n,u.ctx.common.issues);return u.result}}var c=e.map((function(e){return new s(e.ctx.common.issues)}));l(r,{code:a.invalid_union,unionErrors:c});return d}if(r.common.async){return Promise.all(i.map((function(e){return __awaiter(t,void 0,void 0,(function(){var n;var t;return __generator(this,(function(i){switch(i.label){case 0:n=__assign(__assign({},r),{common:__assign(__assign({},r.common),{issues:[]}),parent:null});t={};return[4,e._parseAsync({data:r.data,path:r.path,parent:n})];case 1:return[2,(t.result=i.sent(),t.ctx=n,t)]}}))}))}))).then(u)}else{var o=undefined;var f=[];for(var c=0,h=i;c<h.length;c++){var v=h[c];var _=__assign(__assign({},r),{common:__assign(__assign({},r.common),{issues:[]}),parent:null});var m=v._parseSync({data:r.data,path:r.path,parent:_});if(m.status==="valid"){return m}else if(m.status==="dirty"&&!o){o={result:m,ctx:_}}if(_.common.issues.length){f.push(_.common.issues)}}if(o){(n=r.common.issues).push.apply(n,o.ctx.common.issues);return o.result}var g=f.map((function(e){return new s(e)}));l(r,{code:a.invalid_union,unionErrors:g});return d}};Object.defineProperty(n.prototype,"options",{get:function(){return this._def.options},enumerable:false,configurable:true});return n}(E);fe.create=function(e,n){return new fe(__assign({options:e,typeName:Ie.ZodUnion},A(n)))};function ce(e,t){var a=i(e);var s=i(t);if(e===t){return{valid:true,data:e}}else if(a===r.object&&s===r.object){var u=n.objectKeys(t);var o=n.objectKeys(e).filter((function(e){return u.indexOf(e)!==-1}));var f=__assign(__assign({},e),t);for(var c=0,l=o;c<l.length;c++){var h=l[c];var d=ce(e[h],t[h]);if(!d.valid){return{valid:false}}f[h]=d.data}return{valid:true,data:f}}else if(a===r.array&&s===r.array){if(e.length!==t.length){return{valid:false}}var v=[];for(var _=0;_<e.length;_++){var m=e[_];var g=t[_];var d=ce(m,g);if(!d.valid){return{valid:false}}v.push(d.data)}return{valid:true,data:v}}else if(a===r.date&&s===r.date&&+e===+t){return{valid:true,data:e}}else{return{valid:false}}}var le=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._processInputParams(e),t=n.status,r=n.ctx;var i=function(e,n){if(m(e)||m(n)){return d}var i=ce(e.value,n.value);if(!i.valid){l(r,{code:a.invalid_intersection_types});return d}if(g(e)||g(n)){t.dirty()}return{status:t.value,value:i.data}};if(r.common.async){return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((function(e){var n=e[0],t=e[1];return i(n,t)}))}else{return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};return n}(E);le.create=function(e,n,t){return new le(__assign({left:e,right:n,typeName:Ie.ZodIntersection},A(t)))};var he=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this;var t=this._processInputParams(e),i=t.status,s=t.ctx;if(s.parsedType!==r.array){l(s,{code:a.invalid_type,expected:r.array,received:s.parsedType});return d}if(s.data.length<this._def.items.length){l(s,{code:a.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"});return d}var u=this._def.rest;if(!u&&s.data.length>this._def.items.length){l(s,{code:a.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"});i.dirty()}var o=__spreadArray([],s.data,true).map((function(e,t){var r=n._def.items[t]||n._def.rest;if(!r)return null;return r._parse(new j(s,e,s.path,t))})).filter((function(e){return!!e}));if(s.common.async){return Promise.all(o).then((function(e){return h.mergeArray(i,e)}))}else{return h.mergeArray(i,o)}};Object.defineProperty(n.prototype,"items",{get:function(){return this._def.items},enumerable:false,configurable:true});n.prototype.rest=function(e){return new n(__assign(__assign({},this._def),{rest:e}))};return n}(E);he.create=function(e,n){if(!Array.isArray(e)){throw new Error("You must pass an array of schemas to z.tuple([ ... ])")}return new he(__assign({items:e,typeName:Ie.ZodTuple,rest:null},A(n)))};var de=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(n.prototype,"keySchema",{get:function(){return this._def.keyType},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"valueSchema",{get:function(){return this._def.valueType},enumerable:false,configurable:true});n.prototype._parse=function(e){var n=this;var t=this._processInputParams(e),i=t.status,s=t.ctx;if(s.parsedType!==r.map){l(s,{code:a.invalid_type,expected:r.map,received:s.parsedType});return d}var u=this._def.keyType;var o=this._def.valueType;var f=__spreadArray([],s.data.entries(),true).map((function(e,n){var t=e[0],r=e[1];return{key:u._parse(new j(s,t,s.path,[n,"key"])),value:o._parse(new j(s,r,s.path,[n,"value"]))}}));if(s.common.async){var c=new Map;return Promise.resolve().then((function(){return __awaiter(n,void 0,void 0,(function(){var e,n,t,r,a;return __generator(this,(function(s){switch(s.label){case 0:e=0,n=f;s.label=1;case 1:if(!(e<n.length))return[3,5];t=n[e];return[4,t.key];case 2:r=s.sent();return[4,t.value];case 3:a=s.sent();if(r.status==="aborted"||a.status==="aborted"){return[2,d]}if(r.status==="dirty"||a.status==="dirty"){i.dirty()}c.set(r.value,a.value);s.label=4;case 4:e++;return[3,1];case 5:return[2,{status:i.value,value:c}]}}))}))}))}else{var h=new Map;for(var v=0,_=f;v<_.length;v++){var m=_[v];var g=m.key;var p=m.value;if(g.status==="aborted"||p.status==="aborted"){return d}if(g.status==="dirty"||p.status==="dirty"){i.dirty()}h.set(g.value,p.value)}return{status:i.value,value:h}}};return n}(E);de.create=function(e,n,t){return new de(__assign({valueType:n,keyType:e,typeName:Ie.ZodMap},A(t)))};var ve=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._processInputParams(e),t=n.status,i=n.ctx;if(i.parsedType!==r.set){l(i,{code:a.invalid_type,expected:r.set,received:i.parsedType});return d}var s=this._def;if(s.minSize!==null){if(i.data.size<s.minSize.value){l(i,{code:a.too_small,minimum:s.minSize.value,type:"set",inclusive:true,exact:false,message:s.minSize.message});t.dirty()}}if(s.maxSize!==null){if(i.data.size>s.maxSize.value){l(i,{code:a.too_big,maximum:s.maxSize.value,type:"set",inclusive:true,exact:false,message:s.maxSize.message});t.dirty()}}var u=this._def.valueType;function o(e){var n=new Set;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(a.status==="aborted")return d;if(a.status==="dirty")t.dirty();n.add(a.value)}return{status:t.value,value:n}}var f=__spreadArray([],i.data.values(),true).map((function(e,n){return u._parse(new j(i,e,i.path,n))}));if(i.common.async){return Promise.all(f).then((function(e){return o(e)}))}else{return o(f)}};n.prototype.min=function(e,t){return new n(__assign(__assign({},this._def),{minSize:{value:e,message:x.toString(t)}}))};n.prototype.max=function(e,t){return new n(__assign(__assign({},this._def),{maxSize:{value:e,message:x.toString(t)}}))};n.prototype.size=function(e,n){return this.min(e,n).max(e,n)};n.prototype.nonempty=function(e){return this.min(1,e)};return n}(E);ve.create=function(e,n){return new ve(__assign({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet},A(n)))};var _e=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(n.prototype,"schema",{get:function(){return this._def.getter()},enumerable:false,configurable:true});n.prototype._parse=function(e){var n=this._processInputParams(e).ctx;var t=this._def.getter();return t._parse({data:n.data,path:n.path,parent:n})};return n}(E);_e.create=function(e,n){return new _e(__assign({getter:e,typeName:Ie.ZodLazy},A(n)))};var me=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){if(e.data!==this._def.value){var n=this._getOrReturnCtx(e);l(n,{received:n.data,code:a.invalid_literal,expected:this._def.value});return d}return{status:"valid",value:e.data}};Object.defineProperty(n.prototype,"value",{get:function(){return this._def.value},enumerable:false,configurable:true});return n}(E);me.create=function(e,n){return new me(__assign({value:e,typeName:Ie.ZodLiteral},A(n)))};function ge(e,n){return new pe(__assign({values:e,typeName:Ie.ZodEnum},A(n)))}var pe=function(e){__extends(t,e);function t(){var n=e.apply(this,arguments)||this;k.set(n,void 0);return n}t.prototype._parse=function(e){if(typeof e.data!=="string"){var t=this._getOrReturnCtx(e);var r=this._def.values;l(t,{expected:n.joinValues(r),received:t.parsedType,code:a.invalid_type});return d}if(!b(this,k,"f")){w(this,k,new Set(this._def.values),"f")}if(!b(this,k,"f").has(e.data)){var t=this._getOrReturnCtx(e);var r=this._def.values;l(t,{received:t.data,code:a.invalid_enum_value,options:r});return d}return _(e.data)};Object.defineProperty(t.prototype,"options",{get:function(){return this._def.values},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"enum",{get:function(){var e={};for(var n=0,t=this._def.values;n<t.length;n++){var r=t[n];e[r]=r}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"Values",{get:function(){var e={};for(var n=0,t=this._def.values;n<t.length;n++){var r=t[n];e[r]=r}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"Enum",{get:function(){var e={};for(var n=0,t=this._def.values;n<t.length;n++){var r=t[n];e[r]=r}return e},enumerable:false,configurable:true});t.prototype.extract=function(e,n){if(n===void 0){n=this._def}return t.create(e,__assign(__assign({},this._def),n))};t.prototype.exclude=function(e,n){if(n===void 0){n=this._def}return t.create(this.options.filter((function(n){return!e.includes(n)})),__assign(__assign({},this._def),n))};return t}(E);k=new WeakMap;pe.create=ge;var ye=function(e){__extends(t,e);function t(){var n=e.apply(this,arguments)||this;N.set(n,void 0);return n}t.prototype._parse=function(e){var t=n.getValidEnumValues(this._def.values);var i=this._getOrReturnCtx(e);if(i.parsedType!==r.string&&i.parsedType!==r.number){var s=n.objectValues(t);l(i,{expected:n.joinValues(s),received:i.parsedType,code:a.invalid_type});return d}if(!b(this,N,"f")){w(this,N,new Set(n.getValidEnumValues(this._def.values)),"f")}if(!b(this,N,"f").has(e.data)){var s=n.objectValues(t);l(i,{received:i.data,code:a.invalid_enum_value,options:s});return d}return _(e.data)};Object.defineProperty(t.prototype,"enum",{get:function(){return this._def.values},enumerable:false,configurable:true});return t}(E);N=new WeakMap;ye.create=function(e,n){return new ye(__assign({values:e,typeName:Ie.ZodNativeEnum},A(n)))};var be=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype.unwrap=function(){return this._def.type};n.prototype._parse=function(e){var n=this;var t=this._processInputParams(e).ctx;if(t.parsedType!==r.promise&&t.common.async===false){l(t,{code:a.invalid_type,expected:r.promise,received:t.parsedType});return d}var i=t.parsedType===r.promise?t.data:Promise.resolve(t.data);return _(i.then((function(e){return n._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})})))};return n}(E);be.create=function(e,n){return new be(__assign({type:e,typeName:Ie.ZodPromise},A(n)))};var we=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.innerType=function(){return this._def.schema};t.prototype.sourceType=function(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema};t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e),i=r.status,a=r.ctx;var s=this._def.effect||null;var u={addIssue:function(e){l(a,e);if(e.fatal){i.abort()}else{i.dirty()}},get path(){return a.path}};u.addIssue=u.addIssue.bind(u);if(s.type==="preprocess"){var o=s.transform(a.data,u);if(a.common.async){return Promise.resolve(o).then((function(e){return __awaiter(t,void 0,void 0,(function(){var n;return __generator(this,(function(t){switch(t.label){case 0:if(i.value==="aborted")return[2,d];return[4,this._def.schema._parseAsync({data:e,path:a.path,parent:a})];case 1:n=t.sent();if(n.status==="aborted")return[2,d];if(n.status==="dirty")return[2,v(n.value)];if(i.value==="dirty")return[2,v(n.value)];return[2,n]}}))}))}))}else{if(i.value==="aborted")return d;var f=this._def.schema._parseSync({data:o,path:a.path,parent:a});if(f.status==="aborted")return d;if(f.status==="dirty")return v(f.value);if(i.value==="dirty")return v(f.value);return f}}if(s.type==="refinement"){var c=function(e){var n=s.refinement(e,u);if(a.common.async){return Promise.resolve(n)}if(n instanceof Promise){throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.")}return e};if(a.common.async===false){var h=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(h.status==="aborted")return d;if(h.status==="dirty")i.dirty();c(h.value);return{status:i.value,value:h.value}}else{return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((function(e){if(e.status==="aborted")return d;if(e.status==="dirty")i.dirty();return c(e.value).then((function(){return{status:i.value,value:e.value}}))}))}}if(s.type==="transform"){if(a.common.async===false){var _=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!p(_))return _;var f=s.transform(_.value,u);if(f instanceof Promise){throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.")}return{status:i.value,value:f}}else{return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((function(e){if(!p(e))return e;return Promise.resolve(s.transform(e.value,u)).then((function(e){return{status:i.value,value:e}}))}))}}n.assertNever(s)};return t}(E);we.create=function(e,n,t){return new we(__assign({schema:e,typeName:Ie.ZodEffects,effect:n},A(t)))};we.createWithPreprocess=function(e,n,t){return new we(__assign({schema:n,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects},A(t)))};var xe=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n===r.undefined){return _(undefined)}return this._def.innerType._parse(e)};n.prototype.unwrap=function(){return this._def.innerType};return n}(E);xe.create=function(e,n){return new xe(__assign({innerType:e,typeName:Ie.ZodOptional},A(n)))};var ke=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n===r.null){return _(null)}return this._def.innerType._parse(e)};n.prototype.unwrap=function(){return this._def.innerType};return n}(E);ke.create=function(e,n){return new ke(__assign({innerType:e,typeName:Ie.ZodNullable},A(n)))};var Ne=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._processInputParams(e).ctx;var t=n.data;if(n.parsedType===r.undefined){t=this._def.defaultValue()}return this._def.innerType._parse({data:t,path:n.path,parent:n})};n.prototype.removeDefault=function(){return this._def.innerType};return n}(E);Ne.create=function(e,n){return new Ne(__assign({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof n.default==="function"?n.default:function(){return n.default}},A(n)))};var je=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this;var t=this._processInputParams(e).ctx;var r=__assign(__assign({},t),{common:__assign(__assign({},t.common),{issues:[]})});var i=this._def.innerType._parse({data:r.data,path:r.path,parent:__assign({},r)});if(y(i)){return i.then((function(e){return{status:"valid",value:e.status==="valid"?e.value:n._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}))}else{return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}};n.prototype.removeCatch=function(){return this._def.innerType};return n}(E);je.create=function(e,n){return new je(__assign({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:function(){return n.catch}},A(n)))};var Oe=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._getType(e);if(n!==r.nan){var t=this._getOrReturnCtx(e);l(t,{code:a.invalid_type,expected:r.nan,received:t.parsedType});return d}return{status:"valid",value:e.data}};return n}(E);Oe.create=function(e){return new Oe(__assign({typeName:Ie.ZodNaN},A(e)))};var Ae=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._processInputParams(e).ctx;var t=n.data;return this._def.type._parse({data:t,path:n.path,parent:n})};n.prototype.unwrap=function(){return this._def.type};return n}(E);var Ee=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this;var t=this._processInputParams(e),r=t.status,i=t.ctx;if(i.common.async){var a=function(){return __awaiter(n,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return[4,this._def.in._parseAsync({data:i.data,path:i.path,parent:i})];case 1:e=n.sent();if(e.status==="aborted")return[2,d];if(e.status==="dirty"){r.dirty();return[2,v(e.value)]}else{return[2,this._def.out._parseAsync({data:e.value,path:i.path,parent:i})]}return[2]}}))}))};return a()}else{var s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});if(s.status==="aborted")return d;if(s.status==="dirty"){r.dirty();return{status:"dirty",value:s.value}}else{return this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}};n.create=function(e,t){return new n({in:e,out:t,typeName:Ie.ZodPipeline})};return n}(E);var Ze=function(e){__extends(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}n.prototype._parse=function(e){var n=this._def.innerType._parse(e);var t=function(e){if(p(e)){e.value=Object.freeze(e.value)}return e};return y(n)?n.then((function(e){return t(e)})):t(n)};n.prototype.unwrap=function(){return this._def.innerType};return n}(E);Ze.create=function(e,n){return new Ze(__assign({innerType:e,typeName:Ie.ZodReadonly},A(n)))};var Ie;(function(e){e["ZodString"]="ZodString";e["ZodNumber"]="ZodNumber";e["ZodNaN"]="ZodNaN";e["ZodBigInt"]="ZodBigInt";e["ZodBoolean"]="ZodBoolean";e["ZodDate"]="ZodDate";e["ZodSymbol"]="ZodSymbol";e["ZodUndefined"]="ZodUndefined";e["ZodNull"]="ZodNull";e["ZodAny"]="ZodAny";e["ZodUnknown"]="ZodUnknown";e["ZodNever"]="ZodNever";e["ZodVoid"]="ZodVoid";e["ZodArray"]="ZodArray";e["ZodObject"]="ZodObject";e["ZodUnion"]="ZodUnion";e["ZodDiscriminatedUnion"]="ZodDiscriminatedUnion";e["ZodIntersection"]="ZodIntersection";e["ZodTuple"]="ZodTuple";e["ZodRecord"]="ZodRecord";e["ZodMap"]="ZodMap";e["ZodSet"]="ZodSet";e["ZodFunction"]="ZodFunction";e["ZodLazy"]="ZodLazy";e["ZodLiteral"]="ZodLiteral";e["ZodEnum"]="ZodEnum";e["ZodEffects"]="ZodEffects";e["ZodNativeEnum"]="ZodNativeEnum";e["ZodOptional"]="ZodOptional";e["ZodNullable"]="ZodNullable";e["ZodDefault"]="ZodDefault";e["ZodCatch"]="ZodCatch";e["ZodPromise"]="ZodPromise";e["ZodBranded"]="ZodBranded";e["ZodPipeline"]="ZodPipeline";e["ZodReadonly"]="ZodReadonly"})(Ie||(Ie={}));var Se=e("u",ee.create)}}}));
@@ -1 +0,0 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(r){for(var n,e=1,s=arguments.length;e<s;e++){n=arguments[e];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))r[i]=n[i]}return r};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(r,n,e){if(e||arguments.length===2)for(var s=0,i=n.length,t;s<i;s++){if(t||!(s in n)){if(!t)t=Array.prototype.slice.call(n,0,s);t[s]=n[s]}}return r.concat(t||Array.prototype.slice.call(n))};System.register(["./p-7d593603.system.js"],(function(r){"use strict";var n;return{setters:[function(r){n=r.c}],execute:function(){var e={};var s=r("g",(function(r){if(!e[r]){e[r]=n({fields:[]})}return e[r]}));var i=r("c",(function(r){var n=s(r.id);n.set("fields",__spreadArray([],r.fields.map((function(r){return __assign(__assign({},r),{page:r.page||r.page_sequence})})),true));return n}));var t=r("a",(function(r){var i=s(r.template_id);if(!i){console.log("Creating field store for envelope",r.id,r.template_id);i=n({fields:[]});e[r.template_id]=i}else{i.reset()}i.set("fields",__spreadArray([],r.fields,true));return i}));var a=r("u",(function(r,n,e){var s=r.get("fields")||[];if(n!==e.name){var i=s.filter((function(r){return r.name!==n}));r.set("fields",__spreadArray(__spreadArray([],i,true),[e],false))}else{r.set("fields",s.map((function(r){return r.name===n?__assign(__assign({},r),e):__assign({},r)})))}}))}}}));
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i,H as o,F as s,g as l}from"./p-49988769.js";import{VerdocsEndpoint as a,integerSequence as r,getOrganizationContacts as n,isValidEmail as d,createEnvelope as c,getRGBA as p,formatFullName as h,createTemplateDocument as v,deleteTemplateDocument as m,createTemplate as u,updateField as g,createField as f,updateTemplate as x,updateTemplateRole as b,createTemplateRole as w}from"@verdocs/js-sdk";import{g as y,u as k}from"./p-cde4c155.js";import{g as C,b as q,a as E,u as S}from"./p-6fda3817.js";import{g as z}from"./p-bd642df2.js";import{S as M}from"./p-fd97809c.js";import{V as L}from"./p-04c07b7b.js";import{D as T,P as I,J as H,a as Z,F as V,b as D,T as _}from"./p-b0766439.js";import{f as N}from"./p-12bab948.js";import{i as U}from"./p-a901dff2.js";import{b as R,c as A,d as B,g as P,e as j,f as Q}from"./p-9b921211.js";import"./p-bb253149.js";import"./p-a706bac9.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";const F=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId=null,this.loading=!0}onTemplateIdChanged(e){console.log("[PREVIEW] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[PREVIEW] Missing required template ID ${this.templateId}`):void console.log("[PREVIEW] Unable to start builder session, must be authenticated")}catch(o){console.log("[PREVIEW] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){e&&z(this.endpoint,e,!1).then((e=>{this.templateStore=e,this.fieldStore=y(this.templateId),this.roleStore=C(this.templateId),this.loading=!1})).catch((e=>{throw console.log("Unable to load template",e),e}))}handlePageRendered(e){}render(){var e,t;return i(o,null,this.loading?i("verdocs-loader",null):((null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||[]).map((e=>{const t=r(1,e.pages);return i(s,null,t.map((t=>{var o;const s=(null===(o=e.page_sizes)||void 0===o?void 0:o[t])||{width:612,height:792};return i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:t,disabled:!0,editable:!1,done:!1,virtualWidth:s.width,virtualHeight:s.height,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};F.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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}';const $='<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>',W=class{constructor(i){e(this,i),this.sendingEnvelope=t(this,"sendingEnvelope",7),this.send=t(this,"send",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.searchContacts=t(this,"searchContacts",7),this.endpoint=a.getDefault(),this.templateId=null,this.environment="",this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.showPickerForId="",this.sessionContacts=[],this.sending=!1,this.rolesCompleted={},this.templateStore=null,this.roleStore=null}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.onSessionChanged(((e,t,i)=>{if(!i)return;const o={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};i&&(this.sessionContacts=[o],n(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e),this.sessionContacts=[...e,o]})).catch((e=>{console.log("[SEND] Error getting contacts",e)})))})),this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[SEND] Missing required template ID ${this.templateId}`):void console.log("[SEND] Unable to start Send operation, must be authenticated")}catch(o){console.log("[SEND] Error with send session",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){var t,i,o,s,l;if(e)try{this.templateStore=await z(this.endpoint,e,!1),this.roleStore=C(e),this.recomputeRolesCompleted(),(null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_sendable)||console.warn("[SEND] Template is not sendable",e)}catch(e){console.log("[SEND] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data))}}recomputeRolesCompleted(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i={};this.rolesCompleted={},t.forEach((e=>{const t=e.sequence-1;i[t]||(i[t]=[]);const o=`r-${t}-${i[t].length}`;i[t].push({...e,id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name}),e.first_name&&d(e.email)&&(this.rolesCompleted[o]={...e,id:o,role_name:e.name,first_name:e.first_name,last_name:e.last_name})}))}getLevels(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i=[...new Set(t.map((e=>e.sequence-1)))];return i.sort(((e,t)=>e-t)),i}getRolesAtLevel(e){var t;return((null===(t=this.roleStore)||void 0===t?void 0:t.get("roles"))||[]).filter((t=>t.sequence-1===e)).map(((t,i)=>({...t,id:`r-${e}-${i}`,role_name:t.name,first_name:"",last_name:""})))}getLevelIcon(e){const t=this.getLevels();return i("div",e<0?{class:"level-icon",innerHTML:'<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>'}:e>=t.length?{class:"level-icon",innerHTML:'<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>'}:{class:"level-icon",innerHTML:'<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>'})}handleSelectContact(e,t){e.preventDefault(),this.rolesCompleted[t.id]={...t,...e.detail},this.showPickerForId=""}handleClickRole(e,t){e.stopPropagation(),this.showPickerForId=t.id}handleSend(e){var t,i,o;if(this.sending)return void console.log("[SEND] Skipping duplicate send",e);console.log("[SEND] Sending",e),e.preventDefault(),e.stopPropagation(),this.sending=!0,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!0});const s={template_id:this.templateId,name:(null===(o=null===(i=this.templateStore)||void 0===i?void 0:i.state)||void 0===o?void 0:o.name)||"",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};console.log("[SEND] Creating envelope",s),c(this.endpoint,s).then((e=>{var t,i,o,l;console.log("[SEND] Send envelope",e),this.reset().catch((e=>console.log("Unknown Error",e))),this.sending=!1,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!1}),null===(i=this.send)||void 0===i||i.emit({...s,name:(null===(l=null===(o=this.templateStore)||void 0===o?void 0:o.state)||void 0===l?void 0:l.name)||"New Envelope",envelope_id:e.id,envelope:e})})).catch((e=>{var t,i,o;console.log("Send error",e),L((null===(i=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===i?void 0:i.error)||"Error creating envelope, please try again later."),this.sending=!1,null===(o=this.sendingEnvelope)||void 0===o||o.emit({sending:!1})}))}handleCancel(e){var t;e.stopPropagation(),null===(t=this.exit)||void 0===t||t.emit()}render(){var e,t;if(!this.endpoint.session)return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const s=this.getLevels(),l=q(this.roleStore),a=Object.values(this.rolesCompleted).filter((e=>d(e.email))).length>=l.length;return i(o,{class:{sendable:null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),s.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon(e),this.getRolesAtLevel(e).map((e=>{var t,o,s,l;const a=`verdocs-send-recipient-${e.role_name}`;return e.email?i("div",{class:"recipient",style:{borderColor:p(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:a},(null===(s=this.rolesCompleted[e.id])||void 0===s?void 0:s.first_name)?h(this.rolesCompleted[e.id]):e.role_name,i("div",{class:"icon",innerHTML:$}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:a,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(l=this.rolesCompleted[e.id])&&void 0!==l?l:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":E(this.roleStore,e.role_name),"data-rn":e.role_name,style:{backgroundColor:p(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:a},(null===(t=this.rolesCompleted[e.id])||void 0===t?void 0:t.first_name)?h(this.rolesCompleted[e.id]):e.role_name,i("div",{class:"icon",innerHTML:$}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:a,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(o=this.rolesCompleted[e.id])&&void 0!==o?o:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}})))}))))),i("div",{class:"level level-done"},this.getLevelIcon(s.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!a||this.sending,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};W.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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)}';const O=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.templateUpdated=t(this,"templateUpdated",7),this.sdkError=t(this,"sdkError",7),this.endpoint=a.getDefault(),this.templateId="",this.uploading=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.showDeleteError=!1,this.confirmDeleteDocument=null,this.store=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1)}catch(o){console.log("[TEMPLATE ATTACHMENTS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}handleCancel(e){e.stopPropagation(),this.exit.emit()}handleUploadProgress(e){e>=99?(this.progressPercent=100,this.progressLabel="Processing..."):this.progressPercent=e}async handleUpload(e){var t,i,o,s;e.stopPropagation();const l=e.detail.file;if(l){console.log("[ATTACHMENTS] Uploading...",l),this.uploading=!0,this.progressLabel="Uploading...";try{const e=await v(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] Updated template",this.store.state),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"}),this.uploading=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.uploading=!1}}}handleNext(e){var t;e.stopPropagation(),this.uploading=!1,this.progressLabel="",this.progressPercent=0,null===(t=this.next)||void 0===t||t.emit({template:this.store.state})}async confirmDelete(){await m(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] New template",this.store.state),this.confirmDeleteDocument=null}async handleDelete(e){var t;(null===(t=this.store.state)||void 0===t?void 0:t.documents.length)>1?this.confirmDeleteDocument=e:this.showDeleteError=!0}getFileIcon(e){switch(e.mime){case"application/pdf":return Z;case"image/jpeg":return H;case"image/png":return I;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return T}return V}render(){var e,t,s;if(!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const l=null===(e=this.store)||void 0===e?void 0:e.state;return l.isLoaded?this.endpoint.session&&l.profile_id?i(o,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},null===(t=this.store)||void 0===t?void 0:t.state.documents.map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.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:_,onClick:()=>this.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:!0,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(null===(s=this.store)||void 0===s?void 0:s.state.documents.length)||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=!1}),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:()=>this.confirmDelete(),showCancel:!0,onExit:()=>{this.confirmDeleteDocument=null}})):i(o,{class:"empty"}):i(o,{class:"loading"},i("verdocs-loader",null))}};O.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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}';const Y=["attachments","roles","settings","fields","preview"],X=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.endpoint=a.getDefault(),this.templateId=null,this.step="preview",this.templateStore=null}onTemplateIdChanged(e){console.log("[BUILD_TABS] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("[BUILD_TABS] Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i,o,s,l;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");if(!this.templateId)return this.step="attachments",void console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");try{this.templateStore=await z(this.endpoint,this.templateId,!1)}catch(o){console.log("[BUILD_TABS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[BUILD_TABS] Error loading template",e),null===(o=this.sdkError)||void 0===o||o.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data))}}async loadTemplate(e){e&&(this.templateStore=await z(this.endpoint,e,!1))}setStep(e){var t;console.log("Selected step",e.detail.tab.id),e.stopPropagation(),e.preventDefault(),this.step=e.detail.tab.id,null===(t=this.stepChanged)||void 0===t||t.emit(e.detail.tab.id)}copyTemplateId(){navigator.clipboard.writeText(this.templateId).then((()=>{L("Template ID copied",{style:"success",duration:3e3})})).catch((e=>{var t;console.warn("[BUILD_TABS] Error copying to clipboard",e),null===(t=this.sdkError)||void 0===t||t.emit(e)}))}render(){var e,t,s,l,a,r,n,d,c,p,h,v,m,u,g,f,x,b,w,y,k;if(!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));let C=!1,q=!1,E=!1;this.templateId&&this.templateStore&&this.templateStore.state&&(E=(null===(s=null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||void 0===s?void 0:s.length)>0,q=E&&(null===(r=null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.roles)||void 0===r?void 0:r.length)>0,C=q&&(null===(c=null===(d=null===(n=this.templateStore)||void 0===n?void 0:n.state)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.length)>0);let S=Math.max(Y.indexOf(this.step),0);return!C&&S>=4&&(S=3),!q&&S>=3&&(S=1),!E&&S>=1&&(S=0),i(o,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:S,tabs:[{id:"attachments",disabled:!1,label:"Attachment(s)"},{id:"roles",disabled:!E,label:"Roles"},{id:"settings",disabled:!q,label:"Settings"},{id:"fields",disabled:!q,label:"Fields"},{id:"preview",disabled:!C,label:"Preview/Send"}]}),this.templateId&&i("div",{class:"info"},i("verdocs-button-panel",{icon:'<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>'},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:'<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>',onClick:()=>this.copyTemplateId()})),i("div",{class:"row"},i("label",null,"Name:"),i("div",{class:"value"},null===(h=null===(p=this.templateStore)||void 0===p?void 0:p.state)||void 0===h?void 0:h.name)),i("div",{class:"row"},i("label",null,"Visibility:"),i("div",{class:"value"},(null===(m=null===(v=this.templateStore)||void 0===v?void 0:v.state)||void 0===m?void 0:m.is_public)?"Public":(null===(g=null===(u=this.templateStore)||void 0===u?void 0:u.state)||void 0===g?void 0:g.is_personal)?"Private":"Shared")),i("div",{class:"row"},i("label",null,"Created:"),i("div",{class:"value"},(null===(x=null===(f=this.templateStore)||void 0===f?void 0:f.state)||void 0===x?void 0:x.counter)?N(new Date(null===(w=null===(b=this.templateStore)||void 0===b?void 0:b.state)||void 0===w?void 0:w.created_at),"P p"):"")),i("div",{class:"row"},i("label",null,"Used:"),i("div",{class:"value"},null===(k=null===(y=this.templateStore)||void 0===y?void 0:y.state)||void 0===k?void 0:k.counter," time(s)"))))))}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};X.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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}';const K=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=a.getDefault(),this.maxSize=21495808,this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.errorMessage=""}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.errorMessage="",this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file),this.file.size>this.maxSize&&(this.errorMessage="Total file size must not exceed 20MB.")}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,o;if(e.stopPropagation(),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await u(this.endpoint,{name:this.file.name,initial_reminder:0,followup_reminders:0,documents:[this.file]},(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created template",e),z(this.endpoint,e.id,!0).then((()=>{var t,i;null===(t=this.templateCreated)||void 0===t||t.emit({endpoint:this.endpoint,template:e,templateId:e.id}),null===(i=this.next)||void 0===i||i.emit(e),this.creating=!1,this.progressLabel="",this.progressPercent=0})).catch((e=>{console.log(e)}))}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new M(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(o=e.response)||void 0===o?void 0:o.data)),this.creating=!1}}}render(){return i(o,null,this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:".pdf,application/pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("div",{class:"upload-box",onDrop:e=>{e.preventDefault(),e.target.classList.remove("drag-over"),this.file=e.dataTransfer.files[0],this.file.size>this.maxSize&&(this.errorMessage="Total file size must not exceed 20MB.")},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDragEnter:e=>e.target.classList.add("drag-over"),onDragLeave:e=>e.target.classList.remove("drag-over")},i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>',style:{display:"flex",justifyContent:"center"}}),i("p",null,this.file?this.file.name:"Drag and drop your files here"),i("p",{class:"subscript"},"Supported files: PDF, Word"),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),!!this.errorMessage&&i("div",{class:"error"},this.errorMessage),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating||!!this.errorMessage}))):i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};K.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create p{color:#33364b;margin-top:20px;font-size:18px;font-weight:500;overflow-wrap:anywhere}verdocs-template-create p.subscript{color:#5c6575;font-size:14px;margin:20px}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}verdocs-template-create .error{margin:20px 0;color:#cc0000}';const G='<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>',J=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',class:"signature"},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>',class:"initial"},{id:"sep1",tooltip:"",icon:G,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>',class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>',class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>',class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>',class:"dropdown"},{id:"sep2",tooltip:"",icon:G,class:"separator"},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>',class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>',class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:'<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>',class:"attachment"}],ee=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.fieldsUpdated=t(this,"fieldsUpdated",7),this.pageHeights={},this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.loading=!0}onTemplateIdChanged(e){this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async componentWillLoad(){var e,t,i,o,s,l;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[FIELDS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[FIELDS] Error with fields session",e),null===(o=this.sdkError)||void 0===o||o.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data))}}componentDidRender(){U.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e,t;const i=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[];this.selectedRoleName&&i.find((e=>e&&e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(t=i[0])||void 0===t?void 0:t.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}async loadTemplate(e){var t,i;e&&(this.loading=!0,this.templateStore=await z(this.endpoint,e,!1),this.roleStore=C(this.templateId),this.fieldStore=y(this.templateId),this.selectedRoleName=(null===(i=null===(t=this.roleStore.get("roles"))||void 0===t?void 0:t[0])||void 0===i?void 0:i.name)||"",this.loading=!1)}attachFieldAttributes(e,t,i){i.addEventListener("settingsChanged",(()=>{var e,t;null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(t=this.templateStore)||void 0===t?void 0:t.state,event:"added-field"})})),i.addEventListener("deleted",(()=>{var e,t;i.remove(),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(t=this.templateStore)||void 0===t?void 0:t.state,event:"updated-field"})})),i.setAttribute("templateid",this.templateId),i.setAttribute("fieldname",t.name),i.setAttribute("pageNumber",String(e.pageNumber)),i.setAttribute("xScale",String(e.xScale)),i.setAttribute("yScale",String(e.yScale)),i.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,this.fieldStore.get("fields").filter((e=>e&&e.page===t.pageNumber)).forEach((e=>{const t=P(e),i=document.getElementById(t);i&&(i.setAttribute("fieldname",e.name),i.setAttribute("pagenumber",String(e.page)),this.makeDraggable(i))}))}makeDraggable(e){U(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/o+t,a=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),R(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,i,o,s,l,a,r,n,d;const c=e.target.getAttribute("fieldname"),p=+(e.target.getAttribute("option")||"0"),h=this.fieldStore.get("fields").find((e=>e.name===c));if(!h)return void console.log("[FIELDS] Unable to find field",c,e.target);const v=e.target.getAttribute("pagenumber");let{naturalWidth:m=612,naturalHeight:u=792,renderedHeight:f=792}=this.cachedPageInfo[v];const x=e.target.getBoundingClientRect(),b=e.target.parentElement.getBoundingClientRect(),w=h.width||j(h.type),y=h.height||Q(h.type),C=Math.max(x.left-b.left,0);let q=Math.max(f-(b.bottom-x.bottom),0);console.log("drop",{pageNumber:v,newX:C,newY:q});let E=parseInt(v);q>f?(E=Math.min(E+1,(null===(s=null===(o=null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.documents)||void 0===o?void 0:o[0])||void 0===s?void 0:s.pages)||1),q-=f,f=this.cachedPageInfo[E].renderedHeight,console.log("Next page",{newPageNumber:E,newY:q,renderedHeight:f})):q<0&&(E=Math.max(E-1,1),f=this.cachedPageInfo[E].renderedHeight,q+=f,console.log("Next page",{newPageNumber:E,newY:q,renderedHeight:f}));const{x:S,y:z}=this.viewCoordinatesToPageCoordinates(C,q,v,m-w,u-y);try{const t={x:S,y:z,page:E};console.log("[FIELDS] Will update",c,z,p,t);const i=await g(this.endpoint,this.templateId,c,t);console.log("[FIELDS] Updated",i),k(this.fieldStore,c,i),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target);const{xScale:o=1,yScale:s=1}=this.cachedPageInfo[v];B(e.target,i,o,s),null===(l=this.templateUpdated)||void 0===l||l.emit({endpoint:this.endpoint,template:null===(a=this.templateStore)||void 0===a?void 0:a.state,event:"updated-field"})}catch(t){L("Error updating field, please try again later",{style:"error"}),console.log("[FIELDS] Error updating field",t),null===(r=this.sdkError)||void 0===r||r.emit(new M(t.message,null===(n=t.response)||void 0===n?void 0:n.status,null===(d=t.response)||void 0===d?void 0:d.data)),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target)}}generateFieldName(e,t){let i,o=1;do{i=`${e}P${t}-${o}`,o++}while(this.fieldStore.get("fields").some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:a=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/l,o)),y:Math.floor(Math.min(Math.max(r-t,0)/a,s))}}async handleClickPage(e,t){var i,o;if(this.placing){const s=e.offsetX,l=e.offsetY,a=j(this.placing),r=Q(this.placing),n=this.cachedPageInfo[t],{naturalWidth:d=612,naturalHeight:c=792}=n,p=this.viewCoordinatesToPageCoordinates(s,l,t,d-a,c-r),h=Math.floor(p.x),v=Math.floor(p.y),m={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:n.documentId,type:this.placing,required:"radio"!==this.placing,page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:r,multiline:!1,options:"radio"===this.placing?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",m);const u=await f(this.endpoint,this.templateId,m);console.log("[FIELDS] Saved field",u),this.fieldStore.set("fields",[...this.fieldStore.get("fields"),u]),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:null===(o=this.templateStore)||void 0===o?void 0:o.state,event:"added-field"})}}render(){var e,t,s;if(!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const l=this.roleStore.get("roles").map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},onSubmit:()=>{}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:e=>this.selectedRoleName=e.target.value}),J.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(s=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===s?void 0:s.documents)||[]).map((e=>r(1,e.pages).map((t=>{const o=e.page_sizes[t];return i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(null==o?void 0:o.width)||612,virtualHeight:(null==o?void 0:o.height)||792,disabled:!0,editable:!0,done:!1,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:this.roleStore.get("roles").length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};ee.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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{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}";const te=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.name="",this.dirty=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.name=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.name,this.dirty=!1}catch(e){console.log("[TEMPLATE NAME] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,i,o;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,console.log("Closing"),null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){var t,i,o;e.stopPropagation(),await x(this.endpoint,this.templateId,{name:this.name}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.name=this.name),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"}),null===(o=this.close)||void 0===o||o.emit()}render(){var e,t;return this.endpoint.session?(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoading)?i(o,{class:"loading"},i("verdocs-loader",null)):i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("label",{htmlFor:"verdocs-template-name"},"Template Name"),i("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:e=>{var t,i;this.name=e.target.value,this.dirty=this.name!==(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name)}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};te.style="";const ie={template_owner:"Template Owner",envelope_creator:"Envelope Creator"},oe='<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>',se='<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>',le='<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>',ae='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',re='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',ne=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.templateStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.sender=null,this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await z(this.endpoint,this.templateId,!1).then((e=>{this.templateStore=e,this.roleStore=C(this.templateId),this.loading=!1,this.roleStore.onChange("roles",(e=>{var t;console.log("[ROLES] Roles changed",{roles:e}),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:e})}))})).catch((e=>console.warn(e)))}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new M(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}componentDidRender(){U.dynamicDrop(!0),U(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("dX")||0),i=+(e.target.getAttribute("dY")||0),o=+(e.target.dataset.sequence||0),s=+(e.target.dataset.order||0),l=e.dx+t,a=e.dy+i;e.target.setAttribute("dX",l),e.target.setAttribute("dY",a);const r=e.target.getBoundingClientRect();console.log("w",r.width),e.target.style.transform=`translate(${l+r.width-(s+1)}px, ${a-r.height*o}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.removeAttribute("dX"),e.target.removeAttribute("dY"),e.target.style.transform=null}.bind(this)}}),U(".dropzone").dropzone({overlap:.05,ondrop:async function(e){var t;console.log("dropped",e.target.classList),e.target.classList.remove("active"),S(this.roleStore,e.relatedTarget.dataset.rolename,{sequence:+e.target.dataset.sequence,order:+e.target.dataset.order}),await this.renumberTemplateRoles(),console.log("[ROLES] Updated roles",this.getSortedRoles()),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}getSortedRoles(){return this.roleStore.state.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e=[];return this.getSortedRoles().forEach((t=>{e.includes(t.sequence)||e.push(t.sequence)})),e.sort(((e,t)=>e-t))}getRoleNames(){return this.getSortedRoles().map((e=>e.name))}getRolesAtSequence(e){return this.roleStore.state.roles.filter((t=>t&&t.sequence===e))}renumberTemplateRoles(){const e=[],t=[];return this.getSequenceNumbers().forEach(((i,o)=>{this.getRolesAtSequence(i).forEach(((i,s)=>{e.includes(i.name)||i.sequence===o+1&&i.order===s+1||(i.sequence=o+1,i.order=s+1,e.push(i.name),t.push(b(this.endpoint,this.templateId,i.name,{sequence:i.sequence,order:i.order})))}))})),Promise.all(t)}getNextRoleName(){let e="",t=Object.keys(this.roleStore.state).length-1;do{t++,e=`Recipient ${t}`}while(!e||this.roleStore.state.roles.some((t=>t&&t.name===e)));return e}callCreateRole(e,t,i){console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),w(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:!1,kba_method:null}).then((async e=>{var t;console.log("[ROLES] Created role",e),this.roleStore.set("roles",[...this.roleStore.state.roles,e]),await this.renumberTemplateRoles(),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const i=this.getRolesAtSequence(t).length+1,o=this.getNextRoleName();this.callCreateRole(o,t,i)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,a;if(!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return console.log("Loading",this.loading,null===(t=this.templateStore)||void 0===t?void 0:t.state.isLoaded),i(o,{class:"loading"},i("verdocs-loader",null));const r=this.getRoleNames(),n=this.getSequenceNumbers();return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Owner:")," ",ie[null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.sender]," "))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:se}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),n.map((e=>i(s,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),this.getRolesAtSequence(e).map((t=>{const o=!t.email;return console.log("ras",e,t),i(s,null,o?i("div",{class:"recipient",style:{backgroundColor:p(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?le:"cc"===t.type?re:ae}),t.name," ",i("div",{class:"settings-button",innerHTML:oe,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{borderColor:p(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?le:"cc"===t.type?re:ae}),h(t)," ",i("div",{class:"settings-button",innerHTML:oe,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e}))})),i("button",{class:"add-role",innerHTML:se,onClick:t=>this.handleAddRole(t,e)}))),n.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step")))))),i("div",{class:"row","data-sequence":n.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("button",{class:"add-step",innerHTML:se,onClick:e=>this.handleAddStep(e,n.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),r.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:se})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:r.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null,await this.renumberTemplateRoles(),null===(e=this.rolesUpdated)||void 0===e||e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}}))}get el(){return l(this)}};ne.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-top:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 15px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:rgba(101, 77, 203, 0.4980392157);border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:rgba(101, 77, 203, 0.4980392157);-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const de=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var e,t,i,o,s,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.personal=(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal)||!0,this.public=(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.is_public)||!1,this.dirty=!1}catch(e){console.log("[TEMPLATE VISIBILITY] Error loading template",e),null===(s=this.sdkError)||void 0===s||s.emit(new M(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}handleCancel(e){var t,i,o,s,l;e.stopPropagation(),this.personal=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_personal,this.public=null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s?void 0:s.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(e){var t,i,o;e.stopPropagation(),await x(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"}),null===(o=this.close)||void 0===o||o.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Visibility"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-shared"},"Shared"),i("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:e=>{this.personal=!e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-public"},"Public"),i("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:e=>{this.public=e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(o,{class:"empty"}):i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};de.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{F as verdocs_preview,W as verdocs_send,O as verdocs_template_attachments,X as verdocs_template_build_tabs,K as verdocs_template_create,ee as verdocs_template_fields,te as verdocs_template_name,ne as verdocs_template_roles,de as verdocs_template_visibility}