@verdocs/web-sdk 2.3.14 → 2.3.16
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/{EnvelopeStore-f8c301e1.js → EnvelopeStore-efc35530.js} +1 -1
- package/dist/cjs/{Envelopes-99ca79fe.js → Envelopes-0b9deb2c.js} +2 -6
- package/dist/cjs/{Profiles-54271244.js → Profiles-1a26e4eb.js} +0 -34
- package/dist/cjs/TemplateFieldStore-7449e5ff.js +24 -0
- package/dist/cjs/{TemplateStore-d9936a68.js → TemplateStore-0074c71d.js} +3 -1
- package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
- package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-8f298664.js} +197 -563
- package/dist/cjs/{_commonjsHelpers-0c557e26.js → _commonjsHelpers-1fbbf0eb.js} +0 -5
- package/dist/cjs/interact.min-a61b43b3.js +12 -0
- package/dist/cjs/ipc-test.cjs.entry.js +3 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-2ddfdf9e.js → utils-0916d10f.js} +3 -3
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-auth.cjs.entry.js +8 -34
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +71 -45
- package/dist/cjs/{verdocs-contact-picker_2.cjs.entry.js → verdocs-contact-picker_3.cjs.entry.js} +78 -6
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +5 -4
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-field-attachment.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-date.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +4 -5
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +10 -9
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +19 -10
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +10 -8
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +79 -0
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +70 -37
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +12 -9
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +92 -80
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.css +0 -0
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +181 -0
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.stories.js +20 -0
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +20 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +6 -34
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +2 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +8 -4
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +4 -1
- package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -0
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -0
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +0 -1
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +2 -1
- 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 -1
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -0
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +71 -44
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +80 -68
- package/dist/collection/utils/TemplateFieldStore.js +18 -0
- package/dist/collection/utils/TemplateStore.js +2 -0
- package/dist/collection/utils/Types.js +2 -1
- package/dist/components/Envelopes.js +2 -6
- package/dist/components/TemplateStore.js +21 -2
- package/dist/components/Types2.js +2 -1
- package/dist/components/VerdocsEndpoint.js +197 -562
- package/dist/components/_commonjsHelpers.js +1 -5
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index3.js +40 -29
- package/dist/components/interact.min.js +5 -6
- package/dist/components/verdocs-auth.js +12 -46
- package/dist/components/verdocs-build.js +22 -16
- package/dist/components/verdocs-contact-picker2.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -0
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +0 -1
- package/dist/components/verdocs-field-textarea.js +5 -4
- package/dist/components/verdocs-field-textbox.js +14 -5
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js +3 -1
- package/dist/components/verdocs-portal.d.ts +11 -0
- package/dist/components/verdocs-portal.js +6 -0
- package/dist/components/verdocs-portal2.js +93 -0
- package/dist/components/verdocs-preview2.js +1 -1
- package/dist/components/verdocs-search.js +2 -8
- package/dist/components/verdocs-send2.js +12 -5
- package/dist/components/verdocs-settings-organization2.js +22 -1
- package/dist/components/verdocs-sign.js +8 -4
- package/dist/components/verdocs-template-create2.js +2 -2
- package/dist/components/verdocs-template-field-properties2.js +71 -45
- package/dist/components/verdocs-template-fields2.js +83 -72
- package/dist/components/verdocs-template-roles2.js +4 -4
- package/dist/docs.json +156 -108
- package/dist/esm/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
- package/dist/esm/{Envelopes-21ffb899.js → Envelopes-627c5239.js} +2 -6
- package/dist/esm/{Profiles-4cc942ef.js → Profiles-d4df4d1c.js} +1 -32
- package/dist/esm/TemplateFieldStore-4f1b6332.js +21 -0
- package/dist/esm/{TemplateStore-018fc1db.js → TemplateStore-a2ebdaca.js} +3 -1
- package/dist/esm/Types-1628dc71.js +5 -0
- package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-56fa3371.js} +197 -562
- package/dist/esm/{_commonjsHelpers-5ec8f9b7.js → _commonjsHelpers-8a9f3b18.js} +1 -5
- package/dist/esm/interact.min-6a7b19a1.js +10 -0
- package/dist/esm/ipc-test.entry.js +3 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-d269cea3.js → utils-ca3121df.js} +3 -3
- package/dist/esm/verdocs-activity-box.entry.js +2 -2
- package/dist/esm/verdocs-auth.entry.js +8 -34
- package/dist/esm/verdocs-build.entry.js +3 -2
- package/dist/esm/verdocs-button-panel_2.entry.js +71 -45
- package/dist/esm/{verdocs-contact-picker_2.entry.js → verdocs-contact-picker_3.entry.js} +78 -7
- package/dist/esm/verdocs-envelope-document-page.entry.js +5 -5
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
- package/dist/esm/verdocs-envelope-sidebar.entry.js +5 -4
- package/dist/esm/verdocs-envelopes-list.entry.js +5 -5
- package/dist/esm/verdocs-field-attachment.entry.js +4 -4
- package/dist/esm/verdocs-field-checkbox.entry.js +4 -4
- package/dist/esm/verdocs-field-date.entry.js +5 -5
- package/dist/esm/verdocs-field-dropdown.entry.js +4 -5
- package/dist/esm/verdocs-field-initial.entry.js +4 -4
- package/dist/esm/verdocs-field-payment.entry.js +4 -4
- package/dist/esm/verdocs-field-radio-button.entry.js +4 -4
- package/dist/esm/verdocs-field-signature.entry.js +4 -4
- package/dist/esm/verdocs-field-textarea.entry.js +10 -9
- package/dist/esm/verdocs-field-textbox.entry.js +19 -10
- package/dist/esm/verdocs-field-timestamp.entry.js +5 -5
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +2 -1
- package/dist/esm/verdocs-pagination_2.entry.js +4 -4
- package/dist/esm/verdocs-preview_8.entry.js +10 -8
- package/dist/esm/verdocs-quick-functions_2.entry.js +74 -0
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +68 -35
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +12 -9
- package/dist/esm/verdocs-template-document-page_2.entry.js +5 -5
- package/dist/esm/verdocs-template-fields_4.entry.js +92 -80
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +5 -5
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
- package/dist/esm-es5/Envelopes-627c5239.js +1 -0
- package/dist/esm-es5/Profiles-d4df4d1c.js +1 -0
- package/dist/esm-es5/TemplateFieldStore-4f1b6332.js +1 -0
- package/dist/esm-es5/TemplateStore-a2ebdaca.js +1 -0
- package/dist/esm-es5/Types-1628dc71.js +1 -0
- package/dist/esm-es5/VerdocsEndpoint-56fa3371.js +1 -0
- package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +1 -0
- package/dist/esm-es5/interact.min-6a7b19a1.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-d269cea3.js → utils-ca3121df.js} +2 -2
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_3.entry.js +1 -0
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.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-quick-functions_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.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/controls/verdocs-portal/verdocs-portal.d.ts +37 -0
- package/dist/types/components/{elements/verdocs-search-activity/verdocs-search-activity.stories.d.ts → controls/verdocs-portal/verdocs-portal.stories.d.ts} +3 -6
- package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +4 -0
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +0 -2
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
- package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +7 -0
- package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +8 -5
- package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +4 -2
- package/dist/types/components.d.ts +58 -34
- package/dist/types/utils/TemplateFieldStore.d.ts +6 -0
- package/dist/types/utils/TemplateStore.d.ts +1 -1
- package/dist/types/utils/Types.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/dist/verdocs-web-sdk/{p-a35314fe.js → p-02a71e03.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-035a3ce2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-035f6b38.js +1 -0
- package/dist/verdocs-web-sdk/{p-1406ffd2.entry.js → p-05e6bc91.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-0685d939.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-084c23e4.system.js +1 -0
- package/dist/verdocs-web-sdk/p-0abf0058.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-12d00a0f.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-17598002.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-04d7d759.system.entry.js → p-17bf98f2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1a7aa04b.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-1cb878c8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-1e38b22f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ebc4142c.js → p-1f78be32.js} +1 -1
- package/dist/verdocs-web-sdk/p-22e0d2bc.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-2ccbf54d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-319c00bd.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-32c40388.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-358aef29.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-37dfdc84.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-3cd0d440.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3e607686.js +1 -0
- package/dist/verdocs-web-sdk/{p-a171983b.system.entry.js → p-3f3807b0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8da1555a.entry.js → p-410c63e6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-429cad70.js +1 -0
- package/dist/verdocs-web-sdk/{p-3a702f79.entry.js → p-46624bec.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-4d98f194.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-af3e9624.entry.js → p-4e47ed1c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4e74bb3c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-588d6cea.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-e3a9d167.system.entry.js → p-59769c39.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-5aa77f6d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5bf12ef8.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-6331d113.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9b07a2a7.entry.js → p-637187de.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-6685ff29.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-6dd69d82.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-72978ba3.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-736fbb87.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-76f8c30a.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-7b30c523.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-7d5dbd9a.js +1 -0
- package/dist/verdocs-web-sdk/{p-eef694e8.entry.js → p-82d4afbf.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
- package/dist/verdocs-web-sdk/{p-c694cf93.system.js → p-840827b7.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-870707e8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8aae8d16.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-14aefeb2.system.entry.js → p-8af68516.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-8b0a5309.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8dc15d33.js +1 -0
- package/dist/verdocs-web-sdk/p-915883e6.js +1 -0
- package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-9360b085.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-94009f45.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7e8d64fb.system.js → p-9615b087.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-9bf2d124.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-5c50a778.system.entry.js → p-9ceff040.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-9fc06f7b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0df58c57.entry.js → p-a40b3946.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a627881e.system.js +1 -0
- package/dist/verdocs-web-sdk/p-aae6b4e0.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-35769d0c.system.entry.js → p-ac98f6f1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bd0bc3dd.system.entry.js → p-acc873cf.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-b6231fd3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-b648ab63.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a52a832b.system.entry.js → p-b7a815e9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-b91de346.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-ba653c39.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-bd9ba3b3.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-c80237f9.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-cd20fb77.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-cf703fe4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d0a09719.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-013d1556.system.entry.js → p-d1ea580b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-d39e4a26.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-137cedc8.entry.js → p-d59b6988.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d61fda4b.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-d99a05e4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-dc2ad047.js +1 -0
- package/dist/verdocs-web-sdk/{p-0f94d635.entry.js → p-dd2c2edc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-e1bc55f8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e28878eb.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e2ae3679.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e2ff37fb.system.js +1 -0
- package/dist/verdocs-web-sdk/p-e3ffc00f.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e4dc3264.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-cf765153.entry.js → p-eeca4c30.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-3f9fbf94.entry.js → p-f42c84f1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-dd8845d4.system.entry.js → p-f6b7439f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +8 -7
- package/dist/cjs/interact.min-ba5cc513.js +0 -13
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +0 -220
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +0 -66
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +0 -187
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +0 -14
- package/dist/components/Organizations.js +0 -32
- package/dist/components/verdocs-search-activity.d.ts +0 -11
- package/dist/components/verdocs-search-activity.js +0 -6
- package/dist/components/verdocs-search-activity2.js +0 -170
- package/dist/esm/Types-de18e225.js +0 -4
- package/dist/esm/interact.min-cf83fa88.js +0 -11
- package/dist/esm/verdocs-quick-functions_3.entry.js +0 -214
- package/dist/esm-es5/Envelopes-21ffb899.js +0 -1
- package/dist/esm-es5/Profiles-4cc942ef.js +0 -1
- package/dist/esm-es5/TemplateStore-018fc1db.js +0 -1
- package/dist/esm-es5/Types-de18e225.js +0 -1
- package/dist/esm-es5/VerdocsEndpoint-b011af25.js +0 -1
- package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +0 -1
- package/dist/esm-es5/interact.min-cf83fa88.js +0 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +0 -1
- package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +0 -33
- package/dist/verdocs-web-sdk/p-01166179.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-04580be0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0ad1fd33.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0d28cf05.js +0 -1
- package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-17d0e5f4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-23be436b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2ccbcfeb.system.js +0 -1
- package/dist/verdocs-web-sdk/p-30b4bd45.js +0 -1
- package/dist/verdocs-web-sdk/p-3305a941.system.js +0 -1
- package/dist/verdocs-web-sdk/p-343672f5.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-409e992a.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4a94ee00.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-51756c1b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5a91bf23.js +0 -1
- package/dist/verdocs-web-sdk/p-5df0fa7a.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6307e6ae.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-76907130.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7b63017c.js +0 -1
- package/dist/verdocs-web-sdk/p-7fd7152d.system.js +0 -1
- package/dist/verdocs-web-sdk/p-89aa696c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-961708ac.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-983da2f6.js +0 -1
- package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a5425a9b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b17a20b8.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-bb2c866b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-bbee73c8.system.js +0 -1
- package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cbbf849f.system.js +0 -1
- package/dist/verdocs-web-sdk/p-cbd0802f.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-de60d3a8.js +0 -1
- package/dist/verdocs-web-sdk/p-eab67c09.js +0 -1
- package/dist/verdocs-web-sdk/p-eb595245.system.js +0 -1
- package/dist/verdocs-web-sdk/p-ecf04564.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ee195e5e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f1257cd0.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f65a1b9e.system.js +0 -1
- package/dist/verdocs-web-sdk/p-fde6b724.entry.js +0 -1
@@ -1 +0,0 @@
|
|
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-30b4bd45.js";import{r as n,b as r}from"./p-a35314fe.js";import{g as d,a as c}from"./p-7b63017c.js";import{S as p}from"./p-7a1b2643.js";import{j as h}from"./p-5a91bf23.js";import{a as v,i as m}from"./p-e8ce0b6f.js";import{g as u}from"./p-6de76553.js";import{c as x,d as f}from"./p-567a6e7c.js";import{D as b,P as g,J as y,a as w,F as k,b as S,T as E}from"./p-637fee9b.js";import{V as z}from"./p-ed416acf.js";import"./p-eab67c09.js";import"./p-aa124212.js";import"./p-de60d3a8.js";import"./p-c220af42.js";import"./p-7648c449.js";const C=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=o.getDefault(),this.templateId=null}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");this.store=await d(this.endpoint,this.templateId,!0),console.log(`[PREVIEW] Loading template ${this.templateId}`,this.endpoint.session)}catch(s){console.log("[PREVIEW] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new p(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;(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.fields.filter((e=>e.page_sequence===s.pageNumber))).forEach((e=>n(e,s,r(c(this.store),e.role_name),{disabled:!0,editable:!1,draggable:!1})))}render(){var e,t,o,l;if(!(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded))return i(s,null,i("verdocs-loader",null));const a=[...null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l?void 0:l.pages];return a.sort(((e,t)=>e.sequence-t.sequence)),i(s,null,a.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"}]}))))}};C.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 T='<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>',I=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.store=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,a,n,r,c;try{const n=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.store=await d(this.endpoint,this.templateId,!0),(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable)||console.warn("[SEND] Template is not sendable",this.templateId),null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.roles){const e={};this.rolesCompleted={},null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l||l.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===(a=null==n?void 0:n.session)||void 0===a?void 0:a.profile)&&this.sessionContacts.push({id:n.session.profile.id,name:`${n.session.profile.first_name} ${n.session.profile.last_name}`,email:n.session.profile.email,phone:n.session.profile.phone})}catch(e){console.log("[SEND] Error with preview session",e),null===(n=this.sdkError)||void 0===n||n.emit(new p(e.message,null===(r=e.response)||void 0===r?void 0:r.status,null===(c=e.response)||void 0===c?void 0:c.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.store)||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),h(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,o,l;const a=((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).map((e=>e.name))||[],n=Object.values(this.rolesCompleted).filter((e=>v(e.email)||m(e.phone))).length>=a.length;return i(s,{class:{sendable:null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l?void 0:l.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,n,d;return e.email?i("div",{class:"recipient",style:{borderColor:u(r(a,e.name))},onClick:t=>this.handleClickRole(t,e)},null!==(n=null===(l=this.rolesCompleted[e.id])||void 0===l?void 0:l.full_name)&&void 0!==n?n:e.full_name,i("div",{class:"icon",innerHTML:T}),this.showPickerForId===e.id&&i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(d=this.rolesCompleted[e.id])&&void 0!==d?d: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:u(r(a,e.name))},onClick:t=>this.handleClickRole(t,e)},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:T}),this.showPickerForId===e.id&&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:!n||this.sending,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}};I.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 L=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 d(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 p(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 x(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await d(this.endpoint,this.templateId,!0),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 p(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 f(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await d(this.endpoint,this.templateId,!0),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 w;case"image/jpeg":return y;case"image/png":return g;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return b}return k}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:S})),i("div",{class:"trash-icon",innerHTML:E,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))}};L.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 U=["attachments","roles","settings","fields","preview"],M=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 p(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 d(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 p=!1,h=!1,v=!1;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step),this.templateId&&this.store&&this.store.state&&(v=(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,h=v&&(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,p=h&&(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 m=Math.max(U.indexOf(this.step),0);return!p&&m>=4&&(m=3),!h&&m>=3&&(m=1),!v&&m>=1&&(m=0),console.log({selectedStepIndex:m,canPreview:p,canEditFields:h,canEditRoles:v}),i(s,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:m,tabs:[{id:"attachments",disabled:!1,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!v,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!p,label:"Preview/Send"}]}))}static get watchers(){return{step:["onStepChanged"]}}};M.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 N=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,o,a;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),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("[CREATE] Error creating template",e),null===(s=this.sdkError)||void 0===s||s.emit(new p(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.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."}))}};N.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 R=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 d(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 p(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."}))}};R.style="";const A=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 d(this.endpoint,this.templateId,!0),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 p(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,c,h,v,m;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 d(this.endpoint,this.templateId,!0)):(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 d(this.endpoint,this.templateId,!0))}else await(h=this.endpoint,v=this.templateId,m=null===(o=this.store)||void 0===o?void 0:o.state.reminder_id,h.api.delete("/templates/".concat(v,"/reminder/").concat(m)).then((function(e){return e.data}))),this.store=await d(this.endpoint,this.templateId,!0);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),z(e.message),null===(a=this.sdkError)||void 0===a||a.emit(new p(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===(c=this.close)||void 0===c||c.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("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."}))}};A.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 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.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 d(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 p(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."}))}};D.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{C as verdocs_preview,I as verdocs_send,L as verdocs_template_attachments,M as verdocs_template_build_tabs,N as verdocs_template_create,R as verdocs_template_name,A as verdocs_template_reminders,D as verdocs_template_visibility}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,c as t,f as s,h as i,H as l,a as o}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as d}from"./p-30b4bd45.js";import{g as n}from"./p-7b63017c.js";import{S as a}from"./p-7a1b2643.js";import"./p-7648c449.js";const r=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.endpoint=d.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 n(this.endpoint,e,!0),s(this.el))}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 handleTemplateUpdated(e){var t;console.log("tup"),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)),i(l,null,i("div",{class:"content"},i("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&&i("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&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleRolesNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"settings"===this.step&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)})),"fields"===this.step&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"preview"===this.step&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("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%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))):(console.log("[BUILD] No template ID, rendering created view"),i(l,null,i("div",{class:"content"},i("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)}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateCreated:e=>this.handleTemplateCreated(e.detail.templateId)})))):i(l,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return o(this)}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};r.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{r as verdocs_build}
|
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):o(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;o=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];o=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-05eb4fed.system.js","./p-c694cf93.system.js","./p-7fd7152d.system.js","./p-dc9c4361.system.js","./p-bbee73c8.system.js","./p-2ccbcfeb.system.js","./p-54498887.system.js","./p-327858f0.system.js"],(function(e){"use strict";var t,i,n,o,r,s,a,l;return{setters:[function(e){t=e.r;i=e.c;n=e.h;o=e.H},function(e){r=e.g},function(e){s=e.g},function(e){a=e.F},function(e){l=e.f},function(){},function(){},function(){},function(){}],execute:function(){var d='verdocs-field-timestamp{width:160px;height:15px;opacity:0.5;display:block;font-size:9px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-field-timestamp.done{opacity:1}verdocs-field-timestamp input{cursor:inherit;width:100%;height:100%;font-size:9px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-timestamp input.hide{display:none}verdocs-field-timestamp.required{border:1px solid #cc0000}verdocs-field-timestamp.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-timestamp verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-timestamp verdocs-button-panel[data-active],verdocs-field-timestamp verdocs-button-panel:hover{opacity:1}verdocs-field-timestamp verdocs-button-panel .icon svg{fill:#333333}verdocs-field-timestamp verdocs-button-panel .icon:hover svg{fill:#000000}';var c='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var u=e("verdocs_field_timestamp",function(){function e(e){t(this,e);this.settingsChanged=i(this,"settingsChanged",7);this.deleted=i(this,"deleted",7);this.templateid="";this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.rerender=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,i,d;var u=s(this.field);var f=(i=(t=this.disabled)!==null&&t!==void 0?t:u.disabled)!==null&&i!==void 0?i:false;var p=this.field["rgba"]||r(this.roleindex);var h=u.value||(new Date).toISOString();var v=new Date(h);var m=l(v,a);if(this.done){return n(o,{class:{done:this.done}},m)}return n(o,{class:{required:(d=this.field)===null||d===void 0?void 0:d.required,disabled:f},style:{backgroundColor:p}},n("input",{type:"text",placeholder:u===null||u===void 0?void 0:u.placeholder,tabIndex:u===null||u===void 0?void 0:u.order,value:m,disabled:true,ref:function(t){return e.el=t}}),this.editable&&n("verdocs-button-panel",{icon:c,id:"verdocs-settings-panel-".concat(this.field.name)},n("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:function(){return e.hideSettingsPanel()},onDelete:function(){var t;(t=e.deleted)===null||t===void 0?void 0:t.emit({fieldName:e.field.name});return e.hideSettingsPanel()},onSettingsChanged:function(t){var i;(i=e.settingsChanged)===null||i===void 0?void 0:i.emit(t.detail);return e.hideSettingsPanel()}})))};return e}());u.style=d}}}));
|
@@ -1 +0,0 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(s.next(e))}catch(e){n(e)}}function l(e){try{a(s["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):o(e.value).then(r,l)}a((s=s.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,o,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(s)throw new TypeError("Generator is already executing.");while(i)try{if(s=1,o&&(n=r[0]&2?o["return"]:r[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,r[1])).done)return n;if(o=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];o=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var s=0,o=t.length,n;s<o;s++){if(n||!(s in t)){if(!n)n=Array.prototype.slice.call(t,0,s);n[s]=t[s]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-cbbf849f.system.js","./p-c694cf93.system.js","./p-eb595245.system.js","./p-187b20b7.system.js","./p-2ccbcfeb.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-455d16dc.system.js","./p-ca13070e.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-dc9c4361.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,s,o,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,I,E,S;return{setters:[function(e){t=e.r;i=e.c;s=e.h;o=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.r;d=e.b},function(e){c=e.g;p=e.a},function(e){u=e.S},function(e){h=e.j},function(e){m=e.a;v=e.i},function(e){f=e.g},function(e){g=e.c;b=e.d},function(e){x=e.D;y=e.P;w=e.J;_=e.a;k=e.F;I=e.b;E=e.T},function(e){S=e.V},function(){},function(){},function(){},function(){},function(){}],execute:function(){var C=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var D=function(e,t,i,s){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),s).then((function(e){return e.data}))};var L=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var P='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var z=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.store=null;this.endpoint=n.getDefault();this.templateId=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,c(this.endpoint,this.templateId,true)];case 1:s.store=n.sent();console.log("[PREVIEW] Loading template ".concat(this.templateId),this.endpoint.session);return[3,3];case 2:o=n.sent();console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var t=this;var i,s;var o=e.detail;var n=(s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.fields.filter((function(e){return e.page_sequence===o.pageNumber}));n.forEach((function(e){return a(e,o,d(p(t.store),e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i,n,r;if(!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,null,s("verdocs-loader",null))}var l=__spreadArray([],(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.pages,true);l.sort((function(e,t){return e.sequence-t.sequence}));return s(o,null,l.map((function(t){return s("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());z.style=P;var T='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)}';var R='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var U='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var A='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var M=e("verdocs_send",function(){function e(e){t(this,e);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.store=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r,l,a,d,p,h,m,v;var f=this;return __generator(this,(function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);p=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}h=this;return[4,c(this.endpoint,this.templateId,true)];case 1:h.store=g.sent();if(!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if((s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.roles){m={};this.rolesCompleted={};(n=(o=this.store)===null||o===void 0?void 0:o.state)===null||n===void 0?void 0:n.roles.forEach((function(e){var t=e.sequence-1;m[t]||(m[t]=[]);var i="r-".concat(t,"-").concat(m[t].length);m[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){f.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=m;this.levels=Object.keys(m).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((r=p===null||p===void 0?void 0:p.session)===null||r===void 0?void 0:r.profile){this.sessionContacts.push({id:p.session.profile.id,name:"".concat(p.session.profile.first_name," ").concat(p.session.profile.last_name),email:p.session.profile.email,phone:p.session.profile.phone})}return[3,3];case 2:v=g.sent();console.log("[SEND] Error with preview session",v);(l=this.sdkError)===null||l===void 0?void 0:l.emit(new u(v.message,(a=v.response)===null||a===void 0?void 0:a.status,(d=v.response)===null||d===void 0?void 0:d.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return s("div",{class:"level-icon",innerHTML:U})}else if(e>=this.levels.length){return s("div",{class:"level-icon",innerHTML:N})}else{return s("div",{class:"level-icon",innerHTML:A})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,s;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var o={template_id:this.templateId,name:(s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",o);h(this.endpoint,o).then((function(e){var i;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.send)===null||i===void 0?void 0:i.emit(__assign(__assign({},o),{envelope_id:e.id,envelope:e}))})).catch((function(e){console.log("Send error",e);t.sending=false}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i,n,r;var l=(((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.roles)||[]).map((function(e){return e.name}))||[];var a=Object.values(this.rolesCompleted).filter((function(e){return m(e.email)||v(e.phone)}));var c=a.length>=l.length;return s(o,{class:{sendable:(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.is_sendable}},s("div",{class:"recipients"},s("div",{class:"left-line"}),s("div",{class:"level level-start"},this.getLevelIcon(-1),s("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return s("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,o,n,r,a,c;var p=!t.email;return p?s("div",{class:"recipient",style:{backgroundColor:f(d(l,t.name))},onClick:function(i){return e.handleClickRole(i,t)}},(o=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&o!==void 0?o:t.name,s("div",{class:"icon",innerHTML:R}),e.showPickerForId===t.id&&s("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})):s("div",{class:"recipient",style:{borderColor:f(d(l,t.name))},onClick:function(i){return e.handleClickRole(i,t)}},(a=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&a!==void 0?a:t.full_name,s("div",{class:"icon",innerHTML:R}),e.showPickerForId===t.id&&s("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(c=e.rolesCompleted[t.id])!==null&&c!==void 0?c:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))})))})),s("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),s("div",{class:"complete"},"Signing Complete"))),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),s("verdocs-button",{label:"Send",size:"small",disabled:!c||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&s("verdocs-spinner",null)))};return e}());M.style=T;var j='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var H=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,c(this.endpoint,this.templateId,false)];case 1:s.store=n.sent();return[3,3];case 2:o=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,g(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,c(this.endpoint,this.templateId,true)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(a.message,(s=a.response)===null||s===void 0?void 0:s.status,(o=a.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,b(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,c(this.endpoint,this.templateId,true)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return _;case"image/jpeg":return w;case"image/png":return y;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return x}return k};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return s(o,{class:"loading"},s("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return s(o,{class:"empty"})}return s(o,null,s("h5",null,"Existing Attachments"),s("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return s("div",{class:"attachment"},s("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),s("div",{class:"filename",title:t.name},t.name),s("div",{class:"pages"},s("div",{class:"count"},t.page_numbers),s("div",{class:"pages-icon",innerHTML:I})),s("div",{class:"trash-icon",innerHTML:E,onClick:function(){return e.handleDelete(t)}}))}))),s("h5",null,"Attach a New Document"),this.uploading?s("div",{class:"loader-wrapper"},s("verdocs-loader",null),this.progressLabel&&s("div",{class:"progress-wrapper"},s("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):s("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),s("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&s("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&s("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());H.style=j;var B='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}';var F=["attachments","roles","settings","fields","preview"];var O=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(s){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(s){console.log("[BUILD_TABS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,c(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(F.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return s(o,null,s("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());O.style=B;var W='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}';var V=" ";var q='<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>';var Y=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,l,a;var d=this;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){d.progressLabel="Processing...";d.progressPercent=100}else{d.progressPercent=e}}))];case 2:l=c.sent();console.log("[CREATE] Created template",l);(t=this.templateCreated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:l,templateId:l.id});(i=this.next)===null||i===void 0?void 0:i.emit(l);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,4];case 3:a=c.sent();console.log("[CREATE] Error creating template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new u(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(n=a.response)===null||n===void 0?void 0:n.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?s("div",{class:"loader-wrapper"},s("verdocs-loader",null),this.progressLabel&&s("div",{class:"progress-wrapper"},s("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):s("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},s("div",null,s("span",{innerHTML:q})),s("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),s("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?V:"Or, if you prefer..."),s("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),s("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());Y.style=W;var G="";var J=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,c(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(r.message,(s=r.response)===null||s===void 0?void 0:s.status,(o=r.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return s(o,{class:"loading"},s("verdocs-loader",null))}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("label",{htmlFor:"verdocs-template-name"},"Template Name"),s("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,s;e.name=t.target.value;e.dirty=e.name!==((s=(i=e.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.name)}}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());J.style=G;var K='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}';var Q=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,c(this.endpoint,this.templateId,true)];case 1:n.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(r.message,(s=r.response)===null||s===void 0?void 0:s.status,(o=r.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,r,l,a,d,p,h,m,v,f;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];p={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,C(this.endpoint,this.templateId,p)];case 2:g.sent();h=this;return[4,c(this.endpoint,this.templateId,true)];case 3:h.store=g.sent();return[3,7];case 4:return[4,D(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id,p)];case 5:g.sent();m=this;return[4,c(this.endpoint,this.templateId,true)];case 6:m.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id)];case 9:g.sent();v=this;return[4,c(this.endpoint,this.templateId,true)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);S(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new u(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,{class:"empty"})}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("h5",null,"Reminders"),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),s("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),s("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),s("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&s("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Q.style=K;var X='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}';var Z=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,c(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new u(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s,o,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(o=(s=this.store)===null||s===void 0?void 0:s.state)===null||o===void 0?void 0:o.is_public;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,{class:"empty"})}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("h5",null,"Visibility"),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-is-shared"},"Shared"),s("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),s("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-is-public"},"Public"),s("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),s("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)."),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Z.style=X}}}));
|
@@ -1 +0,0 @@
|
|
1
|
-
System.register([],(function(e){"use strict";return{execute:function(){e({b:o,c:r,g:t});var n=e("a",typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{});function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function r(e,n,t){return t={path:n,exports:{},require:function(e,n){return o()}},e(t,t.exports),t.exports}function o(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}}}}));
|
@@ -1 +0,0 @@
|
|
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-30b4bd45.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,b as m,d as p}from"./p-983da2f6.js";import{f as v}from"./p-c220af42.js";import{d as f}from"./p-a35314fe.js";import"./p-eab67c09.js";import"./p-5a91bf23.js";import"./p-aa124212.js";import"./p-de60d3a8.js";var g=function(e,t){return e.api.get("/organizations/".concat(t,"/profiles")).then((function(e){return e.data}))};const y=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,g(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"))}};y.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 T='<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>',b=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,M=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),g(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:b([{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)=>`${b(t.roles)}`},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,t.id!==this.endpoint.session.profile_id&&s("div",{innerHTML:T,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,v(new Date(t.generated_at),"MMM d, Y"))},{id:"role_id",header:"Role",renderCell:(e,t)=>{var i;return s("div",null,b([{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:T,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 x,G;M.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}(x||(x={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(G||(G={}));const w=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),k=e=>{switch(typeof e){case"undefined":return w.undefined;case"string":return w.string;case"number":return isNaN(e)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(e)?w.array:null===e?w.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?w.promise:"undefined"!=typeof Map&&e instanceof Map?w.map:"undefined"!=typeof Set&&e instanceof Set?w.set:"undefined"!=typeof Date&&e instanceof Date?w.date:w.object;default:return w.unknown}},I=x.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 _ 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,x.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()}}_.create=e=>new _(e);const N=(e,t)=>{let s;switch(e.code){case I.invalid_type:s=e.received===w.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,x.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:s=`Unrecognized key(s) in object: ${x.joinValues(e.keys,", ")}`;break;case I.invalid_union:s="Invalid input";break;case I.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${x.joinValues(e.options)}`;break;case I.invalid_enum_value:s=`Invalid enum value. Expected ${x.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:s="Invalid function arguments";break;case I.invalid_return_type:s="Invalid function return type";break;case I.invalid_date:s="Invalid date";break;case I.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}"`:x.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case I.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 I.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 I.custom:s="Invalid input";break;case I.invalid_intersection_types:s="Intersection results could not be merged";break;case I.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:s="Number must be finite";break;default:s=t.defaultError,x.assertNever(e)}return{message:s}};let S=N;function E(){return S}const C=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 A(e,t){const s=C({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,E(),N].filter((e=>!!e))});e.common.issues.push(s)}class Z{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 P;"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 Z.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 P;if("aborted"===n.status)return P;"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 P=Object.freeze({status:"aborted"}),z=e=>({status:"dirty",value:e}),j=e=>({status:"valid",value:e}),D=e=>"aborted"===e.status,B=e=>"dirty"===e.status,L=e=>"valid"===e.status,U=e=>"undefined"!=typeof Promise&&e instanceof Promise;var $;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}($||($={}));class K{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 O=(e,t)=>{if(L(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 _(e.common.issues);return this._error=t,this._error}}};function R(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 q{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 k(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Z,ctx:{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(U(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:k(e)},n=this._parseSync({data:e,path:i.path,parent:i});return O(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:k(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(U(i)?i:Promise.resolve(i));return O(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:I.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 Ae({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ze.create(this,this._def)}nullable(){return Pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this,this._def)}promise(){return Ce.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return be.create(this,e,this._def)}transform(e){return new Ae({...R(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ze({...R(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Le({typeName:Re.ZodBranded,type:this,...R(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new je({...R(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const V=/^c[^\s-]{8,}$/i,F=/^[a-z][a-z0-9]*$/,H=/[0-9A-HJKMNP-TV-Z]{26}/,W=/^[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,J=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,Q=/^(((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}))$/,X=/^(([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 ee extends q{constructor(){super(...arguments),this._regex=(e,t,s)=>this.refinement((t=>e.test(t)),{validation:t,code:I.invalid_string,...$.errToObj(s)}),this.nonempty=e=>this.min(1,$.errToObj(e)),this.trim=()=>new ee({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ee({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ee({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.string,received:t.parsedType}),P}const t=new Z;let s;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),A(s,{code:I.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),A(s,{code:I.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?A(s,{code:I.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&A(s,{code:I.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)J.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"email",code:I.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)Y.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"emoji",code:I.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)W.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"uuid",code:I.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)V.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"cuid",code:I.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)F.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"cuid2",code:I.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)H.test(e.data)||(s=this._getOrReturnCtx(e,s),A(s,{validation:"ulid",code:I.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(i){s=this._getOrReturnCtx(e,s),A(s,{validation:"url",code:I.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),A(s,{validation:"regex",code:I.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),A(s,{code:I.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),A(s,{code:I.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),A(s,{code:I.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),A(s,{code:I.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"ip"===r.kind?(i=e.data,("v4"!==(n=r.version)&&n||!Q.test(i))&&("v6"!==n&&n||!X.test(i))&&(s=this._getOrReturnCtx(e,s),A(s,{validation:"ip",code:I.invalid_string,message:r.message}),t.dirty())):x.assertNever(r);var i,n,a;return{status:t.value,value:e.data}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$.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,...$.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...$.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...$.errToObj(t)})}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 te(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)}ee.create=e=>{var t;return new ee({checks:[],typeName:Re.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...R(e)})};class se extends q{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)!==w.number){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.number,received:t.parsedType}),P}let t;const s=new Z;for(const i of this._def.checks)"int"===i.kind?x.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),A(t,{code:I.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),A(t,{code:I.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),A(t,{code:I.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"multipleOf"===i.kind?0!==te(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),A(t,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),A(t,{code:I.not_finite,message:i.message}),s.dirty()):x.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,s,i){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:$.toString(i)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:$.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.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&&x.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)}}se.create=e=>new se({checks:[],typeName:Re.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...R(e)});class ie extends q{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)!==w.bigint){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.bigint,received:t.parsedType}),P}let t;const s=new Z;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),A(t,{code:I.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),A(t,{code:I.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),A(t,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):x.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,s,i){return new ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:$.toString(i)}]})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.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}}ie.create=e=>{var t;return new ie({checks:[],typeName:Re.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...R(e)})};class ne extends q{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==w.boolean){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.boolean,received:t.parsedType}),P}return j(e.data)}}ne.create=e=>new ne({typeName:Re.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...R(e)});class ae extends q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.date,received:t.parsedType}),P}if(isNaN(e.data.getTime()))return A(this._getOrReturnCtx(e),{code:I.invalid_date}),P;const t=new Z;let s;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),A(s,{code:I.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),A(s,{code:I.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):x.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:$.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}}ae.create=e=>new ae({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Re.ZodDate,...R(e)});class re extends q{_parse(e){if(this._getType(e)!==w.symbol){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.symbol,received:t.parsedType}),P}return j(e.data)}}re.create=e=>new re({typeName:Re.ZodSymbol,...R(e)});class oe extends q{_parse(e){if(this._getType(e)!==w.undefined){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.undefined,received:t.parsedType}),P}return j(e.data)}}oe.create=e=>new oe({typeName:Re.ZodUndefined,...R(e)});class le extends q{_parse(e){if(this._getType(e)!==w.null){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.null,received:t.parsedType}),P}return j(e.data)}}le.create=e=>new le({typeName:Re.ZodNull,...R(e)});class ce extends q{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}}ce.create=e=>new ce({typeName:Re.ZodAny,...R(e)});class de extends q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}}de.create=e=>new de({typeName:Re.ZodUnknown,...R(e)});class ue extends q{_parse(e){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.never,received:t.parsedType}),P}}ue.create=e=>new ue({typeName:Re.ZodNever,...R(e)});class he extends q{_parse(e){if(this._getType(e)!==w.undefined){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.void,received:t.parsedType}),P}return j(e.data)}}he.create=e=>new he({typeName:Re.ZodVoid,...R(e)});class me extends q{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==w.array)return A(t,{code:I.invalid_type,expected:w.array,received:t.parsedType}),P;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&(A(t,{code:e?I.too_big:I.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&&(A(t,{code:I.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&&(A(t,{code:I.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 K(t,e,t.path,s))))).then((e=>Z.mergeArray(s,e)));const n=[...t.data].map(((e,s)=>i.type._parseSync(new K(t,e,t.path,s))));return Z.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new me({...this._def,minLength:{value:e,message:$.toString(t)}})}max(e,t){return new me({...this._def,maxLength:{value:e,message:$.toString(t)}})}length(e,t){return new me({...this._def,exactLength:{value:e,message:$.toString(t)}})}nonempty(e){return this.min(1,e)}}function pe(e){if(e instanceof ve){const t={};for(const s in e.shape)t[s]=Ze.create(pe(e.shape[s]));return new ve({...e._def,shape:()=>t})}return e instanceof me?new me({...e._def,type:pe(e.element)}):e instanceof Ze?Ze.create(pe(e.unwrap())):e instanceof Pe?Pe.create(pe(e.unwrap())):e instanceof Me?Me.create(e.items.map((e=>pe(e)))):e}me.create=(e,t)=>new me({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...R(t)});class ve extends q{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=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==w.object){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.object,received:t.parsedType}),P}const{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof ue&&"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 K(s,s.data[e],s.path,e)),alwaysSet:e in s.data});if(this._def.catchall instanceof ue){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&&(A(s,{code:I.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 K(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=>Z.mergeObjectSync(t,e))):Z.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return new ve({...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=$.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new ve({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new ve({...this._def,shape:()=>t})}deepPartial(){return pe(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach((s=>{const i=this.shape[s];t[s]=e&&!e[s]?i:i.optional()})),new ve({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Ze;)e=e._def.innerType;t[s]=e}})),new ve({...this._def,shape:()=>t})}keyof(){return Ne(x.objectKeys(this.shape))}}ve.create=(e,t)=>new ve({shape:()=>e,unknownKeys:"strip",catchall:ue.create(),typeName:Re.ZodObject,...R(t)}),ve.strictCreate=(e,t)=>new ve({shape:()=>e,unknownKeys:"strict",catchall:ue.create(),typeName:Re.ZodObject,...R(t)}),ve.lazycreate=(e,t)=>new ve({shape:e,unknownKeys:"strip",catchall:ue.create(),typeName:Re.ZodObject,...R(t)});class fe extends q{_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 _(e.ctx.common.issues)));return A(t,{code:I.invalid_union,unionErrors:s}),P}));{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 _(e)));return A(t,{code:I.invalid_union,unionErrors:n}),P}}get options(){return this._def.options}}fe.create=(e,t)=>new fe({options:e,typeName:Re.ZodUnion,...R(t)});const ge=e=>e instanceof Ie?ge(e.schema):e instanceof Ae?ge(e.innerType()):e instanceof _e?[e.value]:e instanceof Se?e.options:e instanceof Ee?Object.keys(e.enum):e instanceof ze?ge(e._def.innerType):e instanceof oe?[void 0]:e instanceof le?[null]:null;class ye extends q{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return A(t,{code:I.invalid_type,expected:w.object,received:t.parsedType}),P;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}):(A(t,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),P)}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=ge(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 ye({typeName:Re.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...R(s)})}}function Te(e,t){const s=k(e),i=k(t);if(e===t)return{valid:!0,data:e};if(s===w.object&&i===w.object){const s=x.objectKeys(t),i=x.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of i){const i=Te(e[s],t[s]);if(!i.valid)return{valid:!1};n[s]=i.data}return{valid:!0,data:n}}if(s===w.array&&i===w.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const n=Te(e[i],t[i]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===w.date&&i===w.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class be extends q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(e,i)=>{if(D(e)||D(i))return P;const n=Te(e.value,i.value);return n.valid?((B(e)||B(i))&&t.dirty(),{status:t.value,value:n.data}):(A(s,{code:I.invalid_intersection_types}),P)};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}))}}be.create=(e,t,s)=>new be({left:e,right:t,typeName:Re.ZodIntersection,...R(s)});class Me extends q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.array)return A(s,{code:I.invalid_type,expected:w.array,received:s.parsedType}),P;if(s.data.length<this._def.items.length)return A(s,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&s.data.length>this._def.items.length&&(A(s,{code:I.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 K(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(i).then((e=>Z.mergeArray(t,e))):Z.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Me({...this._def,rest:e})}}Me.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Me({items:e,typeName:Re.ZodTuple,rest:null,...R(t)})};class xe extends q{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!==w.object)return A(s,{code:I.invalid_type,expected:w.object,received:s.parsedType}),P;const i=[],n=this._def.keyType,a=this._def.valueType;for(const e in s.data)i.push({key:n._parse(new K(s,e,s.path,e)),value:a._parse(new K(s,s.data[e],s.path,e))});return s.common.async?Z.mergeObjectAsync(t,i):Z.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return new xe(t instanceof q?{keyType:e,valueType:t,typeName:Re.ZodRecord,...R(s)}:{keyType:ee.create(),valueType:e,typeName:Re.ZodRecord,...R(t)})}}class Ge extends q{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!==w.map)return A(s,{code:I.invalid_type,expected:w.map,received:s.parsedType}),P;const i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map((([e,t],a)=>({key:i._parse(new K(s,e,s.path,[a,"key"])),value:n._parse(new K(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 P;"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 P;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}Ge.create=(e,t,s)=>new Ge({valueType:t,keyType:e,typeName:Re.ZodMap,...R(s)});class we extends q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.set)return A(s,{code:I.invalid_type,expected:w.set,received:s.parsedType}),P;const i=this._def;null!==i.minSize&&s.data.size<i.minSize.value&&(A(s,{code:I.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&&(A(s,{code:I.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 P;"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 K(s,e,s.path,t))));return s.common.async?Promise.all(r).then((e=>a(e))):a(r)}min(e,t){return new we({...this._def,minSize:{value:e,message:$.toString(t)}})}max(e,t){return new we({...this._def,maxSize:{value:e,message:$.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}we.create=(e,t)=>new we({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...R(t)});class ke extends q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return A(t,{code:I.invalid_type,expected:w.function,received:t.parsedType}),P;function s(e,s){return C({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E(),N].filter((e=>!!e)),issueData:{code:I.invalid_arguments,argumentsError:s}})}function i(e,s){return C({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E(),N].filter((e=>!!e)),issueData:{code:I.invalid_return_type,returnTypeError:s}})}const n={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Ce){const e=this;return j((async function(...t){const r=new _([]),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 j((function(...t){const r=e._def.args.safeParse(t,n);if(!r.success)throw new _([s(t,r.error)]);const o=Reflect.apply(a,this,r.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new _([i(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ke({...this._def,args:Me.create(e).rest(de.create())})}returns(e){return new ke({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new ke({args:e||Me.create([]).rest(de.create()),returns:t||de.create(),typeName:Re.ZodFunction,...R(s)})}}class Ie extends q{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})}}Ie.create=(e,t)=>new Ie({getter:e,typeName:Re.ZodLazy,...R(t)});class _e extends q{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:I.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ne(e,t){return new Se({values:e,typeName:Re.ZodEnum,...R(t)})}_e.create=(e,t)=>new _e({value:e,typeName:Re.ZodLiteral,...R(t)});class Se extends q{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return A(t,{expected:x.joinValues(this._def.values),received:t.parsedType,code:I.invalid_type}),P}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:I.invalid_enum_value,options:this._def.values}),P}return j(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 Se.create(e)}exclude(e){return Se.create(this.options.filter((t=>!e.includes(t))))}}Se.create=Ne;class Ee extends q{_parse(e){const t=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==w.string&&s.parsedType!==w.number){const e=x.objectValues(t);return A(s,{expected:x.joinValues(e),received:s.parsedType,code:I.invalid_type}),P}if(-1===t.indexOf(e.data)){const e=x.objectValues(t);return A(s,{received:s.data,code:I.invalid_enum_value,options:e}),P}return j(e.data)}get enum(){return this._def.values}}Ee.create=(e,t)=>new Ee({values:e,typeName:Re.ZodNativeEnum,...R(t)});class Ce extends q{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&!1===t.common.async)return A(t,{code:I.invalid_type,expected:w.promise,received:t.parsedType}),P;const s=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return j(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ce.create=(e,t)=>new Ce({type:e,typeName:Re.ZodPromise,...R(t)});class Ae extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.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=>{A(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?P:("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?P:("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(!L(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=>L(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}x.assertNever(i)}}Ae.create=(e,t,s)=>new Ae({schema:e,typeName:Re.ZodEffects,effect:t,...R(s)}),Ae.createWithPreprocess=(e,t,s)=>new Ae({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...R(s)});class Ze extends q{_parse(e){return this._getType(e)===w.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Re.ZodOptional,...R(t)});class Pe extends q{_parse(e){return this._getType(e)===w.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:Re.ZodNullable,...R(t)});class ze extends q{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===w.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:Re.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...R(t)});class je extends q{_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 U(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new _(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new _(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:Re.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...R(t)});class De extends q{_parse(e){if(this._getType(e)!==w.nan){const t=this._getOrReturnCtx(e);return A(t,{code:I.invalid_type,expected:w.nan,received:t.parsedType}),P}return{status:"valid",value:e.data}}}De.create=e=>new De({typeName:Re.ZodNaN,...R(e)});const Be=Symbol("zod_brand");class Le extends q{_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 Ue extends q{_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?P:"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?P:"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 Ue({in:e,out:t,typeName:Re.ZodPipeline})}}class $e extends q{_parse(e){const t=this._def.innerType._parse(e);return L(t)&&(t.value=Object.freeze(t.value)),t}}$e.create=(e,t)=>new $e({innerType:e,typeName:Re.ZodReadonly,...R(t)});const Ke=(e,t={},s)=>e?ce.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})}})):ce.create(),Oe={object:ve.lazycreate};var Re;!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"}(Re||(Re={}));const qe=ee.create,Ve=se.create,Fe=ne.create,He=Ae.create,We={string:e=>ee.create({...e,coerce:!0}),number:e=>se.create({...e,coerce:!0}),boolean:e=>ne.create({...e,coerce:!0}),bigint:e=>ie.create({...e,coerce:!0}),date:e=>ae.create({...e,coerce:!0})};var Je=Object.freeze({__proto__:null,defaultErrorMap:N,setErrorMap:function(e){S=e},getErrorMap:E,makeIssue:C,EMPTY_PATH:[],addIssueToContext:A,ParseStatus:Z,INVALID:P,DIRTY:z,OK:j,isAborted:D,isDirty:B,isValid:L,isAsync:U,get util(){return x},get objectUtil(){return G},ZodParsedType:w,getParsedType:k,ZodType:q,ZodString:ee,ZodNumber:se,ZodBigInt:ie,ZodBoolean:ne,ZodDate:ae,ZodSymbol:re,ZodUndefined:oe,ZodNull:le,ZodAny:ce,ZodUnknown:de,ZodNever:ue,ZodVoid:he,ZodArray:me,ZodObject:ve,ZodUnion:fe,ZodDiscriminatedUnion:ye,ZodIntersection:be,ZodTuple:Me,ZodRecord:xe,ZodMap:Ge,ZodSet:we,ZodFunction:ke,ZodLazy:Ie,ZodLiteral:_e,ZodEnum:Se,ZodNativeEnum:Ee,ZodPromise:Ce,ZodEffects:Ae,ZodTransformer:Ae,ZodOptional:Ze,ZodNullable:Pe,ZodDefault:ze,ZodCatch:je,ZodNaN:De,BRAND:Be,ZodBranded:Le,ZodPipeline:Ue,ZodReadonly:$e,custom:Ke,Schema:q,ZodSchema:q,late:Oe,get ZodFirstPartyTypeKind(){return Re},coerce:We,any:ce.create,array:me.create,bigint:ie.create,boolean:Fe,date:ae.create,discriminatedUnion:ye.create,effect:He,enum:Se.create,function:ke.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ke((t=>t instanceof e),t),intersection:be.create,lazy:Ie.create,literal:_e.create,map:Ge.create,nan:De.create,nativeEnum:Ee.create,never:ue.create,null:le.create,nullable:Pe.create,number:Ve,object:ve.create,oboolean:()=>Fe().optional(),onumber:()=>Ve().optional(),optional:Ze.create,ostring:()=>qe().optional(),pipeline:Ue.create,preprocess:Ae.createWithPreprocess,promise:Ce.create,record:xe.create,set:we.create,strictObject:ve.strictCreate,string:qe,symbol:re.create,transformer:He,tuple:Me.create,undefined:oe.create,union:fe.create,unknown:de.create,void:he.create,NEVER:P,ZodIssueCode:I,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:_});const Ye=[["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]}))),Qe=Je.object({business_name:Je.string().trim().max(30).optional(),contact_email:Je.string().trim().email("Invalid email").optional().or(Je.literal("")),phone:Je.preprocess((e=>f(String(e).trim())),Je.string().optional()),timezone:Je.string().trim().optional(),url:Je.string().trim().optional()}),Xe=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 u(this.endpoint,this.endpoint.session.organization_id);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){e.preventDefault(),e.stopPropagation(),h(n.getDefault(),this.endpoint.session.organization_id,{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}).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=Qe.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:Ye,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"))}};Xe.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 et=Je.object({first_name:Je.string().trim().min(1,"First name is required").max(30),last_name:Je.string().trim().min(1,"Last name is required").max(30),email:Je.string().trim().email("Invalid email").min(1,"Email is required"),phone:Je.preprocess((e=>f(String(e).trim())),Je.string())}),tt=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 m(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(),p(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=et.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"))}};tt.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{y as verdocs_settings_api_keys,M as verdocs_settings_members,Xe as verdocs_settings_organization,tt as verdocs_settings_profile}
|