@digdir/designsystemet-web 1.12.1 → 1.13.0

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/dist/umd/index.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Designsystemet={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function n(){document.addEventListener(`invoke`,e=>{e.type==`invoke`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0),document.addEventListener(`command`,e=>{e.type==`command`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0);function e(e,t,n=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:n})}function t(e){return e&&typeof e.getRootNode==`function`?e.getRootNode():e&&e.parentNode?t(e.parentNode):e}let n=new WeakMap,r=new WeakMap;class i extends Event{constructor(e,t={}){super(e,t);let{source:i,command:a}=t;if(i!=null&&!(i instanceof Element))throw TypeError(`source must be an element`);n.set(this,i||null),r.set(this,a===void 0?``:String(a))}get[Symbol.toStringTag](){return`CommandEvent`}get source(){if(!n.has(this))throw TypeError(`illegal invocation`);let e=n.get(this);if(!(e instanceof Element))return null;let r=t(e);return r===t(this.target||document)?e:r.host}get command(){if(!r.has(this))throw TypeError(`illegal invocation`);return r.get(this)}get action(){throw Error(`CommandEvent#action was renamed to CommandEvent#command`)}get invoker(){throw Error(`CommandEvent#invoker was renamed to CommandEvent#source`)}}e(i.prototype,`source`),e(i.prototype,`command`);class a extends Event{constructor(e,t={}){throw super(e,t),Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let o=new WeakMap;function s(e){Object.defineProperties(e.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(this.hasAttribute(`invokeaction`))throw TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute(`invoketarget`))throw TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(e===null)this.removeAttribute(`commandfor`),o.delete(this);else if(e instanceof Element){this.setAttribute(`commandfor`,``);let n=t(e);t(this)===n||n===this.ownerDocument?o.set(this,e):o.delete(this)}else throw TypeError(`commandForElement must be an element or null`)},get(){if(this.localName!==`button`)return null;if(this.hasAttribute(`invokeaction`)||this.hasAttribute(`invoketarget`))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute(`type`)!==`button`)return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=o.get(this);if(e)return e.isConnected?e:(o.delete(this),null);let n=t(this),r=this.getAttribute(`commandfor`);return(n instanceof Document||n instanceof ShadowRoot)&&r&&n.getElementById(r)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute(`command`)||``;if(e.startsWith(`--`))return e;let t=e.toLowerCase();switch(t){case`show-modal`:case`request-close`:case`close`:case`toggle-popover`:case`hide-popover`:case`show-popover`:return t}return``},set(e){this.setAttribute(`command`,e)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw Error(`invokeAction is deprecated. It has been renamed to command`)},set(e){throw Error(`invokeAction is deprecated. It has been renamed to command`)}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw Error(`invokeTargetElement is deprecated. It has been renamed to command`)},set(e){throw Error(`invokeTargetElement is deprecated. It has been renamed to command`)}}})}let c=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return u.takeRecords(),c.get(this)||null},set(e){let t=c.get(this)||null;t&&this.removeEventListener(`command`,t),c.set(this,typeof e==`object`||typeof e==`function`?e:null),typeof e==`function`&&this.addEventListener(`command`,e)}}});function l(e){for(let t of e)t.oncommand=Function(`event`,t.getAttribute(`oncommand`))}let u=new MutationObserver(e=>{for(let t of e){let{target:e}=t;t.type===`childList`?l(e.querySelectorAll(`[oncommand]`)):l([e])}});u.observe(document,{subtree:!0,childList:!0,attributeFilter:[`oncommand`]}),l(document.querySelectorAll(`[oncommand]`));let d=new WeakSet;function f(e){if(d.has(e)||(d.add(e),e.defaultPrevented)||e.type!==`click`)return;let t=e.target.closest(`button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]`);if(t&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),t.matches(`input`)))throw Error("Input elements no longer support `commandfor`");let n=e.target.closest(`button[commandfor], button[command]`);if(!n)return;if(n.form&&n.getAttribute(`type`)!==`button`)throw e.preventDefault(),Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(n.hasAttribute(`command`)!==n.hasAttribute(`commandfor`)){let e=n.hasAttribute(`command`)?`command`:`commandfor`,t=n.hasAttribute(`command`)?`commandfor`:`command`;throw Error(`Element with ${e} attribute must also have a ${t} attribute to function.`)}if(n.command!==`show-popover`&&n.command!==`hide-popover`&&n.command!==`toggle-popover`&&n.command!==`show-modal`&&n.command!==`request-close`&&n.command!==`close`&&!n.command.startsWith(`--`)){console.warn(`"${n.command}" is not a valid command value. Custom commands must begin with --`);return}let r=n.commandForElement;if(!r)return;let a=new i(`command`,{command:n.command,source:n,cancelable:!0});if(r.dispatchEvent(a),a.defaultPrevented)return;let o=a.command.toLowerCase();if(r.popover){let e=!r.matches(`:popover-open`);e&&(o===`toggle-popover`||o===`show-popover`)?r.showPopover({source:n}):!e&&o===`hide-popover`&&r.hidePopover()}else if(r.localName===`dialog`){let e=!r.hasAttribute(`open`);e&&o==`show-modal`?r.showModal():!e&&o==`close`?r.close(n.value?n.value:void 0):!e&&o==`request-close`&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let e=new Event(`cancel`,{cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||this.close()}),r.requestClose(n.value?n.value:void 0))}}function p(e){e.addEventListener(`click`,f,!0)}function m(e,t){let n=e.prototype.attachShadow;e.prototype.attachShadow=function(e){let r=n.call(this,e);return t(r),r};let r=e.prototype.attachInternals;e.prototype.attachInternals=function(){let e=r.call(this);return e.shadowRoot&&t(e.shadowRoot),e}}s(HTMLButtonElement),m(HTMLElement,e=>{p(e),u.observe(e,{attributeFilter:[`oncommand`]}),l(e.querySelectorAll(`[oncommand]`))}),p(document),Object.assign(globalThis,{CommandEvent:i,InvokeEvent:a})}let r={passive:!0,capture:!0},i=()=>typeof window<`u`&&typeof document<`u`,a=()=>i()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),o=typeof HTMLElement>`u`?class{}:HTMLElement;function s(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let c=(e,...t)=>typeof window>`u`||window.dsWarnings===!1||console.warn(`Designsystemet: ${e}`,...t),l=(e,t,n)=>n===void 0?e.getAttribute(t)??null:(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),u=/^["']|["']$/g,d=(e,t)=>{let n=l(e,t);return n||=getComputedStyle(e).getPropertyValue(`--_ds-${t}`).replace(u,``).trim()||null,n||c(`Missing ${t} on:`,e),n},f=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>p(e,...t)},p=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},m=(e,t)=>{i()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,t()))},h=!1,g=(e,t,n)=>{let r=0,i=()=>{if(!e.isConnected)return a();t(o),o.takeRecords(),r=0},a=()=>o?.disconnect?.(),o=new MutationObserver(()=>{!h&&!r&&(r=requestAnimationFrame(i))});return o.observe(e,n),requestAnimationFrame(i),a},_=(e,t)=>{h=!0,e.textContent=t,requestAnimationFrame(v)},v=()=>{h=!1},y=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))l(n,e,r);return n},b={define:(e,t)=>!i()||window.customElements.get(e)||window.customElements.define(e,t)},ee=0,te=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function x(e){return e&&!e.id&&(e.id=`${te}${++ee}`),e?.id||``}var S=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,C=S&&/android/i.test(navigator.userAgent),ne=S&&/firefox/i.test(navigator.userAgent);S&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);function re(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var ie=`__uDetailsPolyfillSummarys`;if(S&&C&&ne&&!window[ie]){window[ie]=document.getElementsByTagName(`summary`);let e=()=>{if(window[ie])for(let e of window[ie]){let t=e.parentElement;re(e,`role`,`button`),re(e,`aria-expanded`,`${!!t&&!!t.open}`)}};requestAnimationFrame(e),new MutationObserver(e).observe(document,{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let ae=`:click-delegate-hover`,oe=`data-clickdelegatefor`,se=`[${oe}]`,ce=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=e.isTrusted&&e.button<2&&de(e);if(!(!n||n.contains(e.target))){if(t&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);e.stopImmediatePropagation(),n.click()}},le,ue=e=>{let t=de(e);le!==t&&(le&&le.classList.remove(ae),t&&t.classList.add(ae),le=t)},de=({target:e})=>{let t=(e instanceof Element?e.closest(se):null)?.getAttribute(oe),n=t&&document.getElementById(t)||void 0,r=n&&e.closest(`a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]`);return(!r||r===n)&&!n?.disabled?n:void 0};m(`clickdelegatefor`,()=>[f(window,`click auxclick`,ce,!0),f(document,`mouseover`,ue,r)]);let fe=!1,pe=({type:e,target:t,clientX:n=0,clientY:r=0})=>{if(e===`pointerdown`){let e=t?.closest?.(`dialog`)?.getBoundingClientRect();fe=!!(e&&e.top<=r&&r<=e.bottom&&e.left<=n&&n<=e.right)}else{let e=t instanceof HTMLDialogElement&&!fe&&l(t,`closedby`)===`any`;fe=!1,e&&requestAnimationFrame(()=>t.open&&t.close())}},me=()=>{for(let e of document.querySelectorAll(`button[command="show-modal"]`))l(e,`aria-haspopup`,`dialog`)},he=({command:e,target:t})=>e===`--show-non-modal`&&t instanceof HTMLDialogElement&&t.show();m(`dialog`,()=>[f(document,`command`,he,r),f(document,`pointerdown pointerup`,pe,r),g(document,me,{attributeFilter:[`command`],attributes:!0,childList:!0,subtree:!0})]);let w=Math.min,T=Math.max,ge=Math.round,_e=Math.floor,E=e=>({x:e,y:e}),ve={left:`right`,right:`left`,bottom:`top`,top:`bottom`},ye={start:`end`,end:`start`};function be(e,t,n){return T(e,w(t,n))}function D(e,t){return typeof e==`function`?e(t):e}function O(e){return e.split(`-`)[0]}function xe(e){return e.split(`-`)[1]}function Se(e){return e===`x`?`y`:`x`}function Ce(e){return e===`y`?`height`:`width`}let we=new Set([`top`,`bottom`]);function k(e){return we.has(O(e))?`y`:`x`}function Te(e){return Se(k(e))}function Ee(e,t,n){n===void 0&&(n=!1);let r=xe(e),i=Te(e),a=Ce(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fe(o)),[o,Fe(o)]}function De(e){let t=Fe(e);return[Oe(e),t,Oe(t)]}function Oe(e){return e.replace(/start|end/g,e=>ye[e])}let ke=[`left`,`right`],Ae=[`right`,`left`],je=[`top`,`bottom`],Me=[`bottom`,`top`];function Ne(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ae:ke:t?ke:Ae;case`left`:case`right`:return t?je:Me;default:return[]}}function Pe(e,t,n,r){let i=xe(e),a=Ne(O(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Oe)))),a}function Fe(e){return e.replace(/left|right|bottom|top/g,e=>ve[e])}function Ie(e){return{top:0,right:0,bottom:0,left:0,...e}}function Le(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ie(e)}function Re(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ze(e,t,n){let{reference:r,floating:i}=e,a=k(t),o=Te(t),s=Ce(o),c=O(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(xe(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Be(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=D(t,e),p=Le(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Re(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Re(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}let Ve=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ze(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??Be},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=ze(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},He=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=D(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=O(r),_=k(o),v=O(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fe(o)]:De(o)),ee=p!==`none`;!d&&ee&&b.push(...Pe(o,m,p,y));let te=[o,...b],x=await s.detectOverflow(t,h),S=[],C=i.flip?.overflows||[];if(l&&S.push(x[g]),u){let e=Ee(r,a,y);S.push(x[e[0]],x[e[1]])}if(C=[...C,{placement:r,overflows:S}],!S.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=te[e];if(t&&(!(u===`alignment`&&_!==k(t))||C.every(e=>k(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=C.filter(e=>{if(ee){let t=k(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Ue=new Set([`left`,`top`]);async function We(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=O(n),s=xe(n),c=k(n)===`y`,l=Ue.has(o)?-1:1,u=a&&c?-1:1,d=D(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let Ge=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await We(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=D(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=k(O(i)),p=Se(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=be(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=be(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},qe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=D(e,t),u={x:n,y:r},d=k(i),f=Se(d),p=u[f],m=u[d],h=D(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ue.has(O(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=D(e,t),u=await o.detectOverflow(t,l),d=O(i),f=xe(i),p=k(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=w(h-u[g],v),ee=w(m-u[_],y),te=!t.middlewareData.shift,x=b,S=ee;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(x=v),te&&!f){let e=T(u.left,0),t=T(u.right,0),n=T(u.top,0),r=T(u.bottom,0);p?S=m-2*(e!==0||t!==0?e+t:T(u.left,u.right)):x=h-2*(n!==0||r!==0?n+r:T(u.top,u.bottom))}await c({...t,availableWidth:S,availableHeight:x});let C=await o.getDimensions(s.floating);return m!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function Ye(){return typeof window<`u`}function A(e){return Xe(e)?(e.nodeName||``).toLowerCase():`#document`}function j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function M(e){return((Xe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Xe(e){return Ye()?e instanceof Node||e instanceof j(e).Node:!1}function N(e){return Ye()?e instanceof Element||e instanceof j(e).Element:!1}function P(e){return Ye()?e instanceof HTMLElement||e instanceof j(e).HTMLElement:!1}function Ze(e){return!Ye()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof j(e).ShadowRoot}let Qe=new Set([`inline`,`contents`]);function F(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Qe.has(i)}let $e=new Set([`table`,`td`,`th`]);function et(e){return $e.has(A(e))}let tt=[`:popover-open`,`:modal`];function nt(e){return tt.some(t=>{try{return e.matches(t)}catch{return!1}})}let rt=[`transform`,`translate`,`scale`,`rotate`,`perspective`],it=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],at=[`paint`,`layout`,`strict`,`content`];function ot(e){let t=ct(),n=N(e)?L(e):e;return rt.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||it.some(e=>(n.willChange||``).includes(e))||at.some(e=>(n.contain||``).includes(e))}function st(e){let t=R(e);for(;P(t)&&!I(t);){if(ot(t))return t;if(nt(t))return null;t=R(t)}return null}function ct(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}let lt=new Set([`html`,`body`,`#document`]);function I(e){return lt.has(A(e))}function L(e){return j(e).getComputedStyle(e)}function ut(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R(e){if(A(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ze(e)&&e.host||M(e);return Ze(t)?t.host:t}function dt(e){let t=R(e);return I(t)?e.ownerDocument?e.ownerDocument.body:e.body:P(t)&&F(t)?t:dt(t)}function z(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dt(e),i=r===e.ownerDocument?.body,a=j(r);if(i){let e=ft(a);return t.concat(a,a.visualViewport||[],F(r)?r:[],e&&n?z(e):[])}return t.concat(r,z(r,[],n))}function ft(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pt(e){let t=L(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=P(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ge(n)!==a||ge(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function mt(e){return N(e)?e:e.contextElement}function B(e){let t=mt(e);if(!P(t))return E(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=pt(t),o=(a?ge(n.width):n.width)/r,s=(a?ge(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let ht=E(0);function gt(e){let t=j(e);return!ct()||!t.visualViewport?ht:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _t(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==j(e)?!1:t}function V(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=mt(e),o=E(1);t&&(r?N(r)&&(o=B(r)):o=B(e));let s=_t(a,n,r)?gt(a):E(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=j(a),t=r&&N(r)?j(r):r,n=e,i=ft(n);for(;i&&r&&t!==n;){let e=B(i),t=i.getBoundingClientRect(),r=L(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=j(i),i=ft(n)}}return Re({width:u,height:d,x:c,y:l})}function vt(e,t){let n=ut(e).scrollLeft;return t?t.left+n:V(M(e)).left+n}function yt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vt(e,n),y:n.top+t.scrollTop}}function bt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=M(r),s=t?nt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=E(1),u=E(0),d=P(r);if((d||!d&&!a)&&((A(r)!==`body`||F(o))&&(c=ut(r)),P(r))){let e=V(r);l=B(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yt(o,c):E(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function xt(e){return Array.from(e.getClientRects())}function St(e){let t=M(e),n=ut(e),r=e.ownerDocument.body,i=T(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=T(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+vt(e),s=-n.scrollTop;return L(r).direction===`rtl`&&(o+=T(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Ct(e,t){let n=j(e),r=M(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ct();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=vt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}let wt=new Set([`absolute`,`fixed`]);function Tt(e,t){let n=V(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=P(e)?B(e):E(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Et(e,t,n){let r;if(t===`viewport`)r=Ct(e,n);else if(t===`document`)r=St(M(e));else if(N(t))r=Tt(t,n);else{let n=gt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Re(r)}function Dt(e,t){let n=R(e);return n===t||!N(n)||I(n)?!1:L(n).position===`fixed`||Dt(n,t)}function Ot(e,t){let n=t.get(e);if(n)return n;let r=z(e,[],!1).filter(e=>N(e)&&A(e)!==`body`),i=null,a=L(e).position===`fixed`,o=a?R(e):e;for(;N(o)&&!I(o);){let t=L(o),n=ot(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&wt.has(i.position)||F(o)&&!n&&Dt(e,o))?r=r.filter(e=>e!==o):i=t,o=R(o)}return t.set(e,r),r}function kt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?nt(t)?[]:Ot(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Et(t,n,i);return e.top=T(r.top,e.top),e.right=w(r.right,e.right),e.bottom=w(r.bottom,e.bottom),e.left=T(r.left,e.left),e},Et(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function At(e){let{width:t,height:n}=pt(e);return{width:t,height:n}}function jt(e,t,n){let r=P(t),i=M(t),a=n===`fixed`,o=V(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=E(0);function l(){c.x=vt(i)}if(r||!r&&!a)if((A(t)!==`body`||F(i))&&(s=ut(t)),r){let e=V(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?yt(i,s):E(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Mt(e){return L(e).position===`static`}function Nt(e,t){if(!P(e)||L(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return M(e)===n&&(n=n.ownerDocument.body),n}function Pt(e,t){let n=j(e);if(nt(e))return n;if(!P(e)){let t=R(e);for(;t&&!I(t);){if(N(t)&&!Mt(t))return t;t=R(t)}return n}let r=Nt(e,t);for(;r&&et(r)&&Mt(r);)r=Nt(r,t);return r&&I(r)&&Mt(r)&&!ot(r)?n:r||st(e)||n}let Ft=async function(e){let t=this.getOffsetParent||Pt,n=this.getDimensions,r=await n(e.floating);return{reference:jt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function It(e){return L(e).direction===`rtl`}let Lt={convertOffsetParentRelativeRectToViewportRelativeRect:bt,getDocumentElement:M,getClippingRect:kt,getOffsetParent:Pt,getElementRects:Ft,getClientRects:xt,getDimensions:At,getScale:B,isElement:N,isRTL:It};function Rt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zt(e,t){let n=null,r,i=M(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=_e(d),h=_e(i.clientWidth-(u+f)),g=_e(i.clientHeight-(d+p)),_=_e(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:T(0,w(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Rt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Bt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=mt(e),u=i||a?[...l?z(l):[],...z(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?zt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?V(e):null;c&&g();function g(){let t=V(e);h&&!Rt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}let Vt=Ge,Ht=Ke,Ut=He,Wt=Je,Gt=qe,Kt=(e,t,n)=>{let r=new Map,i={platform:Lt,...n},a={...i.platform,_c:r};return Ve(e,t,{...i,platform:a})},qt=`data-placement`,Jt=`data-autoplacement`,H=new Map;function Yt(e){let{newState:t,oldState:n,target:r,source:i=e.detail}=e,a=r instanceof HTMLElement&&Qt(r,`--_ds-floating`);if(!a)return;if(t===`closed`)return H.get(r)?.();if(!i){let e=r.getRootNode(),t=`[popovertarget="${r.id}"],[commandfor="${r.id}"]`;i=r.id&&e?.querySelector?.(t)||void 0}if(!i||i===r||n&&n===t)return;let o=Qt(r,`--_ds-floating-overscroll`),s=l(r,qt)||l(i,qt)||a,c=l(r,Jt)||l(i,Jt),u=parseFloat(getComputedStyle(r,`::before`).height)||0,d=s.match(/left|right/gi)?`Height`:`Width`,f=i[`offset${d}`]/2+u;if(s===`none`)return;let p={strategy:`absolute`,placement:s,middleware:[Vt(u||0),Ht({padding:10,limiter:Gt({offset:{mainAxis:f}})}),$t(),...c===`false`?[]:[Ut({padding:10,crossAxis:!1})],...o?[Wt({apply({availableHeight:e}){o===`fit`&&(r.style.width=`${i.clientWidth}px`),r.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},m=Bt(i,r,async()=>{if(!i?.isConnected)return H.get(r)?.();let{x:e,y:t}=await Kt(i,r,p);r.style.translate=`${e}px ${t}px`});H.set(r,()=>H.delete(r)&&m())}let Xt,Zt=({type:e})=>{if(e===`mousedown`&&(Xt=!1),e===`scroll`&&Xt===!1&&(Xt=!0),e===`mouseup`&&Xt)for(let[e]of H)e.showPopover()};m(`popover`,()=>[f(document,`mousedown scroll mouseup`,Zt,!0),f(document,`toggle ds-toggle-source`,Yt,r)]);let Qt=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),$t=()=>({name:`arrowPseudo`,fn(e){let t=e.elements.floating,n=e.rects.reference,r=`${Math.round(n.width/2+n.x-e.x)}px`,i=`${Math.round(n.height/2+n.y-e.y)}px`;return t.style.setProperty(`--_ds-floating-arrow-x`,r),t.style.setProperty(`--_ds-floating-arrow-y`,i),l(t,`data-floating`,e.placement),e}}),en=e=>(e instanceof HTMLSelectElement||e instanceof HTMLInputElement)&&(e.hasAttribute(`readonly`)||l(e,`aria-readonly`)===`true`),tn=e=>{if(e.key!==`Tab`&&en(e.target)&&(e.preventDefault(),e.key?.startsWith(`Arrow`)&&l(e.target,`type`)===`radio`)){let t=document.querySelectorAll(`input[name="${e.target.name}"]`),n=e.key?.match(/Arrow(Right|Down)/)?1:-1;t[(t.length+[...t].indexOf(e.target)+n)%t.length]?.focus()}},nn=e=>{let t=e.target?.closest?.(`label`)?.control||e.target;en(t)&&(e.preventDefault(),t.focus())},rn=e=>{e.target instanceof HTMLSelectElement&&en(e.target)&&e.preventDefault()};m(`readonly`,()=>[f(document,`keydown`,tn),f(document,`click`,nn),f(document,`mousedown`,rn)]);let an=`data-toggle-group`,on=`[${an}]`,sn=s(()=>{for(let e of document.querySelectorAll(on))l(e,`aria-label`,d(e,an))},0),cn=e=>{let t=e.target instanceof HTMLInputElement&&e.target.closest(on);if(t&&(e.key===`Enter`&&e.target.click(),e.key?.startsWith(`Arrow`))){e.preventDefault?.();let n=t.getElementsByTagName(`input`),r=[...n].indexOf(e.target),i=e.key.match(/Arrow(Right|Down)/)?1:-1;n[(n.length+r+i)%n.length]?.focus()}};m(`toggle-group`,()=>[f(document,`keydown`,cn),g(document,sn,{attributeFilter:[an],attributes:!0,childList:!0,subtree:!0})]);let U,ln,un=0,dn=0,W=`data-tooltip`,fn=`data-color`,pn=`aria-label`,mn=`aria-description`,hn=`[${fn}]`,gn=`[${W}]`,_n=`data-color-scheme`,vn=`[${_n}]`,yn=e=>{e&&!(e instanceof HTMLElement)&&c(`setTooltipElement expects an HTMLElement, got: `,e),U=e||void 0},bn=s(()=>{for(let e of document.querySelectorAll(gn)){let t=e.getAttribute(pn)||e.getAttribute(mn),n=e.getAttribute(W)||d(e,W);if(t!==n){let t=l(e,`role`)!==`img`&&e.textContent?.trim();l(e,W,n),l(e,pn,t?null:n),l(e,mn,t?n:null),e.matches(`a,button,input,label,select,textarea,[tabindex]`)||c(`Missing tabindex="0" attribute on: `,e)}}},0),xn=({type:e,target:t})=>{if(clearTimeout(un),t===U)return;if(e===`mouseover`&&!ln){un=setTimeout(xn,300,{target:t});return}let n=t?.closest?.(`[${W}]`);if(n===ln)return;if(!n)return Sn();U||=y(`div`,{class:`ds-tooltip`}),U.isConnected||document.body.appendChild(U);let r=n.closest(hn),i=n.closest(vn),a=r!==i&&r?.contains(i);clearTimeout(dn),l(U,`popover`,`manual`),l(U,_n,i?.getAttribute(_n)||null),l(U,fn,a&&r?.getAttribute(fn)||null),_(U,l(n,W)),U.showPopover(),U.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n})),ln=n},Sn=()=>U?.isConnected&&U.popover&&U.hidePopover(),Cn=e=>{if(e?.type===`keydown`)return e?.key===`Escape`&&Sn();e?e.target===U&&e.newState===`closed`&&(dn=setTimeout(Cn,300)):ln=void 0};m(`tooltip`,()=>[f(document,`blur focus mouseover`,xn,r),f(document,`toggle keydown`,Cn,r),g(document,bn,{attributeFilter:[W],attributes:!0,childList:!0,subtree:!0})]);var wn=Object.defineProperty,Tn=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,On=(e,t,n)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kn=(e,t)=>{for(var n in t||={})En.call(t,n)&&On(e,n,t[n]);if(Tn)for(var n of Tn(t))Dn.call(t,n)&&On(e,n,t[n]);return e},An=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,jn=An&&/android/i.test(navigator.userAgent),Mn=An&&/iPad|iPhone|iPod/.test(navigator.userAgent);An&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Nn=`${jn?`data`:`aria`}-labelledby`,Pn=`:host(:not([hidden])) { display: block }`,Fn=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,In=typeof HTMLElement>`u`?class{}:HTMLElement;function G(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var Ln=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},Rn=(e,...t)=>Ln(`add`,e,t),zn=(e,...t)=>Ln(`remove`,e,t),Bn=(e,t)=>e.shadowRoot||e.attachShadow({mode:`open`}).append(Kn(`slot`),Kn(`style`,t)),Vn=new WeakMap,Hn=(e,t)=>{if(t===void 0)return Vn.get(e);try{Vn.get(e).disconnect(),Vn.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),Vn.set(e,n)}},Un=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},Wn=0,Gn=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++Wn).toString(32)}`,e.id):``,Kn=(e,t,n)=>{let r=document.createElement(e);return t&&(r[e===`style`?`textContent`:`innerHTML`]=t),r},qn={define:(e,t)=>!An||window.customElements.get(e)||window.customElements.define(e,t)},K,Jn=0,Yn=e=>{K||(K=Kn(`div`),K.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,G(K,`aria-live`,`assertive`)),K.isConnected||document.body.append(K),e&&(K.textContent=`${e}${Jn++%2?`\xA0`:``}`)},Xn=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},Zn=!1,Qn=e=>(e?.type===`mouseup`&&(Zn=!1),e?.type===`mousedown`&&(Zn=!0,Rn(document,`mouseup`,Qn,{once:!0})),Zn),$n=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,er=`disabled`,tr=`selected`,nr=class extends In{static get observedAttributes(){return[er,tr]}connectedCallback(){Mn||(this.tabIndex=-1),this.hasAttribute(`role`)||G(this,`role`,`option`),this.attributeChangedCallback()}attributeChangedCallback(){G(this,`aria-disabled`,`${this.disabled}`),G(this,`aria-selected`,`${this.selected}`)}get defaultSelected(){return this[tr]}set defaultSelected(e){this[tr]=e}get disabled(){return G(this,er)!==null}set disabled(e){G(this,er,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return G(this,`label`)??this.text}set label(e){G(this,`label`,e)}get selected(){return G(this,tr)!==null}set selected(e){G(this,tr,e?``:null)}get text(){return this.textContent?.trim()||``}set text(e){this.textContent=e}get value(){return G(this,`value`)??this.text}set value(e){G(this,`value`,e)}};qn.define(`u-option`,nr);var rr=`${Pn}
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Designsystemet={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function n(){document.addEventListener(`invoke`,e=>{e.type==`invoke`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0),document.addEventListener(`command`,e=>{e.type==`command`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0);function e(e,t,n=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:n})}function t(e){return e&&typeof e.getRootNode==`function`?e.getRootNode():e&&e.parentNode?t(e.parentNode):e}let n=new WeakMap,r=new WeakMap;class i extends Event{constructor(e,t={}){super(e,t);let{source:i,command:a}=t;if(i!=null&&!(i instanceof Element))throw TypeError(`source must be an element`);n.set(this,i||null),r.set(this,a===void 0?``:String(a))}get[Symbol.toStringTag](){return`CommandEvent`}get source(){if(!n.has(this))throw TypeError(`illegal invocation`);let e=n.get(this);if(!(e instanceof Element))return null;let r=t(e);return r===t(this.target||document)?e:r.host}get command(){if(!r.has(this))throw TypeError(`illegal invocation`);return r.get(this)}get action(){throw Error(`CommandEvent#action was renamed to CommandEvent#command`)}get invoker(){throw Error(`CommandEvent#invoker was renamed to CommandEvent#source`)}}e(i.prototype,`source`),e(i.prototype,`command`);class a extends Event{constructor(e,t={}){throw super(e,t),Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let o=new WeakMap;function s(e){Object.defineProperties(e.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(this.hasAttribute(`invokeaction`))throw TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute(`invoketarget`))throw TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(e===null)this.removeAttribute(`commandfor`),o.delete(this);else if(e instanceof Element){this.setAttribute(`commandfor`,``);let n=t(e);t(this)===n||n===this.ownerDocument?o.set(this,e):o.delete(this)}else throw TypeError(`commandForElement must be an element or null`)},get(){if(this.localName!==`button`)return null;if(this.hasAttribute(`invokeaction`)||this.hasAttribute(`invoketarget`))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute(`type`)!==`button`)return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=o.get(this);if(e)return e.isConnected?e:(o.delete(this),null);let n=t(this),r=this.getAttribute(`commandfor`);return(n instanceof Document||n instanceof ShadowRoot)&&r&&n.getElementById(r)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute(`command`)||``;if(e.startsWith(`--`))return e;let t=e.toLowerCase();switch(t){case`show-modal`:case`request-close`:case`close`:case`toggle-popover`:case`hide-popover`:case`show-popover`:return t}return``},set(e){this.setAttribute(`command`,e)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw Error(`invokeAction is deprecated. It has been renamed to command`)},set(e){throw Error(`invokeAction is deprecated. It has been renamed to command`)}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw Error(`invokeTargetElement is deprecated. It has been renamed to command`)},set(e){throw Error(`invokeTargetElement is deprecated. It has been renamed to command`)}}})}let c=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return u.takeRecords(),c.get(this)||null},set(e){let t=c.get(this)||null;t&&this.removeEventListener(`command`,t),c.set(this,typeof e==`object`||typeof e==`function`?e:null),typeof e==`function`&&this.addEventListener(`command`,e)}}});function l(e){for(let t of e)t.oncommand=Function(`event`,t.getAttribute(`oncommand`))}let u=new MutationObserver(e=>{for(let t of e){let{target:e}=t;t.type===`childList`?l(e.querySelectorAll(`[oncommand]`)):l([e])}});u.observe(document,{subtree:!0,childList:!0,attributeFilter:[`oncommand`]}),l(document.querySelectorAll(`[oncommand]`));let d=new WeakSet;function f(e){if(d.has(e)||(d.add(e),e.defaultPrevented)||e.type!==`click`)return;let t=e.target.closest(`button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]`);if(t&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),t.matches(`input`)))throw Error("Input elements no longer support `commandfor`");let n=e.target.closest(`button[commandfor], button[command]`);if(!n)return;if(n.form&&n.getAttribute(`type`)!==`button`)throw e.preventDefault(),Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(n.hasAttribute(`command`)!==n.hasAttribute(`commandfor`)){let e=n.hasAttribute(`command`)?`command`:`commandfor`,t=n.hasAttribute(`command`)?`commandfor`:`command`;throw Error(`Element with ${e} attribute must also have a ${t} attribute to function.`)}if(n.command!==`show-popover`&&n.command!==`hide-popover`&&n.command!==`toggle-popover`&&n.command!==`show-modal`&&n.command!==`request-close`&&n.command!==`close`&&!n.command.startsWith(`--`)){console.warn(`"${n.command}" is not a valid command value. Custom commands must begin with --`);return}let r=n.commandForElement;if(!r)return;let a=new i(`command`,{command:n.command,source:n,cancelable:!0});if(r.dispatchEvent(a),a.defaultPrevented)return;let o=a.command.toLowerCase();if(r.popover){let e=!r.matches(`:popover-open`);e&&(o===`toggle-popover`||o===`show-popover`)?r.showPopover({source:n}):!e&&o===`hide-popover`&&r.hidePopover()}else if(r.localName===`dialog`){let e=!r.hasAttribute(`open`);e&&o==`show-modal`?r.showModal():!e&&o==`close`?r.close(n.value?n.value:void 0):!e&&o==`request-close`&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let e=new Event(`cancel`,{cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||this.close()}),r.requestClose(n.value?n.value:void 0))}}function p(e){e.addEventListener(`click`,f,!0)}function m(e,t){let n=e.prototype.attachShadow;e.prototype.attachShadow=function(e){let r=n.call(this,e);return t(r),r};let r=e.prototype.attachInternals;e.prototype.attachInternals=function(){let e=r.call(this);return e.shadowRoot&&t(e.shadowRoot),e}}s(HTMLButtonElement),m(HTMLElement,e=>{p(e),u.observe(e,{attributeFilter:[`oncommand`]}),l(e.querySelectorAll(`[oncommand]`))}),p(document),Object.assign(globalThis,{CommandEvent:i,InvokeEvent:a})}let r={passive:!0,capture:!0},i=()=>typeof window<`u`&&typeof document<`u`,a=()=>i()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),o=typeof HTMLElement>`u`?class{}:HTMLElement;function s(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let c=(e,...t)=>typeof window>`u`||window.dsWarnings===!1||console.warn(`Designsystemet: ${e}`,...t),l=(e,t,n)=>n===void 0?e.getAttribute(t)??null:(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),u=/^["']|["']$/g,d=(e,t)=>{let n=l(e,t);return n||=getComputedStyle(e).getPropertyValue(`--_ds-${t}`).replace(u,``).trim()||null,n||c(`Missing ${t} on:`,e),n},f=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>p(e,...t)},p=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},m=(e,t)=>{i()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,t()))},h=!1,g=(e,t,n)=>{let r=0,i=()=>{if(!e.isConnected)return a();t(o),o.takeRecords(),r=0},a=()=>o?.disconnect?.(),o=new MutationObserver(()=>{!h&&!r&&(r=requestAnimationFrame(i))});return o.observe(e,n),requestAnimationFrame(i),a},_=(e,t)=>{h=!0,e.textContent=t,requestAnimationFrame(v)},v=()=>{h=!1},y=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))l(n,e,r);return n},b={define:(e,t)=>!i()||window.customElements.get(e)||window.customElements.define(e,t)},x=0,ee=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function S(e){return e&&!e.id&&(e.id=`${ee}${++x}`),e?.id||``}let C,w=0,te=0,ne=e=>{clearTimeout(te),C&&_(C,`${e}${w++%2?`\xA0`:``}`),e&&(te=setTimeout(ne,2e3,``))},re=()=>{document.readyState===`complete`&&(C||(C=y(`div`,{"aria-live":`assertive`}),C.style.overflow=`hidden`,C.style.position=`fixed`,C.style.whiteSpace=`nowrap`,C.style.width=`1px`),C.isConnected||document.body.appendChild(C))};m(`announce`,()=>[f(document,`focus mouseover`,re,r)]);var ie=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ae=ie&&/android/i.test(navigator.userAgent),oe=ie&&/firefox/i.test(navigator.userAgent);ie&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);function se(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var ce=`__uDetailsPolyfillSummarys`;if(ie&&ae&&oe&&!window[ce]){window[ce]=document.getElementsByTagName(`summary`);let e=()=>{if(window[ce])for(let e of window[ce]){let t=e.parentElement;se(e,`role`,`button`),se(e,`aria-expanded`,`${!!t&&!!t.open}`)}};requestAnimationFrame(e),new MutationObserver(e).observe(document,{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let le=`:click-delegate-hover`,ue=`data-clickdelegatefor`,de=`[${ue}]`,fe=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=e.isTrusted&&e.button<2&&he(e);if(!(!n||n.contains(e.target))){if(t&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);e.stopImmediatePropagation(),n.click()}},pe,me=e=>{let t=he(e);pe!==t&&(pe&&pe.classList.remove(le),t&&t.classList.add(le),pe=t)},he=({target:e})=>{let t=(e instanceof Element?e.closest(de):null)?.getAttribute(ue),n=t&&document.getElementById(t)||void 0,r=n&&e.closest(`a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]`);return(!r||r===n)&&!n?.disabled?n:void 0};m(`clickdelegatefor`,()=>[f(window,`click auxclick`,fe,!0),f(document,`mouseover`,me,r)]);let ge=!1,_e=({type:e,target:t,clientX:n=0,clientY:r=0})=>{if(e===`pointerdown`){let e=t?.closest?.(`dialog`)?.getBoundingClientRect();ge=!!(e&&e.top<=r&&r<=e.bottom&&e.left<=n&&n<=e.right)}else{let e=t instanceof HTMLDialogElement&&!ge&&l(t,`closedby`)===`any`;ge=!1,e&&requestAnimationFrame(()=>t.open&&t.close())}},ve=()=>{for(let e of document.querySelectorAll(`button[command="show-modal"]`))l(e,`aria-haspopup`,`dialog`)},ye=({command:e,target:t})=>e===`--show-non-modal`&&t instanceof HTMLDialogElement&&t.show();m(`dialog`,()=>[f(document,`command`,ye,r),f(document,`pointerdown pointerup`,_e,r),g(document,ve,{attributeFilter:[`command`],attributes:!0,childList:!0,subtree:!0})]);let T=Math.min,E=Math.max,be=Math.round,xe=Math.floor,D=e=>({x:e,y:e}),Se={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ce(e,t,n){return E(e,T(t,n))}function O(e,t){return typeof e==`function`?e(t):e}function k(e){return e.split(`-`)[0]}function we(e){return e.split(`-`)[1]}function Te(e){return e===`x`?`y`:`x`}function Ee(e){return e===`y`?`height`:`width`}function A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function De(e){return Te(A(e))}function Oe(e,t,n){n===void 0&&(n=!1);let r=we(e),i=De(e),a=Ee(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Le(o)),[o,Le(o)]}function ke(e){let t=Le(e);return[Ae(e),t,Ae(t)]}function Ae(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let je=[`left`,`right`],Me=[`right`,`left`],Ne=[`top`,`bottom`],Pe=[`bottom`,`top`];function Fe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Me:je:t?je:Me;case`left`:case`right`:return t?Ne:Pe;default:return[]}}function Ie(e,t,n,r){let i=we(e),a=Fe(k(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ae)))),a}function Le(e){let t=k(e);return Se[t]+e.slice(t.length)}function Re(e){return{top:0,right:0,bottom:0,left:0,...e}}function ze(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Re(e)}function Be(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ve(e,t,n){let{reference:r,floating:i}=e,a=A(t),o=De(t),s=Ee(o),c=k(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(we(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function He(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=O(t,e),p=ze(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Be(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Be(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}let Ue=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:He},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ve(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ve(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},We=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=O(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=k(r),_=A(o),v=k(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Le(o)]:ke(o)),x=p!==`none`;!d&&x&&b.push(...Ie(o,m,p,y));let ee=[o,...b],S=await s.detectOverflow(t,h),C=[],w=i.flip?.overflows||[];if(l&&C.push(S[g]),u){let e=Oe(r,a,y);C.push(S[e[0]],S[e[1]])}if(w=[...w,{placement:r,overflows:C}],!C.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=ee[e];if(t&&(!(u===`alignment`&&_!==A(t))||w.every(e=>A(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=A(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Ge=new Set([`left`,`top`]);async function Ke(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=k(n),s=we(n),c=A(n)===`y`,l=Ge.has(o)?-1:1,u=a&&c?-1:1,d=O(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let qe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ke(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Je=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=O(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=A(k(i)),p=Te(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ce(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ce(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ye=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=O(e,t),u={x:n,y:r},d=A(i),f=Te(d),p=u[f],m=u[d],h=O(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ge.has(k(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Xe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=O(e,t),u=await o.detectOverflow(t,l),d=k(i),f=we(i),p=A(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=T(h-u[g],v),x=T(m-u[_],y),ee=!t.middlewareData.shift,S=b,C=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=v),ee&&!f){let e=E(u.left,0),t=E(u.right,0),n=E(u.top,0),r=E(u.bottom,0);p?C=m-2*(e!==0||t!==0?e+t:E(u.left,u.right)):S=h-2*(n!==0||r!==0?n+r:E(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:S});let w=await o.getDimensions(s.floating);return m!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function Ze(){return typeof window<`u`}function j(e){return Qe(e)?(e.nodeName||``).toLowerCase():`#document`}function M(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){return((Qe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qe(e){return Ze()?e instanceof Node||e instanceof M(e).Node:!1}function P(e){return Ze()?e instanceof Element||e instanceof M(e).Element:!1}function F(e){return Ze()?e instanceof HTMLElement||e instanceof M(e).HTMLElement:!1}function $e(e){return!Ze()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof M(e).ShadowRoot}function et(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function tt(e){return/^(table|td|th)$/.test(j(e))}function nt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let rt=/transform|translate|scale|rotate|perspective|filter/,it=/paint|layout|strict|content/,I=e=>!!e&&e!==`none`,at;function ot(e){let t=P(e)?R(e):e;return I(t.transform)||I(t.translate)||I(t.scale)||I(t.rotate)||I(t.perspective)||!ct()&&(I(t.backdropFilter)||I(t.filter))||rt.test(t.willChange||``)||it.test(t.contain||``)}function st(e){let t=z(e);for(;F(t)&&!L(t);){if(ot(t))return t;if(nt(t))return null;t=z(t)}return null}function ct(){return at??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),at}function L(e){return/^(html|body|#document)$/.test(j(e))}function R(e){return M(e).getComputedStyle(e)}function lt(e){return P(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(j(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||$e(e)&&e.host||N(e);return $e(t)?t.host:t}function ut(e){let t=z(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&et(t)?t:ut(t)}function B(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ut(e),i=r===e.ownerDocument?.body,a=M(r);if(i){let e=dt(a);return t.concat(a,a.visualViewport||[],et(r)?r:[],e&&n?B(e):[])}else return t.concat(r,B(r,[],n))}function dt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ft(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=F(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=be(n)!==a||be(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pt(e){return P(e)?e:e.contextElement}function V(e){let t=pt(e);if(!F(t))return D(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ft(t),o=(a?be(n.width):n.width)/r,s=(a?be(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let mt=D(0);function ht(e){let t=M(e);return!ct()||!t.visualViewport?mt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==M(e)?!1:t}function H(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pt(e),o=D(1);t&&(r?P(r)&&(o=V(r)):o=V(e));let s=gt(a,n,r)?ht(a):D(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=M(a),t=r&&P(r)?M(r):r,n=e,i=dt(n);for(;i&&r&&t!==n;){let e=V(i),t=i.getBoundingClientRect(),r=R(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=M(i),i=dt(n)}}return Be({width:u,height:d,x:c,y:l})}function _t(e,t){let n=lt(e).scrollLeft;return t?t.left+n:H(N(e)).left+n}function vt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_t(e,n),y:n.top+t.scrollTop}}function yt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=N(r),s=t?nt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=D(1),u=D(0),d=F(r);if((d||!d&&!a)&&((j(r)!==`body`||et(o))&&(c=lt(r)),d)){let e=H(r);l=V(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vt(o,c):D(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function bt(e){return Array.from(e.getClientRects())}function xt(e){let t=N(e),n=lt(e),r=e.ownerDocument.body,i=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+_t(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=E(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function St(e,t){let n=M(e),r=N(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ct();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=_t(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ct(e,t){let n=H(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=F(e)?V(e):D(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wt(e,t,n){let r;if(t===`viewport`)r=St(e,n);else if(t===`document`)r=xt(N(e));else if(P(t))r=Ct(t,n);else{let n=ht(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Be(r)}function Tt(e,t){let n=z(e);return n===t||!P(n)||L(n)?!1:R(n).position===`fixed`||Tt(n,t)}function Et(e,t){let n=t.get(e);if(n)return n;let r=B(e,[],!1).filter(e=>P(e)&&j(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?z(e):e;for(;P(o)&&!L(o);){let t=R(o),n=ot(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||et(o)&&!n&&Tt(e,o))?r=r.filter(e=>e!==o):i=t,o=z(o)}return t.set(e,r),r}function Dt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?nt(t)?[]:Et(t,this._c):[].concat(n),r],o=wt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=wt(t,a[e],i);s=E(n.top,s),c=T(n.right,c),l=T(n.bottom,l),u=E(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ot(e){let{width:t,height:n}=ft(e);return{width:t,height:n}}function kt(e,t,n){let r=F(t),i=N(t),a=n===`fixed`,o=H(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=D(0);function l(){c.x=_t(i)}if(r||!r&&!a)if((j(t)!==`body`||et(i))&&(s=lt(t)),r){let e=H(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?vt(i,s):D(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function At(e){return R(e).position===`static`}function jt(e,t){if(!F(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return N(e)===n&&(n=n.ownerDocument.body),n}function Mt(e,t){let n=M(e);if(nt(e))return n;if(!F(e)){let t=z(e);for(;t&&!L(t);){if(P(t)&&!At(t))return t;t=z(t)}return n}let r=jt(e,t);for(;r&&tt(r)&&At(r);)r=jt(r,t);return r&&L(r)&&At(r)&&!ot(r)?n:r||st(e)||n}let Nt=async function(e){let t=this.getOffsetParent||Mt,n=this.getDimensions,r=await n(e.floating);return{reference:kt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Pt(e){return R(e).direction===`rtl`}let Ft={convertOffsetParentRelativeRectToViewportRelativeRect:yt,getDocumentElement:N,getClippingRect:Dt,getOffsetParent:Mt,getElementRects:Nt,getClientRects:bt,getDimensions:Ot,getScale:V,isElement:P,isRTL:Pt};function It(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lt(e,t){let n=null,r,i=N(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=xe(d),h=xe(i.clientWidth-(u+f)),g=xe(i.clientHeight-(d+p)),_=xe(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,T(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!It(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Rt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=pt(e),u=i||a?[...l?B(l):[],...t?B(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Lt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?H(e):null;c&&g();function g(){let t=H(e);h&&!It(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}let zt=qe,Bt=Je,Vt=We,Ht=Xe,Ut=Ye,Wt=(e,t,n)=>{let r=new Map,i={platform:Ft,...n},a={...i.platform,_c:r};return Ue(e,t,{...i,platform:a})},Gt=`data-placement`,Kt=`data-autoplacement`,qt=new Map;function Jt(e){let{newState:t,oldState:n,target:r,source:i=e.detail}=e,a=r instanceof HTMLElement&&Zt(r,`--_ds-floating`);if(!a)return;if(t===`closed`)return qt.get(r)?.();if(!i){let e=r.getRootNode(),t=`[popovertarget="${r.id}"],[commandfor="${r.id}"]`;i=r.id&&e?.querySelector?.(t)||void 0}if(!i||i===r||n&&n===t)return;let o=Zt(r,`--_ds-floating-overscroll`),s=l(r,Gt)||l(i,Gt)||a,c=l(r,Kt)||l(i,Kt),u=parseFloat(getComputedStyle(r,`::before`).height)||0,d=s.match(/left|right/gi)?`Height`:`Width`,f=i[`offset${d}`]/2+u;if(s===`none`)return;let p={strategy:`absolute`,placement:s,middleware:[zt(u||0),Bt({padding:10,limiter:Ut({offset:{mainAxis:f}})}),Qt(),...c===`false`?[]:[Vt({padding:10,crossAxis:!1})],...o?[Ht({apply({availableHeight:e}){o===`fit`&&(r.style.width=`${i.clientWidth}px`),r.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},m=Rt(i,r,async()=>{if(!i?.isConnected)return qt.get(r)?.();let{x:e,y:t}=await Wt(i,r,p);r.style.translate=`${e}px ${t}px`});qt.set(r,()=>qt.delete(r)&&m())}let Yt,Xt=({type:e})=>{if(e===`mousedown`&&(Yt=!1),e===`scroll`&&Yt===!1&&(Yt=!0),e===`mouseup`&&Yt)for(let[e]of qt)e.showPopover()};m(`popover`,()=>[f(document,`mousedown scroll mouseup`,Xt,!0),f(document,`toggle ds-toggle-source`,Jt,r)]);let Zt=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),Qt=()=>({name:`arrowPseudo`,fn(e){let t=e.elements.floating,n=e.rects.reference,r=`${Math.round(n.width/2+n.x-e.x)}px`,i=`${Math.round(n.height/2+n.y-e.y)}px`;return t.style.setProperty(`--_ds-floating-arrow-x`,r),t.style.setProperty(`--_ds-floating-arrow-y`,i),l(t,`data-floating`,e.placement),e}}),$t=e=>(e instanceof HTMLSelectElement||e instanceof HTMLInputElement)&&(e.hasAttribute(`readonly`)||l(e,`aria-readonly`)===`true`),en=e=>{if(e.key!==`Tab`&&$t(e.target)&&(e.preventDefault(),e.key?.startsWith(`Arrow`)&&l(e.target,`type`)===`radio`)){let t=document.querySelectorAll(`input[name="${e.target.name}"]`),n=e.key?.match(/Arrow(Right|Down)/)?1:-1;t[(t.length+[...t].indexOf(e.target)+n)%t.length]?.focus()}},tn=e=>{let t=e.target?.closest?.(`label`)?.control||e.target;$t(t)&&(e.preventDefault(),t.focus())},nn=e=>{e.target instanceof HTMLSelectElement&&$t(e.target)&&e.preventDefault()};m(`readonly`,()=>[f(document,`keydown`,en),f(document,`click`,tn),f(document,`mousedown`,nn)]);let rn=`data-toggle-group`,an=`[${rn}]`,on=s(()=>{for(let e of document.querySelectorAll(an))l(e,`aria-label`,d(e,rn))},0),sn=e=>{let t=e.target instanceof HTMLInputElement&&e.target.closest(an);if(t&&(e.key===`Enter`&&e.target.click(),e.key?.startsWith(`Arrow`))){e.preventDefault?.();let n=[...t.getElementsByTagName(`input`)],r=n.indexOf(e.target),i=e.key.match(/Arrow(Right|Down)/)?1:-1,a=r;for(let e=0;e<n.length;e++)if(a=(n.length+a+i)%n.length,!n[a]?.disabled){n[a]?.focus();break}}};m(`toggle-group`,()=>[f(document,`keydown`,sn),g(document,on,{attributeFilter:[rn],attributes:!0,childList:!0,subtree:!0})]);let U,cn,ln=0,un=0,W=`data-tooltip`,dn=`data-color`,fn=`aria-label`,pn=`aria-description`,mn=`[${dn}]`,hn=`[${W}]`,gn=`data-color-scheme`,_n=`[${gn}]`,vn=e=>{e&&!(e instanceof HTMLElement)&&c(`setTooltipElement expects an HTMLElement, got: `,e),U=e||void 0},yn=s(()=>{for(let e of document.querySelectorAll(hn)){let t=e.getAttribute(fn)||e.getAttribute(pn),n=e.getAttribute(W)||d(e,W);if(t!==n){let t=l(e,`role`)!==`img`&&e.textContent?.trim();l(e,W,n),l(e,fn,t?null:n),l(e,pn,t?n:null),e.matches(`a,button,input,label,select,textarea,[tabindex]`)||c(`Missing tabindex="0" attribute on: `,e)}let r=e===cn&&U?.matches(`:popover-open`),i=r&&n&&U?.textContent!==n;r&&i&&(U&&_(U,n),document.activeElement===e&&ne(n))}},0),bn=({type:e,target:t})=>{if(clearTimeout(ln),t===U)return;if(e===`mouseover`&&!cn){ln=setTimeout(bn,300,{target:t});return}let n=t?.closest?.(`[${W}]`);if(n===cn)return;if(!n)return xn();U||=y(`div`,{class:`ds-tooltip`}),U.isConnected||document.body.appendChild(U);let r=n.closest(mn),i=n.closest(_n),a=r!==i&&r?.contains(i);clearTimeout(un),l(U,`popover`,`manual`),l(U,gn,i?.getAttribute(gn)||null),l(U,dn,a&&r?.getAttribute(dn)||null),_(U,l(n,W)),U.showPopover(),U.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n})),cn=n},xn=()=>U?.isConnected&&U.popover&&U.hidePopover(),Sn=e=>{if(e?.type===`keydown`)return e?.key===`Escape`&&xn();e?e.target===U&&e.newState===`closed`&&(un=setTimeout(Sn,300)):cn=void 0};m(`tooltip`,()=>[f(document,`blur focus mouseover`,bn,r),f(document,`toggle keydown`,Sn,r),g(document,yn,{attributeFilter:[W],attributes:!0,childList:!0,subtree:!0})]);var Cn=Object.defineProperty,wn=Object.getOwnPropertySymbols,Tn=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Dn=(e,t,n)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t)=>{for(var n in t||={})Tn.call(t,n)&&Dn(e,n,t[n]);if(wn)for(var n of wn(t))En.call(t,n)&&Dn(e,n,t[n]);return e},kn=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,An=kn&&/android/i.test(navigator.userAgent),jn=kn&&/iPad|iPhone|iPod/.test(navigator.userAgent);kn&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Mn=`${An?`data`:`aria`}-labelledby`,Nn=`:host(:not([hidden])) { display: block }`,Pn=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Fn=typeof HTMLElement>`u`?class{}:HTMLElement;function G(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var In=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},Ln=(e,...t)=>In(`add`,e,t),Rn=(e,...t)=>In(`remove`,e,t),zn=(e,t)=>e.shadowRoot||e.attachShadow({mode:`open`}).append(Gn(`slot`),Gn(`style`,t)),Bn=new WeakMap,Vn=(e,t)=>{if(t===void 0)return Bn.get(e);try{Bn.get(e).disconnect(),Bn.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),Bn.set(e,n)}},Hn=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},Un=0,Wn=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++Un).toString(32)}`,e.id):``,Gn=(e,t,n)=>{let r=document.createElement(e);return t&&(r[e===`style`?`textContent`:`innerHTML`]=t),r},Kn={define:(e,t)=>!kn||window.customElements.get(e)||window.customElements.define(e,t)},K,qn=0,Jn=e=>{K||(K=Gn(`div`),K.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,G(K,`aria-live`,`assertive`)),K.isConnected||document.body.append(K),e&&(K.textContent=`${e}${qn++%2?`\xA0`:``}`)},Yn=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},Xn=!1,Zn=e=>(e?.type===`mouseup`&&(Xn=!1),e?.type===`mousedown`&&(Xn=!0,Ln(document,`mouseup`,Zn,{once:!0})),Xn),Qn=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,$n=`disabled`,er=`selected`,tr=class extends Fn{static get observedAttributes(){return[$n,er]}connectedCallback(){jn||(this.tabIndex=-1),this.hasAttribute(`role`)||G(this,`role`,`option`),this.attributeChangedCallback()}attributeChangedCallback(){G(this,`aria-disabled`,`${this.disabled}`),G(this,`aria-selected`,`${this.selected}`)}get defaultSelected(){return this[er]}set defaultSelected(e){this[er]=e}get disabled(){return G(this,$n)!==null}set disabled(e){G(this,$n,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return G(this,`label`)??this.text}set label(e){G(this,`label`,e)}get selected(){return G(this,er)!==null}set selected(e){G(this,er,e?``:null)}get text(){return this.textContent?.trim()||``}set text(e){this.textContent=e}get value(){return G(this,`value`)??this.text}set value(e){G(this,`value`,e)}};Kn.define(`u-option`,tr);var nr=`${Nn}
2
2
  ::slotted([role="option"]) { display: block; cursor: pointer }
3
- ::slotted([role="option"]:focus) { ${Fn} }
3
+ ::slotted([role="option"]:focus) { ${Pn} }
4
4
  ::slotted([role="option"][aria-hidden="true"]),
5
5
  ::slotted([role="option"][disabled]),
6
- ::slotted([role="option"][hidden]) { display: none !important }`,ir=$n(rr),ar,or=0,sr=Mn||jn,cr=`click,focusout,input,keydown,mousedown,mouseup`,lr=`focus,focusin,blur,focusout`,ur={singular:`%d hit`,plural:`%d hits`},dr=class extends In{constructor(){super(),this._texts=kn({},ur),this._value=``,this._of=`/`,Bn(this,rr)}static get observedAttributes(){return[`id`,...Object.keys(ur).map(e=>`data-sr-${e}`)]}connectedCallback(){this.hidden=!0,this._root=Un(this),G(this,`role`,`listbox`),G(this,`tabindex`,`-1`),Rn(this._root,`focusin`,this),Rn(this._root,`focus`,this,!0),Hn(this,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){zn(this._root||this,`focus`,this,!0),zn(this._root||this,`focusin`,this),Hn(this,!1),mr(this),this._root=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1],i=`input[list="${this.id}"]`;if(ur[r])this._texts[r]=n||ur[r];else if(this._root){this._input&&hr(this,this._input);for(let e of this._root.querySelectorAll(i))hr(this,e)}}handleEvent(e){let{target:t,type:n}=e;e.defaultPrevented||(n===`click`&&yr(this,e),(n===`focus`||n===`focusin`)&&gr(this,e),(n===`blur`||n===`focusout`)&&_r(this,e),n===`keydown`&&br(this,e),n===`mousedown`&&this.contains(t)&&Qn(e),(n===`mutation`||n===`input`)&&(clearTimeout(or),or=setTimeout(xr,0,this,e)))}get options(){if(!this._options){let e=this.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName(`option`)}},fr=e=>e?.disabled||e?.readOnly||!1,pr=(e,t)=>{var n;if(e.hidden!==t)return;e.hidden=fr(e?._input)||!t,(n=Hn(e))==null||n.takeRecords();let r=e.isConnected&&e.popover&&e._input?.isConnected&&e._input?.popoverTargetElement===e;e._input&&hr(e,e._input,t),r&&G(e,`popover`,`manual`),r&&e.togglePopover(t),t&&xr(e)},mr=e=>{e._input&&=(zn(e._input||e,lr,e),zn(e._root||e,cr,e),pr(e,!1),void 0)},hr=(e,t,n=!1)=>{e.popover&&G(t,`popovertarget`,Gn(e)),Rn(t,lr,e,!0),G(t,`aria-autocomplete`,`list`),G(t,`aria-controls`,Gn(e)),G(t,`aria-expanded`,`${!sr||n}`),G(t,`autocomplete`,`off`),G(t,`role`,fr(t)?null:`combobox`)},gr=(e,t)=>{let n=t.target instanceof HTMLInputElement;n&&t.isTrusted&&t.stopImmediatePropagation(),e._input!==t.target&&n&&t.target.list===e&&(e._input&&mr(e),e._input=t.target,e._input.dispatchEvent(new FocusEvent(`focus`)),e._input.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0})),G(e,Nn,Gn(e._input.labels?.[0])),Rn(e._root||e,cr,e),pr(e,G(e._input,`inputmode`)!==`none`),Yn())},_r=(e,t)=>{!jn&&!Qn()&&e._input&&setTimeout(vr,0,e),t.target===e._input&&t.isTrusted&&t.stopImmediatePropagation()},vr=e=>{let t=e._root?.activeElement||null,n=e._input;n&&n!==t&&!e.contains(t)&&(n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t})),mr(e))},yr=(e,{target:t})=>{var n;if(!e._input||e._input===t)return pr(e,!0);for(let r of e.options)if(r.contains(t))return G(e,`aria-multiselectable`)!==`true`&&((n=e._input)==null||n.focus(),pr(e,!1)),Xn(e._input,r.value);jn&&vr(e)},br=(e,t)=>{var n;let{key:r,target:i,altKey:a,ctrlKey:o,shiftKey:s,metaKey:c}=t,l=r===`Escape`||r===`Esc`;if(a||o||c||s||r===`Tab`)return;l&&!e.hidden&&t?.preventDefault(),pr(e,!l);let u=[...e.options].filter(e=>G(e,`aria-hidden`)!==`true`&&e.offsetHeight),d=u.indexOf(i),f=-1;if(r===`ArrowDown`&&(f=(d+1)%u.length),r===`ArrowUp`&&(f=(~d?d:u.length)-1),~d&&((r===`Home`||r===`PageUp`)&&(f=0),(r===`End`||r===`PageDown`)&&(f=u.length-1),r===`Enter`))return u[d].click(),t.preventDefault();if(u[f])for(let e of u)e.tabIndex=-1;u[f]&&t.preventDefault(),(n=u[f]||e._input)==null||n.focus(),!u[f]&&r===`ArrowUp`&&setTimeout(()=>e._input?.setSelectionRange(999,999))},xr=(e,t)=>{let{_texts:n,_root:r,_input:i,options:a}=e,o=i?.value.toLowerCase().trim()||``,s=!e.hasAttribute(`data-nofilter`),c=[],l=[];for(let e of a)(e.disabled||e.hidden||s&&!e.label.toLowerCase().includes(o)?c:l).push(e);for(let e of c)G(e,`aria-hidden`,`true`);for(let e of l)G(e,`aria-hidden`,`false`);let u=l.length;clearTimeout(ar),t?.type===`input`&&o!==e._value&&(ar=setTimeout(()=>{let t=`${!u&&e.innerText.trim()||`${n[u===1?`singular`:`plural`]}`.replace(`%d`,`${u}`)}`;!e.hidden&&r?.activeElement===i&&Yn(t),e._value=o},1e3));let d=0;if(Mn)for(let t of l)G(t,`title`,`${++d} ${e._of} ${u}`)};An&&Object.defineProperty(HTMLInputElement.prototype,`list`,{configurable:!0,enumerable:!0,get(){return Un(this).getElementById(G(this,`list`)||``)}}),qn.define(`u-datalist`,dr);let Sr=`aria-label`;var Cr=class extends o{_items;_label=null;_render;_unresize;_unmutate;static get observedAttributes(){return[Sr]}connectedCallback(){this._label=d(this,Sr),this._items=this.getElementsByTagName(`a`),this._render=s(()=>wr(this),100),this._unresize=f(window,`resize`,this._render),this._unmutate=g(this,this._render,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){n&&(this._label=n),this._render?.()}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._render=this._items=void 0}};let wr=e=>{let t=e._items?.[e._items.length-1],n=t?.parentElement===e?null:t,r=!n?.offsetHeight;l(e,`role`,r?null:`navigation`),l(e,Sr,r?null:e._label);for(let t of e._items||[])l(t,`aria-current`,t===n?`page`:null)};b.define(`ds-breadcrumbs`,Cr);var Tr=class extends o{connectedCallback(){f(this,`animationend`,this,r),requestAnimationFrame(()=>this.handleEvent({target:this}))}handleEvent({target:e}){if(e!==this)return;let t=this.querySelector(`h2,h3,h4,h5,h6`);t&&l(this,`aria-labelledby`,x(t)),l(this,`tabindex`,`-1`),this.focus()}disconnectedCallback(){p(this,`animationend`,this,r)}};b.define(`ds-error-summary`,Tr);let Er=`data-indeterminate`,Dr=new Set,Or=new WeakMap,kr=i()?document.getElementsByTagName(`fieldset`):[],Ar=i()&&CSS.supports(`field-sizing`,`content`),jr=a()?800:200,Mr=new WeakSet,Nr=s(()=>{for(let e of kr)l(e,`aria-labelledby`,`${x(e.querySelector(`legend`))} ${x(e.querySelector(`:scope > :is([data-field="description"],legend + p)`))}`.trim()||null);for(let e of Dr){let t=[],n=[],r,i,a=!1,o=!1;for(let s of e.getElementsByTagName(`*`))if(s instanceof HTMLLabelElement&&n.push(s),!s.hidden)if(Rr(s))r?c(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):r=s;else{let e=s.getAttribute(`data-field`);e===`counter`&&(i=s),e===`validation`?(t.unshift(s),a=!0,o||=Lr(s)):e&&t.push(s)}if(!r)c(`Field is missing input element:`,e);else{i&&Or.set(r,i);for(let e of n)l(e,`for`,x(r));let s=r.type===`radio`||r.type===`checkbox`,c=e.closest(`fieldset`)?.querySelector(`:scope > [data-field="validation"]`);c&&!c?.hidden&&(a=!0,o||=Lr(c),t.unshift(c));let u=l(r,Er);u&&(r.indeterminate=u===`true`),l(e,`data-clickdelegatefor`,s?x(r):null),l(r,`aria-describedby`,t.map(x).join(` `)||null),(a||Mr.has(r))&&(Mr[a?`add`:`delete`](r),l(r,`aria-invalid`,`${o}`)),Fr(r)}}},0),Pr=i()?y(`div`,{"aria-live":`polite`,style:`position:fixed;white-space:nowrap;clip:rect(0 0 0 0)`}):null,Fr=e=>{let t=e.target||e,n=Or.get(t);if(n?.isConnected){let r=(Number(l(n,`data-limit`))||0)-t.value.length,i=r<0?`over`:`under`,a=d(n,`data-${i}`)?.replace(`%d`,`${Math.abs(r)}`);l(n,`data-label`,a),l(n,`data-state`,i),l(n,`data-color`,r<0?`danger`:null),e.type===`input`&&Pr&&a&&(Pr?.isConnected||document.body.appendChild(Pr),Ir(t,a))}!Ar&&t instanceof HTMLTextAreaElement&&(t.style.setProperty(`--_ds-field-sizing`,`auto`),t.style.setProperty(`--_ds-field-sizing`,`${t.scrollHeight}px`))},Ir=s((e,t)=>{let n=document.activeElement===e;Pr?.isConnected&&n&&_(Pr,t)},jr),Lr=e=>e.getAttribute(`data-color`)!==`success`,Rr=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var zr=class extends o{connectedCallback(){Dr.add(this),Nr()}disconnectedCallback(){Dr.delete(this)}};b.define(`ds-field`,zr),m(`field`,()=>[f(document,`input`,Fr,r),g(document,Nr,{attributeFilter:[`data-field`,`data-limit`,`hidden`,`value`,Er],attributes:!0,childList:!0,subtree:!0})]);let Br=`aria-label`,Vr=`data-current`,Hr=`data-total`,Ur=`data-href`,Wr=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:qr(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Gr=class extends o{_unmutate;_render;static get observedAttributes(){return[Br,Vr,Hr,Ur]}connectedCallback(){let e=l(this,Hr),t=l(this,Vr);t&&!e&&c(`Missing ${Hr} attribute on:`,this),e&&!t&&c(`Missing ${Vr} attribute on:`,this),l(this,Br,d(this,Br)),l(this,`role`,`navigation`),this._render=s(()=>Kr(this),0),this._unmutate=g(this,this._render,{childList:!0,subtree:!0})}attributeChangedCallback(){this._render?.()}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let Kr=e=>{let t=Number(l(e,Vr)),n=Number(l(e,Hr));if(t&&n){let r=e.querySelectorAll(`button,a`),i=r.length-2,a=l(e,Ur),{next:o,prev:s,pages:c}=Wr({current:t,total:n,show:i});r.forEach((e,t)=>{let n=t?r[t+1]?c[t-1]?.page:o:s;l(e,`aria-current`,c[t-1]?.current?`true`:null),l(e,`aria-label`,`${n??`hidden`}`),l(e,`role`,n?null:`none`),l(e,`tabindex`,n?null:`-1`),e instanceof HTMLButtonElement&&l(e,`value`,`${n}`),a&&e instanceof HTMLAnchorElement&&l(e,`href`,a.replace(`%d`,`${n}`))})}},qr=(e,t,n=1/0)=>{let r=(n-1)/2,i=Math.max(Math.min(e-Math.floor(r),t-n+1),1),a=Math.min(Math.max(e+Math.ceil(r),n),t),o=Array.from({length:a+1-i},(e,t)=>t+i);return n>4&&i>1&&o.splice(0,2,1,0),n>3&&a<t&&o.splice(-2,2,0,t),o};b.define(`ds-pagination`,Gr);var Jr=Object.defineProperty,Yr=Object.getOwnPropertySymbols,Xr=Object.prototype.hasOwnProperty,Zr=Object.prototype.propertyIsEnumerable,Qr=(e,t,n)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$r=(e,t)=>{for(var n in t||={})Xr.call(t,n)&&Qr(e,n,t[n]);if(Yr)for(var n of Yr(t))Zr.call(t,n)&&Qr(e,n,t[n]);return e},ei=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ti=ei&&/android/i.test(navigator.userAgent),ni=ei&&/iPad|iPhone|iPod/.test(navigator.userAgent);ei&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var ri=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,ii=typeof HTMLElement>`u`?class{}:HTMLElement;function q(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var ai=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},oi=(e,...t)=>ai(`add`,e,t),si=(e,...t)=>ai(`remove`,e,t),ci=new WeakMap,li=(e,t)=>{if(t===void 0)return ci.get(e);try{ci.get(e).disconnect(),ci.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),ci.set(e,n)}},ui=e=>{var t;let n=e.key===` `||e.key===`Enter`;return n&&((t=e.preventDefault)==null||t.call(e)),n&&e.target instanceof HTMLElement&&e.target.dispatchEvent(new MouseEvent(`click`,e)),n},di=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},fi=0,pi=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++fi).toString(32)}`,e.id):``,J=(e,t,n)=>{let r=document.createElement(e);if(t&&(r[e===`style`?`textContent`:`innerHTML`]=t),n)for(let[e,t]of Object.entries(n))q(r,e,t);return r},mi={define:(e,t)=>!ei||window.customElements.get(e)||window.customElements.define(e,t)},hi=e=>{let t=q(e,`aria-label`)||``;return[...(q(e,`aria-labelledby`)?.trim().split(/\s+/)||[]).map(e=>document.getElementById(e)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t)},Y,gi=0,_i=e=>{Y||(Y=J(`div`),Y.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,q(Y,`aria-live`,`assertive`)),Y.isConnected||document.body.append(Y),e&&(Y.textContent=`${e}${gi++%2?`\xA0`:``}`)},vi=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},yi=!1,bi=e=>(e?.type===`mouseup`&&(yi=!1),e?.type===`mousedown`&&(yi=!0,oi(document,`mouseup`,bi,{once:!0})),yi),xi=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Si=`:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
6
+ ::slotted([role="option"][hidden]) { display: none !important }`,rr=Qn(nr),ir,ar=0,or=jn||An,sr=`click,focusout,input,keydown,mousedown,mouseup`,cr=`focus,focusin,blur,focusout`,lr={singular:`%d hit`,plural:`%d hits`},ur=class extends Fn{constructor(){super(),this._texts=On({},lr),this._value=``,this._of=`/`,zn(this,nr)}static get observedAttributes(){return[`id`,...Object.keys(lr).map(e=>`data-sr-${e}`)]}connectedCallback(){this.hidden=!0,this._root=Hn(this),G(this,`role`,`listbox`),G(this,`tabindex`,`-1`),Ln(this._root,`focusin`,this),Ln(this._root,`focus`,this,!0),Vn(this,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Rn(this._root||this,`focus`,this,!0),Rn(this._root||this,`focusin`,this),Vn(this,!1),pr(this),this._root=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1],i=`input[list="${this.id}"]`;if(lr[r])this._texts[r]=n||lr[r];else if(this._root){this._input&&mr(this,this._input);for(let e of this._root.querySelectorAll(i))mr(this,e)}}handleEvent(e){let{target:t,type:n}=e;e.defaultPrevented||(n===`click`&&vr(this,e),(n===`focus`||n===`focusin`)&&hr(this,e),(n===`blur`||n===`focusout`)&&gr(this,e),n===`keydown`&&yr(this,e),n===`mousedown`&&this.contains(t)&&Zn(e),(n===`mutation`||n===`input`)&&(clearTimeout(ar),ar=setTimeout(br,0,this,e)))}get options(){if(!this._options){let e=this.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName(`option`)}},dr=e=>e?.disabled||e?.readOnly||!1,fr=(e,t)=>{var n;if(e.hidden!==t)return;e.hidden=dr(e?._input)||!t,(n=Vn(e))==null||n.takeRecords();let r=e.isConnected&&e.popover&&e._input?.isConnected&&e._input?.popoverTargetElement===e;e._input&&mr(e,e._input,t),r&&G(e,`popover`,`manual`),r&&e.togglePopover(t),t&&br(e)},pr=e=>{e._input&&=(Rn(e._input||e,cr,e),Rn(e._root||e,sr,e),fr(e,!1),void 0)},mr=(e,t,n=!1)=>{e.popover&&G(t,`popovertarget`,Wn(e)),Ln(t,cr,e,!0),G(t,`aria-autocomplete`,`list`),G(t,`aria-controls`,Wn(e)),G(t,`aria-expanded`,`${!or||n}`),G(t,`autocomplete`,`off`),G(t,`role`,dr(t)?null:`combobox`)},hr=(e,t)=>{let n=t.target instanceof HTMLInputElement;n&&t.isTrusted&&t.stopImmediatePropagation(),e._input!==t.target&&n&&t.target.list===e&&(e._input&&pr(e),e._input=t.target,e._input.dispatchEvent(new FocusEvent(`focus`)),e._input.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0})),G(e,Mn,Wn(e._input.labels?.[0])),Ln(e._root||e,sr,e),fr(e,G(e._input,`inputmode`)!==`none`),Jn())},gr=(e,t)=>{!An&&!Zn()&&e._input&&setTimeout(_r,0,e),t.target===e._input&&t.isTrusted&&t.stopImmediatePropagation()},_r=e=>{let t=e._root?.activeElement||null,n=e._input;n&&n!==t&&!e.contains(t)&&(n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t})),pr(e))},vr=(e,{target:t})=>{var n;if(!e._input||e._input===t)return fr(e,!0);for(let r of e.options)if(r.contains(t))return G(e,`aria-multiselectable`)!==`true`&&((n=e._input)==null||n.focus(),fr(e,!1)),Yn(e._input,r.value);An&&_r(e)},yr=(e,t)=>{var n;let{key:r,target:i,altKey:a,ctrlKey:o,shiftKey:s,metaKey:c}=t,l=r===`Escape`||r===`Esc`;if(a||o||c||s||r===`Tab`)return;l&&!e.hidden&&t?.preventDefault(),fr(e,!l);let u=[...e.options].filter(e=>G(e,`aria-hidden`)!==`true`&&e.offsetHeight),d=u.indexOf(i),f=-1;if(r===`ArrowDown`&&(f=(d+1)%u.length),r===`ArrowUp`&&(f=(~d?d:u.length)-1),~d&&((r===`Home`||r===`PageUp`)&&(f=0),(r===`End`||r===`PageDown`)&&(f=u.length-1),r===`Enter`))return u[d].click(),t.preventDefault();if(u[f])for(let e of u)e.tabIndex=-1;u[f]&&t.preventDefault(),(n=u[f]||e._input)==null||n.focus(),!u[f]&&r===`ArrowUp`&&setTimeout(()=>e._input?.setSelectionRange(999,999))},br=(e,t)=>{let{_texts:n,_root:r,_input:i,options:a}=e,o=i?.value.toLowerCase().trim()||``,s=!e.hasAttribute(`data-nofilter`),c=[],l=[];for(let e of a)(e.disabled||e.hidden||s&&!e.label.toLowerCase().includes(o)?c:l).push(e);for(let e of c)G(e,`aria-hidden`,`true`);for(let e of l)G(e,`aria-hidden`,`false`);let u=l.length;clearTimeout(ir),t?.type===`input`&&o!==e._value&&(ir=setTimeout(()=>{let t=`${!u&&e.innerText.trim()||`${n[u===1?`singular`:`plural`]}`.replace(`%d`,`${u}`)}`;!e.hidden&&r?.activeElement===i&&Jn(t),e._value=o},1e3));let d=0;if(jn)for(let t of l)G(t,`title`,`${++d} ${e._of} ${u}`)};kn&&Object.defineProperty(HTMLInputElement.prototype,`list`,{configurable:!0,enumerable:!0,get(){return Hn(this).getElementById(G(this,`list`)||``)}}),Kn.define(`u-datalist`,ur);let xr=`aria-label`;var Sr=class extends o{_items;_label=null;_render;_unresize;_unmutate;static get observedAttributes(){return[xr]}connectedCallback(){this._label=d(this,xr),this._items=this.getElementsByTagName(`a`),this._render=s(()=>Cr(this),100),this._unresize=f(window,`resize`,this._render),this._unmutate=g(this,this._render,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){n&&(this._label=n),this._render?.()}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._render=this._items=void 0}};let Cr=e=>{let t=e._items?.[e._items.length-1],n=t?.parentElement===e?null:t,r=!n?.offsetHeight;l(e,`role`,r?null:`navigation`),l(e,xr,r?null:e._label);for(let t of e._items||[])l(t,`aria-current`,t===n?`page`:null)};b.define(`ds-breadcrumbs`,Sr);var wr=class extends o{connectedCallback(){f(this,`animationend`,this,r),requestAnimationFrame(()=>this.handleEvent({target:this}))}handleEvent({target:e}){if(e!==this)return;let t=this.querySelector(`h2,h3,h4,h5,h6`);t&&l(this,`aria-labelledby`,S(t)),l(this,`tabindex`,`-1`),this.focus()}disconnectedCallback(){p(this,`animationend`,this,r)}};b.define(`ds-error-summary`,wr);let Tr=`data-indeterminate`,Er=new Set,Dr=new WeakMap,Or=i()?document.getElementsByTagName(`fieldset`):[],kr=i()&&CSS.supports(`field-sizing`,`content`),Ar=a()?800:200,jr=new WeakSet,Mr=s(()=>{for(let e of Or)l(e,`aria-labelledby`,`${S(e.querySelector(`legend`))} ${S(e.querySelector(`:scope > :is([data-field="description"],legend + p)`))}`.trim()||null);for(let e of Er){let t=[],n=[],r,i,a=!1,o=!1;for(let s of e.getElementsByTagName(`*`))if(s instanceof HTMLLabelElement&&n.push(s),!s.hidden)if(Ir(s))r?c(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):r=s;else{let e=s.getAttribute(`data-field`);e===`counter`&&(i=s),e===`validation`?(t.unshift(s),a=!0,o||=Fr(s)):e&&t.push(s)}if(!r)c(`Field is missing input element:`,e);else{i&&Dr.set(r,i);for(let e of n)l(e,`for`,S(r));let s=r.type===`radio`||r.type===`checkbox`,c=e.closest(`fieldset`)?.querySelector(`:scope > [data-field="validation"]`);c&&!c?.hidden&&(a=!0,o||=Fr(c),t.unshift(c));let u=l(r,Tr);u&&(r.indeterminate=u===`true`),l(e,`data-clickdelegatefor`,s?S(r):null),l(r,`aria-describedby`,t.map(S).join(` `)||null),(a||jr.has(r))&&(jr[a?`add`:`delete`](r),l(r,`aria-invalid`,`${o}`)),Nr(r)}}},0),Nr=e=>{let t=e.target||e,n=Dr.get(t);if(n?.isConnected){let r=(Number(l(n,`data-limit`))||0)-t.value.length,i=r<0?`over`:`under`,a=d(n,`data-${i}`)?.replace(`%d`,`${Math.abs(r)}`);l(n,`data-label`,a),l(n,`data-state`,i),l(n,`data-color`,r<0?`danger`:null),e.type===`input`&&a&&Pr(t,a)}!kr&&t instanceof HTMLTextAreaElement&&(t.style.setProperty(`--_ds-field-sizing`,`auto`),t.style.setProperty(`--_ds-field-sizing`,`${t.scrollHeight}px`))},Pr=s((e,t)=>{document.activeElement===e&&ne(t)},Ar),Fr=e=>e.getAttribute(`data-color`)!==`success`,Ir=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var Lr=class extends o{connectedCallback(){Er.add(this),Mr()}disconnectedCallback(){Er.delete(this)}};b.define(`ds-field`,Lr),m(`field`,()=>[f(document,`input`,Nr,r),g(document,Mr,{attributeFilter:[`data-field`,`data-limit`,`hidden`,`value`,Tr],attributes:!0,childList:!0,subtree:!0})]);let Rr=`aria-label`,zr=`data-current`,Br=`data-total`,Vr=`data-href`,Hr=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:Gr(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Ur=class extends o{_unmutate;_render;static get observedAttributes(){return[Rr,zr,Br,Vr]}connectedCallback(){let e=l(this,Br),t=l(this,zr);t&&!e&&c(`Missing ${Br} attribute on:`,this),e&&!t&&c(`Missing ${zr} attribute on:`,this),l(this,Rr,d(this,Rr)),l(this,`role`,`navigation`),this._render=s(()=>Wr(this),0),this._unmutate=g(this,this._render,{childList:!0,subtree:!0})}attributeChangedCallback(){this._render?.()}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let Wr=e=>{let t=Number(l(e,zr)),n=Number(l(e,Br));if(t&&n){let r=e.querySelectorAll(`button,a`),i=r.length-2,a=l(e,Vr),{next:o,prev:s,pages:c}=Hr({current:t,total:n,show:i});r.forEach((e,t)=>{let n=t?r[t+1]?c[t-1]?.page:o:s;l(e,`aria-current`,c[t-1]?.current?`true`:null),l(e,`aria-label`,`${n??`hidden`}`),l(e,`role`,n?null:`none`),l(e,`tabindex`,n?null:`-1`),e instanceof HTMLButtonElement&&l(e,`value`,`${n}`),a&&e instanceof HTMLAnchorElement&&l(e,`href`,a.replace(`%d`,`${n}`))})}},Gr=(e,t,n=1/0)=>{let r=(n-1)/2,i=Math.max(Math.min(e-Math.floor(r),t-n+1),1),a=Math.min(Math.max(e+Math.ceil(r),n),t),o=Array.from({length:a+1-i},(e,t)=>t+i);return n>4&&i>1&&o.splice(0,2,1,0),n>3&&a<t&&o.splice(-2,2,0,t),o};b.define(`ds-pagination`,Ur);var Kr=Object.defineProperty,qr=Object.getOwnPropertySymbols,Jr=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable,Xr=(e,t,n)=>t in e?Kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zr=(e,t)=>{for(var n in t||={})Jr.call(t,n)&&Xr(e,n,t[n]);if(qr)for(var n of qr(t))Yr.call(t,n)&&Xr(e,n,t[n]);return e},Qr=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,$r=Qr&&/android/i.test(navigator.userAgent),ei=Qr&&/iPad|iPhone|iPod/.test(navigator.userAgent);Qr&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var ti=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,ni=typeof HTMLElement>`u`?class{}:HTMLElement;function q(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var ri=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},ii=(e,...t)=>ri(`add`,e,t),ai=(e,...t)=>ri(`remove`,e,t),oi=new WeakMap,si=(e,t)=>{if(t===void 0)return oi.get(e);try{oi.get(e).disconnect(),oi.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),oi.set(e,n)}},ci=e=>{var t;let n=e.key===` `||e.key===`Enter`;return n&&((t=e.preventDefault)==null||t.call(e)),n&&e.target instanceof HTMLElement&&e.target.dispatchEvent(new MouseEvent(`click`,e)),n},li=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ui=0,di=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++ui).toString(32)}`,e.id):``,J=(e,t,n)=>{let r=document.createElement(e);if(t&&(r[e===`style`?`textContent`:`innerHTML`]=t),n)for(let[e,t]of Object.entries(n))q(r,e,t);return r},fi={define:(e,t)=>!Qr||window.customElements.get(e)||window.customElements.define(e,t)},pi=e=>{let t=q(e,`aria-label`)||``;return[...(q(e,`aria-labelledby`)?.trim().split(/\s+/)||[]).map(e=>document.getElementById(e)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t)},Y,mi=0,hi=e=>{Y||(Y=J(`div`),Y.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,q(Y,`aria-live`,`assertive`)),Y.isConnected||document.body.append(Y),e&&(Y.textContent=`${e}${mi++%2?`\xA0`:``}`)},gi=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},_i=!1,vi=e=>(e?.type===`mouseup`&&(_i=!1),e?.type===`mousedown`&&(_i=!0,ii(document,`mouseup`,vi,{once:!0})),_i),yi=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,bi=`:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
7
7
  :host(:not([data-multiple])) ::slotted(data),
8
8
  :host([data-multiple="false"]) ::slotted(data) { display: none } /* Hide data if not multiple */
9
9
  [role="listbox"] { position: absolute } /* Avoid affecting CSS like flex on the <u-combobox> */
@@ -11,5 +11,5 @@
11
11
  ::slotted(del) { text-decoration: none }
12
12
  ::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }
13
13
  ::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto; cursor: pointer }
14
- ::slotted(data:focus) { ${ri} }`;xi(Si);var Ci=`beforeinput,blur,focus,click,input,keydown,mousedown`,wi={once:!0,capture:!0,passive:!0},Ti=`false`,Ei=ti||ni,Di=`​`.repeat(5),Oi=`deleteContentBackward`,ki=`insertText`,Ai=`\xA0`,ji={added:`Added`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`},Mi=class extends ii{constructor(){super(),this._item=``,this._speak=``,this._texts=$r({},ji),this._value=``,this.shadowRoot||this.attachShadow({mode:`open`}).append(J(`slot`,null,{"aria-orientation":`horizontal`,tabindex:`-1`,role:`listbox`,name:`items`}),J(`slot`),J(`div`,`<div role="option" tabindex="-1"></div>`,{"aria-hidden":`true`,role:`listbox`}),J(`style`,Si))}static get observedAttributes(){return Object.keys(ji).map(e=>`data-sr-${e}`)}connectedCallback(){this._root=di(this),oi(this,Ci,this,!0),li(this,{attributeFilter:[`value`,`id`,`role`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(Fi,0,this),setTimeout(Ri,0,this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];ji[r]&&(this._texts[r]=n||ji[r])}disconnectedCallback(){li(this,!1),si(this,Ci,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=this._form=void 0}handleEvent(e){let t=e.target;Pi(this)||(e.type===`beforeinput`&&(this._value=t?.value||``),e.type===`blur`&&Vi(this),e.type===`click`&&Ui(this,e),e.type===`focus`&&Bi(this,e),e.type===`input`&&Wi(this,e),e.type===`keydown`&&Gi(this,e),e.type===`mousedown`&&bi(e),e.type===`mutation`&&Fi(this,e))}get multiple(){return(q(this,`data-multiple`)??Ti)!==Ti}set multiple(e){q(this,`data-multiple`,e?``:null)}get creatable(){return(q(this,`data-creatable`)??Ti)!==Ti}set creatable(e){q(this,`data-creatable`,e?``:null)}get control(){return this._control?.isConnected||(this._control=this.querySelector(`input`)),this._control}get list(){return this._list?.isConnected||(this._list=this.querySelector(`datalist,[role="listbox"]`)),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(`del`)),this._clear}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){if(!this._options){let e=this.list?.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options}get values(){return[...this.items].map(({value:e})=>e)}},X=e=>(e?.textContent)?.trim()||``,Ni=e=>e instanceof HTMLDataElement,Pi=({control:e})=>e?.disabled||e?.readOnly||!1,Fi=(e,t)=>{var n;let{_focus:r,_texts:i,items:a,control:o,list:s,multiple:c}=e;if(!o)return;let l=hi(o),u=l.endsWith(Di)?q(o,`data-label`):l;q(o,`data-label`,u);let d=`${u}${c?`, ${a.length?i.found.replace(`%d`,`${a.length}`):i.empty}`:``}`,f=[];for(let{addedNodes:e,removedNodes:n}of t?.detail||[]){for(let t of e)Ni(t)&&f.unshift(t);for(let e of n)Ni(e)&&f.push(e)}let p=c?f.length===1:f[0]===r;if(r&&p){let t=q(o,`aria-expanded`),n=q(o,`inputmode`),a=Ni(r)?o:r,s=!f[0].isConnected;e._speak=`${i[s?`removed`:`added`]} ${X(f[0])}, `,(Ei||r===o)&&_i(e._speak),o!==a&&(Ei&&q(o,`aria-expanded`,null),Ei&&q(o,`inputmode`,`none`),d=Ai,o.focus()),setTimeout(()=>{var r;q(o,`aria-expanded`,t),q(o,`inputmode`,s?`none`:n),(r=a?.focus)==null||r.call(a),q(o,`inputmode`,n),e._speak=``,Ei?setTimeout(Fi,100,e):oi(e,`blur`,()=>Fi(e),wi)},100)}let m=0,h=e.querySelector(`select`),g=Pi(e)?``:i.remove,_=e.shadowRoot?.firstElementChild;_&&q(_,`aria-label`,i.items);for(let t of a){let n=h?.options[m++],r=X(t),o=t.value||r;q(t,`aria-label`,`${e._speak}${r}, ${g}`),q(t,`aria-selected`,`true`),q(t,`role`,`option`),q(t,`slot`,`items`),q(t,`tabindex`,`-1`),q(t,`value`,o),n?Object.assign(n,{textContent:r,value:o}):h?.appendChild(new Option(r,o,!0,!0)),ni&&q(t,`title`,`${m} ${i.of} ${a.length}`)}h&&q(h,`multiple`,c?``:null);for(let e of[...h?.options||[]].slice(m))e.remove();!c&&m>1&&console.warn(e,` Multiple <data> found in single mode.`),s&&(q(s,`aria-multiselectable`,`${c}`),q(o,`list`,pi(s)),q(o,`aria-label`,`${e._speak}${d}${Di}`),s.hasAttribute(`popover`)&&(q(o,`popovertarget`,pi(s)),q(s,`popover`,`manual`)),s._of=i.of);let v=X(a[0]);v!==e._item&&Ri(e),e._item=v,Ii(e),Li(e),(n=li(e))==null||n.takeRecords()},Ii=e=>{e.clear&&q(e.clear,`role`,`button`),e.clear&&(e.clear.hidden=!e.control?.value||Pi(e))},Li=e=>{let{_speak:t,options:n=[],values:r}=e;for(let e of n){let n=q(e,`value`)??X(e);q(e,`aria-label`,t?`${t}${X(e)}`:null),q(e,`selected`,r.includes(n)?``:null)}},Ri=e=>{let{multiple:t,control:n,items:r}=e,i=X(r[0]);!t&&n&&i!==n.value&&vi(n,i,i?ki:Oi)},zi=(e,t=!0)=>{let{_texts:n,options:r=[],creatable:i,control:a,items:o,multiple:s}=e,c=(a?.value)?.trim()||``,l=c.toLowerCase()||null,u=[...r].find(e=>(q(e,`label`)||X(e)).trim().toLowerCase()===l),d={bubbles:!0,cancelable:!0,detail:u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,d))||(u=[...r].find(e=>e.selected)),t)return Li(e),u?Z(e,u,!1):i&&c?Z(e,{value:c},!1):(!s&&!c&&o[0]?Z(e,o[0]):Ri(e),_i(n.invalid));for(let e of r)e.selected=e===u},Z=(e,t,n=!0)=>{var r;let{control:i,items:a,multiple:o}=e,s=J(`data`,t.label||t.value,{value:t.value}),c=[...a].find(e=>e.value===t.value),l={bubbles:!0,cancelable:!0,detail:c||s};if(c&&!n)return Ri(e);if(c===di(e)?.activeElement&&((r=e.shadowRoot?.querySelector(`[role="option"]`))==null||r.focus()),e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,l))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,s),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,l))}},Bi=(e,{target:t})=>{let{_form:n,control:r,multiple:i}=e;t instanceof HTMLElement&&(e._focus=t),i&&n===void 0&&r&&t===r&&(e._form=q(r,`form`),q(r,`form`,`#`)),_i()},Vi=e=>bi()||setTimeout(Hi,0,e),Hi=e=>{let{_focus:t,_root:n,_form:r,multiple:i,control:a}=e;!t||e.contains(n?.activeElement)||(i||zi(e),r&&a&&q(a,`form`,r),e._focus=e._form=void 0)},Ui=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s}=e;if(a?.contains(i))return o&&vi(o,``,Oi),o?.focus();for(let t of s){let{top:a,right:o,bottom:s,left:c}=t.getBoundingClientRect();if(t.contains(i))return Z(e,t);if(r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}i===e&&o?.focus()},Wi=(e,t)=>{let{options:n=[],control:r,multiple:i}=e,a=(r?.value)?.trim()||``;if(t instanceof InputEvent?!t.inputType||t.inputType===`insertReplacementText`:a){t.stopImmediatePropagation(),r&&(r.value=e._value);for(let t of n)if(t.value&&t.value===a)return Z(e,t,i)}else i||zi(e,!1);Ii(e)},Gi=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=i&&i===c,u=l&&i.selectionEnd,d=t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`,f=l?a.length:[...a].indexOf(c);if(l&&o===`Tab`&&!t.shiftKey&&r&&!r.hidden&&(t.preventDefault(),r.tabIndex=0,r.focus(),oi(r,`blur`,()=>q(r,`tabindex`,null),wi)),!(!l&&ui(t)||f===-1||d)){if(o===`ArrowRight`&&!l)f+=1;else if(o===`ArrowLeft`&&!u)--f;else if(o===`Enter`&&l)return zi(e);else if(o===`Backspace`&&!u){if(t.preventDefault(),!s&&a[f])return Z(e,a[f]);l&&--f}else return l||i?.focus();t.preventDefault(),(n=a[Math.max(0,f)]||i)==null||n.focus()}};mi.define(`u-combobox`,Mi);var Ki=class extends Mi{_unmutate;_render;connectedCallback(){super.connectedCallback(),this._render=()=>qi(this),this._unmutate=g(this,this._render,{childList:!0}),f(this,`toggle`,Ji,r)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=this._render=void 0,p(this,`toggle`,Ji,r)}};let qi=({control:e,list:t})=>{e&&!e.placeholder&&l(e,`placeholder`,` `),e&&l(e,`popovertarget`,x(t)||null),t&&l(t,`popover`,`manual`)},Ji=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n}))};b.define(`ds-suggestion`,Ki);var Yi=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Xi=Yi&&/android/i.test(navigator.userAgent);Yi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Zi=`${Xi?`data`:`aria`}-labelledby`,Qi=`:host(:not([hidden])) { display: block }`,$i=typeof HTMLElement>`u`?class{}:HTMLElement;function Q(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var ea=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},ta=(e,...t)=>ea(`add`,e,t),na=(e,...t)=>ea(`remove`,e,t),ra=(e,t)=>e.shadowRoot||e.attachShadow({mode:`open`}).append(ua(`slot`),ua(`style`,t)),ia=new WeakMap,aa=(e,t)=>{if(t===void 0)return ia.get(e);try{ia.get(e).disconnect(),ia.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),ia.set(e,n)}},oa=e=>{var t;let n=e.key===` `||e.key===`Enter`;return n&&((t=e.preventDefault)==null||t.call(e)),n&&e.target instanceof HTMLElement&&e.target.dispatchEvent(new MouseEvent(`click`,e)),n},sa=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ca=0,la=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++ca).toString(32)}`,e.id):``,ua=(e,t,n)=>{let r=document.createElement(e);return t&&(r[e===`style`?`textContent`:`innerHTML`]=t),r},da={define:(e,t)=>!Yi||window.customElements.get(e)||window.customElements.define(e,t)},fa=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,pa=Qi,ma=Qi,ha=Qi,ga=`:host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }`;fa(pa),fa(ma),fa(ga),fa(ha);var _a=`aria-controls`,$=`aria-selected`,va=`data-utabs`,ya=class extends $i{constructor(){super(),ra(this,pa)}connectedCallback(){Q(this,va,``)}get tabList(){return Ta(`tablist`,this)[0]||null}get selectedIndex(){return Da(this.tabs)}set selectedIndex(e){Aa(this.tabs[e])}get tabs(){return Ta(`tab`,this)}get panels(){return Ta(`tabpanel`,this)}},ba=class extends $i{constructor(){super(),ra(this,ma)}connectedCallback(){Q(this,`role`,`tablist`),ta(this,`click,keydown`,this),aa(this,{childList:!0}),requestAnimationFrame(()=>this.handleEvent())}disconnectedCallback(){na(this,`click,keydown`,this),aa(this,!1)}handleEvent(e){var t,n;if(!e||e.type===`mutation`)return this.tabs[Math.max(this.selectedIndex,0)]?.setAttribute($,`true`);let{key:r}=e,i=[...this.tabs],a=i.findIndex(t=>t.contains(e.target)),o=a;if(!(e.defaultPrevented||a===-1)&&(e.type===`click`&&Aa(i[a]),e.type===`keydown`&&!oa(e))){if(r===`ArrowDown`||r===`ArrowRight`)o=(a+1)%i.length;else if(r===`ArrowUp`||r===`ArrowLeft`)o=(a||i.length)-1;else if(r===`End`)o=i.length-1;else if(r===`Home`)o=0;else if(r===`Tab`)o=Da(i);else return;setTimeout(()=>{Q(i[a],`tabindex`,`-1`),Q(i[o],`tabindex`,`0`)}),r!==`Tab`&&(e.preventDefault(),(n=(t=i[o]).focus)==null||n.call(t))}}get tabsElement(){return Oa(this)}get tabs(){return ka(this)}get selectedIndex(){return Da(this.tabs)}set selectedIndex(e){Aa(this.tabs[e])}},xa=!1,Sa=class extends $i{static get observedAttributes(){return[`id`,$,_a]}constructor(){super(),ra(this,ga)}connectedCallback(){Q(this,`role`,`tab`),Q(this,`tabindex`,this.selected?`0`:`-1`)}attributeChangedCallback(){if(!xa&&this.selected&&this.tabList){xa=!0;let e=this.tabList?ka(this.tabList):[],t=Ta(`tabpanel`,this.tabsElement||this),n=Ea(this,t[[...e].indexOf(this)]);n&&Q(n,Zi,la(this));let r=0;for(let i of e){let e=Ea(i,t[r++]);Q(i,`tabindex`,i===this?`0`:`-1`),Q(i,$,`${i===this}`),e?.id&&Q(i,_a,e.id),e&&(e.hidden=e!==n)}xa=!1}}get tabsElement(){return Oa(this)}get tabList(){let e=this.parentElement;return e?.getAttribute(`role`)===`tablist`?e:null}get selected(){return Q(this,$)===`true`}set selected(e){Q(this,$,`${!!e}`)}get index(){let e=this.tabList;return e?[...ka(e)].indexOf(this):0}get panel(){return Ea(this)}},Ca=!1,wa=class extends $i{static get observedAttributes(){return[`id`,`hidden`]}constructor(){super(),ra(this,ha)}connectedCallback(){var e;Q(this,`role`,`tabpanel`),(e=this.tabsElement?.tabList)==null||e.handleEvent(),this.attributeChangedCallback()}attributeChangedCallback(){if(Ca)return;Ca=!0;let e=ja(this.firstChild);this.hidden=Da(this.tabs)===-1,Q(this,`aria-hidden`,`${this.hidden}`),Q(this,`tabindex`,this.hidden||e?null:`0`),Ca=!1}get tabsElement(){return Oa(this)}get tabs(){return sa(this).querySelectorAll(`[role="tab"][${_a}="${this.id}"]`)}},Ta=(e,t)=>t.querySelectorAll(`[role="${e}"]:not(:scope [role="tabpanel"] [role="${e}"])`),Ea=(e,t)=>sa(e).getElementById(Q(e,_a)||la(t)),Da=e=>[...e].findIndex(e=>Q(e,$)===`true`),Oa=e=>e.closest(`[${va}]`),ka=e=>e.querySelectorAll(`:scope > [role="tab"]`),Aa=e=>e&&Q(e,`aria-disabled`)!==`true`&&Q(e,`aria-selected`,`true`),ja=e=>e instanceof Element&&!e.matches(`:disabled,[tabindex^="-"]`)&&e.matches(`[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe`);da.define(`u-tabs`,ya),da.define(`u-tablist`,ba),da.define(`u-tab`,Sa),da.define(`u-tabpanel`,wa);var Ma=class extends ya{},Na=class extends ba{},Pa=class extends Sa{},Fa=class extends wa{};b.define(`ds-tabs`,Ma),b.define(`ds-tablist`,Na),b.define(`ds-tab`,Pa),b.define(`ds-tabpanel`,Fa),i()&&!t()&&n(),e.DSBreadcrumbsElement=Cr,e.DSErrorSummaryElement=Tr,e.DSFieldElement=zr,e.DSPaginationElement=Gr,e.DSSuggestionElement=Ki,e.DSTabElement=Pa,e.DSTabListElement=Na,e.DSTabPanelElement=Fa,e.DSTabsElement=Ma,e.UHTMLDataListElement=dr,e.UHTMLDataListShadowRoot=ir,e.UHTMLDataListStyle=rr,e.pagination=Wr,e.setTooltipElement=yn});
14
+ ::slotted(data:focus) { ${ti} }`;yi(bi);var xi=`beforeinput,blur,focus,click,input,keydown,mousedown`,Si={once:!0,capture:!0,passive:!0},Ci=`false`,wi=$r||ei,Ti=`​`.repeat(5),Ei=`deleteContentBackward`,Di=`insertText`,Oi=`\xA0`,ki={added:`Added`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`},Ai=class extends ni{constructor(){super(),this._item=``,this._speak=``,this._texts=Zr({},ki),this._value=``,this.shadowRoot||this.attachShadow({mode:`open`}).append(J(`slot`,null,{"aria-orientation":`horizontal`,tabindex:`-1`,role:`listbox`,name:`items`}),J(`slot`),J(`div`,`<div role="option" tabindex="-1"></div>`,{"aria-hidden":`true`,role:`listbox`}),J(`style`,bi))}static get observedAttributes(){return Object.keys(ki).map(e=>`data-sr-${e}`)}connectedCallback(){this._root=li(this),ii(this,xi,this,!0),si(this,{attributeFilter:[`value`,`id`,`role`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(Ni,0,this),setTimeout(Ii,0,this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];ki[r]&&(this._texts[r]=n||ki[r])}disconnectedCallback(){si(this,!1),ai(this,xi,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=this._form=void 0}handleEvent(e){let t=e.target;Mi(this)||(e.type===`beforeinput`&&(this._value=t?.value||``),e.type===`blur`&&zi(this),e.type===`click`&&Vi(this,e),e.type===`focus`&&Ri(this,e),e.type===`input`&&Hi(this,e),e.type===`keydown`&&Ui(this,e),e.type===`mousedown`&&vi(e),e.type===`mutation`&&Ni(this,e))}get multiple(){return(q(this,`data-multiple`)??Ci)!==Ci}set multiple(e){q(this,`data-multiple`,e?``:null)}get creatable(){return(q(this,`data-creatable`)??Ci)!==Ci}set creatable(e){q(this,`data-creatable`,e?``:null)}get control(){return this._control?.isConnected||(this._control=this.querySelector(`input`)),this._control}get list(){return this._list?.isConnected||(this._list=this.querySelector(`datalist,[role="listbox"]`)),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(`del`)),this._clear}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){if(!this._options){let e=this.list?.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options}get values(){return[...this.items].map(({value:e})=>e)}},X=e=>(e?.textContent)?.trim()||``,ji=e=>e instanceof HTMLDataElement,Mi=({control:e})=>e?.disabled||e?.readOnly||!1,Ni=(e,t)=>{var n;let{_focus:r,_texts:i,items:a,control:o,list:s,multiple:c}=e;if(!o)return;let l=pi(o),u=l.endsWith(Ti)?q(o,`data-label`):l;q(o,`data-label`,u);let d=`${u}${c?`, ${a.length?i.found.replace(`%d`,`${a.length}`):i.empty}`:``}`,f=[];for(let{addedNodes:e,removedNodes:n}of t?.detail||[]){for(let t of e)ji(t)&&f.unshift(t);for(let e of n)ji(e)&&f.push(e)}let p=c?f.length===1:f[0]===r;if(r&&p){let t=q(o,`aria-expanded`),n=q(o,`inputmode`),a=ji(r)?o:r,s=!f[0].isConnected;e._speak=`${i[s?`removed`:`added`]} ${X(f[0])}, `,(wi||r===o)&&hi(e._speak),o!==a&&(wi&&q(o,`aria-expanded`,null),wi&&q(o,`inputmode`,`none`),d=Oi,o.focus()),setTimeout(()=>{var r;q(o,`aria-expanded`,t),q(o,`inputmode`,s?`none`:n),(r=a?.focus)==null||r.call(a),q(o,`inputmode`,n),e._speak=``,wi?setTimeout(Ni,100,e):ii(e,`blur`,()=>Ni(e),Si)},100)}let m=0,h=e.querySelector(`select`),g=Mi(e)?``:i.remove,_=e.shadowRoot?.firstElementChild;_&&q(_,`aria-label`,i.items);for(let t of a){let n=h?.options[m++],r=X(t),o=t.value||r;q(t,`aria-label`,`${e._speak}${r}, ${g}`),q(t,`aria-selected`,`true`),q(t,`role`,`option`),q(t,`slot`,`items`),q(t,`tabindex`,`-1`),q(t,`value`,o),n?Object.assign(n,{textContent:r,value:o}):h?.appendChild(new Option(r,o,!0,!0)),ei&&q(t,`title`,`${m} ${i.of} ${a.length}`)}h&&q(h,`multiple`,c?``:null);for(let e of[...h?.options||[]].slice(m))e.remove();!c&&m>1&&console.warn(e,` Multiple <data> found in single mode.`),s&&(q(s,`aria-multiselectable`,`${c}`),q(o,`list`,di(s)),q(o,`aria-label`,`${e._speak}${d}${Ti}`),s.hasAttribute(`popover`)&&(q(o,`popovertarget`,di(s)),q(s,`popover`,`manual`)),s._of=i.of);let v=X(a[0]);v!==e._item&&Ii(e),e._item=v,Pi(e),Fi(e),(n=si(e))==null||n.takeRecords()},Pi=e=>{e.clear&&q(e.clear,`role`,`button`),e.clear&&(e.clear.hidden=!e.control?.value||Mi(e))},Fi=e=>{let{_speak:t,options:n=[],values:r}=e;for(let e of n){let n=q(e,`value`)??X(e);q(e,`aria-label`,t?`${t}${X(e)}`:null),q(e,`selected`,r.includes(n)?``:null)}},Ii=e=>{let{multiple:t,control:n,items:r}=e,i=X(r[0]);!t&&n&&i!==n.value&&gi(n,i,i?Di:Ei)},Li=(e,t=!0)=>{let{_texts:n,options:r=[],creatable:i,control:a,items:o,multiple:s}=e,c=(a?.value)?.trim()||``,l=c.toLowerCase()||null,u=[...r].find(e=>(q(e,`label`)||X(e)).trim().toLowerCase()===l),d={bubbles:!0,cancelable:!0,detail:u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,d))||(u=[...r].find(e=>e.selected)),t)return Fi(e),u?Z(e,u,!1):i&&c?Z(e,{value:c},!1):(!s&&!c&&o[0]?Z(e,o[0]):Ii(e),hi(n.invalid));for(let e of r)e.selected=e===u},Z=(e,t,n=!0)=>{var r;let{control:i,items:a,multiple:o}=e,s=J(`data`,t.label||t.value,{value:t.value}),c=[...a].find(e=>e.value===t.value),l={bubbles:!0,cancelable:!0,detail:c||s};if(c&&!n)return Ii(e);if(c===li(e)?.activeElement&&((r=e.shadowRoot?.querySelector(`[role="option"]`))==null||r.focus()),e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,l))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,s),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,l))}},Ri=(e,{target:t})=>{let{_form:n,control:r,multiple:i}=e;t instanceof HTMLElement&&(e._focus=t),i&&n===void 0&&r&&t===r&&(e._form=q(r,`form`),q(r,`form`,`#`)),hi()},zi=e=>vi()||setTimeout(Bi,0,e),Bi=e=>{let{_focus:t,_root:n,_form:r,multiple:i,control:a}=e;!t||e.contains(n?.activeElement)||(i||Li(e),r&&a&&q(a,`form`,r),e._focus=e._form=void 0)},Vi=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s}=e;if(a?.contains(i))return o&&gi(o,``,Ei),o?.focus();for(let t of s){let{top:a,right:o,bottom:s,left:c}=t.getBoundingClientRect();if(t.contains(i))return Z(e,t);if(r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}i===e&&o?.focus()},Hi=(e,t)=>{let{options:n=[],control:r,multiple:i}=e,a=(r?.value)?.trim()||``;if(t instanceof InputEvent?!t.inputType||t.inputType===`insertReplacementText`:a){t.stopImmediatePropagation(),r&&(r.value=e._value);for(let t of n)if(t.value&&t.value===a)return Z(e,t,i)}else i||Li(e,!1);Pi(e)},Ui=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=i&&i===c,u=l&&i.selectionEnd,d=t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`,f=l?a.length:[...a].indexOf(c);if(l&&o===`Tab`&&!t.shiftKey&&r&&!r.hidden&&(t.preventDefault(),r.tabIndex=0,r.focus(),ii(r,`blur`,()=>q(r,`tabindex`,null),Si)),!(!l&&ci(t)||f===-1||d)){if(o===`ArrowRight`&&!l)f+=1;else if(o===`ArrowLeft`&&!u)--f;else if(o===`Enter`&&l)return Li(e);else if(o===`Backspace`&&!u){if(t.preventDefault(),!s&&a[f])return Z(e,a[f]);l&&--f}else return l||i?.focus();t.preventDefault(),(n=a[Math.max(0,f)]||i)==null||n.focus()}};fi.define(`u-combobox`,Ai);var Wi=class extends Ai{_unmutate;_render;connectedCallback(){super.connectedCallback(),this._render=()=>Gi(this),this._unmutate=g(this,this._render,{childList:!0}),f(this,`toggle`,Ki,r)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=this._render=void 0,p(this,`toggle`,Ki,r)}};let Gi=({control:e,list:t})=>{e&&!e.placeholder&&l(e,`placeholder`,` `),e&&l(e,`popovertarget`,S(t)||null),t&&l(t,`popover`,`manual`)},Ki=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n}))};b.define(`ds-suggestion`,Wi);var qi=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Ji=qi&&/android/i.test(navigator.userAgent);qi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Yi=`${Ji?`data`:`aria`}-labelledby`,Xi=`:host(:not([hidden])) { display: block }`,Zi=typeof HTMLElement>`u`?class{}:HTMLElement;function Q(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var Qi=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},$i=(e,...t)=>Qi(`add`,e,t),ea=(e,...t)=>Qi(`remove`,e,t),ta=(e,t)=>e.shadowRoot||e.attachShadow({mode:`open`}).append(ca(`slot`),ca(`style`,t)),na=new WeakMap,ra=(e,t)=>{if(t===void 0)return na.get(e);try{na.get(e).disconnect(),na.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),na.set(e,n)}},ia=e=>{var t;let n=e.key===` `||e.key===`Enter`;return n&&((t=e.preventDefault)==null||t.call(e)),n&&e.target instanceof HTMLElement&&e.target.dispatchEvent(new MouseEvent(`click`,e)),n},aa=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},oa=0,sa=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++oa).toString(32)}`,e.id):``,ca=(e,t,n)=>{let r=document.createElement(e);return t&&(r[e===`style`?`textContent`:`innerHTML`]=t),r},la={define:(e,t)=>!qi||window.customElements.get(e)||window.customElements.define(e,t)},ua=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,da=Xi,fa=Xi,pa=Xi,ma=`:host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }`;ua(da),ua(fa),ua(ma),ua(pa);var ha=`aria-controls`,$=`aria-selected`,ga=`data-utabs`,_a=class extends Zi{constructor(){super(),ta(this,da)}connectedCallback(){Q(this,ga,``)}get tabList(){return Ca(`tablist`,this)[0]||null}get selectedIndex(){return Ta(this.tabs)}set selectedIndex(e){Oa(this.tabs[e])}get tabs(){return Ca(`tab`,this)}get panels(){return Ca(`tabpanel`,this)}},va=class extends Zi{constructor(){super(),ta(this,fa)}connectedCallback(){Q(this,`role`,`tablist`),$i(this,`click,keydown`,this),ra(this,{childList:!0}),requestAnimationFrame(()=>this.handleEvent())}disconnectedCallback(){ea(this,`click,keydown`,this),ra(this,!1)}handleEvent(e){var t,n;if(!e||e.type===`mutation`)return this.tabs[Math.max(this.selectedIndex,0)]?.setAttribute($,`true`);let{key:r}=e,i=[...this.tabs],a=i.findIndex(t=>t.contains(e.target)),o=a;if(!(e.defaultPrevented||a===-1)&&(e.type===`click`&&Oa(i[a]),e.type===`keydown`&&!ia(e))){if(r===`ArrowDown`||r===`ArrowRight`)o=(a+1)%i.length;else if(r===`ArrowUp`||r===`ArrowLeft`)o=(a||i.length)-1;else if(r===`End`)o=i.length-1;else if(r===`Home`)o=0;else if(r===`Tab`)o=Ta(i);else return;setTimeout(()=>{Q(i[a],`tabindex`,`-1`),Q(i[o],`tabindex`,`0`)}),r!==`Tab`&&(e.preventDefault(),(n=(t=i[o]).focus)==null||n.call(t))}}get tabsElement(){return Ea(this)}get tabs(){return Da(this)}get selectedIndex(){return Ta(this.tabs)}set selectedIndex(e){Oa(this.tabs[e])}},ya=!1,ba=class extends Zi{static get observedAttributes(){return[`id`,$,ha]}constructor(){super(),ta(this,ma)}connectedCallback(){Q(this,`role`,`tab`),Q(this,`tabindex`,this.selected?`0`:`-1`)}attributeChangedCallback(){if(!ya&&this.selected&&this.tabList){ya=!0;let e=this.tabList?Da(this.tabList):[],t=Ca(`tabpanel`,this.tabsElement||this),n=wa(this,t[[...e].indexOf(this)]);n&&Q(n,Yi,sa(this));let r=0;for(let i of e){let e=wa(i,t[r++]);Q(i,`tabindex`,i===this?`0`:`-1`),Q(i,$,`${i===this}`),e?.id&&Q(i,ha,e.id),e&&(e.hidden=e!==n)}ya=!1}}get tabsElement(){return Ea(this)}get tabList(){let e=this.parentElement;return e?.getAttribute(`role`)===`tablist`?e:null}get selected(){return Q(this,$)===`true`}set selected(e){Q(this,$,`${!!e}`)}get index(){let e=this.tabList;return e?[...Da(e)].indexOf(this):0}get panel(){return wa(this)}},xa=!1,Sa=class extends Zi{static get observedAttributes(){return[`id`,`hidden`]}constructor(){super(),ta(this,pa)}connectedCallback(){var e;Q(this,`role`,`tabpanel`),(e=this.tabsElement?.tabList)==null||e.handleEvent(),this.attributeChangedCallback()}attributeChangedCallback(){if(xa)return;xa=!0;let e=ka(this.firstChild);this.hidden=Ta(this.tabs)===-1,Q(this,`aria-hidden`,`${this.hidden}`),Q(this,`tabindex`,this.hidden||e?null:`0`),xa=!1}get tabsElement(){return Ea(this)}get tabs(){return aa(this).querySelectorAll(`[role="tab"][${ha}="${this.id}"]`)}},Ca=(e,t)=>t.querySelectorAll(`[role="${e}"]:not(:scope [role="tabpanel"] [role="${e}"])`),wa=(e,t)=>aa(e).getElementById(Q(e,ha)||sa(t)),Ta=e=>[...e].findIndex(e=>Q(e,$)===`true`),Ea=e=>e.closest(`[${ga}]`),Da=e=>e.querySelectorAll(`:scope > [role="tab"]`),Oa=e=>e&&Q(e,`aria-disabled`)!==`true`&&Q(e,`aria-selected`,`true`),ka=e=>e instanceof Element&&!e.matches(`:disabled,[tabindex^="-"]`)&&e.matches(`[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe`);la.define(`u-tabs`,_a),la.define(`u-tablist`,va),la.define(`u-tab`,ba),la.define(`u-tabpanel`,Sa);var Aa=class extends _a{},ja=class extends va{},Ma=class extends ba{},Na=class extends Sa{};b.define(`ds-tabs`,Aa),b.define(`ds-tablist`,ja),b.define(`ds-tab`,Ma),b.define(`ds-tabpanel`,Na),i()&&!t()&&n(),e.DSBreadcrumbsElement=Sr,e.DSErrorSummaryElement=wr,e.DSFieldElement=Lr,e.DSPaginationElement=Ur,e.DSSuggestionElement=Wi,e.DSTabElement=Ma,e.DSTabListElement=ja,e.DSTabPanelElement=Na,e.DSTabsElement=Aa,e.UHTMLDataListElement=ur,e.UHTMLDataListShadowRoot=rr,e.UHTMLDataListStyle=nr,e.pagination=Hr,e.setTooltipElement=vn});
15
15
  //# sourceMappingURL=index.js.map