@sbb-esta/lyne-elements-dev 5.10.0-dev.1791595991 → 5.10.0-dev.1791683977

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/chip.pure.js CHANGED
@@ -14,4 +14,4 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
14
14
  </sbb-mini-button>
15
15
  <span class="sbb-screen-reader-only">, ${g[this._language.current]}</span>
16
16
  `}}})();var w=`:host{gap:var(--sbb-chip-group-gap);width:100%;margin-block:var(--sbb-chip-group-margin-block);line-height:var(--sbb-typo-line-height-text);flex-wrap:wrap;align-items:center;display:flex}:host(:is(:is(:state(size-s),[state--size-s]),:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:0}:host(:is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-s)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-s)}:host(:is(:is(:state(size-l),[state--size-l]),:is(:state(size-m),[state--size-m]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-base-lm)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-m)}:host(:is(:state(without-label),[state--without-label]):not(:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-no-label-not-empty)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-m)}:host(:not(:is(:state(without-label),[state--without-label]),:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-with-label-not-empty)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-l)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-l)}::slotted(input){flex:1 1 var(--sbb-chip-group-input-min-width);max-height:1.5rem}::slotted(sbb-chip){max-width:100%}
17
- `,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.elementDependencies=[C]}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips(),e.has(`disabled`)&&this._inputElement&&this._inputElement.disabled!==this.disabled&&(this._inputElement.disabled=this.disabled)}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){if(!e){this.value=null;return}this._readFormData(e).then(e=>this.value=e)}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus();return}switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t))}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault()}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.dispatchDeleteEvent(),e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();if(e!==void 0&&t[e]){t[e].focus();return}if(t.length>0){t[t.length-1].focus();return}this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){let e=this._inputElement?.disabled??!1;this.disabled!==e&&(this.disabled=e),this._proxyStateToChips()}_proxyStateToChips(){this._chipElements().forEach(e=>{e.disabled=this.disabled||this.formDisabled,e.readOnly=this._inputElement?.hasAttribute(`readonly`)??!1,e.negative=this.negative})}_updateSize(e){this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}_updateInputDescription(){this._inputElement&&this._inputElement.setAttribute(`aria-description`,`${_[this._language.current]} ${this.value.length}`)}render(){return n`<slot @slotchange=${this._setupComponent}></slot>`}}})();export{C as SbbChipElement,E as SbbChipGroupElement,T as SbbChipInputTokenEndEvent};
17
+ `,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.elementDependencies=[C]}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips(),e.has(`disabled`)&&this._inputElement&&this._inputElement.disabled!==this.disabled&&(this._inputElement.disabled=this.disabled)}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){e?this._readFormData(e).then(e=>this.value=e):this.value=null}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus()}else switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t))}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault()}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.dispatchDeleteEvent(),e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();e!==void 0&&t[e]?t[e].focus():t.length>0?t[t.length-1].focus():this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){let e=this._inputElement?.disabled??!1;this.disabled!==e&&(this.disabled=e),this._proxyStateToChips()}_proxyStateToChips(){this._chipElements().forEach(e=>{e.disabled=this.disabled||this.formDisabled,e.readOnly=this._inputElement?.hasAttribute(`readonly`)??!1,e.negative=this.negative})}_updateSize(e){this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}_updateInputDescription(){this._inputElement&&this._inputElement.setAttribute(`aria-description`,`${_[this._language.current]} ${this.value.length}`)}render(){return n`<slot @slotchange=${this._setupComponent}></slot>`}}})();export{C as SbbChipElement,E as SbbChipGroupElement,T as SbbChipInputTokenEndEvent};
package/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import{LitElement as e,defaultConverter as t,html as n,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{__esDecorate as o,__runInitializers as s}from"tslib";import{eventOptions as c,property as l,state as u}from"lit/decorators.js";import{MutationController as d}from"@lit-labs/observers/mutation-controller.js";function f(){return document.documentElement.matches(`:dir(rtl)`)?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}}function p(e){return[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`].includes(e.key)}function m(e){return e.key===`ArrowUp`||e.key===f().prevKey}function h(e){return e.key===`ArrowDown`||e.key===f().nextKey}function g(e){return p(e)||[`PageUp`,`PageDown`,`Home`,`End`].includes(e.key)}function _(e,t,n){return(e+n+t)%t}function v(e){return e-1}function y(e,t,n){let{prevKey:r,nextKey:i}=f();return!e||e.key===i||e.key===`ArrowDown`?t>=n?0:_(t,n,1):e.key===r||e.key===`ArrowUp`?t<0?v(n):_(t,n,-1):t}function b(e){return e.buttons===0||e.detail===0}function x(e){let t=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!!t&&t.identifier===-1&&(t.radiusX==null||t.radiusX===1)&&(t.radiusY==null||t.radiusY===1)}function S(e){return e.composedPath?e.composedPath()[0]:e.target}const C={ignoreKeys:[18,17,224,91,16]},w={passive:!0,capture:!0},T=new class{get mostRecentModality(){return this._mostRecentModality}get mostRecentTarget(){return this._mostRecentTarget}constructor(){this._mostRecentModality=`mouse`,this._mostRecentTarget=null,this._options={...C},this._lastTouchMs=0,this._onKeydown=e=>{this._options?.ignoreKeys?.some(t=>t===e.keyCode)||this._updateState(`keyboard`,e)},this._onMousedown=e=>{Date.now()-this._lastTouchMs<650||this._updateState(b(e)?`keyboard`:`mouse`,e)},this._onTouchstart=e=>{if(x(e)){this._updateState(`keyboard`,e);return}this._lastTouchMs=Date.now(),this._updateState(`touch`,e)},r||(document.addEventListener(`keydown`,this._onKeydown,w),document.addEventListener(`mousedown`,this._onMousedown,w),document.addEventListener(`touchstart`,this._onTouchstart,w))}reset(){this._updateState(`mouse`,null),this._lastTouchMs=0}_updateState(e,t){this._mostRecentModality&&document.documentElement.classList.remove(`sbb-focus-modality-${this._mostRecentModality}`),this._mostRecentModality=e,this._mostRecentTarget=t?S(t):null,document.documentElement.classList.add(`sbb-focus-modality-${this._mostRecentModality}`)}};var ee=class{constructor(e){this._host=e,this._focusinHandler=()=>{this._host.toggleState?.(`has-visible-focus-within`,T.mostRecentModality===`keyboard`)},this._focusoutHandler=()=>{this._host.toggleState?.(`has-visible-focus-within`,!1)},this._host.addController(this)}hostConnected(){this._host.addEventListener(`focusin`,this._focusinHandler),this._host.addEventListener(`focusout`,this._focusoutHandler)}hostDisconnected(){this._host.removeEventListener(`focusin`,this._focusinHandler),this._host.removeEventListener(`focusout`,this._focusoutHandler)}};const te=[`button`,`[href]`,`input`,`select`,`textarea`,`details`,`summary`,`[tabindex]`].map(e=>`${e}:not([disabled],:disabled,[tabindex="-1"],[inert])`).join(`,`);let E;try{E=typeof Intl<`u`&&Intl.v8BreakIterator}catch{E=!1}const D=!r&&/(edge)/i.test(navigator.userAgent),O=!r&&/(msie|trident)/i.test(navigator.userAgent),k=!r&&!!(window.chrome||E)&&typeof CSS<`u`&&!D&&!O,A=!r&&/AppleWebKit/i.test(navigator.userAgent)&&!k&&!D&&!O,j=!r&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!(`MSStream`in window),ne=!r&&/(Mac)/i.test(navigator.platform),re=!r&&/(firefox|minefield)/i.test(navigator.userAgent),ie=!r&&/android/i.test(navigator.userAgent)&&!O,ae=!r&&/safari/i.test(navigator.userAgent)&&A,oe=k,se=()=>!!globalThis.next;
1
+ import{LitElement as e,defaultConverter as t,html as n,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{__esDecorate as o,__runInitializers as s}from"tslib";import{eventOptions as c,property as l,state as u}from"lit/decorators.js";import{MutationController as d}from"@lit-labs/observers/mutation-controller.js";function f(){return document.documentElement.matches(`:dir(rtl)`)?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}}function p(e){return[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`].includes(e.key)}function m(e){return e.key===`ArrowUp`||e.key===f().prevKey}function h(e){return e.key===`ArrowDown`||e.key===f().nextKey}function g(e){return p(e)||[`PageUp`,`PageDown`,`Home`,`End`].includes(e.key)}function _(e,t,n){return(e+n+t)%t}function v(e){return e-1}function y(e,t,n){let{prevKey:r,nextKey:i}=f();return!e||e.key===i||e.key===`ArrowDown`?t>=n?0:_(t,n,1):e.key===r||e.key===`ArrowUp`?t<0?v(n):_(t,n,-1):t}function b(e){return e.buttons===0||e.detail===0}function x(e){let t=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!!t&&t.identifier===-1&&(t.radiusX==null||t.radiusX===1)&&(t.radiusY==null||t.radiusY===1)}function S(e){return e.composedPath?e.composedPath()[0]:e.target}const C={ignoreKeys:[18,17,224,91,16]},w={passive:!0,capture:!0},T=new class{get mostRecentModality(){return this._mostRecentModality}get mostRecentTarget(){return this._mostRecentTarget}constructor(){this._mostRecentModality=`mouse`,this._mostRecentTarget=null,this._options={...C},this._lastTouchMs=0,this._onKeydown=e=>{this._options?.ignoreKeys?.some(t=>t===e.keyCode)||this._updateState(`keyboard`,e)},this._onMousedown=e=>{Date.now()-this._lastTouchMs<650||this._updateState(b(e)?`keyboard`:`mouse`,e)},this._onTouchstart=e=>{x(e)?this._updateState(`keyboard`,e):(this._lastTouchMs=Date.now(),this._updateState(`touch`,e))},r||(document.addEventListener(`keydown`,this._onKeydown,w),document.addEventListener(`mousedown`,this._onMousedown,w),document.addEventListener(`touchstart`,this._onTouchstart,w))}reset(){this._updateState(`mouse`,null),this._lastTouchMs=0}_updateState(e,t){this._mostRecentModality&&document.documentElement.classList.remove(`sbb-focus-modality-${this._mostRecentModality}`),this._mostRecentModality=e,this._mostRecentTarget=t?S(t):null,document.documentElement.classList.add(`sbb-focus-modality-${this._mostRecentModality}`)}};var ee=class{constructor(e){this._host=e,this._focusinHandler=()=>{this._host.toggleState?.(`has-visible-focus-within`,T.mostRecentModality===`keyboard`)},this._focusoutHandler=()=>{this._host.toggleState?.(`has-visible-focus-within`,!1)},this._host.addController(this)}hostConnected(){this._host.addEventListener(`focusin`,this._focusinHandler),this._host.addEventListener(`focusout`,this._focusoutHandler)}hostDisconnected(){this._host.removeEventListener(`focusin`,this._focusinHandler),this._host.removeEventListener(`focusout`,this._focusoutHandler)}};const te=[`button`,`[href]`,`input`,`select`,`textarea`,`details`,`summary`,`[tabindex]`].map(e=>`${e}:not([disabled],:disabled,[tabindex="-1"],[inert])`).join(`,`);let E;try{E=typeof Intl<`u`&&Intl.v8BreakIterator}catch{E=!1}const D=!r&&/(edge)/i.test(navigator.userAgent),O=!r&&/(msie|trident)/i.test(navigator.userAgent),k=!r&&!!(window.chrome||E)&&typeof CSS<`u`&&!D&&!O,A=!r&&/AppleWebKit/i.test(navigator.userAgent)&&!k&&!D&&!O,j=!r&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!(`MSStream`in window),ne=!r&&/(Mac)/i.test(navigator.platform),re=!r&&/(firefox|minefield)/i.test(navigator.userAgent),ie=!r&&/android/i.test(navigator.userAgent)&&!O,ae=!r&&/safari/i.test(navigator.userAgent)&&A,oe=k,se=()=>!!globalThis.next;
2
2
  /**
3
3
  * @license
4
4
  * Copyright Google LLC All Rights Reserved.
@@ -40,7 +40,7 @@ let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._cr
40
40
  `;let zn=(()=>{let e=V(H(P)),t,r=[],i=[],c,u=[],f=[],p,m=[],h=[];return class extends e{static{let n=typeof Symbol==`function`&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[l()],c=[l({attribute:`horizontal-from`,reflect:!0})],p=[l({reflect:!0})],o(this,null,t,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:n},r,i),o(this,null,c,{kind:`accessor`,name:`horizontalFrom`,static:!1,private:!1,access:{has:e=>`horizontalFrom`in e,get:e=>e.horizontalFrom,set:(e,t)=>{e.horizontalFrom=t}},metadata:n},u,f),o(this,null,p,{kind:`accessor`,name:`orientation`,static:!1,private:!1,access:{has:e=>`orientation`in e,get:e=>e.orientation,set:(e,t)=>{e.orientation=t}},metadata:n},m,h),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}static{this.styles=[a(Rn)]}#e=s(this,r,null);get size(){return this.#e}set size(e){this.#e=e}#t=(s(this,i),s(this,u,null));get horizontalFrom(){return this.#t}set horizontalFrom(e){this.#t=e}#n=(s(this,f),s(this,m,`horizontal`));get orientation(){return this.#n}set orientation(e){this.#n=e}get selectionElements(){return Array.from(this.querySelectorAll?.(this.selectionElementSelectors)??[]).filter(e=>e.closest?.(this.localName)===this)}constructor(){super(),s(this,h),this.addController(new d(this,{config:{childList:!0,subtree:!0},callback:()=>this.toggleState(`has-panel`,!!this.querySelector?.(this.panelElementSelector))}))}onSlotChange(){}render(){return n`
41
41
  <slot @slotchange=${()=>this.onSlotChange()}></slot>
42
42
  <slot name="error"></slot>
43
- `}}})();var Bn=class{get size(){return this._handlers.size}constructor(e,t){this._host=e,this._property=t,this._handlers=/* @__PURE__ */ new Set,this._hostDefinedPromise=null,r||(customElements.get(this._host.localName)?customElements.upgrade(this._host):this._hostDefinedPromise=customElements.whenDefined(this._host.localName).then(()=>{customElements.upgrade(this._host),this._hostDefinedPromise=null})),this._value=this._host[this._property]}addHandler(e){this._handlers.size||(this._host.addController?this._host.addController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.addController(this))),this._handlers.add(e),this._hostDefinedPromise?this._hostDefinedPromise.then(()=>e(this._host)):e(this._host)}removeHandler(e){this._handlers.delete(e),this._handlers.size||(this._host.removeController?this._host.removeController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.removeController(this)))}hostUpdate(){let e=this._host[this._property];if(this._value!==e){this._value=e;for(let e of this._handlers)e(this._host)}}};const U=/* @__PURE__ */ new WeakMap;var Vn=class{constructor(e,t,n){this._host=e,this._referenceResolver=t,this._handlers=n,this._host.addController(this)}hostConnected(){this.connect()}hostDisconnected(){this._reference!==this._referenceResolver()&&this.disconnect()}connect(){let e=this._referenceResolver();if(this._reference===e||(this.disconnect(),this._reference=e,!this._reference))return;let t=U.get(this._reference);t||(t=/* @__PURE__ */ new Map,U.set(this._reference,t)),this._watchers=t;for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers.get(e);n||(n=new Bn(this._reference,e),this._watchers.set(e,n)),n.addHandler(t)}}disconnect(){if(this._reference){for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers?.get(e);n&&(n.removeHandler(t),n.size||(this._watchers.delete(e),!this._watchers.size&&this._reference&&U.delete(this._reference)))}this._reference=null}}};const Hn=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Hn.at(-1)?.escapeStrategy())});var Un=class{constructor(e,t=Hn){this._host=e,this._overlayStack=t,this._host.addController?.(this)}hostDisconnected(){this.disconnect()}connect(){this.disconnect(),this._overlayStack.push(this._host)}disconnect(){if(this._overlayStack.length){let e=this._overlayStack.findIndex(e=>e===this._host);e!==-1&&this._overlayStack.splice(e,1)}}};const Wn=/* @__PURE__ */ new WeakMap;var Gn=class{constructor(e,t,n=Wn){this._host=e,this._idRef=t,this._observers=n,this._rootNode=null,this._host.addController(this)}hostConnected(){if(r)return;this._rootNode=this._host.getRootNode();let e=this._observers.get(this._rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)n.add(e.oldValue),n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>n.add(e.id)));for(let t of e){let e=t._host[t._idRef];e&&typeof e==`string`&&n.has(e)&&t._host.requestUpdate()}});t.observe(this._rootNode,{attributeFilter:[`id`],childList:!0,subtree:!0,attributeOldValue:!0}),this._observers.set(this._rootNode,{observer:t,controllers:e})}}hostDisconnected(){if(r||!this._rootNode)return;let e=this._observers.get(this._rootNode);if(!e){this._rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),this._observers.delete(this._rootNode)),this._rootNode=null}find(){if(r||!this._rootNode)return null;{let e=this._host[this._idRef];return typeof e==`string`?this._rootNode?.getElementById(e):null}}};const Kn=[`script`,`head`,`template`,`style`,`link`],qn=/* @__PURE__ */ new Set,Jn=/* @__PURE__ */ new Set,Yn=/* @__PURE__ */ new Set;var Xn=class{constructor(e,t=qn,n=Yn,r=Jn){this._host=e,this._inertElements=t,this._inertOverlays=n,this._exemptedElements=r,this._host.addController?.(this)}hostConnected(){this._host.isOpen&&this.activate()}hostDisconnected(){this.isInert()&&this.deactivate()}activate(){this._inertOverlays.size&&this._removeAllInertAttributes(),this._inertOverlays.add(this._host),this._addAllInertAttributes()}deactivate(){if(this._currentOverlay()!==this._host){this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host);return}this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()}isInert(){return this._inertOverlays.has(this._host)}exempt(e){this._inertElements.has(e)&&!this._exemptedElements.has(e)&&(this._removeInertAttributes(e),this._inertElements.delete(e),this._exemptedElements.add(e))}restoreAllExempted(){this._exemptedElements.forEach(e=>this._addInertAttributes(e)),this._exemptedElements.clear()}_currentOverlay(){return[...this._inertOverlays].pop()??null}_removeAllInertAttributes(){this._inertElements.forEach(e=>this._removeInertAttributes(e)),this._inertElements.clear()}_removeInertAttributes(e){e&&(e.hasAttribute(`data-sbb-inert`)&&(e.inert=!1,e.removeAttribute(`data-sbb-inert`)),e.hasAttribute(`data-sbb-aria-hidden`)&&(e.removeAttribute(`aria-hidden`),e.removeAttribute(`data-sbb-aria-hidden`)))}_addAllInertAttributes(){let e=this._currentOverlay(),t=e?[e]:[],n=[document.documentElement];for(;n.length>0;)for(let e of n.shift().querySelectorAll(`*`))e.matches(`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`)&&t.push(e),e.shadowRoot&&n.push(e.shadowRoot);let r=[],i=e=>r.push(...e.composedPath());for(let e of t)e.addEventListener(`ɵinert`,i,{once:!0}),e.dispatchEvent(new Event(`ɵinert`,{composed:!0}));let a=new Set(r),o=/* @__PURE__ */ new Set;for(let e of a)for(let t of e.parentNode?.childNodes??[])t.nodeType===Node.ELEMENT_NODE&&!Kn.includes(t.localName)&&!a.has(t)&&o.add(t);for(let e of o)this._addInertAttributes(e)}_addInertAttributes(e){this._inertElements.add(e),e.inert||(e.inert=!0,e.toggleAttribute(`data-sbb-inert`,!0)),e.hasAttribute(`aria-hidden`)||(e.setAttribute(`aria-hidden`,`true`),e.toggleAttribute(`data-sbb-aria-hidden`,!0))}};const Zn=`(forced-colors: active)`,W=`(prefers-color-scheme: dark)`,Qn=`(any-hover: hover)`,$n=`(pointer: coarse)`,er=`(min-width: 0rem)`,tr=`(min-width: 37.5rem)`,nr=`(min-width: 64rem)`,rr=`(min-width: 90rem)`,ir=`(max-width: 63.9375rem)`,ar=`(max-width: 89.9375rem)`,G=/* @__PURE__ */ new Map;var or=class{constructor(e,t){this._queries=t,e.addController(this)}matches(e){return r?null:matchMedia(e).matches}hostConnected(){if(!r)for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);if(n)n.handlers.add(t);else{let n=matchMedia(e),r=/* @__PURE__ */ new Set([t]),i=e=>r.forEach(t=>t(e.matches));n.addEventListener(`change`,i),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},sr=class e extends or{static{this._currentMode=this._readLightDarkClass()}static{this._observer=r?null:new MutationObserver(t=>{if(t[0].oldValue!==document.documentElement.getAttribute(`class`)){let t=this._readLightDarkClass();this._currentMode!==t&&(e.requestUpdate(),this._currentMode=t)}})}static{this._observerConfig={attributeFilter:[`class`],attributeOldValue:!0}}constructor(e,t){let n=()=>{t(this.matches()),this._host.toggleState?.(`dark`,this.matches())};super(e,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const cr=!r&&CSS.supports(`anchor-name`,`--test`),lr=[`top`,`bottom`,`left`,`right`,`top span-left`,`top span-right`,`bottom span-left`,`bottom span-right`,`left span-top`,`left span-bottom`,`right span-top`,`right span-bottom`],ur=[`block-start`,`block-end`,`inline-start`,`inline-end`,`block-start span-inline-start`,`block-start span-inline-end`,`block-end span-inline-start`,`block-end span-inline-end`,`inline-start span-block-start`,`inline-start span-block-end`,`inline-end span-block-start`,`inline-end span-block-end`],dr={"block-start":`block-start`,"block-end":`block-end`,"inline-start":`inline-end`,"inline-end":`inline-start`,"block-start span-inline-start":`block-start span-inline-end`,"block-start span-inline-end":`block-start span-inline-start`,"block-end span-inline-start":`block-end span-inline-end`,"block-end span-inline-end":`block-end span-inline-start`,"inline-start span-block-start":`inline-end span-block-start`,"inline-start span-block-end":`inline-end span-block-end`,"inline-end span-block-start":`inline-start span-block-start`,"inline-end span-block-end":`inline-start span-block-end`};[...lr,...ur];let fr=0;var pr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!cr){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++fr}`,this._positions=[],e.addController(this),this._overlay=e}hostConnected(){this._usePolyfill?this._overlay.style.setProperty(`position-area`,`initial`):this._overlay.style.setProperty(`position-anchor`,this._anchorName)}hostUpdate(){r||this._readPositionsFromCss()}connect(e){r||(this._anchor&&this.disconnect(),this._anchor=e,this._usePolyfill||this._anchor.style.setProperty(`anchor-name`,this._anchorName),this._readPositionsFromCss(),this._calculatePosition(),this._abortController?.abort(),this._abortController=new AbortController,document.addEventListener(`scroll`,()=>this._requestCalculatePosition(),{capture:!0,passive:!0,signal:this._abortController.signal}),window.addEventListener(`resize`,()=>this._requestCalculatePosition(),{passive:!0,signal:this._abortController.signal}),this._resizeObserver.observe(e,{box:`border-box`}),this._resizeObserver.observe(this._overlay,{box:`border-box`}))}disconnect(){this._anchor?.style.removeProperty(`anchor-name`),this._anchor=void 0,this._abortController?.abort(),this._resizeObserver.disconnect()}_requestCalculatePosition(){this._frame??=requestAnimationFrame(()=>{this._calculatePosition(),this._frame=void 0})}_calculatePosition(){if(this._anchor){if(this._usePolyfill){let e=this._getOptimalPosition(this._positions);this._applyOverlayPosition(e.position,e.left,e.top)}this._overlay.setAttribute(`data-position`,this.currentPosition)}}_getOptimalPosition(e){let{offsetHeight:t,offsetWidth:n}=this._overlay,{innerHeight:r,innerWidth:i}=window,{top:a,left:o,height:s,width:c}=this._anchor.getBoundingClientRect(),l=this._overlay.matches(`:dir(rtl)`),u=a,d=r-s-a,f=o,p=i-c-o,m=n-c,h=t-s,g=m/2,_=h/2;this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-height`,`${s}px`),this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-width`,`${c}px`);let v={left:0,top:0,position:``},y;for(let r of e){switch(l&&ur.includes(r)?dr[r]:r){default:case`bottom`:case`block-end`:v={position:r,left:o-g,top:a+s,fits:t<=d&&g<=f&&g<=p};break;case`top`:case`block-start`:v={position:r,left:o-g,top:a-t,fits:t<=u&&g<=f&&g<=p};break;case`right`:case`inline-end`:v={position:r,left:o+c,top:a-_,fits:n<=p&&_<=u&&_<=d};break;case`left`:case`inline-start`:v={position:r,left:o-n,top:a-_,fits:n<=f&&_<=u&&_<=d};break;case`top span-left`:case`block-start span-inline-start`:v={position:r,left:o-m,top:a-t,fits:t<=u&&m<=f};break;case`top span-right`:case`block-start span-inline-end`:v={position:r,left:o,top:a-t,fits:t<=u&&m<=p};break;case`bottom span-left`:case`block-end span-inline-start`:v={position:r,left:o-m,top:a+s,fits:t<=d&&m<=f};break;case`bottom span-right`:case`block-end span-inline-end`:v={position:r,left:o,top:a+s,fits:t<=d&&m<=p};break;case`left span-top`:case`inline-start span-block-start`:v={position:r,left:o-n,top:a+s-t,fits:n<=f&&h<=u};break;case`left span-bottom`:case`inline-start span-block-end`:v={position:r,left:o-n,top:a,fits:n<=f&&h<=d};break;case`right span-top`:case`inline-end span-block-start`:v={position:r,left:o+c,top:a+s-t,fits:n<=p&&h<=u};break;case`right span-bottom`:case`inline-end span-block-end`:v={position:r,left:o+c,top:a,fits:n<=p&&h<=d}}if(v.fits)return v;y??=v}return y}_applyOverlayPosition(e,t,n){this._lastPosition=e,this._overlay.style.left=`${t}px`,this._overlay.style.top=`${n}px`}_readPositionsFromCss(){if(!this._usePolyfill)return;this._overlayStyles??=getComputedStyle(this._overlay);let e=[this._overlayStyles.getPropertyValue(`--sbb-overlay-position-area`)||`block-end`,...this._overlayStyles.getPropertyValue(`--sbb-overlay-position-try-fallbacks`).split(`,`).map(e=>e.trim()).filter(e=>!!e)];this._positions=e,this._lastPosition&&!this._positions.includes(this._lastPosition)&&(this._lastPosition=void 0)}};const mr=/* @__PURE__ */ new Set;var hr=class{constructor(e,t=mr){this._host=e,this._lockers=t,this._locked=!1,this._scrollProperties={scrollPosition:0,touchStartY:0},this._touchStart=e=>{this._scrollProperties.touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=this._findScrollableAncestor(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._scrollProperties.touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()},this._host.addController?.(this)}_isVerticallyScrollable(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}_findScrollableAncestor(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&this._isVerticallyScrollable(t))return t}return null}hostDisconnected(){this.enableScroll()}disableScroll(){if(this._locked)return;this._locked=!0;let e=this._lockers.size===0;if(this._lockers.add(this._host),!e)return;this._scrollProperties.scrollPosition=window.scrollY||document.documentElement.scrollTop,this._scrollProperties.savedPosition=document.body.style.position,this._scrollProperties.savedTop=document.body.style.top,this._scrollProperties.savedInsetInline=document.body.style.insetInline,this._scrollProperties.savedOverflow=document.body.style.overflow;let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollProperties.scrollPosition}px`,document.body.style.insetInline=`0 ${t}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${t}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){this._locked&&(this._locked=!1,this._lockers.delete(this._host),!(this._lockers.size>0)&&(document.body.style.position=this._scrollProperties.savedPosition||``,document.body.style.top=this._scrollProperties.savedTop||``,document.body.style.insetInline=this._scrollProperties.savedInsetInline||``,document.body.style.overflow=this._scrollProperties.savedOverflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollProperties.scrollPosition)))}};const gr=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,_r=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,vr=1,yr=2,br=3,xr=4,Sr=5,Cr=6,wr=0;var K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(_r);try{t=n?this.createDate(+n[1],+n[2],+n[3]):null}catch{}if(this.isValid(t))return t;let r=e.replace(/\D/g,` `).trim()?.match(gr);try{t=r?this.createDate(+r[3],+r[2],+r[1]):null}catch{}if(!r||r.index!==0||r.length<=2||r.some(e=>e===void 0)||!this.isValid(t))return null;let i=+r[3];if(typeof i==`number`&&i<100&&i>=0){let e=this.getYear(this.today())-2e3+this._cutoffYearOffset;i=i<=e?2e3+i:1900+i}return this.createDate(i,+r[2],+r[1])}format(e,t){if(!this.isValid(e))return``;let n=/* @__PURE__ */ new Date(this.toIso8601(e)+`T00:00:00`),r=new Intl.DateTimeFormat(`de-CH`,{day:`2-digit`,month:`2-digit`,year:`numeric`});if(t?.weekdayStyle===`none`)return r.format(n);let i=t?.weekdayStyle??`short`,a=this.getDayOfWeekNames(i)[this.getDayOfWeek(e)];return a=a.charAt(0).toUpperCase()+a.substring(1),i===`short`&&(a=a.substring(0,2)),`${a}, ${r.format(n)}`}toIso8601(e){let t=(e,t=2)=>`${e}`.padStart(t,`0`);return`${t(this.getYear(e),4)}-${t(this.getMonth(e))}-${t(this.getDate(e))}`}getValidDateOrNull(e){return this.isDateInstance(e)&&this.isValid(e)?e:null}getFirstWeekOffset(e){let t=this.createDate(this.getYear(e),this.getMonth(e),1);return(7+this.getDayOfWeek(t)-this.getFirstDayOfWeek())%7}compareDate(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)}sameDate(e,t){if(e&&t){let n=this.isValid(e),r=this.isValid(t);return n&&r?!this.compareDate(e,t):n==r}return e==t}clampDate(e,t,n){return t&&this.compareDate(e,t)<0?t:n&&this.compareDate(e,n)>0?n:e}};const Tr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Er=class extends K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date((/* @__PURE__ */ new Date()).setHours(0,0,0,0))}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);let r=this._createDateWithOverflow(e,t-1,n);if(r.getMonth()+1!==t)throw Error(`Invalid day "${n}" for month "${t}".`);return r}isDateInstance(e){return e instanceof Date}isValid(e){return!!e&&!isNaN(e.valueOf())}clone(e){return new Date(e.valueOf())}addCalendarYears(e,t){return this.addCalendarMonths(e,t*12)}addCalendarMonths(e,t){let n=e.getMonth()+t,r=new Date(e.getFullYear(),n,1,0,0,0,0),i=this.getNumDaysInMonth(r);return new Date(this.clone(e).setMonth(n,Math.min(i,e.getDate())))}addCalendarDays(e,t){let n=e.getDate()+t;return new Date(e.getFullYear(),e.getMonth(),n,0,0,0,0)}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Tr.test(e))return this.getValidDateOrNull(new Date(e.includes(`T`)?e:e+`T00:00:00`))}return super.deserialize(e)}invalid(){return/* @__PURE__ */ new Date(NaN)}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}_createDateWithOverflow(e,t,n){let r=new Date(e,t,n);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}};const q=new Er,Dr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Or=class extends K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Dr.test(e))return this.getValidDateOrNull(Temporal.PlainDate.from(e.split(`T`)[0]))}return super.deserialize(e)}invalid(){return null}toIso8601(e){return e.toJSON()}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}};const kr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{get(){let n=t.get.call(this);return e(this,n)}};throw Error(`Unsupported decorator location: ${r}`)},Ar=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(r){let i=n.access.get(this);t.set.call(this,r);let a=n.access.get(this);a!==i&&e(this,a,i)}};throw Error(`Unsupported decorator location: ${r}`)},J=/* @__PURE__ */ new WeakMap,Y=/* @__PURE__ */ new WeakMap,jr=()=>(e,t)=>{let{kind:n,metadata:i,name:a}=t;if(n===`accessor`){if(r)return{};let n=globalThis.litPropertyMetadata.get(i)?.get(a)?.attribute,o=typeof n==`string`?n:a;return t.addInitializer(function(){this.addController({host:this,rootNode:null,checkIdReference(e){let n=this.host.getAttribute(o)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)e.oldValue&&n.add(e.oldValue),e.target.id&&n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(t.id&&n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>{e.id&&n.add(e.id)}));e.forEach(e=>e.checkIdReference(n))});t.observe(this.rootNode,{attributeFilter:[`id`],attributeOldValue:!0,childList:!0,subtree:!0}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);if(!e){this.rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode)),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Mr={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;return n.isValid(e)?n.toIso8601(e):null}},Nr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Pr(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function Fr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Ir(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function Lr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Rr(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&Lr(t))return t}return null}var zr=class{constructor(){this._scrollPosition=0,this._touchStartY=0,this._touchStart=e=>{this._touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=Rr(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()}}disableScroll(){if(Z())return;this._scrollPosition=window.scrollY||document.documentElement.scrollTop,this._position=document.body.style.position,this._top=document.body.style.top,this._insetInline=document.body.style.insetInline,this._overflow=document.body.style.overflow;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollPosition}px`,document.body.style.insetInline=`0 ${e}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${e}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.position=this._position||``,document.body.style.top=this._top||``,document.body.style.insetInline=this._insetInline||``,document.body.style.overflow=this._overflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollPosition))}};function Br(e){e.key===` `&&e.preventDefault()}function Vr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Hr=e=>{class t extends e{constructor(){super(...arguments),this.isAnimating=!1,this._animationPromise=Promise.resolve()}get animationComplete(){return this._animationPromise}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){this.isAnimating||(this._animationPromise=this._enqueueAnimation())}stopAnimation(){}async _enqueueAnimation(){this.isAnimating=!0;let e=this.stopAnimation,t=new Promise(t=>{this.stopAnimation=()=>{e(),this.isAnimating=!1,t()}});try{await this._animationPromise}catch(e){Promise.reject(e)}return t}}return t},Ur=e=>(()=>{let n=V(H(L(e))),r=[],i;return class extends n{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;i=[l({type:Boolean,converter:{...t,fromAttribute:(e,n)=>({value:t.fromAttribute?.(e,n),attribute:!0})}})],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,r),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`checkbox`}set checked(e){let t=typeof e==`object`&&e.attribute;t&&(e=e.value),this.hasUpdated&&!t&&(this._attributeMutationBlocked=!0),this._checked=!!e,this.updateFormValue()}get checked(){return this._checked}get type(){return`checkbox`}constructor(){super(),this._attributeMutationBlocked=(s(this,r),!1),this._languageController=new z(this),this._checked=!1,this._handleKeyboardInteraction=e=>{e.key===` `&&this._handleUserInteraction()},this._handleUserInteraction=()=>{this.disabled||(this.withUserInteraction?.(),this.checked=!this.checked,this._attributeMutationBlocked=!0,this.dispatchEvent(new InputEvent(`input`,{composed:!0,bubbles:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},this.addEventListener?.(`click`,this._handleUserInteraction),this.addEventListener?.(`keydown`,Br),this.addEventListener?.(`keyup`,this._handleKeyboardInteraction)}connectedCallback(){super.connectedCallback(),this.tabIndex=0}attributeChangedCallback(e,t,n){(e!==`checked`||!this._attributeMutationBlocked)&&super.attributeChangedCallback(e,t,n)}formResetCallback(){this.checked=this.hasAttribute(`checked`),this._attributeMutationBlocked=!1}formStateRestoreCallback(e,t){e&&(this.checked=e===`true`)}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}formState(){return`${this.checked}`}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){super.validate(),this.required&&!this.checked?this.setValidityFlag(`valueMissing`,fn[this._languageController.current]):this.removeValidityFlag(`valueMissing`)}}})(),Wr=e=>(()=>{let t=e,n=[],r;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l({type:Boolean,attribute:`readonly`})],o(this,null,r,{kind:`setter`,name:`readOnly`,static:!1,private:!1,access:{has:e=>`readOnly`in e,set:(e,t)=>{e.readOnly=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}set readOnly(e){this.#e=!!e,this.toggleAttribute(`readonly`,this.#e)}get readOnly(){return this.#e}#e=(s(this,n),!1)}})(),Gr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Kr=e=>(()=>{let t=Wr(V(H(L(e)))),i=[],a,u,d;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;a=[l()],u=[l({attribute:!1})],d=[c({passive:!0})],o(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:e},null,i),o(this,null,u,{kind:`setter`,name:`placeholder`,static:!1,private:!1,access:{has:e=>`placeholder`in e,set:(e,t)=>{e.placeholder=t}},metadata:e},null,i),o(this,null,d,{kind:`method`,name:`_cleanChildren`,static:!1,private:!1,access:{has:e=>`_cleanChildren`in e,get:e=>e._cleanChildren},metadata:e},null,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`textbox`}static{this.formFieldAssociated=!0}get type(){return`text`}set value(e){this._value=this._cleanText(e),this.hasUpdated&&this._assignValue(this._value),this.dispatchEvent(new Event(`displayvaluechange`,{bubbles:!0,composed:!0}))}get value(){return this._value??``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this.internals.ariaPlaceholder=e||null}get placeholder(){return this.getAttribute(`placeholder`)??``}constructor(){super(),this._shouldEmitChange=(s(this,i),!1),this._shouldTriggerSubmit=!1,this.language=new z(this),this._value=``,this.addEventListener?.(`input`,()=>{let e=this._value;this._value=this._cleanText(this.textContent??``),this.requestUpdate(`value`,e),this.internals.states.add(`interacted`),this._shouldEmitChange=!0},{capture:!0}),this.addEventListener?.(`change`,()=>this._shouldEmitChange=!1,{capture:!0}),this.addEventListener?.(`keydown`,e=>{if(this._requiresEmptyPatch()&&this._assignValue(``),(e.key===`Enter`||e.key===`
43
+ `}}})();var Bn=class{get size(){return this._handlers.size}constructor(e,t){this._host=e,this._property=t,this._handlers=/* @__PURE__ */ new Set,this._hostDefinedPromise=null,r||(customElements.get(this._host.localName)?customElements.upgrade(this._host):this._hostDefinedPromise=customElements.whenDefined(this._host.localName).then(()=>{customElements.upgrade(this._host),this._hostDefinedPromise=null})),this._value=this._host[this._property]}addHandler(e){this._handlers.size||(this._host.addController?this._host.addController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.addController(this))),this._handlers.add(e),this._hostDefinedPromise?this._hostDefinedPromise.then(()=>e(this._host)):e(this._host)}removeHandler(e){this._handlers.delete(e),this._handlers.size||(this._host.removeController?this._host.removeController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.removeController(this)))}hostUpdate(){let e=this._host[this._property];if(this._value!==e){this._value=e;for(let e of this._handlers)e(this._host)}}};const U=/* @__PURE__ */ new WeakMap;var Vn=class{constructor(e,t,n){this._host=e,this._referenceResolver=t,this._handlers=n,this._host.addController(this)}hostConnected(){this.connect()}hostDisconnected(){this._reference!==this._referenceResolver()&&this.disconnect()}connect(){let e=this._referenceResolver();if(this._reference===e||(this.disconnect(),this._reference=e,!this._reference))return;let t=U.get(this._reference);t||(t=/* @__PURE__ */ new Map,U.set(this._reference,t)),this._watchers=t;for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers.get(e);n||(n=new Bn(this._reference,e),this._watchers.set(e,n)),n.addHandler(t)}}disconnect(){if(this._reference){for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers?.get(e);n&&(n.removeHandler(t),n.size||(this._watchers.delete(e),!this._watchers.size&&this._reference&&U.delete(this._reference)))}this._reference=null}}};const Hn=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Hn.at(-1)?.escapeStrategy())});var Un=class{constructor(e,t=Hn){this._host=e,this._overlayStack=t,this._host.addController?.(this)}hostDisconnected(){this.disconnect()}connect(){this.disconnect(),this._overlayStack.push(this._host)}disconnect(){if(this._overlayStack.length){let e=this._overlayStack.findIndex(e=>e===this._host);e!==-1&&this._overlayStack.splice(e,1)}}};const Wn=/* @__PURE__ */ new WeakMap;var Gn=class{constructor(e,t,n=Wn){this._host=e,this._idRef=t,this._observers=n,this._rootNode=null,this._host.addController(this)}hostConnected(){if(r)return;this._rootNode=this._host.getRootNode();let e=this._observers.get(this._rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)n.add(e.oldValue),n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>n.add(e.id)));for(let t of e){let e=t._host[t._idRef];e&&typeof e==`string`&&n.has(e)&&t._host.requestUpdate()}});t.observe(this._rootNode,{attributeFilter:[`id`],childList:!0,subtree:!0,attributeOldValue:!0}),this._observers.set(this._rootNode,{observer:t,controllers:e})}}hostDisconnected(){if(r||!this._rootNode)return;let e=this._observers.get(this._rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),this._observers.delete(this._rootNode))),this._rootNode=null}find(){if(r||!this._rootNode)return null;{let e=this._host[this._idRef];return typeof e==`string`?this._rootNode?.getElementById(e):null}}};const Kn=[`script`,`head`,`template`,`style`,`link`],qn=/* @__PURE__ */ new Set,Jn=/* @__PURE__ */ new Set,Yn=/* @__PURE__ */ new Set;var Xn=class{constructor(e,t=qn,n=Yn,r=Jn){this._host=e,this._inertElements=t,this._inertOverlays=n,this._exemptedElements=r,this._host.addController?.(this)}hostConnected(){this._host.isOpen&&this.activate()}hostDisconnected(){this.isInert()&&this.deactivate()}activate(){this._inertOverlays.size&&this._removeAllInertAttributes(),this._inertOverlays.add(this._host),this._addAllInertAttributes()}deactivate(){this._currentOverlay()===this._host?(this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()):this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host)}isInert(){return this._inertOverlays.has(this._host)}exempt(e){this._inertElements.has(e)&&!this._exemptedElements.has(e)&&(this._removeInertAttributes(e),this._inertElements.delete(e),this._exemptedElements.add(e))}restoreAllExempted(){this._exemptedElements.forEach(e=>this._addInertAttributes(e)),this._exemptedElements.clear()}_currentOverlay(){return[...this._inertOverlays].pop()??null}_removeAllInertAttributes(){this._inertElements.forEach(e=>this._removeInertAttributes(e)),this._inertElements.clear()}_removeInertAttributes(e){e&&(e.hasAttribute(`data-sbb-inert`)&&(e.inert=!1,e.removeAttribute(`data-sbb-inert`)),e.hasAttribute(`data-sbb-aria-hidden`)&&(e.removeAttribute(`aria-hidden`),e.removeAttribute(`data-sbb-aria-hidden`)))}_addAllInertAttributes(){let e=this._currentOverlay(),t=e?[e]:[],n=[document.documentElement];for(;n.length>0;)for(let e of n.shift().querySelectorAll(`*`))e.matches(`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`)&&t.push(e),e.shadowRoot&&n.push(e.shadowRoot);let r=[],i=e=>r.push(...e.composedPath());for(let e of t)e.addEventListener(`ɵinert`,i,{once:!0}),e.dispatchEvent(new Event(`ɵinert`,{composed:!0}));let a=new Set(r),o=/* @__PURE__ */ new Set;for(let e of a)for(let t of e.parentNode?.childNodes??[])t.nodeType===Node.ELEMENT_NODE&&!Kn.includes(t.localName)&&!a.has(t)&&o.add(t);for(let e of o)this._addInertAttributes(e)}_addInertAttributes(e){this._inertElements.add(e),e.inert||(e.inert=!0,e.toggleAttribute(`data-sbb-inert`,!0)),e.hasAttribute(`aria-hidden`)||(e.setAttribute(`aria-hidden`,`true`),e.toggleAttribute(`data-sbb-aria-hidden`,!0))}};const Zn=`(forced-colors: active)`,W=`(prefers-color-scheme: dark)`,Qn=`(any-hover: hover)`,$n=`(pointer: coarse)`,er=`(min-width: 0rem)`,tr=`(min-width: 37.5rem)`,nr=`(min-width: 64rem)`,rr=`(min-width: 90rem)`,ir=`(max-width: 63.9375rem)`,ar=`(max-width: 89.9375rem)`,G=/* @__PURE__ */ new Map;var or=class{constructor(e,t){this._queries=t,e.addController(this)}matches(e){return r?null:matchMedia(e).matches}hostConnected(){if(!r)for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);if(n)n.handlers.add(t);else{let n=matchMedia(e),r=/* @__PURE__ */ new Set([t]),i=e=>r.forEach(t=>t(e.matches));n.addEventListener(`change`,i),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},sr=class e extends or{static{this._currentMode=this._readLightDarkClass()}static{this._observer=r?null:new MutationObserver(t=>{if(t[0].oldValue!==document.documentElement.getAttribute(`class`)){let t=this._readLightDarkClass();this._currentMode!==t&&(e.requestUpdate(),this._currentMode=t)}})}static{this._observerConfig={attributeFilter:[`class`],attributeOldValue:!0}}constructor(e,t){let n=()=>{t(this.matches()),this._host.toggleState?.(`dark`,this.matches())};super(e,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const cr=!r&&CSS.supports(`anchor-name`,`--test`),lr=[`top`,`bottom`,`left`,`right`,`top span-left`,`top span-right`,`bottom span-left`,`bottom span-right`,`left span-top`,`left span-bottom`,`right span-top`,`right span-bottom`],ur=[`block-start`,`block-end`,`inline-start`,`inline-end`,`block-start span-inline-start`,`block-start span-inline-end`,`block-end span-inline-start`,`block-end span-inline-end`,`inline-start span-block-start`,`inline-start span-block-end`,`inline-end span-block-start`,`inline-end span-block-end`],dr={"block-start":`block-start`,"block-end":`block-end`,"inline-start":`inline-end`,"inline-end":`inline-start`,"block-start span-inline-start":`block-start span-inline-end`,"block-start span-inline-end":`block-start span-inline-start`,"block-end span-inline-start":`block-end span-inline-end`,"block-end span-inline-end":`block-end span-inline-start`,"inline-start span-block-start":`inline-end span-block-start`,"inline-start span-block-end":`inline-end span-block-end`,"inline-end span-block-start":`inline-start span-block-start`,"inline-end span-block-end":`inline-start span-block-end`};[...lr,...ur];let fr=0;var pr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!cr){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++fr}`,this._positions=[],e.addController(this),this._overlay=e}hostConnected(){this._usePolyfill?this._overlay.style.setProperty(`position-area`,`initial`):this._overlay.style.setProperty(`position-anchor`,this._anchorName)}hostUpdate(){r||this._readPositionsFromCss()}connect(e){r||(this._anchor&&this.disconnect(),this._anchor=e,this._usePolyfill||this._anchor.style.setProperty(`anchor-name`,this._anchorName),this._readPositionsFromCss(),this._calculatePosition(),this._abortController?.abort(),this._abortController=new AbortController,document.addEventListener(`scroll`,()=>this._requestCalculatePosition(),{capture:!0,passive:!0,signal:this._abortController.signal}),window.addEventListener(`resize`,()=>this._requestCalculatePosition(),{passive:!0,signal:this._abortController.signal}),this._resizeObserver.observe(e,{box:`border-box`}),this._resizeObserver.observe(this._overlay,{box:`border-box`}))}disconnect(){this._anchor?.style.removeProperty(`anchor-name`),this._anchor=void 0,this._abortController?.abort(),this._resizeObserver.disconnect()}_requestCalculatePosition(){this._frame??=requestAnimationFrame(()=>{this._calculatePosition(),this._frame=void 0})}_calculatePosition(){if(this._anchor){if(this._usePolyfill){let e=this._getOptimalPosition(this._positions);this._applyOverlayPosition(e.position,e.left,e.top)}this._overlay.setAttribute(`data-position`,this.currentPosition)}}_getOptimalPosition(e){let{offsetHeight:t,offsetWidth:n}=this._overlay,{innerHeight:r,innerWidth:i}=window,{top:a,left:o,height:s,width:c}=this._anchor.getBoundingClientRect(),l=this._overlay.matches(`:dir(rtl)`),u=a,d=r-s-a,f=o,p=i-c-o,m=n-c,h=t-s,g=m/2,_=h/2;this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-height`,`${s}px`),this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-width`,`${c}px`);let v={left:0,top:0,position:``},y;for(let r of e){switch(l&&ur.includes(r)?dr[r]:r){default:case`bottom`:case`block-end`:v={position:r,left:o-g,top:a+s,fits:t<=d&&g<=f&&g<=p};break;case`top`:case`block-start`:v={position:r,left:o-g,top:a-t,fits:t<=u&&g<=f&&g<=p};break;case`right`:case`inline-end`:v={position:r,left:o+c,top:a-_,fits:n<=p&&_<=u&&_<=d};break;case`left`:case`inline-start`:v={position:r,left:o-n,top:a-_,fits:n<=f&&_<=u&&_<=d};break;case`top span-left`:case`block-start span-inline-start`:v={position:r,left:o-m,top:a-t,fits:t<=u&&m<=f};break;case`top span-right`:case`block-start span-inline-end`:v={position:r,left:o,top:a-t,fits:t<=u&&m<=p};break;case`bottom span-left`:case`block-end span-inline-start`:v={position:r,left:o-m,top:a+s,fits:t<=d&&m<=f};break;case`bottom span-right`:case`block-end span-inline-end`:v={position:r,left:o,top:a+s,fits:t<=d&&m<=p};break;case`left span-top`:case`inline-start span-block-start`:v={position:r,left:o-n,top:a+s-t,fits:n<=f&&h<=u};break;case`left span-bottom`:case`inline-start span-block-end`:v={position:r,left:o-n,top:a,fits:n<=f&&h<=d};break;case`right span-top`:case`inline-end span-block-start`:v={position:r,left:o+c,top:a+s-t,fits:n<=p&&h<=u};break;case`right span-bottom`:case`inline-end span-block-end`:v={position:r,left:o+c,top:a,fits:n<=p&&h<=d}}if(v.fits)return v;y??=v}return y}_applyOverlayPosition(e,t,n){this._lastPosition=e,this._overlay.style.left=`${t}px`,this._overlay.style.top=`${n}px`}_readPositionsFromCss(){if(!this._usePolyfill)return;this._overlayStyles??=getComputedStyle(this._overlay);let e=[this._overlayStyles.getPropertyValue(`--sbb-overlay-position-area`)||`block-end`,...this._overlayStyles.getPropertyValue(`--sbb-overlay-position-try-fallbacks`).split(`,`).map(e=>e.trim()).filter(e=>!!e)];this._positions=e,this._lastPosition&&!this._positions.includes(this._lastPosition)&&(this._lastPosition=void 0)}};const mr=/* @__PURE__ */ new Set;var hr=class{constructor(e,t=mr){this._host=e,this._lockers=t,this._locked=!1,this._scrollProperties={scrollPosition:0,touchStartY:0},this._touchStart=e=>{this._scrollProperties.touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=this._findScrollableAncestor(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._scrollProperties.touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()},this._host.addController?.(this)}_isVerticallyScrollable(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}_findScrollableAncestor(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&this._isVerticallyScrollable(t))return t}return null}hostDisconnected(){this.enableScroll()}disableScroll(){if(this._locked)return;this._locked=!0;let e=this._lockers.size===0;if(this._lockers.add(this._host),!e)return;this._scrollProperties.scrollPosition=window.scrollY||document.documentElement.scrollTop,this._scrollProperties.savedPosition=document.body.style.position,this._scrollProperties.savedTop=document.body.style.top,this._scrollProperties.savedInsetInline=document.body.style.insetInline,this._scrollProperties.savedOverflow=document.body.style.overflow;let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollProperties.scrollPosition}px`,document.body.style.insetInline=`0 ${t}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${t}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){this._locked&&(this._locked=!1,this._lockers.delete(this._host),!(this._lockers.size>0)&&(document.body.style.position=this._scrollProperties.savedPosition||``,document.body.style.top=this._scrollProperties.savedTop||``,document.body.style.insetInline=this._scrollProperties.savedInsetInline||``,document.body.style.overflow=this._scrollProperties.savedOverflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollProperties.scrollPosition)))}};const gr=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,_r=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,vr=1,yr=2,br=3,xr=4,Sr=5,Cr=6,wr=0;var K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(_r);try{t=n?this.createDate(+n[1],+n[2],+n[3]):null}catch{}if(this.isValid(t))return t;let r=e.replace(/\D/g,` `).trim()?.match(gr);try{t=r?this.createDate(+r[3],+r[2],+r[1]):null}catch{}if(!r||r.index!==0||r.length<=2||r.some(e=>e===void 0)||!this.isValid(t))return null;let i=+r[3];if(typeof i==`number`&&i<100&&i>=0){let e=this.getYear(this.today())-2e3+this._cutoffYearOffset;i=i<=e?2e3+i:1900+i}return this.createDate(i,+r[2],+r[1])}format(e,t){if(!this.isValid(e))return``;let n=/* @__PURE__ */ new Date(this.toIso8601(e)+`T00:00:00`),r=new Intl.DateTimeFormat(`de-CH`,{day:`2-digit`,month:`2-digit`,year:`numeric`});if(t?.weekdayStyle===`none`)return r.format(n);let i=t?.weekdayStyle??`short`,a=this.getDayOfWeekNames(i)[this.getDayOfWeek(e)];return a=a.charAt(0).toUpperCase()+a.substring(1),i===`short`&&(a=a.substring(0,2)),`${a}, ${r.format(n)}`}toIso8601(e){let t=(e,t=2)=>`${e}`.padStart(t,`0`);return`${t(this.getYear(e),4)}-${t(this.getMonth(e))}-${t(this.getDate(e))}`}getValidDateOrNull(e){return this.isDateInstance(e)&&this.isValid(e)?e:null}getFirstWeekOffset(e){let t=this.createDate(this.getYear(e),this.getMonth(e),1);return(7+this.getDayOfWeek(t)-this.getFirstDayOfWeek())%7}compareDate(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)}sameDate(e,t){if(e&&t){let n=this.isValid(e),r=this.isValid(t);return n&&r?!this.compareDate(e,t):n==r}return e==t}clampDate(e,t,n){return t&&this.compareDate(e,t)<0?t:n&&this.compareDate(e,n)>0?n:e}};const Tr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Er=class extends K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date((/* @__PURE__ */ new Date()).setHours(0,0,0,0))}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);let r=this._createDateWithOverflow(e,t-1,n);if(r.getMonth()+1!==t)throw Error(`Invalid day "${n}" for month "${t}".`);return r}isDateInstance(e){return e instanceof Date}isValid(e){return!!e&&!isNaN(e.valueOf())}clone(e){return new Date(e.valueOf())}addCalendarYears(e,t){return this.addCalendarMonths(e,t*12)}addCalendarMonths(e,t){let n=e.getMonth()+t,r=new Date(e.getFullYear(),n,1,0,0,0,0),i=this.getNumDaysInMonth(r);return new Date(this.clone(e).setMonth(n,Math.min(i,e.getDate())))}addCalendarDays(e,t){let n=e.getDate()+t;return new Date(e.getFullYear(),e.getMonth(),n,0,0,0,0)}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Tr.test(e))return this.getValidDateOrNull(new Date(e.includes(`T`)?e:e+`T00:00:00`))}return super.deserialize(e)}invalid(){return/* @__PURE__ */ new Date(NaN)}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}_createDateWithOverflow(e,t,n){let r=new Date(e,t,n);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}};const q=new Er,Dr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Or=class extends K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Dr.test(e))return this.getValidDateOrNull(Temporal.PlainDate.from(e.split(`T`)[0]))}return super.deserialize(e)}invalid(){return null}toIso8601(e){return e.toJSON()}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}};const kr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{get(){let n=t.get.call(this);return e(this,n)}};throw Error(`Unsupported decorator location: ${r}`)},Ar=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(r){let i=n.access.get(this);t.set.call(this,r);let a=n.access.get(this);a!==i&&e(this,a,i)}};throw Error(`Unsupported decorator location: ${r}`)},J=/* @__PURE__ */ new WeakMap,Y=/* @__PURE__ */ new WeakMap,jr=()=>(e,t)=>{let{kind:n,metadata:i,name:a}=t;if(n===`accessor`){if(r)return{};let n=globalThis.litPropertyMetadata.get(i)?.get(a)?.attribute,o=typeof n==`string`?n:a;return t.addInitializer(function(){this.addController({host:this,rootNode:null,checkIdReference(e){let n=this.host.getAttribute(o)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)e.oldValue&&n.add(e.oldValue),e.target.id&&n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(t.id&&n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>{e.id&&n.add(e.id)}));e.forEach(e=>e.checkIdReference(n))});t.observe(this.rootNode,{attributeFilter:[`id`],attributeOldValue:!0,childList:!0,subtree:!0}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode))),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Mr={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;return n.isValid(e)?n.toIso8601(e):null}},Nr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Pr(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function Fr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Ir(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function Lr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Rr(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&Lr(t))return t}return null}var zr=class{constructor(){this._scrollPosition=0,this._touchStartY=0,this._touchStart=e=>{this._touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=Rr(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()}}disableScroll(){if(Z())return;this._scrollPosition=window.scrollY||document.documentElement.scrollTop,this._position=document.body.style.position,this._top=document.body.style.top,this._insetInline=document.body.style.insetInline,this._overflow=document.body.style.overflow;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollPosition}px`,document.body.style.insetInline=`0 ${e}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${e}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.position=this._position||``,document.body.style.top=this._top||``,document.body.style.insetInline=this._insetInline||``,document.body.style.overflow=this._overflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollPosition))}};function Br(e){e.key===` `&&e.preventDefault()}function Vr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Hr=e=>{class t extends e{constructor(){super(...arguments),this.isAnimating=!1,this._animationPromise=Promise.resolve()}get animationComplete(){return this._animationPromise}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){this.isAnimating||(this._animationPromise=this._enqueueAnimation())}stopAnimation(){}async _enqueueAnimation(){this.isAnimating=!0;let e=this.stopAnimation,t=new Promise(t=>{this.stopAnimation=()=>{e(),this.isAnimating=!1,t()}});try{await this._animationPromise}catch(e){Promise.reject(e)}return t}}return t},Ur=e=>(()=>{let n=V(H(L(e))),r=[],i;return class extends n{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;i=[l({type:Boolean,converter:{...t,fromAttribute:(e,n)=>({value:t.fromAttribute?.(e,n),attribute:!0})}})],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,r),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`checkbox`}set checked(e){let t=typeof e==`object`&&e.attribute;t&&(e=e.value),this.hasUpdated&&!t&&(this._attributeMutationBlocked=!0),this._checked=!!e,this.updateFormValue()}get checked(){return this._checked}get type(){return`checkbox`}constructor(){super(),this._attributeMutationBlocked=(s(this,r),!1),this._languageController=new z(this),this._checked=!1,this._handleKeyboardInteraction=e=>{e.key===` `&&this._handleUserInteraction()},this._handleUserInteraction=()=>{this.disabled||(this.withUserInteraction?.(),this.checked=!this.checked,this._attributeMutationBlocked=!0,this.dispatchEvent(new InputEvent(`input`,{composed:!0,bubbles:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},this.addEventListener?.(`click`,this._handleUserInteraction),this.addEventListener?.(`keydown`,Br),this.addEventListener?.(`keyup`,this._handleKeyboardInteraction)}connectedCallback(){super.connectedCallback(),this.tabIndex=0}attributeChangedCallback(e,t,n){(e!==`checked`||!this._attributeMutationBlocked)&&super.attributeChangedCallback(e,t,n)}formResetCallback(){this.checked=this.hasAttribute(`checked`),this._attributeMutationBlocked=!1}formStateRestoreCallback(e,t){e&&(this.checked=e===`true`)}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}formState(){return`${this.checked}`}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){super.validate(),this.required&&!this.checked?this.setValidityFlag(`valueMissing`,fn[this._languageController.current]):this.removeValidityFlag(`valueMissing`)}}})(),Wr=e=>(()=>{let t=e,n=[],r;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l({type:Boolean,attribute:`readonly`})],o(this,null,r,{kind:`setter`,name:`readOnly`,static:!1,private:!1,access:{has:e=>`readOnly`in e,set:(e,t)=>{e.readOnly=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}set readOnly(e){this.#e=!!e,this.toggleAttribute(`readonly`,this.#e)}get readOnly(){return this.#e}#e=(s(this,n),!1)}})(),Gr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Kr=e=>(()=>{let t=Wr(V(H(L(e)))),i=[],a,u,d;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;a=[l()],u=[l({attribute:!1})],d=[c({passive:!0})],o(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:e},null,i),o(this,null,u,{kind:`setter`,name:`placeholder`,static:!1,private:!1,access:{has:e=>`placeholder`in e,set:(e,t)=>{e.placeholder=t}},metadata:e},null,i),o(this,null,d,{kind:`method`,name:`_cleanChildren`,static:!1,private:!1,access:{has:e=>`_cleanChildren`in e,get:e=>e._cleanChildren},metadata:e},null,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`textbox`}static{this.formFieldAssociated=!0}get type(){return`text`}set value(e){this._value=this._cleanText(e),this.hasUpdated&&this._assignValue(this._value),this.dispatchEvent(new Event(`displayvaluechange`,{bubbles:!0,composed:!0}))}get value(){return this._value??``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this.internals.ariaPlaceholder=e||null}get placeholder(){return this.getAttribute(`placeholder`)??``}constructor(){super(),this._shouldEmitChange=(s(this,i),!1),this._shouldTriggerSubmit=!1,this.language=new z(this),this._value=``,this.addEventListener?.(`input`,()=>{let e=this._value;this._value=this._cleanText(this.textContent??``),this.requestUpdate(`value`,e),this.internals.states.add(`interacted`),this._shouldEmitChange=!0},{capture:!0}),this.addEventListener?.(`change`,()=>this._shouldEmitChange=!1,{capture:!0}),this.addEventListener?.(`keydown`,e=>{if(this._requiresEmptyPatch()&&this._assignValue(``),(e.key===`Enter`||e.key===`
44
44
  `)&&e.isTrusted)e.preventDefault(),e.stopImmediatePropagation(),this._shouldTriggerSubmit=this.dispatchEvent(new KeyboardEvent(`keydown`,e));else if(A&&this.value&&(e.key===`Backspace`||e.key===`Delete`)&&e.isTrusted){if(e.preventDefault(),e.stopImmediatePropagation(),!this.dispatchEvent(new KeyboardEvent(`keydown`,e)))return;let t=window.getSelection()?.getRangeAt(0);if(!t)return;t.startOffset===t.endOffset?e.key===`Backspace`&&t.startOffset>0?(t.setStart(t.startContainer,t.startOffset-1),t.deleteContents(),this._dispatchInputEvent()):e.key===`Delete`&&t.endOffset<this.value.length&&(t.setEnd(t.endContainer,t.endOffset+1),t.deleteContents(),this._dispatchInputEvent()):(t.deleteContents(),this._dispatchInputEvent())}},{capture:!0}),this.addEventListener?.(`keyup`,e=>{e.key===`Enter`||e.key===`
45
45
  `?(this._emitChangeIfNecessary(),this._shouldTriggerSubmit&&(this._shouldTriggerSubmit=!1,this.form?.requestSubmit())):this._requiresEmptyPatch()&&this._setCursorAt(0)},{capture:!0}),this.addEventListener?.(`paste`,e=>{e.preventDefault(),this._requiresEmptyPatch()&&this._assignValue(``);let t=this._cleanText(e.clipboardData?.getData(`text/plain`)??``),n=window.getSelection()?.getRangeAt(0);n&&t&&(n.deleteContents(),n.insertNode(document.createTextNode(this.preparePastedText(t))),n.setStart(n.endContainer,n.endOffset),this._dispatchInputEvent())}),this.addEventListener?.(`focus`,()=>{T.mostRecentModality===`keyboard`&&window.getSelection()?.selectAllChildren(this)}),this.addEventListener?.(`touchend`,()=>{this._requiresEmptyPatch()&&(this._assignValue(`&nbsp;`),this._setCursorAt(0))}),this.addEventListener?.(`click`,()=>{this._requiresEmptyPatch()&&T.mostRecentModality===`touch`&&this._setCursorAt(0)}),this.addEventListener?.(`blur`,()=>{window.getSelection()?.removeAllRanges(),this.value===``&&this._assignValue(``),this._emitChangeIfNecessary(),this.scrollLeft=0},{capture:!0})}isDisabledExternally(){return this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals.ariaMultiLine=`false`,this._updateContenteditable(),this._assignValue(this.value)}focus(e){if(super.focus(e),this._canSelect()){let e=window.getSelection();if(!e)return;let t=e.rangeCount>0?e.getRangeAt(0):null;if(t&&t.startOffset!==0)return;this._setCursorAt(this.textContent.length)}}attributeChangedCallback(e,t,n){(e!==`value`||!this.matches?.(`:is(:state(interacted),[state--interacted])`))&&super.attributeChangedCallback(e,t,n)}formResetCallback(){this.internals.states.delete(`interacted`),this.value=this.getAttribute(`value`)??``}formStateRestoreCallback(e,t){e&&typeof e==`string`&&(this.value=e)}select(){window.getSelection()?.selectAllChildren(this)}firstUpdated(e){super.firstUpdated(e),this.value&&!this.innerHTML.length&&this._assignValue(this.value)}requestUpdate(e,t,n){super.requestUpdate(e,t,n),this.isConnected&&(e===`disabled`||e===`formDisabled`||e===`readOnly`)&&this._updateContenteditable()}shouldValidate(e){return super.shouldValidate(e)||e===`value`||e===`required`}validate(){super.validate(),this.required&&!this.value?this.setValidityFlag(`valueMissing`,mn[this.language.current]):this.removeValidityFlag(`valueMissing`)}isSelected(){if(r)return!1;let e=window.getSelection();return!!e&&e.rangeCount>0&&this.contains(e.anchorNode)}preparePastedText(e){return e}_requiresEmptyPatch(){return!r&&k&&this.value===``&&window.matchMedia(`(pointer: coarse)`).matches}_assignValue(e){this.innerHTML=e}_setCursorAt(e){let t=window.getSelection();if(!this.firstChild||!t)return;let n=document.createRange();n.setStart(this.firstChild,e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}_cleanText(e){return e===null?``:`${e}`.replace(/[\n\r]+/g,``)}_dispatchInputEvent(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}_cleanChildren(){if(this.childElementCount)for(let e of this.children)e.remove()}_updateContenteditable(){if(!r&&this.isConnected){this.internals.ariaReadOnly=this.readOnly?`true`:null,this.internals.ariaDisabled=this.disabled?`true`:null;let e=this.disabled||this.readOnly?`false`:Gr?`plaintext-only`:`true`;this.setAttribute(`contenteditable`,e),this.readOnly?this.setAttribute(`tabindex`,`0`):this.removeAttribute(`tabindex`)}}_emitChangeIfNecessary(){this._shouldEmitChange&&(this._shouldEmitChange=!1,this.dispatchEvent(new Event(`change`,{bubbles:!0})))}_canSelect(){return!r&&!this.disabled&&!this.readOnly&&!!this.value}render(){return n`<slot @slotchange=${this._cleanChildren}></slot>`}}})(),Q=/* @__PURE__ */ new WeakMap,qr=e=>(()=>{let t=V(H(L(e))),n=[],i,a;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;i=[l({type:Boolean})],a=[l()],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,n),o(this,null,a,{kind:`setter`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,set:(e,t)=>{e.name=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`radio`}set checked(e){this._checked=!!e,this.toggleState(`checked`,this.checked),this.internals.ariaChecked=this.checked.toString(),this.updateFormValue(),this._synchronizeGroupState()}get checked(){return this._checked}set name(e){let t=this.name;e!==t&&(super.name=e,this._disconnectFromRegistry(t),this._connectToRegistry(),this._synchronizeGroupState())}get name(){return super.name}get type(){return`radio`}constructor(){super(),this._checked=(s(this,n),!1),this._languageController=new z(this),this.addEventListener?.(`keydown`,e=>this._handleArrowKeyDown(e))}connectedCallback(){super.connectedCallback(),this._connectToRegistry(),this._synchronizeGroupState()}disconnectedCallback(){super.disconnectedCallback(),this._disconnectFromRegistry(this.name)}formResetCallback(){this.checked=this.hasAttribute(`checked`)}formStateRestoreCallback(e,t){typeof e==`string`||e==null?this.checked=e===this.value:e instanceof FormData&&this._readFormData(e).then(e=>{this.checked=e===this.value})}async _readFormData(e){let t=e.get(this.name);return t instanceof Blob?JSON.parse(await t.text()):t}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.updateFocusableRadios()}firstUpdated(e){super.firstUpdated(e),this.updateFocusableRadios()}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){if(super.validate(),!this.associatedRadioButtons)return;let e=!1,t=!1;for(let n of this.associatedRadioButtons)e||=n.required,t||=n.checked;e&&!t?this.associatedRadioButtons.forEach(e=>e.setValidityFlag(`valueMissing`,pn[this._languageController.current])):this.associatedRadioButtons.forEach(e=>e.removeValidityFlag(`valueMissing`))}updateFocusableRadios(){if(!this.hasUpdated)return;let e=this._interactableGroupedRadios(),t=e.findIndex(e=>e.checked&&!e.disabled&&!e.formDisabled),n=t===-1?e.findIndex(e=>!e.disabled&&!e.formDisabled):t;n!==-1&&(e[n].tabIndex=0,e.splice(n,1)),e.forEach(e=>e.removeAttribute(`tabindex`))}async navigateByKeyboard(e){e.checked=!0,this.emitChangeEvents(),await e.updateComplete,e.focus()}emitChangeEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_synchronizeGroupState(){this.checked&&this._deselectGroupedRadios(),this.updateFocusableRadios()}_connectToRegistry(){if(!this.name||r)return;let e=this.form??this.getRootNode();this._radioButtonGroupsMap=Q.get(e),this._radioButtonGroupsMap||(this._radioButtonGroupsMap=/* @__PURE__ */ new Map,Q.set(e,this._radioButtonGroupsMap)),this.associatedRadioButtons=this._radioButtonGroupsMap.get(this.name),this.associatedRadioButtons||(this.associatedRadioButtons=/* @__PURE__ */ new Set,this._radioButtonGroupsMap.set(this.name,this.associatedRadioButtons));let t=Array.from(this.associatedRadioButtons);this.associatedRadioButtons.clear();let n=t.findIndex(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING);n===-1?t.push(this):t.splice(n,0,this),t.forEach(e=>this.associatedRadioButtons.add(e)),this.validate()}_disconnectFromRegistry(e){this.associatedRadioButtons?.delete(this),this.associatedRadioButtons?.size===0?this._radioButtonGroupsMap?.delete(e):this.validate(),this.associatedRadioButtons=void 0,this._radioButtonGroupsMap=void 0}_interactableGroupedRadios(){return Array.from(this.associatedRadioButtons??[]).filter(e=>M.isVisible(e))}_deselectGroupedRadios(){Array.from(this.associatedRadioButtons??[]).filter(e=>e!==this).forEach(e=>e.checked=!1)}async _handleArrowKeyDown(e){if(!p(e))return;e.preventDefault();let t=this._interactableGroupedRadios().filter(e=>!e.disabled&&!e.formDisabled),n=y(e,t.indexOf(this),t.length);await this.navigateByKeyboard(t[n])}}})();var Jr=`:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-width:var(--sbb-spacing-fixed-3x);--sbb-scrollbar-thumb-width:.125rem;--sbb-scrollbar-thumb-width-hover:.25rem;--sbb-scrollbar-width-firefox:thin;--sbb-scrollbar-color:light-dark(color-mix(in srgb, var(--sbb-color-black) 30%, transparent),color-mix(in srgb, var(--sbb-color-white) 30%, transparent));--sbb-scrollbar-color-hover:light-dark(color-mix(in srgb, var(--sbb-color-black) 60%, transparent),color-mix(in srgb, var(--sbb-color-white) 60%, transparent));--sbb-scrollbar-track-color:transparent}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color,transparent)}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color,transparent)}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color,currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover,currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-button,:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color,currentcolor) var(--sbb-scrollbar-track-color,transparent)}}:is(.sbb-scrollbar-negative,.sbb-scrollbar-thick-negative,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-color:color-mix(in srgb, var(--sbb-color-white) 30%, transparent);--sbb-scrollbar-color-hover:color-mix(in srgb, var(--sbb-color-white) 60%, transparent)}:is(.sbb-scrollbar-thick-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-thumb-width:.5rem;--sbb-scrollbar-thumb-width-hover:var(--sbb-scrollbar-thumb-width);--sbb-scrollbar-width-firefox:auto}:is(.sbb-scrollbar-track-visible,.sbb-scrollbar-thick-track-visible){--sbb-scrollbar-track-color:var(--sbb-background-color-4)}:is(.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-track-color:var(--sbb-background-color-4-negative)}
46
46
  `,Yr=`button{appearance:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent;color:inherit;background:0 0;border:none;border-radius:0;outline:none;margin:0;padding:0}
package/option.pure.js CHANGED
@@ -14,7 +14,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,not
14
14
  <slot></slot>
15
15
  </span>
16
16
  `}};const E=i(`:host{--sbb-options-panel-position-x:0;--sbb-options-panel-position-y:0;--sbb-options-pointer-events:all;--_sbb-options-panel-max-height:min(var(--sbb-options-panel-max-height-calculated), var(--sbb-options-panel-max-height,100000em));--sbb-options-panel-min-height:1em;--sbb-options-panel-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));--sbb-options-panel-internal-z-index:var(--sbb-select-z-index,var(--sbb-overlay-default-z-index));font-weight:400}:host([negative]){--sbb-options-panel-box-shadow:var(--sbb-box-shadow-level-9-hard-negative);--sbb-options-panel-background-color:var(--sbb-background-color-2-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}:host(:not(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))),:host(:is(:state(state-closed),[state--state-closed])){--sbb-options-panel-visibility:hidden;--sbb-options-pointer-events:none}:host(:is(:state(state-opening),[state--state-opening])){--sbb-options-panel-animation-name:open}:host(:is(:state(state-closing),[state--state-closing])){--sbb-options-panel-animation-name:close}:host(:is(:state(options-panel-position-below),[state--options-panel-position-below])){--sbb-options-panel-animation-translate:var(--sbb-spacing-fixed-2x)}:host(:is(:state(options-panel-position-above),[state--options-panel-position-above])){--sbb-options-panel-animation-translate:calc(-1 * var(--sbb-spacing-fixed-2x));--_sbb-options-panel-offset:calc(-1 * var(--sbb-options-panel-offset))}:host([preserve-icon-space]){--sbb-option-icon-container-display:block}::slotted(sbb-divider){margin-block:var(--sbb-options-panel-divider-margin-block)}.sbb-option-panel__overlay-container{pointer-events:none;z-index:var(--sbb-options-panel-internal-z-index);position:fixed;inset:0}.sbb-option-panel__overlay-container:after{content:"";top:var(--sbb-options-panel-origin-position-y);left:var(--sbb-options-panel-origin-position-x);width:var(--sbb-options-panel-width);height:var(--sbb-options-panel-origin-height);border-radius:var(--sbb-options-panel-border-radius);transition:box-shadow var(--sbb-options-panel-animation-duration) var(--sbb-options-panel-animation-timing-function);background-color:#0000;display:block;position:absolute}:host(:is(:is(:state(state-opened),[state--state-opened]),:is(:state(state-opening),[state--state-opening])):is(:state(option-panel-origin-borderless),[state--option-panel-origin-borderless])) .sbb-option-panel__overlay-container:after{box-shadow:var(--sbb-options-panel-box-shadow)}.sbb-option-panel__overlay{visibility:var(--sbb-options-panel-visibility,visible);border-radius:var(--sbb-options-panel-border-radius);top:var(--sbb-options-panel-position-y);left:var(--sbb-options-panel-position-x);width:var(--sbb-options-panel-width,fit-content);transition:box-shadow var(--sbb-options-panel-animation-duration) var(--sbb-options-panel-animation-timing-function);box-shadow:var(--sbb-options-panel-box-shadow);background-color:var(--sbb-options-panel-background-color);padding-block:var(--sbb-options-panel-padding-block);max-height:var(--_sbb-options-panel-max-height);min-height:var(--sbb-options-panel-min-height);pointer-events:var(--sbb-options-pointer-events);animation-name:var(--sbb-options-panel-animation-name);animation-duration:var(--sbb-options-panel-animation-duration);animation-timing-function:var(--sbb-options-panel-animation-timing-function);border:none;margin-block-start:var(--_sbb-options-panel-offset,var(--sbb-options-panel-offset));padding-inline:0;display:block;position:absolute;overflow:hidden auto}@media (forced-colors:active){.sbb-option-panel__overlay{border:var(--sbb-border-width-1x) solid CanvasText}}@keyframes open{0%{translate:0 var(--sbb-options-panel-animation-translate);opacity:0}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{translate:0 var(--sbb-options-panel-animation-translate);opacity:0}}
17
- `),D=m,O={childList:!0,subtree:!0,characterData:!0};let k=(()=>{let i=s(v(c)),l=[],d,m,y,b=[],x=[],S,C=[],w=[],T,E=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[];return class extends i{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;d=[a()],m=[a({type:Boolean})],y=[o()],S=[o()],T=[o()],A=[o()],N=[o()],I=[o()],e(this,null,d,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,l),e(this,null,m,{kind:`setter`,name:`selected`,static:!1,private:!1,access:{has:e=>`selected`in e,set:(e,t)=>{e.selected=t}},metadata:t},null,l),e(this,null,y,{kind:`accessor`,name:`disabledFromGroup`,static:!1,private:!1,access:{has:e=>`disabledFromGroup`in e,get:e=>e.disabledFromGroup,set:(e,t)=>{e.disabledFromGroup=t}},metadata:t},b,x),e(this,null,S,{kind:`accessor`,name:`groupLabel`,static:!1,private:!1,access:{has:e=>`groupLabel`in e,get:e=>e.groupLabel,set:(e,t)=>{e.groupLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`label`,static:!1,private:!1,access:{has:e=>`label`in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:t},E,k),e(this,null,A,{kind:`accessor`,name:`disableLabelHighlight`,static:!1,private:!1,access:{has:e=>`disableLabelHighlight`in e,get:e=>e.disableLabelHighlight,set:(e,t)=>{e.disableLabelHighlight=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`_highlightString`,static:!1,private:!1,access:{has:e=>`_highlightString`in e,get:e=>e._highlightString,set:(e,t)=>{e._highlightString=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`_inertAriaGroups`,static:!1,private:!1,access:{has:e=>`_inertAriaGroups`in e,get:e=>e._inertAriaGroups,set:(e,t)=>{e._inertAriaGroups=t}},metadata:t},L,R),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.events={optionselected:`optionselected`}}static{this.styles=[h]}set value(e){typeof e==`string`?(this.setAttribute(`value`,`${e}`),this._value=null):this._value=e,this.dispatchEvent(new Event(`ɵoptionvaluechange`,{bubbles:!0}))}get value(){return this._value??this.getAttribute(`value`)}set selected(e){this.toggleAttribute(`selected`,e),this._updateAriaSelected()}get selected(){return this.hasAttribute(`selected`)}#e;get disabledFromGroup(){return this.#e}set disabledFromGroup(e){this.#e=e}#t;get groupLabel(){return this.#t}set groupLabel(e){this.#t=e}#n;get label(){return this.#n}set label(e){this.#n=e}#r;get disableLabelHighlight(){return this.#r}set disableLabelHighlight(e){this.#r=e}#i;get _highlightString(){return this.#i}set _highlightString(e){this.#i=e}#a;get _inertAriaGroups(){return this.#a}set _inertAriaGroups(e){this.#a=e}constructor(){super(),this._value=(t(this,l),null),this.#e=t(this,b,!1),this.#t=(t(this,x),t(this,C,``)),this.#n=(t(this,w),t(this,E,void 0)),this.#r=(t(this,k),t(this,j,!1)),this.#i=(t(this,M),t(this,P,null)),this.#a=(t(this,F),t(this,L,!1)),this._previousSize=(t(this,R),null),this.addEventListener?.(`click`,e=>this.selectByClick(e),{passive:!0}),this.addController(new _(this,{config:O,callback:()=>{this.handleHighlightState(),this.dispatchEvent(new Event(`optionLabelChanged`,{bubbles:!0}))}})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid, sbb-select`),{size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}})),D&&(this.hydrationRequired?this.hydrationComplete.then(()=>this._inertAriaGroups=D):this._inertAriaGroups=D)}attributeChangedCallback(e,t,n){(e!==`value`||t!==n)&&super.attributeChangedCallback(e,t,n)}highlight(e){this._highlightString=e}selectViaUserInteraction(e){this.selected=e,this.selected&&this.dispatchEvent(new Event(`optionselected`,{bubbles:!0,composed:!0}))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),(e===`disabled`||e===`disabledFromGroup`)&&(this.toggleState(`disabled`,this.disabled||this.disabledFromGroup),g(this,`tabindex`,f&&!this.disabled&&!this.disabledFromGroup?0:null),this.updateAriaDisabled())}firstUpdated(e){super.firstUpdated(e),this._updateAriaSelected()}updateDisableHighlight(e){this.disableLabelHighlight=e,this.toggleState(`disable-highlight`,e)}setActive(e){this.toggleState(`active`,e)}updateAriaDisabled(){this.internals.ariaDisabled=this.disabled||this.disabledFromGroup?`true`:null,this.dispatchEvent(new Event(`ɵdisabledchange`,{bubbles:!0}))}_updateAriaSelected(){this.internals.ariaSelected=`${this.selected}`}handleHighlightState(){let e=Array.from(this.childNodes??[]).filter(e=>e.nodeType!==Node.COMMENT_NODE&&(!(e instanceof Element)||e.slot!==`icon`)),t=e.filter(e=>e.nodeType===Node.TEXT_NODE);if(t.length===0||e.filter(e=>!(e instanceof Element)||e.localName!==`template`).length!==t.length){this.updateDisableHighlight(!0);return}this.label=t.map(e=>e.wholeText).filter(e=>e.trim()).join(``)}getHighlightedLabel(){if(!this._highlightString||!this._highlightString.trim())return n`${this.label}`;let e=this.label.toLowerCase().indexOf(this._highlightString.toLowerCase());if(e===-1)return n`${this.label}`;let t=this.label.substring(0,e),r=this.label.substring(e,e+this._highlightString.length),i=this.label.substring(e+this._highlightString.length);return n`
17
+ `),D=m,O={childList:!0,subtree:!0,characterData:!0};let k=(()=>{let i=s(v(c)),l=[],d,m,y,b=[],x=[],S,C=[],w=[],T,E=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[];return class extends i{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;d=[a()],m=[a({type:Boolean})],y=[o()],S=[o()],T=[o()],A=[o()],N=[o()],I=[o()],e(this,null,d,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,l),e(this,null,m,{kind:`setter`,name:`selected`,static:!1,private:!1,access:{has:e=>`selected`in e,set:(e,t)=>{e.selected=t}},metadata:t},null,l),e(this,null,y,{kind:`accessor`,name:`disabledFromGroup`,static:!1,private:!1,access:{has:e=>`disabledFromGroup`in e,get:e=>e.disabledFromGroup,set:(e,t)=>{e.disabledFromGroup=t}},metadata:t},b,x),e(this,null,S,{kind:`accessor`,name:`groupLabel`,static:!1,private:!1,access:{has:e=>`groupLabel`in e,get:e=>e.groupLabel,set:(e,t)=>{e.groupLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`label`,static:!1,private:!1,access:{has:e=>`label`in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:t},E,k),e(this,null,A,{kind:`accessor`,name:`disableLabelHighlight`,static:!1,private:!1,access:{has:e=>`disableLabelHighlight`in e,get:e=>e.disableLabelHighlight,set:(e,t)=>{e.disableLabelHighlight=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`_highlightString`,static:!1,private:!1,access:{has:e=>`_highlightString`in e,get:e=>e._highlightString,set:(e,t)=>{e._highlightString=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`_inertAriaGroups`,static:!1,private:!1,access:{has:e=>`_inertAriaGroups`in e,get:e=>e._inertAriaGroups,set:(e,t)=>{e._inertAriaGroups=t}},metadata:t},L,R),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.events={optionselected:`optionselected`}}static{this.styles=[h]}set value(e){typeof e==`string`?(this.setAttribute(`value`,`${e}`),this._value=null):this._value=e,this.dispatchEvent(new Event(`ɵoptionvaluechange`,{bubbles:!0}))}get value(){return this._value??this.getAttribute(`value`)}set selected(e){this.toggleAttribute(`selected`,e),this._updateAriaSelected()}get selected(){return this.hasAttribute(`selected`)}#e;get disabledFromGroup(){return this.#e}set disabledFromGroup(e){this.#e=e}#t;get groupLabel(){return this.#t}set groupLabel(e){this.#t=e}#n;get label(){return this.#n}set label(e){this.#n=e}#r;get disableLabelHighlight(){return this.#r}set disableLabelHighlight(e){this.#r=e}#i;get _highlightString(){return this.#i}set _highlightString(e){this.#i=e}#a;get _inertAriaGroups(){return this.#a}set _inertAriaGroups(e){this.#a=e}constructor(){super(),this._value=(t(this,l),null),this.#e=t(this,b,!1),this.#t=(t(this,x),t(this,C,``)),this.#n=(t(this,w),t(this,E,void 0)),this.#r=(t(this,k),t(this,j,!1)),this.#i=(t(this,M),t(this,P,null)),this.#a=(t(this,F),t(this,L,!1)),this._previousSize=(t(this,R),null),this.addEventListener?.(`click`,e=>this.selectByClick(e),{passive:!0}),this.addController(new _(this,{config:O,callback:()=>{this.handleHighlightState(),this.dispatchEvent(new Event(`optionLabelChanged`,{bubbles:!0}))}})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid, sbb-select`),{size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}})),D&&(this.hydrationRequired?this.hydrationComplete.then(()=>this._inertAriaGroups=D):this._inertAriaGroups=D)}attributeChangedCallback(e,t,n){(e!==`value`||t!==n)&&super.attributeChangedCallback(e,t,n)}highlight(e){this._highlightString=e}selectViaUserInteraction(e){this.selected=e,this.selected&&this.dispatchEvent(new Event(`optionselected`,{bubbles:!0,composed:!0}))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),(e===`disabled`||e===`disabledFromGroup`)&&(this.toggleState(`disabled`,this.disabled||this.disabledFromGroup),g(this,`tabindex`,f&&!this.disabled&&!this.disabledFromGroup?0:null),this.updateAriaDisabled())}firstUpdated(e){super.firstUpdated(e),this._updateAriaSelected()}updateDisableHighlight(e){this.disableLabelHighlight=e,this.toggleState(`disable-highlight`,e)}setActive(e){this.toggleState(`active`,e)}updateAriaDisabled(){this.internals.ariaDisabled=this.disabled||this.disabledFromGroup?`true`:null,this.dispatchEvent(new Event(`ɵdisabledchange`,{bubbles:!0}))}_updateAriaSelected(){this.internals.ariaSelected=`${this.selected}`}handleHighlightState(){let e=Array.from(this.childNodes??[]).filter(e=>e.nodeType!==Node.COMMENT_NODE&&(!(e instanceof Element)||e.slot!==`icon`)),t=e.filter(e=>e.nodeType===Node.TEXT_NODE);t.length===0||e.filter(e=>!(e instanceof Element)||e.localName!==`template`).length!==t.length?this.updateDisableHighlight(!0):this.label=t.map(e=>e.wholeText).filter(e=>e.trim()).join(``)}getHighlightedLabel(){if(!this._highlightString||!this._highlightString.trim())return n`${this.label}`;let e=this.label.toLowerCase().indexOf(this._highlightString.toLowerCase());if(e===-1)return n`${this.label}`;let t=this.label.substring(0,e),r=this.label.substring(e,e+this._highlightString.length),i=this.label.substring(e+this._highlightString.length);return n`
18
18
  <span class="sbb-option__label--highlight">${t}</span><span>${r}</span
19
19
  ><span class="sbb-option__label--highlight">${i}</span>
20
20
  `}renderIcon(){return n`<span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}renderLabel(){return this.label&&!this.disableLabelHighlight?this.getHighlightedLabel():r}renderTick(){return r}render(){return n`
@@ -32,7 +32,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,not
32
32
  ${this.renderTick()}
33
33
  </div>
34
34
  `}}})();var A=`:host{--sbb-focus-outline-offset:var(--sbb-option-focus-outline-offset);background-color:var(--sbb-option-background-color);font-size:var(--sbb-option-font-size);letter-spacing:var(--sbb-letter-spacing-text);display:block}:host(:is(:state(negative),[state--negative])){--sbb-option-color:var(--sbb-color-3-negative);--sbb-option-icon-color:var(--sbb-color-5);--sbb-option-background-color-hover:var(--sbb-color-midnight);--sbb-option-background-color-active:var(--sbb-background-color-4-negative);--sbb-option-disabled-border-color:var(--sbb-border-color-5);--sbb-option-disabled-background-color:var(--sbb-background-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}:host(:is(:state(size-s),[state--size-s])){--sbb-option-min-height:var(--sbb-size-element-xxs);--sbb-option-focus-outline-offset:calc(-1 * var(--sbb-spacing-fixed-1x));--sbb-option-focus-outline-inset:0 var(--sbb-spacing-fixed-1x)}:host(:is(:state(size-m),[state--size-m])){--sbb-option-min-height:var(--sbb-size-element-s);--sbb-option-focus-outline-offset:inherit;--sbb-option-focus-outline-inset:var(--sbb-spacing-fixed-1x)}@media (any-hover:hover){:host(:hover:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color:var(--sbb-option-background-color-hover)}}:host(:active:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color:var(--sbb-option-background-color-active)}:host(:not(:is(:state(disable-highlight),[state--disable-highlight]))) .sbb-option__label slot{display:none}:host(:is(:state(disabled),[state--disabled])){--sbb-option-cursor:var(--sbb-cursor-default)}@media (forced-colors:active){:host(:is(:state(disabled),[state--disabled])){--sbb-option-color:GrayText}}:host(:is(:state(variant-select),[state--variant-select])){--sbb-option-column-gap:var(--sbb-spacing-fixed-2x);--sbb-option-justify-content:space-between}:host(:is(:state(variant-select),[state--variant-select]):is(:state(multiple),[state--multiple])){--sbb-option-justify-content:start}:host(:is(:state(active),[state--active])){--sbb-option-focus-outline-display:block}:host(:not(:is(:state(disabled),[state--disabled]))) .sbb-option__label--highlight{font-weight:700}@media (forced-colors:active){:host(:not(:is(:state(disabled),[state--disabled]))) .sbb-option__label--highlight{color:highlight}}.sbb-option{min-height:var(--sbb-option-min-height);align-items:center;column-gap:var(--sbb-option-column-gap);padding-inline:var(--sbb-option-padding-inline);justify-content:var(--sbb-option-justify-content);color:var(--sbb-option-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color);display:flex;position:relative}.sbb-option:after{content:"";display:var(--sbb-option-focus-outline-display,none);inset:var(--sbb-option-focus-outline-inset);pointer-events:none;border:var(--sbb-focus-outline-width) solid var(--sbb-focus-outline-color);border-radius:var(--sbb-option-border-radius);position:absolute}:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option{z-index:0;position:relative}:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option:before{content:"";display:var(--sbb-option-disabled-display,block);inset:var(--sbb-option-disabled-inset);border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-option-disabled-border-radius);background-color:var(--sbb-option-disabled-background-color);z-index:-1;position:absolute}@media (forced-colors:active){:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option:before{border-color:graytext}}.sbb-option__icon{min-width:var(--sbb-size-icon-ui-small);min-height:var(--sbb-size-icon-ui-small);color:var(--sbb-option-icon-color);display:flex}:host(:not(:is(:state(slotted-icon),[state--slotted-icon]),:is(:state(has-icon-name),[state--has-icon-name]))) .sbb-option__icon{display:var(--sbb-option-icon-container-display,none)}.sbb-option__label{text-overflow:var(--sbb-option-text-overflow);overflow:var(--sbb-option-overflow);white-space:var(--sbb-option-white-space,initial)}
35
- `,j=class extends k{static{this.elementName=`sbb-option`}static{this.elementDependencies=[y]}static{this.role=`option`}static{this.styles=[i(A)]}static{this.events={optionselectionchange:`optionselectionchange`,optionselected:`optionselected`}}set _variant(e){this._variantInternal&&this.internals.states.delete(`variant-${this._variantInternal}`),this._variantInternal=e,this._variantInternal&&this.internals.states.add(`variant-${this._variantInternal}`)}get _variant(){return this._variantInternal??null}constructor(){super(),this.addController(new u(this,()=>this.closest(`sbb-optgroup`),{disabled:e=>this.disabledFromGroup=e.disabled,label:e=>this.groupLabel=e.label})),this.addController(new u(this,()=>this.closest(`sbb-select`),{multiple:e=>{this.toggleState(`multiple`,e.multiple),this.requestUpdate()},negative:e=>this._handleNegativeChange(e)}))}_isMultiple(){return!this.hydrationRequired&&this.matches?.(`:is(:state(multiple),[state--multiple])`)}_handleNegativeChange(e){this.toggleState(`negative`,e.negative),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this.hydrationRequired?this.hydrationComplete.then(()=>this._init()):this._init()}_init(){this._setVariantByContext(),this.handleHighlightState()}selectByClick(e){if(this.disabled||this.disabledFromGroup){e.stopPropagation();return}this._isMultiple()?(e.stopPropagation(),this.selectViaUserInteraction(!this.selected)):this.selectViaUserInteraction(!0)}selectViaUserInteraction(e){super.selectViaUserInteraction(e),this.dispatchEvent(new Event(`optionselectionchange`,{bubbles:!0,composed:!0}))}_setVariantByContext(){this.closest?.(`sbb-autocomplete`)?this._variant=`autocomplete`:this.closest?.(`sbb-select`)&&(this._variant=`select`)}handleHighlightState(){if(this._variant!==`autocomplete`){this.updateDisableHighlight(!0);return}super.handleHighlightState()}renderIcon(){return n`
35
+ `,j=class extends k{static{this.elementName=`sbb-option`}static{this.elementDependencies=[y]}static{this.role=`option`}static{this.styles=[i(A)]}static{this.events={optionselectionchange:`optionselectionchange`,optionselected:`optionselected`}}set _variant(e){this._variantInternal&&this.internals.states.delete(`variant-${this._variantInternal}`),this._variantInternal=e,this._variantInternal&&this.internals.states.add(`variant-${this._variantInternal}`)}get _variant(){return this._variantInternal??null}constructor(){super(),this.addController(new u(this,()=>this.closest(`sbb-optgroup`),{disabled:e=>this.disabledFromGroup=e.disabled,label:e=>this.groupLabel=e.label})),this.addController(new u(this,()=>this.closest(`sbb-select`),{multiple:e=>{this.toggleState(`multiple`,e.multiple),this.requestUpdate()},negative:e=>this._handleNegativeChange(e)}))}_isMultiple(){return!this.hydrationRequired&&this.matches?.(`:is(:state(multiple),[state--multiple])`)}_handleNegativeChange(e){this.toggleState(`negative`,e.negative),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this.hydrationRequired?this.hydrationComplete.then(()=>this._init()):this._init()}_init(){this._setVariantByContext(),this.handleHighlightState()}selectByClick(e){this.disabled||this.disabledFromGroup?e.stopPropagation():this._isMultiple()?(e.stopPropagation(),this.selectViaUserInteraction(!this.selected)):this.selectViaUserInteraction(!0)}selectViaUserInteraction(e){super.selectViaUserInteraction(e),this.dispatchEvent(new Event(`optionselectionchange`,{bubbles:!0,composed:!0}))}_setVariantByContext(){this.closest?.(`sbb-autocomplete`)?this._variant=`autocomplete`:this.closest?.(`sbb-select`)&&(this._variant=`select`)}handleHighlightState(){this._variant===`autocomplete`?super.handleHighlightState():this.updateDisableHighlight(!0)}renderIcon(){return n`
36
36
  <!-- Icon -->
37
37
  ${this._isMultiple()?r:n` <span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}
38
38
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-dev",
3
- "version": "5.10.0-dev.1791595991",
3
+ "version": "5.10.0-dev.1791683977",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
- "https://github.com/sbb-design-systems/lyne-components/commit/3a58adccc5d69eea509098640002860fb72cc3d1"
9
+ "https://github.com/sbb-design-systems/lyne-components/commit/1751b535be6627e706972ba4322e23cb38a8cbde"
10
10
  ],
11
11
  "type": "module",
12
12
  "exports": {
package/popover.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{ResizeController as n}from"@lit-labs/observers/resize-controller.js";import{html as r,isServer as i,unsafeCSS as a}from"lit";import{property as o,state as s}from"lit/decorators.js";import{ref as c}from"lit/directives/ref.js";import{IS_FOCUSABLE_QUERY as l,SbbEscapableOverlayController as u,SbbFocusTrapController as d,SbbLanguageController as f,SbbMediaQueryPointerCoarse as p,SbbNegativeMixin as m,SbbOpenCloseBaseElement as h,SbbPropertyWatcherController as g,forceType as _,getElementPosition as v,i18nClosePopover as y,idReference as b,isEventOnElement as x,isFakeMousedownFromScreenReader as S,isZeroAnimationDuration as C,popoverResetStyles as w,readConfig as T,removeAriaOverlayTriggerProperties as E,sbbInputModalityDetector as D,scrollbarStyles as O,setAriaOverlayTriggerProperties as k,ɵstateController as A}from"./core.js";import{SbbSecondaryButtonElement as j}from"./button.pure.js";var M=`:host{--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));--sbb-popover-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--_sbb-popover-inset:0 auto auto 0;--_sbb-popover-translate:0 var(--sbb-spacing-fixed-2x);--_sbb-popover-box-shadow:var(--sbb-box-shadow-level-9-hard);display:none;outline:none!important}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){--_sbb-popover-inset:0;display:block}:host(:is(:state(position-above),[state--position-above])){--_sbb-popover-translate:0 calc(var(--sbb-spacing-fixed-2x) * -1)}.sbb-popover:after,.sbb-popover__content:before{content:"";width:var(--sbb-popover-arrow-size);height:var(--sbb-popover-arrow-size);left:var(--_sbb-popover-arrow-position-x,0);bottom:calc(100% - var(--sbb-popover-arrow-size) / 2);background-color:var(--sbb-popover-background);border-radius:var(--sbb-border-radius-2x) 0;display:block;position:absolute;rotate:45deg}.sbb-popover__container{inset:var(--_sbb-popover-inset);pointer-events:none;z-index:var(--sbb-popover-z-index,var(--sbb-overlay-default-z-index));position:fixed}.sbb-popover{top:var(--_sbb-popover-position-y,0);bottom:unset;left:var(--_sbb-popover-position-x,0);right:unset;background-color:var(--sbb-popover-background);max-width:var(--sbb-popover-max-width);width:max-content;box-shadow:var(--_sbb-popover-box-shadow);border-radius:var(--sbb-popover-border-radius);pointer-events:all;border:none;outline:none;padding:0;display:none;position:absolute}:host(:focus-visible) .sbb-popover{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-popover{animation-name:open;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing);display:block}:host(:is(:state(state-closing),[state--state-closing])) .sbb-popover{pointer-events:none;animation-name:close;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing)}.sbb-popover:after{z-index:-1;box-shadow:var(--_sbb-popover-box-shadow)}@media (forced-colors:active){.sbb-popover:after{outline:var(--sbb-border-width-1x) solid CanvasText}}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:after{top:calc(100% - var(--sbb-popover-arrow-size) / 2)}@media (forced-colors:active){.sbb-popover{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-popover:before{content:"";z-index:-1;background-color:#0000;display:block;position:absolute;inset:0}:host(:is(:state(position-below),[state--position-below])) .sbb-popover:before{inset-block-start:calc(-1 * var(--sbb-spacing-fixed-6x))}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:before{inset-block-end:calc(-1 * var(--sbb-spacing-fixed-6x))}.sbb-popover__content{border-radius:var(--sbb-popover-border-radius);padding:var(--sbb-popover-padding);background-color:var(--sbb-popover-background);outline:none}.sbb-popover__content:before{clip-path:polygon(100% 0,0% 0%,0% 100%)}:host(:is(:state(position-above),[state--position-above])) .sbb-popover__content:before{top:calc(100% - var(--sbb-popover-arrow-size) / 2);clip-path:polygon(100% 0,100% 100%,0% 100%)}@keyframes open{0%{opacity:0;translate:var(--_sbb-popover-translate)}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{opacity:0;translate:var(--_sbb-popover-translate)}}
2
- `;const N=/* @__PURE__ */ new Set;var P=class extends Event{get closeTarget(){return this._closeTarget}constructor(e,{closeTarget:t,cancelable:n}){super(e,{cancelable:n}),this._closeTarget=t}};let F=(()=>{let s=h,f,p=[],m=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,p,null),this._nextFocusedElement=t(this,m),this._skipCloseFocus=!1,this._resizeController=new n(this,{target:null,callback:()=>this._setPopoverPosition()}),this._escapableOverlayController=new u(this),this._focusTrapController=new d(this),this._blurTimeout=null,this._pointerDownListener=e=>{this._isPointerDownEventOnPopover=x(this.overlay,e)},this._closeOnBackdropClick=e=>{let t=e.composedPath();!this._isPointerDownEventOnPopover&&!x(this.overlay,e)&&(!this.trigger||!t.includes(this.trigger))&&(this._nextFocusedElement=t.filter(e=>e instanceof window.HTMLElement).find(e=>e.matches(l)),clearTimeout(this.closeTimeout),this.close())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;f=[b(),o()],e(this,null,f,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},p,m),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[w,a(M)]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}open(){if((this.state===`closed`||this.state===`closing`)&&this.overlay&&this.dispatchBeforeOpenEvent()){for(let e of N)(e.state===`opened`||e.state===`opening`)&&e.close();this.showPopover?.(),this.state=`opening`,this.inert=!0,this._setPopoverPosition(),this._attachWindowEvents(),this._escapableOverlayController.connect(),this._nextFocusedElement=void 0,this._skipCloseFocus=!1,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),this._isZeroAnimationDuration()&&this._handleOpening()}}close(e){(this.state===`opened`||this.state===`opening`)&&(this._popoverCloseElement=e,this.dispatchBeforeCloseEvent({closeTarget:e??null})&&(this.state=`closing`,this.inert=!0,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this._isZeroAnimationDuration()&&this._handleClosing()))}_isZeroAnimationDuration(){return C(this,`--sbb-popover-animation-duration`)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.overlay&&(this._resizeController.unobserve(this.overlay),this.overlay.firstElementChild?.scrollTo(0,0)),this.removeAttribute(`tabindex`),this._skipCloseFocus||(this._nextFocusedElement||this._triggerElement)?.focus(),this._escapableOverlayController.disconnect(),this._openStateController?.abort(),this._focusTrapController.enabled=!1,this.dispatchCloseEvent({closeTarget:this._popoverCloseElement??null})}_handleOpening(){this.state=`opened`,this.inert=!1,this._setPopoverFocus(),this._focusTrapController.enabled=!0,this.overlay&&this._resizeController.observe(this.overlay),this.dispatchOpenEvent()}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.state=`closed`,N.add(this),this.hasUpdated&&this._configureTrigger()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&(!e||e===`trigger`||e===`hoverTrigger`)&&this.hasUpdated&&this._configureTrigger()}firstUpdated(e){super.firstUpdated(e),this._configureTrigger()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openStateController?.abort(),N.delete(this),this._blurTimeout&&clearTimeout(this._blurTimeout)}_configureTrigger(){if(!i){if(this.hydrationRequired){this.hydrationComplete.then(()=>this._configureTrigger());return}this.configureTrigger(this._triggerElement??null)}}configureTrigger(e){this._triggerAbortController?.abort(),E(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(k(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this.registerTriggerListeners(this._triggerAbortController.signal))}registerTriggerListeners(e){this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:e})}_attachWindowEvents(){this._openStateController=new AbortController,document.addEventListener(`scroll`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal}),window.addEventListener(`pointerdown`,this._pointerDownListener,{signal:this._openStateController.signal}),window.addEventListener(`pointerup`,this._closeOnBackdropClick,{signal:this._openStateController.signal})}_closeOnSbbPopoverCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(`sbb-popover-close`)||e.localName===`sbb-popover-close-button`)&&!e.hasAttribute(`disabled`));t&&(clearTimeout(this.closeTimeout),this.close(t))}_onPopoverAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_setPopoverFocus(){!this._focusTrapController.focusInitialElement()&&this._openStateController&&(this.setAttribute(`tabindex`,`0`),this.focus({preventScroll:!0}),this.addEventListener(`blur`,e=>{this._blurTimeout=setTimeout(()=>{if(document.visibilityState!==`hidden`){if(this.removeAttribute(`tabindex`),this.contains(e.relatedTarget)||e.relatedTarget===this.trigger)return;(this.state===`opened`||this.state===`opening`)&&(this._skipCloseFocus=!0),this.close()}})},{signal:this._openStateController.signal}))}_setPopoverPosition(){if(!this.overlay||!this._triggerElement)return;let e=v(this.overlay,this._triggerElement,this.shadowRoot.querySelector(`.sbb-popover__container`),{verticalOffset:16,horizontalOffset:32,centered:!0,responsiveHeight:!0}),t=e.alignment.vertical;for(let e of[`above`,`below`])this.toggleState(`position-${e}`,e===t);let n=this.overlay.offsetWidth,r=document.documentElement.clientWidth,i=Math.max(2,Math.min(e.left,r-n-2)),a=this._triggerElement.getBoundingClientRect(),o=parseFloat(getComputedStyle(this.overlay).borderTopLeftRadius)||0,s=a.left-i+a.width/2-8,c=Math.max(o,Math.min(s,n-o-16));this.style.setProperty(`--_sbb-popover-position-x`,`${i}px`),this.style.setProperty(`--_sbb-popover-position-y`,`${e.top}px`),this.style.setProperty(`--_sbb-popover-arrow-position-x`,`${c}px`),this.style.setProperty(`--_sbb-popover-max-height`,e.maxHeight)}dispatchBeforeCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`beforeclose`,{closeTarget:t,cancelable:!0}))}dispatchCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`close`,{closeTarget:t,cancelable:!1}))}render(){return r`
2
+ `;const N=/* @__PURE__ */ new Set;var P=class extends Event{get closeTarget(){return this._closeTarget}constructor(e,{closeTarget:t,cancelable:n}){super(e,{cancelable:n}),this._closeTarget=t}};let F=(()=>{let s=h,f,p=[],m=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,p,null),this._nextFocusedElement=t(this,m),this._skipCloseFocus=!1,this._resizeController=new n(this,{target:null,callback:()=>this._setPopoverPosition()}),this._escapableOverlayController=new u(this),this._focusTrapController=new d(this),this._blurTimeout=null,this._pointerDownListener=e=>{this._isPointerDownEventOnPopover=x(this.overlay,e)},this._closeOnBackdropClick=e=>{let t=e.composedPath();!this._isPointerDownEventOnPopover&&!x(this.overlay,e)&&(!this.trigger||!t.includes(this.trigger))&&(this._nextFocusedElement=t.filter(e=>e instanceof window.HTMLElement).find(e=>e.matches(l)),clearTimeout(this.closeTimeout),this.close())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;f=[b(),o()],e(this,null,f,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},p,m),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[w,a(M)]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}open(){if((this.state===`closed`||this.state===`closing`)&&this.overlay&&this.dispatchBeforeOpenEvent()){for(let e of N)(e.state===`opened`||e.state===`opening`)&&e.close();this.showPopover?.(),this.state=`opening`,this.inert=!0,this._setPopoverPosition(),this._attachWindowEvents(),this._escapableOverlayController.connect(),this._nextFocusedElement=void 0,this._skipCloseFocus=!1,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),this._isZeroAnimationDuration()&&this._handleOpening()}}close(e){(this.state===`opened`||this.state===`opening`)&&(this._popoverCloseElement=e,this.dispatchBeforeCloseEvent({closeTarget:e??null})&&(this.state=`closing`,this.inert=!0,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this._isZeroAnimationDuration()&&this._handleClosing()))}_isZeroAnimationDuration(){return C(this,`--sbb-popover-animation-duration`)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.overlay&&(this._resizeController.unobserve(this.overlay),this.overlay.firstElementChild?.scrollTo(0,0)),this.removeAttribute(`tabindex`),this._skipCloseFocus||(this._nextFocusedElement||this._triggerElement)?.focus(),this._escapableOverlayController.disconnect(),this._openStateController?.abort(),this._focusTrapController.enabled=!1,this.dispatchCloseEvent({closeTarget:this._popoverCloseElement??null})}_handleOpening(){this.state=`opened`,this.inert=!1,this._setPopoverFocus(),this._focusTrapController.enabled=!0,this.overlay&&this._resizeController.observe(this.overlay),this.dispatchOpenEvent()}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.state=`closed`,N.add(this),this.hasUpdated&&this._configureTrigger()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&(!e||e===`trigger`||e===`hoverTrigger`)&&this.hasUpdated&&this._configureTrigger()}firstUpdated(e){super.firstUpdated(e),this._configureTrigger()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openStateController?.abort(),N.delete(this),this._blurTimeout&&clearTimeout(this._blurTimeout)}_configureTrigger(){i||(this.hydrationRequired?this.hydrationComplete.then(()=>this._configureTrigger()):this.configureTrigger(this._triggerElement??null))}configureTrigger(e){this._triggerAbortController?.abort(),E(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(k(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this.registerTriggerListeners(this._triggerAbortController.signal))}registerTriggerListeners(e){this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:e})}_attachWindowEvents(){this._openStateController=new AbortController,document.addEventListener(`scroll`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal}),window.addEventListener(`pointerdown`,this._pointerDownListener,{signal:this._openStateController.signal}),window.addEventListener(`pointerup`,this._closeOnBackdropClick,{signal:this._openStateController.signal})}_closeOnSbbPopoverCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(`sbb-popover-close`)||e.localName===`sbb-popover-close-button`)&&!e.hasAttribute(`disabled`));t&&(clearTimeout(this.closeTimeout),this.close(t))}_onPopoverAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_setPopoverFocus(){!this._focusTrapController.focusInitialElement()&&this._openStateController&&(this.setAttribute(`tabindex`,`0`),this.focus({preventScroll:!0}),this.addEventListener(`blur`,e=>{this._blurTimeout=setTimeout(()=>{if(document.visibilityState!==`hidden`){if(this.removeAttribute(`tabindex`),this.contains(e.relatedTarget)||e.relatedTarget===this.trigger)return;(this.state===`opened`||this.state===`opening`)&&(this._skipCloseFocus=!0),this.close()}})},{signal:this._openStateController.signal}))}_setPopoverPosition(){if(!this.overlay||!this._triggerElement)return;let e=v(this.overlay,this._triggerElement,this.shadowRoot.querySelector(`.sbb-popover__container`),{verticalOffset:16,horizontalOffset:32,centered:!0,responsiveHeight:!0}),t=e.alignment.vertical;for(let e of[`above`,`below`])this.toggleState(`position-${e}`,e===t);let n=this.overlay.offsetWidth,r=document.documentElement.clientWidth,i=Math.max(2,Math.min(e.left,r-n-2)),a=this._triggerElement.getBoundingClientRect(),o=parseFloat(getComputedStyle(this.overlay).borderTopLeftRadius)||0,s=a.left-i+a.width/2-8,c=Math.max(o,Math.min(s,n-o-16));this.style.setProperty(`--_sbb-popover-position-x`,`${i}px`),this.style.setProperty(`--_sbb-popover-position-y`,`${e.top}px`),this.style.setProperty(`--_sbb-popover-arrow-position-x`,`${c}px`),this.style.setProperty(`--_sbb-popover-max-height`,e.maxHeight)}dispatchBeforeCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`beforeclose`,{closeTarget:t,cancelable:!0}))}dispatchCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`close`,{closeTarget:t,cancelable:!1}))}render(){return r`
3
3
  <div class="sbb-popover__container">
4
4
  <div
5
5
  @animationend=${this._onPopoverAnimationEnd}
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,unsafeCSS as r}from"lit";import{property as i,state as a}from"lit/decorators.js";import{SbbElement as o,SbbLanguageController as s,SbbSelectionPanelMixin as c,forceType as l,i18nCollapsed as u,i18nExpanded as d,isZeroAnimationDuration as f}from"./core.js";import{SbbDividerElement as p}from"./divider.pure.js";var m=`:host{--sbb-selection-panel-inner-background:transparent;--sbb-selection-panel-inner-border-width:0px;--sbb-selection-expansion-panel-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));width:var(--sbb-selection-group-elements-width,100%);background-color:var(--sbb-selection-expansion-panel-background);border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-expansion-panel-border-width) var(--sbb-selection-expansion-panel-border-color);transition-duration:var(--sbb-selection-expansion-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);flex:auto;transition-property:box-shadow;display:block;position:relative}@media (forced-colors:active){:host:after{content:"";pointer-events:none;border:var(--sbb-selection-expansion-panel-border-width) solid var(--sbb-selection-expansion-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius);display:block;position:absolute;inset:0}}:host(:is(:state(size-xs),[state--size-xs])){--sbb-selection-expansion-panel-content-padding-inline:var(--sbb-selection-panel-input-padding-inline-xs)}:host(:is(:state(size-s),[state--size-s])){--sbb-selection-expansion-panel-content-padding-inline:var(--sbb-selection-panel-input-padding-inline-s)}:host(:is(:state(size-m),[state--size-m])){--sbb-selection-expansion-panel-content-padding-inline:var(--sbb-selection-panel-input-padding-inline-m)}:host(:is(:state(color-milk),[state--color-milk])){--sbb-selection-expansion-panel-background:var(--sbb-selection-panel-background-milk)}:host(:where(:is(:state(checked),[state--checked])):not(:where(:is(:state(disabled),[state--disabled])))){--sbb-selection-expansion-panel-border-color:var(--sbb-selection-panel-border-color-checked);--sbb-selection-expansion-panel-border-width:var(--sbb-selection-panel-border-width-checked)}:host(:is(:state(slotted-content),[state--slotted-content]):where(:is(:state(disabled),[state--disabled]))){--sbb-selection-expansion-panel-border-color:var(--sbb-selection-panel-border-color-default)}:host(:is(:state(borderless),[state--borderless]):not(:where(:is(:state(checked),[state--checked])))){--sbb-selection-expansion-panel-border-color:transparent}:host(:not(:is(:state(slotted-content),[state--slotted-content]):where(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened])))){--sbb-selection-expansion-panel-content-padding-block-end:0px;--sbb-selection-expansion-panel-content-visibility:hidden}.sbb-selection-expansion-panel__content--wrapper{visibility:var(--sbb-selection-expansion-panel-content-visibility);opacity:0;grid-template-rows:0fr;display:grid}:host(:is(:state(state-opened),[state--state-opened])) .sbb-selection-expansion-panel__content--wrapper{opacity:1;grid-template-rows:1fr}:host(:is(:state(state-opening),[state--state-opening])) .sbb-selection-expansion-panel__content--wrapper{animation-name:open,open-opacity;animation-fill-mode:forwards;animation-duration:var(--sbb-selection-expansion-panel-animation-duration);animation-timing-function:var(--sbb-animation-easing);animation-delay:0s, var(--sbb-selection-expansion-panel-animation-duration)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-selection-expansion-panel__content--wrapper{animation-name:close;animation-duration:var(--sbb-selection-expansion-panel-animation-duration);animation-timing-function:var(--sbb-animation-easing)}:host(:not(:is(:state(slotted-content),[state--slotted-content]))) .sbb-selection-expansion-panel__content--wrapper{display:none}.sbb-selection-expansion-panel__content{padding-inline:var(--sbb-selection-expansion-panel-content-padding-inline);transition:padding var(--sbb-selection-expansion-panel-animation-duration) var(--sbb-animation-easing);padding-block-end:var(--sbb-selection-expansion-panel-content-padding-block-end);overflow:hidden}sbb-divider{margin-block-end:var(--sbb-selection-expansion-panel-content-padding-block-start)}@keyframes open{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}@keyframes open-opacity{0%{opacity:0}to{opacity:1}}@keyframes close{0%{opacity:1;grid-template-rows:1fr}to{opacity:0;grid-template-rows:0fr}}
2
- `;let h=(()=>{let h=c(o),g=[],_,v=[],y=[],b;return class extends h{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;_=[l(),i({attribute:`force-open`,type:Boolean})],b=[a()],e(this,null,_,{kind:`accessor`,name:`forceOpen`,static:!1,private:!1,access:{has:e=>`forceOpen`in e,get:e=>e.forceOpen,set:(e,t)=>{e.forceOpen=t}},metadata:t},v,y),e(this,null,b,{kind:`setter`,name:`_state`,static:!1,private:!1,access:{has:e=>`_state`in e,set:(e,t)=>{e._state=t}},metadata:t},null,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-selection-expansion-panel`}static{this.elementDependencies=[p]}static{this.styles=[r(m)]}static{this.events={beforeopen:`beforeopen`,open:`open`,beforeclose:`beforeclose`,close:`close`}}#e;get forceOpen(){return this.#e}set forceOpen(e){this.#e=e}set _state(e){this._stateInternal&&this.internals.states.delete(`state-${this._stateInternal}`),this._stateInternal=e,this._stateInternal&&this.internals.states.add(`state-${this._stateInternal}`)}get _state(){return this._stateInternal}get _hasContent(){return this.querySelectorAll?.(`[slot="content"]`).length>0}constructor(){super(),this.#e=(t(this,g),t(this,v,!1)),this._stateInternal=t(this,y),this._language=new s(this),this._state=`closed`}willUpdate(e){super.willUpdate(e),e.has(`forceOpen`)&&this._updateState()}onInputStateChange(){this._updateState()}_updateState(){this._hasContent&&(this.forceOpen||this.matches(`:is(:state(checked),[state--checked])`)?this._open():this._close(),this._updateExpandedLabel(this.forceOpen||this.matches(`:is(:state(checked),[state--checked])`)))}_open(){(this._state===`closed`||this._state===`closing`)&&(this._state=`opening`,this.dispatchEvent(new Event(`beforeopen`,{cancelable:!0})),(!this.hasUpdated||this._isZeroAnimationDuration())&&this._handleOpening())}_close(){(this._state===`opened`||this._state===`opening`)&&(this._state=`closing`,this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0})),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return f(this,`--sbb-selection-expansion-panel-animation-duration`)}_handleClosing(){this._state=`closed`,this.dispatchEvent(new Event(`close`))}_handleOpening(){this._state=`opened`,this.dispatchEvent(new Event(`open`))}_onAnimationEnd(e){e.animationName===`open-opacity`&&this._state===`opening`?this._handleOpening():e.animationName===`close`&&this._state===`closing`&&this._handleClosing()}async _updateExpandedLabel(e){await this.hydrationComplete;let t=this.panel;if(t){if(!this._hasContent){t.expansionState=``;return}t.expansionState=e?`, `+d[this._language.current]:`, `+u[this._language.current]}}render(){return n`
2
+ `;let h=(()=>{let h=c(o),g=[],_,v=[],y=[],b;return class extends h{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;_=[l(),i({attribute:`force-open`,type:Boolean})],b=[a()],e(this,null,_,{kind:`accessor`,name:`forceOpen`,static:!1,private:!1,access:{has:e=>`forceOpen`in e,get:e=>e.forceOpen,set:(e,t)=>{e.forceOpen=t}},metadata:t},v,y),e(this,null,b,{kind:`setter`,name:`_state`,static:!1,private:!1,access:{has:e=>`_state`in e,set:(e,t)=>{e._state=t}},metadata:t},null,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-selection-expansion-panel`}static{this.elementDependencies=[p]}static{this.styles=[r(m)]}static{this.events={beforeopen:`beforeopen`,open:`open`,beforeclose:`beforeclose`,close:`close`}}#e;get forceOpen(){return this.#e}set forceOpen(e){this.#e=e}set _state(e){this._stateInternal&&this.internals.states.delete(`state-${this._stateInternal}`),this._stateInternal=e,this._stateInternal&&this.internals.states.add(`state-${this._stateInternal}`)}get _state(){return this._stateInternal}get _hasContent(){return this.querySelectorAll?.(`[slot="content"]`).length>0}constructor(){super(),this.#e=(t(this,g),t(this,v,!1)),this._stateInternal=t(this,y),this._language=new s(this),this._state=`closed`}willUpdate(e){super.willUpdate(e),e.has(`forceOpen`)&&this._updateState()}onInputStateChange(){this._updateState()}_updateState(){this._hasContent&&(this.forceOpen||this.matches(`:is(:state(checked),[state--checked])`)?this._open():this._close(),this._updateExpandedLabel(this.forceOpen||this.matches(`:is(:state(checked),[state--checked])`)))}_open(){(this._state===`closed`||this._state===`closing`)&&(this._state=`opening`,this.dispatchEvent(new Event(`beforeopen`,{cancelable:!0})),(!this.hasUpdated||this._isZeroAnimationDuration())&&this._handleOpening())}_close(){(this._state===`opened`||this._state===`opening`)&&(this._state=`closing`,this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0})),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return f(this,`--sbb-selection-expansion-panel-animation-duration`)}_handleClosing(){this._state=`closed`,this.dispatchEvent(new Event(`close`))}_handleOpening(){this._state=`opened`,this.dispatchEvent(new Event(`open`))}_onAnimationEnd(e){e.animationName===`open-opacity`&&this._state===`opening`?this._handleOpening():e.animationName===`close`&&this._state===`closing`&&this._handleClosing()}async _updateExpandedLabel(e){await this.hydrationComplete;let t=this.panel;t&&(t.expansionState=this._hasContent?e?`, `+d[this._language.current]:`, `+u[this._language.current]:``)}render(){return n`
3
3
  <div class="sbb-selection-expansion-panel__input">
4
4
  <slot></slot>
5
5
  </div>
package/tabs.pure.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{ResizeController as n}from"@lit-labs/observers/resize-controller.js";import{html as r,unsafeCSS as i}from"lit";import{property as a}from"lit/decorators.js";import{ref as o}from"lit/directives/ref.js";import{SbbDisabledMixin as s,SbbElement as c,SbbNamedSlotListMixin as l,SbbPropertyWatcherController as u,forceType as d,getNextElementIndex as f,hostScrollbarStyles as p,isArrowKeyPressed as m,omitEmptyConverter as h,ɵstateController as g}from"./core.js";import{html as _,unsafeStatic as v}from"lit/static-html.js";import{SbbIconNameMixin as y}from"./icon.pure.js";var b=`:host{flex-direction:column;display:flex}:host(:not([size])){--sbb-tab-group-content-gap:var(--sbb-tab-group-content-gap-default)}:host([size=s]){--sbb-tab-group-content-gap:var(--sbb-tab-group-content-gap-size-s)}:host([size=l]){--sbb-tab-group-content-gap:var(--sbb-tab-group-content-gap-size-l)}:host([size=xl]){--sbb-tab-group-content-gap:var(--sbb-tab-group-content-gap-size-xl)}.sbb-tab-group,.sbb-tab-nav-bar{flex-wrap:wrap;display:flex}
2
2
  `,x=`:host{--sbb-tab-label-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));--sbb-tab-label-outline-border-radius-internal:calc(var(--sbb-tab-label-outline-border-radius) - var(--sbb-focus-outline-offset))}:host(:is(:is(:state(size-s),[state--size-s]),[size=s])){--sbb-tab-label-height:var(--sbb-size-element-xs);--sbb-tab-label-inline-padding:var(--sbb-spacing-responsive-xxxs);--sbb-tab-label-font-size:var(--sbb-text-font-size-s)}:host(:is(:is(:state(size-l),[state--size-l]),[size=l])){--sbb-tab-label-height:var(--sbb-size-element-m);--sbb-tab-label-inline-padding:var(--sbb-spacing-responsive-xs);--sbb-tab-label-font-size:var(--sbb-text-font-size-m)}:host(:is(:is(:state(size-xl),[state--size-xl]),[size=xl])){--sbb-tab-label-height:var(--sbb-size-element-m);--sbb-tab-label-inline-padding:var(--sbb-spacing-responsive-xs);--sbb-tab-label-font-size:var(--sbb-text-font-size-xl)}:host(sbb-tab-label),:host(sbb-tab-nav-bar) ::slotted(a){pointer-events:var(--sbb-tab-label-pointer-events,unset)}@media (forced-colors:active){:host(sbb-tab-label),:host(sbb-tab-nav-bar) ::slotted(a){--sbb-tab-label-color:ButtonText;--sbb-tab-label-amount-color:ButtonText}}:host(sbb-tab-nav-bar) ::slotted(a),:host(sbb-tab-label) .sbb-tab-label{align-items:center;gap:var(--sbb-tab-label-gap);color:var(--sbb-tab-label-color);padding-inline:var(--sbb-tab-label-inline-padding);min-height:var(--sbb-tab-label-height);transition:color var(--sbb-tab-label-animation-duration) var(--sbb-tab-label-animation-easing);font-size:var(--sbb-tab-label-font-size);letter-spacing:var(--sbb-letter-spacing-text);line-height:var(--sbb-typo-line-height-text);font-weight:var(--sbb-tab-label-font-weight);text-decoration:var(--sbb-tab-label-text-decoration);margin:0;display:flex;position:relative}:host(sbb-tab-nav-bar) ::slotted(a):after,:host(sbb-tab-label) .sbb-tab-label:after{content:"";height:var(--sbb-tab-label-marker-thickness);background-color:var(--sbb-tab-label-color);scale:var(--sbb-tab-label-marker-scale,0);transition-duration:var(--sbb-tab-label-animation-duration);transition-timing-function:var(--sbb-tab-label-animation-easing);transition-property:scale,background-color;position:absolute;inset-block-end:0;inset-inline:0}:host(sbb-tab-nav-bar) .sbb-tab-nav-bar>[data-has-divider],:host(sbb-tab-label:is(:state(has-divider),[state--has-divider])){position:relative}:host(sbb-tab-nav-bar) .sbb-tab-nav-bar>[data-has-divider]:before,:host(sbb-tab-label:is(:state(has-divider),[state--has-divider])):before{content:"";width:var(--sbb-tab-group-width);height:var(--sbb-border-width-1x);background-color:var(--sbb-tab-label-line-color);position:absolute;inset-block-end:0;inset-inline-start:0}:host(sbb-tab-nav-bar) ::slotted(a.sbb-disabled),:host(sbb-tab-label[disabled]){--sbb-tab-label-cursor:unset;--sbb-tab-label-pointer-events:none;--sbb-tab-label-text-decoration:line-through}@media (forced-colors:active){:host(sbb-tab-nav-bar) ::slotted(a.sbb-disabled),:host(sbb-tab-label[disabled]){--sbb-tab-label-color:GrayText;--sbb-tab-label-amount-color:GrayText}}:host(sbb-tab-nav-bar) ::slotted(a.sbb-active:not(.sbb-disabled)),:host(sbb-tab-label[active]:not([disabled])){--sbb-tab-label-color:var(--sbb-color-3);--sbb-tab-label-cursor:unset;--sbb-tab-label-pointer-events:none;--sbb-tab-label-marker-scale:1}@media (forced-colors:active){:host(sbb-tab-nav-bar) ::slotted(a.sbb-active:not(.sbb-disabled)),:host(sbb-tab-label[active]:not([disabled])){--sbb-tab-label-color:ButtonText;--sbb-tab-label-amount-color:ButtonText}}@media (any-hover:hover){:host(sbb-tab-nav-bar) ::slotted(a:hover:not(.sbb-disabled)),:host(sbb-tab-label:hover:not([disabled])){--sbb-tab-label-marker-scale:1}}:host(sbb-tab-nav-bar) ::slotted(a:active:not(.sbb-disabled)),:host(sbb-tab-label:active){--sbb-tab-label-color:var(--sbb-color-3)}@media (forced-colors:active){:host(sbb-tab-nav-bar) ::slotted(a:active:not(.sbb-disabled)),:host(sbb-tab-label:active){--sbb-tab-label-color:ButtonText;--sbb-tab-label-amount-color:ButtonText}}:host(sbb-tab-nav-bar) ::slotted(a:focus-visible),:host(sbb-tab-label:focus-visible) .sbb-tab-label{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width);border-radius:var(--sbb-tab-label-outline-border-radius-internal)}
3
3
  `;const S=i(b),C=i(x);var w=`:host{--sbb-tab-group-animation-duration:0s;gap:var(--sbb-tab-group-content-gap)}:host(:is(:state(initialized),[state--initialized])){--sbb-tab-group-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x))}.sbb-tab-group-content{height:var(--sbb-tab-content-height);transition:height var(--sbb-tab-group-animation-duration) var(--sbb-animation-easing)}:host([fixed-height]) ::slotted(sbb-tab){height:100%;overflow:auto}
4
- `,T=class extends Event{get activeIndex(){return this._activeIndex}get activeTabLabel(){return this._activeTabLabel}get activeTab(){return this._activeTab}get previousIndex(){return this._previousIndex}get previousTabLabel(){return this._previousTabLabel}get previousTab(){return this._previousTab}constructor({activeIndex:e,activeTabLabel:t,activeTab:n,previousIndex:r,previousTabLabel:i,previousTab:a}){super(`tabchange`,{bubbles:!0,composed:!0}),this._activeIndex=e,this._activeTabLabel=t,this._activeTab=n,this._previousIndex=r,this._previousTabLabel=i,this._previousTab=a}};let E=(()=>{let s=c,l,u=[],p=[],h,_=[],v=[],y,b=[],x=[];return class extends s{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;l=[a({reflect:!0})],h=[d(),a({attribute:`initial-selected-index`,type:Number})],y=[d(),a({attribute:`fixed-height`,type:Boolean,reflect:!0})],e(this,null,l,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},u,p),e(this,null,h,{kind:`accessor`,name:`initialSelectedIndex`,static:!1,private:!1,access:{has:e=>`initialSelectedIndex`in e,get:e=>e.initialSelectedIndex,set:(e,t)=>{e.initialSelectedIndex=t}},metadata:t},_,v),e(this,null,y,{kind:`accessor`,name:`fixedHeight`,static:!1,private:!1,access:{has:e=>`fixedHeight`in e,get:e=>e.fixedHeight,set:(e,t)=>{e.fixedHeight=t}},metadata:t},b,x),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tab-group`}static{this.styles=[S,i(w)]}static{this.events={tabchange:`tabchange`}}#e;get size(){return this.#e}set size(e){this.#e=e}#t;get initialSelectedIndex(){return this.#t}set initialSelectedIndex(e){this.#t=e}#n;get fixedHeight(){return this.#n}set fixedHeight(e){this.#n=e}get labels(){return Array.from(this.children??[]).filter(e=>/^sbb-tab-label$/u.test(e.localName))}get tabs(){return Array.from(this.children??[]).filter(e=>/^sbb-tab$/u.test(e.localName))}constructor(){super(),this._tabGroupResizeObserver=new n(this,{target:null,skipInitial:!0,callback:()=>this._onTabGroupElementResize()}),this.#e=t(this,u,null),this.#t=(t(this,p),t(this,_,0)),this.#n=(t(this,v),t(this,b,!1)),t(this,x),this.addEventListener?.(`keydown`,e=>this._handleKeyDown(e))}firstUpdated(e){super.firstUpdated(e),this.labels.forEach(e=>e.linkToTab()),this._initSelection(),Promise.resolve().then(()=>this.internals.states.add(`initialized`)),this._tabGroupResizeObserver.observe(this._tabGroupElement)}disableTab(e){this.labels[e]&&(this.labels[e].disabled=!0)}enableTab(e){this.labels[e]&&(this.labels[e].disabled=!1)}activateTab(e){this.labels[e]?.activate()}_enabledTabs(){return this.labels.filter(e=>(customElements.upgrade(e),!e.disabled))}_onContentSlotChange(){this._contentSlotChangeDebounceId&&clearTimeout(this._contentSlotChangeDebounceId),this._contentSlotChangeDebounceId=setTimeout(()=>{this.labels.forEach(e=>e.linkToTab()),this.labels.find(e=>e.active)?.activate()},150)}_onLabelSlotChange(){this.labels.forEach(e=>e.linkToTab()),this._ensureActiveTab()}_ensureActiveTab(){this.matches?.(`:is(:state(initialized),[state--initialized])`)&&!this.labels.some(e=>e.active)&&this._initSelection()}_initSelection(){let e=this.labels[this.initialSelectedIndex];if(e&&(customElements.upgrade(e),this.initialSelectedIndex>=0&&this.initialSelectedIndex<this.labels.length&&!e.disabled)){e.activate();return}this._enabledTabs()[0]?.activate()}_onTabGroupElementResize(){let e=this.labels;e.forEach(t=>{g(t)?.toggle(`has-divider`,t===e[0]||t.offsetLeft===e[0].offsetLeft)}),this.style.setProperty(`--sbb-tab-group-width`,`${this._tabGroupElement.clientWidth}px`)}_handleKeyDown(e){let t=this._enabledTabs();if(!(!t||e.target!==this&&e.target.parentElement!==this)&&m(e)){let n=t.findIndex(e=>e.active),r=f(e,n,t.length);t[r]?.activate(),t[r]?.focus(),e.preventDefault()}}setTabContentHeight(e){this.style.setProperty(`--sbb-tab-content-height`,`${e}px`)}render(){return r`
4
+ `,T=class extends Event{get activeIndex(){return this._activeIndex}get activeTabLabel(){return this._activeTabLabel}get activeTab(){return this._activeTab}get previousIndex(){return this._previousIndex}get previousTabLabel(){return this._previousTabLabel}get previousTab(){return this._previousTab}constructor({activeIndex:e,activeTabLabel:t,activeTab:n,previousIndex:r,previousTabLabel:i,previousTab:a}){super(`tabchange`,{bubbles:!0,composed:!0}),this._activeIndex=e,this._activeTabLabel=t,this._activeTab=n,this._previousIndex=r,this._previousTabLabel=i,this._previousTab=a}};let E=(()=>{let s=c,l,u=[],p=[],h,_=[],v=[],y,b=[],x=[];return class extends s{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;l=[a({reflect:!0})],h=[d(),a({attribute:`initial-selected-index`,type:Number})],y=[d(),a({attribute:`fixed-height`,type:Boolean,reflect:!0})],e(this,null,l,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},u,p),e(this,null,h,{kind:`accessor`,name:`initialSelectedIndex`,static:!1,private:!1,access:{has:e=>`initialSelectedIndex`in e,get:e=>e.initialSelectedIndex,set:(e,t)=>{e.initialSelectedIndex=t}},metadata:t},_,v),e(this,null,y,{kind:`accessor`,name:`fixedHeight`,static:!1,private:!1,access:{has:e=>`fixedHeight`in e,get:e=>e.fixedHeight,set:(e,t)=>{e.fixedHeight=t}},metadata:t},b,x),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tab-group`}static{this.styles=[S,i(w)]}static{this.events={tabchange:`tabchange`}}#e;get size(){return this.#e}set size(e){this.#e=e}#t;get initialSelectedIndex(){return this.#t}set initialSelectedIndex(e){this.#t=e}#n;get fixedHeight(){return this.#n}set fixedHeight(e){this.#n=e}get labels(){return Array.from(this.children??[]).filter(e=>/^sbb-tab-label$/u.test(e.localName))}get tabs(){return Array.from(this.children??[]).filter(e=>/^sbb-tab$/u.test(e.localName))}constructor(){super(),this._tabGroupResizeObserver=new n(this,{target:null,skipInitial:!0,callback:()=>this._onTabGroupElementResize()}),this.#e=t(this,u,null),this.#t=(t(this,p),t(this,_,0)),this.#n=(t(this,v),t(this,b,!1)),t(this,x),this.addEventListener?.(`keydown`,e=>this._handleKeyDown(e))}firstUpdated(e){super.firstUpdated(e),this.labels.forEach(e=>e.linkToTab()),this._initSelection(),Promise.resolve().then(()=>this.internals.states.add(`initialized`)),this._tabGroupResizeObserver.observe(this._tabGroupElement)}disableTab(e){this.labels[e]&&(this.labels[e].disabled=!0)}enableTab(e){this.labels[e]&&(this.labels[e].disabled=!1)}activateTab(e){this.labels[e]?.activate()}_enabledTabs(){return this.labels.filter(e=>(customElements.upgrade(e),!e.disabled))}_onContentSlotChange(){this._contentSlotChangeDebounceId&&clearTimeout(this._contentSlotChangeDebounceId),this._contentSlotChangeDebounceId=setTimeout(()=>{this.labels.forEach(e=>e.linkToTab()),this.labels.find(e=>e.active)?.activate()},150)}_onLabelSlotChange(){this.labels.forEach(e=>e.linkToTab()),this._ensureActiveTab()}_ensureActiveTab(){this.matches?.(`:is(:state(initialized),[state--initialized])`)&&!this.labels.some(e=>e.active)&&this._initSelection()}_initSelection(){let e=this.labels[this.initialSelectedIndex];e&&(customElements.upgrade(e),this.initialSelectedIndex>=0&&this.initialSelectedIndex<this.labels.length&&!e.disabled)?e.activate():this._enabledTabs()[0]?.activate()}_onTabGroupElementResize(){let e=this.labels;e.forEach(t=>{g(t)?.toggle(`has-divider`,t===e[0]||t.offsetLeft===e[0].offsetLeft)}),this.style.setProperty(`--sbb-tab-group-width`,`${this._tabGroupElement.clientWidth}px`)}_handleKeyDown(e){let t=this._enabledTabs();if(!(!t||e.target!==this&&e.target.parentElement!==this)&&m(e)){let n=t.findIndex(e=>e.active),r=f(e,n,t.length);t[r]?.activate(),t[r]?.focus(),e.preventDefault()}}setTabContentHeight(e){this.style.setProperty(`--sbb-tab-content-height`,`${e}px`)}render(){return r`
5
5
  <div
6
6
  class="sbb-tab-group"
7
7
  role="tablist"
package/tag.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isServer as r,unsafeCSS as i}from"lit";import{property as a}from"lit/decorators.js";import{SbbButtonLikeBaseElement as o,SbbDisabledMixin as s,SbbDisabledTabIndexActionMixin as c,SbbElement as l,SbbNamedSlotListMixin as u,SbbPropertyWatcherController as d,forceType as f,getNextElementIndex as p,isArrowKeyPressed as m,omitEmptyConverter as h}from"./core.js";import{SbbIconNameMixin as g}from"./icon.pure.js";var _=`:host{display:block}.sbb-tag-group__list{gap:var(--sbb-spacing-fixed-3x);flex-wrap:wrap;display:flex}.sbb-tag-group__list>:is(li,span){max-width:100%;display:flex}
2
- `;let v=(()=>{let o=s(u(l)),c=[],d,h=[],g=[],v,y=[],b=[],x,S=[],C=[],w;return class extends o{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;d=[f(),a({attribute:`accessibility-label`})],v=[f(),a({type:Boolean})],x=[a({reflect:!0})],w=[a()],e(this,null,d,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:t},h,g),e(this,null,v,{kind:`accessor`,name:`multiple`,static:!1,private:!1,access:{has:e=>`multiple`in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:t},y,b),e(this,null,x,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},S,C),e(this,null,w,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,c),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tag-group`}static{this.styles=[i(_)]}#e;get accessibilityLabel(){return this.#e}set accessibilityLabel(e){this.#e=e}#t;get multiple(){return this.#t}set multiple(e){this.#t=e}#n;get size(){return this.#n}set size(e){this.#n=e}set value(e){if(r||!this.hasUpdated){this._value=e;return}this._applyValueToTags(e)}get value(){return r||!this.hasUpdated?this._value:this.multiple?this.tags.filter(e=>e.checked).map(e=>e.value):this.tags.find(e=>e.checked)?.value??null}get tags(){return Array.from(this.querySelectorAll?.(`sbb-tag`)??[],e=>(customElements.upgrade(e),e))}constructor(){super(),this.listChildLocalNames=(t(this,c),[`sbb-tag`,`div`]),this.#e=t(this,h,``),this.#t=(t(this,g),t(this,y,!1)),this.#n=(t(this,b),t(this,S,null)),this._value=(t(this,C),null),this.addEventListener?.(`keydown`,e=>this._handleArrowKeyDown(e))}willUpdate(e){super.willUpdate(e),e.has(`value`)&&!this.hasUpdated&&this._value&&this._applyValueToTags(this.value),e.has(`disabled`)&&this.tags.forEach(e=>e.requestUpdate?.(`disabled`)),(e.has(`listChildren`)||e.has(`multiple`))&&(this.multiple?e.has(`multiple`)&&this._enabledTags().forEach(e=>e.tabIndex=0):(this.tags.filter(e=>e.checked).slice(1).forEach(e=>e.checked=!1),this.updateExclusiveTabIndex())),(e.has(`accessibilityLabel`)||e.has(`multiple`))&&(this.multiple?(this.internals.role=this.accessibilityLabel?null:`group`,this.internals.ariaLabel=null):(this.internals.role=`radiogroup`,this.internals.ariaLabel=this.accessibilityLabel))}_enabledTags(){return this.tags.filter(e=>!e.disabled)}updateExclusiveTabIndex(){let e=this._enabledTags(),t=e.find(e=>e.checked)??e[0];e.forEach(e=>e.tabIndex=e===t?0:-1)}_handleArrowKeyDown(e){if(this.multiple||!m(e))return;e.preventDefault();let t=this._enabledTags(),n=t.indexOf(e.target);if(n===-1)return;let r=t[p(e,n,t.length)];t.forEach(e=>e.tabIndex=e===r?0:-1),r.focus()}_applyValueToTags(e){let t=this.tags;if(e===null)t.forEach(e=>e.checked=!1);else if(this.multiple){if(!Array.isArray(e)&&t.every(t=>t.value!==e))try{e=JSON.parse(e)}catch{}let n=Array.isArray(e)?e:[e];t.forEach(e=>e.checked=n.includes(e.value))}else Array.isArray(e)||t.forEach(t=>t.checked=t.value===e)}render(){return n`
2
+ `;let v=(()=>{let o=s(u(l)),c=[],d,h=[],g=[],v,y=[],b=[],x,S=[],C=[],w;return class extends o{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;d=[f(),a({attribute:`accessibility-label`})],v=[f(),a({type:Boolean})],x=[a({reflect:!0})],w=[a()],e(this,null,d,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:t},h,g),e(this,null,v,{kind:`accessor`,name:`multiple`,static:!1,private:!1,access:{has:e=>`multiple`in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:t},y,b),e(this,null,x,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},S,C),e(this,null,w,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,c),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tag-group`}static{this.styles=[i(_)]}#e;get accessibilityLabel(){return this.#e}set accessibilityLabel(e){this.#e=e}#t;get multiple(){return this.#t}set multiple(e){this.#t=e}#n;get size(){return this.#n}set size(e){this.#n=e}set value(e){r||!this.hasUpdated?this._value=e:this._applyValueToTags(e)}get value(){return r||!this.hasUpdated?this._value:this.multiple?this.tags.filter(e=>e.checked).map(e=>e.value):this.tags.find(e=>e.checked)?.value??null}get tags(){return Array.from(this.querySelectorAll?.(`sbb-tag`)??[],e=>(customElements.upgrade(e),e))}constructor(){super(),this.listChildLocalNames=(t(this,c),[`sbb-tag`,`div`]),this.#e=t(this,h,``),this.#t=(t(this,g),t(this,y,!1)),this.#n=(t(this,b),t(this,S,null)),this._value=(t(this,C),null),this.addEventListener?.(`keydown`,e=>this._handleArrowKeyDown(e))}willUpdate(e){super.willUpdate(e),e.has(`value`)&&!this.hasUpdated&&this._value&&this._applyValueToTags(this.value),e.has(`disabled`)&&this.tags.forEach(e=>e.requestUpdate?.(`disabled`)),(e.has(`listChildren`)||e.has(`multiple`))&&(this.multiple?e.has(`multiple`)&&this._enabledTags().forEach(e=>e.tabIndex=0):(this.tags.filter(e=>e.checked).slice(1).forEach(e=>e.checked=!1),this.updateExclusiveTabIndex())),(e.has(`accessibilityLabel`)||e.has(`multiple`))&&(this.multiple?(this.internals.role=this.accessibilityLabel?null:`group`,this.internals.ariaLabel=null):(this.internals.role=`radiogroup`,this.internals.ariaLabel=this.accessibilityLabel))}_enabledTags(){return this.tags.filter(e=>!e.disabled)}updateExclusiveTabIndex(){let e=this._enabledTags(),t=e.find(e=>e.checked)??e[0];e.forEach(e=>e.tabIndex=e===t?0:-1)}_handleArrowKeyDown(e){if(this.multiple||!m(e))return;e.preventDefault();let t=this._enabledTags(),n=t.indexOf(e.target);if(n===-1)return;let r=t[p(e,n,t.length)];t.forEach(e=>e.tabIndex=e===r?0:-1),r.focus()}_applyValueToTags(e){let t=this.tags;if(e===null)t.forEach(e=>e.checked=!1);else if(this.multiple){if(!Array.isArray(e)&&t.every(t=>t.value!==e))try{e=JSON.parse(e)}catch{}let n=Array.isArray(e)?e:[e];t.forEach(e=>e.checked=n.includes(e.value))}else Array.isArray(e)||t.forEach(t=>t.checked=t.value===e)}render(){return n`
3
3
  ${this.renderList({class:`sbb-tag-group__list`,ariaLabel:this.multiple?this.accessibilityLabel:void 0})}
4
4
  `}}})();var y=`:host{--sbb-tag-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));max-width:100%;display:inline-block;outline:none!important}:host([size=s]){--sbb-tag-height:var(--sbb-tag-height-s);--sbb-tag-padding-inline:var(--sbb-tag-padding-inline-s)}:host([size=m]){--sbb-tag-height:var(--sbb-tag-height-m);--sbb-tag-padding-inline:var(--sbb-tag-padding-inline-m)}:host(:is(:state(checked),[state--checked])){--sbb-tag-border-color:var(--sbb-border-color-3);--sbb-tag-border-width:var(--sbb-border-width-2x)}@media (forced-colors:active){:host(:is(:state(checked),[state--checked])){--sbb-tag-border-width:var(--sbb-border-width-4x);--sbb-tag-border-color:Highlight!important}}:host(:is(:disabled,[disabled-interactive])){--sbb-tag-text-color:light-dark(var(--sbb-color-granite),var(--sbb-color-aluminium));--sbb-tag-amount-color:var(--sbb-tag-text-color);--sbb-tag-background-color:var(--sbb-background-color-3);--sbb-tag-border-color:light-dark(var(--sbb-color-cement),var(--sbb-color-smoke));--sbb-tag-border-style:dashed;--sbb-tag-cursor:unset;--sbb-tag-pointer-events:none}@media (forced-colors:active){:host(:is(:disabled,[disabled-interactive])){--sbb-tag-text-color:GrayText;--sbb-tag-amount-color:GrayText;--sbb-tag-border-color:GrayText}}:host(:is(:state(checked),[state--checked]):is(:disabled,[disabled-interactive])){--sbb-tag-border-color:light-dark(var(--sbb-color-metal),var(--sbb-color-cement));--sbb-tag-border-style:dashed}@media (any-hover:hover){:host(:hover:not(:disabled,[disabled-interactive],:active,:is(:state(active),[state--active]))){--sbb-tag-background-color:var(--sbb-background-color-3);--sbb-tag-inset:calc(var(--sbb-border-width-2x) * -1);--sbb-tag-content-shift:translateY(calc(var(--sbb-border-width-1x) * -1))}}@media (any-hover:hover) and (forced-colors:active){:host(:hover:not(:disabled,[disabled-interactive],:active,:is(:state(active),[state--active]))){--sbb-tag-border-color:Highlight}}:host(:is(:active,:is(:state(active),[state--active])):not(:disabled,[disabled-interactive])){--sbb-tag-background-color:var(--sbb-background-color-3);--sbb-tag-border-color:light-dark(var(--sbb-color-iron),var(--sbb-color-storm));--sbb-tag-border-width:var(--sbb-border-width-2x);--sbb-tag-text-color:var(--sbb-color-4)}@media (forced-colors:active){:host(:is(:active,:is(:state(active),[state--active])):not(:disabled,[disabled-interactive])){--sbb-tag-border-color:Highlight;--sbb-tag-text-color:ButtonText}}.sbb-tag{height:var(--sbb-tag-height);max-width:100%;font-size:var(--sbb-text-font-size-xs);letter-spacing:var(--sbb-letter-spacing-text);line-height:var(--sbb-typo-line-height-text);align-items:center;gap:var(--sbb-tag-gap);padding-inline:var(--sbb-tag-padding-inline);cursor:var(--sbb-tag-cursor,var(--sbb-cursor-pointer));border-radius:var(--sbb-tag-border-radius);color:var(--sbb-tag-text-color);transition:color var(--sbb-tag-animation-duration) var(--sbb-tag-animation-easing);-webkit-tap-highlight-color:transparent;user-select:none;pointer-events:var(--sbb-tag-pointer-events,unset);display:flex;position:relative}.sbb-tag:before{content:"";inset:var(--sbb-tag-inset,0);background-color:var(--sbb-tag-background-color);border:var(--sbb-tag-border-width) var(--sbb-tag-border-style) var(--sbb-tag-border-color);border-radius:var(--sbb-tag-border-radius);transition-duration:var(--sbb-tag-animation-duration);transition-timing-function:var(--sbb-tag-animation-easing);transition-property:inset,background-color,border-color,box-shadow;position:absolute}:host(:focus-visible) .sbb-tag:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}.sbb-tag__icon{height:calc(var(--sbb-typo-line-height-text) * 1em);flex-shrink:0;align-items:center;display:flex}:host(:not(:is(:state(slotted-icon),[state--slotted-icon]),:is(:state(has-icon-name),[state--has-icon-name]))) .sbb-tag__icon{display:none}.sbb-tag__text{white-space:nowrap;text-overflow:ellipsis;font-weight:700;overflow:hidden}.sbb-tag__amount{color:var(--sbb-tag-amount-color)}:host(:not(:is(:state(slotted-amount),[state--slotted-amount]),[amount])) .sbb-tag__amount{display:none}.sbb-tag--shift{transition:transform var(--sbb-tag-animation-duration) var(--sbb-tag-animation-easing);transform:var(--sbb-tag-content-shift,0);will-change:transform}
5
5
  `;let b=(()=>{let r=g(c(o)),s,l=[],u=[],p,m=[],_=[],v,b=[],x=[],S,C=[],w=[];return class extends r{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;s=[a()],p=[f(),a({reflect:!0,converter:h})],v=[f(),a({reflect:!1,type:Boolean})],S=[a({reflect:!0})],e(this,null,s,{kind:`accessor`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},l,u),e(this,null,p,{kind:`accessor`,name:`amount`,static:!1,private:!1,access:{has:e=>`amount`in e,get:e=>e.amount,set:(e,t)=>{e.amount=t}},metadata:t},m,_),e(this,null,v,{kind:`accessor`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:t},b,x),e(this,null,S,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},C,w),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tag`}static{this.styles=[i(y)]}static{this.events={input:`input`,didChange:`didChange`,change:`change`}}#e;get value(){return this.#e}set value(e){this.#e=e}#t;get amount(){return this.#t}set amount(e){this.#t=e}#n;get checked(){return this.#n}set checked(e){this.#n=e}#r;get size(){return this.#r}set size(e){this.#r=e}constructor(){super(),this.#e=t(this,l,null),this.#t=(t(this,u),t(this,m,``)),this.#n=(t(this,_),t(this,b,!1)),this.#r=(t(this,x),t(this,C,null)),this._checkedChangedByUser=(t(this,w),!1),this.addEventListener?.(`click`,()=>this._handleClick()),this.addController(new d(this,()=>this._tagGroup(),{multiple:e=>this._updateAriaRole(e),size:e=>{this.size=e.size}})),this._updateCheckedState()}_updateCheckedState(){this.toggleState(`checked`,this.checked),this.updateFormValue(),this._updateAriaRole()}_tagGroup(){return this.closest?.(`sbb-tag-group`)??null}_updateAriaRole(e=this._tagGroup()){e&&!e.multiple?(this.internals.role=`radio`,this.internals.ariaChecked=`${this.checked}`,this.internals.ariaPressed=null):(this.internals.role=`button`,this.internals.ariaChecked=null,this.internals.ariaPressed=`${this.checked}`)}isDisabledExternally(){return this._tagGroup()?.disabled??!1}_handleClick(){if(this.disabled)return;let e=this._tagGroup();e&&!e.multiple&&this.checked||(this._setCheckedFromUser(!this.checked),this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})))}_setCheckedFromUser(e){this.checked!==e&&(this._checkedChangedByUser=!0,this.checked=e)}_dispatchChangeEvents(){this.dispatchEvent(new Event(`change`,{bubbles:!0})),this.dispatchEvent(new Event(`didChange`,{bubbles:!0}))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),e===`checked`&&this._updateCheckedState()}willUpdate(e){super.willUpdate(e);let t=this._checkedChangedByUser;if(e.has(`checked`)){let e=this._tagGroup();e&&!e.multiple&&(this.checked?e.tags.forEach(e=>{e.tabIndex=e===this?0:-1,e!==this&&(t?e._setCheckedFromUser(!1):e.checked=!1)}):e.tags.some(e=>e.checked)||e.updateExclusiveTabIndex())}}updated(e){super.updated(e),e.has(`checked`)&&(this._checkedChangedByUser&&=(this._dispatchChangeEvents(),!1))}formResetCallback(){this.checked=this.hasAttribute(`checked`)}formStateRestoreCallback(e,t){e&&(this.checked=e===`true`)}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}formState(){return`${this.checked}`}renderTemplate(){return n`