'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-9564483d.js');
const dataTestIds_enum = require('./dataTestIds.enum-f00213b8.js');

function trimAddress(s) {
    const firstFour = s.slice(0, 6);
    const lastFour = s.slice(-6);
    return `${firstFour}...${lastFour}`;
}
const renderAccounts = ({ shownAccounts = [], onSelectAccount, selectedIndex }) => {
    return (index.h("div", { class: "account-list", "data-testid": dataTestIds_enum.DataTestIdsEnum.addressTableContainer },
        index.h("div", { class: "account-header" },
            index.h("div", { class: "account-header-item" }, "Address"),
            index.h("div", { class: "account-header-item" }, "Balance"),
            index.h("div", { class: "account-header-item" }, "#")),
        shownAccounts.map(account => (index.h("div", { class: "account-row", onClick: () => onSelectAccount(account.index) },
            index.h("div", { class: "address-row-item-data " },
                index.h("input", { type: "radio", name: "account", checked: account.index === selectedIndex, value: account.index }),
                index.h("span", { class: "address" }, trimAddress(account.address))),
            index.h("div", { class: "address-row-item-data" }, account.balance),
            index.h("div", { class: "address-row-item-data" }, account.index))))));
};

const ledgerAccountScreenCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;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}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.relative{position:relative}.block{display:block}.flex{display:flex}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.border{border-width:1px}.account-header{align-items:center;background-color:#ced4da;border-radius:8px;display:flex;font-size:14px;line-height:1;padding:16px 20px 16px 16px;text-align:left}.account-header-item{flex:1}.account-header-item:first-child{max-width:55%;width:55%}.account-header-item:last-child{flex-basis:32px;max-width:32px;text-align:center;width:32px}.account-list{max-height:300px;min-height:300px;overflow:auto;position:relative;width:100%}.account-row{align-items:center;border-radius:8px;cursor:pointer;display:flex;padding:16px}.account-row:hover{background-color:#f5f5f5}.address-row-item-data{align-items:center;display:flex;flex:1;font-size:14px;line-height:1;padding-right:16px;text-align:left}.address-row-item-data:last-child{flex-basis:32px;justify-content:center;max-width:32px;padding-right:0;text-align:center;width:32px}.navigation{display:flex;gap:10rem;justify-content:center;margin-top:20px}.navigation-button{background:transparent;border:none;cursor:pointer}.navigation-button:hover{color:#1a56db}.navigation-button:disabled{color:#737373;pointer-events:none}.access-button{background-color:#1a56db;border:none;border-radius:8px;color:#fff;cursor:pointer;display:block;margin:20px auto;padding:12px;width:200px}.access-button:disabled{background-color:#a1a1a1;box-shadow:none;color:#e0e0e0;cursor:not-allowed;opacity:.6;transform:none}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
const LedgerAccountScreenStyle0 = ledgerAccountScreenCss;

const LedgerAccountScreen = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.selectAccount = index.createEvent(this, "selectAccount", 7);
        this.nextPage = index.createEvent(this, "nextPage", 7);
        this.prevPage = index.createEvent(this, "prevPage", 7);
        this.accessWallet = index.createEvent(this, "accessWallet", 7);
    }
    render() {
        const isSelectedIndexOnPage = this.accountScreenData.accounts.some(({ index }) => index === this.selectedIndex);
        const accountsList = this.accountScreenData.isLoading || this.accountScreenData.accounts.length === 0 ? (index.h("generic-spinner", { "data-testid": dataTestIds_enum.DataTestIdsEnum.ledgerLoading })) : (renderAccounts({
            shownAccounts: this.accountScreenData.accounts,
            onSelectAccount: (index) => this.selectAccount.emit(index),
            selectedIndex: this.selectedIndex,
        }));
        return (index.h(index.Fragment, { key: '838d37d86d04247b19101ff5dc387a6531c90265' }, accountsList, !this.accountScreenData.isLoading && this.accountScreenData.accounts.length !== 0 && (index.h(index.Fragment, { key: 'aeb62e0519bbcc46944ce97bcace57504db3f73b' }, index.h("div", { key: 'c4bd512b2c8b08591774abc0af92a85e16697c85', class: "navigation" }, index.h("button", { key: '0c891e5f8af57d75a693f4cf9a12d2114aa493cb', onClick: () => this.prevPage.emit(), disabled: this.accountScreenData.startIndex <= 0, "data-testid": dataTestIds_enum.DataTestIdsEnum.prevBtn, class: "navigation-button" }, '< ', " Prev"), index.h("button", { key: '081d4f65b0c978dc2be6700631d41ae4eadfc1ac', onClick: () => this.nextPage.emit(), "data-testid": dataTestIds_enum.DataTestIdsEnum.nextBtn, class: "navigation-button" }, "Next", ' >')), index.h("button", { key: 'ef36f5928ee6c5a4e90661edffaf41718f35326e', "data-testid": dataTestIds_enum.DataTestIdsEnum.confirmBtn, class: "access-button", onClick: () => this.accessWallet.emit(), disabled: !isSelectedIndexOnPage }, "Access Wallet")))));
    }
};
LedgerAccountScreen.style = LedgerAccountScreenStyle0;

const ledgerConfirmScreenCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;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}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.absolute{position:absolute}.relative{position:relative}.address-section{font-size:16px;line-height:1.5;margin-top:40px;text-align:center}.address-section .address-description{color:#858688}.address-section .address-data{word-break:break-word}.address-section .address-data,.address-section .address-header{background-color:#ced4da;border-radius:8px;line-height:1;padding:12px;text-align:center}.address-footer{color:var(--gray-700);font-size:14px;line-height:1.5;margin-top:40px;padding-top:40px;position:relative}.address-footer:before{background-color:var(--gray-700);bottom:100%;content:\"\";height:1px;left:0;position:absolute;right:0}.address-footer a{color:var(--primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
const LedgerConfirmScreenStyle0 = ledgerConfirmScreenCss;

const LedgerConnectConfirmBody = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        var _a, _b, _c;
        return (index.h("div", { key: '0880892711fbeb784c21e15496b4173565280af6', "data-testid": dataTestIds_enum.DataTestIdsEnum.ledgerConfirmAddress, class: "address-section" }, index.h("div", { key: '706e6edcc03110f2497b17e38e0e11fc60ad892c', class: "address-section" }, index.h("div", { key: '7da51c02c52439bfef22334ef622b8704eab39ec', class: "address-description" }, this.confirmScreenData.confirmAddressText), index.h("div", { key: '925967ec6e7737d9f1caa98959fc76d41962a832', class: "address-header" }, this.confirmScreenData.selectedAddress)), index.h("div", { key: 'e2e8d8db7bcbfa7e1b60447b24bbb5fca5ec1680', class: "address-section" }, index.h("div", { key: '121b66e3ec8229c535c73da6cf3b637fc438abff', class: "address-description" }, (_a = this.confirmScreenData) === null || _a === void 0 ? void 0 : _a.authText), index.h("div", { key: '5c0e247e7a1e336a8542476dd37584aeafd4cb5e', class: "address-data" }, (_b = this.confirmScreenData) === null || _b === void 0 ? void 0 : _b.data), index.h("div", { key: '68b203c6f68d96afa4e28dab583650c539344269', class: "address-description" }, (_c = this.confirmScreenData) === null || _c === void 0 ? void 0 : _c.areShownText)), index.h("div", { key: '35dbb8d7dbe719b3e401b28472c6ee7eebee8217', class: "address-footer" }, index.h("div", { key: '4299c9327bd3e334e4a72e79fe6694632f4115a4' }, "Select Approve on your device to confirm."), index.h("div", { key: '2cbc978bc0f591b5819c3518f6c7c645e2814e67' }, "Or, if it does not match, close this page and", ' ', index.h("a", { key: '5ce66e477655b258e75f07a857b10939a6b1702e', href: "https://help.multiversx.com/en/", target: "_blank", rel: "noreferrer" }, "contact support"), "."))));
    }
};
LedgerConnectConfirmBody.style = LedgerConfirmScreenStyle0;

const ledgerConnectScreenCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;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}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.flex{display:flex}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.border{border-width:1px}.access-button{background-color:#1a56db;border:none;border-radius:8px;color:#fff;cursor:pointer;display:block;margin:20px auto;padding:12px;width:200px}.access-button:disabled{background-color:#a1a1a1;box-shadow:none;color:#e0e0e0;cursor:not-allowed;opacity:.6;transform:none}.connection-link{display:flex;justify-content:center}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
const LedgerConnectScreenStyle0 = ledgerConnectScreenCss;

const LedgerConnectScreen = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.connect = index.createEvent(this, "connect", 7);
    }
    render() {
        var _a, _b, _c, _d;
        return (index.h("div", { key: '08fe03416fca00f63a2e653589ec45c8972cc5c9' }, ((_a = this.connectScreenData) === null || _a === void 0 ? void 0 : _a.error) && index.h("p", { key: '5eaa4d2a23f19ebe7ce71aa2e691dba9dffe2182' }, this.connectScreenData.error), ((_b = this.connectScreenData) === null || _b === void 0 ? void 0 : _b.customContentMarkup) && ((_c = this.connectScreenData) === null || _c === void 0 ? void 0 : _c.customContentMarkup), index.h("button", { key: '4fca2ae10bd0fb94e9c1036ce074e6d3fb4c0c7e', "data-testid": dataTestIds_enum.DataTestIdsEnum.ledgerConnectBtn, class: "access-button", onClick: () => this.connect.emit(), disabled: (_d = this.connectScreenData) === null || _d === void 0 ? void 0 : _d.disabled }, "Connect Ledger"), index.h("a", { key: 'fdf5f3204413be7230985f4b229e8fc21cdc57ca', href: "https://support.ledger.com/hc/en-us/articles/115005165269-Connection-issues-with-Windows-or-Linux", target: "_blank", rel: "noopener noreferrer", class: "connection-link" }, "Having connection issues?")));
    }
};
LedgerConnectScreen.style = LedgerConnectScreenStyle0;

exports.ledger_account_screen = LedgerAccountScreen;
exports.ledger_confirm_screen = LedgerConnectConfirmBody;
exports.ledger_connect_screen = LedgerConnectScreen;

//# sourceMappingURL=ledger-account-screen_3.cjs.entry.js.map