import{a as p}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.UFTAQNZB.js";import{a as r}from"./chunk.NYKJXI3Q.js";import{a as d,b as o,h as n}from"./chunk.XJAJO727.js";import{b as m,e as s}from"./chunk.OBAEIKIV.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends n{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","help-text");this.size="lg";this.orientation="vertical";this.label="";this.helpText=""}getAllCheckboxes(){return[...this.querySelectorAll("sd-6-22-0-checkbox")]}async syncCheckboxElements(){let i=this.getAllCheckboxes();await Promise.all(i.map(async l=>{await l.updateComplete,l.size=this.size}))}syncCheckboxes(){customElements.get("sd-6-22-0-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-6-22-0-checkbox").then(()=>this.syncCheckboxes())}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){let i=this.hasSlotController.test("label"),l=this.label?!0:i,b=this.hasSlotController.test("help-text"),c=this.helpText?!0:b,x=s`<slot @slotchange="${this.syncCheckboxes}"></slot>`,h=this.hasSlotController.test("tooltip");return s`<fieldset part="form-control" class="${a("border-0 p-0 m-0",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label">${l||h?s`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a("p-0 font-bold leading-normal text-black",l?"flex":"hidden")}" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${h?s`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a({vertical:"flex flex-col",horizontal:"flex flex-row"}[this.orientation])}">${x}</div></fieldset><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-2",c?"block":"hidden")}" aria-hidden="${!c}">${this.helpText}</slot>`}};t.styles=[...n.styles,m`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
:host{display:block}:host([orientation=vertical]) ::slotted(sd-6-22-0-checkbox){margin-bottom:var(--sd-spacing-2);display:flex}:host([orientation=vertical]) ::slotted(sd-6-22-0-checkbox:last-of-type){margin-bottom:calc(var(--sd-spacing-1) * 0)}:host([orientation=horizontal]) ::slotted(sd-6-22-0-checkbox){margin-right:var(--sd-spacing-6)}:host([orientation=horizontal]) ::slotted(sd-6-22-0-checkbox:last-of-type){margin-right:calc(var(--sd-spacing-1) * 0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-6-22-0-checkbox){margin-right:var(--sd-spacing-4)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-6-22-0-checkbox:last-of-type){margin-right:calc(var(--sd-spacing-1) * 0)}`],e([o({type:String,reflect:!0})],t.prototype,"size",2),e([o({type:String,reflect:!0})],t.prototype,"orientation",2),e([o({type:String,reflect:!0})],t.prototype,"label",2),e([o({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),e([r("size",{waitUntilFirstUpdate:!0})],t.prototype,"handleSizeChange",1),e([r("invalid",{waitUntilFirstUpdate:!0})],t.prototype,"handleInvalid",1),t=e([d("sd-6-22-0-checkbox-group")],t);export{t as a};
