'use strict';

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

const index = require('./index-78cbcbe5.js');
const clsx_m = require('./clsx.m-505a3555.js');

const buttonSizeTypographyVariant = {
  sm: 'action',
  md: 'action',
  lg: 'h6',
  xl: 'h4',
};

const mdsButtonCss = "*,::before,::after{--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:rgb(59 130 246 / 0.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;}::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:rgb(59 130 246 / 0.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;}@tailwind utilities; :host{--background:rgb(var(--brand-maggioli-02));--border-color:transparent;--color:rgb(var(--tone-neutral));--icon-color:var(--color);--radius:0.5rem;box-sizing:border-box;display:inline-flex;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;padding-left:1.5rem;padding-right:1.5rem;padding-top:0.5rem;padding-bottom:0.5rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--background);border-color:var(--border-color) !important;border-radius:var(--radius, 0.5rem);border-style:solid;border-width:2px !important;color:var(--color)}.text{min-width:0px;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text::first-letter{text-transform:uppercase}.icon{display:inline-flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;fill:var(--icon-color)}@tailwind utilities; :host([variant=primary]),:host([variant=primary][tone=strong]){--background:rgb(var(--brand-maggioli-03));--color:rgb(var(--tone-neutral))}:host([variant=primary]:hover),:host([variant=primary][tone=strong]:hover){--background:rgb(var(--brand-maggioli-04))}:host([variant=primary][active]),:host([variant=primary][tone=strong][active]){--background:rgb(var(--brand-maggioli-02))}:host([variant=primary][tone=weak]){--background:rgb(var(--brand-maggioli-04));--color:rgb(var(--brand-maggioli-10))}:host([variant=primary][tone=weak]:hover){--background:rgb(var(--brand-maggioli-05));--color:rgb(var(--tone-neutral))}:host([variant=primary][tone=weak][active]){--background:rgb(var(--brand-maggioli-03));--color:rgb(var(--brand-maggioli-10))}:host([variant=primary][tone=ghost]){--background:transparent;--border-color:rgb(var(--brand-maggioli-04));--color:rgb(var(--brand-maggioli-03))}:host([variant=primary][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--brand-maggioli-04));--color:rgb(var(--brand-maggioli-02))}:host([variant=primary][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--brand-maggioli-05));--color:rgb(var(--brand-maggioli-03))}:host([variant=primary][tone=quiet]){--background:transparent;--color:rgb(var(--brand-maggioli-02))}:host([variant=primary][tone=quiet]:hover){--background:transparent;--color:rgb(var(--brand-maggioli-04))}:host([variant=primary][tone=quiet][active]){--background:transparent;--color:rgb(var(--brand-maggioli-01))}:host([variant=dark]),:host([variant=dark][tone=strong]){--background:rgb(var(--tone-neutral-04));--color:rgb(var(--tone-neutral))}:host([variant=dark]:hover),:host([variant=dark][tone=strong]:hover){--background:rgb(var(--tone-neutral-05))}:host([variant=dark][active]),:host([variant=dark][tone=strong][active]){--background:rgb(var(--tone-neutral-03))}:host([variant=dark][tone=weak]){--background:rgb(var(--tone-neutral-05));--color:rgb(var(--tone-neutral))}:host([variant=dark][tone=weak]:hover){--background:rgb(var(--tone-neutral-06))}:host([variant=dark][tone=weak][active]){--background:rgb(var(--tone-neutral-04))}:host([variant=dark][tone=ghost]){--background:transparent;--border-color:rgb(var(--tone-neutral-03));--color:rgb(var(--tone-neutral-03))}:host([variant=dark][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--tone-neutral-04));--color:rgb(var(--tone-neutral-04))}:host([variant=dark][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--tone-neutral-02));--color:rgb(var(--tone-neutral-02))}:host([variant=dark][tone=quiet]){--background:transparent;--color:rgb(var(--tone-neutral-02))}:host([variant=dark][tone=quiet]:hover){--background:transparent;--color:rgb(var(--tone-neutral-04))}:host([variant=dark][tone=quiet][active]){--background:transparent;--color:rgb(var(--tone-neutral-02))}@tailwind utilities; :host([variant=light]),:host([variant=light][tone=strong]){--background:rgb(var(--tone-neutral));--color:rgb(var(--tone-neutral-03))}:host([variant=light]:hover),:host([variant=light][tone=strong]:hover){--color:rgb(var(--tone-neutral-04))}:host([variant=light][active]),:host([variant=light][tone=strong][active]){--color:rgb(var(--tone-neutral-02))}:host([variant=light][tone=weak]){--background:rgb(var(--tone-neutral));--color:rgb(var(--tone-neutral-05))}:host([variant=light][tone=weak]:hover){--color:rgb(var(--tone-neutral-04))}:host([variant=light][tone=weak][active]){--color:rgb(var(--tone-neutral-03))}:host([variant=light][tone=ghost]){--background:transparent;--border-color:rgb(var(--tone-neutral));--color:rgb(var(--tone-neutral))}:host([variant=light][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--tone-neutral));--color:rgb(var(--tone-neutral))}:host([variant=light][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--tone-neutral));--color:rgb(var(--tone-neutral))}:host([variant=light][tone=quiet]){--background:transparent;--color:rgb(var(--tone-neutral))}:host([variant=light][tone=quiet]:hover){--background:transparent;--color:rgb(var(--tone-neutral))}:host([variant=light][tone=quiet][active]){--background:transparent;--color:rgb(var(--tone-neutral))}@tailwind utilities; :host([variant=error]),:host([variant=error][tone=strong]){--background:rgb(var(--status-error-05));--color:rgb(var(--tone-neutral))}:host([variant=error]:hover),:host([variant=error][tone=strong]:hover){--background:rgb(var(--status-error-04))}:host([variant=error][active]),:host([variant=error][tone=strong][active]){--background:rgb(var(--status-error-06))}:host([variant=error][tone=weak]){--background:rgb(var(--status-error-06));--color:rgb(var(--status-error-10))}:host([variant=error][tone=weak]:hover){--background:rgb(var(--status-error-05));--color:rgb(var(--tone-neutral))}:host([variant=error][tone=weak][active]){--background:rgb(var(--status-error-07));--color:rgb(var(--status-error-10))}:host([variant=error][tone=ghost]){--background:transparent;--border-color:rgb(var(--status-error-04));--color:rgb(var(--status-error-03))}:host([variant=error][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--status-error-04));--color:rgb(var(--status-error-02))}:host([variant=error][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--status-error-05));--color:rgb(var(--status-error-03))}:host([variant=error][tone=quiet]){--background:transparent;--color:rgb(var(--status-error-02))}:host([variant=error][tone=quiet]:hover){--background:transparent;--color:rgb(var(--status-error-04))}:host([variant=error][tone=quiet][active]){--background:transparent;--color:rgb(var(--status-error-01))}.pointer-events-none{pointer-events:none !important}.collapse{visibility:collapse !important}.static{position:static !important}.fixed{position:fixed !important}.absolute{position:absolute !important}.relative{position:relative !important}.sticky{position:sticky !important}.top-4{top:1rem !important}.left-5{left:1.25rem !important}.bottom-0{bottom:0px !important}.right-0{right:0px !important}.my-3{margin-top:0.75rem !important;margin-bottom:0.75rem !important}.mx-6{margin-left:1.5rem !important;margin-right:1.5rem !important}.mb-2{margin-bottom:0.5rem !important}.ml-2{margin-left:0.5rem !important}.mr-10{margin-right:2.5rem !important}.ml-10{margin-left:2.5rem !important}.mr-2{margin-right:0.5rem !important}.mr-4{margin-right:1rem !important}.ml-4{margin-left:1rem !important}.block{display:block !important}.inline{display:inline !important}.flex{display:flex !important}.table{display:table !important}.hidden{display:none !important}.h-screen{height:100vh !important}.h-full{height:100% !important}.h-auto{height:auto !important}.min-h-\\[200px\\]{min-height:200px !important}.min-h-\\[50px\\]{min-height:50px !important}.w-screen{width:100vw !important}.w-\\[200px\\]{width:200px !important}.w-full{width:100% !important}.w-10{width:2.5rem !important}.w-\\[40px\\]{width:40px !important}.w-auto{width:auto !important}.w-24{width:6rem !important}.min-w-\\[200px\\]{min-width:200px !important}.max-w-\\[100px\\]{max-width:100px !important}.flex-none{flex:none !important}.grow{flex-grow:1 !important}.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)) !important}.cursor-pointer{cursor:pointer !important}.cursor-grab{cursor:grab !important}.flex-row{flex-direction:row !important}.flex-col{flex-direction:column !important}.items-center{align-items:center !important}.justify-between{justify-content:space-between !important}.whitespace-pre-wrap{white-space:pre-wrap !important}.rounded-md{border-radius:0.375rem !important}.rounded-lg{border-radius:0.5rem !important}.rounded-b-md{border-bottom-right-radius:0.375rem !important;border-bottom-left-radius:0.375rem !important}.rounded-t-md{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important}.border{border-width:1px !important}.bg-brand-maggioli-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-maggioli-05), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-18{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-18), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-17{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-17), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-04{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-04), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-06{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-bg-opacity)) !important}.bg-label-amaranth-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-amaranth-05), var(--tw-bg-opacity)) !important}.bg-label-aqua-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-aqua-05), var(--tw-bg-opacity)) !important}.bg-label-blue-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-blue-05), var(--tw-bg-opacity)) !important}.bg-label-green-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-green-05), var(--tw-bg-opacity)) !important}.bg-label-lime-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-lime-05), var(--tw-bg-opacity)) !important}.bg-label-orange-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orange-05), var(--tw-bg-opacity)) !important}.bg-label-orchid-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orchid-05), var(--tw-bg-opacity)) !important}.bg-label-sky-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-sky-05), var(--tw-bg-opacity)) !important}.bg-label-yellow-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-yellow-05), var(--tw-bg-opacity)) !important}.bg-label-violet-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-violet-05), var(--tw-bg-opacity)) !important}.bg-status-error-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity)) !important}.bg-status-info-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity)) !important}.bg-status-success-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-success-05), var(--tw-bg-opacity)) !important}.bg-status-warning-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-warning-05), var(--tw-bg-opacity)) !important}.fill-label-blue-05{fill:rgb(var(--label-blue-05)) !important}.fill-label-green-06{fill:rgb(var(--label-green-06)) !important}.p-4{padding:1rem !important}.py-2{padding-top:0.5rem !important;padding-bottom:0.5rem !important}.py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.pr-6{padding-right:1.5rem !important}.pl-5{padding-left:1.25rem !important}.pr-4{padding-right:1rem !important}.pt-10{padding-top:2.5rem !important}.text-base{font-size:1rem !important;line-height:1.5rem !important}.text-sm{font-size:0.875rem !important;line-height:1.25rem !important}.font-bold{font-weight:700 !important}.font-normal{font-weight:400 !important}.lowercase{text-transform:lowercase !important}.text-brand-synbee-eolo-v1-06{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-text-opacity)) !important}.text-brand-synbee-eolo-v1-04{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-04), var(--tw-text-opacity)) !important}.text-adjust-tone-04{--tw-text-opacity:1 !important;color:rgba(var(--adjust-tone-04), var(--tw-text-opacity)) !important}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important}:host([variant=warning]),:host([variant=warning][tone=strong]){--background:rgb(var(--status-warning-05));--color:rgb(var(--tone-neutral))}:host([variant=warning]:hover),:host([variant=warning][tone=strong]:hover){--background:rgb(var(--status-warning-04))}:host([variant=warning][active]),:host([variant=warning][tone=strong][active]){--background:rgb(var(--status-warning-06))}:host([variant=warning][tone=weak]){--background:rgb(var(--status-warning-06));--color:rgb(var(--status-warning-10))}:host([variant=warning][tone=weak]:hover){--background:rgb(var(--status-warning-05));--color:rgb(var(--tone-neutral))}:host([variant=warning][tone=weak][active]){--background:rgb(var(--status-warning-07));--color:rgb(var(--status-warning-10))}:host([variant=warning][tone=ghost]){--background:transparent;--border-color:rgb(var(--status-warning-04));--color:rgb(var(--status-warning-03))}:host([variant=warning][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--status-warning-04));--color:rgb(var(--status-warning-02))}:host([variant=warning][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--status-warning-05));--color:rgb(var(--status-warning-03))}:host([variant=warning][tone=quiet]){--background:transparent;--color:rgb(var(--status-warning-02))}:host([variant=warning][tone=quiet]:hover){--background:transparent;--color:rgb(var(--status-warning-04))}:host([variant=warning][tone=quiet][active]){--background:transparent;--color:rgb(var(--status-warning-01))}.pointer-events-none{pointer-events:none !important}.collapse{visibility:collapse !important}.static{position:static !important}.fixed{position:fixed !important}.absolute{position:absolute !important}.relative{position:relative !important}.sticky{position:sticky !important}.top-4{top:1rem !important}.left-5{left:1.25rem !important}.bottom-0{bottom:0px !important}.right-0{right:0px !important}.my-3{margin-top:0.75rem !important;margin-bottom:0.75rem !important}.mx-6{margin-left:1.5rem !important;margin-right:1.5rem !important}.mb-2{margin-bottom:0.5rem !important}.ml-2{margin-left:0.5rem !important}.mr-10{margin-right:2.5rem !important}.ml-10{margin-left:2.5rem !important}.mr-2{margin-right:0.5rem !important}.mr-4{margin-right:1rem !important}.ml-4{margin-left:1rem !important}.block{display:block !important}.inline{display:inline !important}.flex{display:flex !important}.table{display:table !important}.hidden{display:none !important}.h-screen{height:100vh !important}.h-full{height:100% !important}.h-auto{height:auto !important}.min-h-\\[200px\\]{min-height:200px !important}.min-h-\\[50px\\]{min-height:50px !important}.w-screen{width:100vw !important}.w-\\[200px\\]{width:200px !important}.w-full{width:100% !important}.w-10{width:2.5rem !important}.w-\\[40px\\]{width:40px !important}.w-auto{width:auto !important}.w-24{width:6rem !important}.min-w-\\[200px\\]{min-width:200px !important}.max-w-\\[100px\\]{max-width:100px !important}.flex-none{flex:none !important}.grow{flex-grow:1 !important}.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)) !important}.cursor-pointer{cursor:pointer !important}.cursor-grab{cursor:grab !important}.flex-row{flex-direction:row !important}.flex-col{flex-direction:column !important}.items-center{align-items:center !important}.justify-between{justify-content:space-between !important}.whitespace-pre-wrap{white-space:pre-wrap !important}.rounded-md{border-radius:0.375rem !important}.rounded-lg{border-radius:0.5rem !important}.rounded-b-md{border-bottom-right-radius:0.375rem !important;border-bottom-left-radius:0.375rem !important}.rounded-t-md{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important}.border{border-width:1px !important}.bg-brand-maggioli-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-maggioli-05), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-18{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-18), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-17{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-17), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-04{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-04), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-06{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-bg-opacity)) !important}.bg-label-amaranth-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-amaranth-05), var(--tw-bg-opacity)) !important}.bg-label-aqua-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-aqua-05), var(--tw-bg-opacity)) !important}.bg-label-blue-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-blue-05), var(--tw-bg-opacity)) !important}.bg-label-green-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-green-05), var(--tw-bg-opacity)) !important}.bg-label-lime-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-lime-05), var(--tw-bg-opacity)) !important}.bg-label-orange-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orange-05), var(--tw-bg-opacity)) !important}.bg-label-orchid-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orchid-05), var(--tw-bg-opacity)) !important}.bg-label-sky-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-sky-05), var(--tw-bg-opacity)) !important}.bg-label-yellow-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-yellow-05), var(--tw-bg-opacity)) !important}.bg-label-violet-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-violet-05), var(--tw-bg-opacity)) !important}.bg-status-error-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity)) !important}.bg-status-info-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity)) !important}.bg-status-success-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-success-05), var(--tw-bg-opacity)) !important}.bg-status-warning-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-warning-05), var(--tw-bg-opacity)) !important}.fill-label-blue-05{fill:rgb(var(--label-blue-05)) !important}.fill-label-green-06{fill:rgb(var(--label-green-06)) !important}.p-4{padding:1rem !important}.py-2{padding-top:0.5rem !important;padding-bottom:0.5rem !important}.py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.pr-6{padding-right:1.5rem !important}.pl-5{padding-left:1.25rem !important}.pr-4{padding-right:1rem !important}.pt-10{padding-top:2.5rem !important}.text-base{font-size:1rem !important;line-height:1.5rem !important}.text-sm{font-size:0.875rem !important;line-height:1.25rem !important}.font-bold{font-weight:700 !important}.font-normal{font-weight:400 !important}.lowercase{text-transform:lowercase !important}.text-brand-synbee-eolo-v1-06{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-text-opacity)) !important}.text-brand-synbee-eolo-v1-04{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-04), var(--tw-text-opacity)) !important}.text-adjust-tone-04{--tw-text-opacity:1 !important;color:rgba(var(--adjust-tone-04), var(--tw-text-opacity)) !important}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important}:host([variant=info]),:host([variant=info][tone=strong]){--background:rgb(var(--status-info-05));--color:rgb(var(--tone-neutral))}:host([variant=info]:hover),:host([variant=info][tone=strong]:hover){--background:rgb(var(--status-info-04))}:host([variant=info][active]),:host([variant=info][tone=strong][active]){--background:rgb(var(--status-info-06))}:host([variant=info][tone=weak]){--background:rgb(var(--status-info-06));--color:rgb(var(--status-info-10))}:host([variant=info][tone=weak]:hover){--background:rgb(var(--status-info-05));--color:rgb(var(--tone-neutral))}:host([variant=info][tone=weak][active]){--background:rgb(var(--status-info-07));--color:rgb(var(--status-info-10))}:host([variant=info][tone=ghost]){--background:transparent;--border-color:rgb(var(--status-info-04));--color:rgb(var(--status-info-03))}:host([variant=info][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--status-info-04));--color:rgb(var(--status-info-02))}:host([variant=info][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--status-info-05));--color:rgb(var(--status-info-03))}:host([variant=info][tone=quiet]){--background:transparent;--color:rgb(var(--status-info-02))}:host([variant=info][tone=quiet]:hover){--background:transparent;--color:rgb(var(--status-info-04))}:host([variant=info][tone=quiet][active]){--background:transparent;--color:rgb(var(--status-info-01))}.fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 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)}:host([variant=success]),:host([variant=success][tone=strong]){--background:rgb(var(--status-success-05));--color:rgb(var(--tone-neutral))}:host([variant=success]:hover),:host([variant=success][tone=strong]:hover){--background:rgb(var(--status-success-04))}:host([variant=success][active]),:host([variant=success][tone=strong][active]){--background:rgb(var(--status-success-06))}:host([variant=success][tone=weak]){--background:rgb(var(--status-success-06));--color:rgb(var(--status-success-10))}:host([variant=success][tone=weak]:hover){--background:rgb(var(--status-success-05));--color:rgb(var(--tone-neutral))}:host([variant=success][tone=weak][active]){--background:rgb(var(--status-success-07));--color:rgb(var(--status-success-10))}:host([variant=success][tone=ghost]){--background:transparent;--border-color:rgb(var(--status-success-04));--color:rgb(var(--status-success-03))}:host([variant=success][tone=ghost]:hover){--background:transparent;--border-color:rgb(var(--status-success-04));--color:rgb(var(--status-success-02))}:host([variant=success][tone=ghost][active]){--background:transparent;--border-color:rgb(var(--status-success-05));--color:rgb(var(--status-success-03))}:host([variant=success][tone=quiet]){--background:transparent;--color:rgb(var(--status-success-02))}:host([variant=success][tone=quiet]:hover){--background:transparent;--color:rgb(var(--status-success-04))}:host([variant=success][tone=quiet][active]){--background:transparent;--color:rgb(var(--status-success-01))}:host([size=sm]){height:1.75rem;padding-left:0.75rem;padding-right:0.75rem;padding-top:0px;padding-bottom:0px;--radius:0.375rem}:host(.no-text[size=sm]){padding:0px}:host([size=sm]) .text{font-weight:500}:host([size=md]){height:2.25rem;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.25rem;padding-bottom:0.25rem}:host(.no-text[size=md]){padding:0.25rem}:host([size=lg]){height:2.75rem;padding-left:1.5rem;padding-right:1.5rem;padding-top:0.5rem;padding-bottom:0.5rem}:host(.no-text[size=lg]){padding:0.5rem}:host([size=xl]){height:3.25rem;padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem}:host(.no-text[size=xl]){padding:0.5rem}.active\\:cursor-grabbing:active{cursor:grabbing !important}";

const MdsButton = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /**
     * Specifies the horizontal position of the icon displayed in the button
     */
    this.iconPosition = 'left';
    /**
     * The type of the button element
     */
    this.type = 'submit';
    /**
     * Specifies the color variant for the button
     */
    this.variant = 'primary';
    /**
     * Specifies the tone variant for the button
     */
    this.tone = 'strong';
    /**
     * Specifies the size for the button
     */
    this.size = 'md';
    this.mouseDown = () => {
      this.active = true;
    };
    this.mouseUp = () => {
      this.active = false;
    };
  }
  componentWillLoad() {
    this.hasText = this.hostElement.innerHTML !== '';
  }
  render() {
    this.typography = buttonSizeTypographyVariant[this.size];
    return (index.h(index.Host, { class: clsx_m.clsx(!this.hasText && 'no-text'), onMouseDown: this.mouseDown, onMouseUp: this.mouseUp, onMouseOut: this.mouseUp }, this.icon && this.iconPosition === 'left' && index.h("mds-icon", { class: "icon", name: this.icon }), this.hasText && index.h("mds-text", { class: "text", part: "label", typography: this.typography }, index.h("slot", null)), this.icon && this.iconPosition === 'right' && index.h("mds-icon", { class: "icon", name: this.icon })));
  }
  get hostElement() { return index.getElement(this); }
};
MdsButton.style = mdsButtonCss;

function promisifyRequest(request) {
  return new Promise(function (resolve, reject) {
    // @ts-ignore - file size hacks
    request.oncomplete = request.onsuccess = function () {
      return resolve(request.result);
    }; // @ts-ignore - file size hacks


    request.onabort = request.onerror = function () {
      return reject(request.error);
    };
  });
}

function createStore(dbName, storeName) {
  var request = indexedDB.open(dbName);

  request.onupgradeneeded = function () {
    return request.result.createObjectStore(storeName);
  };

  var dbp = promisifyRequest(request);
  return function (txMode, callback) {
    return dbp.then(function (db) {
      return callback(db.transaction(storeName, txMode).objectStore(storeName));
    });
  };
}

var defaultGetStoreFunc;

function defaultGetStore() {
  if (!defaultGetStoreFunc) {
    defaultGetStoreFunc = createStore('keyval-store', 'keyval');
  }

  return defaultGetStoreFunc;
}
/**
 * Get a value by its key.
 *
 * @param key
 * @param customStore Method to get a custom store. Use with caution (see the docs).
 */


function get(key) {
  var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();
  return customStore('readonly', function (store) {
    return promisifyRequest(store.get(key));
  });
}
/**
 * Set a value with a key.
 *
 * @param key
 * @param value
 * @param customStore Method to get a custom store. Use with caution (see the docs).
 */


function set(key, value) {
  var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();
  return customStore('readwrite', function (store) {
    store.put(value, key);
    return promisifyRequest(store.transaction);
  });
}
/**
 * Delete a particular key from the store.
 *
 * @param key
 * @param customStore Method to get a custom store. Use with caution (see the docs).
 */


function del(key) {
  var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();
  return customStore('readwrite', function (store) {
    store.delete(key);
    return promisifyRequest(store.transaction);
  });
}

class MdsIconSet {
  /**
   * Create a new icon set.  Icon sets have a name (ie, a namespace).  For
   * example, an icon with a name of "rh-logo" represents a "logo" icon from the
   * "rh" set.  Icon set names are always separated from the rest of the icon
   * name with a hyphen `-`.  This means that set names cannot contain a hyphen.
   *
   * @param  name the namespace of the icon set
   * @param  path the web-accessible path to the icon set (for instance, a CDN)
   * @param  resolveIconName an optional function to combine the path and an icon name into a final path.  The function will be passed the namespaced icon name (for example, "rh-api" where rh is the namespace and api is the individual icon's name)
   * @returns  an object with the status of the icon set installation, such as `{ result: true, text: 'icon set installed' }` or `{ result: false, text: 'icon set is already installed' }`
   */
  constructor(name, path, _resolveIconName) {
    this.name = name;
    this.path = path;
    this._resolveIconName = _resolveIconName;
  }
  /**
   * Run the icon set's name resolver to turn an icon name into an icon path, id, etc.
   */
  resolveIconName(iconName) {
    console.log(`resolveIconName - iconName: ${iconName} | name: ${this.name} | path: ${this.path}`);
    return this._resolveIconName(iconName, this.name, this.path);
  }
  get resolver() {
    return this._resolveIconName;
  }
}

class IconsSetController {
  constructor() {
    this._iconsSets = new Map();
    this.cacheExp = 60 * 60 * 1000 * 24;
    this.memoryCache = {};
    // Try to retrieve svg from cache
    this.isCacheAvailable = async (url) => {
      try {
        const loaderItem = await get(`loader_${url}`);
        if (!loaderItem) {
          return false;
        }
        const item = JSON.parse(loaderItem);
        if (Date.now() < item.expiry) {
          return item.data;
        }
        del(`loader_${url}`);
        return false;
      }
      catch (e) {
        console.error('isCacheAvailable error', e);
        return false;
      }
    };
    // Set svg to cache
    this.setCache = async (url, data) => {
      try {
        await set(`loader_${url}`, JSON.stringify({
          data,
          expiry: Date.now() + this.cacheExp,
        }));
      }
      catch (e) {
        console.error('setCache error', e);
      }
    };
  }
  addIconSet(name, path, resolveIconName) {
    let resolveFunction = resolveIconName;
    const existingSet = this._iconsSets.get(name);
    if (!resolveFunction && existingSet && typeof existingSet.resolver === 'function') {
      resolveFunction = existingSet.resolver;
    }
    else if (resolveFunction && typeof resolveFunction !== 'function') {
      console.error('MdsIconSvg: the third input of addIconSet should be a function that parses and returns the icons\'s filename.');
      return false;
    }
    else if (!resolveFunction) {
      console.error(`MdsIconSvg: the set ${name} needs a resolve function for the icon names.`);
      return false;
    }
    this._iconsSets.set(name, new MdsIconSet(name, path, resolveFunction));
    return true;
  }
  getIconSet(iconName) {
    if (!iconName)
      return { set: null };
    return { set: this._iconsSets.get(iconName.split('/')[0]) };
  }
  setSvgPath(svgPath) {
    this._svgPath = svgPath;
  }
  getSvgPath() {
    return this._svgPath;
  }
  async fetchSvg(src) {
    try {
      const lsCache = await this.isCacheAvailable(src);
      if (this.memoryCache[src] || lsCache) {
        return this.memoryCache[src] || lsCache;
      }
      const response = await fetch(src);
      if (!response.ok) {
        throw Error(`Request for '${src}' returned ${response.status} (${response.statusText})`);
      }
      const body = await response.text();
      const bodyLower = body.toLowerCase().trim();
      if (!(bodyLower.startsWith('<svg') || bodyLower.startsWith('<?xml'))) {
        throw Error(`Resource '${src}' returned an invalid SVG file`);
      }
      this.setCache(src, body);
      this.memoryCache[src] = body;
      return body;
    }
    catch (e) {
      console.error('fetchSvg error', e);
      return '';
    }
  }
}
const IconsSetService = new IconsSetController();

const mdsIconCss = ".static{position:static}.fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.fill-label-blue-05{fill:rgb(var(--label-blue-05))}.fill-label-green-06{fill:rgb(var(--label-green-06))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 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)}:host{display:inline-flex;aspect-ratio:1 / 1;width:1.5rem;align-items:center;justify-content:center}.icon{display:inline-flex;align-items:center;justify-content:center;font-style:normal}.icon svg{height:auto;width:100%}";

const MdsIcon = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.updateIconHref();
  }
  static setSvgPathStatic(path) {
    IconsSetService.setSvgPath(path);
  }
  /**
   * Set the path to the directory of svg files
   * @param svgPath path to the directory of svg files
   */
  async setSvgPath(svgPath) {
    IconsSetService.setSvgPath(svgPath);
    this.updateIconHref();
  }
  async updateIconHref() {
    if (!this.name)
      return Promise.resolve();
    const svgPath = IconsSetService.getSvgPath() || window.sessionStorage.getItem(MdsIcon._svgPathKey);
    this._iconHref = svgPath && !this.name.startsWith('http') ? window.location.origin.concat(svgPath.concat(this.name).concat('.svg')) : this.name;
    this.svgHTML = await IconsSetService.fetchSvg(this._iconHref);
  }
  render() {
    return (index.h(index.Host, null, this.svgHTML && index.h("i", { class: "icon", innerHTML: this.svgHTML })));
  }
  get hostElement() { return index.getElement(this); }
  static get watchers() { return {
    "name": ["updateIconHref"]
  }; }
};
MdsIcon._svgPathKey = 'mdsIconSvgPath';
MdsIcon.style = mdsIconCss;

exports.mds_button = MdsButton;
exports.mds_icon = MdsIcon;
