import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-cuwa7Els.js';
import { D as DefaultEndpoint } from './p-C_Xku1v2.js';
import { d as defineCustomElement$1 } from './p-_nUQ5iEk.js';

const verdocsDelegateDialogCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-delegate-dialog{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-delegate-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-delegate-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-delegate-dialog .step{margin-left:6px;color:#666}verdocs-delegate-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-delegate-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-delegate-dialog .help-icon{width:40px;height:40px}verdocs-delegate-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-delegate-dialog .help-text{font-weight:400}verdocs-delegate-dialog .input{gap:10px;margin:5px 0;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row}verdocs-delegate-dialog .input label{margin:8px 0 0 0;-ms-flex:0 0 100px;flex:0 0 100px;font-size:13px;font-weight:500;line-height:10px;white-space:nowrap}verdocs-delegate-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #cccccc}verdocs-delegate-dialog .input textarea{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #cccccc;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-delegate-dialog .input.names input{width:80px}verdocs-delegate-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-delegate-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-delegate-dialog .field label{-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-delegate-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-delegate-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-delegate-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-delegate-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-delegate-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-delegate-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-delegate-dialog .buttons verdocs-button{margin-left:16px}";

const QuestionIcon = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>`;
const VerdocsDelegateDialog = /*@__PURE__*/ proxyCustomElement(class VerdocsDelegateDialog extends H {
    constructor() {
        super();
        this.__registerHost();
        this.exit = createEvent(this, "exit");
        this.next = createEvent(this, "next");
        /**
         * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
         */
        this.endpoint = DefaultEndpoint;
        /**
         * The envelope to process.
         */
        this.envelope = null;
        this.first_name = '';
        this.last_name = '';
        this.email = '';
        this.phone = '';
        this.message = '';
    }
    handleCancel() {
        this.exit.emit();
    }
    // We need a separate event handler for clicking the background because it can receive events "through" other child components
    handleDismiss(e) {
        if (e.target.class === 'background-overlay') {
            e.preventDefault();
            this.handleCancel();
        }
    }
    // We need a separate event handler for clicking the background because it can receive events "through" other child components
    handleDelegate() {
        this.next.emit({
            first_name: this.first_name,
            last_name: this.last_name,
            email: this.email,
            phone: this.phone,
            message: this.message,
        });
    }
    render() {
        return (h(Host, { key: '1b273825b9e7829da0e4c2f1e0dd198b99e22778' }, h("div", { key: 'ee6933619eccc3bd070a39cfe203db31f9e49360', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'a5dd9c14107423563cd9f125ada09e093a2f339a', class: "dialog" }, h("div", { key: '9de61c918546d1c07e6910bf510a86a7b02b3ec4', class: "heading" }, "Delegate \"", this.envelope.name, "\""), h("div", { key: '4a18099b2af26a5ffacfef8316224ff46d0e6130', class: "help-box" }, h("div", { key: '1edddc209d05847359e5899c635a434b84df5cbf', class: "help-icon", innerHTML: QuestionIcon }), h("div", { key: '3b88b1a8fe4432a76ecdd7c890af1c62f6e37e15', class: "help-details" }, h("div", { key: 'c912b3030e38e44f6e99708c70dc914bb8c16d7b', class: "help-title" }, "Please verify your email address"), h("div", { key: '743843ee38ee599147c38428794f75433418ad8f', class: "help-text" }, "Check your email for a one-time code, and enter it below."))), h("div", { key: 'a1c76355c3085882a3a85b2e9d92e7e6fdb52ae0', class: "input names" }, h("label", { key: 'a67cddd940d0b12e85eb4e838a4ea74763b8114b', htmlFor: "verdocs-delegate-email" }, "New Recipient:"), h("input", { key: '119c0d496eed6721e0a75f83f1419a9d5f491bd7', type: "text", id: "verdocs-delegate-first", name: "verdocs-delegate-first", autocomplete: "blocked", placeholder: "First name...", value: this.first_name, onInput: (e) => (this.first_name = e.target.value) }), h("input", { key: '6a63aaf105137ca0e1dac6cf7a19f4b82d8c47d6', type: "text", id: "verdocs-delegate-last", name: "verdocs-delegate-last", autocomplete: "blocked", placeholder: "Last name...", value: this.last_name, onInput: (e) => (this.last_name = e.target.value) })), h("div", { key: '347e2279573063eb892c0b813468d5c09408531a', class: "input" }, h("label", { key: '825073c57fd16fbf3e310280f308c43be821965d', htmlFor: "verdocs-delegate-email" }, "Email Address:"), h("input", { key: '56838680257dee66d68c0e725caf836ea40ff295', type: "text", id: "verdocs-delegate-email", name: "verdocs-delegate-email", autocomplete: "blocked", placeholder: "New recipient email address...", value: this.email, onInput: (e) => (this.email = e.target.value) })), h("div", { key: '063226a4aed54f801b830c79d8bd09c27538454e', class: "input" }, h("label", { key: '19a7c63649de25be50d55441e1c27e80bea5ca0a', htmlFor: "verdocs-delegate-phone" }, "Phone:"), h("input", { key: '433ad74b6599db5c29d52948fdd373c3dbe62736', type: "text", id: "verdocs-delegate-phone", name: "verdocs-delegate-phone", autocomplete: "blocked", placeholder: "Optional phone number...", value: this.phone, onInput: (e) => (this.phone = e.target.value) })), h("div", { key: '07a2f3a2f4ba17bd89104f1d0d113650c7415dbd', class: "input" }, h("label", { key: 'eab9f7cde38d80e75c35b731cb3e1bc8a0f41bab', htmlFor: "verdocs-delegate-email" }, "Message:"), h("textarea", { key: '4aceddbcca0ef4b30a7d04fd15509588fabe9732', id: "verdocs-delegate-message", name: "verdocs-delegate-message", rows: 3, autocomplete: "blocked", placeholder: "Optional message to include in the invitation...", onInput: (e) => (this.message = e.target.value) }, this.message)), h("div", { key: '6c24b31253ca9146f93b6ae17deb984ce4aa5c5a', class: "buttons" }, h("verdocs-button", { key: 'd17fe7c1c699a49c7fe923ed528b18c8d780ddbb', label: "Cancel", variant: "outline", onClick: () => this.handleCancel() }), h("verdocs-button", { key: '260a127ef6c7c8a6703ad46136233302ed4d0437', label: 'Delegate', onClick: () => this.handleDelegate(), disabled: !this.first_name || !this.last_name || !this.email }))))));
    }
    static get style() { return verdocsDelegateDialogCss; }
}, [0, "verdocs-delegate-dialog", {
        "endpoint": [1040],
        "envelope": [16],
        "first_name": [32],
        "last_name": [32],
        "email": [32],
        "phone": [32],
        "message": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["verdocs-delegate-dialog", "verdocs-button"];
    components.forEach(tagName => { switch (tagName) {
        case "verdocs-delegate-dialog":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, VerdocsDelegateDialog);
            }
            break;
        case "verdocs-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { VerdocsDelegateDialog as V, defineCustomElement as d };
//# sourceMappingURL=p-BpUKXYCJ.js.map

//# sourceMappingURL=p-BpUKXYCJ.js.map