import { p as proxyCustomElement, H, f as forceUpdate, h } from './p-C6Ye8jK5.js';
import { D as DataTestIdsEnum } from './p-BPc6-DQj.js';
import { E as EventBus } from './p-S9juR7eS.js';
import { d as defineCustomElement$4 } from './p-BoVsYek2.js';
import { d as defineCustomElement$3 } from './p-DAW0tbcX.js';
import { d as defineCustomElement$2 } from './p-B6XigyR5.js';

// types here need to be synced with the types in sdk-dapp-core pendingTransactions.types.ts
var PendingTransactionsEventsEnum;
(function (PendingTransactionsEventsEnum) {
    PendingTransactionsEventsEnum["CLOSE_PENDING_TRANSACTIONS"] = "CLOSE_PENDING_TRANSACTIONS";
    PendingTransactionsEventsEnum["OPEN_PENDING_TRANSACTIONS_PANEL"] = "OPEN_PENDING_TRANSACTIONS_PANEL";
    PendingTransactionsEventsEnum["DATA_UPDATE"] = "DATA_UPDATE";
})(PendingTransactionsEventsEnum || (PendingTransactionsEventsEnum = {}));

const pendingTransactionsPanelCss = "/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer theme{:host,:root{--mvx-font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--mvx-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--mvx-default-font-family:var(--mvx-font-sans);--mvx-default-mono-font-family:var(--mvx-font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--mvx-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--mvx-default-font-feature-settings,normal);font-variation-settings:var(--mvx-default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--mvx-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--mvx-default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--mvx-default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities;.modal-body{align-items:center;display:flex;justify-content:center;padding:16px}.close-button{background-color:#343a40;border:1px solid #0000;border-radius:.25rem;color:#fff;cursor:pointer;padding:.375rem .75rem}.pending-transactions-panel{background-color:#fff;box-shadow:0 4px 12px #00000026;max-width:100%;padding:0;width:450px}.pending-transactions-content{display:flex;flex-direction:column;height:100%;padding:24px}.pending-transactions-header{border-bottom:1px solid #0000001a;margin-bottom:24px;padding-bottom:16px}.pending-transactions-header h2{font-size:20px;font-weight:600;margin-bottom:8px}.pending-transactions-header h4{color:#0009;font-size:14px;font-weight:400}.pending-transactions-body{align-items:center;display:flex;flex:1;justify-content:center;padding:16px}";

const PendingTransactionstPanel = /*@__PURE__*/ proxyCustomElement(class PendingTransactionstPanel extends H {
    constructor() {
        super();
        this.__registerHost();
        this.eventBus = new EventBus();
        this.isOpen = false;
        this.data = {
            isPending: false,
            title: '',
            subtitle: '',
        };
    }
    componentDidLoad() {
        this.eventBus.subscribe(PendingTransactionsEventsEnum.DATA_UPDATE, this.dataUpdate.bind(this));
        this.eventBus.subscribe(PendingTransactionsEventsEnum.OPEN_PENDING_TRANSACTIONS_PANEL, this.handleOpen.bind(this));
        this.eventBus.subscribe(PendingTransactionsEventsEnum.CLOSE_PENDING_TRANSACTIONS, this.onClose.bind(this, { isUserClick: false }));
    }
    disconnectedCallback() {
        this.eventBus.unsubscribe(PendingTransactionsEventsEnum.DATA_UPDATE, this.dataUpdate.bind(this));
        this.eventBus.unsubscribe(PendingTransactionsEventsEnum.OPEN_PENDING_TRANSACTIONS_PANEL, this.handleOpen.bind(this));
        this.eventBus.unsubscribe(PendingTransactionsEventsEnum.CLOSE_PENDING_TRANSACTIONS, this.onClose.bind(this, { isUserClick: false }));
    }
    handleOpen() {
        this.isOpen = true;
    }
    handleClose() {
        this.isOpen = false;
        this.onClose({ isUserClick: true });
    }
    onClose(props = { isUserClick: true }) {
        this.isOpen = false;
        if (props.isUserClick) {
            this.eventBus.publish(PendingTransactionsEventsEnum.CLOSE_PENDING_TRANSACTIONS);
        }
    }
    dataUpdate(payload) {
        if (payload.shouldClose) {
            return this.onClose({ isUserClick: false });
        }
        this.isOpen = true;
        this.data = Object.assign({}, payload);
        forceUpdate(this);
    }
    async getEventBus() {
        return this.eventBus;
    }
    render() {
        return (h("mvx-side-panel", { key: 'fb6e2a2f21fb8105ee6d8b053ab89d4855f32285', isOpen: this.isOpen, panelClassName: "pending-transactions-panel", onClose: this.handleClose.bind(this) }, h("div", { key: '82b63e9f37a8c863dc7068dfe49a03aad098b9c6', class: "pending-transactions-content" }, h("div", { key: '20b36237d7fb57b8dfa991a7d9d2df236e9389e8', class: "pending-transactions-header" }, h("h2", { key: 'c9ba8e40186f3c4a369b413ffb2a9c7704bd2c78', "data-testid": DataTestIdsEnum.pendingTransactionsTitle }, this.data.title), h("h4", { key: 'a6a05721a1b77877e081b64c9a26822da0715012', "data-testid": DataTestIdsEnum.pendingTransactionsSubtitle }, this.data.subtitle)), h("div", { key: 'a1efef97c39172f741e05b55a08cccaf2755a418', class: "pending-transactions-body" }, h("button", { key: '9e4654746d024fd9b14fb23441365cf1f73d6970', class: "close-button", onClick: this.handleClose.bind(this) }, "Close")))));
    }
    static get style() { return pendingTransactionsPanelCss; }
}, [0, "mvx-pending-transactions-panel", {
        "data": [16],
        "isOpen": [32],
        "getEventBus": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["mvx-pending-transactions-panel", "mvx-back-arrow-icon", "mvx-close-icon", "mvx-side-panel"];
    components.forEach(tagName => { switch (tagName) {
        case "mvx-pending-transactions-panel":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, PendingTransactionstPanel);
            }
            break;
        case "mvx-back-arrow-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "mvx-close-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "mvx-side-panel":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const MvxPendingTransactionsPanel = PendingTransactionstPanel;
const defineCustomElement = defineCustomElement$1;

export { MvxPendingTransactionsPanel, defineCustomElement };
//# sourceMappingURL=mvx-pending-transactions-panel.js.map

//# sourceMappingURL=mvx-pending-transactions-panel.js.map