@verdocs/web-sdk 2.3.62 → 2.3.64
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.
- package/dist/cjs/{TemplateFieldStore-43a0b60d.js → TemplateFieldStore-3d25fc86.js} +11 -10
- package/dist/cjs/{TemplateStore-ccf29182.js → TemplateStore-89072ea0.js} +1 -1
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-31385d19.js → utils-7cc3fe3c.js} +76 -3
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/{verdocs-portal_2.cjs.entry.js → verdocs-checkbox_5.cjs.entry.js} +57 -11
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -2
- package/dist/cjs/{verdocs-field-date.cjs.entry.js → verdocs-field-attachment_15.cjs.entry.js} +1520 -6
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +3 -4
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-sign.cjs.entry.js +9 -12
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +26 -19
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -9
- package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +19 -0
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js +19 -0
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +19 -0
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +19 -0
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +19 -0
- package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js +19 -0
- package/dist/collection/components/fields/verdocs-field-radio-button-group/verdocs-field-radio-button.js +19 -0
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +19 -0
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +19 -0
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +1 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +27 -6
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +19 -0
- package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +95 -6
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +5 -9
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +24 -16
- package/dist/collection/utils/TemplateFieldStore.js +11 -10
- package/dist/collection/utils/utils.js +23 -4
- package/dist/components/TemplateFieldStore.js +11 -10
- package/dist/components/ipc-test.js +120 -30
- package/dist/components/utils.js +28 -1
- package/dist/components/verdocs-build.js +144 -60
- package/dist/components/verdocs-field-attachment.js +1 -168
- package/dist/{esm/verdocs-field-attachment.entry.js → components/verdocs-field-attachment2.js} +96 -19
- package/dist/components/verdocs-field-checkbox.js +1 -148
- package/dist/{esm/verdocs-field-checkbox.entry.js → components/verdocs-field-checkbox2.js} +90 -19
- package/dist/components/verdocs-field-date.js +1 -204
- package/dist/{esm/verdocs-field-date.entry.js → components/verdocs-field-date2.js} +97 -21
- package/dist/components/verdocs-field-dropdown.js +1 -154
- package/dist/{esm/verdocs-field-dropdown.entry.js → components/verdocs-field-dropdown2.js} +90 -19
- package/dist/components/verdocs-field-initial.js +1 -184
- package/dist/{esm/verdocs-field-initial.entry.js → components/verdocs-field-initial2.js} +98 -19
- package/dist/components/verdocs-field-payment.js +2 -0
- package/dist/components/verdocs-field-radio-button.js +1 -152
- package/dist/{esm/verdocs-field-radio-button.entry.js → components/verdocs-field-radio-button2.js} +90 -19
- package/dist/components/verdocs-field-signature.js +1 -183
- package/dist/{esm/verdocs-field-signature.entry.js → components/verdocs-field-signature2.js} +98 -19
- package/dist/components/verdocs-field-textarea.js +1 -206
- package/dist/{esm/verdocs-field-textarea.entry.js → components/verdocs-field-textarea2.js} +95 -23
- package/dist/components/verdocs-field-textbox.js +1 -208
- package/dist/{esm/verdocs-field-textbox.entry.js → components/verdocs-field-textbox2.js} +104 -30
- package/dist/components/verdocs-field-timestamp.js +1 -157
- package/dist/{esm/verdocs-field-timestamp.entry.js → components/verdocs-field-timestamp2.js} +92 -19
- package/dist/components/verdocs-preview2.js +130 -4
- package/dist/components/verdocs-sign.js +7 -9
- package/dist/components/verdocs-template-document-page2.js +188 -7
- package/dist/components/verdocs-template-field-properties2.js +31 -11
- package/dist/components/verdocs-template-fields2.js +146 -31
- package/dist/docs.json +671 -15
- package/dist/esm/{TemplateFieldStore-211c1ed4.js → TemplateFieldStore-6e67e86b.js} +11 -10
- package/dist/esm/{TemplateStore-f752d353.js → TemplateStore-7fba801e.js} +1 -1
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-86fc7318.js → utils-36f1bbdd.js} +71 -2
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/{verdocs-portal_2.entry.js → verdocs-checkbox_5.entry.js} +56 -13
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -2
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -2
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -2
- package/dist/esm/verdocs-field-attachment_15.entry.js +1632 -0
- package/dist/esm/verdocs-field-payment.entry.js +3 -3
- package/dist/esm/verdocs-pagination_2.entry.js +1 -2
- package/dist/esm/verdocs-preview_8.entry.js +3 -4
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -2
- package/dist/esm/verdocs-sign.entry.js +9 -12
- package/dist/esm/verdocs-template-fields_4.entry.js +26 -19
- package/dist/esm/verdocs-view.entry.js +1 -2
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{TemplateFieldStore-211c1ed4.js → TemplateFieldStore-6e67e86b.js} +1 -1
- package/dist/esm-es5/{TemplateStore-f752d353.js → TemplateStore-7fba801e.js} +1 -1
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-86fc7318.js → utils-36f1bbdd.js} +2 -2
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -0
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -0
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-payment/verdocs-field-payment.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-radio-button-group/verdocs-field-radio-button.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-textarea/verdocs-field-textarea.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +4 -0
- package/dist/types/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.d.ts +4 -0
- package/dist/types/components/templates/verdocs-template-document-page/verdocs-template-document-page.d.ts +12 -0
- package/dist/types/components.d.ts +104 -0
- package/dist/types/utils/TemplateFieldStore.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +9 -1
- package/dist/verdocs-web-sdk/p-00e8cfa6.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-04ac4336.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-08b5e01b.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-116f7900.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-26646a40.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-2a16963c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-358ce165.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3995b09b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3c59911b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3efa7c26.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-01d02174.js → p-47c63cc7.js} +1 -1
- package/dist/verdocs-web-sdk/p-500dce36.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-7c40ab4b.system.entry.js → p-5050f8a2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e10bd7a0.entry.js → p-508808d2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5c306718.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6b6330f2.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4b8a5a4e.system.entry.js → p-72f22ee9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-80e69a68.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-83597b2e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8d9a749d.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9054234f.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-f69790c5.system.js → p-95080569.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-aecd8680.entry.js → p-9d4a5fd8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a16eba51.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-f0dd9355.js → p-a3d7cdda.js} +2 -2
- package/dist/verdocs-web-sdk/{p-90a1755f.system.js → p-cacffa79.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-79965a5a.system.js → p-cff87d52.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-d1092a62.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d7f90328.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-db5de7e8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e311d75f.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ea96b41e.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ef20cb50.js +1 -0
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/p-f2a169d8.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Files-4bdc0c0f.js +0 -47
- package/dist/cjs/verdocs-checkbox_3.cjs.entry.js +0 -56
- package/dist/cjs/verdocs-field-attachment.cjs.entry.js +0 -99
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +0 -85
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +0 -91
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +0 -113
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +0 -89
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +0 -112
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +0 -141
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +0 -143
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +0 -92
- package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +0 -227
- package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +0 -227
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +0 -150
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +0 -82
- package/dist/components/Fields.js +0 -26
- package/dist/custom-elements.json +0 -2091
- package/dist/esm/Files-70a192df.js +0 -44
- package/dist/esm/verdocs-checkbox_3.entry.js +0 -50
- package/dist/esm/verdocs-initial-dialog.entry.js +0 -223
- package/dist/esm/verdocs-signature-dialog.entry.js +0 -223
- package/dist/esm/verdocs-template-document-page_2.entry.js +0 -145
- package/dist/esm/verdocs-upload-dialog.entry.js +0 -78
- package/dist/esm-es5/Files-70a192df.js +0 -1
- package/dist/esm-es5/verdocs-checkbox_3.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-attachment.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +0 -1
- package/dist/esm-es5/verdocs-initial-dialog.entry.js +0 -1
- package/dist/esm-es5/verdocs-portal_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-signature-dialog.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0edfbbb9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0fd03f17.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-16cc9e91.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-1b9f1492.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-202a5368.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-20986706.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-22275b64.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2407c719.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2bb8b0c0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-30265ae4.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-32076544.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-327858f0.system.js +0 -1
- package/dist/verdocs-web-sdk/p-34832c03.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4157afe4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-43a78ea1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4b740499.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-50a552a9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-521a3fec.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-522f19d0.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6190eb2d.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-66b9d77e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6a5fbeb0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6bae71c2.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6eb2ce21.js +0 -1
- package/dist/verdocs-web-sdk/p-712e8341.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-77898b84.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7cb3209d.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-83a1476c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8bf9acf4.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9365abef.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-946903f3.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-98f91a5e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a1ccd671.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a5f450a1.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a6048cc9.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a604c1ad.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a9934632.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-aa124212.js +0 -1
- package/dist/verdocs-web-sdk/p-b3c78f12.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ba87f33c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-bb2006de.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c9716926.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cb316fe0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cee12c63.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d3942875.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e27ec758.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e2a8ce1d.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e98e76f5.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ecc85500.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ef1f4d49.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f23af885.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f55038fc.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f63a8d6d.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f68c15fb.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f8f703bb.system.entry.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as i,H as s}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as o,b as l,u as a}from"./p-035f6b38.js";import{g as n}from"./p-ef20cb50.js";import{g as r,b as d,a as c}from"./p-b086f9be.js";import{g as h}from"./p-47c63cc7.js";import{r as p}from"./p-a3d7cdda.js";import{S as m}from"./p-7a1b2643.js";import{j as v}from"./p-dc2ad047.js";import{a as u,i as x}from"./p-e8ce0b6f.js";import{g as f}from"./p-6de76553.js";import{c as b,d as g}from"./p-567a6e7c.js";import{D as y,P as w,J as k,a as S,F as E,b as z,T as C}from"./p-029ae656.js";import{V as T}from"./p-ed416acf.js";import"./p-7648c449.js";import"./p-eab67c09.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const I=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=o.getDefault(),this.templateId=null,this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[PREVIEW] Unable to start builder session, must be authenticated");h(this.endpoint,this.templateId,!0).then((e=>{var t,i;this.templateStore=e,console.log("[PREVIEW] Loaded Template Store",e.state),this.fieldStore=n(this.templateId),this.roleStore=r(this.templateId),console.log("RS",null===(t=this.roleStore)||void 0===t?void 0:t.state),console.log("FS",null===(i=this.fieldStore)||void 0===i?void 0:i.state),console.log("[PREVIEW] Loaded template",this.templateStore.state,this.roleStore.get("roles"),this.fieldStore.get("fields")),this.loading=!1})).catch((e=>{console.log(e)}))}catch(s){console.log("[PREVIEW] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new m(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handlePageRendered(e){var t,i;const s=e.detail,o=null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.fields.filter((e=>e.page_sequence===s.pageNumber));console.log("[PREVIEW] Page rendered",s,o),o.forEach((e=>p(e,s,{disabled:!0,editable:!1,draggable:!1})))}render(){var e,t;if(this.loading)return i(s,null,i("verdocs-loader",null));const o=[...null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.pages];return o.sort(((e,t)=>e.sequence-t.sequence)),i(s,null,o.map((e=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}};I.style='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';const L='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>',R=class{constructor(i){e(this,i),this.send=t(this,"send",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.searchContacts=t(this,"searchContacts",7),this.levels=[],this.templateStore=null,this.roleStore=null,this.endpoint=o.getDefault(),this.templateId=null,this.environment="web",this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.rolesAtLevel={},this.showPickerForId="",this.sessionContacts=[],this.sending=!1,this.rolesCompleted={}}async reset(){this.rolesCompleted={}}async componentWillLoad(){var e,t,i,s,o,l;try{const s=this.endpoint.loadSession();if(!this.templateId)return void console.log(`[SEND] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SEND] Unable to start builder session, must be authenticated");if(this.templateStore=await h(this.endpoint,this.templateId,!1),this.roleStore=r(this.templateId),(null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable)||console.warn("[SEND] Template is not sendable",this.templateId),this.roleStore.get("roles")){const e={};this.rolesCompleted={},this.roleStore.get("roles").forEach((t=>{const i=t.sequence-1;e[i]||(e[i]=[]);const s=`r-${i}-${e[i].length}`;e[i].push({...t,id:s}),t.full_name&&(t.email||t.phone)&&(this.rolesCompleted[s]={...t,id:s})})),this.rolesAtLevel=e,this.levels=Object.keys(e).map((e=>+e)),this.levels.sort(((e,t)=>e-t))}(null===(i=null==s?void 0:s.session)||void 0===i?void 0:i.profile)&&this.sessionContacts.push({id:s.session.profile.id,name:`${s.session.profile.first_name} ${s.session.profile.last_name}`,email:s.session.profile.email,phone:s.session.profile.phone})}catch(e){console.log("[SEND] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new m(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(l=e.response)||void 0===l?void 0:l.data))}}getLevelIcon(e){return i("div",e<0?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}:e>=this.levels.length?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}:{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'})}handleSelectContact(e,t){e.preventDefault(),this.rolesCompleted[t.id]={...t,...e.detail},this.showPickerForId=""}handleClickRole(e,t){e.stopPropagation(),this.showPickerForId=t.id}handleSend(e){var t,i;if(this.sending)return void console.log("Skipping duplicate send",e);console.log("Sending",e),e.preventDefault(),e.stopPropagation(),this.sending=!0;const s={template_id:this.templateId,name:null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s),v(this.endpoint,s).then((e=>{var t;console.log("[SEND] Send envelope",e),this.reset().catch((e=>console.log("Unknown Error",e))),this.sending=!1,null===(t=this.send)||void 0===t||t.emit({...s,envelope_id:e.id,envelope:e})})).catch((e=>{console.log("Send error",e),this.sending=!1}))}handleCancel(e){var t;e.stopPropagation(),null===(t=this.exit)||void 0===t||t.emit()}render(){var e,t;const o=d(this.roleStore),l=Object.values(this.rolesCompleted).filter((e=>u(e.email)||x(e.phone))).length>=o.length;return i(s,{class:{sendable:null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),this.levels.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon(e),this.rolesAtLevel[e].map((e=>{var t,s,o,l,a,n;const r=`verdocs-send-recipient-${e.name}`;return e.email?i("div",{class:"recipient",style:{borderColor:f(c(this.roleStore,e.name))},onClick:t=>this.handleClickRole(t,e),id:r},null!==(a=null===(l=this.rolesCompleted[e.id])||void 0===l?void 0:l.full_name)&&void 0!==a?a:e.full_name,i("div",{class:"icon",innerHTML:L}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:r,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(n=this.rolesCompleted[e.id])&&void 0!==n?n:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}}))):i("div",{class:"recipient",style:{backgroundColor:f(c(this.roleStore,e.name))},onClick:t=>this.handleClickRole(t,e),id:r},null!==(s=null===(t=this.rolesCompleted[e.id])||void 0===t?void 0:t.full_name)&&void 0!==s?s:e.name,i("div",{class:"icon",innerHTML:L}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:r,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(o=this.rolesCompleted[e.id])&&void 0!==o?o:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}})))}))))),i("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!l||this.sending,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}};R.style='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';const U=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.templateUpdated=t(this,"templateUpdated",7),this.sdkError=t(this,"sdkError",7),this.endpoint=o.getDefault(),this.templateId="",this.uploading=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.showDeleteError=!1,this.confirmDeleteDocument=null,this.store=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await h(this.endpoint,this.templateId,!1)}catch(s){console.log("[TEMPLATE ATTACHMENTS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new m(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handleCancel(e){e.stopPropagation(),this.exit.emit()}handleUploadProgress(e){e>=99?(this.progressPercent=100,this.progressLabel="Processing..."):this.progressPercent=e}async handleUpload(e){var t,i,s,o;e.stopPropagation();const l=e.detail.file;if(l){console.log("[ATTACHMENTS] Uploading...",l),this.uploading=!0,this.progressLabel="Uploading...";try{const e=await b(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await h(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] Updated template",this.store.state),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"}),this.uploading=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e),null===(i=this.sdkError)||void 0===i||i.emit(new m(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data)),this.uploading=!1}}}handleNext(e){var t;e.stopPropagation(),this.uploading=!1,this.progressLabel="",this.progressPercent=0,null===(t=this.next)||void 0===t||t.emit({template:this.store.state})}async confirmDelete(){await g(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await h(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] New template",this.store.state),this.confirmDeleteDocument=null}async handleDelete(e){var t;(null===(t=this.store.state)||void 0===t?void 0:t.template_documents.length)>1?this.confirmDeleteDocument=e:this.showDeleteError=!0}getFileIcon(e){switch(e.mime){case"application/pdf":return S;case"image/jpeg":return k;case"image/png":return w;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return y}return E}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const l=null===(e=this.store)||void 0===e?void 0:e.state;return l.isLoaded?this.endpoint.session&&l.profile_id?i(s,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},null===(t=this.store)||void 0===t?void 0:t.state.template_documents.map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.page_numbers),i("div",{class:"pages-icon",innerHTML:z})),i("div",{class:"trash-icon",innerHTML:C,onClick:()=>this.handleDelete(e)}))))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(null===(o=this.store)||void 0===o?void 0:o.state.template_documents.length)||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=!1}),this.confirmDeleteDocument&&i("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:!0,onExit:()=>{this.confirmDeleteDocument=null}})):i(s,{class:"empty"}):i(s,{class:"loading"},i("verdocs-loader",null))}};U.style='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';const M=["attachments","roles","settings","fields","preview"],N=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.endpoint=o.getDefault(),this.templateId=null,this.step="preview",this.store=null}onStepChanged(){console.log("Step changed",this.step,this.templateId),this.loadTemplate().catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");if(!this.templateId)return void(this.step="preview");this.loadTemplate().catch((e=>console.log("[BUILD_TABS] Unable to load template",e)))}catch(s){console.log("[BUILD_TABS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new m(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(){this.templateId&&(this.store=await h(this.endpoint,this.templateId,!1))}setStep(e){var t;console.log("Selected step",e.detail.tab.id),e.stopPropagation(),e.preventDefault(),this.step=e.detail.tab.id,null===(t=this.stepChanged)||void 0===t||t.emit(e.detail.tab.id)}render(){var e,t,o,l,a,n,r,d,c;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));let h=!1,p=!1,m=!1;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step),this.templateId&&this.store&&this.store.state&&(m=(null===(o=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.template_documents)||void 0===o?void 0:o.length)>0,p=m&&(null===(n=null===(a=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===a?void 0:a.roles)||void 0===n?void 0:n.length)>0,h=p&&(null===(c=null===(d=null===(r=this.store)||void 0===r?void 0:r.state)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.length)>0);let v=Math.max(M.indexOf(this.step),0);return!h&&v>=4&&(v=3),!p&&v>=3&&(v=1),!m&&v>=1&&(v=0),console.log({selectedStepIndex:v,canPreview:h,canEditFields:p,canEditRoles:m}),i(s,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:v,tabs:[{id:"attachments",disabled:!1,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!p,label:"Settings"},{id:"fields",disabled:!p,label:"Fields"},{id:"preview",disabled:!h,label:"Preview/Send"}]}))}static get watchers(){return{step:["onStepChanged"]}}};N.style='verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';const A=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=o.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await l(this.endpoint,{name:this.file.name,documents:[this.file]},(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created template",e),h(this.endpoint,e.id,!0).then((()=>{var t,i;null===(t=this.templateCreated)||void 0===t||t.emit({endpoint:this.endpoint,template:e,templateId:e.id}),null===(i=this.next)||void 0===i||i.emit(e),this.creating=!1,this.progressLabel="",this.progressPercent=0})).catch((e=>{console.log(e)}))}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new m(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return i(s,null,this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("div",{class:"upload-box",onDrop:e=>{e.preventDefault(),e.target.classList.remove("drag-over"),this.file=e.dataTransfer.files[0]},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDragEnter:e=>e.target.classList.add("drag-over"),onDragLeave:e=>e.target.classList.remove("drag-over")},i("div",null,i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};A.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const D=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.name="",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await h(this.endpoint,this.templateId,!1),this.name=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.name,this.dirty=!1}catch(e){console.log("[TEMPLATE NAME] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new m(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,console.log("Closing"),null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await a(this.endpoint,this.templateId,{name:this.name}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.name=this.name),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoading)?i(s,{class:"loading"},i("verdocs-loader",null)):i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("label",{htmlFor:"verdocs-template-name"},"Template Name"),i("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:e=>{var t,i;this.name=e.target.value,this.dirty=this.name!==(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name)}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};D.style="";const j=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.showPlanBlocker=!1,this.sendReminders=!1,this.firstReminderDays="1",this.reminderDays="1",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await h(this.endpoint,this.templateId,!1),this.sendReminders=!!(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.reminder_id),this.dirty=!1}catch(e){console.log("[TEMPLATE REMINDERS] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new m(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.sendReminders=!!(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.reminder_id),this.dirty=!1,null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s,o,l,a,n,r,d,c,p,v;e.stopPropagation();try{if(this.sendReminders){const e={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.reminder_id)?(await function(e,t,i,s){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),s).then((function(e){return e.data}))}(this.endpoint,this.templateId,null===(s=this.store)||void 0===s?void 0:s.state.reminder_id,e),this.store=await h(this.endpoint,this.templateId,!1)):(await function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))}(this.endpoint,this.templateId,e),this.store=await h(this.endpoint,this.templateId,!1))}else await(c=this.endpoint,p=this.templateId,v=null===(o=this.store)||void 0===o?void 0:o.state.reminder_id,c.api.delete("/templates/".concat(p,"/reminder/").concat(v)).then((function(e){return e.data}))),this.store=await h(this.endpoint,this.templateId,!1);null===(l=this.templateUpdated)||void 0===l||l.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"})}catch(e){console.log("[TEMPLATE REMINDERS] Unable to update reminders",e),T(e.message),null===(a=this.sdkError)||void 0===a||a.emit(new m(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(r=e.response)||void 0===r?void 0:r.data))}this.dirty=!1,null===(d=this.close)||void 0===d||d.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Reminders"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),i("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:e=>{this.sendReminders=e.target.checked,this.dirty=!0}})),i("p",null,i("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),i("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:e=>{this.firstReminderDays=e.target.value,this.dirty=!0},disabled:!this.sendReminders})),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),i("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:e=>{this.reminderDays=e.target.value,this.dirty=!0},disabled:!this.sendReminders})),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))),this.showPlanBlocker&&i("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:()=>this.showPlanBlocker=!1})):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};j.style='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .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-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';const H=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var e,t,i,s,o,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await h(this.endpoint,this.templateId,!1),this.personal=(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal)||!0,this.public=(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(e){console.log("[TEMPLATE VISIBILITY] Error loading template",e),null===(o=this.sdkError)||void 0===o||o.emit(new m(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}handleCancel(e){var t,i,s,o,l;e.stopPropagation(),this.personal=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await a(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Visibility"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-shared"},"Shared"),i("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:e=>{this.personal=!e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-public"},"Public"),i("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:e=>{this.public=e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};H.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{I as verdocs_preview,R as verdocs_send,U as verdocs_template_attachments,N as verdocs_template_build_tabs,A as verdocs_template_create,D as verdocs_template_name,j as verdocs_template_reminders,H as verdocs_template_visibility}
|
@@ -0,0 +1 @@
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,n=t.length,r;o<n;o++){if(r||!(o in t)){if(!r)r=Array.prototype.slice.call(t,0,o);r[o]=t[o]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-3bcd86ea.system.js","./p-cacffa79.system.js","./p-9a5ff58c.system.js","./p-bbee73c8.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,n,r,s,a,l;return{setters:[function(e){t=e.r;i=e.c;o=e.h;n=e.H;r=e.a},function(e){s=e.i},function(e){a=e.d},function(e){l=e.c},function(){},function(){},function(){},function(){},function(){}],execute:function(){var c='verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';var d='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>';var p='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>';var f=5;var u=function(e){var t=e.page,i=e.selected,n=e.onClick;var r;if(t==="first"){r=d}else if(t==="last"){r=p}else{r=String(t+1)}return o("div",{class:"page-button ".concat(t===i?"selected":""),onClick:function(){return n(t)},innerHTML:r})};var h=e("verdocs_pagination",function(){function e(e){t(this,e);this.selectPage=i(this,"selectPage",7);this.selectedPage=0;this.itemCount=1;this.perPage=10}e.prototype.handleSelectPage=function(e){var t;this.selectedPage=e;(t=this.selectPage)===null||t===void 0?void 0:t.emit({selectedPage:e})};e.prototype.render=function(){var e=this;var t=Math.max(0,this.selectedPage-2);var i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;var r=s(0,Math.ceil(this.itemCount/this.perPage)).slice(t,t+f);return o(n,null,this.selectedPage>0&&o(u,{page:"first",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(0)}}),t>0&&o("div",{class:"ellipsis"},"..."),r.map((function(t){return o(u,{page:t,selected:e.selectedPage,onClick:function(t){return e.handleSelectPage(+t)}})})),this.selectedPage<i-1&&o("div",{class:"ellipsis"},"..."),this.selectedPage<i-1&&o(u,{page:"last",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(i-1)}}))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());h.style=c;var g='verdocs-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:#4c56cb3f}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';var v='<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>';var b=e("verdocs_quick_filter",function(){function e(e){t(this,e);this.optionSelected=i(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.open=undefined}e.prototype.componentDidLoad=function(){this.popper=l(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var t=!(e.target==this.el||this.el.contains(e.target));if(t){this.hide()}};e.prototype.handleSelectOption=function(e,t){e.stopPropagation();this.optionSelected.emit(t);this.value=t.value;this.hide()};e.prototype.showDropdown=function(){var e,t;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(t=this.popper)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var t,i;if(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.localName)==="button"&&((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var t,i,r;var s=(t=this.options)===null||t===void 0?void 0:t.find((function(t){return t.value===e.value}));var l=(i=this.options)===null||i===void 0?void 0:i.reduce((function(e,t){return e.label.length>t.label.length?e:t}));var c=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");var d=a(this.label,"14px Inter, Barlow, sans-serif");var p="".concat(c+d+40,"px");return o(n,{class:{open:!!this.open},style:{minWidth:p,display:"inline-block"}},o("div",{class:"control",onClick:function(t){return e.toggleDropdown(t)},onBlur:function(t){return e.handleHideDropdown(t)}},o("div",{class:"title",ref:function(t){return e.dropdownButton=t}},o("span",{class:"prefix"},this.label,":"),s?s.label:this.placeholder),o("div",{style:{flex:"1"}}),o("div",{class:"separator"}),o("div",{class:"arrow",innerHTML:v,"aria-label":"Open Menu"})),o("div",{class:"items","aria-hidden":!this.open,ref:function(t){return e.dropdownMenu=t},style:{minWidth:p}},(r=this.options)===null||r===void 0?void 0:r.map((function(t){return t.label?o("button",{onClick:function(i){return e.handleSelectOption(i,t)},class:"option ".concat(t.value===e.value?"selected":""),disabled:t.disabled},t.label):o("div",{class:"separator"})}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());b.style=g}}}));
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as i,h as t,H as s,F as o}from"./p-14b44491.js";import{e as n,a,u as l,f as r,h as d,i as h}from"./p-dc2ad047.js";import{R as c}from"./p-05788c2b.js";import{e as p,a as u,b as v}from"./p-3cd894ff.js";import{V as g}from"./p-035f6b38.js";import{i as m,a as f}from"./p-e8ce0b6f.js";import{f as x,i as b}from"./p-5e808a0b.js";import{a as w,u as y,r as k,b as S}from"./p-a3d7cdda.js";import{a as N}from"./p-ef20cb50.js";import{V as I}from"./p-ed416acf.js";import{S as G}from"./p-7a1b2643.js";import"./p-eab67c09.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";const j=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],F=[{id:"print",label:"Print"},{id:"download",label:"Download"}],D=class{constructor(t){e(this,t),this.sdkError=i(this,"sdkError",7),this.envelopeLoaded=i(this,"envelopeLoaded",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.endpoint=null,this.recipientIndex=-1,this.envelopeId=null,this.roleId=null,this.inviteCode=null,this.headerTargetId=null,this.envelope=null,this.roleNames=[],this.sortedRecipients=[],this.recipient=null,this.signerToken=null,this.hasSignature=!1,this.nextButtonLabel="Start",this.nextSubmits=!1,this.errorMessage="",this.focusedField="",this.submitting=!1,this.isDone=!1,this.showDone=!1,this.showLoadError=!1,this.finishLater=!1,this.showFinishLater=!1,this.agreed=!1,this.documentsSingularPlural="document"}componentWillLoad(){this.endpoint=new g({sessionType:"signing"})}async componentWillRender(){var e,i,t,s,o,l,r;if(this.envelopeId)if(this.roleId)if(this.inviteCode)try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{session:e,recipient:i,signerToken:t}=await n(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode});console.log(`[SIGN] Loaded signing session ${e.email} / ${e.profile_id}`),this.recipient=i,console.log("[SIGN] We are recipient",this.recipient),this.signerToken=t,this.endpoint.setToken(t),this.agreed&&(this.nextButtonLabel="Next"),this.envelope=await a(this.endpoint,this.envelopeId),N(this.envelope),this.sortedRecipients=[...this.envelope.recipients],this.sortedRecipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence)),this.roleNames=this.sortedRecipients.map((e=>e.role_name)),this.envelope.documents.length>0&&(this.documentsSingularPlural="document(s)"),this.recipientIndex=this.roleNames.findIndex((e=>e==this.roleId)),this.recipientIndex>-1?(this.recipient=this.sortedRecipients[this.recipientIndex],this.agreed=this.recipient.agreed,console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)):console.log("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients),this.isDone=["submitted","canceled","declined"].includes(this.recipient.status),this.checkRecipientFields(),null===(s=this.envelopeLoaded)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope})}catch(e){console.log("Error with signing session",e),null===(o=this.sdkError)||void 0===o||o.emit(new G(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data)),this.showLoadError=!0}else null===(t=this.sdkError)||void 0===t||t.emit(new G("[SIGN] Missing required inviteCode",500,""));else null===(i=this.sdkError)||void 0===i||i.emit(new G("[SIGN] Missing required roleId",500,""));else null===(e=this.sdkError)||void 0===e||e.emit(new G("[SIGN] Missing required envelopId",500,""))}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-sign-header");e&&i&&(console.log("[SIGN] Moving header"),i.remove(),e.append(i))}handleClickAgree(){this.submitting=!0,p(this.endpoint,this.envelopeId,this.roleId,!0).then((()=>{var e;this.nextButtonLabel="Next",this.recipient.agreed=!0,this.submitting=!1,this.agreed=!0,null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("Update failure",e),this.submitting=!1,null===(i=this.sdkError)||void 0===i||i.emit(new G(e.message,null===(t=e.response)||void 0===t?void 0:t.status,null===(s=e.response)||void 0===s?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,o,n;switch(e.detail.id){case"later":this.finishLater=!0,this.showFinishLater=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":I("This feature will be available in an upcoming release."),null===(t=this.envelopeUpdated)||void 0===t||t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=!0;const e=await u(this.endpoint,this.envelopeId,this.roleId);console.log("Decline result",e),null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"}),this.submitting=!1,this.isDone=!0}break;case"print":window.print(),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":w(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((e=>{console.log("Error downloading PDF",e)})),null===(n=this.envelopeUpdated)||void 0===n||n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e),this.getRecipientFields().forEach((t=>{t.name===e&&(t.settings=i.settings,y(t),this.checkRecipientFields())}))}saveFieldChange(e,i){console.log("[SIGN] updateRecipientFieldValue",e),l(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;401===(null===(i=e.response)||void 0===i?void 0:i.status)&&"jwt expired"===(null===(s=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===s?void 0:s.error)?(console.log("[SIGN] Signing session expired"),this.errorMessage="Signing session expired. Please reload your browser to continue."):console.log("[SIGN] Server error",e),null===(o=this.sdkError)||void 0===o||o.emit(new G(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(a=e.response)||void 0===a?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:!1,value:t});case"checkbox_group":{const t=e.settings.options.map((e=>({id:e.id,checked:i.target.checked})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"radio_button_group":{const t=e.settings.options.map((e=>({id:e.id,selected:i.target.value===e.id})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"dropdown":return this.saveFieldChange(e.name,{prepared:!1,value:i.detail});case"initial":if(!i.detail)return;const l=await(await fetch(i.detail)).blob();return(o=this.endpoint,"initial",n=l,a=new FormData,a.append("initial",n,"initial"),o.api.post("/initials",a).then((function(e){return e.data}))).then((async i=>{const t=await d(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":if(!i.detail)return;const h=await(await fetch(i.detail)).blob();return function(e,i,t){var s=new FormData;return s.append("signature",t,"signature"),e.api.post("/signatures",s).then((function(e){return e.data}))}(this.endpoint,0,h).then((async i=>{console.log("Signature update result",i);const t=await r(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)})).catch((e=>{console.warn("Error updating signature",e)}));case"date":const{date:c,formattedDate:p}=i.detail;if(p)return console.log("dt",{date:c,formattedDate:p}),this.saveFieldChange(e.name,{prepared:!1,value:p});break;case"timestamp":console.log("Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("Unhandled field update",{value:t,checked:s},e)}var o,n,a}isFieldValid(e){var i,t,s,o,n,a,l;const{required:r=!1}=e,{result:d="",value:h="",base64:c=""}=e.settings||{};switch(e.type){case"textbox":switch((null===(i=e.settings)||void 0===i?void 0:i.validator)||""){case"email":return f(d);case"phone":return m(d);default:return!r||""!==d}case"signature":case"initial":return!r||""!==c;case"timestamp":return!0;case"textarea":case"date":case"attachment":return!r||""!==d;case"dropdown":return!r||""!==h;case"checkbox_group":const p=((null===(s=null===(t=e.settings)||void 0===t?void 0:t.options)||void 0===s?void 0:s.filter((e=>e.checked)))||[]).length;return!r||p>=((null===(o=e.settings)||void 0===o?void 0:o.minimum_checked)||0)&&p<=((null===(n=e.settings)||void 0===n?void 0:n.maximum_checked)||999);case"radio_button_group":return!r||((null===(l=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===l?void 0:l.filter((e=>e.selected)))||[]).length>0;default:return!1}}async handleNext(){var e;if(this.nextSubmits){try{this.submitting=!0;const e=await v(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",e),this.recipient.status="submitted",this.showDone=!0,this.isDone=!0}catch(e){console.log("[SIGN] Error submitting",e)}return void(this.submitting=!1)}const i=this.getRecipientFields().filter((e=>e.required));let t=i.findIndex((e=>e.name===this.focusedField))+1;t>=i.length&&(t=0);let s=i[t],o=0;if(o<i.length&&["signature","initial"].includes(s.type)&&"signed"===(null===(e=s.settings)||void 0===e?void 0:e.result)&&(o++,t++,t>=i.length&&(t=0),s=i[t]),o>=i.length&&(s=null),s){const e=S(s),i=document.getElementById(e);null==i||i.focusField(),this.focusedField=s.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.recipient_role===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));e.length<1?(this.nextButtonLabel="Finish",this.nextSubmits||(this.nextSubmits=!0)):(console.log("[SIGN] c invalid fields",e),this.nextButtonLabel="Next",this.nextSubmits=!1)}attachFieldAttributes(e,i,t){var s;t.addEventListener("input",(e=>{console.log("[SIGN] onfieldInput",e.detail,e.target.value),e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")?this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())):this.checkRecipientFields()})),t.addEventListener("attached",(async e=>{console.log("[SIGN] onAttached",e.detail,e.target.value);const t=await h(this.endpoint,this.envelopeId,this.roleId,i.name,e.detail);console.log("upload result",t),this.checkRecipientFields()})),t.addEventListener("removed",(e=>{console.log("[SIGN] onRemoved",e.detail,e.target.value)})),t.addEventListener("focusout",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),t.addEventListener("fieldChange",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),t.setAttribute("templateid",this.envelope.template_id),t.setAttribute("fieldname",i.name),t.setAttribute("page",e.pageNumber),t.setAttribute("xScale",e.xScale),t.setAttribute("yScale",e.yScale),t.setAttribute("initials",this.recipient?x(this.recipient.full_name):""),t.setAttribute("name",(null===(s=this.recipient)||void 0===s?void 0:s.full_name)||"")}handlePageRendered(e){const i=e.detail;this.getRecipientFields().filter((e=>e.page===i.pageNumber)).filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=k(e,i,{disabled:!1,editable:!1,draggable:!1,done:this.isDone});t&&(Array.isArray(t)?t.map((t=>this.attachFieldAttributes(i,e,t))):this.attachFieldAttributes(i,e,t))})),this.sortedRecipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status===c.INVITED||e.status===c.OPENED||e.status===c.PENDING))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=k(e,i,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});t&&(Array.isArray(t)?t.map((t=>this.attachFieldAttributes(i,e,t))):this.attachFieldAttributes(i,e,t))}))})),this.checkRecipientFields()}render(){return this.envelope?this.isDone?t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return null===(i=this.sdkError)||void 0===i?void 0:i.emit(e.detail)}}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,{class:{agreed:this.agreed}},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:this.isDone||this.finishLater?F:j,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((e=>{const i=b(1,e.page_numbers);return t(o,null,i.map((i=>t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=!1}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.showLoadError&&t("verdocs-ok-dialog",{heading:"Error Loading Document",message:"Please check with the sender to ensure it has not been canceled, and try again later.",buttonLabel:"Retry",onNext:()=>{this.showLoadError=!1,window.location.reload()}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)),!this.agreed&&t("div",{class:"cover"},t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:()=>this.handleClickAgree()}),t("ul",null,t("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",t("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),t("li",null,"Agree to Verdocs"," ",t("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",t("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),"."))))):t(s,null,t("verdocs-loader",null))}};D.style='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-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;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';export{D as verdocs_sign}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as s,H as i}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as n}from"./p-035f6b38.js";import{a,c as r,b as o}from"./p-5e808a0b.js";import{V as l}from"./p-ed416acf.js";import{S as c}from"./p-7a1b2643.js";import{g as d,a as u,u as h}from"./p-3e607686.js";import{f as m}from"./p-c220af42.js";import{c as p}from"./p-a3d7cdda.js";import"./p-eab67c09.js";import"./p-dc2ad047.js";import"./p-839f6f0d.js";var v=function(e,t){return e.api.get("/organizations/".concat(t,"/profiles")).then((function(e){return e.data}))};const f=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.keys=[],this.creatingKey=!1,this.createdKey=null,this.deletingKey=null,this.rotatingKey=null,this.newApiKeyName="",this.newApiKeyProfileId="",this.members=[]}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.newApiKeyProfileId=this.endpoint.session.profile_id,v(this.endpoint,this.endpoint.session.organization_id).then((e=>{this.members=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Error loading organization members",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})})),this.loadKeys()}loadKeys(){var e,t;(e=this.endpoint,t=this.endpoint.session.organization_id,e.api.get("/organizations/".concat(t,"/api_key")).then((function(e){return e.data}))).then((e=>{this.keys=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Unable to load API keys",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})}))}async handleDeleteKey(){var e,t,s;(e=this.endpoint,t=this.deletingKey.organization_id,s=this.deletingKey.client_id,e.api.delete("/organizations/".concat(t,"/api_key/").concat(s)).then((function(e){return e.data}))).then((()=>{this.deletingKey=null,l("API key deleted",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.deletingKey=null,console.log("[SETTINGS] Unable to delete API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to delete API key. Please try again later",{style:"error"})}))}async handleRotateKey(){var e,t,s;(e=this.endpoint,t=this.rotatingKey.organization_id,s=this.rotatingKey.client_id,e.api.put("/organizations/".concat(t,"/api_key/").concat(s,"/rotate")).then((function(e){return e.data}))).then((e=>{this.rotatingKey=null,l("API key rotated",{style:"success"}),this.loadKeys(),this.createdKey=e})).catch((e=>{var t,s,i;this.rotatingKey=null,console.log("[SETTINGS] Unable to rotate API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to rotate API key. Please try again later",{style:"error"})}))}async handleCreateKey(){var e,t,s;(e=this.endpoint,t=this.endpoint.session.organization_id,s={name:this.newApiKeyName,profile_id:this.newApiKeyProfileId},e.api.post("/organizations/".concat(t,"/api_key"),s).then((function(e){return e.data}))).then((e=>{this.creatingKey=!1,this.createdKey=e,l("API key created",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.creatingKey=!1,console.log("[SETTINGS] Unable to create API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to create API key. Please try again later",{style:"error"})}))}render(){var e,t,n,r;const o=this.members.map((e=>({label:a(e),value:e.id})));return this.endpoint.session?s(i,null,s("verdocs-table",{data:this.keys,columns:[{id:"name",header:"Name",renderCell:(e,t)=>s("div",null,s("div",null,t.name))},{id:"client_id",header:"Client ID",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>'}),s("div",null,t.client_id))},{id:"profile_id",header:"Acts as",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>'}),s("div",null,a(t.profile)))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><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>',onClick:()=>this.deletingKey=t}),s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>',onClick:()=>this.rotatingKey=t}))}]}),s("verdocs-button",{label:"Add API Key",size:"normal",onClick:()=>this.creatingKey=!0}),this.deletingKey&&s("verdocs-dialog",{onExit:()=>this.deletingKey=null},s("div",{slot:"title",class:"heading"},'Delete API key "',this.deletingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this key? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.deletingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleDeleteKey()})))),this.rotatingKey&&s("verdocs-dialog",{onExit:()=>this.rotatingKey=null},s("div",{slot:"title",class:"heading"},'Rotate API key "',this.rotatingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to rotate this key? A new client secret will be generated, and the old value will become unusable. This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.rotatingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleRotateKey()})))),this.creatingKey&&s("verdocs-dialog",{onExit:()=>this.creatingKey=!1},s("div",{slot:"title",class:"heading"},"Create API Key"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",placeholder:"API key name...",id:"verdocs-api-key-name",value:this.newApiKeyName,autocomplete:"off",required:!0,onInput:e=>this.newApiKeyName=e.target.value,onFocusout:e=>{this.newApiKeyName=e.target.value.trim()}}),s("p",null,'API keys must be associated with a profile. Actions performed via API calls using this key will "act as" this profile.'),s("verdocs-select-input",{options:o,label:"Act as Profile",onInput:e=>{this.newApiKeyProfileId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.creatingKey=!1}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleCreateKey()})))),this.createdKey&&s("verdocs-dialog",{onExit:()=>this.createdKey=null},s("div",{slot:"title",class:"heading"},"API Key Details"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",disabled:!0,value:null===(e=this.createdKey)||void 0===e?void 0:e.name}),s("verdocs-text-input",{label:"Profile",disabled:!0,value:a(null===(t=this.createdKey)||void 0===t?void 0:t.profile)}),s("p",null,"Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"),s("verdocs-text-input",{label:"Client ID",disabled:!0,value:null===(n=this.createdKey)||void 0===n?void 0:n.client_id,copyable:!0}),s("verdocs-text-input",{label:"Secret Key",disabled:!0,value:null===(r=this.createdKey)||void 0===r?void 0:r.client_secret,copyable:!0}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",label:"Done",onClick:()=>this.createdKey=null}))))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};f.style='verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-api-keys .col-client_id,verdocs-settings-api-keys .col-actions{display:none}}';const g='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><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>',y=e=>void 0!==e.find((e=>"owner"===e.name))?"Owner":void 0!==e.find((e=>"admin"===e.name))?"Admin":void 0!==e.find((e=>"member"===e.name))?"Member":void 0!==e.find((e=>"basic_user"===e.name))?"Basic User":void 0!==e.find((e=>"contact"===e.name))?"Contact":void 0,T=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.members=[],this.invited=[],this.roles=[],this.selectedTab=0,this.invitingMember=!1,this.newEmailAddress="",this.newRoleId="",this.submitting=!1,this.deletingInvitation=null,this.resendingInvitation=null,this.deletingMember=null}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.loadMembers().catch((e=>console.log("Unknown Error",e)))}async loadMembers(){var e,t,s,i,n,a;try{const[t,s,i]=await Promise.all([d(this.endpoint),v(this.endpoint,this.endpoint.session.organization_id),(n=this.endpoint,a=this.endpoint.session.organization_id,n.api.get("/organizations/".concat(a,"/invitation")).then((function(e){return e.data})))]);this.roles=t,this.members=s,this.invited=i,this.newRoleId=(null===(e=t.find((e=>"member"===e.name)))||void 0===e?void 0:e.id)||""}catch(e){null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load members. Please try again later")}}async handleInviteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.endpoint.session.organization_id,s={email:this.newEmailAddress,role_id:this.newRoleId,organization_id:this.endpoint.session.organization_id},e.api.post("/organizations/".concat(t,"/invitation"),s).then((function(e){return e.data}))).then((e=>{console.log("[SETTINGS] Invited member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Invitation sent!",{style:"success"}),this.loadMembers()})).catch((e=>{console.log("[SETTINGS] Unable to invite member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Unable to invite member. Please try again later",{style:"error"})}))}async handleDeleteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingMember.organization_id,s=this.deletingMember.email,e.api.delete("/organizations/".concat(t,"/profiles/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingMember=null,l("The member has been deleted.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingMember=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleDeleteInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingInvitation.organization_id,s=this.deletingInvitation.email,e.api.delete("/organizations/".concat(t,"/invitation/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingInvitation=null,l("The invitation has been cancelled.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingInvitation=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleResendInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.resendingInvitation.organization_id,s=this.resendingInvitation.email,e.api.post("/organizations/".concat(t,"/invitation/").concat(s,"/resend")).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.resendingInvitation=null,l("The invitation has been resent.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.resendingInvitation=null,console.log("REsend error",e),l("Unable to resend invitation. Please try again later",{style:"error"})}))}render(){if(!this.endpoint.session)return console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated");const e=this.roles.map((e=>({label:y([{name:e.name}]),value:e.id})));return s(i,null,s("verdocs-tabs",{tabs:[{label:`Members (${this.members.length})`},{label:`Pending Invitations (${this.invited.length})`}],onSelectTab:e=>this.selectedTab=e.detail.index}),0===this.selectedTab&&s("verdocs-table",{data:this.members,columns:[{id:"name",renderHeader:()=>"Member",renderCell:(e,t)=>{return s("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},s("div",{class:"role",style:{backgroundColor:(i=t.roles,void 0!==i.find((e=>"owner"===e.name))?"#9333ea":void 0!==i.find((e=>"admin"===e.name))?"#2563eb":void 0!==i.find((e=>"member"===e.name))?"#16a34a":void 0!==i.find((e=>"basic_user"===e.name))?"#ea580c":void 0!==i.find((e=>"contact"===e.name))?"#52525B":void 0)}},o(t)),s("span",null,a(t)));var i}},{id:"email",header:"E-mail Address"},{id:"phone",header:"Phone Number"},{id:"roles",header:"Role",renderCell:(e,t)=>`${y(t.roles)}`},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,t.id!==this.endpoint.session.profile_id&&s("div",{innerHTML:g,onClick:()=>this.deletingMember=t}))}]}),1===this.selectedTab&&s("verdocs-table",{data:this.invited,columns:[{id:"email",header:"E-mail Address"},{id:"generated_at",header:"Invited",renderCell:(e,t)=>s("div",null,m(new Date(t.generated_at),"MMM d, Y"))},{id:"role_id",header:"Role",renderCell:(e,t)=>{var i;return s("div",null,y([{name:null===(i=this.roles.find((e=>e.id===t.role_id)))||void 0===i?void 0:i.name}]))}},{id:"status",header:"Status",renderCell:(e,t)=>s("div",null,r(t.status))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:g,onClick:()=>this.deletingInvitation=t}),s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>',onClick:()=>this.resendingInvitation=t}))}]}),s("verdocs-button",{label:"Invite New Member",size:"normal",disabled:this.submitting,onClick:()=>this.invitingMember=!0}),this.invitingMember&&s("verdocs-dialog",{onExit:()=>this.invitingMember=!1},s("div",{slot:"title",class:"heading"},"Invite New Member"),s("div",{class:"content"},s("verdocs-text-input",{label:"E-mail Address",placeholder:"Enter the user's email address...",id:"verdocs-invite-email",value:this.newEmailAddress,autocomplete:"off",required:!0,onInput:e=>this.newEmailAddress=e.target.value,onFocusout:e=>{this.newEmailAddress=e.target.value.trim()}}),s("div",{style:{marginBottom:"20px"}}),s("verdocs-select-input",{options:e,label:"Role",onInput:e=>{this.newRoleId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",disabled:this.submitting,onClick:()=>this.invitingMember=!1}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting||!this.newEmailAddress||!this.newRoleId,onClick:()=>this.handleInviteMember()})))),this.deletingMember&&s("verdocs-dialog",{onExit:()=>this.deletingMember=null},s("div",{slot:"title",class:"heading"},"Delete Member?"),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this member? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingMember=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteMember()})))),this.deletingInvitation&&s("verdocs-dialog",{onExit:()=>this.deletingInvitation=null},s("div",{slot:"title",class:"heading"},"Cancel Invitation?"),s("div",{class:"content"},s("p",null,"Are you sure you want to cancel this invitation? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteInvitation()})))),this.resendingInvitation&&s("verdocs-dialog",{onExit:()=>this.resendingInvitation=null},s("div",{slot:"title",class:"heading"},"Resend Invitation?"),s("div",{class:"content"},s("p",null,"The user will receive an email reminder to join your organization."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.resendingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleResendInvitation()})))))}};var b,M;T.style='verdocs-settings-members{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-members .data-col svg{width:24px;height:24px}verdocs-settings-members .col-name svg,verdocs-settings-members .col-client_id svg,verdocs-settings-members .col-profile_id svg{fill:#a1a1aa}verdocs-settings-members .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-members .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-members .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-members .header-col.col-actions{text-align:center}verdocs-settings-members verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-members .col-email,verdocs-settings-members .col-phone,verdocs-settings-members .col-actions{display:none}}',function(e){e.assertEqual=e=>e,e.assertIs=function(){},e.assertNever=function(){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of s)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(b||(b={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(M||(M={}));const x=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},w=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class k extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},i=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)s._errors.push(t(n));else{let e=s,i=0;for(;i<n.path.length;){const s=n.path[i];i===n.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(n))):e[s]=e[s]||{_errors:[]},e=e[s],i++}}};return i(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},s=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}k.create=e=>new k(e);const I=(e,t)=>{let s;switch(e.code){case w.invalid_type:s=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,b.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:s=`Unrecognized key(s) in object: ${b.joinValues(e.keys,", ")}`;break;case w.invalid_union:s="Invalid input";break;case w.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${b.joinValues(e.options)}`;break;case w.invalid_enum_value:s=`Invalid enum value. Expected ${b.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:s="Invalid function arguments";break;case w.invalid_return_type:s="Invalid function return type";break;case w.invalid_date:s="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:b.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case w.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:s="Invalid input";break;case w.invalid_intersection_types:s="Intersection results could not be merged";break;case w.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:s="Number must be finite";break;default:s=t.defaultError,b.assertNever(e)}return{message:s}};let _=I;function N(){return _}const S=e=>{const{data:t,path:s,errorMaps:i,issueData:n}=e,a=[...s,...n.path||[]],r={...n,path:a};let o="";const l=i.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(r,{data:t,defaultError:o}).message;return{...n,path:a,message:n.message||o}};function E(e,t){const s=S({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,N(),I].filter((e=>!!e))});e.common.issues.push(s)}class C{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const i of t){if("aborted"===i.status)return A;"dirty"===i.status&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t)s.push({key:await e.key,value:await e.value});return C.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const i of t){const{key:t,value:n}=i;if("aborted"===t.status)return A;if("aborted"===n.status)return A;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!i.alwaysSet||(s[t.value]=n.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Z=e=>({status:"dirty",value:e}),P=e=>({status:"valid",value:e}),z=e=>"aborted"===e.status,j=e=>"dirty"===e.status,D=e=>"valid"===e.status,L=e=>"undefined"!=typeof Promise&&e instanceof Promise;var U;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(U||(U={}));class B{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $=(e,t)=>{if(D(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new k(e.common.issues);return this._error=t,this._error}}};function K(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:n}=e;if(t&&(s||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=i?i:t.defaultError}:{message:null!=s?s:t.defaultError},description:n}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return G(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(L(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const i={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:G(e)},n=this._parseSync({data:e,path:i.path,parent:i});return $(i,n)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:G(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(L(i)?i:Promise.resolve(i));return $(s,n)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const n=e(t),a=()=>i.addIssue({code:w.custom,...s(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(a(),!1))):!!n||(a(),!1)}))}refinement(e,t){return this._refinement(((s,i)=>!!e(s)||(i.addIssue("function"==typeof t?t(s,i):t),!1)))}_refinement(e){return new Ee({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ce.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this,this._def)}promise(){return Se.create(this,this._def)}or(e){return pe.create([this,e],this._def)}and(e){return ye.create(this,e,this._def)}transform(e){return new Ee({...K(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ze({...K(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new De({typeName:Ke.ZodBranded,type:this,...K(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...K(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Le.create(this,e)}readonly(){return Ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R=/^c[^\s-]{8,}$/i,q=/^[a-z][a-z0-9]*$/,V=/^[0-9A-HJKMNP-TV-Z]{26}$/,F=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,H=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let W;const J=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Y=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class Q extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.string,received:t.parsedType}),A}const t=new C;let s;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,n=e.data.length<r.value;(i||n)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)H.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)W||(W=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),W.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)F.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)R.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)q.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)V.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(i){s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?((a=r).precision?a.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${a.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${a.precision}}Z$`):0===a.precision?a.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):a.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"ip"===r.kind?(i=e.data,("v4"!==(n=r.version)&&n||!J.test(i))&&("v6"!==n&&n||!Y.test(i))&&(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty())):b.assertNever(r);var i,n,a;return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement((t=>e.test(t)),{validation:t,code:w.invalid_string,...U.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}datetime(e){var t;return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,message:e}:{kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...U.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...U.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function X(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=s>i?s:i;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}Q.create=e=>{var t;return new Q({checks:[],typeName:Ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...K(e)})};class ee extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.number,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"int"===i.kind?b.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"multipleOf"===i.kind?0!==X(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_finite,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&b.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ee.create=e=>new ee({checks:[],typeName:Ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...K(e)});class te extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.bigint,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}te.create=e=>{var t;return new te({checks:[],typeName:Ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...K(e)})};class se extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.boolean,received:t.parsedType}),A}return P(e.data)}}se.create=e=>new se({typeName:Ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...K(e)});class ie extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.date,received:t.parsedType}),A}if(isNaN(e.data.getTime()))return E(this._getOrReturnCtx(e),{code:w.invalid_date}),A;const t=new C;let s;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):b.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ie.create=e=>new ie({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ke.ZodDate,...K(e)});class ne extends O{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.symbol,received:t.parsedType}),A}return P(e.data)}}ne.create=e=>new ne({typeName:Ke.ZodSymbol,...K(e)});class ae extends O{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.undefined,received:t.parsedType}),A}return P(e.data)}}ae.create=e=>new ae({typeName:Ke.ZodUndefined,...K(e)});class re extends O{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.null,received:t.parsedType}),A}return P(e.data)}}re.create=e=>new re({typeName:Ke.ZodNull,...K(e)});class oe extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}}oe.create=e=>new oe({typeName:Ke.ZodAny,...K(e)});class le extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}}le.create=e=>new le({typeName:Ke.ZodUnknown,...K(e)});class ce extends O{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.never,received:t.parsedType}),A}}ce.create=e=>new ce({typeName:Ke.ZodNever,...K(e)});class de extends O{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.void,received:t.parsedType}),A}return P(e.data)}}de.create=e=>new de({typeName:Ke.ZodVoid,...K(e)});class ue extends O{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==x.array)return E(t,{code:w.invalid_type,expected:x.array,received:t.parsedType}),A;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&(E(t,{code:e?w.too_big:w.too_small,minimum:n?i.exactLength.value:void 0,maximum:e?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(E(t,{code:w.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(E(t,{code:w.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>i.type._parseAsync(new B(t,e,t.path,s))))).then((e=>C.mergeArray(s,e)));const n=[...t.data].map(((e,s)=>i.type._parseSync(new B(t,e,t.path,s))));return C.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}function he(e){if(e instanceof me){const t={};for(const s in e.shape)t[s]=Ce.create(he(e.shape[s]));return new me({...e._def,shape:()=>t})}return e instanceof ue?new ue({...e._def,type:he(e.element)}):e instanceof Ce?Ce.create(he(e.unwrap())):e instanceof Ae?Ae.create(he(e.unwrap())):e instanceof Te?Te.create(e.items.map((e=>he(e)))):e}ue.create=(e,t)=>new ue({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...K(t)});class me extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=b.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),A}const{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof ce&&"strip"===this._def.unknownKeys))for(const e in s.data)n.includes(e)||a.push(e);const r=[];for(const e of n)r.push({key:{status:"valid",value:e},value:i[e]._parse(new B(s,s.data[e],s.path,e)),alwaysSet:e in s.data});if(this._def.catchall instanceof ce){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)r.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)a.length>0&&(E(s,{code:w.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a)r.push({key:{status:"valid",value:t},value:e._parse(new B(s,s.data[t],s.path,t)),alwaysSet:t in s.data})}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const s=await t.key;e.push({key:s,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>C.mergeObjectSync(t,e))):C.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var i,n,a,r;const o=null!==(a=null===(n=(i=this._def).errorMap)||void 0===n?void 0:n.call(i,t,s).message)&&void 0!==a?a:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=U.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const t={};return b.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new me({...this._def,shape:()=>t})}omit(e){const t={};return b.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new me({...this._def,shape:()=>t})}deepPartial(){return he(this)}partial(e){const t={};return b.objectKeys(this.shape).forEach((s=>{const i=this.shape[s];t[s]=e&&!e[s]?i:i.optional()})),new me({...this._def,shape:()=>t})}required(e){const t={};return b.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Ce;)e=e._def.innerType;t[s]=e}})),new me({...this._def,shape:()=>t})}keyof(){return Ie(b.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)});class pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new k(e.ctx.common.issues)));return E(t,{code:w.invalid_union,unionErrors:s}),A}));{let e;const i=[];for(const n of s){const s={...t,common:{...t.common,issues:[]},parent:null},a=n._parseSync({data:t.data,path:t.path,parent:s});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=i.map((e=>new k(e)));return E(t,{code:w.invalid_union,unionErrors:n}),A}}get options(){return this._def.options}}pe.create=(e,t)=>new pe({options:e,typeName:Ke.ZodUnion,...K(t)});const ve=e=>e instanceof we?ve(e.schema):e instanceof Ee?ve(e.innerType()):e instanceof ke?[e.value]:e instanceof _e?e.options:e instanceof Ne?Object.keys(e.enum):e instanceof Ze?ve(e._def.innerType):e instanceof ae?[void 0]:e instanceof re?[null]:null;class fe extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return E(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),A;const s=this.discriminator,i=this.optionsMap.get(t.data[s]);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const i=new Map;for(const s of t){const t=ve(s.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new fe({typeName:Ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...K(s)})}}function ge(e,t){const s=G(e),i=G(t);if(e===t)return{valid:!0,data:e};if(s===x.object&&i===x.object){const s=b.objectKeys(t),i=b.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of i){const i=ge(e[s],t[s]);if(!i.valid)return{valid:!1};n[s]=i.data}return{valid:!0,data:n}}if(s===x.array&&i===x.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const n=ge(e[i],t[i]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===x.date&&i===x.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ye extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(e,i)=>{if(z(e)||z(i))return A;const n=ge(e.value,i.value);return n.valid?((j(e)||j(i))&&t.dirty(),{status:t.value,value:n.data}):(E(s,{code:w.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ye.create=(e,t,s)=>new ye({left:e,right:t,typeName:Ke.ZodIntersection,...K(s)});class Te extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return E(s,{code:w.invalid_type,expected:x.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return E(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new B(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(i).then((e=>C.mergeArray(t,e))):C.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Te({...this._def,rest:e})}}Te.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Te({items:e,typeName:Ke.ZodTuple,rest:null,...K(t)})};class be extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return E(s,{code:w.invalid_type,expected:x.object,received:s.parsedType}),A;const i=[],n=this._def.keyType,a=this._def.valueType;for(const e in s.data)i.push({key:n._parse(new B(s,e,s.path,e)),value:a._parse(new B(s,s.data[e],s.path,e))});return s.common.async?C.mergeObjectAsync(t,i):C.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return new be(t instanceof O?{keyType:e,valueType:t,typeName:Ke.ZodRecord,...K(s)}:{keyType:Q.create(),valueType:e,typeName:Ke.ZodRecord,...K(t)})}}class Me extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return E(s,{code:w.invalid_type,expected:x.map,received:s.parsedType}),A;const i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map((([e,t],a)=>({key:i._parse(new B(s,e,s.path,[a,"key"])),value:n._parse(new B(s,t,s.path,[a,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of a){const i=await s.key,n=await s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of a){const i=s.key,n=s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}Me.create=(e,t,s)=>new Me({valueType:t,keyType:e,typeName:Ke.ZodMap,...K(s)});class xe extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return E(s,{code:w.invalid_type,expected:x.set,received:s.parsedType}),A;const i=this._def;null!==i.minSize&&s.data.size<i.minSize.value&&(E(s,{code:w.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&s.data.size>i.maxSize.value&&(E(s,{code:w.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function a(e){const s=new Set;for(const i of e){if("aborted"===i.status)return A;"dirty"===i.status&&t.dirty(),s.add(i.value)}return{status:t.value,value:s}}const r=[...s.data.values()].map(((e,t)=>n._parse(new B(s,e,s.path,t))));return s.common.async?Promise.all(r).then((e=>a(e))):a(r)}min(e,t){return new xe({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new xe({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}xe.create=(e,t)=>new xe({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...K(t)});class Ge extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return E(t,{code:w.invalid_type,expected:x.function,received:t.parsedType}),A;function s(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:w.invalid_arguments,argumentsError:s}})}function i(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:w.invalid_return_type,returnTypeError:s}})}const n={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Se){const e=this;return P((async function(...t){const r=new k([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw r.addIssue(s(t,e)),r})),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch((e=>{throw r.addIssue(i(l,e)),r}))}))}{const e=this;return P((function(...t){const r=e._def.args.safeParse(t,n);if(!r.success)throw new k([s(t,r.error)]);const o=Reflect.apply(a,this,r.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new k([i(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ge({...this._def,args:Te.create(e).rest(le.create())})}returns(e){return new Ge({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Ge({args:e||Te.create([]).rest(le.create()),returns:t||le.create(),typeName:Ke.ZodFunction,...K(s)})}}class we extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}we.create=(e,t)=>new we({getter:e,typeName:Ke.ZodLazy,...K(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new _e({values:e,typeName:Ke.ZodEnum,...K(t)})}ke.create=(e,t)=>new ke({value:e,typeName:Ke.ZodLiteral,...K(t)});class _e extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return E(t,{expected:b.joinValues(this._def.values),received:t.parsedType,code:w.invalid_type}),A}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_enum_value,options:this._def.values}),A}return P(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return _e.create(e)}exclude(e){return _e.create(this.options.filter((t=>!e.includes(t))))}}_e.create=Ie;class Ne extends O{_parse(e){const t=b.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const e=b.objectValues(t);return E(s,{expected:b.joinValues(e),received:s.parsedType,code:w.invalid_type}),A}if(-1===t.indexOf(e.data)){const e=b.objectValues(t);return E(s,{received:s.data,code:w.invalid_enum_value,options:e}),A}return P(e.data)}get enum(){return this._def.values}}Ne.create=(e,t)=>new Ne({values:e,typeName:Ke.ZodNativeEnum,...K(t)});class Se extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return E(t,{code:w.invalid_type,expected:x.promise,received:t.parsedType}),A;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return P(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Se.create=(e,t)=>new Se({type:e,typeName:Ke.ZodPromise,...K(t)});class Ee extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{E(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(s.data,n);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:s.path,parent:s}))):this._def.schema._parseSync({data:e,path:s.path,parent:s})}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===i.status?A:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?A:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===i.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(e))return e;const a=i.transform(e.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>D(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}b.assertNever(i)}}Ee.create=(e,t,s)=>new Ee({schema:e,typeName:Ke.ZodEffects,effect:t,...K(s)}),Ee.createWithPreprocess=(e,t,s)=>new Ee({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...K(s)});class Ce extends O{_parse(e){return this._getType(e)===x.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ke.ZodOptional,...K(t)});class Ae extends O{_parse(e){return this._getType(e)===x.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:Ke.ZodNullable,...K(t)});class Ze extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...K(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return L(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...K(t)});class ze extends O{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.nan,received:t.parsedType}),A}return{status:"valid",value:e.data}}}ze.create=e=>new ze({typeName:Ke.ZodNaN,...K(e)});const je=Symbol("zod_brand");class De extends O{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class Le extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),Z(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Le({in:e,out:t,typeName:Ke.ZodPipeline})}}class Ue extends O{_parse(e){const t=this._def.innerType._parse(e);return D(t)&&(t.value=Object.freeze(t.value)),t}}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ke.ZodReadonly,...K(t)});const Be=(e,t={},s)=>e?oe.create().superRefine(((i,n)=>{var a,r;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(r=null!==(a=e.fatal)&&void 0!==a?a:s)||void 0===r||r;n.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}})):oe.create(),$e={object:me.lazycreate};var Ke;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ke||(Ke={}));const Oe=Q.create,Re=ee.create,qe=se.create,Ve=Ee.create,Fe={string:e=>Q.create({...e,coerce:!0}),number:e=>ee.create({...e,coerce:!0}),boolean:e=>se.create({...e,coerce:!0}),bigint:e=>te.create({...e,coerce:!0}),date:e=>ie.create({...e,coerce:!0})};var He=Object.freeze({__proto__:null,defaultErrorMap:I,setErrorMap:function(e){_=e},getErrorMap:N,makeIssue:S,EMPTY_PATH:[],addIssueToContext:E,ParseStatus:C,INVALID:A,DIRTY:Z,OK:P,isAborted:z,isDirty:j,isValid:D,isAsync:L,get util(){return b},get objectUtil(){return M},ZodParsedType:x,getParsedType:G,ZodType:O,ZodString:Q,ZodNumber:ee,ZodBigInt:te,ZodBoolean:se,ZodDate:ie,ZodSymbol:ne,ZodUndefined:ae,ZodNull:re,ZodAny:oe,ZodUnknown:le,ZodNever:ce,ZodVoid:de,ZodArray:ue,ZodObject:me,ZodUnion:pe,ZodDiscriminatedUnion:fe,ZodIntersection:ye,ZodTuple:Te,ZodRecord:be,ZodMap:Me,ZodSet:xe,ZodFunction:Ge,ZodLazy:we,ZodLiteral:ke,ZodEnum:_e,ZodNativeEnum:Ne,ZodPromise:Se,ZodEffects:Ee,ZodTransformer:Ee,ZodOptional:Ce,ZodNullable:Ae,ZodDefault:Ze,ZodCatch:Pe,ZodNaN:ze,BRAND:je,ZodBranded:De,ZodPipeline:Le,ZodReadonly:Ue,custom:Be,Schema:O,ZodSchema:O,late:$e,get ZodFirstPartyTypeKind(){return Ke},coerce:Fe,any:oe.create,array:ue.create,bigint:te.create,boolean:qe,date:ie.create,discriminatedUnion:fe.create,effect:Ve,enum:_e.create,function:Ge.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Be((t=>t instanceof e),t),intersection:ye.create,lazy:we.create,literal:ke.create,map:Me.create,nan:ze.create,nativeEnum:Ne.create,never:ce.create,null:re.create,nullable:Ae.create,number:Re,object:me.create,oboolean:()=>qe().optional(),onumber:()=>Re().optional(),optional:Ce.create,ostring:()=>Oe().optional(),pipeline:Le.create,preprocess:Ee.createWithPreprocess,promise:Se.create,record:be.create,set:xe.create,strictObject:me.strictCreate,string:Oe,symbol:ne.create,transformer:Ve,tuple:Te.create,undefined:ae.create,union:pe.create,unknown:le.create,void:de.create,NEVER:A,ZodIssueCode:w,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:k});const We=[["International Date Line West","GMT-11:00","(GMT-11:00) International Date Line West"],["Midway Island","GMT-11:00","(GMT-11:00) Midway Island"],["Samoa","GMT-11:00","(GMT-11:00) Samoa"],["Hawaii","GMT-10:00","(GMT-10:00) Hawaii"],["Alaska","GMT-09:00","(GMT-09:00) Alaska"],["Pacific Time (US & Canada)","GMT-08:00","(GMT-08:00) Pacific Time (US & Canada)"],["Tijuana","GMT-08:00","(GMT-08:00) Tijuana"],["Arizona","GMT-07:00","(GMT-07:00) Arizona"],["Chihuahua","GMT-07:00","(GMT-07:00) Chihuahua"],["Mazatlan","GMT-07:00","(GMT-07:00) Mazatlan"],["Mountain Time (US & Canada)","GMT-07:00","(GMT-07:00) Mountain Time (US & Canada)"],["Central America","GMT-06:00","(GMT-06:00) Central America"],["Central Time (US & Canada)","GMT-06:00","(GMT-06:00) Central Time (US & Canada)"],["Guadalajara","GMT-06:00","(GMT-06:00) Guadalajara"],["Mexico City","GMT-06:00","(GMT-06:00) Mexico City"],["Monterrey","GMT-06:00","(GMT-06:00) Monterrey"],["Saskatchewan","GMT-06:00","(GMT-06:00) Saskatchewan"],["Bogota","GMT-05:00","(GMT-05:00) Bogota"],["Eastern Time (US & Canada)","GMT-05:00","(GMT-05:00) Eastern Time (US & Canada)"],["Indiana (East)","GMT-05:00","(GMT-05:00) Indiana (East)"],["Lima","GMT-05:00","(GMT-05:00) Lima"],["Quito","GMT-05:00","(GMT-05:00) Quito"],["Caracas","GMT-04:30","(GMT-04:30) Caracas"],["Atlantic Time (Canada)","GMT-04:00","(GMT-04:00) Atlantic Time (Canada)"],["Georgetown","GMT-04:00","(GMT-04:00) Georgetown"],["La Paz","GMT-04:00","(GMT-04:00) La Paz"],["Santiago","GMT-04:00","(GMT-04:00) Santiago"],["Newfoundland","GMT-03:30","(GMT-03:30) Newfoundland"],["Brasilia","GMT-03:00","(GMT-03:00) Brasilia"],["Buenos Aires","GMT-03:00","(GMT-03:00) Buenos Aires"],["Greenland","GMT-03:00","(GMT-03:00) Greenland"],["Mid-Atlantic","GMT-02:00","(GMT-02:00) Mid-Atlantic"],["Azores","GMT-01:00","(GMT-01:00) Azores"],["Cape Verde Is.","GMT-01:00","(GMT-01:00) Cape Verde Is."],["Casablanca","GMT+00:00","(GMT+00:00) Casablanca"],["Dublin","GMT+00:00","(GMT+00:00) Dublin"],["Edinburgh","GMT+00:00","(GMT+00:00) Edinburgh"],["Lisbon","GMT+00:00","(GMT+00:00) Lisbon"],["London","GMT+00:00","(GMT+00:00) London"],["Monrovia","GMT+00:00","(GMT+00:00) Monrovia"],["UTC","GMT+00:00","(GMT+00:00) UTC"],["Amsterdam","GMT+01:00","(GMT+01:00) Amsterdam"],["Belgrade","GMT+01:00","(GMT+01:00) Belgrade"],["Berlin","GMT+01:00","(GMT+01:00) Berlin"],["Bern","GMT+01:00","(GMT+01:00) Bern"],["Bratislava","GMT+01:00","(GMT+01:00) Bratislava"],["Brussels","GMT+01:00","(GMT+01:00) Brussels"],["Budapest","GMT+01:00","(GMT+01:00) Budapest"],["Copenhagen","GMT+01:00","(GMT+01:00) Copenhagen"],["Ljubljana","GMT+01:00","(GMT+01:00) Ljubljana"],["Madrid","GMT+01:00","(GMT+01:00) Madrid"],["Paris","GMT+01:00","(GMT+01:00) Paris"],["Prague","GMT+01:00","(GMT+01:00) Prague"],["Rome","GMT+01:00","(GMT+01:00) Rome"],["Sarajevo","GMT+01:00","(GMT+01:00) Sarajevo"],["Skopje","GMT+01:00","(GMT+01:00) Skopje"],["Stockholm","GMT+01:00","(GMT+01:00) Stockholm"],["Vienna","GMT+01:00","(GMT+01:00) Vienna"],["Warsaw","GMT+01:00","(GMT+01:00) Warsaw"],["West Central Africa","(GMT+01:00","(GMT+01:00) West Central Africa"],["Zagreb","GMT+01:00","(GMT+01:00) Zagreb"],["Athens","GMT+02:00","(GMT+02:00) Athens"],["Bucharest","GMT+02:00","(GMT+02:00) Bucharest"],["Cairo","GMT+02:00","(GMT+02:00) Cairo"],["Harare","GMT+02:00","(GMT+02:00) Harare"],["Helsinki","GMT+02:00","(GMT+02:00) Helsinki"],["Istanbul","GMT+02:00","(GMT+02:00) Istanbul"],["Jerusalem","GMT+02:00","(GMT+02:00) Jerusalem"],["Kyiv","GMT+02:00","(GMT+02:00) Kyiv"],["Minsk","GMT+02:00","(GMT+02:00) Minsk"],["Pretoria","GMT+02:00","(GMT+02:00) Pretoria"],["Riga","GMT+02:00","(GMT+02:00) Riga"],["Sofia","GMT+02:00","(GMT+02:00) Sofia"],["Tallinn","GMT+02:00","(GMT+02:00) Tallinn"],["Vilnius","GMT+02:00","(GMT+02:00) Vilnius"],["Baghdad","GMT+03:00","(GMT+03:00) Baghdad"],["Kuwait","GMT+03:00","(GMT+03:00) Kuwait"],["Moscow","GMT+03:00","(GMT+03:00) Moscow"],["Nairobi","GMT+03:00","(GMT+03:00) Nairobi"],["Riyadh","GMT+03:00","(GMT+03:00) Riyadh"],["St. Petersburg","GMT+03:00","(GMT+03:00) St. Petersburg"],["Volgograd","GMT+03:00","(GMT+03:00) Volgograd"],["Tehran","GMT+03:30","(GMT+03:30) Tehran"],["Abu Dhabi","GMT+04:00","(GMT+04:00) Abu Dhabi"],["Baku","GMT+04:00","(GMT+04:00) Baku"],["Muscat","GMT+04:00","(GMT+04:00) Muscat"],["Tbilisi","GMT+04:00","(GMT+04:00) Tbilisi"],["Yerevan","GMT+04:00","(GMT+04:00) Yerevan"],["Kabul","GMT+04:30","(GMT+04:30) Kabul"],["Ekaterinburg","GMT+05:00","(GMT+05:00) Ekaterinburg"],["Islamabad","GMT+05:00","(GMT+05:00) Islamabad"],["Karachi","GMT+05:00","(GMT+05:00) Karachi"],["Tashkent","GMT+05:00","(GMT+05:00) Tashkent"],["Chennai","GMT+05:30","(GMT+05:30) Chennai"],["Kolkata","GMT+05:30","(GMT+05:30) Kolkata"],["Mumbai","GMT+05:30","(GMT+05:30) Mumbai"],["New Delhi","GMT+05:30","(GMT+05:30) New Delhi"],["Sri Jayawardenepura","GMT+05:30","(GMT+05:30) Sri Jayawardenepura"],["Kathmandu","GMT+05:45","(GMT+05:45) Kathmandu"],["Almaty","GMT+06:00","(GMT+06:00) Almaty"],["Astana","GMT+06:00","(GMT+06:00) Astana"],["Dhaka","GMT+06:00","(GMT+06:00) Dhaka"],["Novosibirsk","GMT+06:00","(GMT+06:00) Novosibirsk"],["Rangoon","GMT+06:30","(GMT+06:30) Rangoon"],["Bangkok","GMT+07:00","(GMT+07:00) Bangkok"],["Hanoi","GMT+07:00","(GMT+07:00) Hanoi"],["Jakarta","GMT+07:00","(GMT+07:00) Jakarta"],["Krasnoyarsk","GMT+07:00","(GMT+07:00) Krasnoyarsk"],["Beijing","GMT+08:00","(GMT+08:00) Beijing"],["Chongqing","GMT+08:00","(GMT+08:00) Chongqing"],["Hong Kong","GMT+08:00","(GMT+08:00) Hong Kong"],["Irkutsk","GMT+08:00","(GMT+08:00) Irkutsk"],["Kuala Lumpur","GMT+08:00","(GMT+08:00) Kuala Lumpur"],["Perth","GMT+08:00","(GMT+08:00) Perth"],["Singapore","GMT+08:00","(GMT+08:00) Singapore"],["Taipei","GMT+08:00","(GMT+08:00) Taipei"],["Ulaan Bataar","GMT+08:00","(GMT+08:00) Ulaan Bataar"],["Urumqi","GMT+08:00","(GMT+08:00) Urumqi"],["Osaka","GMT+09:00","(GMT+09:00) Osaka"],["Sapporo","GMT+09:00","(GMT+09:00) Sapporo"],["Seoul","GMT+09:00","(GMT+09:00) Seoul"],["Tokyo","GMT+09:00","(GMT+09:00) Tokyo"],["Yakutsk","GMT+09:00","(GMT+09:00) Yakutsk"],["Adelaide","GMT+09:30","(GMT+09:30) Adelaide"],["Darwin","GMT+09:30","(GMT+09:30) Darwin"],["Brisbane","GMT+10:00","(GMT+10:00) Brisbane"],["Canberra","GMT+10:00","(GMT+10:00) Canberra"],["Guam","GMT+10:00","(GMT+10:00) Guam"],["Hobart","GMT+10:00","(GMT+10:00) Hobart"],["Melbourne","GMT+10:00","(GMT+10:00) Melbourne"],["Port Moresby","GMT+10:00","(GMT+10:00) Port Moresby"],["Sydney","GMT+10:00","(GMT+10:00) Sydney"],["Vladivostok","GMT+10:00","(GMT+10:00) Vladivostok"],["Kamchatka","GMT+11:00","(GMT+11:00) Kamchatka"],["Magadan","GMT+11:00","(GMT+11:00) Magadan"],["New Caledonia","GMT+11:00","(GMT+11:00) New Caledonia"],["Solomon Is.","GMT+11:00","(GMT+11:00) Solomon Is."],["Auckland","GMT+12:00","(GMT+12:00) Auckland"],["Fiji","GMT+12:00","(GMT+12:00) Fiji"],["Marshall Is.","GMT+12:00","(GMT+12:00) Marshall Is."],["Wellington","GMT+12:00","(GMT+12:00) Wellington"],["Nuku'alofa","GMT+13:00","(GMT+13:00) Nuku'alofa"]].map((e=>({value:e[2],label:e[2]}))),Je=He.object({business_name:He.string().trim().max(30).optional(),contact_email:He.string().trim().email("Invalid email").optional().or(He.literal("")),phone:He.preprocess((e=>p(String(e).trim())),He.string().optional()),timezone:He.string().trim().optional(),url:He.string().trim().optional()}),Ye=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.organizationUpdated=t(this,"organizationUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.name="",this.business_name="",this.contact_email="",this.phone="",this.address="",this.address2="",this.timezone="",this.url=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await(t=this.endpoint,s=this.endpoint.session.organization_id,t.api.get("/organizations/".concat(s)).then((function(e){return e.data})));var t,s;console.log("[SETTINGS] Loaded organization",e),this.resetForm(e)}resetForm(e){this.name=e.name,this.business_name=e.business_name,this.contact_email=e.contact_email,this.phone=e.phone,this.address=e.address,this.address2=e.address2,this.timezone=e.timezone,this.url=e.url,this.dirty=!1,this.valid=!0}handleSubmit(e){var t,s,i;e.preventDefault(),e.stopPropagation(),(t=n.getDefault(),s=this.endpoint.session.organization_id,i={name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url},t.api.patch("/organizations/".concat(s),i).then((function(e){return e.data}))).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.organizationUpdated)||void 0===t||t.emit({endpoint:this.endpoint,organization:e}),this.resetForm(e)})).catch((e=>l(`Error updating organization: ${e.message}`,{style:"error"})))}processFields(){const e=Je.safeParse({name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"Organization Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-name",value:this.name,autocomplete:"off",label:"Name",required:!1,disabled:!1,placeholder:"Enter your organization's name...",onInput:e=>this.name=e.target.value,onFocusout:e=>{this.name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-business-name",value:this.business_name,autocomplete:"off",label:"Display Name",placeholder:"The name to display on communications...",onInput:e=>this.business_name=e.target.value,onFocusout:e=>{this.business_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-url",value:this.url,autocomplete:"off",label:"Web URL",placeholder:"Enter your Web URL...",onInput:e=>this.url=e.target.value,onFocusout:e=>{this.url=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-phone",value:this.phone,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-email",value:this.contact_email,clearable:!0,autocomplete:"off",label:"Contact Email",placeholder:"Enter your contact email address...",onInput:e=>this.contact_email=e.target.value,onFocusout:e=>{this.contact_email=e.target.value.trim(),this.processFields()}}),s("verdocs-select-input",{options:We,value:this.timezone,label:"Time Zone"}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};Ye.style='verdocs-settings-organization{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-organization .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-organization .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-organization verdocs-text-input{margin:10px 0}verdocs-settings-organization verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-organization .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';const Qe=He.object({first_name:He.string().trim().min(1,"First name is required").max(30),last_name:He.string().trim().min(1,"Last name is required").max(30),email:He.string().trim().email("Invalid email").min(1,"Email is required"),phone:He.preprocess((e=>p(String(e).trim())),He.string())}),Xe=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.profileUpdated=t(this,"profileUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.first_name="",this.last_name="",this.email="",this.phone=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await u(this.endpoint);console.log("[SETTINGS] Loaded profile",e),this.resetForm(e)}resetForm(e){this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.dirty=!1,this.valid=!0}handleSubmit(e){e.preventDefault(),e.stopPropagation(),h(n.getDefault(),this.endpoint.session.profile_id,{first_name:this.first_name,last_name:this.last_name,phone:this.phone}).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.profileUpdated)||void 0===t||t.emit({endpoint:this.endpoint,profile:e}),this.resetForm(e)})).catch((e=>l(`Error updating profile: ${e.message}`,{style:"error"})))}processFields(){const e=Qe.safeParse({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"My Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-first-name",value:this.first_name,autocomplete:"off",label:"First Name",required:!0,placeholder:"Enter your first name...",onInput:e=>this.first_name=e.target.value,onFocusout:e=>{this.first_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-last-name",value:this.last_name,autocomplete:"off",label:"Last Name",required:!0,placeholder:"Enter your last name...",onInput:e=>this.last_name=e.target.value,onFocusout:e=>{this.last_name=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-email",value:this.email,autocomplete:"off",label:"Email Address",required:!0,disabled:!0,placeholder:"Enter your email address...",onInput:e=>this.email=e.target.value,onFocusout:e=>{this.email=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-phone",value:this.phone,clearable:!0,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};Xe.style='verdocs-settings-profile{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-profile .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-profile .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-profile verdocs-text-input{margin:10px 0}verdocs-settings-profile verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-profile .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';export{f as verdocs_settings_api_keys,T as verdocs_settings_members,Ye as verdocs_settings_organization,Xe as verdocs_settings_profile}
|
@@ -1 +1 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++){r=arguments[t];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var i=0,s=r.length,n;i<s;i++){if(n||!(i in r)){if(!n)n=Array.prototype.slice.call(r,0,i);n[i]=r[i]}}return e.concat(n||Array.prototype.slice.call(r))};System.register(["./p-3af6b910.system.js"],(function(e){"use strict";var r;return{setters:[function(e){r=e.c}],execute:function(){var t={};var i=e("g",(function(e){if(!t[e]){t[e]=r({fields:[]})}return t[e]}));var s=e("c",(function(e){var s=i(e.id);if(!s){console.log("Creating template field store for template",e);s=r({fields:[]});t[e.id]=s}s.set("fields",__spreadArray([],e.fields,true));return s}));var n=e("a",(function(e){var s=i(e.template_id);if(!s){console.log("Creating field store for envelope",e.id,e.template_id);s=r({fields:[]});t[e.template_id]=s}else{console.log("Resetting field store for envelope",e.id,e.template_id);s.reset()}s.set("fields",__spreadArray([],e.fields,true));return s}));var a=e("u",(function(e,r,t){var i=
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++){r=arguments[t];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var i=0,s=r.length,n;i<s;i++){if(n||!(i in r)){if(!n)n=Array.prototype.slice.call(r,0,i);n[i]=r[i]}}return e.concat(n||Array.prototype.slice.call(r))};System.register(["./p-3af6b910.system.js"],(function(e){"use strict";var r;return{setters:[function(e){r=e.c}],execute:function(){var t={};var i=e("g",(function(e){if(!t[e]){t[e]=r({fields:[]})}return t[e]}));var s=e("c",(function(e){var s=i(e.id);if(!s){console.log("Creating template field store for template",e);s=r({fields:[]});t[e.id]=s}s.set("fields",__spreadArray([],e.fields,true));return s}));var n=e("a",(function(e){var s=i(e.template_id);if(!s){console.log("Creating field store for envelope",e.id,e.template_id);s=r({fields:[]});t[e.template_id]=s}else{console.log("Resetting field store for envelope",e.id,e.template_id);s.reset()}s.set("fields",__spreadArray([],e.fields,true));return s}));var a=e("u",(function(e,r,t){var i=e.get("fields")||[];if(r!==t.name){console.log("Renaming",r,t.name);var s=i.filter((function(e){return e.name!==r}));e.set("fields",__spreadArray(__spreadArray([],s,true),[t],false))}else{console.log("Updating",r);e.set("fields",i.map((function(e){return e.name===r?__assign(__assign({},e),t):__assign({},e)})))}}))}}}));
|
@@ -1 +1 @@
|
|
1
|
-
import{r as e,c as t,h as s,H as i,a as l}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as o}from"./p-035f6b38.js";import{g as d}from"./p-
|
1
|
+
import{r as e,c as t,h as s,H as i,a as l}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as o}from"./p-035f6b38.js";import{g as d}from"./p-47c63cc7.js";import{S as a}from"./p-7a1b2643.js";import"./p-7648c449.js";import"./p-b086f9be.js";import"./p-ef20cb50.js";const n=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.send=t(this,"send",7),this.templateUpdated=t(this,"templateUpdated",7),this.templateCreated=t(this,"templateCreated",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.endpoint=o.getDefault(),this.templateId=null,this.step="preview",this.store=null}onTemplateIdChanged(e){console.log("Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return console.log("[BUILD] No template ID, activating upload mode"),void(this.step="attachments");if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(i){console.log("[BUILD] Error loading template",i),null===(e=this.sdkError)||void 0===e||e.emit(new a(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}async loadTemplate(e){e&&(console.log("Loading store",e),this.store=await d(this.endpoint,e,!1))}handleCancel(e){console.log("Cancel",e.detail),this.step="preview"}async handleTemplateCreated(e){var t;await this.loadTemplate(e),this.templateId=e,this.step="roles",null===(t=this.stepChanged)||void 0===t||t.emit("roles")}async handleRolesUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}async handleTemplateUpdated(e){var t;null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles",null===(e=this.stepChanged)||void 0===e||e.emit("roles")}handleRolesNext(){var e;this.step="fields",null===(e=this.stepChanged)||void 0===e||e.emit("fields")}handleStepChanged(e){var t;console.log("osc",e),this.step=e,null===(t=this.stepChanged)||void 0===t||t.emit(e)}render(){return this.endpoint.session?this.store?(console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step)),s(i,null,s("div",{class:"content"},s("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),"attachments"===this.step&&s("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"roles"===this.step&&s("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),"settings"===this.step&&s("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},s("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),s("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),s("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)})),"fields"===this.step&&s("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"preview"===this.step&&s("div",{class:"preview-container"},s("div",{class:"preview-send-wrapper"},s("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var t;return null===(t=this.send)||void 0===t?void 0:t.emit(e.detail)},style:{width:"100%"}})),s("div",{class:"preview-preview-wrapper"},s("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))):(console.log("[BUILD] No template ID, rendering created view"),s(i,null,s("div",{class:"content"},s("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),s("verdocs-template-create",{endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateCreated:e=>this.handleTemplateCreated(e.detail.templateId)})))):s(i,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return l(this)}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};n.style='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';export{n as verdocs_build}
|
@@ -0,0 +1 @@
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[s]=t[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function s(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function l(e){try{r(i.next(e))}catch(e){o(e)}}function a(e){try{r(i["throw"](e))}catch(e){o(e)}}function r(e){e.done?n(e.value):s(e.value).then(l,a)}r((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return r([e,t])}}function r(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,s&&(o=l[0]&2?s["return"]:l[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;if(s=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;s=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1];o=l;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(l);break}if(o[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];s=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,o;i<s;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-8aae8d16.system.js","./p-1d60151a.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-3bcd86ea.system.js","./p-cacffa79.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,n,i,s,o,l,a,r,c,d,p,u,v,h;return{setters:[function(e){t=e.r;n=e.c;i=e.h;s=e.H},function(e){o=e.l;l=e.c},function(e){a=e.g;r=e.a;c=e.b},function(){},function(e){d=e.V},function(e){p=e.i},function(e){u=e.s},function(e){v=e.V},function(e){h=e.S},function(){},function(){},function(){}],execute:function(){var f='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';var g='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var m=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var x=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var w=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var y=e("verdocs_envelopes_list",function(){function e(e){t(this,e);this.changeView=n(this,"changeView",7);this.changeStatus=n(this,"changeStatus",7);this.changeSort=n(this,"changeSort",7);this.changeMatch=n(this,"changeMatch",7);this.sdkError=n(this,"sdkError",7);this.viewEnvelope=n(this,"viewEnvelope",7);this.finishEnvelope=n(this,"finishEnvelope",7);this.endpoint=d.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleMatchUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ENVELOPES] Must be authenticated");return}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.queryEnvelopes()];case 1:e.sent();this.initiallyLoaded=true;return[2]}}))}))};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,s,l;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign({},i);break;case"sent":i=__assign(__assign({},i),{is_owner:true});break;case"action":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"waiting":i=__assign(__assign({},i),{is_owner:true,status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{status:["complete"]});break;default:i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.status=[this.status]}}if(this.match.trim());return[4,o(this.endpoint,i)];case 1:s=a.sent();this.envelopes=s.envelopes;this.count=s.total;this.loading=false;return[3,3];case 2:l=a.sent();this.loading=false;console.log("[ENVELOPES] Error listing envelopes",l);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new h(l.message,(t=l.response)===null||t===void 0?void 0:t.status,(n=l.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;u(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){u(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return i(s,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:function(t){var n;e.match=t.target.value.trim();(n=e.changeMatch)===null||n===void 0?void 0:n.emit(e.match)}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:m,onOptionSelected:function(t){e.view=t.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:x,onOptionSelected:function(t){e.status=t.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:w,onOptionSelected:function(t){e.sort=t.detail.value}}),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(t){var n;var s=a(t);var o=c(e.endpoint.session,t);var d=s.find((function(t){var n;return t.email===((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||""}));var p=d&&o&&r(((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||"",s);var u=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!p},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!o}];return i("div",{class:"envelope",key:t.id,onClick:function(){var n;return(n=e.viewEnvelope)===null||n===void 0?void 0:n.emit({endpoint:e.endpoint,envelope:t})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===t.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(n){if(n.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[t],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==t.id}))}}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:g,class:"envelope-icon"}),i("div",{class:"envelope-name"},t.name,": ",i("div",{class:"envelope-recipients"},t.recipients.map((function(e){return e.full_name})).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:t,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(t.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:u,onOptionSelected:function(n){var i,s;switch(n.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:t});break;case"finish":(s=e.finishEnvelope)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:t});break;case"download":e.downloadEnvelope(t);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){l(e.endpoint,t.id).then((function(){return v("Envelope canceled")})).catch((function(e){return v("Unable to cancel envelope: "+e.messabge,{style:"error"})}));e.queryEnvelopes().catch((function(){}))}break}}})))})),!this.initiallyLoaded&&i("div",{style:{width:"100%"}},p(0,this.rowsPerPage).map((function(){return i("div",{class:"envelope-placeholder"})}))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:function(t){e.selectedPage=t.detail.selectedPage}})):i("div",null))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}());y.style=f}}}));
|