@digdir/designsystemet-web 1.13.0 → 1.13.2

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