@digdir/designsystemet-web 1.13.0 → 1.13.1

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)},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}
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)=>!i()||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;function S(e){return i()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++x}`}let C,w=0,T=0,ee=e=>{clearTimeout(T),C&&_(C,`${e}${w++%2?`\xA0`:``}`),e&&(T=setTimeout(ee,2e3,``))},te=()=>{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`,te,r)]);var ne=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,re=ne&&/android/i.test(navigator.userAgent),ie=ne&&/firefox/i.test(navigator.userAgent);ne&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);function ae(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 oe=`__uDetailsPolyfillSummarys`;if(ne&&re&&ie&&!window[oe]){window[oe]=document.getElementsByTagName(`summary`);let e=()=>{if(window[oe])for(let e of window[oe]){let t=e.parentElement;ae(e,`role`,`button`),ae(e,`aria-expanded`,`${!!t&&!!t.open}`)}};requestAnimationFrame(e),new MutationObserver(e).observe(document,{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let se=`:click-delegate-hover`,ce=`data-clickdelegatefor`,le=`[${ce}]`,ue=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=e.isTrusted&&e.button<2&&pe(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()}},de,fe=e=>{let t=pe(e);de!==t&&(de&&de.classList.remove(se),t&&t.classList.add(se),de=t)},pe=({target:e})=>{let t=(e instanceof Element?e.closest(le):null)?.getAttribute(ce),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`,ue,!0),f(document,`mouseover`,fe,r)]);let me=!1,he=({type:e,target:t,clientX:n=0,clientY:r=0})=>{if(e===`pointerdown`){let e=t?.closest?.(`dialog`)?.getBoundingClientRect();me=!!(e&&e.top<=r&&r<=e.bottom&&e.left<=n&&n<=e.right)}else{let e=t instanceof HTMLDialogElement&&!me&&l(t,`closedby`)===`any`;me=!1,e&&requestAnimationFrame(()=>t.open&&t.close())}},ge=()=>{for(let e of document.querySelectorAll(`button[command="show-modal"]`))l(e,`aria-haspopup`,`dialog`)},_e=({command:e,target:t})=>e===`--show-non-modal`&&t instanceof HTMLDialogElement&&t.show();m(`dialog`,()=>[f(document,`command`,_e,r),f(document,`pointerdown pointerup`,he,r),g(document,ge,{attributeFilter:[`command`],attributes:!0,childList:!0,subtree:!0})]);let E=Math.min,D=Math.max,ve=Math.round,ye=Math.floor,O=e=>({x:e,y:e}),be={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function xe(e,t,n){return D(e,E(t,n))}function k(e,t){return typeof e==`function`?e(t):e}function A(e){return e.split(`-`)[0]}function Se(e){return e.split(`-`)[1]}function Ce(e){return e===`x`?`y`:`x`}function we(e){return e===`y`?`height`:`width`}function j(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Te(e){return Ce(j(e))}function Ee(e,t,n){n===void 0&&(n=!1);let r=Se(e),i=Te(e),a=we(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.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}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=Se(e),a=Ne(A(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Oe)))),a}function Fe(e){let t=A(e);return be[t]+e.slice(t.length)}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=j(t),o=Te(t),s=we(o),c=A(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(Se(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}=k(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=o.detectOverflow?o:{...o,detectOverflow:Be},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=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}=ze(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},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}=k(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=A(r),_=j(o),v=A(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fe(o)]:De(o)),x=p!==`none`;!d&&x&&b.push(...Pe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ee(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==j(t))||T.every(e=>j(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=j(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=A(n),s=Se(n),c=j(n)===`y`,l=Ue.has(o)?-1:1,u=a&&c?-1:1,d=k(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}=k(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=j(A(i)),p=Ce(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=xe(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=xe(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}=k(e,t),u={x:n,y:r},d=j(i),f=Ce(d),p=u[f],m=u[d],h=k(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(A(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}=k(e,t),u=await o.detectOverflow(t,l),d=A(i),f=Se(i),p=j(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=E(h-u[g],v),x=E(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=D(u.left,0),t=D(u.right,0),n=D(u.top,0),r=D(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:D(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:D(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ye(){return typeof window<`u`}function M(e){return Xe(e)?(e.nodeName||``).toLowerCase():`#document`}function N(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function P(e){return((Xe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Xe(e){return Ye()?e instanceof Node||e instanceof N(e).Node:!1}function F(e){return Ye()?e instanceof Element||e instanceof N(e).Element:!1}function I(e){return Ye()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function Ze(e){return!Ye()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function Qe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function $e(e){return/^(table|td|th)$/.test(M(e))}function et(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let tt=/transform|translate|scale|rotate|perspective|filter/,nt=/paint|layout|strict|content/,L=e=>!!e&&e!==`none`,rt;function it(e){let t=F(e)?z(e):e;return L(t.transform)||L(t.translate)||L(t.scale)||L(t.rotate)||L(t.perspective)||!ot()&&(L(t.backdropFilter)||L(t.filter))||tt.test(t.willChange||``)||nt.test(t.contain||``)}function at(e){let t=B(e);for(;I(t)&&!R(t);){if(it(t))return t;if(et(t))return null;t=B(t)}return null}function ot(){return rt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rt}function R(e){return/^(html|body|#document)$/.test(M(e))}function z(e){return N(e).getComputedStyle(e)}function st(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function B(e){if(M(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ze(e)&&e.host||P(e);return Ze(t)?t.host:t}function ct(e){let t=B(e);return R(t)?e.ownerDocument?e.ownerDocument.body:e.body:I(t)&&Qe(t)?t:ct(t)}function lt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ct(e),i=r===e.ownerDocument?.body,a=N(r);if(i){let e=ut(a);return t.concat(a,a.visualViewport||[],Qe(r)?r:[],e&&n?lt(e):[])}else return t.concat(r,lt(r,[],n))}function ut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dt(e){let t=z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=I(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ve(n)!==a||ve(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ft(e){return F(e)?e:e.contextElement}function V(e){let t=ft(e);if(!I(t))return O(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dt(t),o=(a?ve(n.width):n.width)/r,s=(a?ve(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let pt=O(0);function mt(e){let t=N(e);return!ot()||!t.visualViewport?pt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ht(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==N(e)?!1:t}function H(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ft(e),o=O(1);t&&(r?F(r)&&(o=V(r)):o=V(e));let s=ht(a,n,r)?mt(a):O(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=N(a),t=r&&F(r)?N(r):r,n=e,i=ut(n);for(;i&&r&&t!==n;){let e=V(i),t=i.getBoundingClientRect(),r=z(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=N(i),i=ut(n)}}return Re({width:u,height:d,x:c,y:l})}function gt(e,t){let n=st(e).scrollLeft;return t?t.left+n:H(P(e)).left+n}function _t(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gt(e,n),y:n.top+t.scrollTop}}function vt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=P(r),s=t?et(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=O(1),u=O(0),d=I(r);if((d||!d&&!a)&&((M(r)!==`body`||Qe(o))&&(c=st(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?_t(o,c):O(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 yt(e){return Array.from(e.getClientRects())}function bt(e){let t=P(e),n=st(e),r=e.ownerDocument.body,i=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+gt(e),s=-n.scrollTop;return z(r).direction===`rtl`&&(o+=D(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function xt(e,t){let n=N(e),r=P(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ot();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=gt(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 St(e,t){let n=H(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=I(e)?V(e):O(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ct(e,t,n){let r;if(t===`viewport`)r=xt(e,n);else if(t===`document`)r=bt(P(e));else if(F(t))r=St(t,n);else{let n=mt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Re(r)}function wt(e,t){let n=B(e);return n===t||!F(n)||R(n)?!1:z(n).position===`fixed`||wt(n,t)}function Tt(e,t){let n=t.get(e);if(n)return n;let r=lt(e,[],!1).filter(e=>F(e)&&M(e)!==`body`),i=null,a=z(e).position===`fixed`,o=a?B(e):e;for(;F(o)&&!R(o);){let t=z(o),n=it(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Qe(o)&&!n&&wt(e,o))?r=r.filter(e=>e!==o):i=t,o=B(o)}return t.set(e,r),r}function Et(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?et(t)?[]:Tt(t,this._c):[].concat(n),r],o=Ct(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=Ct(t,a[e],i);s=D(n.top,s),c=E(n.right,c),l=E(n.bottom,l),u=D(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dt(e){let{width:t,height:n}=dt(e);return{width:t,height:n}}function Ot(e,t,n){let r=I(t),i=P(t),a=n===`fixed`,o=H(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=O(0);function l(){c.x=gt(i)}if(r||!r&&!a)if((M(t)!==`body`||Qe(i))&&(s=st(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?_t(i,s):O(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 kt(e){return z(e).position===`static`}function At(e,t){if(!I(e)||z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return P(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){let n=N(e);if(et(e))return n;if(!I(e)){let t=B(e);for(;t&&!R(t);){if(F(t)&&!kt(t))return t;t=B(t)}return n}let r=At(e,t);for(;r&&$e(r)&&kt(r);)r=At(r,t);return r&&R(r)&&kt(r)&&!it(r)?n:r||at(e)||n}let Mt=async function(e){let t=this.getOffsetParent||jt,n=this.getDimensions,r=await n(e.floating);return{reference:Ot(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nt(e){return z(e).direction===`rtl`}let Pt={convertOffsetParentRelativeRectToViewportRelativeRect:vt,getDocumentElement:P,getClippingRect:Et,getOffsetParent:jt,getElementRects:Mt,getClientRects:yt,getDimensions:Dt,getScale:V,isElement:F,isRTL:Nt};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t){let n=null,r,i=P(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=ye(d),h=ye(i.clientWidth-(u+f)),g=ye(i.clientHeight-(d+p)),_=ye(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:D(0,E(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&&!Ft(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 Lt(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=ft(e),u=i||a?[...l?lt(l):[],...t?lt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?It(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&&!Ft(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 Rt=Ge,zt=Ke,Bt=He,Vt=Je,Ht=qe,Ut=(e,t,n)=>{let r=new Map,i={platform:Pt,...n},a={...i.platform,_c:r};return Ve(e,t,{...i,platform:a})},Wt=`data-placement`,Gt=`data-autoplacement`,Kt=new Map;function qt(e){let{newState:t,oldState:n,target:r,source:i=e.detail}=e,a=r instanceof HTMLElement&&l(r,`popover`)!==null&&Xt(r,`--_ds-floating`);if(!a)return;if(t===`closed`)return Kt.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=Xt(r,`--_ds-floating-overscroll`),s=l(r,Wt)||l(i,Wt)||a,c=l(r,Gt)||l(i,Gt),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:[Rt(u||0),zt({padding:10,limiter:Ht({offset:{mainAxis:f}})}),Zt(),...c===`false`?[]:[Bt({padding:10,crossAxis:!1})],...o?[Vt({apply({availableHeight:e}){o===`fit`&&(r.style.width=`${i.clientWidth}px`),r.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},m=Lt(i,r,async()=>{if(!i?.isConnected)return Kt.get(r)?.();let{x:e,y:t}=await Ut(i,r,p);r.style.translate=`${e}px ${t}px`});Kt.set(r,()=>Kt.delete(r)&&m())}let Jt,Yt=({type:e})=>{if(e===`mousedown`&&(Jt=!1),e===`scroll`&&Jt===!1&&(Jt=!0),e===`mouseup`&&Jt)for(let[e]of Kt)e.showPopover()};m(`popover`,()=>[f(document,`mousedown scroll mouseup`,Yt,!0),f(document,`toggle ds-toggle-source`,qt,r)]);let Xt=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),Zt=()=>({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}}),Qt=e=>(e instanceof HTMLSelectElement||e instanceof HTMLInputElement)&&(e.hasAttribute(`readonly`)||l(e,`aria-readonly`)===`true`),$t=e=>{if(e.key!==`Tab`&&Qt(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()}},en=e=>{let t=e.target?.closest?.(`label`)?.control||e.target;Qt(t)&&(e.preventDefault(),t.focus())},tn=e=>{e.target instanceof HTMLSelectElement&&Qt(e.target)&&e.preventDefault()};m(`readonly`,()=>[f(document,`keydown`,$t),f(document,`click`,en),f(document,`mousedown`,tn)]);let nn=`data-toggle-group`,rn=`[${nn}]`,an=s(()=>{for(let e of document.querySelectorAll(rn))l(e,`aria-label`,d(e,nn))},0),on=e=>{let t=e.target instanceof HTMLInputElement&&e.target.closest(rn);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`,on),g(document,an,{attributeFilter:[nn],attributes:!0,childList:!0,subtree:!0})]);let U,sn,cn=0,ln=0,un=i()&&/iPad|iPhone|iPod/.test(navigator.userAgent),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===sn&&U?.matches(`:popover-open`),i=r&&n&&U?.textContent!==n;r&&i&&(U&&_(U,n),document.activeElement===e&&ee(n))}},0),bn=({type:e,target:t})=>{if(clearTimeout(cn),t===U)return;if(e===`mouseover`&&!sn&&!un){cn=setTimeout(bn,300,{target:t});return}let n=t?.closest?.(`[${W}]`);if(n===sn)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(ln),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})),sn=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`&&(ln=setTimeout(Sn,300)):sn=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
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 }`,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 */
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&&ee(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> */