import { h, Host } from "@stencil/core";
const classificationText = {
    default: "protective marking not set",
    official: "official",
    "official-sensitive": "official-sensitive",
    secret: "secret",
    "top-secret": "top secret",
};
export class ClassificationBanner {
    constructor() {
        /**
         * The additional information that will be displayed after the classification.
         */
        this.additionalSelectors = "";
        /**
         * The classification level to be displayed - also determines the banner and text colour.
         */
        this.classification = "default";
        /**
         * The optional text that will be displayed before classification to specify relevant country/countries.
         */
        this.country = "uk";
        /**
         * If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page.
         */
        this.inline = false;
        /**
         * If `true`, "Up to" will be displayed before the classification and country.
         */
        this.upTo = false;
    }
    render() {
        const { inline, upTo } = this;
        // In case of unrecognized props, fallback to default
        let { country, additionalSelectors, classification } = this;
        if (!country)
            country = "";
        if (!additionalSelectors)
            additionalSelectors = "";
        if (!classification ||
            (classification && !classificationText[classification]))
            classification = "default";
        return (h(Host, { key: 'f30aac02756628e8538572d0b2cab67b0ffc4b75', class: { ["ic-classification-banner-inline"]: !!inline } }, h("banner", { key: '5eda99cbdf376e20ad9ed03fc5c7fc515805c6da', "aria-label": "Protective marking", class: {
                ["classification-banner"]: true,
                [`${classification}`]: classification,
            } }, classification !== "default" ? (h("span", { class: "offscreen" }, "The protective marking of this page is:", " ")) : null, h("ic-typography", { key: '3f094aa6b0ed00ec4f70858a81a030b2599829f9', variant: "caption-uppercase" }, classification === "default"
            ? classificationText[classification]
            : `${upTo ? "up to" : ""} 
               ${country} 
               ${classificationText[classification]} 
               ${additionalSelectors}`))));
    }
    static get is() { return "ic-classification-banner"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["ic-classification-banner.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["ic-classification-banner.css"]
        };
    }
    static get properties() {
        return {
            "additionalSelectors": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The additional information that will be displayed after the classification."
                },
                "getter": false,
                "setter": false,
                "attribute": "additional-selectors",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "classification": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcProtectiveMarkings",
                    "resolved": "\"default\" | \"official\" | \"official-sensitive\" | \"secret\" | \"top-secret\" | undefined",
                    "references": {
                        "IcProtectiveMarkings": {
                            "location": "import",
                            "path": "./ic-classification-banner.types",
                            "id": "src/components/ic-classification-banner/ic-classification-banner.types.tsx::IcProtectiveMarkings"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The classification level to be displayed - also determines the banner and text colour."
                },
                "getter": false,
                "setter": false,
                "attribute": "classification",
                "reflect": false,
                "defaultValue": "\"default\""
            },
            "country": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The optional text that will be displayed before classification to specify relevant country/countries."
                },
                "getter": false,
                "setter": false,
                "attribute": "country",
                "reflect": false,
                "defaultValue": "\"uk\""
            },
            "inline": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page."
                },
                "getter": false,
                "setter": false,
                "attribute": "inline",
                "reflect": false,
                "defaultValue": "false"
            },
            "upTo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, \"Up to\" will be displayed before the classification and country."
                },
                "getter": false,
                "setter": false,
                "attribute": "up-to",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
}
//# sourceMappingURL=ic-classification-banner.js.map
