@digdir/designsystemet-web 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { UHTMLComboboxElement } from "@u-elements/u-combobox";
4
4
  import * as UTabs from "@u-elements/u-tabs";
5
5
  export * from "@u-elements/u-datalist";
6
6
  //#region package.json
7
- var version = "1.22.0";
7
+ var version = "1.23.0";
8
8
  //#endregion
9
9
  //#region src/utils/utils.ts
10
10
  const ARIA_DESC = "aria-description";
@@ -703,8 +703,9 @@ function apply$1() {
703
703
  //#region src/invokers/invokers.ts
704
704
  if (isBrowser() && !isSupported$1()) apply$1();
705
705
  //#endregion
706
- //#region ../../node_modules/.pnpm/@oddbird+popover-polyfill@0.7.2/node_modules/@oddbird/popover-polyfill/dist/popover-fn.js
707
- var ToggleEvent = class extends Event {
706
+ //#region ../../node_modules/.pnpm/@oddbird+popover-polyfill@0.7.2_patch_hash=1f3e1d4b9b98be6ea6d4707fbe7b7ac66be549654cb4bb41ad60295c10c029f8/node_modules/@oddbird/popover-polyfill/dist/popover-fn.js
707
+ var EventClass = globalThis.Event || class {};
708
+ var ToggleEvent = class extends EventClass {
708
709
  oldState;
709
710
  newState;
710
711
  constructor(type, init = {}) {
@@ -1309,20 +1310,23 @@ const ATTR_AUTO = "data-autoplacement";
1309
1310
  const POPOVERS = /* @__PURE__ */ new Map();
1310
1311
  const handleToggle = (e) => toggle(getComposedTarget(e), e.newState, e.oldState, e.source || e.detail);
1311
1312
  function toggle(el, newState, oldState, source) {
1312
- const float = el instanceof HTMLElement && attr(el, "popover") !== null && getCSSProp(el, "--_ds-floating");
1313
+ const isPopover = el instanceof HTMLElement && attr(el, "popover") !== null;
1313
1314
  const prev = POPOVERS.get(el);
1314
1315
  if (newState === "open" && prev && prev.source === source) return;
1315
1316
  prev?.cleanup();
1316
- if (newState === "closed" || !float) return;
1317
+ if (newState === "closed" || !isPopover) return;
1317
1318
  if (!source) {
1318
1319
  const css = el.id && `[popovertarget="${el.id}"],[commandfor="${el.id}"]`;
1319
1320
  source = css && getRoot(el).querySelector(css) || void 0;
1320
1321
  }
1321
1322
  if (!source || source === el || oldState && oldState === newState) return;
1323
+ const dsFloating = getCSSProp(el, "--_ds-floating");
1324
+ const attrPlacement = attr(el, ATTR_PLACE) ?? attr(source, ATTR_PLACE);
1325
+ if (attrPlacement === null && !dsFloating) return;
1322
1326
  el.style.scrollMarginBottom = `var(--_ds-floating-arrow-size)`;
1323
1327
  const padding = 10;
1328
+ const placement = attrPlacement || dsFloating || "top";
1324
1329
  const overscroll = getCSSProp(el, "--_ds-floating-overscroll");
1325
- const placement = attr(el, ATTR_PLACE) || attr(source, ATTR_PLACE) || float;
1326
1330
  const auto = attr(el, ATTR_AUTO) || attr(source, ATTR_AUTO);
1327
1331
  const arrowSize = parseFloat(getCSSProp(el, "scroll-margin-bottom")) || 0;
1328
1332
  const shiftProp = placement.match(/left|right/gi) ? "Height" : "Width";
@@ -1346,10 +1350,8 @@ function toggle(el, newState, oldState, source) {
1346
1350
  ...overscroll ? [size({ apply({ availableHeight }) {
1347
1351
  if (sized) return;
1348
1352
  sized = true;
1349
- const width = `${source.offsetWidth}px`;
1350
1353
  const maxHeight = `${Math.max(50, availableHeight - padding * 2)}px`;
1351
1354
  requestAnimationFrame(() => {
1352
- if (overscroll === "fit" && el.style.width !== width) el.style.width = width;
1353
1355
  if (el.style.maxHeight !== maxHeight) el.style.maxHeight = maxHeight;
1354
1356
  });
1355
1357
  } })] : []
@@ -1357,6 +1359,10 @@ function toggle(el, newState, oldState, source) {
1357
1359
  };
1358
1360
  const unfloat = autoUpdate(source, el, async () => {
1359
1361
  if (!source?.isConnected) return POPOVERS.get(el)?.cleanup();
1362
+ if (overscroll === "fit") {
1363
+ const width = `${source.offsetWidth}px`;
1364
+ if (el.style.width !== width) el.style.width = width;
1365
+ }
1360
1366
  const { x, y } = await computePosition(source, el, options);
1361
1367
  el.style.translate = `${x}px ${y}px`;
1362
1368
  });
@@ -1889,6 +1895,7 @@ var DSPaginationElement = class extends DSElement {
1889
1895
  this._unmutate = this._render = void 0;
1890
1896
  }
1891
1897
  };
1898
+ const isNamedByAriaLabel = (el) => !el.textContent?.trim() && !attr(el, "aria-labelledby");
1892
1899
  const render$1 = (self) => {
1893
1900
  const current = Number(attr(self, ATTR_CURRENT));
1894
1901
  const total = Number(attr(self, ATTR_TOTAL));
@@ -1902,9 +1909,11 @@ const render$1 = (self) => {
1902
1909
  show
1903
1910
  });
1904
1911
  items.forEach((item, i) => {
1905
- const page = i ? items[i + 1] ? pages[i - 1]?.page : next : prev;
1912
+ const isStep = i !== 0 && !!items[i + 1];
1913
+ const page = isStep ? pages[i - 1]?.page : i ? next : prev;
1906
1914
  attr(item, "aria-current", pages[i - 1]?.current ? "true" : null);
1907
- attr(item, ARIA_LABEL, `${page ?? "hidden"}`);
1915
+ if (isStep) attr(item, ARIA_LABEL, `${page ?? "hidden"}`);
1916
+ else if (isNamedByAriaLabel(item)) attr(item, ARIA_LABEL, attrOrCSS(item, ARIA_LABEL));
1908
1917
  attr(item, "role", page ? null : "none");
1909
1918
  attr(item, "tabindex", page ? null : "-1");
1910
1919
  if (item instanceof HTMLButtonElement) attr(item, "value", `${page}`);
@@ -1960,30 +1969,32 @@ const render = (self) => {
1960
1969
  }
1961
1970
  handleEmpty({ currentTarget: self });
1962
1971
  };
1963
- const handleEmpty = ({ currentTarget: self }) => {
1964
- const { creatable, control, options, values } = self;
1972
+ const handleEmpty = (event) => {
1973
+ const self = event.currentTarget;
1974
+ const { creatable, control, options } = self;
1965
1975
  if (!options) return;
1966
1976
  const value = control?.value.trim() || "";
1967
1977
  const query = value.toLowerCase();
1968
- let emptyOp;
1969
- let hasMatch = false;
1978
+ let emptyOpt;
1979
+ let hasLabel = false;
1970
1980
  for (const opt of options) {
1971
- if (!emptyOp && opt.hasAttribute(ATTR_EMPTY)) emptyOp = opt;
1972
- else if (!hasMatch && (!query || opt.label?.toLowerCase() === query)) hasMatch = true;
1973
- if (hasMatch && emptyOp) break;
1974
- }
1975
- if (!emptyOp) return;
1976
- emptyOp.hidden = hasMatch;
1977
- attr(emptyOp, "label", value);
1978
- attr(emptyOp, "value", creatable ? value : "");
1981
+ if (!emptyOpt && opt.hasAttribute(ATTR_EMPTY)) emptyOpt = opt;
1982
+ else if (!hasLabel && (!query || opt.label?.toLowerCase() === query)) hasLabel = true;
1983
+ if (hasLabel && emptyOpt) break;
1984
+ }
1985
+ if (!emptyOpt) return;
1986
+ emptyOpt.hidden = hasLabel || creatable && !value;
1987
+ attr(emptyOpt, "label", value);
1988
+ attr(emptyOpt, "value", creatable ? value : "");
1979
1989
  if (creatable) {
1980
- const found = values.some((val) => val === value);
1981
- const text = attrOrCSS(emptyOp, ATTR_EMPTY);
1982
- const hint = !found && text?.replace(REGEX_CREATE, () => value) || value;
1983
- if (!text) warn(`Missing ${ATTR_EMPTY} value on:`, emptyOp);
1984
- else attr(emptyOp, ATTR_EMPTY, text);
1985
- attr(emptyOp, "disabled", found && emptyOp.textContent ? "true" : null);
1986
- attr(emptyOp, ATTR_CREATE, hint);
1990
+ const hasValue = self.values.includes(value);
1991
+ const text = attrOrCSS(emptyOpt, ATTR_EMPTY);
1992
+ const hint = !hasValue && text?.replace(REGEX_CREATE, () => value) || value;
1993
+ if (!text) warn(`Missing ${ATTR_EMPTY} value on:`, emptyOpt);
1994
+ else attr(emptyOpt, ATTR_EMPTY, text);
1995
+ const disabled = hasValue && emptyOpt.textContent ? "true" : null;
1996
+ attr(emptyOpt, "disabled", disabled);
1997
+ attr(emptyOpt, ATTR_CREATE, hint);
1987
1998
  }
1988
1999
  };
1989
2000
  const polyfillToggleSource = (event) => {
package/dist/umd/index.js CHANGED
@@ -1,4 +1,4 @@
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`});var t=`1.22.0`;let n=`aria-label`,r=`aria-labelledby`,i={passive:!0,capture:!0},a=()=>typeof window<`u`&&typeof document<`u`,o=()=>a()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),s=typeof HTMLElement>`u`?class{}:HTMLElement;function c(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let l=(e,...t)=>!a()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),u=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),d=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),f=/^["']|["']$/g,p=/\\(["'])/g,m=(e,t)=>{let n=u(e,t);return n||=d(e,`--_ds-${t}`).replace(f,``).replace(p,`$1`).trim(),n||null},h=e=>{let t=e?.getRootNode?.()||e?.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:e?.ownerDocument||document},g=e=>{let t=e.target?.shadowRoot&&e.composedPath()[0]||e.target;return t?.nodeType===1?t:null},_=e=>{let t=new Set;for(;e;)t.add(e),e=e.nodeType===11?e.host:e.assignedSlot||e.parentNode;return t},v=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>y(e,...t)},y=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},b=`_dsHotReloadCleanup${t}`,x=(e,t)=>{if(a()){window[b]||(window[b]=new Map);for(let t of window[b]?.get(e)||[])t();window[b]?.set(e,t())}},S=(e,t,n)=>{let r=()=>i.disconnect(),i=new MutationObserver(n=>{if(!a()||!e.isConnected)return r();t(e,n)});return t(e),i.observe(e,n),r},C=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))u(n,e,r);return n},w={define:(e,t)=>!a()||window.customElements.get(e)||window.customElements.define(e,t)},T=0;function E(e){return a()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++T}`}let D,ee=0,te=0,ne=e=>{clearTimeout(te),D&&(D.textContent=`${e}${ee++%2?`\xA0`:``}`),e&&(te=setTimeout(ne,2e3,``))},re=()=>{document.readyState===`complete`&&(D||(D=C(`div`,{"aria-live":`assertive`}),D.style.overflow=`hidden`,D.style.position=`fixed`,D.style.whiteSpace=`nowrap`,D.style.width=`1px`),D.isConnected||document.body.appendChild(D))};x(`announce`,()=>[v(document,`focus mouseover`,re,i)]);let ie=`:click-delegate-hover`,ae=new Set([`A`,`BUTTON`,`DETAILS`,`DIALOG`,`INPUT`,`LABEL`,`SELECT`,`TEXTAREA`]),oe=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=g(e),r=e.button<2&&ue(e);if(!(!r||r.contains(n))){for(let e of _(n))if(e.control===r)return;if(t&&r instanceof HTMLAnchorElement)return window.open(r.href,void 0,r.rel);e.stopImmediatePropagation(),r.click()}},se,ce,le=e=>{let t=g(e);if(!t||t===ce)return;ce=t;let n=ue(e);se!==n&&(se&&se.classList.remove(ie),n&&n.classList.add(ie),se=n)},ue=e=>{let t;for(let n of e.composedPath()){if(n.nodeType!==1)continue;n.nodeName===`LABEL`&&(n=n.control||n);let e=n.getAttribute(`data-clickdelegatefor`);if(e){let r=h(n).getElementById(e);return r&&!(t&&t!==r)&&!r.disabled&&!r.readOnly?r:void 0}!t&&de(n)&&(t=n)}},de=e=>e.isContentEditable||e.popover||ae.has(e.nodeName)||u(e,`role`)===`button`;x(`clickdelegatefor`,()=>[v(window,`click auxclick`,oe,!0),v(document,`mousemove`,le,i)]);var fe=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,pe=fe(),me=pe?navigator.userAgent:``,he=/android/i.test(me),ge=/firefox/i.test(me);pe&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var _e=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ve=(e,t,n)=>{let r=new MutationObserver(n=>{if(!fe()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ye=`__uDetailsPolyfillSummarys`;if(fe()&&he&&ge&&!window[ye]){let e=document.getElementsByTagName(`summary`);window[ye]=ve(document,()=>{for(let t of e){let e=t.parentElement;_e(t,`role`,`button`),_e(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let be=!1,xe=e=>{let{type:t,clientX:n=0,clientY:r=0}=e,i=g(e);if(i&&t===`pointerdown`)for(let e of _(i)){if(e.nodeName!==`DIALOG`)continue;let t=e.getBoundingClientRect();be=t.top<=r&&r<=t.bottom&&t.left<=n&&n<=t.right;return}else{let e=i?.nodeName===`DIALOG`&&!be&&u(i,`closedby`)===`any`;be=!1,e&&setTimeout(Se,0,i)}},Se=e=>e.open&&e.close(),Ce=`--show-non-modal`,we=e=>{for(let t of e.composedPath()){let e=t.nodeType===1&&u(t,`command`);if(e===`show-modal`||e===Ce)return u(t,`aria-haspopup`,`dialog`)}},Te=({command:e,target:t})=>e===Ce&&t instanceof HTMLDialogElement&&t.show();x(`dialog`,()=>[v(document,`command`,Te,i),v(document,`focus`,we,i),v(document,`pointerdown pointerup`,xe,i)]);let Ee=a()?document.getElementsByTagName(`fieldset`):[],De=()=>{for(let e of Ee){if(e.hasAttribute(`aria-labelledby`))continue;let t=``;for(let n of e.children){let e=n.nodeName;(e===`LEGEND`||n.getAttribute(`data-field`)===`description`||e===`P`&&n.previousElementSibling?.nodeName===`LEGEND`)&&(t+=`${E(n)} `)}u(e,r,t.trim()||null)}};x(`fieldset`,()=>[S(document,De,{childList:!0,subtree:!0})]);let Oe=`focusgroup`,ke=`${Oe}start`,Ae=new WeakMap,je=new Map,Me={listbox:{block:!0,wrap:!1,items:`option`},menu:{block:!0,wrap:!0,items:`menuitem`},menubar:{block:!1,wrap:!0,items:`menuitem`},radiogroup:{block:null,wrap:!0,items:`radio`},tablist:{block:!1,wrap:!0,items:`tab`},toolbar:{block:!1,wrap:!1,items:null}},Ne=!1,Pe=new Set([`AUDIO`,`VIDEO`,`TEXTAREA`,`SELECT`,`date`,`datetime-local`,`email`,`month`,`number`,`password`,`range`,`search`,`tel`,`text`,`time`,`url`,`week`]),Fe=a()&&(Oe in HTMLElement.prototype||`focusGroup`in HTMLElement.prototype),Ie=e=>Ne=e,Le=e=>{if(e.defaultPrevented||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.key===`Tab`,n=e.key===`ArrowUp`||e.key===`ArrowDown`,r=n||e.key===`ArrowLeft`||e.key===`ArrowRight`;if(!t&&!r&&e.key!==`Home`&&e.key!==`End`)return;t&&(Ie(!0),setTimeout(Ie,100,!1));let i=g(e);if(!i||qe(i))return;let a=ze(_(i));if(a?.role&&a?.el===i&&(a=ze(_(a.el.parentNode))),!a?.role)return;let o=Ve(a.el,i),s=0;if(t){let e=o.filter(e=>e!==i);return setTimeout(Je,0,e,Je(e))}if(e.key===`Home`)s=0;else if(e.key===`End`)s=o.length-1;else{let{direction:t,writingMode:r}=getComputedStyle(i),c=r.startsWith(`vertical`),l=c?r===`vertical-rl`:t===`rtl`,u=e.key===`ArrowDown`||e.key===`ArrowRight`,d=n!==c,f=u!==(!n&&l);if((a.block??d)!==d)return;s=o.indexOf(i)+(f?1:-1),s=a.wrap?(o.length+s)%o.length:Math.max(0,Math.min(s,o.length-1))}o[s]!==i&&e.preventDefault(),o[s]?.focus?.()},Re=e=>{let t=g(e),n=_(t);for(let[e,t]of je)!n.has(e)&&je.delete(e)&&t();for(let e of n)e.nodeType===11&&!je.has(e)&&je.set(e,v(e,`focus`,Re,i));if(e.target?.shadowRoot)return;let r=ze(n);if(r?.role){if(Ne&&!qe(r.focus)){let e=He(Ve(r.el,null),t),n=r.memory&&e.includes(r.focus)&&r.focus||e.find(e=>e?.hasAttribute(ke))||e[0];if(n!==t)return n?.focus?.()}r.focus=t}},ze=e=>{for(let t of e){if(t.nodeType!==Node.ELEMENT_NODE)continue;let e=t.getAttribute(Oe);if(e!==null){let n=Ae.get(t);if(n?.key===e)return n;n=Be(t,e),Ae.set(t,n);for(let e of Ve(t))e&&!e.hasAttribute(`role`)&&u(e,`role`,n.items);return t.hasAttribute(`role`)||u(t,`role`,n.role),n}if(We(t))return}},Be=(e,t)=>{let n=new Set(t.toLowerCase().split(` `)),r=[...n].find(e=>e in Me),i=Me[r],a=n.has(`inline`),o=n.has(`block`);return{key:t,el:e,role:r,block:a&&o?null:o||!a&&i?.block,focus:null,items:i?.items,memory:!n.has(`nomemory`),wrap:n.has(`wrap`)||!n.has(`nowrap`)&&i?.wrap}},Ve=(e,t,n=[],r=!1)=>{let i=e?.nodeName===`SLOT`?e.assignedElements({flatten:!0}):(e?.shadowRoot||e)?.children;for(let e=0,a=i?.length||e;i&&e<a;e++){let a=i[e];if(a.nodeName===`SLOT`)Ve(a,t,n,r);else if(Ue(a)&&!We(a)&&Ge(a)){let e=a.getAttribute(Oe);a===t||!r&&e!==`none`&&Ke(a)?n.push(a):e!==null&&t===null?n.push(null):Ve(a,t,n,r||e!==null)}}return n},He=(e,t)=>{let n=e.indexOf(t),r=e.indexOf(null,n);return e.slice(e.lastIndexOf(null,n)+1,r===-1?void 0:r)},Ue=e=>!e.inert&&!e.hidden&&!e.disabled,We=e=>e?.nodeName===`DIALOG`||e?.hasAttribute(`popover`),Ge=a()&&typeof Element.prototype.checkVisibility==`function`?e=>e.checkVisibility():e=>e.offsetParent!==null,Ke=e=>e.isContentEditable||e.tabIndex>=0&&!e.disabled,qe=e=>e?.isContentEditable||Pe.has(e?.nodeName)||e?.nodeName===`INPUT`&&Pe.has(e.type),Je=(e,t)=>Array.from(e,(e,n)=>{let r=e?.getAttribute(`tabindex`);return e&&u(e,`tabindex`,t?t[n]:`-1`),r});Fe||x(Oe,()=>[v(document,`keydown`,Le),v(document,`focus`,Re,i),()=>{for(let[,e]of je)e();je.clear()}]);function Ye(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function Xe(){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===`toggle-popover`||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})}a()&&!Ye()&&Xe();let Ze=Math.min,O=Math.max,Qe=Math.round,$e=Math.floor,k=e=>({x:e,y:e}),et={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function tt(e,t,n){return O(e,Ze(t,n))}function A(e,t){return typeof e==`function`?e(t):e}function j(e){return e.split(`-`)[0]}function nt(e){return e.split(`-`)[1]}function rt(e){return e===`x`?`y`:`x`}function it(e){return e===`y`?`height`:`width`}function M(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function at(e){return rt(M(e))}function ot(e,t,n){n===void 0&&(n=!1);let r=nt(e),i=at(e),a=it(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ht(o)),[o,ht(o)]}function st(e){let t=ht(e);return[ct(e),t,ct(t)]}function ct(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let lt=[`left`,`right`],ut=[`right`,`left`],dt=[`top`,`bottom`],ft=[`bottom`,`top`];function pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ut:lt:t?lt:ut;case`left`:case`right`:return t?dt:ft;default:return[]}}function mt(e,t,n,r){let i=nt(e),a=pt(j(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ct)))),a}function ht(e){let t=j(e);return et[t]+e.slice(t.length)}function gt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _t(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gt(e)}function vt(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 yt(e,t,n){let{reference:r,floating:i}=e,a=M(t),o=at(t),s=it(o),c=j(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}}let m=nt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function bt(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}=A(t,e),p=_t(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vt(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=vt(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 xt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:bt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yt(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}=yt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},St=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}=A(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=j(r),_=M(o),v=j(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ht(o)]:st(o)),x=p!==`none`;!d&&x&&b.push(...mt(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ot(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===M(t)||T.every(e=>M(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=M(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{}}}},Ct=new Set([`left`,`top`]);async function wt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=j(n),s=nt(n),c=M(n)===`y`,l=Ct.has(o)?-1:1,u=a&&c?-1:1,d=A(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 Tt=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 wt(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}}}}},Et=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}=A(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=M(i),p=rt(f),m=u[p],h=u[f],g=(e,t)=>tt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Dt=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}=A(e,t),u={x:n,y:r},d=M(i),f=rt(d),p=u[f],m=u[d],h=A(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Ct.has(j(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}}}},Ot=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=A(e,t),c=await i.detectOverflow(t,s),l=j(n),u=nt(n),d=M(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ze(p-c[m],g),y=Ze(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*O(c.left,c.right):S=p-2*O(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function kt(){return typeof window<`u`}function At(e){return jt(e)?(e.nodeName||``).toLowerCase():`#document`}function N(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function P(e){return((jt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jt(e){return kt()?e instanceof Node||e instanceof N(e).Node:!1}function F(e){return kt()?e instanceof Element||e instanceof N(e).Element:!1}function I(e){return kt()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function Mt(e){return!kt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function Nt(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 Pt(e){return/^(table|td|th)$/.test(At(e))}function Ft(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let It=/transform|translate|scale|rotate|perspective|filter/,Lt=/paint|layout|strict|content/,L=e=>!!e&&e!==`none`,Rt;function zt(e){let t=F(e)?R(e):e;return L(t.transform)||L(t.translate)||L(t.scale)||L(t.rotate)||L(t.perspective)||!Vt()&&(L(t.backdropFilter)||L(t.filter))||It.test(t.willChange||``)||Lt.test(t.contain||``)}function Bt(e){let t=z(e);for(;I(t)&&!Ht(t);){if(zt(t))return t;if(Ft(t))return null;t=z(t)}return null}function Vt(){return Rt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Rt}function Ht(e){return/^(html|body|#document)$/.test(At(e))}function R(e){return N(e).getComputedStyle(e)}function Ut(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(At(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mt(e)&&e.host||P(e);return Mt(t)?t.host:t}function Wt(e){let t=z(e);return Ht(t)?(e.ownerDocument||e).body:I(t)&&Nt(t)?t:Wt(t)}function Gt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wt(e),i=r===e.ownerDocument?.body,a=N(r);if(i){let e=Kt(a);return t.concat(a,a.visualViewport||[],Nt(r)?r:[],e&&n?Gt(e):[])}else return t.concat(r,Gt(r,[],n))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qt(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=I(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qe(n)!==a||Qe(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jt(e){return F(e)?e:e.contextElement}function Yt(e){let t=Jt(e);if(!I(t))return k(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qt(t),o=(a?Qe(n.width):n.width)/r,s=(a?Qe(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let Xt=k(0);function Zt(e){let t=N(e);return!Vt()||!t.visualViewport?Xt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===N(e)}function $t(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jt(e),o=k(1);t&&(r?F(r)&&(o=Yt(r)):o=Yt(e));let s=Qt(a,n,r)?Zt(a):k(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&&r){let e=N(a),t=F(r)?N(r):r,n=e,i=Kt(n);for(;i&&t!==n;){let e=Yt(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=N(i),i=Kt(n)}}return vt({width:u,height:d,x:c,y:l})}function en(e,t){let n=Ut(e).scrollLeft;return t?t.left+n:$t(P(e)).left+n}function tn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=P(r),s=t?Ft(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=k(1),u=k(0),d=I(r);if((d||!a)&&((At(r)!==`body`||Nt(o))&&(c=Ut(r)),d)){let e=$t(r);l=Yt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?tn(o,c):k(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 rn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function an(e){let t=Ut(e),n=e.ownerDocument.body,r=O(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=O(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+en(e),o=-t.scrollTop;return R(n).direction===`rtl`&&(a+=O(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function on(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=N(e),a=P(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Vt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(en(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sn(e,t){let n=$t(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Yt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=on(e,n,t);else if(t===`document`)r=an(P(e));else if(F(t))r=sn(t,n);else{let n=Zt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vt(r)}function ln(e,t){let n=t.get(e);if(n)return n;let r=Gt(e,[],!1).filter(e=>F(e)&&At(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?z(e):e;for(;F(o)&&!Ht(o);){let e=R(o),t=zt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=z(o)}return t.set(e,r),r}function un(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ft(t)?[]:ln(t,this._c):[].concat(n),r],o=cn(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=cn(t,a[e],i);s=O(n.top,s),c=Ze(n.right,c),l=Ze(n.bottom,l),u=O(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dn(e){let{width:t,height:n}=qt(e);return{width:t,height:n}}function fn(e,t,n){let r=I(t),i=P(t),a=n===`fixed`,o=$t(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=k(0);if((r||!a)&&((At(t)!==`body`||Nt(i))&&(s=Ut(t)),r)){let e=$t(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=en(i));let l=i&&!r&&!a?tn(i,s):k(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pn(e){return R(e).position===`static`}function mn(e,t){if(!I(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return P(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){let n=N(e);if(Ft(e))return n;if(!I(e)){let t=z(e);for(;t&&!Ht(t);){if(F(t)&&!pn(t))return t;t=z(t)}return n}let r=mn(e,t);for(;r&&Pt(r)&&pn(r);)r=mn(r,t);return r&&Ht(r)&&pn(r)&&!zt(r)?n:r||Bt(e)||n}let gn=async function(e){let t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _n(e){return R(e).direction===`rtl`}let vn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:P,getClippingRect:un,getOffsetParent:hn,getElementRects:gn,getClientRects:rn,getDimensions:dn,getScale:Yt,isElement:F,isRTL:_n};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bn(e,t,n){let r=null,i,a=P(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=$e(d),h=$e(a.clientWidth-(u+f)),g=$e(a.clientHeight-(d+p)),_=$e(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:O(0,Ze(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=N(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xn(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=Jt(e),u=i||a?[...l?Gt(l):[],...t?Gt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bn(l,n,a):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?$t(e):null;c&&g();function g(){let t=$t(e);h&&!yn(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 Sn=Tt,Cn=Et,wn=St,Tn=Ot,En=Dt,Dn=(e,t,n)=>{let r=new Map,i=n??{},a={...vn,...i.platform,_c:r};return xt(e,t,{...i,platform:a})};var On=class extends Event{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},kn=new WeakMap;function An(e,t,n){kn.set(e,setTimeout(()=>{kn.has(e)&&e.dispatchEvent(new On(`toggle`,{cancelable:!1,oldState:t,newState:n}))},0))}var jn=globalThis.ShadowRoot||function(){},Mn=globalThis.HTMLDialogElement||function(){},Nn=new WeakMap,B=new WeakMap,V=new WeakMap,Pn=new WeakMap;function Fn(e){return Pn.get(e)||`hidden`}var In=new WeakMap;function Ln(e){return[...e].pop()}function Rn(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=Fn(t);(e.popoverTargetAction!==`show`||n!==`showing`)&&(e.popoverTargetAction!==`hide`||n!==`hidden`)&&(n===`showing`?Qn(t,!0,!0):H(t,!1)&&(In.set(t,e),Zn(t)))}function H(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&Fn(e)!==`showing`||!t&&Fn(e)!==`hidden`||e instanceof Mn&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function zn(e){if(!e)return 0;let t=B.get(document)||new Set,n=V.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function Bn(e){let t=Wn(e),n=Gn(e);return zn(t)>zn(n)?t:n}function Vn(e){let t,n=V.get(e)||new Set,r=B.get(e)||new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=Ln(i),t.isConnected?t:(i.delete(t),Vn(e))):null}function Hn(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function Un(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?Un(e.parentNode):e}function Wn(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&Pn.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Gn(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Kn(e,t){let n=new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=Wn(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||Un(e)),i}function qn(e){return e.hidden||e instanceof jn||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function Jn(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(qn(i))return i;i=r.nextNode()}}function Yn(e){var t;(t=Jn(e))==null||t.focus()}var Xn=new WeakMap;function Zn(e){if(!H(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new On(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!H(e,!1))return;let n=!1,r=e.popover,i=null,a=Kn(e,B.get(t)||new Set),o=Kn(e,V.get(t)||new Set);if(r===`auto`&&(er(V.get(t)||new Set,n,!0),U(a||t,n,!0),i=`auto`),r===`hint`&&(o?(U(o,n,!0),i=`hint`):(er(V.get(t)||new Set,n,!0),a?(U(a,n,!0),i=`auto`):i=`hint`)),r===`auto`||r===`hint`){if(r!==e.popover||!H(e,!1))return;Vn(t)||(n=!0),i===`auto`?(B.has(t)||B.set(t,new Set),B.get(t).add(e)):i===`hint`&&(V.has(t)||V.set(t,new Set),V.get(t).add(e))}Xn.delete(e);let s=t.activeElement;e.classList.add(`:popover-open`),Pn.set(e,`showing`),Nn.has(t)||Nn.set(t,new Set),Nn.get(t).add(e),ar(In.get(e),!0),Yn(e),n&&s&&e.popover===`auto`&&Xn.set(e,s),An(e,`closed`,`open`)}function Qn(e,t=!1,n=!1){var r,i;if(!H(e,!0))return;let a=e.ownerDocument;if([`auto`,`hint`].includes(e.popover)&&(U(e,t,n),!H(e,!0)))return;let o=B.get(a)||new Set,s=o.has(e)&&Ln(o)===e;if(ar(In.get(e),!1),In.delete(e),n&&(e.dispatchEvent(new On(`beforetoggle`,{oldState:`open`,newState:`closed`})),s&&Ln(o)!==e&&U(e,t,n),!H(e,!0)))return;(r=Nn.get(a))==null||r.delete(e),o.delete(e),(i=V.get(a))==null||i.delete(e),e.classList.remove(`:popover-open`),Pn.set(e,`hidden`),n&&An(e,`open`,`closed`);let c=Xn.get(e);c&&(Xn.delete(e),t&&c.focus())}function $n(e,t=!1,n=!1){let r=Vn(e);for(;r;)Qn(r,t,n),r=Vn(e)}function er(e,t=!1,n=!1){let r=Hn(e);for(;r;)Qn(r,t,n),r=Hn(e)}function tr(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;Fn(o)===`showing`&&t.size;)Qn(Ln(t),n,r);t.has(e)&&Ln(t)!==e&&(i=!0),i&&(r=!1)}}function U(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return $n(r,t,n);if(V.get(r)?.has(e)){tr(e,V.get(r),t,n);return}er(V.get(r)||new Set,t,n),B.get(r)?.has(e)&&tr(e,B.get(r),t,n)}var nr=new WeakMap;function rr(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument||t;if(!Vn(n))return;let r=Bn(t);if(r&&e.type===`pointerdown`)nr.set(n,r);else if(e.type===`pointerup`){let e=nr.get(n)===r;nr.delete(n),e&&U(r||n,!1,!0)}}var ir=new WeakMap;function ar(e,t=!1){if(!e)return;ir.has(e)||ir.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=ir.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var or=globalThis.ShadowRoot||function(){},sr=`popover-polyfill`;function cr(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype&&`showPopover`in HTMLElement.prototype}function lr(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function W(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var ur=/(^|[^\\]):popover-open\b/g;function dr(){return typeof globalThis.CSSLayerBlockRule==`function`}function fr(e){let t=dr(),n=(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??sr).split(`.`).map(e=>CSS.escape(e)).join(`.`);return`
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`});var t=`1.23.0`;let n=`aria-label`,r=`aria-labelledby`,i={passive:!0,capture:!0},a=()=>typeof window<`u`&&typeof document<`u`,o=()=>a()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),s=typeof HTMLElement>`u`?class{}:HTMLElement;function c(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let l=(e,...t)=>!a()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),u=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),d=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),f=/^["']|["']$/g,p=/\\(["'])/g,m=(e,t)=>{let n=u(e,t);return n||=d(e,`--_ds-${t}`).replace(f,``).replace(p,`$1`).trim(),n||null},h=e=>{let t=e?.getRootNode?.()||e?.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:e?.ownerDocument||document},g=e=>{let t=e.target?.shadowRoot&&e.composedPath()[0]||e.target;return t?.nodeType===1?t:null},_=e=>{let t=new Set;for(;e;)t.add(e),e=e.nodeType===11?e.host:e.assignedSlot||e.parentNode;return t},v=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>y(e,...t)},y=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},b=`_dsHotReloadCleanup${t}`,x=(e,t)=>{if(a()){window[b]||(window[b]=new Map);for(let t of window[b]?.get(e)||[])t();window[b]?.set(e,t())}},S=(e,t,n)=>{let r=()=>i.disconnect(),i=new MutationObserver(n=>{if(!a()||!e.isConnected)return r();t(e,n)});return t(e),i.observe(e,n),r},C=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))u(n,e,r);return n},w={define:(e,t)=>!a()||window.customElements.get(e)||window.customElements.define(e,t)},T=0;function E(e){return a()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++T}`}let D,ee=0,te=0,ne=e=>{clearTimeout(te),D&&(D.textContent=`${e}${ee++%2?`\xA0`:``}`),e&&(te=setTimeout(ne,2e3,``))},re=()=>{document.readyState===`complete`&&(D||(D=C(`div`,{"aria-live":`assertive`}),D.style.overflow=`hidden`,D.style.position=`fixed`,D.style.whiteSpace=`nowrap`,D.style.width=`1px`),D.isConnected||document.body.appendChild(D))};x(`announce`,()=>[v(document,`focus mouseover`,re,i)]);let ie=`:click-delegate-hover`,ae=new Set([`A`,`BUTTON`,`DETAILS`,`DIALOG`,`INPUT`,`LABEL`,`SELECT`,`TEXTAREA`]),oe=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=g(e),r=e.button<2&&ue(e);if(!(!r||r.contains(n))){for(let e of _(n))if(e.control===r)return;if(t&&r instanceof HTMLAnchorElement)return window.open(r.href,void 0,r.rel);e.stopImmediatePropagation(),r.click()}},se,ce,le=e=>{let t=g(e);if(!t||t===ce)return;ce=t;let n=ue(e);se!==n&&(se&&se.classList.remove(ie),n&&n.classList.add(ie),se=n)},ue=e=>{let t;for(let n of e.composedPath()){if(n.nodeType!==1)continue;n.nodeName===`LABEL`&&(n=n.control||n);let e=n.getAttribute(`data-clickdelegatefor`);if(e){let r=h(n).getElementById(e);return r&&!(t&&t!==r)&&!r.disabled&&!r.readOnly?r:void 0}!t&&de(n)&&(t=n)}},de=e=>e.isContentEditable||e.popover||ae.has(e.nodeName)||u(e,`role`)===`button`;x(`clickdelegatefor`,()=>[v(window,`click auxclick`,oe,!0),v(document,`mousemove`,le,i)]);var fe=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,pe=fe(),me=pe?navigator.userAgent:``,he=/android/i.test(me),ge=/firefox/i.test(me);pe&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var _e=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ve=(e,t,n)=>{let r=new MutationObserver(n=>{if(!fe()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ye=`__uDetailsPolyfillSummarys`;if(fe()&&he&&ge&&!window[ye]){let e=document.getElementsByTagName(`summary`);window[ye]=ve(document,()=>{for(let t of e){let e=t.parentElement;_e(t,`role`,`button`),_e(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let be=!1,xe=e=>{let{type:t,clientX:n=0,clientY:r=0}=e,i=g(e);if(i&&t===`pointerdown`)for(let e of _(i)){if(e.nodeName!==`DIALOG`)continue;let t=e.getBoundingClientRect();be=t.top<=r&&r<=t.bottom&&t.left<=n&&n<=t.right;return}else{let e=i?.nodeName===`DIALOG`&&!be&&u(i,`closedby`)===`any`;be=!1,e&&setTimeout(Se,0,i)}},Se=e=>e.open&&e.close(),Ce=`--show-non-modal`,we=e=>{for(let t of e.composedPath()){let e=t.nodeType===1&&u(t,`command`);if(e===`show-modal`||e===Ce)return u(t,`aria-haspopup`,`dialog`)}},Te=({command:e,target:t})=>e===Ce&&t instanceof HTMLDialogElement&&t.show();x(`dialog`,()=>[v(document,`command`,Te,i),v(document,`focus`,we,i),v(document,`pointerdown pointerup`,xe,i)]);let Ee=a()?document.getElementsByTagName(`fieldset`):[],De=()=>{for(let e of Ee){if(e.hasAttribute(`aria-labelledby`))continue;let t=``;for(let n of e.children){let e=n.nodeName;(e===`LEGEND`||n.getAttribute(`data-field`)===`description`||e===`P`&&n.previousElementSibling?.nodeName===`LEGEND`)&&(t+=`${E(n)} `)}u(e,r,t.trim()||null)}};x(`fieldset`,()=>[S(document,De,{childList:!0,subtree:!0})]);let Oe=`focusgroup`,ke=`${Oe}start`,Ae=new WeakMap,je=new Map,Me={listbox:{block:!0,wrap:!1,items:`option`},menu:{block:!0,wrap:!0,items:`menuitem`},menubar:{block:!1,wrap:!0,items:`menuitem`},radiogroup:{block:null,wrap:!0,items:`radio`},tablist:{block:!1,wrap:!0,items:`tab`},toolbar:{block:!1,wrap:!1,items:null}},Ne=!1,Pe=new Set([`AUDIO`,`VIDEO`,`TEXTAREA`,`SELECT`,`date`,`datetime-local`,`email`,`month`,`number`,`password`,`range`,`search`,`tel`,`text`,`time`,`url`,`week`]),Fe=a()&&(Oe in HTMLElement.prototype||`focusGroup`in HTMLElement.prototype),Ie=e=>Ne=e,Le=e=>{if(e.defaultPrevented||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.key===`Tab`,n=e.key===`ArrowUp`||e.key===`ArrowDown`,r=n||e.key===`ArrowLeft`||e.key===`ArrowRight`;if(!t&&!r&&e.key!==`Home`&&e.key!==`End`)return;t&&(Ie(!0),setTimeout(Ie,100,!1));let i=g(e);if(!i||qe(i))return;let a=ze(_(i));if(a?.role&&a?.el===i&&(a=ze(_(a.el.parentNode))),!a?.role)return;let o=Ve(a.el,i),s=0;if(t){let e=o.filter(e=>e!==i);return setTimeout(Je,0,e,Je(e))}if(e.key===`Home`)s=0;else if(e.key===`End`)s=o.length-1;else{let{direction:t,writingMode:r}=getComputedStyle(i),c=r.startsWith(`vertical`),l=c?r===`vertical-rl`:t===`rtl`,u=e.key===`ArrowDown`||e.key===`ArrowRight`,d=n!==c,f=u!==(!n&&l);if((a.block??d)!==d)return;s=o.indexOf(i)+(f?1:-1),s=a.wrap?(o.length+s)%o.length:Math.max(0,Math.min(s,o.length-1))}o[s]!==i&&e.preventDefault(),o[s]?.focus?.()},Re=e=>{let t=g(e),n=_(t);for(let[e,t]of je)!n.has(e)&&je.delete(e)&&t();for(let e of n)e.nodeType===11&&!je.has(e)&&je.set(e,v(e,`focus`,Re,i));if(e.target?.shadowRoot)return;let r=ze(n);if(r?.role){if(Ne&&!qe(r.focus)){let e=He(Ve(r.el,null),t),n=r.memory&&e.includes(r.focus)&&r.focus||e.find(e=>e?.hasAttribute(ke))||e[0];if(n!==t)return n?.focus?.()}r.focus=t}},ze=e=>{for(let t of e){if(t.nodeType!==Node.ELEMENT_NODE)continue;let e=t.getAttribute(Oe);if(e!==null){let n=Ae.get(t);if(n?.key===e)return n;n=Be(t,e),Ae.set(t,n);for(let e of Ve(t))e&&!e.hasAttribute(`role`)&&u(e,`role`,n.items);return t.hasAttribute(`role`)||u(t,`role`,n.role),n}if(We(t))return}},Be=(e,t)=>{let n=new Set(t.toLowerCase().split(` `)),r=[...n].find(e=>e in Me),i=Me[r],a=n.has(`inline`),o=n.has(`block`);return{key:t,el:e,role:r,block:a&&o?null:o||!a&&i?.block,focus:null,items:i?.items,memory:!n.has(`nomemory`),wrap:n.has(`wrap`)||!n.has(`nowrap`)&&i?.wrap}},Ve=(e,t,n=[],r=!1)=>{let i=e?.nodeName===`SLOT`?e.assignedElements({flatten:!0}):(e?.shadowRoot||e)?.children;for(let e=0,a=i?.length||e;i&&e<a;e++){let a=i[e];if(a.nodeName===`SLOT`)Ve(a,t,n,r);else if(Ue(a)&&!We(a)&&Ge(a)){let e=a.getAttribute(Oe);a===t||!r&&e!==`none`&&Ke(a)?n.push(a):e!==null&&t===null?n.push(null):Ve(a,t,n,r||e!==null)}}return n},He=(e,t)=>{let n=e.indexOf(t),r=e.indexOf(null,n);return e.slice(e.lastIndexOf(null,n)+1,r===-1?void 0:r)},Ue=e=>!e.inert&&!e.hidden&&!e.disabled,We=e=>e?.nodeName===`DIALOG`||e?.hasAttribute(`popover`),Ge=a()&&typeof Element.prototype.checkVisibility==`function`?e=>e.checkVisibility():e=>e.offsetParent!==null,Ke=e=>e.isContentEditable||e.tabIndex>=0&&!e.disabled,qe=e=>e?.isContentEditable||Pe.has(e?.nodeName)||e?.nodeName===`INPUT`&&Pe.has(e.type),Je=(e,t)=>Array.from(e,(e,n)=>{let r=e?.getAttribute(`tabindex`);return e&&u(e,`tabindex`,t?t[n]:`-1`),r});Fe||x(Oe,()=>[v(document,`keydown`,Le),v(document,`focus`,Re,i),()=>{for(let[,e]of je)e();je.clear()}]);function Ye(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function Xe(){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===`toggle-popover`||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})}a()&&!Ye()&&Xe();let Ze=Math.min,O=Math.max,Qe=Math.round,$e=Math.floor,k=e=>({x:e,y:e}),et={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function tt(e,t,n){return O(e,Ze(t,n))}function A(e,t){return typeof e==`function`?e(t):e}function j(e){return e.split(`-`)[0]}function nt(e){return e.split(`-`)[1]}function rt(e){return e===`x`?`y`:`x`}function it(e){return e===`y`?`height`:`width`}function M(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function at(e){return rt(M(e))}function ot(e,t,n){n===void 0&&(n=!1);let r=nt(e),i=at(e),a=it(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ht(o)),[o,ht(o)]}function st(e){let t=ht(e);return[ct(e),t,ct(t)]}function ct(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let lt=[`left`,`right`],ut=[`right`,`left`],dt=[`top`,`bottom`],ft=[`bottom`,`top`];function pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ut:lt:t?lt:ut;case`left`:case`right`:return t?dt:ft;default:return[]}}function mt(e,t,n,r){let i=nt(e),a=pt(j(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ct)))),a}function ht(e){let t=j(e);return et[t]+e.slice(t.length)}function gt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _t(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gt(e)}function vt(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 yt(e,t,n){let{reference:r,floating:i}=e,a=M(t),o=at(t),s=it(o),c=j(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}}let m=nt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function bt(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}=A(t,e),p=_t(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vt(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=vt(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 xt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:bt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yt(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}=yt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},St=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}=A(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=j(r),_=M(o),v=j(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ht(o)]:st(o)),x=p!==`none`;!d&&x&&b.push(...mt(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ot(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===M(t)||T.every(e=>M(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=M(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{}}}},Ct=new Set([`left`,`top`]);async function wt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=j(n),s=nt(n),c=M(n)===`y`,l=Ct.has(o)?-1:1,u=a&&c?-1:1,d=A(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 Tt=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 wt(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}}}}},Et=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}=A(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=M(i),p=rt(f),m=u[p],h=u[f],g=(e,t)=>tt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Dt=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}=A(e,t),u={x:n,y:r},d=M(i),f=rt(d),p=u[f],m=u[d],h=A(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Ct.has(j(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}}}},Ot=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=A(e,t),c=await i.detectOverflow(t,s),l=j(n),u=nt(n),d=M(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ze(p-c[m],g),y=Ze(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*O(c.left,c.right):S=p-2*O(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function kt(){return typeof window<`u`}function At(e){return jt(e)?(e.nodeName||``).toLowerCase():`#document`}function N(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function P(e){return((jt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jt(e){return kt()?e instanceof Node||e instanceof N(e).Node:!1}function F(e){return kt()?e instanceof Element||e instanceof N(e).Element:!1}function I(e){return kt()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function Mt(e){return!kt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function Nt(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 Pt(e){return/^(table|td|th)$/.test(At(e))}function Ft(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let It=/transform|translate|scale|rotate|perspective|filter/,Lt=/paint|layout|strict|content/,L=e=>!!e&&e!==`none`,Rt;function zt(e){let t=F(e)?R(e):e;return L(t.transform)||L(t.translate)||L(t.scale)||L(t.rotate)||L(t.perspective)||!Vt()&&(L(t.backdropFilter)||L(t.filter))||It.test(t.willChange||``)||Lt.test(t.contain||``)}function Bt(e){let t=z(e);for(;I(t)&&!Ht(t);){if(zt(t))return t;if(Ft(t))return null;t=z(t)}return null}function Vt(){return Rt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Rt}function Ht(e){return/^(html|body|#document)$/.test(At(e))}function R(e){return N(e).getComputedStyle(e)}function Ut(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(At(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mt(e)&&e.host||P(e);return Mt(t)?t.host:t}function Wt(e){let t=z(e);return Ht(t)?(e.ownerDocument||e).body:I(t)&&Nt(t)?t:Wt(t)}function Gt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wt(e),i=r===e.ownerDocument?.body,a=N(r);if(i){let e=Kt(a);return t.concat(a,a.visualViewport||[],Nt(r)?r:[],e&&n?Gt(e):[])}else return t.concat(r,Gt(r,[],n))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qt(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=I(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qe(n)!==a||Qe(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jt(e){return F(e)?e:e.contextElement}function Yt(e){let t=Jt(e);if(!I(t))return k(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qt(t),o=(a?Qe(n.width):n.width)/r,s=(a?Qe(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let Xt=k(0);function Zt(e){let t=N(e);return!Vt()||!t.visualViewport?Xt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===N(e)}function $t(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jt(e),o=k(1);t&&(r?F(r)&&(o=Yt(r)):o=Yt(e));let s=Qt(a,n,r)?Zt(a):k(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&&r){let e=N(a),t=F(r)?N(r):r,n=e,i=Kt(n);for(;i&&t!==n;){let e=Yt(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=N(i),i=Kt(n)}}return vt({width:u,height:d,x:c,y:l})}function en(e,t){let n=Ut(e).scrollLeft;return t?t.left+n:$t(P(e)).left+n}function tn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=P(r),s=t?Ft(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=k(1),u=k(0),d=I(r);if((d||!a)&&((At(r)!==`body`||Nt(o))&&(c=Ut(r)),d)){let e=$t(r);l=Yt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?tn(o,c):k(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 rn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function an(e){let t=Ut(e),n=e.ownerDocument.body,r=O(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=O(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+en(e),o=-t.scrollTop;return R(n).direction===`rtl`&&(a+=O(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function on(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=N(e),a=P(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Vt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(en(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sn(e,t){let n=$t(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Yt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=on(e,n,t);else if(t===`document`)r=an(P(e));else if(F(t))r=sn(t,n);else{let n=Zt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vt(r)}function ln(e,t){let n=t.get(e);if(n)return n;let r=Gt(e,[],!1).filter(e=>F(e)&&At(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?z(e):e;for(;F(o)&&!Ht(o);){let e=R(o),t=zt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=z(o)}return t.set(e,r),r}function un(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ft(t)?[]:ln(t,this._c):[].concat(n),r],o=cn(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=cn(t,a[e],i);s=O(n.top,s),c=Ze(n.right,c),l=Ze(n.bottom,l),u=O(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dn(e){let{width:t,height:n}=qt(e);return{width:t,height:n}}function fn(e,t,n){let r=I(t),i=P(t),a=n===`fixed`,o=$t(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=k(0);if((r||!a)&&((At(t)!==`body`||Nt(i))&&(s=Ut(t)),r)){let e=$t(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=en(i));let l=i&&!r&&!a?tn(i,s):k(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pn(e){return R(e).position===`static`}function mn(e,t){if(!I(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return P(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){let n=N(e);if(Ft(e))return n;if(!I(e)){let t=z(e);for(;t&&!Ht(t);){if(F(t)&&!pn(t))return t;t=z(t)}return n}let r=mn(e,t);for(;r&&Pt(r)&&pn(r);)r=mn(r,t);return r&&Ht(r)&&pn(r)&&!zt(r)?n:r||Bt(e)||n}let gn=async function(e){let t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _n(e){return R(e).direction===`rtl`}let vn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:P,getClippingRect:un,getOffsetParent:hn,getElementRects:gn,getClientRects:rn,getDimensions:dn,getScale:Yt,isElement:F,isRTL:_n};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bn(e,t,n){let r=null,i,a=P(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=$e(d),h=$e(a.clientWidth-(u+f)),g=$e(a.clientHeight-(d+p)),_=$e(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:O(0,Ze(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=N(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xn(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=Jt(e),u=i||a?[...l?Gt(l):[],...t?Gt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bn(l,n,a):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?$t(e):null;c&&g();function g(){let t=$t(e);h&&!yn(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 Sn=Tt,Cn=Et,wn=St,Tn=Ot,En=Dt,Dn=(e,t,n)=>{let r=new Map,i=n??{},a={...vn,...i.platform,_c:r};return xt(e,t,{...i,platform:a})};var On=globalThis.Event||class{},kn=class extends On{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},An=new WeakMap;function jn(e,t,n){An.set(e,setTimeout(()=>{An.has(e)&&e.dispatchEvent(new kn(`toggle`,{cancelable:!1,oldState:t,newState:n}))},0))}var Mn=globalThis.ShadowRoot||function(){},Nn=globalThis.HTMLDialogElement||function(){},Pn=new WeakMap,B=new WeakMap,V=new WeakMap,Fn=new WeakMap;function In(e){return Fn.get(e)||`hidden`}var Ln=new WeakMap;function Rn(e){return[...e].pop()}function zn(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=In(t);(e.popoverTargetAction!==`show`||n!==`showing`)&&(e.popoverTargetAction!==`hide`||n!==`hidden`)&&(n===`showing`?$n(t,!0,!0):H(t,!1)&&(Ln.set(t,e),Qn(t)))}function H(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&In(e)!==`showing`||!t&&In(e)!==`hidden`||e instanceof Nn&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function Bn(e){if(!e)return 0;let t=B.get(document)||new Set,n=V.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function Vn(e){let t=Gn(e),n=Kn(e);return Bn(t)>Bn(n)?t:n}function Hn(e){let t,n=V.get(e)||new Set,r=B.get(e)||new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=Rn(i),t.isConnected?t:(i.delete(t),Hn(e))):null}function Un(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function Wn(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?Wn(e.parentNode):e}function Gn(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&Fn.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||Wn(e),e instanceof Mn&&(e=e.host),e instanceof Document)return}}function Kn(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||Wn(e),e instanceof Mn&&(e=e.host),e instanceof Document)return}}function qn(e,t){let n=new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=Gn(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||Wn(e)),i}function Jn(e){return e.hidden||e instanceof Mn||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function Yn(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(Jn(i))return i;i=r.nextNode()}}function Xn(e){var t;(t=Yn(e))==null||t.focus()}var Zn=new WeakMap;function Qn(e){if(!H(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new kn(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!H(e,!1))return;let n=!1,r=e.popover,i=null,a=qn(e,B.get(t)||new Set),o=qn(e,V.get(t)||new Set);if(r===`auto`&&(tr(V.get(t)||new Set,n,!0),U(a||t,n,!0),i=`auto`),r===`hint`&&(o?(U(o,n,!0),i=`hint`):(tr(V.get(t)||new Set,n,!0),a?(U(a,n,!0),i=`auto`):i=`hint`)),r===`auto`||r===`hint`){if(r!==e.popover||!H(e,!1))return;Hn(t)||(n=!0),i===`auto`?(B.has(t)||B.set(t,new Set),B.get(t).add(e)):i===`hint`&&(V.has(t)||V.set(t,new Set),V.get(t).add(e))}Zn.delete(e);let s=t.activeElement;e.classList.add(`:popover-open`),Fn.set(e,`showing`),Pn.has(t)||Pn.set(t,new Set),Pn.get(t).add(e),or(Ln.get(e),!0),Xn(e),n&&s&&e.popover===`auto`&&Zn.set(e,s),jn(e,`closed`,`open`)}function $n(e,t=!1,n=!1){var r,i;if(!H(e,!0))return;let a=e.ownerDocument;if([`auto`,`hint`].includes(e.popover)&&(U(e,t,n),!H(e,!0)))return;let o=B.get(a)||new Set,s=o.has(e)&&Rn(o)===e;if(or(Ln.get(e),!1),Ln.delete(e),n&&(e.dispatchEvent(new kn(`beforetoggle`,{oldState:`open`,newState:`closed`})),s&&Rn(o)!==e&&U(e,t,n),!H(e,!0)))return;(r=Pn.get(a))==null||r.delete(e),o.delete(e),(i=V.get(a))==null||i.delete(e),e.classList.remove(`:popover-open`),Fn.set(e,`hidden`),n&&jn(e,`open`,`closed`);let c=Zn.get(e);c&&(Zn.delete(e),t&&c.focus())}function er(e,t=!1,n=!1){let r=Hn(e);for(;r;)$n(r,t,n),r=Hn(e)}function tr(e,t=!1,n=!1){let r=Un(e);for(;r;)$n(r,t,n),r=Un(e)}function nr(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;In(o)===`showing`&&t.size;)$n(Rn(t),n,r);t.has(e)&&Rn(t)!==e&&(i=!0),i&&(r=!1)}}function U(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return er(r,t,n);if(V.get(r)?.has(e)){nr(e,V.get(r),t,n);return}tr(V.get(r)||new Set,t,n),B.get(r)?.has(e)&&nr(e,B.get(r),t,n)}var rr=new WeakMap;function ir(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument||t;if(!Hn(n))return;let r=Vn(t);if(r&&e.type===`pointerdown`)rr.set(n,r);else if(e.type===`pointerup`){let e=rr.get(n)===r;rr.delete(n),e&&U(r||n,!1,!0)}}var ar=new WeakMap;function or(e,t=!1){if(!e)return;ar.has(e)||ar.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=ar.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var sr=globalThis.ShadowRoot||function(){},cr=`popover-polyfill`;function lr(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype&&`showPopover`in HTMLElement.prototype}function ur(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function W(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var dr=/(^|[^\\]):popover-open\b/g;function fr(){return typeof globalThis.CSSLayerBlockRule==`function`}function pr(e){let t=fr(),n=(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??cr).split(`.`).map(e=>CSS.escape(e)).join(`.`);return`
2
2
  ${t?`@layer ${n} {`:``}
3
3
  :where([popover]) {
4
4
  position: fixed;
@@ -60,7 +60,7 @@ ${t?`@layer ${n} {`:``}
60
60
  }
61
61
  }
62
62
  ${t?`}`:``}
63
- `}var pr=null;function mr(e,t){let n=fr(t);if(pr===null)try{pr=new CSSStyleSheet,pr.replaceSync(n)}catch{pr=!1}if(pr===!1||!e.adoptedStyleSheets){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[pr,...e.adoptedStyleSheets]}function hr(e){if(typeof window>`u`)return;let t=e?.layerName;window.ToggleEvent=window.ToggleEvent||On;function n(e){return e?.includes(`:popover-open`)&&(e=e.replace(ur,`$1.\\:popover-open`)),e}W(Document.prototype,`querySelector`,n),W(Document.prototype,`querySelectorAll`,n),W(Element.prototype,`querySelector`,n),W(Element.prototype,`querySelectorAll`,n),W(Element.prototype,`matches`,n),W(Element.prototype,`closest`,n),W(DocumentFragment.prototype,`querySelectorAll`,n),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){Zn(this)}},hidePopover:{enumerable:!0,configurable:!0,writable:!0,value(){Qn(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),Pn.get(this)===`showing`&&e.force===void 0||e.force===!1?Qn(this,!0,!0):(e.force===void 0||e.force===!0)&&Zn(this),Pn.get(this)===`showing`}}});let r=Element.prototype.attachShadow;r&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=r.call(this,e);return mr(n,t),n}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=i.call(this);return e.shadowRoot&&mr(e.shadowRoot,t),e}}});let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),a.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),a.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=a.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return a.delete(this),null;let t=Un(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof or)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}o(HTMLButtonElement),o(HTMLInputElement);let s=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=Un(n);if(!(r instanceof or||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));if(i){Rn(i),e.preventDefault();return}},c=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&U(n.ownerDocument||n,!0,!0)};(e=>{e.addEventListener(`click`,s),e.addEventListener(`keydown`,c),e.addEventListener(`pointerdown`,rr),e.addEventListener(`pointerup`,rr)})(document),mr(document,t)}a()&&!cr()&&!lr()&&hr({layerName:`ds.base`});let gr=new Map,_r=`data-placement`,vr=`data-autoplacement`,yr=new Map,br=e=>xr(g(e),e.newState,e.oldState,e.source||e.detail);function xr(e,t,n,r){let i=e instanceof HTMLElement&&u(e,`popover`)!==null&&d(e,`--_ds-floating`),a=yr.get(e);if(t===`open`&&a&&a.source===r||(a?.cleanup(),t===`closed`||!i))return;if(!r){let t=e.id&&`[popovertarget="${e.id}"],[commandfor="${e.id}"]`;r=t&&h(e).querySelector(t)||void 0}if(!r||r===e||n&&n===t)return;e.style.scrollMarginBottom=`var(--_ds-floating-arrow-size)`;let o=d(e,`--_ds-floating-overscroll`),s=u(e,_r)||u(r,_r)||i,c=u(e,vr)||u(r,vr),l=parseFloat(d(e,`scroll-margin-bottom`))||0,f=s.match(/left|right/gi)?`Height`:`Width`,p=r[`offset${f}`]/2+l;if(s===`none`)return;let m=!1,g={strategy:`absolute`,placement:s,middleware:[Sn(l),Cn({padding:10,limiter:En({offset:{mainAxis:p}})}),Tr(),...c===`false`?[]:[wn({padding:10,crossAxis:!1})],...o?[Tn({apply({availableHeight:t}){if(m)return;m=!0;let n=`${r.offsetWidth}px`,i=`${Math.max(50,t-20)}px`;requestAnimationFrame(()=>{o===`fit`&&e.style.width!==n&&(e.style.width=n),e.style.maxHeight!==i&&(e.style.maxHeight=i)})}})]:[]]},_=xn(r,e,async()=>{if(!r?.isConnected)return yr.get(e)?.cleanup();let{x:t,y:n}=await Dn(r,e,g);e.style.translate=`${t}px ${n}px`});yr.set(e,{source:r,cleanup:()=>yr.delete(e)&&_()})}let Sr,Cr=e=>{if(e.type===`pointerdown`&&(Sr=!1),e.type===`scroll`&&Sr===!1&&(Sr=!0),e.type===`pointerup`&&Sr)for(let[e]of yr)e.showPopover()},wr=e=>{for(let[e,t]of gr)!e.host?.isConnected&&gr.delete(e)&&t();let t=h(g(e));t instanceof ShadowRoot&&!gr.has(t)&&gr.set(t,v(t,`toggle`,br,i))};x(`popover`,()=>{let e=Object.getOwnPropertyDescriptors(HTMLElement.prototype),t=HTMLElement.prototype.togglePopover,n=HTMLElement.prototype.showPopover,r=HTMLElement.prototype.hidePopover;return Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value(e){let n=this.matches(`:popover-open`),r=typeof e==`boolean`,i=n?`open`:`closed`,a=(r?e:e?.force??!n)?`open`:`closed`,o=r?void 0:e?.source,s=t?.call(this,e);return xr(this,a,i,o),s}},showPopover:{...e.showPopover,value(e){let t=this.matches(`:popover-open`)?`open`:`closed`,r=n?.call(this,e);return xr(this,`open`,t,e?.source),r}},hidePopover:{...e.hidePopover,value(){let e=this.matches(`:popover-open`)?`open`:`closed`,t=r?.call(this);return xr(this,`closed`,e),t}}}),[v(document,`click`,wr,i),v(document,`pointerdown pointerup scroll`,Cr,i),v(document,`toggle ds-toggle-source`,br,i),()=>{Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value:t},showPopover:{...e.showPopover,value:n},hidePopover:{...e.hidePopover,value:r}});for(let[,e]of gr)e();gr.clear()}]});let Tr=()=>({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),u(t,`data-floating`,e.placement),e}}),Er=e=>u(e,`readonly`)!==null||u(e,`aria-readonly`)===`true`,Dr=e=>{(!(e.key===`Tab`||e.altKey||e.ctrlKey||e.metaKey)||e.key?.startsWith(`Arrow`))&&Or(e)},Or=e=>{let t=g(e);t?.nodeName===`SELECT`&&Er(t)&&e.preventDefault()},kr=e=>{for(let t of e.composedPath())if(t?.nodeName===`LABEL`&&(t=t.control),t?.nodeName===`INPUT`||t?.nodeName===`SELECT`){Er(t)&&(e.stopImmediatePropagation(),e.preventDefault(),t[t.nodeName===`SELECT`?`blur`:`focus`](),requestAnimationFrame(()=>t.isConnected&&t.focus()));return}};x(`readonly`,()=>[v(document,`keydown`,Dr),v(document,`click`,kr,!0),v(document,`mousedown`,Or,!0)]);let Ar=`focusgroup`,jr=`data-toggle-group`,Mr=`[${jr}]`,Nr,Pr=(e,t)=>{for(let n of t||[null])if(n?.attributeName===jr)zr(n.target);else if(!n||n.addedNodes.length){let t=n?.target||e;for(let e of t.querySelectorAll(Mr))zr(e)}},Fr=e=>{Nr&&Rr(e)&&(e.preventDefault(),e.stopImmediatePropagation())},Ir=()=>Nr=!1,Lr=e=>{Nr=e.key?.startsWith(`Arrow`),e.key===`Enter`&&Rr(e)?.click(),Nr&&setTimeout(Ir,0)},Rr=e=>{let t=g(e);if(!(t?.nodeName!==`INPUT`||t.type!==`radio`||!t.name)){for(let e of _(t))if(!(e.nodeType!==1||!e.hasAttribute(Ar)))return u(e,Ar)?.includes(`radiogroup`)?t:void 0}},zr=e=>{if(e.hasAttribute(Ar))return;let t=m(e,jr),i=u(e,r)?.trim(),a=`Please use ${Ar}="radiogroup" and ${i?r:n}="${i||t}" instead of deprecated ${jr} on:`;u(e,n,i?null:t),u(e,Ar,`radiogroup`),l(a,e)};x(`toggle-group`,()=>[v(document,`click`,Fr,!0),v(document,`keydown`,Lr),S(document,Pr,{attributeFilter:[jr],attributes:!0,childList:!0,subtree:!0})]);let G,Br,Vr,K,Hr=0,Ur=`data-color`,Wr=`data-color-scheme`,Gr=`data-size`,Kr=`data-tooltip`,qr=a()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Jr=`[${Ur}]`,Yr=`[${Wr}]`,Xr=`[${Gr}]`,Zr=`[${Kr}]`,Qr=e=>{e&&!(e instanceof HTMLElement)&&l(`setTooltipElement expects an HTMLElement, got: `,e),ii(),Hr=0,G=e||void 0},$r=(e=document)=>{for(let t of e?.querySelectorAll(Zr)||[])ti(t)},ei=(e,t)=>{if(!t)return $r();for(let e of t)if(e.target!==G)if(e.attributeName===Kr)ti(e.target);else for(let t of e.addedNodes)t.nodeType===1&&(t.hasAttribute(Kr)?ti(t):$r(t))},ti=(e,t=!0)=>{let r=m(e,Kr)||``;if(r[0]===`#`&&(r=h(e).getElementById(r.slice(1))?.textContent?.trim()||``),r!==(e.getAttribute(`aria-label`)||e.getAttribute(`aria-description`))){let t=u(e,`role`)!==`img`&&e.textContent?.trim();u(e,Kr,r),u(e,n,t?null:r),u(e,`aria-description`,t?r:null),e.tabIndex===-1&&!e.hasAttribute(`tabindex`)&&e.nodeName!==`LABEL`&&l(`Missing tabindex="0" attribute on: `,e)}e===K&&G?.textContent!==r&&(G&&(G.textContent=r),r&&t&&document.activeElement===e&&ne(r))},ni=e=>{let t=g(e);if(!t||Vr===t||G?.contains(t))return;Vr=t;let n=Vr?.closest?.(Zr)||void 0;if(K!==n&&(K&&ii(),K=n,n)){if(e.type===`focus`||qr||300>Date.now()-Hr)return ri();e.type===`mousemove`&&(Br=setTimeout(ri,300))}},ri=()=>{if(!K)return ii();G||=C(`div`,{class:`ds-tooltip`}),G.isConnected||document.body.appendChild(G);let e=K.closest(Jr),t=K.closest(Yr),n=K.closest(Xr),r=e!==t&&e?.contains(t);u(G,`popover`,`manual`),u(G,Wr,t?.getAttribute(Wr)||null),u(G,Ur,r&&e?.getAttribute(Ur)||null),u(G,Gr,n?.getAttribute(Gr)||null),ti(K,!1),G.showPopover(),G.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:K}))},ii=e=>{(e?.type!==`keydown`||e?.key===`Escape`)&&(K&&G?.isConnected&&G.popover&&G.hidePopover(),e||(Hr=Date.now()),clearTimeout(Br),K=void 0)};x(`tooltip`,()=>[v(document,`focus mousemove`,ni,i),v(document,`keydown`,ii,i),S(document,ei,{attributeFilter:[Kr],attributes:!0,childList:!0,subtree:!0})]);var ai=class extends s{_items;_label={key:n,value:null};_unresize;_unmutate;static get observedAttributes(){return[n,r]}connectedCallback(){let e=c(()=>oi(this),100);this._items=this.getElementsByTagName(`a`),this._unresize=v(window,`resize`,e),this._unmutate=S(this,oi,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&oi(this)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let oi=e=>{let t=e._items?.[e._items.length-1],i=t?.parentElement===e?null:t,a=!i?.offsetHeight;u(e,`role`,a?null:`navigation`);for(let t of e._items||[])u(t,`aria-current`,t===i?`page`:null);let o=m(e,n)?.trim(),s=u(e,r)?.trim(),c=o||s;c&&(e._label.value=c),c&&(e._label.key=s?r:n);let l=a?null:e._label.value;c!==l&&(u(e,r,null),u(e,n,null),u(e,e._label.key,l))};w.define(`ds-breadcrumbs`,ai);var si=class extends s{_unmutate;connectedCallback(){v(this,`animationend`,this,i),u(this,`role`,`group`),u(this,`tabindex`,`-1`),this._unmutate=S(this,ci,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){y(this,`animationend`,this,i),this._unmutate?.(),this._unmutate=void 0}};let ci=e=>{let t=u(e,n)?.trim(),i=u(e,r)?.trim(),a=e.querySelector(`h2,h3,h4,h5,h6`);a&&!t&&!i&&u(e,r,E(a)),!a&&!t&&!i&&l(`Missing accessible name on:`,e,`\nAdd a heading (h2–h6), or set ${n} or ${r} to provide an accessible name for screen readers.`)};w.define(`ds-error-summary`,si);let li=`data-field`,ui=`data-limit`,di=`aria-invalid`,fi=`aria-describedby`,pi=`data-indeterminate`,mi=`:scope > [${li}="validation"]`,hi=o()?800:200,gi=e=>{let t=[],n=[],r=e._descs||[],i=!1,a=!1;e._input?.hidden&&(e._input=void 0);for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden)if(bi(r))e._input?.isConnected&&e._input!==r?l(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):e._input=r;else{let t=r.getAttribute(li);t===`counter`&&(e._counter=r),t===`validation`?(n.unshift(E(r)),i=!0,a||=yi(r)):t&&n.push(E(r))}if(!e._input?.isConnected)return;let o=e._input;for(let e of t)u(e,`for`,E(o)||null);let s=e.closest(`fieldset`)?.querySelector(mi);s&&!s?.hidden&&(i=!0,a||=yi(s),n.unshift(E(s)));let c=u(o,pi);c&&(o.indeterminate=c===`true`),(o.type===`radio`||o.type===`checkbox`)&&u(e,`data-clickdelegatefor`,E(o));let d=(u(o,fi)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];u(o,fi,[...n,...d].join(` `)||null),e._descs=n;let f=e._validation;i&&!f&&!o.hasAttribute(di)?(u(o,di,a?`true`:null),e._validation=!0):!i&&f&&(u(o,di,null),e._validation=void 0),e.handleEvent()},_i={over:`%d tegn for mye`,under:`%d tegn igjen`},vi=c((e,t)=>{a()&&document.activeElement===e&&ne(t)},hi),yi=e=>{let t=e.getAttribute(`data-color`);return!t||t===`danger`},bi=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var xi=class extends s{_counter;_descs;_input;_validation;_unevents;_unmutate;connectedCallback(){this._unevents=v(this,`input`,this,i),this._unmutate=S(this,()=>gi(this),{attributeFilter:[li,ui,`hidden`,`id`,`value`,pi],attributes:!0,childList:!0,subtree:!0})}handleEvent(e){let{_counter:t,_input:n}=this;if(t?.isConnected&&n){let r=(Number(u(t,ui))||0)-n.value.length,i=r<0?`over`:`under`,a=(m(t,`data-${i}`)||_i[i])?.replace(`%d`,`${Math.abs(r)}`);a||l(`Missing data-${i} on:`,t),u(t,`data-label`,a),u(t,`data-state`,i),u(t,`data-color`,r<0?`danger`:null),u(n,`aria-invalid`,r<0?`true`:null),e?.type===`input`&&a&&vi(n,a)}n instanceof HTMLTextAreaElement&&(n.style.setProperty(`--_ds-field-sizing`,`auto`),n.style.setProperty(`--_ds-field-sizing`,`${n.scrollHeight}px`))}disconnectedCallback(){this._unevents?.(),this._unmutate?.(),this._unevents=this._unmutate=void 0,this._input=this._counter=this._descs=this._validation=void 0}};w.define(`ds-field`,xi);let Si=`data-current`,Ci=`data-total`,wi=`data-href`,Ti=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:Oi(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Ei=class extends s{_unmutate;_render;static get observedAttributes(){return[n,r,Si,Ci,wi]}connectedCallback(){let e=u(this,Ci),t=u(this,Si);t&&!e&&l(`Missing ${Ci} attribute on:`,this),e&&!t&&l(`Missing ${Si} attribute on:`,this);let i=m(this,n),a=u(this,r)?.trim();i||a?u(this,n,a?null:i):l(`Missing ${n} on:`,this),u(this,`role`,`navigation`),this._unmutate=S(this,Di,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&Di(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let Di=e=>{let t=Number(u(e,Si)),r=Number(u(e,Ci));if(t&&r){let i=e.querySelectorAll(`button,a`),a=i.length-2,o=u(e,wi),{next:s,prev:c,pages:l}=Ti({current:t,total:r,show:a});i.forEach((e,t)=>{let r=t?i[t+1]?l[t-1]?.page:s:c;u(e,`aria-current`,l[t-1]?.current?`true`:null),u(e,n,`${r??`hidden`}`),u(e,`role`,r?null:`none`),u(e,`tabindex`,r?null:`-1`),e instanceof HTMLButtonElement&&u(e,`value`,`${r}`),o&&e instanceof HTMLAnchorElement&&u(e,`href`,o.replace(`%d`,`${r}`))})}},Oi=(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};w.define(`ds-pagination`,Ei);var ki=Object.defineProperty,Ai=Object.defineProperties,ji=Object.getOwnPropertyDescriptors,Mi=Object.getOwnPropertySymbols,Ni=Object.prototype.hasOwnProperty,Pi=Object.prototype.propertyIsEnumerable,Fi=(e,t,n)=>t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||={})Ni.call(t,n)&&Fi(e,n,t[n]);if(Mi)for(var n of Mi(t))Pi.call(t,n)&&Fi(e,n,t[n]);return e},Li=(e,t)=>Ai(e,ji(t)),Ri=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,zi=Ri(),Bi=zi?navigator.userAgent:``,Vi=/android/i.test(Bi),Hi=/firefox/i.test(Bi),Ui=/iPad|iPhone|iPod/.test(Bi),Wi=zi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),Gi=zi&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ki={once:!0,capture:!0,passive:!0},qi=`:host(:not([hidden])) { display: block }`,Ji=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Yi=`${Vi?`data`:`aria`}-multiselectable`,Xi=typeof HTMLElement>`u`?class{}:HTMLElement,q=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),Zi=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Qi(e,...t)},Qi=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},$i=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.appendChild(oa(`slot`)),!n.querySelector(`style`))if(!Gi)n.appendChild(oa(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},ea=(e,t,n)=>{let r=new MutationObserver(n=>{if(!Ri()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ta=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},na=e=>ta(e).activeElement,ra=e=>{let t=q(e,`aria-label`)||``;return[...(q(e,`aria-labelledby`)?.split(` `)||[]).map(e=>document.getElementById(e.trim()||`-`)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t).trim()},ia=e=>{if(!e||!zi)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},aa=zi?Object.prototype.hasOwnProperty:()=>!1,oa=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let e in t)aa.call(t,e)&&q(r,e,t[e]);return r},sa={define:(e,t)=>!Ri()||window.customElements.get(e)||window.customElements.define(e,t)},ca=(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}))},la=new WeakSet,ua=(e,t)=>(t?.type===`pointerdown`&&(la.add(e),Zi(document,`pointerup`,()=>la.delete(e),Ki)),la.has(e)),da=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,fa=e=>{let t=q(e,`form`);q(e,`form`,`#`),setTimeout(pa,0,e,t)},pa=(e,t)=>q(e,`form`,t),J=e=>(e?.textContent)?.trim()||``,Y,ma=0,ha=0,ga=e=>{clearTimeout(ha),Y||(Y=oa(`div`,{"aria-live":`assertive`}),Y.style.overflow=`hidden`,Y.style.position=`fixed`,Y.style.whiteSpace=`nowrap`,Y.style.width=`1px`),Y.isConnected||document.body.appendChild(Y),e===``&&(Y.textContent=``),e&&(Y.textContent=`${e}${ma++%2?`\xA0`:``}`,ha=setTimeout(ga,!Wi&&Hi?2e3:300,``))},_a=`${qi}
63
+ `}var mr=null;function hr(e,t){let n=pr(t);if(mr===null)try{mr=new CSSStyleSheet,mr.replaceSync(n)}catch{mr=!1}if(mr===!1||!e.adoptedStyleSheets){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[mr,...e.adoptedStyleSheets]}function gr(e){if(typeof window>`u`)return;let t=e?.layerName;window.ToggleEvent=window.ToggleEvent||kn;function n(e){return e?.includes(`:popover-open`)&&(e=e.replace(dr,`$1.\\:popover-open`)),e}W(Document.prototype,`querySelector`,n),W(Document.prototype,`querySelectorAll`,n),W(Element.prototype,`querySelector`,n),W(Element.prototype,`querySelectorAll`,n),W(Element.prototype,`matches`,n),W(Element.prototype,`closest`,n),W(DocumentFragment.prototype,`querySelectorAll`,n),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){Qn(this)}},hidePopover:{enumerable:!0,configurable:!0,writable:!0,value(){$n(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),Fn.get(this)===`showing`&&e.force===void 0||e.force===!1?$n(this,!0,!0):(e.force===void 0||e.force===!0)&&Qn(this),Fn.get(this)===`showing`}}});let r=Element.prototype.attachShadow;r&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=r.call(this,e);return hr(n,t),n}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=i.call(this);return e.shadowRoot&&hr(e.shadowRoot,t),e}}});let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),a.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),a.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=a.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return a.delete(this),null;let t=Wn(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof sr)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}o(HTMLButtonElement),o(HTMLInputElement);let s=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=Wn(n);if(!(r instanceof sr||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));if(i){zn(i),e.preventDefault();return}},c=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&U(n.ownerDocument||n,!0,!0)};(e=>{e.addEventListener(`click`,s),e.addEventListener(`keydown`,c),e.addEventListener(`pointerdown`,ir),e.addEventListener(`pointerup`,ir)})(document),hr(document,t)}a()&&!lr()&&!ur()&&gr({layerName:`ds.base`});let _r=new Map,vr=`data-placement`,yr=`data-autoplacement`,br=new Map,xr=e=>Sr(g(e),e.newState,e.oldState,e.source||e.detail);function Sr(e,t,n,r){let i=e instanceof HTMLElement&&u(e,`popover`)!==null,a=br.get(e);if(t===`open`&&a&&a.source===r||(a?.cleanup(),t===`closed`||!i))return;if(!r){let t=e.id&&`[popovertarget="${e.id}"],[commandfor="${e.id}"]`;r=t&&h(e).querySelector(t)||void 0}if(!r||r===e||n&&n===t)return;let o=d(e,`--_ds-floating`),s=u(e,vr)??u(r,vr);if(s===null&&!o)return;e.style.scrollMarginBottom=`var(--_ds-floating-arrow-size)`;let c=s||o||`top`,l=d(e,`--_ds-floating-overscroll`),f=u(e,yr)||u(r,yr),p=parseFloat(d(e,`scroll-margin-bottom`))||0,m=c.match(/left|right/gi)?`Height`:`Width`,g=r[`offset${m}`]/2+p;if(c===`none`)return;let _=!1,v={strategy:`absolute`,placement:c,middleware:[Sn(p),Cn({padding:10,limiter:En({offset:{mainAxis:g}})}),Er(),...f===`false`?[]:[wn({padding:10,crossAxis:!1})],...l?[Tn({apply({availableHeight:t}){if(_)return;_=!0;let n=`${Math.max(50,t-20)}px`;requestAnimationFrame(()=>{e.style.maxHeight!==n&&(e.style.maxHeight=n)})}})]:[]]},y=xn(r,e,async()=>{if(!r?.isConnected)return br.get(e)?.cleanup();if(l===`fit`){let t=`${r.offsetWidth}px`;e.style.width!==t&&(e.style.width=t)}let{x:t,y:n}=await Dn(r,e,v);e.style.translate=`${t}px ${n}px`});br.set(e,{source:r,cleanup:()=>br.delete(e)&&y()})}let Cr,wr=e=>{if(e.type===`pointerdown`&&(Cr=!1),e.type===`scroll`&&Cr===!1&&(Cr=!0),e.type===`pointerup`&&Cr)for(let[e]of br)e.showPopover()},Tr=e=>{for(let[e,t]of _r)!e.host?.isConnected&&_r.delete(e)&&t();let t=h(g(e));t instanceof ShadowRoot&&!_r.has(t)&&_r.set(t,v(t,`toggle`,xr,i))};x(`popover`,()=>{let e=Object.getOwnPropertyDescriptors(HTMLElement.prototype),t=HTMLElement.prototype.togglePopover,n=HTMLElement.prototype.showPopover,r=HTMLElement.prototype.hidePopover;return Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value(e){let n=this.matches(`:popover-open`),r=typeof e==`boolean`,i=n?`open`:`closed`,a=(r?e:e?.force??!n)?`open`:`closed`,o=r?void 0:e?.source,s=t?.call(this,e);return Sr(this,a,i,o),s}},showPopover:{...e.showPopover,value(e){let t=this.matches(`:popover-open`)?`open`:`closed`,r=n?.call(this,e);return Sr(this,`open`,t,e?.source),r}},hidePopover:{...e.hidePopover,value(){let e=this.matches(`:popover-open`)?`open`:`closed`,t=r?.call(this);return Sr(this,`closed`,e),t}}}),[v(document,`click`,Tr,i),v(document,`pointerdown pointerup scroll`,wr,i),v(document,`toggle ds-toggle-source`,xr,i),()=>{Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value:t},showPopover:{...e.showPopover,value:n},hidePopover:{...e.hidePopover,value:r}});for(let[,e]of _r)e();_r.clear()}]});let Er=()=>({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),u(t,`data-floating`,e.placement),e}}),Dr=e=>u(e,`readonly`)!==null||u(e,`aria-readonly`)===`true`,Or=e=>{(!(e.key===`Tab`||e.altKey||e.ctrlKey||e.metaKey)||e.key?.startsWith(`Arrow`))&&kr(e)},kr=e=>{let t=g(e);t?.nodeName===`SELECT`&&Dr(t)&&e.preventDefault()},Ar=e=>{for(let t of e.composedPath())if(t?.nodeName===`LABEL`&&(t=t.control),t?.nodeName===`INPUT`||t?.nodeName===`SELECT`){Dr(t)&&(e.stopImmediatePropagation(),e.preventDefault(),t[t.nodeName===`SELECT`?`blur`:`focus`](),requestAnimationFrame(()=>t.isConnected&&t.focus()));return}};x(`readonly`,()=>[v(document,`keydown`,Or),v(document,`click`,Ar,!0),v(document,`mousedown`,kr,!0)]);let jr=`focusgroup`,Mr=`data-toggle-group`,Nr=`[${Mr}]`,Pr,Fr=(e,t)=>{for(let n of t||[null])if(n?.attributeName===Mr)Br(n.target);else if(!n||n.addedNodes.length){let t=n?.target||e;for(let e of t.querySelectorAll(Nr))Br(e)}},Ir=e=>{Pr&&zr(e)&&(e.preventDefault(),e.stopImmediatePropagation())},Lr=()=>Pr=!1,Rr=e=>{Pr=e.key?.startsWith(`Arrow`),e.key===`Enter`&&zr(e)?.click(),Pr&&setTimeout(Lr,0)},zr=e=>{let t=g(e);if(!(t?.nodeName!==`INPUT`||t.type!==`radio`||!t.name)){for(let e of _(t))if(!(e.nodeType!==1||!e.hasAttribute(jr)))return u(e,jr)?.includes(`radiogroup`)?t:void 0}},Br=e=>{if(e.hasAttribute(jr))return;let t=m(e,Mr),i=u(e,r)?.trim(),a=`Please use ${jr}="radiogroup" and ${i?r:n}="${i||t}" instead of deprecated ${Mr} on:`;u(e,n,i?null:t),u(e,jr,`radiogroup`),l(a,e)};x(`toggle-group`,()=>[v(document,`click`,Ir,!0),v(document,`keydown`,Rr),S(document,Fr,{attributeFilter:[Mr],attributes:!0,childList:!0,subtree:!0})]);let G,Vr,Hr,K,Ur=0,Wr=`data-color`,Gr=`data-color-scheme`,Kr=`data-size`,qr=`data-tooltip`,Jr=a()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Yr=`[${Wr}]`,Xr=`[${Gr}]`,Zr=`[${Kr}]`,Qr=`[${qr}]`,$r=e=>{e&&!(e instanceof HTMLElement)&&l(`setTooltipElement expects an HTMLElement, got: `,e),ai(),Ur=0,G=e||void 0},ei=(e=document)=>{for(let t of e?.querySelectorAll(Qr)||[])ni(t)},ti=(e,t)=>{if(!t)return ei();for(let e of t)if(e.target!==G)if(e.attributeName===qr)ni(e.target);else for(let t of e.addedNodes)t.nodeType===1&&(t.hasAttribute(qr)?ni(t):ei(t))},ni=(e,t=!0)=>{let r=m(e,qr)||``;if(r[0]===`#`&&(r=h(e).getElementById(r.slice(1))?.textContent?.trim()||``),r!==(e.getAttribute(`aria-label`)||e.getAttribute(`aria-description`))){let t=u(e,`role`)!==`img`&&e.textContent?.trim();u(e,qr,r),u(e,n,t?null:r),u(e,`aria-description`,t?r:null),e.tabIndex===-1&&!e.hasAttribute(`tabindex`)&&e.nodeName!==`LABEL`&&l(`Missing tabindex="0" attribute on: `,e)}e===K&&G?.textContent!==r&&(G&&(G.textContent=r),r&&t&&document.activeElement===e&&ne(r))},ri=e=>{let t=g(e);if(!t||Hr===t||G?.contains(t))return;Hr=t;let n=Hr?.closest?.(Qr)||void 0;if(K!==n&&(K&&ai(),K=n,n)){if(e.type===`focus`||Jr||300>Date.now()-Ur)return ii();e.type===`mousemove`&&(Vr=setTimeout(ii,300))}},ii=()=>{if(!K)return ai();G||=C(`div`,{class:`ds-tooltip`}),G.isConnected||document.body.appendChild(G);let e=K.closest(Yr),t=K.closest(Xr),n=K.closest(Zr),r=e!==t&&e?.contains(t);u(G,`popover`,`manual`),u(G,Gr,t?.getAttribute(Gr)||null),u(G,Wr,r&&e?.getAttribute(Wr)||null),u(G,Kr,n?.getAttribute(Kr)||null),ni(K,!1),G.showPopover(),G.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:K}))},ai=e=>{(e?.type!==`keydown`||e?.key===`Escape`)&&(K&&G?.isConnected&&G.popover&&G.hidePopover(),e||(Ur=Date.now()),clearTimeout(Vr),K=void 0)};x(`tooltip`,()=>[v(document,`focus mousemove`,ri,i),v(document,`keydown`,ai,i),S(document,ti,{attributeFilter:[qr],attributes:!0,childList:!0,subtree:!0})]);var oi=class extends s{_items;_label={key:n,value:null};_unresize;_unmutate;static get observedAttributes(){return[n,r]}connectedCallback(){let e=c(()=>si(this),100);this._items=this.getElementsByTagName(`a`),this._unresize=v(window,`resize`,e),this._unmutate=S(this,si,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&si(this)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let si=e=>{let t=e._items?.[e._items.length-1],i=t?.parentElement===e?null:t,a=!i?.offsetHeight;u(e,`role`,a?null:`navigation`);for(let t of e._items||[])u(t,`aria-current`,t===i?`page`:null);let o=m(e,n)?.trim(),s=u(e,r)?.trim(),c=o||s;c&&(e._label.value=c),c&&(e._label.key=s?r:n);let l=a?null:e._label.value;c!==l&&(u(e,r,null),u(e,n,null),u(e,e._label.key,l))};w.define(`ds-breadcrumbs`,oi);var ci=class extends s{_unmutate;connectedCallback(){v(this,`animationend`,this,i),u(this,`role`,`group`),u(this,`tabindex`,`-1`),this._unmutate=S(this,li,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){y(this,`animationend`,this,i),this._unmutate?.(),this._unmutate=void 0}};let li=e=>{let t=u(e,n)?.trim(),i=u(e,r)?.trim(),a=e.querySelector(`h2,h3,h4,h5,h6`);a&&!t&&!i&&u(e,r,E(a)),!a&&!t&&!i&&l(`Missing accessible name on:`,e,`\nAdd a heading (h2–h6), or set ${n} or ${r} to provide an accessible name for screen readers.`)};w.define(`ds-error-summary`,ci);let ui=`data-field`,di=`data-limit`,fi=`aria-invalid`,pi=`aria-describedby`,mi=`data-indeterminate`,hi=`:scope > [${ui}="validation"]`,gi=o()?800:200,_i=e=>{let t=[],n=[],r=e._descs||[],i=!1,a=!1;e._input?.hidden&&(e._input=void 0);for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden)if(xi(r))e._input?.isConnected&&e._input!==r?l(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):e._input=r;else{let t=r.getAttribute(ui);t===`counter`&&(e._counter=r),t===`validation`?(n.unshift(E(r)),i=!0,a||=bi(r)):t&&n.push(E(r))}if(!e._input?.isConnected)return;let o=e._input;for(let e of t)u(e,`for`,E(o)||null);let s=e.closest(`fieldset`)?.querySelector(hi);s&&!s?.hidden&&(i=!0,a||=bi(s),n.unshift(E(s)));let c=u(o,mi);c&&(o.indeterminate=c===`true`),(o.type===`radio`||o.type===`checkbox`)&&u(e,`data-clickdelegatefor`,E(o));let d=(u(o,pi)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];u(o,pi,[...n,...d].join(` `)||null),e._descs=n;let f=e._validation;i&&!f&&!o.hasAttribute(fi)?(u(o,fi,a?`true`:null),e._validation=!0):!i&&f&&(u(o,fi,null),e._validation=void 0),e.handleEvent()},vi={over:`%d tegn for mye`,under:`%d tegn igjen`},yi=c((e,t)=>{a()&&document.activeElement===e&&ne(t)},gi),bi=e=>{let t=e.getAttribute(`data-color`);return!t||t===`danger`},xi=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var Si=class extends s{_counter;_descs;_input;_validation;_unevents;_unmutate;connectedCallback(){this._unevents=v(this,`input`,this,i),this._unmutate=S(this,()=>_i(this),{attributeFilter:[ui,di,`hidden`,`id`,`value`,mi],attributes:!0,childList:!0,subtree:!0})}handleEvent(e){let{_counter:t,_input:n}=this;if(t?.isConnected&&n){let r=(Number(u(t,di))||0)-n.value.length,i=r<0?`over`:`under`,a=(m(t,`data-${i}`)||vi[i])?.replace(`%d`,`${Math.abs(r)}`);a||l(`Missing data-${i} on:`,t),u(t,`data-label`,a),u(t,`data-state`,i),u(t,`data-color`,r<0?`danger`:null),u(n,`aria-invalid`,r<0?`true`:null),e?.type===`input`&&a&&yi(n,a)}n instanceof HTMLTextAreaElement&&(n.style.setProperty(`--_ds-field-sizing`,`auto`),n.style.setProperty(`--_ds-field-sizing`,`${n.scrollHeight}px`))}disconnectedCallback(){this._unevents?.(),this._unmutate?.(),this._unevents=this._unmutate=void 0,this._input=this._counter=this._descs=this._validation=void 0}};w.define(`ds-field`,Si);let Ci=`data-current`,wi=`data-total`,Ti=`data-href`,Ei=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:Ai(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Di=class extends s{_unmutate;_render;static get observedAttributes(){return[n,r,Ci,wi,Ti]}connectedCallback(){let e=u(this,wi),t=u(this,Ci);t&&!e&&l(`Missing ${wi} attribute on:`,this),e&&!t&&l(`Missing ${Ci} attribute on:`,this);let i=m(this,n),a=u(this,r)?.trim();i||a?u(this,n,a?null:i):l(`Missing ${n} on:`,this),u(this,`role`,`navigation`),this._unmutate=S(this,ki,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&ki(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let Oi=e=>!e.textContent?.trim()&&!u(e,`aria-labelledby`),ki=e=>{let t=Number(u(e,Ci)),r=Number(u(e,wi));if(t&&r){let i=e.querySelectorAll(`button,a`),a=i.length-2,o=u(e,Ti),{next:s,prev:c,pages:l}=Ei({current:t,total:r,show:a});i.forEach((e,t)=>{let r=t!==0&&!!i[t+1],a=r?l[t-1]?.page:t?s:c;u(e,`aria-current`,l[t-1]?.current?`true`:null),r?u(e,n,`${a??`hidden`}`):Oi(e)&&u(e,n,m(e,n)),u(e,`role`,a?null:`none`),u(e,`tabindex`,a?null:`-1`),e instanceof HTMLButtonElement&&u(e,`value`,`${a}`),o&&e instanceof HTMLAnchorElement&&u(e,`href`,o.replace(`%d`,`${a}`))})}},Ai=(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};w.define(`ds-pagination`,Di);var ji=Object.defineProperty,Mi=Object.defineProperties,Ni=Object.getOwnPropertyDescriptors,Pi=Object.getOwnPropertySymbols,Fi=Object.prototype.hasOwnProperty,Ii=Object.prototype.propertyIsEnumerable,Li=(e,t,n)=>t in e?ji(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ri=(e,t)=>{for(var n in t||={})Fi.call(t,n)&&Li(e,n,t[n]);if(Pi)for(var n of Pi(t))Ii.call(t,n)&&Li(e,n,t[n]);return e},zi=(e,t)=>Mi(e,Ni(t)),Bi=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Vi=Bi(),Hi=Vi?navigator.userAgent:``,Ui=/android/i.test(Hi),Wi=/firefox/i.test(Hi),Gi=/iPad|iPhone|iPod/.test(Hi),Ki=Vi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),qi=Vi&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ji={once:!0,capture:!0,passive:!0},Yi=`:host(:not([hidden])) { display: block }`,Xi=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Zi=`${Ui?`data`:`aria`}-multiselectable`,Qi=typeof HTMLElement>`u`?class{}:HTMLElement,q=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),$i=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>ea(e,...t)},ea=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},ta=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.appendChild(ca(`slot`)),!n.querySelector(`style`))if(!qi)n.appendChild(ca(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},na=(e,t,n)=>{let r=new MutationObserver(n=>{if(!Bi()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ra=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ia=e=>ra(e).activeElement,aa=e=>{let t=q(e,`aria-label`)||``;return[...(q(e,`aria-labelledby`)?.split(` `)||[]).map(e=>document.getElementById(e.trim()||`-`)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t).trim()},oa=e=>{if(!e||!Vi)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},sa=Vi?Object.prototype.hasOwnProperty:()=>!1,ca=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let e in t)sa.call(t,e)&&q(r,e,t[e]);return r},la={define:(e,t)=>!Bi()||window.customElements.get(e)||window.customElements.define(e,t)},ua=(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}))},da=new WeakSet,fa=(e,t)=>(t?.type===`pointerdown`&&(da.add(e),$i(document,`pointerup`,()=>da.delete(e),Ji)),da.has(e)),pa=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ma=e=>{let t=q(e,`form`);q(e,`form`,`#`),setTimeout(ha,0,e,t)},ha=(e,t)=>q(e,`form`,t),ga=e=>(e?.textContent)?.trim()||``,J,_a=0,va=0,ya=e=>{clearTimeout(va),J||(J=ca(`div`,{"aria-live":`assertive`}),J.style.overflow=`hidden`,J.style.position=`fixed`,J.style.whiteSpace=`nowrap`,J.style.width=`1px`),J.isConnected||document.body.appendChild(J),e===``&&(J.textContent=``),e&&(J.textContent=`${e}${_a++%2?`\xA0`:``}`,va=setTimeout(ya,!Ki&&Wi?2e3:300,``))},ba=`${Yi}
64
64
  [part="items"]:not([hidden]) { display: inline-flex; flex-wrap: wrap } /* Can not be "contents" as this confuses VoiceOver */
65
65
  :host(:not([data-multiple])) [part="items"],
66
66
  :host([data-multiple="false"]) [part="items"] { display: none }
@@ -74,10 +74,10 @@ ${t?`}`:``}
74
74
  ::slotted(button[type="reset"]:empty)::before { content: '\\00D7'; content: '\\00D7' / '' }
75
75
  ::slotted(button[aria-expanded="false"]:empty)::before { content: '\\25BC'; content: '\\25BC' / '' }
76
76
  ::slotted(button[aria-expanded="true"]:empty)::before { content: '\\25B2'; content: '\\25B2' / '' }
77
- ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Ji} }`;da(_a);var va=!1,X=`aria-label`,ya=`button[type="reset"],del`,ba=`button[aria-expanded]`,xa=`datalist,u-datalist,[role="listbox"]`,Sa=`option,u-option,[role="option"]`,Ca={focusVisible:!0},wa=`comboboxprogrammaticinput`,Ta=`blur focus click input keydown pointerdown ${wa}`,Ea=`false`,Da={added:`Added`,clear:`Clear input`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`,toggle:`Options`},Oa=class extends Xi{constructor(){super(),this._focusMoved=!1,this._itemSingleVale=``,this._speak=``,this._texts=Ii({},Da),this._value=``;let e=$i(this,_a);this._listbox=e.querySelector(`[role="listbox"]`)||oa(`div`),this._listbox.innerHTML=`<slot name="items"></slot>`,q(this._listbox,`aria-orientation`,`horizontal`),q(this._listbox,`role`,`listbox`),q(this._listbox,`part`,`items`),q(this._listbox,`tabindex`,`-1`),e.insertBefore(this._listbox,e.firstChild)}static get observedAttributes(){return Object.keys(Da).map(e=>`data-sr-${e}`)}connectedCallback(){Zi(this,Ta,this,!0),this._umutate=ea(this,za,{attributeFilter:[`id`,`value`,`role`,`aria-expanded`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];Da[r]&&(this._texts[r]=n||Da[r]),r===`clear`&&this.clear&&q(this.clear,X,this._texts.clear)}disconnectedCallback(){var e;Qi(this,Ta,this,!0),(e=this._umutate)==null||e.call(this),this._umutate=this._clear=this._toggle=this._control=this._singleTypingMatch=this._select=this._options=this._items=this._list=void 0}handleEvent(e){this.control?.disabled||this.control?.readOnly||(e.type===`blur`&&ja(this),e.type===`click`&&Na(this,e),e.type===wa&&Fa(this),e.type===`focus`&&ga(),e.type===`input`&&Pa(this,e),e.type===`keydown`&&Ia(this,e),e.type===`pointerdown`&&(va=!!this.list?.hidden,ua(this,e)))}get multiple(){return(q(this,`data-multiple`)??Ea)!==Ea}set multiple(e){q(this,`data-multiple`,e?``:null)}get creatable(){return(q(this,`data-creatable`)??Ea)!==Ea}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(xa),this._options=void 0),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(ya)),this._clear}get toggle(){return this._toggle?.isConnected||(this._toggle=this.querySelector(ba)),this._toggle}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){let e=!this._options&&this.list?.querySelector(Sa)?.nodeName;return e&&(this._options=this.list?.getElementsByTagName(e)),this._options||this.getElementsByTagName(`-`)}get values(){return Array.from(this.items,({value:e})=>e)}},ka=e=>{let{creatable:t,control:n,options:r,multiple:i,list:a}=e,o=(n?.value)?.trim()||``,s=o.toLowerCase()||null,c;if(a){c=[...r].find(e=>Ka(e).trim().toLowerCase()===s);let t={bubbles:!0,cancelable:!0,detail:c};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,t))||(c=[...r].find(Ya)),i)Wa(e);else for(let e of r)Ja(e,e===c)}return!c&&t&&o?{value:o,label:o}:c&&{value:qa(c),label:Ka(c)}},Aa=(e,t,n=!0)=>{let{_texts:r,control:i,items:a,multiple:o}=e;if(!t)return o?ga(r.invalid):!i?.value&&a[0]?Aa(e,a[0]):Ga(e);let s=[...a].findIndex(e=>e.value===t.value),c=a[s],l=c===na(e)&&(o&&(a[s-1]||a[s+1])||i);if(c&&!n)return Ga(e);l&&l.focus(Ca),e._focusMoved=!!l;let u=oa(`data`,{value:t.value},t.label||t.value),d={bubbles:!0,cancelable:!0,detail:c||u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,d))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,u),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,d))}else Ga(e)},ja=e=>ua(e)||setTimeout(Ma,0,e),Ma=e=>e.multiple||e.contains(na(e))||Aa(e,e._singleTypingMatch,!1),Na=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s,toggle:c}=e,l=i===e;if(c?.contains(i)&&(o?.focus(),va&&o?.click()),o&&a?.contains(i))return t.preventDefault(),ca(o,``,`deleteContentBackward`),o.focus(),va||o.click();for(let t of s){if(t.contains(i))return Aa(e,t);if(!l)continue;let{top:a,right:o,bottom:s,left:c,width:u,height:d}=t.getBoundingClientRect();if(u&&d&&r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}l&&o?.focus()},Pa=(e,t)=>{var n;let{control:r,options:i,multiple:a}=e,{isTrusted:o,inputType:s}=t;if(o&&!s&&r?.value||!o&&t instanceof InputEvent&&s===``||s===`insertReplacementText`){(n=t.stopImmediatePropagation)==null||n.call(t);let o=r?.value||null,s=[...i].find(e=>qa(e)===o);if(r&&(r.value=e._value),s)return Aa(e,s,a)}else e._value=r?.value||``,!a&&o&&(e._singleTypingMatch=ka(e));Ua(e)},Fa=e=>{e._singleTypingMatch=void 0,e._value=e.control?.value||``,Ua(e)},Ia=(e,t)=>{t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`||(e.control===t.target?La(e,t):Ra(e,t))},La=(e,t)=>{var n;let{clear:r,control:i,creatable:a,items:o,list:s,multiple:c}=e;if((t.key===`ArrowLeft`||t.key===`Backspace`)&&!i?.selectionEnd&&((n=o[o.length-1])==null||n.focus(Ca),t.preventDefault()),t.key===`Enter`&&i&&(s||a)){let t=e._singleTypingMatch||ka(e);fa(i),Aa(e,t,c)}t.key===`Tab`&&!t.shiftKey&&r&&i?.value&&(t.preventDefault(),q(r,`aria-hidden`,`false`),q(r,`tabindex`,`0`),r.focus(Ca),Zi(r,`blur`,()=>Ua(e),Ki))},Ra=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=[...a].indexOf(c);if((o===` `||o===`Enter`)&&(a[l]||c===r))return(n=a[l]||r)==null||n.click(),t.preventDefault();if(a[l]){if(o.startsWith(`Arrow`)&&t.preventDefault(),o===`ArrowLeft`)return a[l-1]?.focus(Ca);if(o===`ArrowRight`)return(a[l+1]||i)?.focus(Ca);if(o===`Backspace`)return t.preventDefault(),s||Aa(e,a[l]);i?.focus()}},za=(e,t)=>{var n;if(!e.control)return;let{_texts:r,control:i,items:a,list:o,multiple:s,toggle:c}=e,l=[];for(let{addedNodes:e,removedNodes:n}of t||[]){for(let t of e)t.nodeName===`DATA`&&l.unshift(t);for(let e of n)e.nodeName===`DATA`&&l.push(e)}let u=na(e);if((s?l.length===1:l[0]===u)&&e.contains(u)){let t=i?q(i,X):null;e._speak=`${r[l[0].isConnected?`added`:`removed`]} ${J(l[0])}, `,q(i,X,`${e._speak}${ra(i)}`),e._focusMoved||setTimeout(()=>ga(e._speak.slice(0,-2))),setTimeout(Ba,300,e,t)}if(!s){let t=J(a[0]);t!==e._itemSingleVale&&Ga(e),e._itemSingleVale=t}Va(e),Ua(e),Wa(e),Ha(e),c&&q(c,`aria-expanded`,o?`${!o.hidden}`:Ea);let d=`${a.length?r.found.replace(`%d`,`${a.length}`):r.empty}`;q(i,`aria-description`,s?d:null),q(i,`list`,ia(o)),q(e._listbox,X,r.items),(n=e._umutate)==null||n.takeRecords()},Ba=(e,t)=>{e._speak=``,e.control&&q(e.control,X,t),Va(e)},Va=e=>{let{_listbox:t,_texts:n,_speak:r,items:i,multiple:a}=e,o=0;for(let e of i)q(e,X,`${r}${J(e)}, ${n.remove}${Ui?`, ${++o} ${n.of} ${i.length}`:``}`),q(e,`hidden`,a?null:``),q(e,`role`,`option`),q(e,`slot`,`items`),q(e,`tabindex`,`-1`),q(e,`value`,qa(e));q(t,`hidden`,i.length?null:``)},Ha=e=>{var t;if(e._select?.isConnected||(e._select=e.querySelector(`select`)),!e._select)return;let{_select:n,items:r,multiple:i}=e,a,o=0;q(n,`multiple`,i?``:null);for(let e of r){let t=n?.options[o++],r=J(e),i=qa(e);t?Object.assign(t,{defaultSelected:!0,selected:!0,text:r,value:i}):(a||=document.createDocumentFragment(),a.appendChild(new Option(r,i,!0,!0)))}if(a)n.appendChild(a);else for(let e of[...n.options].slice(o))e.remove();(t=e._umutate)==null||t.takeRecords()},Ua=e=>{let{clear:t,control:n,toggle:r,list:i}=e,a=!n?.value||n?.disabled||n?.readOnly;t?.nodeName===`DEL`&&q(t,`role`,`button`),t&&(q(t,X)||q(t,X,e._texts.clear),q(t,`aria-hidden`,`${Ui||Vi}`),q(t,`hidden`,a?``:null),q(t,`tabindex`,`-1`)),r&&(q(r,X)||q(r,X,e._texts.toggle),q(r,`aria-hidden`,`${Ui||Vi}`),q(r,`hidden`,a&&i?null:``),q(r,`tabindex`,`-1`),q(r,`type`,`button`))},Wa=e=>{if(!e.list)return;let{_texts:t,list:n,multiple:r,options:i,values:a}=e;q(n,`data-sr-of`,t.of),q(n,Yi,`${r}`);for(let e of i)Ja(e,a.includes(qa(e)))},Ga=e=>{if(!e.control||!e.list||e.multiple)return;let{control:t,items:n}=e,r=J(n[0]),i=r?`insertText`:`deleteContentBackward`;r!==t.value&&ca(t,r,i)},Ka=e=>q(e,`label`)??J(e),qa=e=>q(e,`value`)??J(e),Ja=(e,t)=>q(e,`selected`,t?``:null),Ya=e=>e.selected??e.hasAttribute(`selected`);if(Ri()&&!window.customElements.get(`u-combobox`)){let e=HTMLInputElement.prototype,t=Object.getOwnPropertyDescriptor(e,`value`);Object.defineProperty(e,"value",Li(Ii({},t),{set(e){var n;let r=this.parentElement,i=this.value;(n=t?.set)==null||n.call(this,e),i!==e&&r?._control===this&&this.dispatchEvent(new CustomEvent(wa,{bubbles:!0}))}}))}sa.define(`u-combobox`,Oa);var Xa=Object.defineProperty,Za=Object.getOwnPropertySymbols,Qa=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,eo=(e,t,n)=>t in e?Xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,to=(e,t)=>{for(var n in t||={})Qa.call(t,n)&&eo(e,n,t[n]);if(Za)for(var n of Za(t))$a.call(t,n)&&eo(e,n,t[n]);return e},no=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ro=no(),io=ro?navigator.userAgent:``,ao=/android/i.test(io),oo=/firefox/i.test(io),so=/iPad|iPhone|iPod/.test(io),co=ro&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),lo=ro&&window.CSSStyleSheet&&document.adoptedStyleSheets,uo={once:!0,capture:!0,passive:!0},fo=`:host(:not([hidden])) { display: block }`,po=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,mo=`${ao?`data`:`aria`}-multiselectable`,ho=typeof HTMLElement>`u`?class{}:HTMLElement,Z=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),go=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>_o(e,...t)},_o=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},vo=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(Co(`slot`)),!n.querySelector(`style`))if(!lo)n.append(Co(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},yo=(e,t,n)=>{let r=new MutationObserver(n=>{if(!no()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},bo=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},xo=e=>bo(e).activeElement,So=e=>{if(!e||!ro)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},Co=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Z(r,e,n);return r},wo={define:(e,t)=>!no()||window.customElements.get(e)||window.customElements.define(e,t)},To=(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}))},Eo=new WeakSet,Do=(e,t)=>(t?.type===`pointerdown`&&(Eo.add(e),go(document,`pointerup`,()=>Eo.delete(e),uo)),Eo.has(e)),Oo=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ko=e=>{let t=Z(e,`form`);Z(e,`form`,`#`),setTimeout(Ao,0,e,t)},Ao=(e,t)=>Z(e,`form`,t),jo=e=>(e?.textContent)?.trim()||``,Q,Mo=0,No=0,Po=e=>{clearTimeout(No),Q||(Q=Co(`div`,{"aria-live":`assertive`}),Q.style.overflow=`hidden`,Q.style.position=`fixed`,Q.style.whiteSpace=`nowrap`,Q.style.width=`1px`),Q.isConnected||document.body.append(Q),e===``&&(Q.textContent=``),e&&(Q.textContent=`${e}${Mo++%2?`\xA0`:``}`,No=setTimeout(Po,!co&&oo?2e3:300,``))},Fo=`disabled`,Io=`selected`,Lo=class extends ho{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return[`id`,Fo,Io]}connectedCallback(){ao&&(this.tabIndex=-1),this.hasAttribute(`role`)||Z(this,`role`,`option`),Z(this,`aria-disabled`,`${this.disabled}`),Z(this,`aria-selected`,`${this.selected}`),So(this)}attributeChangedCallback(e){this._skipAttrChange||=(this._skipAttrChange=!0,e===`id`?So(this):Z(this,`aria-${e}`,`${this[e]}`),!1)}get defaultSelected(){return this[Io]}set defaultSelected(e){this[Io]=e}get disabled(){return Z(this,Fo)!==null}set disabled(e){Z(this,Fo,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return Z(this,`label`)??this.text}set label(e){Z(this,`label`,e)}get selected(){return Z(this,Io)!==null}set selected(e){Z(this,Io,e?``:null)}get text(){return jo(this)}set text(e){this.textContent=e}get value(){return Z(this,`value`)??this.text}set value(e){Z(this,`value`,e)}};wo.define(`u-option`,Lo);var Ro=`data-activedescendant`,zo=`aria-hidden`,Bo=`${fo}
77
+ ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Xi} }`;pa(ba);var xa=!1,Y=`aria-label`,Sa=`button[type="reset"],del`,Ca=`button[aria-expanded]`,wa=`datalist,u-datalist,[role="listbox"]`,Ta=`option,u-option,[role="option"]`,Ea={focusVisible:!0},Da=`comboboxprogrammaticinput`,Oa=`blur focus click input keydown pointerdown ${Da}`,ka=`false`,Aa={added:`Added`,clear:`Clear input`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`,toggle:`Options`},ja=class extends Qi{constructor(){super(),this._focusMoved=!1,this._itemSingleVale=``,this._speak=``,this._texts=Ri({},Aa),this._value=``;let e=ta(this,ba);this._listbox=e.querySelector(`[role="listbox"]`)||ca(`div`),this._listbox.innerHTML=`<slot name="items"></slot>`,q(this._listbox,`aria-orientation`,`horizontal`),q(this._listbox,`role`,`listbox`),q(this._listbox,`part`,`items`),q(this._listbox,`tabindex`,`-1`),e.insertBefore(this._listbox,e.firstChild)}static get observedAttributes(){return Object.keys(Aa).map(e=>`data-sr-${e}`)}connectedCallback(){$i(this,Oa,this,!0),this._umutate=na(this,Ha,{attributeFilter:[`id`,`value`,`role`,`aria-expanded`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];Aa[r]&&(this._texts[r]=n||Aa[r]),r===`clear`&&this.clear&&q(this.clear,Y,this._texts.clear)}disconnectedCallback(){var e;ea(this,Oa,this,!0),(e=this._umutate)==null||e.call(this),this._umutate=this._clear=this._toggle=this._control=this._singleTypingMatch=this._select=this._options=this._items=this._list=void 0}handleEvent(e){this.control?.disabled||this.control?.readOnly||(e.type===`blur`&&Pa(this),e.type===`click`&&Ia(this,e),e.type===Da&&Ra(this),e.type===`focus`&&ya(),e.type===`input`&&La(this,e),e.type===`keydown`&&za(this,e),e.type===`pointerdown`&&(xa=!!this.list?.hidden,fa(this,e)))}get multiple(){return(q(this,`data-multiple`)??ka)!==ka}set multiple(e){q(this,`data-multiple`,e?``:null)}get creatable(){return(q(this,`data-creatable`)??ka)!==ka}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(wa),this._options=void 0),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(Sa)),this._clear}get toggle(){return this._toggle?.isConnected||(this._toggle=this.querySelector(Ca)),this._toggle}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){let e=!this._options&&this.list?.querySelector(Ta)?.nodeName;return e&&(this._options=this.list?.getElementsByTagName(e)),this._options||this.getElementsByTagName(`-`)}get values(){return Array.from(this.items,({value:e})=>e)}},Ma=e=>{let{creatable:t,control:n,options:r,multiple:i,list:a}=e,o=(n?.value)?.trim()||``,s=o.toLowerCase()||null,c;if(a){c=[...r].find(e=>Xa(e).trim().toLowerCase()===s);let t={bubbles:!0,cancelable:!0,detail:c};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,t))||(c=[...r].find($a)),i)Ja(e);else for(let e of r)Qa(e,e===c)}return!c&&t&&o?{value:o,label:o,creatable:t}:c&&{value:Za(c),label:Xa(c)}},Na=(e,t,n=!0)=>{let{_texts:r,control:i,items:a,multiple:o}=e;if(!t)return o?ya(r.invalid):!i?.value&&a[0]?Na(e,a[0]):Ya(e);let s=[...a].findIndex(e=>e.value===t.value),c=a[s],l=c===ia(e)&&(o&&(a[s-1]||a[s+1])||i);if(c&&!n)return Ya(e);l&&l.focus(Ea),e._focusMoved=!!l;let u=ca(`data`,{value:t.value},t.label||t.value),d={bubbles:!0,cancelable:!0,detail:c||u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,d))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,u),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,d))}else Ya(e)},Pa=e=>fa(e)||setTimeout(Fa,0,e),Fa=e=>e.multiple||e.contains(ia(e))||Na(e,e._singleTypingMatch?.creatable?void 0:e._singleTypingMatch,!1),Ia=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s,toggle:c,multiple:l}=e,u=i===e;if(c?.contains(i)&&(o?.focus(),xa&&o?.click()),o&&a?.contains(i))return t.preventDefault(),ua(o,``,`deleteContentBackward`),l||Na(e),o.focus(),xa||o.click();for(let t of s){if(t.contains(i))return Na(e,t);if(!u)continue;let{top:a,right:o,bottom:s,left:c,width:l,height:d}=t.getBoundingClientRect();if(l&&d&&r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}u&&o?.focus()},La=(e,t)=>{var n;let{control:r,options:i,multiple:a}=e,{isTrusted:o,inputType:s}=t;if(o&&!s&&r?.value||!o&&t instanceof InputEvent&&s===``||s===`insertReplacementText`){(n=t.stopImmediatePropagation)==null||n.call(t);let o=r?.value||null,s=[...i].find(e=>Za(e)===o);if(a&&Wa(e,!0),s)return Na(e,s,a)}else Wa(e),!a&&o&&(e._singleTypingMatch=Ma(e));qa(e)},Ra=e=>{e._singleTypingMatch=void 0,Wa(e),qa(e)},za=(e,t)=>{t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`||(e.control===t.target?Ba(e,t):Va(e,t))},Ba=(e,t)=>{var n;let{clear:r,control:i,creatable:a,items:o,list:s,multiple:c}=e;if((t.key===`ArrowLeft`||t.key===`Backspace`)&&!i?.selectionEnd&&((n=o[o.length-1])==null||n.focus(Ea),t.preventDefault()),t.key===`Enter`&&i&&(s||a)){let t=e._singleTypingMatch||Ma(e);ma(i),Na(e,t,c)}t.key===`Tab`&&!t.shiftKey&&r&&i?.value&&(t.preventDefault(),q(r,`aria-hidden`,`false`),q(r,`tabindex`,`0`),r.focus(Ea),$i(r,`blur`,()=>qa(e),Ji))},Va=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=[...a].indexOf(c);if((o===` `||o===`Enter`)&&(a[l]||c===r))return(n=a[l]||r)==null||n.click(),t.preventDefault();if(a[l]){if(o.startsWith(`Arrow`)&&t.preventDefault(),o===`ArrowLeft`)return a[l-1]?.focus(Ea);if(o===`ArrowRight`)return(a[l+1]||i)?.focus(Ea);if(o===`Backspace`)return t.preventDefault(),s||Na(e,a[l]);i?.focus()}},Ha=(e,t)=>{var n;if(!e.control)return;let{_texts:r,control:i,items:a,list:o,multiple:s,toggle:c}=e,l=[];for(let{addedNodes:e,removedNodes:n}of t||[]){for(let t of e)t.nodeName===`DATA`&&l.unshift(t);for(let e of n)e.nodeName===`DATA`&&l.push(e)}let u=ia(e);if((s?l.length===1:l[0]===u)&&e.contains(u)){let t=i?q(i,Y):null;e._speak=`${r[l[0].isConnected?`added`:`removed`]} ${ga(l[0])}, `,q(i,Y,`${e._speak}${aa(i)}`),e._focusMoved||setTimeout(()=>ya(e._speak.slice(0,-2))),setTimeout(Ua,300,e,t)}if(!s){let t=ga(a[0]);t!==e._itemSingleVale&&Ya(e),e._itemSingleVale=t}Ga(e),qa(e),Ja(e),Ka(e),c&&q(c,`aria-expanded`,o?`${!o.hidden}`:ka);let d=`${a.length?r.found.replace(`%d`,`${a.length}`):r.empty}`;q(i,`aria-description`,s?d:null),q(i,`list`,oa(o)),q(e._listbox,Y,r.items),(n=e._umutate)==null||n.takeRecords()},Ua=(e,t)=>{e._speak=``,e.control&&q(e.control,Y,t),Ga(e)},Wa=(e,t=!1)=>{let n=e.control,r=n?.value||``;clearTimeout(e._valueTimer),e._valueTimer=setTimeout(()=>{t?n&&(n.value=e._value||``):e._value=r})},Ga=e=>{let{_listbox:t,_texts:n,_speak:r,items:i,multiple:a}=e,o=0;for(let e of i)q(e,Y,`${r}${ga(e)}, ${n.remove}${Gi?`, ${++o} ${n.of} ${i.length}`:``}`),q(e,`hidden`,a?null:``),q(e,`role`,`option`),q(e,`slot`,`items`),q(e,`tabindex`,`-1`),q(e,`value`,Za(e));q(t,`hidden`,i.length?null:``)},Ka=e=>{var t;if(e._select?.isConnected||(e._select=e.querySelector(`select`)),!e._select)return;let{_select:n,items:r,multiple:i}=e,a,o=0;q(n,`multiple`,i?``:null);for(let e of r){let t=n?.options[o++],r=ga(e),i=Za(e);t?Object.assign(t,{defaultSelected:!0,selected:!0,text:r,value:i}):(a||=document.createDocumentFragment(),a.appendChild(new Option(r,i,!0,!0)))}if(a)n.appendChild(a);else for(let e of[...n.options].slice(o))e.remove();(t=e._umutate)==null||t.takeRecords()},qa=e=>{let{clear:t,control:n,toggle:r,list:i}=e,a=!n?.value||n?.disabled||n?.readOnly;t?.nodeName===`DEL`&&q(t,`role`,`button`),t&&(q(t,Y)||q(t,Y,e._texts.clear),q(t,`aria-hidden`,`${Gi||Ui}`),q(t,`hidden`,a?``:null),q(t,`tabindex`,`-1`)),r&&(q(r,Y)||q(r,Y,e._texts.toggle),q(r,`aria-hidden`,`${Gi||Ui}`),q(r,`hidden`,a&&i?null:``),q(r,`tabindex`,`-1`),q(r,`type`,`button`))},Ja=e=>{if(!e.list)return;let{_texts:t,list:n,multiple:r,options:i,values:a}=e;q(n,`data-sr-of`,t.of),q(n,Zi,`${r}`);for(let e of i)Qa(e,a.includes(Za(e)))},Ya=e=>{if(!e.control||!e.list||e.multiple)return;let{control:t,items:n}=e,r=ga(n[0]),i=r?`insertText`:`deleteContentBackward`;r!==t.value&&ua(t,r,i)},Xa=e=>q(e,`label`)??ga(e),Za=e=>q(e,`value`)??ga(e),Qa=(e,t)=>q(e,`selected`,t?``:null),$a=e=>e.selected??e.hasAttribute(`selected`);if(Bi()&&!window.customElements.get(`u-combobox`)){let e=HTMLInputElement.prototype,t=Object.getOwnPropertyDescriptor(e,`value`);Object.defineProperty(e,"value",zi(Ri({},t),{set(e){var n;let r=this.parentElement,i=this.value;(n=t?.set)==null||n.call(this,e),i!==e&&r?._control===this&&this.dispatchEvent(new CustomEvent(Da,{bubbles:!0}))}}))}la.define(`u-combobox`,ja);var eo=Object.defineProperty,to=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,io=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ao=(e,t)=>{for(var n in t||={})no.call(t,n)&&io(e,n,t[n]);if(to)for(var n of to(t))ro.call(t,n)&&io(e,n,t[n]);return e},oo=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,so=oo(),co=so?navigator.userAgent:``,lo=/android/i.test(co),uo=/firefox/i.test(co),fo=/iPad|iPhone|iPod/.test(co),po=so&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),mo=so&&window.CSSStyleSheet&&document.adoptedStyleSheets,ho={once:!0,capture:!0,passive:!0},go=`:host(:not([hidden])) { display: block }`,_o=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,vo=`${lo?`data`:`aria`}-multiselectable`,yo=typeof HTMLElement>`u`?class{}:HTMLElement,X=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),bo=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>xo(e,...t)},xo=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},So=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(Do(`slot`)),!n.querySelector(`style`))if(!mo)n.append(Do(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Co=(e,t,n)=>{let r=new MutationObserver(n=>{if(!oo()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},wo=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},To=e=>wo(e).activeElement,Eo=e=>{if(!e||!so)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},Do=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))X(r,e,n);return r},Oo={define:(e,t)=>!oo()||window.customElements.get(e)||window.customElements.define(e,t)},ko=(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}))},Ao=new WeakSet,jo=(e,t)=>(t?.type===`pointerdown`&&(Ao.add(e),bo(document,`pointerup`,()=>Ao.delete(e),ho)),Ao.has(e)),Mo=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,No=e=>{let t=X(e,`form`);X(e,`form`,`#`),setTimeout(Po,0,e,t)},Po=(e,t)=>X(e,`form`,t),Fo=e=>(e?.textContent)?.trim()||``,Z,Io=0,Lo=0,Ro=e=>{clearTimeout(Lo),Z||(Z=Do(`div`,{"aria-live":`assertive`}),Z.style.overflow=`hidden`,Z.style.position=`fixed`,Z.style.whiteSpace=`nowrap`,Z.style.width=`1px`),Z.isConnected||document.body.append(Z),e===``&&(Z.textContent=``),e&&(Z.textContent=`${e}${Io++%2?`\xA0`:``}`,Lo=setTimeout(Ro,!po&&uo?2e3:300,``))},zo=`disabled`,Bo=`selected`,Vo=class extends yo{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return[`id`,zo,Bo]}connectedCallback(){lo&&(this.tabIndex=-1),this.hasAttribute(`role`)||X(this,`role`,`option`),X(this,`aria-disabled`,`${this.disabled}`),X(this,`aria-selected`,`${this.selected}`),Eo(this)}attributeChangedCallback(e){this._skipAttrChange||=(this._skipAttrChange=!0,e===`id`?Eo(this):X(this,`aria-${e}`,`${this[e]}`),!1)}get defaultSelected(){return this[Bo]}set defaultSelected(e){this[Bo]=e}get disabled(){return X(this,zo)!==null}set disabled(e){X(this,zo,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return X(this,`label`)??this.text}set label(e){X(this,`label`,e)}get selected(){return X(this,Bo)!==null}set selected(e){X(this,Bo,e?``:null)}get text(){return Fo(this)}set text(e){this.textContent=e}get value(){return X(this,`value`)??this.text}set value(e){X(this,`value`,e)}};Oo.define(`u-option`,Vo);var Ho=`data-activedescendant`,Uo=`aria-hidden`,Wo=`${go}
78
78
  ::slotted([role="option"]) { display: block; cursor: pointer }
79
- ::slotted([role="option"][${Ro}]) { ${po} }
80
- ::slotted([role="option"]:is([${zo}="true"], [disabled], [hidden])) { display: none !important }`,Vo=Oo(Bo),Ho,Uo=`focus click keydown`,Wo=`focusout input pointerdown`,Go={of:`of`,plural:`%d hits`,singular:`%d hit`},Ko=class extends ho{constructor(){super(),this._texts=to({},Go),vo(this,Bo)}static get observedAttributes(){return[`id`,...Object.keys(Go).map(e=>`data-sr-${e}`)]}connectedCallback(){this._root=bo(this),Z(this,`hidden`,``),Z(this,`role`,`listbox`),Z(this,`tabindex`,`-1`),go(this._root,Uo,this,!0),this._umutate=yo(this,as,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;this._root&&_o(this._root,Uo,this,!0),this._root&&_o(this._root,Wo,this),Qo(this,null),(e=this._umutate)==null||e.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1];if(Go[r])this._texts[r]=n||Go[r];else if(this.id){let e=`input[list="${this.id}"]`,t=bo(this).querySelector(e);t&&Qo(this,t)}}handleEvent(e){e.defaultPrevented||(e.type===`focus`&&$o(this,e),e.type===`focusout`&&es(this,e),e.type===`click`&&rs(this,e),e.type===`input`&&as(this),e.type===`keydown`&&is(this,e),e.type===`pointerdown`&&ns(this,e))}get options(){let e=!this._options&&this.querySelector(`[role="option"],option`);return e&&(this._options=this.getElementsByTagName(e?.nodeName)),this._options||this.getElementsByTagName(`option`)}},qo=e=>e.disabled||e.readOnly,Jo=e=>e instanceof HTMLInputElement,Yo=e=>Z(e,zo)!==`true`&&e.clientHeight,Xo=(e,t)=>{e._input&&Z(e._input,`aria-expanded`,`${t}`),!(!e.isConnected||e.hidden!==t)&&(t||Zo(e),e.popover&&e.togglePopover(t),t&&setTimeout(()=>clearTimeout(Ho)),e.hidden=!t)},Zo=(e,t)=>{e._input&&Z(e._input,`aria-activedescendant`,So(t));for(let n of e.options)Z(n,Ro,n===t?``:null);t?.scrollIntoView({block:`nearest`})},Qo=(e,t)=>{let n=t||e._input,r=!e._root||e.hidden;n&&(e.popover&&(Z(e,`popover`,`manual`),Z(n,`popovertarget`,t&&So(e))),Z(n,`aria-autocomplete`,t&&`list`),Z(n,`aria-controls`,t&&So(e)),Z(n,`aria-expanded`,t&&`${!r}`),Z(n,`autocomplete`,t&&`off`),Z(n,`enterkeyhint`,`done`),Z(n,`role`,t&&!qo(n)?`combobox`:null))},$o=(e,{target:t})=>{if(e._input!==t)if(Jo(t)&&t.getAttribute(`list`)===e.id){if(Qo(e,null),Qo(e,t),qo(t))return;e._root&&go(e._root,Wo,e),Z(e,`aria-label`,(t.labels?.[0])?.textContent.trim()||null),Po(),e._input=t,ao&&Xo(e,!0)}else ts(e)},es=(e,t)=>{Do(e)?t.stopImmediatePropagation():ao||setTimeout(ts,0,e,t)},ts=e=>{let t=xo(e);e._input===t||e.contains(t)||(e._root&&_o(e._root,Wo,e),Xo(e,!1),e._input=void 0)},ns=(e,t)=>e.contains(t.target)&&Do(e,t),rs=(e,t)=>{var n;if(Jo(t.target)&&$o(e,t),e._input===t.target)return Xo(e,!0);if(!e.contains(t.target))return ts(e);for(let r of e.options)if(r.contains(t.target))return(n=e._input)==null||n.focus(),e._input&&To(e._input,r.value),Xo(e,Z(e,mo)===`true`)},is=(e,t)=>{if(Jo(t.target)&&$o(e,t),e._input!==t.target)return;let{key:n,ctrlKey:r,metaKey:i,altKey:a}=t;if(r||i||n===`Shift`||n===`Tab`||a&&!n.startsWith(`Arrow`))return;n===`Escape`&&!e.hidden&&t.preventDefault(),Xo(e,n!==`Escape`);let o=n===`Enter`,s=Z(e._input,`aria-activedescendant`),c=[],l=-1,u=-1;for(let t of e.options)Yo(t)&&(c.push(t),t.id===s&&(l=c.length-1));!a&&n===`ArrowDown`&&(u=(l+1)%c.length),!a&&n===`ArrowUp`&&(u=(l||c.length)-1),~l&&((n===`Home`||n===`PageUp`)&&(u=0),(n===`End`||n===`PageDown`)&&(u=c.length-1),o&&(u=l)),c[u]&&(t.preventDefault(),e._input.focus()),o&&c[u]?(t.stopImmediatePropagation(),ko(e._input),c[u].click()):Zo(e,c[u])},as=e=>{var t;if(!e._input||e.hidden)return;let n=e._input.value.toLowerCase().trim()||``,r=!e.hasAttribute(`data-nofilter`),i=[],a=[];for(let t of e.options)(t.disabled||t.hidden||r&&!t.label.toLowerCase().includes(n)?i:a).push(t);for(let e of i)Z(e,zo,`true`);for(let e of a)Z(e,zo,`false`);clearTimeout(Ho),Ho=setTimeout(os,500,e,a),so&&a.forEach((t,n,{length:r})=>{Z(t,`title`,`${n+1} ${e._texts.of} ${r}`)}),(t=e._umutate)==null||t.takeRecords()},os=(e,t)=>!e.hidden&&e._input===xo(e)&&Po(`${t.some(({value:e})=>e)?`${e._texts[t[1]?`plural`:`singular`]}`.replace(`%d`,`${t.length}`):e.innerText}`);no()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){let e=Z(this,`list`);return e&&bo(this).getElementById(e)}}),wo.define(`u-datalist`,Ko);let ss=`data-empty`,cs=`comboboxafterselect comboboxprogrammaticinput input`,ls=/\{value\}|%s/,us=`data-sr-singular`,ds=`data-sr-plural`,fs=`added,clear,empty,found,invalid,items,of,plural,remove,removed,singular,toggle`.split(`,`).map(e=>`data-sr-${e}`);var ps=class extends Oa{_unmutate;connectedCallback(){for(let e of fs)u(this,e,m(this,e));super.connectedCallback(),this._unmutate=S(this,ms,{childList:!0}),v(this,cs,hs,i),v(this,`toggle`,gs,i)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,y(this,cs,hs,i),y(this,`toggle`,gs,i)}};let ms=e=>{let{control:t,list:n}=e;n||=e.querySelector(`u-datalist`),t&&u(t,`popovertarget`,n?E(n):null),n&&(u(n,ds)||u(n,ds,u(e,ds)),u(n,us)||u(n,us,u(e,us)),u(n,`data-is-floating`,`true`),u(n,`popover`,`manual`)),hs({currentTarget:e})},hs=({currentTarget:e})=>{let{creatable:t,control:n,options:r,values:i}=e;if(!r)return;let a=n?.value.trim()||``,o=a.toLowerCase(),s,c=!1;for(let e of r)if(!s&&e.hasAttribute(ss)?s=e:!c&&(!o||e.label?.toLowerCase()===o)&&(c=!0),c&&s)break;if(s&&(s.hidden=c,u(s,`label`,a),u(s,`value`,t?a:``),t)){let e=i.some(e=>e===a),t=m(s,ss),n=!e&&t?.replace(ls,()=>a)||a;t?u(s,ss,t):l(`Missing ${ss} value on:`,s),u(s,`disabled`,e&&s.textContent?`true`:null),u(s,`data-create`,n)}},gs=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:n}))};w.define(`ds-suggestion`,ps);var _s=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,vs=_s(),ys=vs?navigator.userAgent:``,bs=/android/i.test(ys);vs&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var xs=vs&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ss=`:host(:not([hidden])) { display: block }`,Cs=`${bs?`data`:`aria`}-labelledby`,ws=typeof HTMLElement>`u`?class{}:HTMLElement,$=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),Ts=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Es(e,...t)},Es=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Ds=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(js(`slot`)),!n.querySelector(`style`))if(!xs)n.append(js(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Os=(e,t,n)=>{let r=new MutationObserver(n=>{if(!_s()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ks=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},As=e=>{if(!e||!vs)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},js=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))$(r,e,n);return r},Ms={define:(e,t)=>!_s()||window.customElements.get(e)||window.customElements.define(e,t)},Ns=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Ps=`aria-controls`,Fs=`aria-disabled`,Is=`aria-selected`,Ls=`tabindex`,Rs=Ss,zs=Ss,Bs=`${Ss}
79
+ ::slotted([role="option"][${Ho}]) { ${_o} }
80
+ ::slotted([role="option"]:is([${Uo}="true"], [disabled], [hidden])) { display: none !important }`,Go=Mo(Wo),Ko,qo=`focus click keydown`,Jo=`focusout input pointerdown`,Yo={of:`of`,plural:`%d hits`,singular:`%d hit`},Xo=class extends yo{constructor(){super(),this._texts=ao({},Yo),So(this,Wo)}static get observedAttributes(){return[`id`,...Object.keys(Yo).map(e=>`data-sr-${e}`)]}connectedCallback(){this._root=wo(this),X(this,`hidden`,``),X(this,`role`,`listbox`),X(this,`tabindex`,`-1`),bo(this._root,qo,this,!0),this._umutate=Co(this,ls,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;this._root&&xo(this._root,qo,this,!0),this._root&&xo(this._root,Jo,this),ns(this,null),(e=this._umutate)==null||e.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1];if(Yo[r])this._texts[r]=n||Yo[r];else if(this.id){let e=`input[list="${this.id}"]`,t=wo(this).querySelector(e);t&&ns(this,t)}}handleEvent(e){e.defaultPrevented||(e.type===`focus`&&rs(this,e),e.type===`focusout`&&is(this,e),e.type===`click`&&ss(this,e),e.type===`input`&&ls(this),e.type===`keydown`&&cs(this,e),e.type===`pointerdown`&&os(this,e))}get options(){let e=!this._options&&this.querySelector(`[role="option"],option`);return e&&(this._options=this.getElementsByTagName(e?.nodeName)),this._options||this.getElementsByTagName(`option`)}},Zo=e=>e.disabled||e.readOnly,Qo=e=>e instanceof HTMLInputElement,$o=e=>X(e,Uo)!==`true`&&e.clientHeight,es=(e,t)=>{e._input&&X(e._input,`aria-expanded`,`${t}`),!(!e.isConnected||e.hidden!==t)&&(t||ts(e),e.popover&&e.togglePopover(t),t&&setTimeout(()=>clearTimeout(Ko)),e.hidden=!t)},ts=(e,t)=>{e._input&&X(e._input,`aria-activedescendant`,Eo(t));for(let n of e.options)X(n,Ho,n===t?``:null);t?.scrollIntoView({block:`nearest`})},ns=(e,t)=>{let n=t||e._input,r=!e._root||e.hidden;n&&(e.popover&&(X(e,`popover`,`manual`),X(n,`popovertarget`,t&&Eo(e))),X(n,`aria-autocomplete`,t&&`list`),X(n,`aria-controls`,t&&Eo(e)),X(n,`aria-expanded`,t&&`${!r}`),X(n,`autocomplete`,t&&`off`),X(n,`enterkeyhint`,`done`),X(n,`role`,t&&!Zo(n)?`combobox`:null))},rs=(e,{target:t})=>{if(e._input!==t)if(Qo(t)&&t.getAttribute(`list`)===e.id){if(ns(e,null),ns(e,t),Zo(t))return;e._root&&bo(e._root,Jo,e),X(e,`aria-label`,(t.labels?.[0])?.textContent.trim()||null),Ro(),e._input=t,lo&&es(e,!0)}else as(e)},is=(e,t)=>{jo(e)?t.stopImmediatePropagation():lo||setTimeout(as,0,e,t)},as=e=>{let t=To(e);e._input===t||e.contains(t)||(e._root&&xo(e._root,Jo,e),es(e,!1),e._input=void 0)},os=(e,t)=>e.contains(t.target)&&jo(e,t),ss=(e,t)=>{var n;if(Qo(t.target)&&rs(e,t),e._input===t.target)return es(e,!0);if(!e.contains(t.target))return as(e);for(let r of e.options)if(r.contains(t.target))return(n=e._input)==null||n.focus(),e._input&&ko(e._input,r.value),es(e,X(e,vo)===`true`)},cs=(e,t)=>{if(Qo(t.target)&&rs(e,t),e._input!==t.target)return;let{key:n,ctrlKey:r,metaKey:i,altKey:a}=t;if(r||i||n===`Shift`||n===`Tab`||a&&!n.startsWith(`Arrow`))return;n===`Escape`&&!e.hidden&&t.preventDefault(),es(e,n!==`Escape`);let o=n===`Enter`,s=X(e._input,`aria-activedescendant`),c=[],l=-1,u=-1;for(let t of e.options)$o(t)&&(c.push(t),t.id===s&&(l=c.length-1));!a&&n===`ArrowDown`&&(u=(l+1)%c.length),!a&&n===`ArrowUp`&&(u=(l||c.length)-1),~l&&((n===`Home`||n===`PageUp`)&&(u=0),(n===`End`||n===`PageDown`)&&(u=c.length-1),o&&(u=l)),c[u]&&(t.preventDefault(),e._input.focus()),o&&c[u]?(t.stopImmediatePropagation(),No(e._input),c[u].click()):ts(e,c[u])},ls=e=>{var t;if(!e._input||e.hidden)return;let n=e._input.value.toLowerCase().trim()||``,r=!e.hasAttribute(`data-nofilter`),i=[],a=[];for(let t of e.options)(t.disabled||t.hidden||r&&!t.label.toLowerCase().includes(n)?i:a).push(t);for(let e of i)X(e,Uo,`true`);for(let e of a)X(e,Uo,`false`);clearTimeout(Ko),Ko=setTimeout(us,500,e,a),fo&&a.forEach((t,n,{length:r})=>{X(t,`title`,`${n+1} ${e._texts.of} ${r}`)}),(t=e._umutate)==null||t.takeRecords()},us=(e,t)=>!e.hidden&&e._input===To(e)&&Ro(`${t.some(({value:e})=>e)?`${e._texts[t[1]?`plural`:`singular`]}`.replace(`%d`,`${t.length}`):e.innerText}`);oo()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){let e=X(this,`list`);return e&&wo(this).getElementById(e)}}),Oo.define(`u-datalist`,Xo);let ds=`data-empty`,fs=`comboboxafterselect comboboxprogrammaticinput input`,ps=/\{value\}|%s/,ms=`data-sr-singular`,hs=`data-sr-plural`,gs=`added,clear,empty,found,invalid,items,of,plural,remove,removed,singular,toggle`.split(`,`).map(e=>`data-sr-${e}`);var _s=class extends ja{_unmutate;connectedCallback(){for(let e of gs)u(this,e,m(this,e));super.connectedCallback(),this._unmutate=S(this,vs,{childList:!0}),v(this,fs,ys,i),v(this,`toggle`,bs,i)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,y(this,fs,ys,i),y(this,`toggle`,bs,i)}};let vs=e=>{let{control:t,list:n}=e;n||=e.querySelector(`u-datalist`),t&&u(t,`popovertarget`,n?E(n):null),n&&(u(n,hs)||u(n,hs,u(e,hs)),u(n,ms)||u(n,ms,u(e,ms)),u(n,`data-is-floating`,`true`),u(n,`popover`,`manual`)),ys({currentTarget:e})},ys=e=>{let t=e.currentTarget,{creatable:n,control:r,options:i}=t;if(!i)return;let a=r?.value.trim()||``,o=a.toLowerCase(),s,c=!1;for(let e of i)if(!s&&e.hasAttribute(ds)?s=e:!c&&(!o||e.label?.toLowerCase()===o)&&(c=!0),c&&s)break;if(s&&(s.hidden=c||n&&!a,u(s,`label`,a),u(s,`value`,n?a:``),n)){let e=t.values.includes(a),n=m(s,ds),r=!e&&n?.replace(ps,()=>a)||a;n?u(s,ds,n):l(`Missing ${ds} value on:`,s);let i=e&&s.textContent?`true`:null;u(s,`disabled`,i),u(s,`data-create`,r)}},bs=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:n}))};w.define(`ds-suggestion`,_s);var xs=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Ss=xs(),Cs=Ss?navigator.userAgent:``,ws=/android/i.test(Cs);Ss&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Ts=Ss&&window.CSSStyleSheet&&document.adoptedStyleSheets,Es=`:host(:not([hidden])) { display: block }`,Ds=`${ws?`data`:`aria`}-labelledby`,Os=typeof HTMLElement>`u`?class{}:HTMLElement,Q=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ks=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>As(e,...t)},As=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},js=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(Fs(`slot`)),!n.querySelector(`style`))if(!Ts)n.append(Fs(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Ms=(e,t,n)=>{let r=new MutationObserver(n=>{if(!xs()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Ns=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},Ps=e=>{if(!e||!Ss)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},Fs=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Q(r,e,n);return r},Is={define:(e,t)=>!xs()||window.customElements.get(e)||window.customElements.define(e,t)},Ls=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Rs=`aria-controls`,zs=`aria-disabled`,Bs=`aria-selected`,Vs=`tabindex`,Hs=Es,Us=Es,Ws=`${Es}
81
81
  ::slotted([role="tab"]:not([hidden])) { display: inline-block; cursor: pointer }
82
- ::slotted([role="tab"][${Fs}="true"]) { cursor: default }`;Ns(Rs),Ns(Bs),Ns(zs);var Vs=class extends ws{constructor(){super(),Ds(this,Rs)}get tabList(){return this.querySelector(`[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])`)}get selectedIndex(){let e=Qs(this.tabList);return e.indexOf(Zs(e))}set selectedIndex(e){tc(this.tabs[e])}get tabs(){return this.querySelectorAll(`[role="tab"]:not(:scope [role="tabpanel"] [role="tab"])`)}get panels(){return this.querySelectorAll(`[role="tabpanel"]:not(:scope [role="tabpanel"] [role="tabpanel"])`)}},Hs=class extends ws{constructor(){super(),Ds(this,Bs)}connectedCallback(){$(this,`role`,`tablist`),Ts(this,`click keydown`,this),this._umutate=Os(this,Gs,{attributeFilter:[`id`,`role`,Ps,Is],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;Es(this,`click keydown`,this),(e=this._umutate)==null||e.call(this),this._umutate=void 0}handleEvent(e){var t,n,r,i;let{key:a,type:o,target:s}=e,c=Qs(this),l=c.findIndex(e=>e.contains(s)),u=a===` `||a===`Enter`,d=l;if(!(e.defaultPrevented||l===-1)&&(o===`click`&&tc(c[l]),o===`keydown`)){if(u)return(t=e.preventDefault)==null||t.call(e),c[l].dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0}));if(a===`ArrowDown`||a===`ArrowRight`)d=(l+1)%c.length;else if(a===`ArrowUp`||a===`ArrowLeft`)d=(l||c.length)-1;else if(a===`End`)d=c.length-1;else if(a===`Home`)d=0;else if(a===`Tab`&&!Xs(c[l])){let e=Zs(c);return e&&$(e,Ls,`-1`),e&&setTimeout(()=>$(e,Ls,`0`))}else return;(n=e.preventDefault)==null||n.call(e),(i=(r=c[d]).focus)==null||i.call(r)}}get tabsElement(){return ec(this)}get tabs(){return this.querySelectorAll(`:scope > [role="tab"]`)}get selectedIndex(){let e=Qs(this);return e.indexOf(Zs(e))}set selectedIndex(e){tc(this.tabs[e])}},Us=class extends ws{static get observedAttributes(){return[`id`,Is,Ps]}connectedCallback(){$(this,`role`,`tab`),$(this,Is,`${this.selected}`),$(this,Ls,this.selected?`0`:`-1`),Zs(this.parentElement?.children)||tc(this)}attributeChangedCallback(){!qs.has(this.parentElement)&&this.selected&&tc(this)}get tabsElement(){return ec(this)}get tabList(){let e=this.parentElement;return e instanceof Hs?e:null}get selected(){return Xs(this)}set selected(e){e&&tc(this)}get index(){return Math.max(Qs(this.parentElement).indexOf(this),0)}get panel(){let e=ec(this)?.panels,t=Qs(this.parentElement).indexOf(this);return $s(this,e?.[t])}},Ws=class extends ws{constructor(){super(),Ds(this,zs)}connectedCallback(){$(this,`role`,`tabpanel`);let e=new Set(this.tabs),t=ec(this),n=t?.tabs[Array.prototype.indexOf.call(t?.panels,this)];n&&!n.hasAttribute(Ps)&&e.add(n);let r=Zs(e)||e.values().next().value;Js(r,()=>Ks(this,r,!!r&&Xs(r)))}get tabsElement(){return ec(this)}get tabs(){return ks(this).querySelectorAll(`[${Ps}="${As(this)}"]`)}},Gs=(e,t=[])=>{let n;for(let{target:e}of t)e instanceof Element&&$(e,`role`)===`tab`&&Xs(e)&&(n=e);tc(n)},Ks=(e,t,n=!1)=>{$(e,`aria-hidden`,`${!n}`),$(e,`hidden`,n?null:``),$(e,Ls,n?`0`:null),t&&$(t,Ps,As(e)),t&&n&&Xs(t)&&$(e,Cs,As(t))},qs=new Set,Js=(e,t)=>{var n;let r=e?.parentElement;r&&qs.add(r),t(),r&&qs.delete(r),(n=r?._umutate)==null||n.takeRecords()},Ys=e=>$(e,Fs)!==`true`,Xs=e=>$(e,Is)===`true`,Zs=(e=[])=>{for(let t of e)if(Xs(t))return t},Qs=e=>{let t=[];for(let n of e?.children||[])n.getAttribute(`role`)===`tab`&&t.push(n);return t},$s=(e,t=null)=>{let n=$(e,Ps);return n?ks(e).getElementById(n):t},ec=e=>{for(let t=e;t;t=t.parentNode||t.host)if(t instanceof Vs)return t;return null},tc=e=>e&&Ys(e)&&Js(e,()=>{let t=Qs(e.parentElement),n=ec(e)?.panels||[],r=$s(e,n?.[t.indexOf(e)]),i=0;for(let a of t){let t=$s(a,n[i++]);$(a,Is,`${a===e}`),$(a,Ls,a===e?`0`:`-1`),t&&Ks(t,a,t===r)}});Ms.define(`u-tabs`,Vs),Ms.define(`u-tablist`,Hs),Ms.define(`u-tab`,Us),Ms.define(`u-tabpanel`,Ws);var nc=class extends Vs{},rc=class extends Hs{},ic=class extends Us{},ac=class extends Ws{};w.define(`ds-tabs`,nc),w.define(`ds-tablist`,rc),w.define(`ds-tab`,ic),w.define(`ds-tabpanel`,ac),e.DSBreadcrumbsElement=ai,e.DSErrorSummaryElement=si,e.DSFieldElement=xi,e.DSPaginationElement=Ei,e.DSSuggestionElement=ps,e.DSTabElement=ic,e.DSTabListElement=rc,e.DSTabPanelElement=ac,e.DSTabsElement=nc,e.UHTMLDataListElement=Ko,e.UHTMLDataListShadowRoot=Vo,e.UHTMLDataListStyle=Bo,e.initTooltips=$r,e.pagination=Ti,e.setTooltipElement=Qr});
82
+ ::slotted([role="tab"][${zs}="true"]) { cursor: default }`;Ls(Hs),Ls(Ws),Ls(Us);var Gs=class extends Os{constructor(){super(),js(this,Hs)}get tabList(){return this.querySelector(`[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])`)}get selectedIndex(){let e=nc(this.tabList);return e.indexOf(tc(e))}set selectedIndex(e){$(this.tabs[e])}get tabs(){return this.querySelectorAll(`[role="tab"]:not(:scope [role="tabpanel"] [role="tab"])`)}get panels(){return this.querySelectorAll(`[role="tabpanel"]:not(:scope [role="tabpanel"] [role="tabpanel"])`)}},Ks=class extends Os{constructor(){super(),js(this,Ws)}connectedCallback(){Q(this,`role`,`tablist`),ks(this,`click keydown`,this),this._umutate=Ms(this,Ys,{attributeFilter:[`id`,`role`,Rs,Bs],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;As(this,`click keydown`,this),(e=this._umutate)==null||e.call(this),this._umutate=void 0}handleEvent(e){var t,n,r,i;let{key:a,type:o,target:s}=e,c=nc(this),l=c.findIndex(e=>e.contains(s)),u=a===` `||a===`Enter`,d=l;if(!(e.defaultPrevented||l===-1)&&(o===`click`&&$(c[l]),o===`keydown`)){if(u)return(t=e.preventDefault)==null||t.call(e),c[l].dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0}));if(a===`ArrowDown`||a===`ArrowRight`)d=(l+1)%c.length;else if(a===`ArrowUp`||a===`ArrowLeft`)d=(l||c.length)-1;else if(a===`End`)d=c.length-1;else if(a===`Home`)d=0;else if(a===`Tab`&&!ec(c[l])){let e=tc(c);return e&&Q(e,Vs,`-1`),e&&setTimeout(()=>Q(e,Vs,`0`))}else return;(n=e.preventDefault)==null||n.call(e),(i=(r=c[d]).focus)==null||i.call(r)}}get tabsElement(){return ic(this)}get tabs(){return this.querySelectorAll(`:scope > [role="tab"]`)}get selectedIndex(){let e=nc(this);return e.indexOf(tc(e))}set selectedIndex(e){$(this.tabs[e])}},qs=class extends Os{static get observedAttributes(){return[`id`,Bs,Rs]}connectedCallback(){Q(this,`role`,`tab`),Q(this,Bs,`${this.selected}`),Q(this,Vs,this.selected?`0`:`-1`),tc(this.parentElement?.children)||$(this)}attributeChangedCallback(){!Zs.has(this.parentElement)&&this.selected&&$(this)}get tabsElement(){return ic(this)}get tabList(){let e=this.parentElement;return e instanceof Ks?e:null}get selected(){return ec(this)}set selected(e){e&&$(this)}get index(){return Math.max(nc(this.parentElement).indexOf(this),0)}get panel(){let e=ic(this)?.panels,t=nc(this.parentElement).indexOf(this);return rc(this,e?.[t])}},Js=class extends Os{constructor(){super(),js(this,Us)}connectedCallback(){Q(this,`role`,`tabpanel`);let e=new Set(this.tabs),t=ic(this),n=t?.tabs[Array.prototype.indexOf.call(t?.panels,this)];n&&!n.hasAttribute(Rs)&&e.add(n);let r=tc(e)||e.values().next().value;Qs(r,()=>Xs(this,r,!!r&&ec(r)))}get tabsElement(){return ic(this)}get tabs(){return Ns(this).querySelectorAll(`[${Rs}="${Ps(this)}"]`)}},Ys=(e,t=[])=>{let n;for(let{target:e}of t)e instanceof Element&&Q(e,`role`)===`tab`&&ec(e)&&(n=e);$(n)},Xs=(e,t,n=!1)=>{Q(e,`aria-hidden`,`${!n}`),Q(e,`hidden`,n?null:``),Q(e,Vs,n?`0`:null),t&&Q(t,Rs,Ps(e)),t&&n&&ec(t)&&Q(e,Ds,Ps(t))},Zs=new Set,Qs=(e,t)=>{var n;let r=e?.parentElement;r&&Zs.add(r),t(),r&&Zs.delete(r),(n=r?._umutate)==null||n.takeRecords()},$s=e=>Q(e,zs)!==`true`,ec=e=>Q(e,Bs)===`true`,tc=(e=[])=>{for(let t of e)if(ec(t))return t},nc=e=>{let t=[];for(let n of e?.children||[])n.getAttribute(`role`)===`tab`&&t.push(n);return t},rc=(e,t=null)=>{let n=Q(e,Rs);return n?Ns(e).getElementById(n):t},ic=e=>{for(let t=e;t;t=t.parentNode||t.host)if(t instanceof Gs)return t;return null},$=e=>e&&$s(e)&&Qs(e,()=>{let t=nc(e.parentElement),n=ic(e)?.panels||[],r=rc(e,n?.[t.indexOf(e)]),i=0;for(let a of t){let t=rc(a,n[i++]);Q(a,Bs,`${a===e}`),Q(a,Vs,a===e?`0`:`-1`),t&&Xs(t,a,t===r)}});Is.define(`u-tabs`,Gs),Is.define(`u-tablist`,Ks),Is.define(`u-tab`,qs),Is.define(`u-tabpanel`,Js);var ac=class extends Gs{},oc=class extends Ks{},sc=class extends qs{},cc=class extends Js{};w.define(`ds-tabs`,ac),w.define(`ds-tablist`,oc),w.define(`ds-tab`,sc),w.define(`ds-tabpanel`,cc),e.DSBreadcrumbsElement=oi,e.DSErrorSummaryElement=ci,e.DSFieldElement=Si,e.DSPaginationElement=Di,e.DSSuggestionElement=_s,e.DSTabElement=sc,e.DSTabListElement=oc,e.DSTabPanelElement=cc,e.DSTabsElement=ac,e.UHTMLDataListElement=Xo,e.UHTMLDataListShadowRoot=Go,e.UHTMLDataListStyle=Wo,e.initTooltips=ei,e.pagination=Ei,e.setTooltipElement=$r});
83
83
  //# sourceMappingURL=index.js.map