import { r as registerInstance, c as createEvent, h } from './index-CV0Pyo1O.js';
import { B as image, C as buttonLink, D as card } from './parts-CPKMvyV_.js';

const TerminalQuantitySelector = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.selectedQuantityChange = createEvent(this, "selectedQuantityChange", 7);
        this.limit = Infinity;
        this.selectedQuantity = 0;
        this.removeUnit = () => {
            if (this.selectedQuantity > 0) {
                this.selectedQuantity--;
                this.selectedQuantityChange.emit({ modelName: this.modelName, quantity: this.selectedQuantity });
            }
        };
        this.addUnit = () => {
            if (this.limit > 0) {
                this.selectedQuantity++;
                this.selectedQuantityChange.emit({ modelName: this.modelName, quantity: this.selectedQuantity });
            }
        };
    }
    render() {
        return (h("div", { key: '1704fa75958fcfd09f49a3c0fe8116d573bfa2ed', class: "rounded shadow-sm card p-2", part: card }, h("div", { key: '0efa6cc9b68c077928f808ae87de23bfdae8d114', class: "d-flex gap-3" }, h("div", { key: 'bffacd3f4efa0f4836df925c71cda7b557041041', class: "d-flex align-items-center" }, h("img", { key: '5d2d65f2e080408fce1c036f95b19829de05ec21', src: this.imageUrl, alt: this.modelName, height: 75, width: 75, part: image })), h("div", { key: '8c97aca0bf669cbd0b19f6d7eafffd36b20fd14e', class: "d-flex flex-column flex-grow-1 gap-3 p-4 justify-content-center" }, h("div", { key: '96ec8a7338c8d3bcaa032a8dd0f68a331901ba57', class: "row" }, h("div", { key: '85cf477f4bc74ef873d7087e8e087728f80d9412', class: "col-6 d-flex gap-2" }, this.modelName, h("form-control-tooltip", { key: '50357d9dad8c03ff4112a8a5f95aa8ccf99ea640', helpText: this.description })), h("div", { key: '598a1cd15123c470dcd3bc602a988ad335f07f39', class: "col-6 d-flex justify-content-end align-items-center" }, h("button", { key: '6868ee6d61d15ff37d01432e40126ae4f77a97cb', class: "p-0 minus btn", onClick: this.removeUnit, part: buttonLink }, "-"), h("div", { key: 'dff94157f9c0cf1afbe60ee655568cd6b109fc1f', class: "w-25 text-center" }, this.selectedQuantity), h("button", { key: '12aa22434ff134acd554a7eeb9782c81d14d7f02', class: "p-0 plus btn", onClick: this.addUnit, part: buttonLink }, "+")))))));
    }
};

export { TerminalQuantitySelector as terminal_quantity_selector };
