@verdocs/web-sdk 2.3.2 → 2.3.4

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 (146) hide show
  1. package/dist/cjs/{TemplateStore-d5dd1621.js → TemplateStore-0ed8cd92.js} +1 -1
  2. package/dist/cjs/{VerdocsEndpoint-8495a05a.js → VerdocsEndpoint-7a8bf79c.js} +4 -1
  3. package/dist/cjs/ipc-test.cjs.entry.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +11 -2
  9. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  29. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +10 -0
  30. package/dist/components/VerdocsEndpoint.js +4 -1
  31. package/dist/components/verdocs-template-field-properties2.js +10 -0
  32. package/dist/docs.json +1 -1
  33. package/dist/esm/{TemplateStore-18b6dbe3.js → TemplateStore-0ecf6e55.js} +1 -1
  34. package/dist/esm/{VerdocsEndpoint-140b14d7.js → VerdocsEndpoint-a18c0968.js} +4 -1
  35. package/dist/esm/ipc-test.entry.js +2 -2
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  38. package/dist/esm/verdocs-auth.entry.js +1 -1
  39. package/dist/esm/verdocs-build.entry.js +2 -2
  40. package/dist/esm/verdocs-button-panel_2.entry.js +11 -2
  41. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  42. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  43. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
  44. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
  45. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  46. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  47. package/dist/esm/verdocs-field-textbox.entry.js +1 -1
  48. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  49. package/dist/esm/verdocs-preview_8.entry.js +2 -2
  50. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  51. package/dist/esm/verdocs-search.entry.js +1 -1
  52. package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
  53. package/dist/esm/verdocs-settings.entry.js +1 -1
  54. package/dist/esm/verdocs-sign.entry.js +1 -1
  55. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  56. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  57. package/dist/esm/verdocs-template-star.entry.js +1 -1
  58. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  59. package/dist/esm/verdocs-view.entry.js +1 -1
  60. package/dist/esm/verdocs-web-sdk.js +1 -1
  61. package/dist/esm-es5/{TemplateStore-18b6dbe3.js → TemplateStore-0ecf6e55.js} +1 -1
  62. package/dist/esm-es5/{VerdocsEndpoint-140b14d7.js → VerdocsEndpoint-a18c0968.js} +1 -1
  63. package/dist/esm-es5/ipc-test.entry.js +1 -1
  64. package/dist/esm-es5/loader.js +1 -1
  65. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  66. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  67. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  73. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-settings.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  89. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +1 -0
  90. package/dist/verdocs-web-sdk/{p-be083d74.system.entry.js → p-03105a2e.system.entry.js} +1 -1
  91. package/dist/verdocs-web-sdk/{p-a8533019.entry.js → p-05b000c0.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-8ad78ada.system.entry.js → p-0f06edcc.system.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/{p-2ec00680.entry.js → p-0f4a5b95.entry.js} +1 -1
  94. package/dist/verdocs-web-sdk/{p-d0865aca.entry.js → p-1674c703.entry.js} +1 -1
  95. package/dist/verdocs-web-sdk/{p-59baf5ed.system.entry.js → p-16d0f4e6.system.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-3a8c1133.entry.js → p-1c7c6ec7.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-878edeb5.system.entry.js → p-1f51b91e.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/{p-5c2b1e35.entry.js → p-21126597.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/p-23617458.entry.js +1 -0
  100. package/dist/verdocs-web-sdk/{p-dc37ce85.system.entry.js → p-23c7d6bb.system.entry.js} +1 -1
  101. package/dist/verdocs-web-sdk/{p-853a8c73.entry.js → p-26388fe4.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-2a9669b6.entry.js +1 -0
  103. package/dist/verdocs-web-sdk/{p-764045ab.entry.js → p-2af999c9.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-23ff8991.system.entry.js → p-2ca76aa5.system.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-f0b826a2.system.entry.js → p-304cf5b0.system.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-f83e5b8f.system.js → p-3070cc3b.system.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-4aeea02f.system.entry.js → p-31e97ef4.system.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/{p-1bb86e1a.entry.js → p-3614c448.entry.js} +1 -1
  109. package/dist/verdocs-web-sdk/{p-5ed0a61e.system.js → p-4bf88541.system.js} +1 -1
  110. package/dist/verdocs-web-sdk/{p-c58e4861.entry.js → p-4e43fd86.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/{p-aca795cb.system.entry.js → p-58f28d9f.system.entry.js} +1 -1
  112. package/dist/verdocs-web-sdk/{p-f0fbc822.system.entry.js → p-5d32e0a5.system.entry.js} +1 -1
  113. package/dist/verdocs-web-sdk/{p-f1aa1551.system.entry.js → p-5d51cf54.system.entry.js} +1 -1
  114. package/dist/verdocs-web-sdk/{p-576a4517.system.entry.js → p-663073d5.system.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/{p-571f4e12.js → p-6aef8042.js} +1 -1
  116. package/dist/verdocs-web-sdk/{p-0002c8d5.system.entry.js → p-6bc1c9f2.system.entry.js} +1 -1
  117. package/dist/verdocs-web-sdk/{p-4ddbb290.entry.js → p-6da61008.entry.js} +1 -1
  118. package/dist/verdocs-web-sdk/{p-acac85fc.entry.js → p-6ff52337.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/{p-38272a03.entry.js → p-85abbfc9.entry.js} +1 -1
  120. package/dist/verdocs-web-sdk/{p-16724702.js → p-8ff245c9.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-fc6629e5.system.entry.js → p-91fd5faa.system.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-c01196f9.system.entry.js → p-9adda357.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-c7f6bb1d.system.entry.js → p-a15df083.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-8b28f85b.entry.js → p-a5ac349f.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-5cce8ddb.system.entry.js → p-aac84ce0.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-f0d2d9e1.entry.js → p-acba9950.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-fff35c6b.entry.js → p-b5972878.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-c48b67ab.system.entry.js → p-b77a743c.system.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-e4432f87.entry.js → p-c18362fd.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-32f1c0a6.entry.js → p-cc05162a.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-7db74d5e.system.entry.js → p-cc962212.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-1df623d7.system.entry.js → p-cf19be3a.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-ed2d0a49.system.entry.js → p-d33eb0d9.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-8ceccd53.entry.js → p-d5e82bfc.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-e7481777.system.entry.js → p-d844ab61.system.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  137. package/dist/verdocs-web-sdk/{p-f269c7c4.entry.js → p-f16c85f8.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-b2139ec5.entry.js → p-f709b7d9.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-07432832.system.entry.js → p-f77c6153.system.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-65b96820.system.entry.js → p-f7fd08bb.system.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-b10db51e.entry.js → p-f9889d9a.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-ad18bb44.entry.js → p-fce1bc9e.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  144. package/package.json +2 -2
  145. package/dist/verdocs-web-sdk/p-1cd6f713.entry.js +0 -1
  146. package/dist/verdocs-web-sdk/p-66b2899b.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as o,F as s,a as l}from"./p-14b44491.js";import{i as r}from"./p-999fbe79.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-16724702.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{b as v,r as m,f as u,h as f,i as g}from"./p-ee159b14.js";import{g as x,a as b}from"./p-571f4e12.js";import{S as w}from"./p-7a1b2643.js";import{g as y}from"./p-6de76553.js";import"./p-7d5dbd9a.js";import"./p-5a91bf23.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";var k=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/roles/").concat(i),o).then((function(e){return e.data}))};const q='<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>',C=[{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>'},{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>'},{id:"sep1",tooltip:"",icon:q},{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>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",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>'},{id:"radio_button_group",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>'},{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>'},{id:"sep2",tooltip:"",icon:q},{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>'},{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>'}],E=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,o,s,l,r;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");this.store=await x(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loaded template ${this.templateId}`,this.store.state),this.selectedRoleName=(null===(o=null===(i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===i?void 0:i[0])||void 0===o?void 0:o.name)||"",console.log("[FIELDS] Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new w(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){r.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,i,o,s,l;this.selectedRoleName&&((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).find((e=>e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(l=null===(s=null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles)||void 0===s?void 0:s[0])||void 0===l?void 0:l.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}handleFieldSettingsChange(e,t,i,o,s){var l,r,a,n;console.log("[FIELDS] Field settings changed",t.name,s),Object.assign(t,s),o.field=s,this.selectedRoleName=t.role_name,o.setAttribute("roleindex",v(b(this.store),t.role_name)),o.field=null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.fields.find((e=>e.name===t.name)),this.rerender++,o.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(n=this.store)||void 0===n?void 0:n.state,event:"updated-field"}),console.log("[FIELDS] Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),m(t,e,i,{disabled:!0,editable:!0,draggable:!0})}attachFieldAttributes(e,t,i,o){o.addEventListener("input",(e=>this.handleFieldChange(t,e))),o.addEventListener("settingsChanged",(s=>this.handleFieldSettingsChange(e,t,i,o,s.detail.field))),o.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),o.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state,event:"updated-field"})})),o.setAttribute("templateid",this.templateId),o.setAttribute("roleindex",i),o.setAttribute("pageNumber",e.pageNumber),o.setAttribute("xScale",e.xScale),o.setAttribute("yScale",e.yScale),o.setAttribute("name",t.name)}handlePageRendered(e){var t;const i=e.detail;console.log("[FIELDS] Page rendered",i.pageNumber,i),this.cachedPageInfo[i.pageNumber]=i,this.pageHeights[i.pageNumber]=i.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===i.pageNumber))).forEach((e=>this.reRenderField(e,i.pageNumber)))}reRenderField(e,t){const i=this.cachedPageInfo[t],o=v(b(this.store),e.role_name),s=m(e,i,o,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(i,e,o,t),this.makeDraggable(t)})):(this.attachFieldAttributes(i,e,o,s),this.makeDraggable(s)))}makeDraggable(e){r(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,r=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),u(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t;const i=e.target.getAttribute("pageNumber"),{naturalWidth:o=612,naturalHeight:s=792,renderedHeight:l=792}=this.cachedPageInfo[i],r=e.target.getBoundingClientRect(),a=e.target.parentElement.getBoundingClientRect(),n=Math.max(r.left-a.left,0),d=Math.max(l-(a.bottom-r.bottom),0),{x:c,y:h}=this.viewCoordinatesToPageCoordinates(n,d,i,o-e.rect.width,s-e.rect.height),m=e.target.getAttribute("name"),u=+(e.target.getAttribute("option")||"0"),f=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===m));if(f){switch(f.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":f.setting.x=c,f.setting.y=h;break;case"checkbox_group":case"radio_button_group":{const e=f.setting.options[u];e&&(e.x=c,e.y=h)}}console.log("[FIELDS] Will update",m,u,f);const t=await p(this.endpoint,this.templateId,m,f),o=this.cachedPageInfo[i],s=v(b(this.store),f.role_name);this.handleFieldSettingsChange(o,f,s,e.target,t),e.target.removeAttribute("posX"),e.target.removeAttribute("posY")}}generateFieldName(e,t){var i;let o,s=1;do{o=`${e}P${t}-${s}`,s++}while(null===(i=this.store)||void 0===i?void 0:i.state.fields.some((e=>e.name===o)));return o}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/l,o)),y:Math.floor(Math.min(Math.max(a-t,0)/r,s))}}async handleClickPage(e,t){var i,o,s;if(this.placing){const l=e.offsetX,r=e.offsetY,a=f(this.placing),n=g(this.placing),d=this.cachedPageInfo[t],{naturalWidth:p=612,naturalHeight:h=792}=d,v=this.viewCoordinatesToPageCoordinates(l,r,t,p-a,h-n),m=Math.floor(v.x),u=Math.floor(v.y),x={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:d.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:u},x:m,y:u,tabindex:0,width:a,height:n};switch(x.type){case"attachment":case"payment":x.setting={x:m,y:u};break;case"initial":case"signature":x.setting={x:m,y:u,result:""};break;case"checkbox_group":x.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${x.name}-1`,value:"Option 1",checked:!1,x:m,y:u}]};break;case"date":x.setting={x:m,y:u,width:a,height:n,result:""};break;case"dropdown":x.required=!1,x.setting={x:m,y:u,width:a,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":x.setting={options:[{id:`${x.name}-1`,value:"Option 1",selected:!1,x:m,y:u}]};break;case"textarea":case"textbox":x.setting={x:m,y:u,width:a,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":x.setting={x:m,y:u,width:a,height:n}}"textarea"===x.type&&(x.setting.leading=16,x.type="textbox");const b=await c(this.endpoint,this.templateId,x);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(i=this.store)||void 0===i?void 0:i.state.fields,b]),this.placing=null,null===(o=this.templateUpdated)||void 0===o||o.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}render(){var e,t,s,l,r,a,n,d;if(console.log("[FIELDS] Rendering",this.selectedRoleName),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const p=null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.roles.map((e=>({value:e.name,label:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:p,onInput:e=>this.selectedRoleName=e.target.value}),C.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,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:(null===(d=null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.roles)||void 0===d?void 0:d.length)>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};E.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const M=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.fullName="",this.email="",this.phone="",this.allowDelegation=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1);const i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.fullName=i.full_name,this.email=i.email,this.phone=i.phone,this.allowDelegation=i.delegator,console.log("[ROLES] Editing role",i))}catch(e){console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(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,null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,k(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,this.store=await x(this.endpoint,this.templateId,!0),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("Update error",e),this.saving=!1}))}async handleDelete(e){var t,i,o;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,i=this.templateId,o=this.roleName,t.api.delete("/templates/".concat(i,"/roles/").concat(o)).then((function(e){return e.data}))).then((e=>{var t;console.log("Role deleted",e),this.store.state.roles=[...this.store.state.roles.filter((e=>e.name!==this.roleName))],null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){const e=-1!==(this.store.state.fields||[]).findIndex((e=>e.role_name===this.roleName));return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},i("div",{class:"dialog"},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.fullName=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.allowDelegation,onInput:e=>{this.allowDelegation=e.target.checked,this.dirty=!0}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),i("div",{style:{flex:"1"}}),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)}))))))}};M.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const Z={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},L='<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>',z='<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>',S='<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>',H='<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>',V='<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>',I=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.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=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");await this.reloadStore()}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new w(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 reloadStore(){this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}componentDidRender(){r.dynamicDrop(!0),r(".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("posX")||0),i=+(e.target.getAttribute("posY")||0),o=e.dx+t,s=e.dy+i;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,i,o,s,l;e.target.classList.remove("active");const r=e.relatedTarget.dataset.rolename,a=+e.target.dataset.sequence,n=+e.target.dataset.order,d=null===(o=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles)||void 0===o?void 0:o.find((e=>e.name===r));d&&(d.sequence=a,d.order=n,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>k(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.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()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,i)=>{var o,s;null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,o)=>{e.includes(t.name)||(t.sequence=i+1,t.order=o+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,i,o;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,i){var o,s,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),(o=this.endpoint,s=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:i,full_name:"",email:"",phone:"",type:"signer",delegator:!1},o.api.post("/templates/".concat(s,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t,i;console.log("[ROLES] Created role",e),this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles(),null===(t=this.templateUpdated)||void 0===t||t.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var i;e.stopPropagation();const o=(null===(i=this.store)||void 0===i?void 0:i.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,o)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,r,a,n;if(console.log("[ROLES] Rendering"),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,{class:"loading"},i("verdocs-loader",null));const d=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(r=this.store.state)||void 0===r?void 0:r.updateCount},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"},"Sender:")," ",Z[null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.sender]," ",i("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:z}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,o;return 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}),null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles.filter((t=>t.sequence===e)).map((t=>i(s,null,t.email?i("div",{class:"recipient",style:{borderColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.full_name," ",i("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{backgroundColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.name," ",i("div",{class:"settings-button",innerHTML:L,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:z,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":this.sequences.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("button",{class:"add-step",innerHTML:z,onClick:e=>this.handleAddStep(e,this.sequences.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")))),d.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:z})," 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:d.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,t;await x(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};I.style='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-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 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var i;console.log("Update result",t),(null===(i=this.store)||void 0===i?void 0:i.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};R.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{E as verdocs_template_fields,M as verdocs_template_role_properties,I as verdocs_template_roles,R as verdocs_template_sender}
1
+ import{r as e,c as t,h as i,H as o,F as s,a as l}from"./p-14b44491.js";import{i as r}from"./p-999fbe79.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-8ff245c9.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{b as v,r as m,f as u,h as f,i as g}from"./p-ee159b14.js";import{g as x,a as b}from"./p-6aef8042.js";import{S as w}from"./p-7a1b2643.js";import{g as y}from"./p-6de76553.js";import"./p-7d5dbd9a.js";import"./p-5a91bf23.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";var k=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/roles/").concat(i),o).then((function(e){return e.data}))};const q='<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>',C=[{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>'},{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>'},{id:"sep1",tooltip:"",icon:q},{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>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",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>'},{id:"radio_button_group",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>'},{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>'},{id:"sep2",tooltip:"",icon:q},{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>'},{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>'}],E=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,o,s,l,r;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");this.store=await x(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loaded template ${this.templateId}`,this.store.state),this.selectedRoleName=(null===(o=null===(i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===i?void 0:i[0])||void 0===o?void 0:o.name)||"",console.log("[FIELDS] Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new w(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){r.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,i,o,s,l;this.selectedRoleName&&((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).find((e=>e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(l=null===(s=null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles)||void 0===s?void 0:s[0])||void 0===l?void 0:l.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}handleFieldSettingsChange(e,t,i,o,s){var l,r,a,n;console.log("[FIELDS] Field settings changed",t.name,s),Object.assign(t,s),o.field=s,this.selectedRoleName=t.role_name,o.setAttribute("roleindex",v(b(this.store),t.role_name)),o.field=null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.fields.find((e=>e.name===t.name)),this.rerender++,o.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(n=this.store)||void 0===n?void 0:n.state,event:"updated-field"}),console.log("[FIELDS] Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),m(t,e,i,{disabled:!0,editable:!0,draggable:!0})}attachFieldAttributes(e,t,i,o){o.addEventListener("input",(e=>this.handleFieldChange(t,e))),o.addEventListener("settingsChanged",(s=>this.handleFieldSettingsChange(e,t,i,o,s.detail.field))),o.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),o.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state,event:"updated-field"})})),o.setAttribute("templateid",this.templateId),o.setAttribute("roleindex",i),o.setAttribute("pageNumber",e.pageNumber),o.setAttribute("xScale",e.xScale),o.setAttribute("yScale",e.yScale),o.setAttribute("name",t.name)}handlePageRendered(e){var t;const i=e.detail;console.log("[FIELDS] Page rendered",i.pageNumber,i),this.cachedPageInfo[i.pageNumber]=i,this.pageHeights[i.pageNumber]=i.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===i.pageNumber))).forEach((e=>this.reRenderField(e,i.pageNumber)))}reRenderField(e,t){const i=this.cachedPageInfo[t],o=v(b(this.store),e.role_name),s=m(e,i,o,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(i,e,o,t),this.makeDraggable(t)})):(this.attachFieldAttributes(i,e,o,s),this.makeDraggable(s)))}makeDraggable(e){r(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,r=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),u(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t;const i=e.target.getAttribute("pageNumber"),{naturalWidth:o=612,naturalHeight:s=792,renderedHeight:l=792}=this.cachedPageInfo[i],r=e.target.getBoundingClientRect(),a=e.target.parentElement.getBoundingClientRect(),n=Math.max(r.left-a.left,0),d=Math.max(l-(a.bottom-r.bottom),0),{x:c,y:h}=this.viewCoordinatesToPageCoordinates(n,d,i,o-e.rect.width,s-e.rect.height),m=e.target.getAttribute("name"),u=+(e.target.getAttribute("option")||"0"),f=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===m));if(f){switch(f.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":f.setting.x=c,f.setting.y=h;break;case"checkbox_group":case"radio_button_group":{const e=f.setting.options[u];e&&(e.x=c,e.y=h)}}console.log("[FIELDS] Will update",m,u,f);const t=await p(this.endpoint,this.templateId,m,f),o=this.cachedPageInfo[i],s=v(b(this.store),f.role_name);this.handleFieldSettingsChange(o,f,s,e.target,t),e.target.removeAttribute("posX"),e.target.removeAttribute("posY")}}generateFieldName(e,t){var i;let o,s=1;do{o=`${e}P${t}-${s}`,s++}while(null===(i=this.store)||void 0===i?void 0:i.state.fields.some((e=>e.name===o)));return o}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/l,o)),y:Math.floor(Math.min(Math.max(a-t,0)/r,s))}}async handleClickPage(e,t){var i,o,s;if(this.placing){const l=e.offsetX,r=e.offsetY,a=f(this.placing),n=g(this.placing),d=this.cachedPageInfo[t],{naturalWidth:p=612,naturalHeight:h=792}=d,v=this.viewCoordinatesToPageCoordinates(l,r,t,p-a,h-n),m=Math.floor(v.x),u=Math.floor(v.y),x={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:d.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:u},x:m,y:u,tabindex:0,width:a,height:n};switch(x.type){case"attachment":case"payment":x.setting={x:m,y:u};break;case"initial":case"signature":x.setting={x:m,y:u,result:""};break;case"checkbox_group":x.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${x.name}-1`,value:"Option 1",checked:!1,x:m,y:u}]};break;case"date":x.setting={x:m,y:u,width:a,height:n,result:""};break;case"dropdown":x.required=!1,x.setting={x:m,y:u,width:a,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":x.setting={options:[{id:`${x.name}-1`,value:"Option 1",selected:!1,x:m,y:u}]};break;case"textarea":case"textbox":x.setting={x:m,y:u,width:a,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":x.setting={x:m,y:u,width:a,height:n}}"textarea"===x.type&&(x.setting.leading=16,x.type="textbox");const b=await c(this.endpoint,this.templateId,x);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(i=this.store)||void 0===i?void 0:i.state.fields,b]),this.placing=null,null===(o=this.templateUpdated)||void 0===o||o.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}render(){var e,t,s,l,r,a,n,d;if(console.log("[FIELDS] Rendering",this.selectedRoleName),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const p=null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.roles.map((e=>({value:e.name,label:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:p,onInput:e=>this.selectedRoleName=e.target.value}),C.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,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:(null===(d=null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.roles)||void 0===d?void 0:d.length)>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};E.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const M=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.fullName="",this.email="",this.phone="",this.allowDelegation=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1);const i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.fullName=i.full_name,this.email=i.email,this.phone=i.phone,this.allowDelegation=i.delegator,console.log("[ROLES] Editing role",i))}catch(e){console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(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,null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,k(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,this.store=await x(this.endpoint,this.templateId,!0),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("Update error",e),this.saving=!1}))}async handleDelete(e){var t,i,o;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,i=this.templateId,o=this.roleName,t.api.delete("/templates/".concat(i,"/roles/").concat(o)).then((function(e){return e.data}))).then((e=>{var t;console.log("Role deleted",e),this.store.state.roles=[...this.store.state.roles.filter((e=>e.name!==this.roleName))],null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){const e=-1!==(this.store.state.fields||[]).findIndex((e=>e.role_name===this.roleName));return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},i("div",{class:"dialog"},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.fullName=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.allowDelegation,onInput:e=>{this.allowDelegation=e.target.checked,this.dirty=!0}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),i("div",{style:{flex:"1"}}),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)}))))))}};M.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const Z={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},L='<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>',z='<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>',S='<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>',H='<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>',V='<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>',I=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.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=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");await this.reloadStore()}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new w(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 reloadStore(){this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}componentDidRender(){r.dynamicDrop(!0),r(".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("posX")||0),i=+(e.target.getAttribute("posY")||0),o=e.dx+t,s=e.dy+i;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,i,o,s,l;e.target.classList.remove("active");const r=e.relatedTarget.dataset.rolename,a=+e.target.dataset.sequence,n=+e.target.dataset.order,d=null===(o=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles)||void 0===o?void 0:o.find((e=>e.name===r));d&&(d.sequence=a,d.order=n,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>k(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.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()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,i)=>{var o,s;null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,o)=>{e.includes(t.name)||(t.sequence=i+1,t.order=o+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,i,o;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,i){var o,s,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),(o=this.endpoint,s=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:i,full_name:"",email:"",phone:"",type:"signer",delegator:!1},o.api.post("/templates/".concat(s,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t,i;console.log("[ROLES] Created role",e),this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles(),null===(t=this.templateUpdated)||void 0===t||t.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var i;e.stopPropagation();const o=(null===(i=this.store)||void 0===i?void 0:i.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,o)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,r,a,n;if(console.log("[ROLES] Rendering"),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,{class:"loading"},i("verdocs-loader",null));const d=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(r=this.store.state)||void 0===r?void 0:r.updateCount},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"},"Sender:")," ",Z[null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.sender]," ",i("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:z}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,o;return 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}),null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles.filter((t=>t.sequence===e)).map((t=>i(s,null,t.email?i("div",{class:"recipient",style:{borderColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.full_name," ",i("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{backgroundColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.name," ",i("div",{class:"settings-button",innerHTML:L,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:z,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":this.sequences.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("button",{class:"add-step",innerHTML:z,onClick:e=>this.handleAddStep(e,this.sequences.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")))),d.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:z})," 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:d.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,t;await x(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};I.style='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-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 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var i;console.log("Update result",t),(null===(i=this.store)||void 0===i?void 0:i.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};R.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{E as verdocs_template_fields,M as verdocs_template_role_properties,I as verdocs_template_roles,R as verdocs_template_sender}
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-54498887.system.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.d}],execute:function(){var r=this;e({T:void 0,a:void 0});var n;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(n||(n={}));var i;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(i||(i={}));var o=e("c",(function(e,t,r){var n,o;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var s=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var u=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!s){return{canPerform:false,message:"Active session required"}}var c=(r===null||r===void 0?void 0:r.profile_id)===s;var f=(r===null||r===void 0?void 0:r.organization_id)===u;var l=(n=r===null||r===void 0?void 0:r.is_personal)!==null&&n!==void 0?n:false;var p=(o=r===null||r===void 0?void 0:r.is_public)!==null&&o!==void 0?o:false;var d=[];switch(t){case"create_personal":d.push(i.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":d.push(i.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":d.push(i.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!c){if(!l&&f||!p){d.push(i.TEMPLATE_MEMBER_READ)}}break;case"write":if(!c){d.push(i.TEMPLATE_MEMBER_READ);d.push(i.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_ORG)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_PUBLIC);d.push(i.TEMPLATE_CREATOR_VISIBILITY)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(c){d.push(i.TEMPLATE_CREATOR_DELETE)}else{d.push(i.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(a(e,d)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(d.toString())}}));var a=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};var s=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())}))};var u=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var c=e("e",(function(e,t){return e.api.post("/templates",{params:t}).then((function(e){return e.data}))}));var f=e("g",(function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))}));var l=["name","is_personal","is_public","sender","description","roles","fields"];var p=e("b",(function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){var i=new FormData;l.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/v2/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/v2/templates",t,n).then((function(e){return e.data}))}}));var d=e("u",(function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))}));var h=e("d",(function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))}));var v;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(v||(v={}));var E=e("l",(function(e,t){if(t===void 0){t={}}return s(void 0,void 0,void 0,(function(){return u(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))}));var m;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(m||(m=e("T",{})));var _;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(_||(_=e("a",{})));var R;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(R||(R={}));var y;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(y||(y={}));var T;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(T||(T={}));var g;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(g||(g={}));var b=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var A=function(e){return!b.has(e&&e.code)};var O="axios-retry";function w(e){var t=["ERR_CANCELED","ECONNABORTED"];if(e.response){return false}if(!e.code){return false}if(t.includes(e.code)){return false}return A(e)}var S=["get","head","options"];var L=S.concat(["put","delete"]);function C(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function N(e){var t;if(!((t=e.config)===null||t===void 0?void 0:t.method)){return false}return C(e)&&S.indexOf(e.config.method)!==-1}function I(e){var t;if(!((t=e.config)===null||t===void 0?void 0:t.method)){return false}return C(e)&&L.indexOf(e.config.method)!==-1}function P(e){return w(e)||I(e)}function D(){return 0}function U(e,t,r){if(e===void 0){e=0}if(t===void 0){t=undefined}if(r===void 0){r=100}var n=Math.pow(2,e)*r;var i=n*.2*Math.random();return n+i}var M={retries:3,retryCondition:P,retryDelay:D,shouldResetTimeout:false,onRetry:function(){}};function B(e,t){return __assign(__assign(__assign({},M),t),e[O])}function j(e,t){var r=B(e,t||{});r.retryCount=r.retryCount||0;r.lastRequestTime=r.lastRequestTime||Date.now();e[O]=r;return r}function x(e,t){if(e.defaults.agent===t.agent){delete t.agent}if(e.defaults.httpAgent===t.httpAgent){delete t.httpAgent}if(e.defaults.httpsAgent===t.httpsAgent){delete t.httpsAgent}}function F(e,t){return s(this,void 0,void 0,(function(){var r,n,i,o,a;return u(this,(function(s){switch(s.label){case 0:r=e.retries,n=e.retryCondition;i=(e.retryCount||0)<r&&n(t);if(!(typeof i==="object"))return[3,4];s.label=1;case 1:s.trys.push([1,3,,4]);return[4,i];case 2:o=s.sent();return[2,o!==false];case 3:a=s.sent();return[2,false];case 4:return[2,i]}}))}))}var k=function(e,t){var n=e.interceptors.request.use((function(e){j(e,t);return e}));var i=e.interceptors.response.use(null,(function(n){return s(r,void 0,void 0,(function(){var r,i,o,a,s,c,f,l;return u(this,(function(u){switch(u.label){case 0:r=n.config;if(!r){return[2,Promise.reject(n)]}i=j(r,t);return[4,F(i,n)];case 1:if(!u.sent())return[3,3];i.retryCount+=1;o=i.retryDelay,a=i.shouldResetTimeout,s=i.onRetry;c=o(i.retryCount,n);x(e,r);if(!a&&r.timeout&&i.lastRequestTime){f=Date.now()-i.lastRequestTime;l=r.timeout-f-c;if(l<=0){return[2,Promise.reject(n)]}r.timeout=l}r.transformRequest=[function(e){return e}];return[4,s(i.retryCount,n,r)];case 2:u.sent();return[2,new Promise((function(t){setTimeout((function(){return t(e(r))}),c)}))];case 3:return[2,Promise.reject(n)]}}))}))}));return{requestInterceptorId:n,responseInterceptorId:i}};k.isNetworkError=w;k.isSafeRequestError=N;k.isIdempotentRequestError=I;k.isNetworkOrIdempotentRequestError=P;k.exponentialDelay=U;k.isRetryableError=C;function q(e,t){return function r(){return e.apply(t,arguments)}}var G=Object.prototype.toString;var V=Object.getPrototypeOf;var z=function(e){return function(t){var r=G.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));var H=function(e){e=e.toLowerCase();return function(t){return z(t)===e}};var J=function(e){return function(t){return typeof t===e}};var K=Array.isArray;var W=J("undefined");function Y(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&Q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var X=H("ArrayBuffer");function Z(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&X(e.buffer)}return t}var $=J("string");var Q=J("function");var ee=J("number");var te=function(e){return e!==null&&typeof e==="object"};var re=function(e){return e===true||e===false};var ne=function(e){if(z(e)!=="object"){return false}var t=V(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var ie=H("Date");var oe=H("File");var ae=H("Blob");var se=H("FileList");var ue=function(e){return te(e)&&Q(e.pipe)};var ce=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||Q(e.append)&&((t=z(e))==="formdata"||t==="object"&&Q(e.toString)&&e.toString()==="[object FormData]"))};var fe=H("URLSearchParams");var le=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function pe(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var a;var s;if(typeof e!=="object"){e=[e]}if(K(e)){for(a=0,s=e.length;a<s;a++){t.call(null,e[a],a,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var c=u.length;var f=void 0;for(a=0;a<c;a++){f=u[a];t.call(null,e[f],f,e)}}}function de(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var he=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var ve=function(e){return!W(e)&&e!==he};function Ee(){var e=(ve(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&de(t,n)||n;if(ne(t[i])&&ne(r)){t[i]=Ee(t[i],r)}else if(ne(r)){t[i]=Ee({},r)}else if(K(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&pe(arguments[n],r)}return t}var me=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;pe(t,(function(t,n){if(r&&Q(t)){e[n]=q(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var _e=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var Re=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var ye=function(e,t,r,n){var i;var o;var a;var s={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){a=i[o];if((!n||n(a,e,t))&&!s[a]){t[a]=e[a];s[a]=true}}e=r!==false&&V(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var Te=function(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r};var ge=function(e){if(!e)return null;if(K(e))return e;var t=e.length;if(!ee(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r};var be=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&V(Uint8Array));var Ae=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var Oe=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var we=H("HTMLFormElement");var Se=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var Le=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var Ce=H("RegExp");var Ne=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};pe(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var Ie=function(e){Ne(e,(function(t,r){if(Q(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!Q(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var Pe=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};K(e)?n(e):n(String(e).split(t));return r};var De=function(){};var Ue=function(e,t){e=+e;return Number.isFinite(e)?e:t};var Me="abcdefghijklmnopqrstuvwxyz";var Be="0123456789";var je={DIGIT:Be,ALPHA:Me,ALPHA_DIGIT:Me+Me.toUpperCase()+Be};var xe=function(e,t){if(e===void 0){e=16}if(t===void 0){t=je.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function Fe(e){return!!(e&&Q(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var ke=function(e){var t=new Array(10);var r=function(e,n){if(te(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=K(e)?[]:{};pe(e,(function(e,t){var o=r(e,n+1);!W(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var qe=H("AsyncFunction");var Ge=function(e){return e&&(te(e)||Q(e))&&Q(e.then)&&Q(e.catch)};var Ve={isArray:K,isArrayBuffer:X,isBuffer:Y,isFormData:ce,isArrayBufferView:Z,isString:$,isNumber:ee,isBoolean:re,isObject:te,isPlainObject:ne,isUndefined:W,isDate:ie,isFile:oe,isBlob:ae,isRegExp:Ce,isFunction:Q,isStream:ue,isURLSearchParams:fe,isTypedArray:be,isFileList:se,forEach:pe,merge:Ee,extend:me,trim:le,stripBOM:_e,inherits:Re,toFlatObject:ye,kindOf:z,kindOfTest:H,endsWith:Te,toArray:ge,forEachEntry:Ae,matchAll:Oe,isHTMLForm:we,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:Ne,freezeMethods:Ie,toObjectSet:Pe,toCamelCase:Se,noop:De,toFiniteNumber:Ue,findKey:de,global:he,isContextDefined:ve,ALPHABET:je,generateString:xe,isSpecCompliantForm:Fe,toJSONObject:ke,isAsyncFn:qe,isThenable:Ge};function ze(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}Ve.inherits(ze,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ve.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var He=ze.prototype;var Je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){Je[e]={value:e}}));Object.defineProperties(ze,Je);Object.defineProperty(He,"isAxiosError",{value:true});ze.from=function(e,t,r,n,i,o){var a=Object.create(He);Ve.toFlatObject(e,a,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));ze.call(a,e.message,t,r,n,i);a.cause=e;a.name=e.name;o&&Object.assign(a,o);return a};var Ke=null;function We(e){return Ve.isPlainObject(e)||Ve.isArray(e)}function Ye(e){return Ve.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=Ye(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function Ze(e){return Ve.isArray(e)&&!e.some(We)}var $e=Ve.toFlatObject(Ve,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function Qe(e,t,r){if(!Ve.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=Ve.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!Ve.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||f;var o=r.dots;var a=r.indexes;var s=r.Blob||typeof Blob!=="undefined"&&Blob;var u=s&&Ve.isSpecCompliantForm(t);if(!Ve.isFunction(i)){throw new TypeError("visitor must be a function")}function c(e){if(e===null)return"";if(Ve.isDate(e)){return e.toISOString()}if(!u&&Ve.isBlob(e)){throw new ze("Blob is not supported. Use a Buffer instead.")}if(Ve.isArrayBuffer(e)||Ve.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function f(e,r,i){var s=e;if(e&&!i&&typeof e==="object"){if(Ve.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(Ve.isArray(e)&&Ze(e)||(Ve.isFileList(e)||Ve.endsWith(r,"[]"))&&(s=Ve.toArray(e))){r=Ye(r);s.forEach((function e(n,i){!(Ve.isUndefined(n)||n===null)&&t.append(a===true?Xe([r],i,o):a===null?r:r+"[]",c(n))}));return false}}if(We(e)){return true}t.append(Xe(i,r,o),c(e));return false}var l=[];var p=Object.assign($e,{defaultVisitor:f,convertValue:c,isVisitable:We});function d(e,r){if(Ve.isUndefined(e))return;if(l.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}l.push(e);Ve.forEach(e,(function e(n,o){var a=!(Ve.isUndefined(n)||n===null)&&i.call(t,n,Ve.isString(o)?o.trim():o,r,p);if(a===true){d(n,r?r.concat(o):[o])}}));l.pop()}if(!Ve.isObject(e)){throw new TypeError("data must be an object")}d(e);return t}function et(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function tt(e,t){this._pairs=[];e&&Qe(e,this,t)}var rt=tt.prototype;rt.append=function e(t,r){this._pairs.push([t,r])};rt.toString=function e(t){var r=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function it(e,t,r){if(!t){return e}var n=r&&r.encode||nt;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=Ve.isURLSearchParams(t)?t.toString():new tt(t,r).toString(n)}if(o){var a=e.indexOf("#");if(a!==-1){e=e.slice(0,a)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var ot=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){Ve.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var at={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var st=typeof URLSearchParams!=="undefined"?URLSearchParams:tt;var ut=typeof FormData!=="undefined"?FormData:null;var ct=typeof Blob!=="undefined"?Blob:null;var ft={isBrowser:true,classes:{URLSearchParams:st,FormData:ut,Blob:ct},protocols:["http","https","file","blob","url","data"]};var lt=typeof window!=="undefined"&&typeof document!=="undefined";var pt=function(e){return lt&&["ReactNative","NativeScript","NS"].indexOf(e)<0}(typeof navigator!=="undefined"&&navigator.product);var dt=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var ht=Object.freeze({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserWebWorkerEnv:dt,hasStandardBrowserEnv:pt});var vt=__assign(__assign({},ht),ft);function Et(e,t){return Qe(e,new vt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){if(vt.isNode&&Ve.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)}},t))}function mt(e){return Ve.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function _t(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function Rt(e){function t(e,r,n,i){var o=e[i++];var a=Number.isFinite(+o);var s=i>=e.length;o=!o&&Ve.isArray(n)?n.length:o;if(s){if(Ve.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!a}if(!n[o]||!Ve.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&Ve.isArray(n[o])){n[o]=_t(n[o])}return!a}if(Ve.isFormData(e)&&Ve.isFunction(e.entries)){var r={};Ve.forEachEntry(e,(function(e,n){t(mt(e),n,r,0)}));return r}return null}function yt(e,t,r){if(Ve.isString(e)){try{(t||JSON.parse)(e);return Ve.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var Tt={transitional:at,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=Ve.isObject(t);if(o&&Ve.isHTMLForm(t)){t=new FormData(t)}var a=Ve.isFormData(t);if(a){if(!i){return t}return i?JSON.stringify(Rt(t)):t}if(Ve.isArrayBuffer(t)||Ve.isBuffer(t)||Ve.isStream(t)||Ve.isFile(t)||Ve.isBlob(t)){return t}if(Ve.isArrayBufferView(t)){return t.buffer}if(Ve.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Et(t,this.formSerializer).toString()}if((s=Ve.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return Qe(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return yt(t)}return t}],transformResponse:[function e(t){var r=this.transitional||Tt.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&Ve.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var a=!o&&i;try{return JSON.parse(t)}catch(e){if(a){if(e.name==="SyntaxError"){throw ze.from(e,ze.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};Ve.forEach(["delete","get","head","post","put","patch"],(function(e){Tt.headers[e]={}}));var gt=Ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var bt=function(e){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&gt[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var At=Symbol("internals");function Ot(e){return e&&String(e).trim().toLowerCase()}function wt(e){if(e===false||e==null){return e}return Ve.isArray(e)?e.map(wt):String(e)}function St(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var Lt=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function Ct(e,t,r,n,i){if(Ve.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Ve.isString(t))return;if(Ve.isString(n)){return t.indexOf(n)!==-1}if(Ve.isRegExp(n)){return n.test(t)}}function Nt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function It(e,t){var r=Ve.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var Pt=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=Ot(t);if(!i){throw new Error("header name must be a non-empty string")}var o=Ve.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=wt(e)}}var o=function(e,t){return Ve.forEach(e,(function(e,r){return i(e,r,t)}))};if(Ve.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(Ve.isString(e)&&(e=e.trim())&&!Lt(e)){o(bt(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=Ot(e);if(e){var r=Ve.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return St(n)}if(Ve.isFunction(t)){return t.call(this,n,r)}if(Ve.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=Ot(e);if(e){var r=Ve.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||Ct(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=Ot(e);if(e){var i=Ve.findKey(r,e);if(i&&(!t||Ct(r,r[i],i,t))){delete r[i];n=true}}}if(Ve.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||Ct(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};Ve.forEach(this,(function(n,i){var o=Ve.findKey(r,i);if(o){t[o]=wt(n);delete t[i];return}var a=e?Nt(i):String(i).trim();if(a!==i){delete t[i]}t[a]=wt(n);r[a]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);Ve.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&Ve.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[At]=this[At]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=Ot(e);if(!r[t]){It(n,e);r[t]=true}}Ve.isArray(e)?e.forEach(i):i(e);return this};return e}();Pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ve.reduceDescriptors(Pt.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));Ve.freezeMethods(Pt);function Dt(e,t){var r=this||Tt;var n=t||r;var i=Pt.from(n.headers);var o=n.data;Ve.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function Ut(e){return!!(e&&e.__CANCEL__)}function Mt(e,t,r){ze.call(this,e==null?"canceled":e,ze.ERR_CANCELED,t,r);this.name="CanceledError"}Ve.inherits(Mt,ze,{__CANCEL__:true});function Bt(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new ze("Request failed with status code "+r.status,[ze.ERR_BAD_REQUEST,ze.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var jt=vt.hasStandardBrowserEnv?{write:function(e,t,r,n,i,o){var a=[e+"="+encodeURIComponent(t)];Ve.isNumber(r)&&a.push("expires="+new Date(r).toGMTString());Ve.isString(n)&&a.push("path="+n);Ve.isString(i)&&a.push("domain="+i);o===true&&a.push("secure");document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function xt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ft(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function kt(e,t){if(e&&!xt(t)){return Ft(e,t)}return t}var qt=vt.hasStandardBrowserEnv?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=Ve.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function Gt(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vt(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var a;t=t!==undefined?t:1e3;return function s(u){var c=Date.now();var f=n[o];if(!a){a=c}r[i]=u;n[i]=c;var l=o;var p=0;while(l!==i){p+=r[l++];l=l%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(c-a<t){return}var d=f&&c-f;return d?Math.round(p*1e3/d):undefined}}function zt(e,t){var r=0;var n=Vt(50,250);return function(i){var o=i.loaded;var a=i.lengthComputable?i.total:undefined;var s=o-r;var u=n(s);var c=o<=a;r=o;var f={loaded:o,total:a,progress:a?o/a:undefined,bytes:s,rate:u?u:undefined,estimated:u&&a&&c?(a-o)/u:undefined,event:i};f[t?"download":"upload"]=true;e(f)}}var Ht=typeof XMLHttpRequest!=="undefined";var Jt=Ht&&function(e){return new Promise((function t(r,n){var i=e.data;var o=Pt.from(e.headers).normalize();var a=e.responseType,s=e.withXSRFToken;var u;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(u)}if(e.signal){e.signal.removeEventListener("abort",u)}}var f;if(Ve.isFormData(i)){if(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv){o.setContentType(false)}else if((f=o.getContentType())!==false){var l=f?f.split(";").map((function(e){return e.trim()})).filter(Boolean):[],p=l[0],d=l.slice(1);o.setContentType(__spreadArray([p||"multipart/form-data"],d,true).join("; "))}}var h=new XMLHttpRequest;if(e.auth){var v=e.auth.username||"";var E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+E))}var m=kt(e.baseURL,e.url);h.open(e.method.toUpperCase(),it(m,e.params,e.paramsSerializer),true);h.timeout=e.timeout;function _(){if(!h){return}var t=Pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());var i=!a||a==="text"||a==="json"?h.responseText:h.response;var o={data:i,status:h.status,statusText:h.statusText,headers:t,config:e,request:h};Bt((function e(t){r(t);c()}),(function e(t){n(t);c()}),o);h=null}if("onloadend"in h){h.onloadend=_}else{h.onreadystatechange=function e(){if(!h||h.readyState!==4){return}if(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)){return}setTimeout(_)}}h.onabort=function t(){if(!h){return}n(new ze("Request aborted",ze.ECONNABORTED,e,h));h=null};h.onerror=function t(){n(new ze("Network Error",ze.ERR_NETWORK,e,h));h=null};h.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||at;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new ze(r,i.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,h));h=null};if(vt.hasStandardBrowserEnv){s&&Ve.isFunction(s)&&(s=s(e));if(s||s!==false&&qt(m)){var R=e.xsrfHeaderName&&e.xsrfCookieName&&jt.read(e.xsrfCookieName);if(R){o.set(e.xsrfHeaderName,R)}}}i===undefined&&o.setContentType(null);if("setRequestHeader"in h){Ve.forEach(o.toJSON(),(function e(t,r){h.setRequestHeader(r,t)}))}if(!Ve.isUndefined(e.withCredentials)){h.withCredentials=!!e.withCredentials}if(a&&a!=="json"){h.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){h.addEventListener("progress",zt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&h.upload){h.upload.addEventListener("progress",zt(e.onUploadProgress))}if(e.cancelToken||e.signal){u=function(t){if(!h){return}n(!t||t.type?new Mt(null,e,h):t);h.abort();h=null};e.cancelToken&&e.cancelToken.subscribe(u);if(e.signal){e.signal.aborted?u():e.signal.addEventListener("abort",u)}}var y=Gt(m);if(y&&vt.protocols.indexOf(y)===-1){n(new ze("Unsupported protocol "+y+":",ze.ERR_BAD_REQUEST,e));return}h.send(i||null)}))};var Kt={http:Ke,xhr:Jt};Ve.forEach(Kt,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Wt=function(e){return"- ".concat(e)};var Yt=function(e){return Ve.isFunction(e)||e===null||e===false};var Xt={getAdapter:function(e){e=Ve.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var a=void 0;n=r;if(!Yt(r)){n=Kt[(a=String(r)).toLowerCase()];if(n===undefined){throw new ze("Unknown adapter '".concat(a,"'"))}}if(n){break}i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?s.length>1?"since :\n"+s.map(Wt).join("\n"):" "+Wt(s[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:Kt};function Zt(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new Mt(null,e)}}function $t(e){Zt(e);e.headers=Pt.from(e.headers);e.data=Dt.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=Xt.getAdapter(e.adapter||Tt.adapter);return t(e).then((function t(r){Zt(e);r.data=Dt.call(e,e.transformResponse,r);r.headers=Pt.from(r.headers);return r}),(function t(r){if(!Ut(r)){Zt(e);if(r&&r.response){r.response.data=Dt.call(e,e.transformResponse,r.response);r.response.headers=Pt.from(r.response.headers)}}return Promise.reject(r)}))}var Qt=function(e){return e instanceof Pt?e.toJSON():e};function er(e,t){t=t||{};var r={};function n(e,t,r){if(Ve.isPlainObject(e)&&Ve.isPlainObject(t)){return Ve.merge.call({caseless:r},e,t)}else if(Ve.isPlainObject(t)){return Ve.merge({},t)}else if(Ve.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!Ve.isUndefined(t)){return n(e,t,r)}else if(!Ve.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!Ve.isUndefined(t)){return n(undefined,t)}}function a(e,t){if(!Ve.isUndefined(t)){return n(undefined,t)}else if(!Ve.isUndefined(e)){return n(undefined,e)}}function s(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return i(Qt(e),Qt(t),true)}};Ve.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var a=u[o]||i;var c=a(e[o],t[o],o);Ve.isUndefined(c)&&a!==s||(r[o]=c)}));return r}var tr="1.6.2";var rr={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){rr[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var nr={};rr.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+tr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new ze(i(n," has been removed"+(r?" in "+r:"")),ze.ERR_DEPRECATED)}if(r&&!nr[n]){nr[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function ir(e,t,r){if(typeof e!=="object"){throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var a=t[o];if(a){var s=e[o];var u=s===undefined||a(s,o,e);if(u!==true){throw new ze("option "+o+" must be "+u,ze.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new ze("Unknown option "+o,ze.ERR_BAD_OPTION)}}}var or={assertOptions:ir,validators:rr};var ar=or.validators;var sr=function(){function e(e){this.defaults=e;this.interceptors={request:new ot,response:new ot}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=er(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){or.assertOptions(r,{silentJSONParsing:ar.transitional(ar.boolean),forcedJSONParsing:ar.transitional(ar.boolean),clarifyTimeoutError:ar.transitional(ar.boolean)},false)}if(n!=null){if(Ve.isFunction(n)){t.paramsSerializer={serialize:n}}else{or.assertOptions(n,{encode:ar.function,serialize:ar.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&Ve.merge(i.common,i[t.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=Pt.concat(o,i);var a=[];var s=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}s=s&&r.synchronous;a.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var c;var f=0;var l;if(!s){var p=[$t.bind(this),undefined];p.unshift.apply(p,a);p.push.apply(p,u);l=p.length;c=Promise.resolve(t);while(f<l){c=c.then(p[f++],p[f++])}return c}l=a.length;var d=t;f=0;while(f<l){var h=a[f++];var v=a[f++];try{d=h(d)}catch(e){v.call(this,e);break}}try{c=$t.call(this,d)}catch(e){return Promise.reject(e)}f=0;l=u.length;while(f<l){c=c.then(u[f++],u[f++])}return c};e.prototype.getUri=function(e){e=er(this.defaults,e);var t=kt(e.baseURL,e.url);return it(t,e.params,e.paramsSerializer)};return e}();Ve.forEach(["delete","get","head","options"],(function e(t){sr.prototype[t]=function(e,r){return this.request(er(r||{},{method:t,url:e,data:(r||{}).data}))}}));Ve.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(er(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}sr.prototype[t]=r();sr.prototype[t+"Form"]=r(true)}));var ur=function(){function e(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t=r._listeners.length;while(t-- >0){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n,i,o){if(r.reason){return}r.reason=new Mt(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function cr(e){return function t(r){return e.apply(null,r)}}function fr(e){return Ve.isObject(e)&&e.isAxiosError===true}var lr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lr).forEach((function(e){var t=e[0],r=e[1];lr[r]=t}));function pr(e){var t=new sr(e);var r=q(sr.prototype.request,t);Ve.extend(r,sr.prototype,t,{allOwnKeys:true});Ve.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return pr(er(e,r))};return r}var dr=pr(Tt);dr.Axios=sr;dr.CanceledError=Mt;dr.CancelToken=ur;dr.isCancel=Ut;dr.VERSION=tr;dr.toFormData=Qe;dr.AxiosError=ze;dr.Cancel=dr.CanceledError;dr.all=function e(t){return Promise.all(t)};dr.spread=cr;dr.isAxiosError=fr;dr.mergeConfig=er;dr.AxiosHeaders=Pt;dr.formToJSON=function(e){return Rt(Ve.isHTMLForm(e)?new FormData(e):e)};dr.getAdapter=Xt.getAdapter;dr.HttpStatusCode=lr;dr.default=dr;var hr=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var vr=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return hr()}try{if(!__global__)return hr();return __global__}finally{delete Object.prototype.__global__}}();var Er=Symbol.for("verdocs-default-endpoint");var mr=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var _r=e("V",function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL="https://api.verdocs.com";this.baseURLv2="https://api-v2.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||"https://api.verdocs.com";this.baseURLv2=(e===null||e===void 0?void 0:e.baseURLv2)||"https://api-v2.verdocs.com";this.timeout=(e===null||e===void 0?void 0:e.timeout)||6e4;this.environment=(e===null||e===void 0?void 0:e.environment)||"verdocs";this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||"user";this.clientID=(e===null||e===void 0?void 0:e.clientID)||"not-set";this.api=dr.create({baseURL:this.baseURL,timeout:this.timeout});k(this.api,{retries:0,retryDelay:k.exponentialDelay,onRetry:function(e,t,r){window.console.debug("[JS_SDK] Retrying request (".concat(e,")"),t.message,r.url)}})}e.prototype.setDefault=function(){vr[Er]=this};e.getDefault=function(){if(!vr[Er]){vr[Er]=new e;window.console.debug("[JS_SDK] Created default endpoint",vr[Er])}return vr[Er]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getBaseURLv2=function(){return this.baseURLv2};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.baseURL=e;this.api.defaults.baseURL=e;return this};e.prototype.setBaseURLv2=function(e){this.baseURLv2=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(mr)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var r=t(e);if(r===null||r.exp&&r.exp*1e3<(new Date).getTime()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=r;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="Bearer ".concat(e)}localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.getToken=function(){return this.token};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}())}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-54498887.system.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.d}],execute:function(){var r=this;e({T:void 0,a:void 0});var n;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(n||(n={}));var i;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(i||(i={}));var o=e("c",(function(e,t,r){var n,o;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var s=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var u=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!s){return{canPerform:false,message:"Active session required"}}var c=(r===null||r===void 0?void 0:r.profile_id)===s;var f=(r===null||r===void 0?void 0:r.organization_id)===u;var l=(n=r===null||r===void 0?void 0:r.is_personal)!==null&&n!==void 0?n:false;var p=(o=r===null||r===void 0?void 0:r.is_public)!==null&&o!==void 0?o:false;var d=[];switch(t){case"create_personal":d.push(i.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":d.push(i.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":d.push(i.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!c){if(!l&&f||!p){d.push(i.TEMPLATE_MEMBER_READ)}}break;case"write":if(!c){d.push(i.TEMPLATE_MEMBER_READ);d.push(i.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_ORG)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(c){d.push(i.TEMPLATE_CREATOR_CREATE_PUBLIC);d.push(i.TEMPLATE_CREATOR_VISIBILITY)}else{d.push(i.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(c){d.push(i.TEMPLATE_CREATOR_DELETE)}else{d.push(i.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(a(e,d)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(d.toString())}}));var a=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};var s=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())}))};var u=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var c=e("e",(function(e,t){return e.api.post("/templates",{params:t}).then((function(e){return e.data}))}));var f=e("g",(function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))}));var l=["name","is_personal","is_public","sender","description","roles","fields"];var p=e("b",(function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){var i=new FormData;l.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/v2/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/v2/templates",t,n).then((function(e){return e.data}))}}));var d=e("u",(function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))}));var h=e("d",(function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))}));var v;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(v||(v={}));var E=e("l",(function(e,t){if(t===void 0){t={}}return s(void 0,void 0,void 0,(function(){return u(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))}));var m;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(m||(m=e("T",{})));var _;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(_||(_=e("a",{})));var R;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(R||(R={}));var y;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(y||(y={}));var T;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(T||(T={}));var g;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(g||(g={}));var b=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var A=function(e){return!b.has(e&&e.code)};var O="axios-retry";function w(e){var t=["ERR_CANCELED","ECONNABORTED"];if(e.response){return false}if(!e.code){return false}if(t.includes(e.code)){return false}return A(e)}var S=["get","head","options"];var L=S.concat(["put","delete"]);function C(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function N(e){var t;if(!((t=e.config)===null||t===void 0?void 0:t.method)){return false}return C(e)&&S.indexOf(e.config.method)!==-1}function I(e){var t;if(!((t=e.config)===null||t===void 0?void 0:t.method)){return false}return C(e)&&L.indexOf(e.config.method)!==-1}function P(e){return w(e)||I(e)}function D(){return 0}function U(e,t,r){if(e===void 0){e=0}if(t===void 0){t=undefined}if(r===void 0){r=100}var n=Math.pow(2,e)*r;var i=n*.2*Math.random();return n+i}var M={retries:3,retryCondition:P,retryDelay:D,shouldResetTimeout:false,onRetry:function(){}};function B(e,t){return __assign(__assign(__assign({},M),t),e[O])}function j(e,t){var r=B(e,t||{});r.retryCount=r.retryCount||0;r.lastRequestTime=r.lastRequestTime||Date.now();e[O]=r;return r}function x(e,t){if(e.defaults.agent===t.agent){delete t.agent}if(e.defaults.httpAgent===t.httpAgent){delete t.httpAgent}if(e.defaults.httpsAgent===t.httpsAgent){delete t.httpsAgent}}function F(e,t){return s(this,void 0,void 0,(function(){var r,n,i,o,a;return u(this,(function(s){switch(s.label){case 0:r=e.retries,n=e.retryCondition;i=(e.retryCount||0)<r&&n(t);if(!(typeof i==="object"))return[3,4];s.label=1;case 1:s.trys.push([1,3,,4]);return[4,i];case 2:o=s.sent();return[2,o!==false];case 3:a=s.sent();return[2,false];case 4:return[2,i]}}))}))}var k=function(e,t){var n=e.interceptors.request.use((function(e){j(e,t);return e}));var i=e.interceptors.response.use(null,(function(n){return s(r,void 0,void 0,(function(){var r,i,o,a,s,c,f,l;return u(this,(function(u){switch(u.label){case 0:r=n.config;if(!r){return[2,Promise.reject(n)]}i=j(r,t);return[4,F(i,n)];case 1:if(!u.sent())return[3,3];i.retryCount+=1;o=i.retryDelay,a=i.shouldResetTimeout,s=i.onRetry;c=o(i.retryCount,n);x(e,r);if(!a&&r.timeout&&i.lastRequestTime){f=Date.now()-i.lastRequestTime;l=r.timeout-f-c;if(l<=0){return[2,Promise.reject(n)]}r.timeout=l}r.transformRequest=[function(e){return e}];return[4,s(i.retryCount,n,r)];case 2:u.sent();return[2,new Promise((function(t){setTimeout((function(){return t(e(r))}),c)}))];case 3:return[2,Promise.reject(n)]}}))}))}));return{requestInterceptorId:n,responseInterceptorId:i}};k.isNetworkError=w;k.isSafeRequestError=N;k.isIdempotentRequestError=I;k.isNetworkOrIdempotentRequestError=P;k.exponentialDelay=U;k.isRetryableError=C;function q(e,t){return function r(){return e.apply(t,arguments)}}var G=Object.prototype.toString;var V=Object.getPrototypeOf;var z=function(e){return function(t){var r=G.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));var H=function(e){e=e.toLowerCase();return function(t){return z(t)===e}};var J=function(e){return function(t){return typeof t===e}};var K=Array.isArray;var W=J("undefined");function Y(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&Q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var X=H("ArrayBuffer");function Z(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&X(e.buffer)}return t}var $=J("string");var Q=J("function");var ee=J("number");var te=function(e){return e!==null&&typeof e==="object"};var re=function(e){return e===true||e===false};var ne=function(e){if(z(e)!=="object"){return false}var t=V(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var ie=H("Date");var oe=H("File");var ae=H("Blob");var se=H("FileList");var ue=function(e){return te(e)&&Q(e.pipe)};var ce=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||Q(e.append)&&((t=z(e))==="formdata"||t==="object"&&Q(e.toString)&&e.toString()==="[object FormData]"))};var fe=H("URLSearchParams");var le=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function pe(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var a;var s;if(typeof e!=="object"){e=[e]}if(K(e)){for(a=0,s=e.length;a<s;a++){t.call(null,e[a],a,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var c=u.length;var f=void 0;for(a=0;a<c;a++){f=u[a];t.call(null,e[f],f,e)}}}function de(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var he=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var ve=function(e){return!W(e)&&e!==he};function Ee(){var e=(ve(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&de(t,n)||n;if(ne(t[i])&&ne(r)){t[i]=Ee(t[i],r)}else if(ne(r)){t[i]=Ee({},r)}else if(K(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&pe(arguments[n],r)}return t}var me=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;pe(t,(function(t,n){if(r&&Q(t)){e[n]=q(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var _e=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var Re=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var ye=function(e,t,r,n){var i;var o;var a;var s={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){a=i[o];if((!n||n(a,e,t))&&!s[a]){t[a]=e[a];s[a]=true}}e=r!==false&&V(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var Te=function(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r};var ge=function(e){if(!e)return null;if(K(e))return e;var t=e.length;if(!ee(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r};var be=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&V(Uint8Array));var Ae=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var Oe=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var we=H("HTMLFormElement");var Se=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var Le=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var Ce=H("RegExp");var Ne=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};pe(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var Ie=function(e){Ne(e,(function(t,r){if(Q(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!Q(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var Pe=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};K(e)?n(e):n(String(e).split(t));return r};var De=function(){};var Ue=function(e,t){e=+e;return Number.isFinite(e)?e:t};var Me="abcdefghijklmnopqrstuvwxyz";var Be="0123456789";var je={DIGIT:Be,ALPHA:Me,ALPHA_DIGIT:Me+Me.toUpperCase()+Be};var xe=function(e,t){if(e===void 0){e=16}if(t===void 0){t=je.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function Fe(e){return!!(e&&Q(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var ke=function(e){var t=new Array(10);var r=function(e,n){if(te(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=K(e)?[]:{};pe(e,(function(e,t){var o=r(e,n+1);!W(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var qe=H("AsyncFunction");var Ge=function(e){return e&&(te(e)||Q(e))&&Q(e.then)&&Q(e.catch)};var Ve={isArray:K,isArrayBuffer:X,isBuffer:Y,isFormData:ce,isArrayBufferView:Z,isString:$,isNumber:ee,isBoolean:re,isObject:te,isPlainObject:ne,isUndefined:W,isDate:ie,isFile:oe,isBlob:ae,isRegExp:Ce,isFunction:Q,isStream:ue,isURLSearchParams:fe,isTypedArray:be,isFileList:se,forEach:pe,merge:Ee,extend:me,trim:le,stripBOM:_e,inherits:Re,toFlatObject:ye,kindOf:z,kindOfTest:H,endsWith:Te,toArray:ge,forEachEntry:Ae,matchAll:Oe,isHTMLForm:we,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:Ne,freezeMethods:Ie,toObjectSet:Pe,toCamelCase:Se,noop:De,toFiniteNumber:Ue,findKey:de,global:he,isContextDefined:ve,ALPHABET:je,generateString:xe,isSpecCompliantForm:Fe,toJSONObject:ke,isAsyncFn:qe,isThenable:Ge};function ze(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}Ve.inherits(ze,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ve.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var He=ze.prototype;var Je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){Je[e]={value:e}}));Object.defineProperties(ze,Je);Object.defineProperty(He,"isAxiosError",{value:true});ze.from=function(e,t,r,n,i,o){var a=Object.create(He);Ve.toFlatObject(e,a,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));ze.call(a,e.message,t,r,n,i);a.cause=e;a.name=e.name;o&&Object.assign(a,o);return a};var Ke=null;function We(e){return Ve.isPlainObject(e)||Ve.isArray(e)}function Ye(e){return Ve.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=Ye(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function Ze(e){return Ve.isArray(e)&&!e.some(We)}var $e=Ve.toFlatObject(Ve,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function Qe(e,t,r){if(!Ve.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=Ve.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!Ve.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||f;var o=r.dots;var a=r.indexes;var s=r.Blob||typeof Blob!=="undefined"&&Blob;var u=s&&Ve.isSpecCompliantForm(t);if(!Ve.isFunction(i)){throw new TypeError("visitor must be a function")}function c(e){if(e===null)return"";if(Ve.isDate(e)){return e.toISOString()}if(!u&&Ve.isBlob(e)){throw new ze("Blob is not supported. Use a Buffer instead.")}if(Ve.isArrayBuffer(e)||Ve.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function f(e,r,i){var s=e;if(e&&!i&&typeof e==="object"){if(Ve.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(Ve.isArray(e)&&Ze(e)||(Ve.isFileList(e)||Ve.endsWith(r,"[]"))&&(s=Ve.toArray(e))){r=Ye(r);s.forEach((function e(n,i){!(Ve.isUndefined(n)||n===null)&&t.append(a===true?Xe([r],i,o):a===null?r:r+"[]",c(n))}));return false}}if(We(e)){return true}t.append(Xe(i,r,o),c(e));return false}var l=[];var p=Object.assign($e,{defaultVisitor:f,convertValue:c,isVisitable:We});function d(e,r){if(Ve.isUndefined(e))return;if(l.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}l.push(e);Ve.forEach(e,(function e(n,o){var a=!(Ve.isUndefined(n)||n===null)&&i.call(t,n,Ve.isString(o)?o.trim():o,r,p);if(a===true){d(n,r?r.concat(o):[o])}}));l.pop()}if(!Ve.isObject(e)){throw new TypeError("data must be an object")}d(e);return t}function et(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function tt(e,t){this._pairs=[];e&&Qe(e,this,t)}var rt=tt.prototype;rt.append=function e(t,r){this._pairs.push([t,r])};rt.toString=function e(t){var r=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function it(e,t,r){if(!t){return e}var n=r&&r.encode||nt;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=Ve.isURLSearchParams(t)?t.toString():new tt(t,r).toString(n)}if(o){var a=e.indexOf("#");if(a!==-1){e=e.slice(0,a)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var ot=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){Ve.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var at={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var st=typeof URLSearchParams!=="undefined"?URLSearchParams:tt;var ut=typeof FormData!=="undefined"?FormData:null;var ct=typeof Blob!=="undefined"?Blob:null;var ft={isBrowser:true,classes:{URLSearchParams:st,FormData:ut,Blob:ct},protocols:["http","https","file","blob","url","data"]};var lt=typeof window!=="undefined"&&typeof document!=="undefined";var pt=function(e){return lt&&["ReactNative","NativeScript","NS"].indexOf(e)<0}(typeof navigator!=="undefined"&&navigator.product);var dt=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var ht=Object.freeze({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserWebWorkerEnv:dt,hasStandardBrowserEnv:pt});var vt=__assign(__assign({},ht),ft);function Et(e,t){return Qe(e,new vt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){if(vt.isNode&&Ve.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)}},t))}function mt(e){return Ve.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function _t(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function Rt(e){function t(e,r,n,i){var o=e[i++];var a=Number.isFinite(+o);var s=i>=e.length;o=!o&&Ve.isArray(n)?n.length:o;if(s){if(Ve.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!a}if(!n[o]||!Ve.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&Ve.isArray(n[o])){n[o]=_t(n[o])}return!a}if(Ve.isFormData(e)&&Ve.isFunction(e.entries)){var r={};Ve.forEachEntry(e,(function(e,n){t(mt(e),n,r,0)}));return r}return null}function yt(e,t,r){if(Ve.isString(e)){try{(t||JSON.parse)(e);return Ve.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var Tt={transitional:at,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=Ve.isObject(t);if(o&&Ve.isHTMLForm(t)){t=new FormData(t)}var a=Ve.isFormData(t);if(a){if(!i){return t}return i?JSON.stringify(Rt(t)):t}if(Ve.isArrayBuffer(t)||Ve.isBuffer(t)||Ve.isStream(t)||Ve.isFile(t)||Ve.isBlob(t)){return t}if(Ve.isArrayBufferView(t)){return t.buffer}if(Ve.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Et(t,this.formSerializer).toString()}if((s=Ve.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return Qe(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return yt(t)}return t}],transformResponse:[function e(t){var r=this.transitional||Tt.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&Ve.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var a=!o&&i;try{return JSON.parse(t)}catch(e){if(a){if(e.name==="SyntaxError"){throw ze.from(e,ze.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};Ve.forEach(["delete","get","head","post","put","patch"],(function(e){Tt.headers[e]={}}));var gt=Ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var bt=function(e){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&gt[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var At=Symbol("internals");function Ot(e){return e&&String(e).trim().toLowerCase()}function wt(e){if(e===false||e==null){return e}return Ve.isArray(e)?e.map(wt):String(e)}function St(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var Lt=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function Ct(e,t,r,n,i){if(Ve.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Ve.isString(t))return;if(Ve.isString(n)){return t.indexOf(n)!==-1}if(Ve.isRegExp(n)){return n.test(t)}}function Nt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function It(e,t){var r=Ve.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var Pt=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=Ot(t);if(!i){throw new Error("header name must be a non-empty string")}var o=Ve.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=wt(e)}}var o=function(e,t){return Ve.forEach(e,(function(e,r){return i(e,r,t)}))};if(Ve.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(Ve.isString(e)&&(e=e.trim())&&!Lt(e)){o(bt(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=Ot(e);if(e){var r=Ve.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return St(n)}if(Ve.isFunction(t)){return t.call(this,n,r)}if(Ve.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=Ot(e);if(e){var r=Ve.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||Ct(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=Ot(e);if(e){var i=Ve.findKey(r,e);if(i&&(!t||Ct(r,r[i],i,t))){delete r[i];n=true}}}if(Ve.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||Ct(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};Ve.forEach(this,(function(n,i){var o=Ve.findKey(r,i);if(o){t[o]=wt(n);delete t[i];return}var a=e?Nt(i):String(i).trim();if(a!==i){delete t[i]}t[a]=wt(n);r[a]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);Ve.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&Ve.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[At]=this[At]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=Ot(e);if(!r[t]){It(n,e);r[t]=true}}Ve.isArray(e)?e.forEach(i):i(e);return this};return e}();Pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ve.reduceDescriptors(Pt.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));Ve.freezeMethods(Pt);function Dt(e,t){var r=this||Tt;var n=t||r;var i=Pt.from(n.headers);var o=n.data;Ve.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function Ut(e){return!!(e&&e.__CANCEL__)}function Mt(e,t,r){ze.call(this,e==null?"canceled":e,ze.ERR_CANCELED,t,r);this.name="CanceledError"}Ve.inherits(Mt,ze,{__CANCEL__:true});function Bt(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new ze("Request failed with status code "+r.status,[ze.ERR_BAD_REQUEST,ze.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var jt=vt.hasStandardBrowserEnv?{write:function(e,t,r,n,i,o){var a=[e+"="+encodeURIComponent(t)];Ve.isNumber(r)&&a.push("expires="+new Date(r).toGMTString());Ve.isString(n)&&a.push("path="+n);Ve.isString(i)&&a.push("domain="+i);o===true&&a.push("secure");document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function xt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ft(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function kt(e,t){if(e&&!xt(t)){return Ft(e,t)}return t}var qt=vt.hasStandardBrowserEnv?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=Ve.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function Gt(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vt(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var a;t=t!==undefined?t:1e3;return function s(u){var c=Date.now();var f=n[o];if(!a){a=c}r[i]=u;n[i]=c;var l=o;var p=0;while(l!==i){p+=r[l++];l=l%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(c-a<t){return}var d=f&&c-f;return d?Math.round(p*1e3/d):undefined}}function zt(e,t){var r=0;var n=Vt(50,250);return function(i){var o=i.loaded;var a=i.lengthComputable?i.total:undefined;var s=o-r;var u=n(s);var c=o<=a;r=o;var f={loaded:o,total:a,progress:a?o/a:undefined,bytes:s,rate:u?u:undefined,estimated:u&&a&&c?(a-o)/u:undefined,event:i};f[t?"download":"upload"]=true;e(f)}}var Ht=typeof XMLHttpRequest!=="undefined";var Jt=Ht&&function(e){return new Promise((function t(r,n){var i=e.data;var o=Pt.from(e.headers).normalize();var a=e.responseType,s=e.withXSRFToken;var u;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(u)}if(e.signal){e.signal.removeEventListener("abort",u)}}var f;if(Ve.isFormData(i)){if(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv){o.setContentType(false)}else if((f=o.getContentType())!==false){var l=f?f.split(";").map((function(e){return e.trim()})).filter(Boolean):[],p=l[0],d=l.slice(1);o.setContentType(__spreadArray([p||"multipart/form-data"],d,true).join("; "))}}var h=new XMLHttpRequest;if(e.auth){var v=e.auth.username||"";var E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+E))}var m=kt(e.baseURL,e.url);h.open(e.method.toUpperCase(),it(m,e.params,e.paramsSerializer),true);h.timeout=e.timeout;function _(){if(!h){return}var t=Pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());var i=!a||a==="text"||a==="json"?h.responseText:h.response;var o={data:i,status:h.status,statusText:h.statusText,headers:t,config:e,request:h};Bt((function e(t){r(t);c()}),(function e(t){n(t);c()}),o);h=null}if("onloadend"in h){h.onloadend=_}else{h.onreadystatechange=function e(){if(!h||h.readyState!==4){return}if(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)){return}setTimeout(_)}}h.onabort=function t(){if(!h){return}n(new ze("Request aborted",ze.ECONNABORTED,e,h));h=null};h.onerror=function t(){n(new ze("Network Error",ze.ERR_NETWORK,e,h));h=null};h.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||at;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new ze(r,i.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,h));h=null};if(vt.hasStandardBrowserEnv){s&&Ve.isFunction(s)&&(s=s(e));if(s||s!==false&&qt(m)){var R=e.xsrfHeaderName&&e.xsrfCookieName&&jt.read(e.xsrfCookieName);if(R){o.set(e.xsrfHeaderName,R)}}}i===undefined&&o.setContentType(null);if("setRequestHeader"in h){Ve.forEach(o.toJSON(),(function e(t,r){h.setRequestHeader(r,t)}))}if(!Ve.isUndefined(e.withCredentials)){h.withCredentials=!!e.withCredentials}if(a&&a!=="json"){h.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){h.addEventListener("progress",zt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&h.upload){h.upload.addEventListener("progress",zt(e.onUploadProgress))}if(e.cancelToken||e.signal){u=function(t){if(!h){return}n(!t||t.type?new Mt(null,e,h):t);h.abort();h=null};e.cancelToken&&e.cancelToken.subscribe(u);if(e.signal){e.signal.aborted?u():e.signal.addEventListener("abort",u)}}var y=Gt(m);if(y&&vt.protocols.indexOf(y)===-1){n(new ze("Unsupported protocol "+y+":",ze.ERR_BAD_REQUEST,e));return}h.send(i||null)}))};var Kt={http:Ke,xhr:Jt};Ve.forEach(Kt,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Wt=function(e){return"- ".concat(e)};var Yt=function(e){return Ve.isFunction(e)||e===null||e===false};var Xt={getAdapter:function(e){e=Ve.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var a=void 0;n=r;if(!Yt(r)){n=Kt[(a=String(r)).toLowerCase()];if(n===undefined){throw new ze("Unknown adapter '".concat(a,"'"))}}if(n){break}i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?s.length>1?"since :\n"+s.map(Wt).join("\n"):" "+Wt(s[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:Kt};function Zt(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new Mt(null,e)}}function $t(e){Zt(e);e.headers=Pt.from(e.headers);e.data=Dt.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=Xt.getAdapter(e.adapter||Tt.adapter);return t(e).then((function t(r){Zt(e);r.data=Dt.call(e,e.transformResponse,r);r.headers=Pt.from(r.headers);return r}),(function t(r){if(!Ut(r)){Zt(e);if(r&&r.response){r.response.data=Dt.call(e,e.transformResponse,r.response);r.response.headers=Pt.from(r.response.headers)}}return Promise.reject(r)}))}var Qt=function(e){return e instanceof Pt?e.toJSON():e};function er(e,t){t=t||{};var r={};function n(e,t,r){if(Ve.isPlainObject(e)&&Ve.isPlainObject(t)){return Ve.merge.call({caseless:r},e,t)}else if(Ve.isPlainObject(t)){return Ve.merge({},t)}else if(Ve.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!Ve.isUndefined(t)){return n(e,t,r)}else if(!Ve.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!Ve.isUndefined(t)){return n(undefined,t)}}function a(e,t){if(!Ve.isUndefined(t)){return n(undefined,t)}else if(!Ve.isUndefined(e)){return n(undefined,e)}}function s(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return i(Qt(e),Qt(t),true)}};Ve.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var a=u[o]||i;var c=a(e[o],t[o],o);Ve.isUndefined(c)&&a!==s||(r[o]=c)}));return r}var tr="1.6.2";var rr={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){rr[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var nr={};rr.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+tr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new ze(i(n," has been removed"+(r?" in "+r:"")),ze.ERR_DEPRECATED)}if(r&&!nr[n]){nr[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function ir(e,t,r){if(typeof e!=="object"){throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var a=t[o];if(a){var s=e[o];var u=s===undefined||a(s,o,e);if(u!==true){throw new ze("option "+o+" must be "+u,ze.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new ze("Unknown option "+o,ze.ERR_BAD_OPTION)}}}var or={assertOptions:ir,validators:rr};var ar=or.validators;var sr=function(){function e(e){this.defaults=e;this.interceptors={request:new ot,response:new ot}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=er(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){or.assertOptions(r,{silentJSONParsing:ar.transitional(ar.boolean),forcedJSONParsing:ar.transitional(ar.boolean),clarifyTimeoutError:ar.transitional(ar.boolean)},false)}if(n!=null){if(Ve.isFunction(n)){t.paramsSerializer={serialize:n}}else{or.assertOptions(n,{encode:ar.function,serialize:ar.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&Ve.merge(i.common,i[t.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=Pt.concat(o,i);var a=[];var s=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}s=s&&r.synchronous;a.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var c;var f=0;var l;if(!s){var p=[$t.bind(this),undefined];p.unshift.apply(p,a);p.push.apply(p,u);l=p.length;c=Promise.resolve(t);while(f<l){c=c.then(p[f++],p[f++])}return c}l=a.length;var d=t;f=0;while(f<l){var h=a[f++];var v=a[f++];try{d=h(d)}catch(e){v.call(this,e);break}}try{c=$t.call(this,d)}catch(e){return Promise.reject(e)}f=0;l=u.length;while(f<l){c=c.then(u[f++],u[f++])}return c};e.prototype.getUri=function(e){e=er(this.defaults,e);var t=kt(e.baseURL,e.url);return it(t,e.params,e.paramsSerializer)};return e}();Ve.forEach(["delete","get","head","options"],(function e(t){sr.prototype[t]=function(e,r){return this.request(er(r||{},{method:t,url:e,data:(r||{}).data}))}}));Ve.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(er(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}sr.prototype[t]=r();sr.prototype[t+"Form"]=r(true)}));var ur=function(){function e(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t=r._listeners.length;while(t-- >0){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n,i,o){if(r.reason){return}r.reason=new Mt(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function cr(e){return function t(r){return e.apply(null,r)}}function fr(e){return Ve.isObject(e)&&e.isAxiosError===true}var lr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lr).forEach((function(e){var t=e[0],r=e[1];lr[r]=t}));function pr(e){var t=new sr(e);var r=q(sr.prototype.request,t);Ve.extend(r,sr.prototype,t,{allOwnKeys:true});Ve.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return pr(er(e,r))};return r}var dr=pr(Tt);dr.Axios=sr;dr.CanceledError=Mt;dr.CancelToken=ur;dr.isCancel=Ut;dr.VERSION=tr;dr.toFormData=Qe;dr.AxiosError=ze;dr.Cancel=dr.CanceledError;dr.all=function e(t){return Promise.all(t)};dr.spread=cr;dr.isAxiosError=fr;dr.mergeConfig=er;dr.AxiosHeaders=Pt;dr.formToJSON=function(e){return Rt(Ve.isHTMLForm(e)?new FormData(e):e)};dr.getAdapter=Xt.getAdapter;dr.HttpStatusCode=lr;dr.default=dr;var hr=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var vr=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return hr()}try{if(!__global__)return hr();return __global__}finally{delete Object.prototype.__global__}}();var Er=Symbol.for("verdocs-default-endpoint");var mr=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var _r=e("V",function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL=window.location.origin==="https://beta.verdocs.com"?"https://stage-api.verdocs.com":"https://api.verdocs.com";this.baseURLv2="https://api-v2.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||"https://api.verdocs.com";this.baseURLv2=(e===null||e===void 0?void 0:e.baseURLv2)||"https://api-v2.verdocs.com";this.timeout=(e===null||e===void 0?void 0:e.timeout)||6e4;this.environment=(e===null||e===void 0?void 0:e.environment)||"verdocs";this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||"user";this.clientID=(e===null||e===void 0?void 0:e.clientID)||"not-set";this.api=dr.create({baseURL:this.baseURL,timeout:this.timeout});k(this.api,{retries:0,retryDelay:k.exponentialDelay,onRetry:function(e,t,r){window.console.debug("[JS_SDK] Retrying request (".concat(e,")"),t.message,r.url)}})}e.prototype.setDefault=function(){vr[Er]=this};e.getDefault=function(){if(!vr[Er]){vr[Er]=new e;window.console.debug("[JS_SDK] Created default endpoint",vr[Er])}return vr[Er]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getBaseURLv2=function(){return this.baseURLv2};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.baseURL=e;this.api.defaults.baseURL=e;return this};e.prototype.setBaseURLv2=function(e){this.baseURLv2=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(mr)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var r=t(e);if(r===null||r.exp&&r.exp*1e3<(new Date).getTime()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=r;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="Bearer ".concat(e)}localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.getToken=function(){return this.token};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}())}}}));