/**
 * Copyright © Volker Schukai and all contributing authors, 2026. All rights reserved.
 * Node module: @schukai/monster
 *
 * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
 * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
 *
 * For those who do not wish to adhere to the AGPLv3, a commercial license is available.
 * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
 * For more information about purchasing a commercial license, please contact Volker Schukai.
 */

import { addAttributeToken } from "../../../dom/attributes.mjs";
import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";

export { StateStyleSheet };

/**
 * @private
 * @type {CSSStyleSheet}
 */
const StateStyleSheet = new CSSStyleSheet();

try {
	StateStyleSheet.insertRule(
		`
@layer state {
.block{display:block}.inline{display:inline}.inline-block{display:inline-block}.grid{display:grid}.inline-grid{display:inline-grid}.flex{display:flex}.inline-flex{display:inline-flex}.hidden,.hide,.none{display:none}.visible{visibility:visible}.invisible{visibility:hidden}.monster-border-primary-1,.monster-border-primary-2,.monster-border-primary-3,.monster-border-primary-4{border-width:var(--monster-border-width);border-radius:var(--monster-border-radius);border-style:var(--monster-border-style)}.monster-border-0{border-width:0;border-radius:0;border-style:none}.monster-border-primary-1{border-color:var(--monster-bg-color-primary-1)}.monster-border-primary-2{border-color:var(--monster-bg-color-primary-2)}.monster-border-primary-3{border-color:var(--monster-bg-color-primary-3)}.monster-border-primary-4{border-color:var(--monster-bg-color-primary-4)}.monster-border-secondary-1,.monster-border-secondary-2,.monster-border-secondary-3,.monster-border-secondary-4{border-width:var(--monster-border-width);border-radius:var(--monster-border-radius);border-style:var(--monster-border-style)}.monster-border-secondary-1{border-color:var(--monster-bg-color-secondary-1)}.monster-border-secondary-2{border-color:var(--monster-bg-color-secondary-2)}.monster-border-secondary-3{border-color:var(--monster-bg-color-secondary-3)}.monster-border-secondary-4{border-color:var(--monster-bg-color-secondary-4)}.monster-border-tertiary-1,.monster-border-tertiary-2,.monster-border-tertiary-3,.monster-border-tertiary-4{border-width:var(--monster-border-width);border-radius:var(--monster-border-radius);border-style:var(--monster-border-style)}.monster-border-tertiary-1{border-color:var(--monster-bg-color-tertiary-1)}.monster-border-tertiary-2{border-color:var(--monster-bg-color-tertiary-2)}.monster-border-tertiary-3{border-color:var(--monster-bg-color-tertiary-3)}.monster-border-tertiary-4{border-color:var(--monster-bg-color-tertiary-4)}[data-monster-role=control]{outline:none;width:100%;box-sizing:border-box}[data-monster-role=control].flex{display:flex;flex-direction:row;align-items:center}:host{display:block;box-sizing:border-box}div{text-align:center}::slotted(:empty:not(img)){display:none}slot{display:flex;flex-direction:column;justify-content:center;align-items:center}::slotted(svg[slot=visual]){height:40vmin;width:auto;min-height:200px}::slotted(h1){font-size:3rem;line-height:1.15;margin:4rem 0 1.5rem;font-weight:400;text-align:center}::slotted(h2){font-size:2.5rem;line-height:1.2;margin:4rem 0 1.5rem;font-weight:400;text-align:center}::slotted(h3){font-size:2rem;line-height:1.25;margin:4rem 0 1.25rem;font-weight:400;text-align:center}::slotted(h4){font-size:1.5rem;line-height:1.3;margin:4rem 0 1.25rem;font-weight:400;text-align:center}::slotted(h5){font-size:1.4rem;line-height:1.3;margin:4rem 0 1.25rem;font-weight:bolder;text-align:center}::slotted(h6){font-size:1.3rem;line-height:1.3;margin:4rem 0 1.25rem;font-weight:700;text-align:center}::slotted(p){text-align:center;font-size:1rem;line-height:1.6;font-weight:400;text-align:justify}::slotted(button[slot=action]){width:-webkit-fill-available;width:-moz-available;width:stretch;font-size:1rem;font-weight:400;line-height:1.5;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-width:var(--monster-border-width);border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);box-shadow:var(--monster-box-shadow-1);padding:.375rem .75rem;outline:none;background-position:50%;position:relative;overflow:hidden;font-family:var(--monster-font-family),sans-serif;display:flex;align-items:center;justify-content:center;gap:.4rem;background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}::slotted(button[slot=action]:hover){transition:background .8s,color .25s .0833333333s;box-shadow:var(--monster-box-shadow-2)}::slotted(*){flex-grow:1}slot[name=action]{flex-direction:row;align-content:center;padding:2rem 1rem;-moz-column-gap:1rem;column-gap:1rem;place-content:center space-evenly;display:flex;justify-content:space-between;align-items:stretch}@media (max-width:480px){slot[name=action]{flex-direction:column;-moz-column-gap:0;column-gap:0;row-gap:1rem;padding:1rem 0}}
}`,
		0,
	);
} catch (e) {
	addAttributeToken(
		document.getRootNode().querySelector("html"),
		ATTRIBUTE_ERRORMESSAGE,
		e + "",
	);
}
