@mattilsynet/design 3.2.8 → 3.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/mtds/app/app-observer.js +1 -1
  2. package/mtds/app/app-toggle.js +26 -10
  3. package/mtds/app/app-toggle.js.map +1 -1
  4. package/mtds/app/app-toggle2.js +10 -26
  5. package/mtds/app/app-toggle2.js.map +1 -1
  6. package/mtds/app/app.js +1 -1
  7. package/mtds/atlas/atlas-element.js +1 -1
  8. package/mtds/breadcrumbs/breadcrumbs.d.ts +1 -1
  9. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  10. package/mtds/deprecations.js +6 -5
  11. package/mtds/deprecations.js.map +1 -1
  12. package/mtds/errorsummary/errorsummary.d.ts +1 -1
  13. package/mtds/errorsummary/errorsummary.js.map +1 -1
  14. package/mtds/field/field.d.ts +1 -1
  15. package/mtds/field/field.js.map +1 -1
  16. package/mtds/index.d.ts +1 -2
  17. package/mtds/index.iife.js +19 -23
  18. package/mtds/index.js +32 -37
  19. package/mtds/index.js.map +1 -1
  20. package/mtds/package.json.js +1 -1
  21. package/mtds/pagination/pagination.d.ts +1 -1
  22. package/mtds/pagination/pagination.js +9 -8
  23. package/mtds/pagination/pagination.js.map +1 -1
  24. package/mtds/styles.css +1 -1
  25. package/mtds/styles.json +23 -23
  26. package/mtds/styles.module.css.js +33 -33
  27. package/mtds/tabs/tabs.d.ts +1 -1
  28. package/mtds/tabs/tabs.js.map +1 -1
  29. package/mtds/tailwind.css +0 -1
  30. package/mtds/tooltip/tooltip-element.js +7 -6
  31. package/mtds/tooltip/tooltip-element.js.map +1 -1
  32. package/package.json +5 -5
  33. package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +0 -238
  34. package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +0 -1
  35. package/mtds/external/@u-elements/u-details/dist/u-details.js +0 -101
  36. package/mtds/external/@u-elements/u-details/dist/u-details.js.map +0 -1
  37. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -235
  38. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
@@ -1,31 +1,31 @@
1
- var mtds=(function(S){"use strict";var Br=Object.defineProperty,ho=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,zr=Object.prototype.propertyIsEnumerable,go=(t,e,n)=>e in t?Br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fr=(t,e)=>{for(var n in e||(e={}))Ur.call(e,n)&&go(t,n,e[n]);if(ho)for(var n of ho(e))zr.call(e,n)&&go(t,n,e[n]);return t},Ke=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",se=Ke(),Ye=se?navigator.userAgent:"",bo=/android/i.test(Ye),Wr=/firefox/i.test(Ye),vo=/iPad|iPhone|iPod/.test(Ye),yo,Vr=se&&/^Mac/i.test(((yo=navigator.userAgentData)==null?void 0:yo.platform)||navigator.platform),Gr=se&&window.CSSStyleSheet&&document.adoptedStyleSheets,wo={once:!0,capture:!0,passive:!0},jr=":host(:not([hidden])) { display: block }",Xr="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Kr=`${bo?"data":"aria"}-multiselectable`,Yr=typeof HTMLElement>"u"?class{}:HTMLElement,E=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Qe=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>_o(t,...e)},_o=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},Qr=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Ut("slot")),!n.querySelector("style"))if(!Gr)n.append(Ut("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Jr=(t,e,n)=>{const o=new MutationObserver(s=>{if(!Ke()||!t.isConnected)return i();e(t,s)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Zr=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Je=t=>Zr(t).activeElement,ta=t=>{var e;const n=E(t,"aria-label")||"";return[...(((e=E(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,s)=>{var r;return i||((r=s?.innerText)==null?void 0:r.trim())||""},n).trim()},ea=t=>{if(!t||!se)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Ut=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))E(o,i,s);return o},na={define:(t,e)=>!Ke()||window.customElements.get(t)||window.customElements.define(t,e)},So=(t,e,n="")=>{var o,i;const s={bubbles:!0,composed:!0,data:e,inputType:n},r=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",s)),(i=(o=Object.getOwnPropertyDescriptor(r,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",s)),t.dispatchEvent(new Event("change",{bubbles:!0}))},Ze=new WeakSet,xo=(t,e)=>(e?.type==="pointerdown"&&(Ze.add(t),Qe(document,"pointerup",()=>Ze.delete(t),wo)),Ze.has(t)),oa=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,ia=t=>{const e=E(t,"form");E(t,"form","#"),setTimeout(sa,0,t,e)},sa=(t,e)=>E(t,"form",e),Tt=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},G,ra=0,Eo=0,re=t=>{clearTimeout(Eo),G||(G=Ut("div",{"aria-live":"assertive"}),G.style.overflow="hidden",G.style.position="fixed",G.style.whiteSpace="nowrap",G.style.width="1px"),G.isConnected||document.body.append(G),t===""&&(G.textContent=""),t&&(G.textContent=`${t}${ra++%2?" ":""}`,Eo=setTimeout(re,!Vr&&Wr?2e3:300,""))},tn=`${jr}
1
+ var mtds=(function($){"use strict";var ro=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",re=ro(),As=re?navigator.userAgent:"",so=/iPad|iPhone|iPod/.test(As),ao;re&&/^Mac/i.test(((ao=navigator.userAgentData)==null?void 0:ao.platform)||navigator.platform);var Ts=re&&window.CSSStyleSheet&&document.adoptedStyleSheets,ks=typeof HTMLElement>"u"?class{}:HTMLElement,N=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Ls=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(lo("slot")),!n.querySelector("style"))if(!Ts)n.append(lo("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Rs=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Is=t=>{var e;const n=N(t,"aria-label")||"";return[...(((e=N(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,r)=>{var s;return i||((s=r?.innerText)==null?void 0:s.trim())||""},n).trim()},Os=t=>{if(!t||!re)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},lo=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))N(o,i,r);return o},Ms={define:(t,e)=>!ro()||window.customElements.get(t)||window.customElements.define(t,e)},se="value",We="max",Ds=`:host(:not([hidden])) { box-sizing: border-box; border: 1px solid; display: inline-block; height: .5em; width: 10em; overflow: hidden }
2
+ :host::before { content: ''; display: block; height: 100%; background: currentColor; width: var(--percentage, 0%); transition: width .2s }
3
+ :host(:not([value])) { background: linear-gradient(90deg,currentColor 25%, transparent 50%, currentColor 75%) 50%/400% }
4
+ @media (prefers-reduced-motion: no-preference) { :host { animation: indeterminate 2s linear infinite } }
5
+ @keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,co=class extends ks{constructor(){var t;super(),this._skipAttrChange=!1,Ls(this,Ds),this._internals=(t=this.attachInternals)==null?void 0:t.call(this)}static get observedAttributes(){return["aria-label","aria-labelledby",se,We]}connectedCallback(){N(this,"aria-valuemin","0"),N(this,"aria-valuemax","100"),N(this,"role",so?"img":"progressbar"),this.attributeChangedCallback()}attributeChangedCallback(){if(this._skipAttrChange||!this.hasAttribute("role"))return;this._skipAttrChange=!0;const t=this.position,e=Math.max(0,Math.round(t*100));this.style.setProperty("--percentage",`${e}%`);let n=Is(this);so&&(n=`${n.replace(/\(\d+%\)$/,"")} (${e}%)`.trim()),N(this,"aria-busy",`${t===-1}`),N(this,"aria-label",n),N(this,"aria-labelledby",null),N(this,"aria-valuenow",t===-1?null:`${e}`),this._skipAttrChange=!1}get labels(){var t;const e=(t=this._internals)==null?void 0:t.labels;if(e)return e;const n=Os(this),o=this.closest("label:not([for])");return o&&N(o,"for",n),Rs(this).querySelectorAll(`label[for="${n}"]`)}get position(){return this.hasAttribute(se)?Math.min(this.value/this.max,1):-1}get value(){return Math.min(uo(this,se),this.max)}set value(t){fo(this,se,t)}get max(){return uo(this,We,1)}set max(t){fo(this,We,t,1)}};co.formAssociated=!0;var uo=(t,e,n=0)=>{const o=N(t,e),i=Number(o);return o===null?n:Number.isFinite(i)&&Math.max(n,i)||n},fo=(t,e,n,o=0)=>{const i=Number(n);if(Number.isFinite(i))return N(t,e,`${Math.max(o,i)||o}`);throw new Error(`Failed to set the '${e}' property on 'UHTMLProgressElement': The provided double value is non-finite.`)};Ms.define("u-progress",co);function Ps(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function Ns(){document.addEventListener("invoke",f=>{f.type=="invoke"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0),document.addEventListener("command",f=>{f.type=="command"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0);function t(f,p,b=!0){Object.defineProperty(f,p,{...Object.getOwnPropertyDescriptor(f,p),enumerable:b})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}let n=new WeakMap,o=new WeakMap;class i extends Event{constructor(p,b={}){super(p,b);let{source:y,command:_}=b;if(y!=null&&!(y instanceof Element))throw TypeError("source must be an element");n.set(this,y||null),o.set(this,_===void 0?"":String(_))}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw TypeError("illegal invocation");let p=n.get(this);if(!(p instanceof Element))return null;let b=e(p);return b===e(this.target||document)?p:b.host}get command(){if(!o.has(this))throw TypeError("illegal invocation");return o.get(this)}}t(i.prototype,"source"),t(i.prototype,"command");let r=new WeakMap;function s(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(p){if(p===null)this.removeAttribute("commandfor"),r.delete(this);else if(p instanceof Element){this.setAttribute("commandfor","");let b=e(p);e(this)===b||b===this.ownerDocument?r.set(this,p):r.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 p=r.get(this);if(p)return p.isConnected?p:(r.delete(this),null);let b=e(this),y=this.getAttribute("commandfor");return(b instanceof Document||b instanceof ShadowRoot)&&y&&b.getElementById(y)||null}},command:{enumerable:!0,configurable:!0,get(){let p=this.getAttribute("command")||"";if(p.startsWith("--"))return p;let b=p.toLowerCase();switch(b){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return b}return""},set(p){this.setAttribute("command",p)}}})}let a=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return c.takeRecords(),a.get(this)||null},set(f){let p=a.get(this)||null;p&&this.removeEventListener("command",p),a.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function l(f){for(let p of f)p.oncommand=Function("event",p.getAttribute("oncommand"))}let c=new MutationObserver(f=>{for(let p of f){let{target:b}=p;p.type==="childList"?l(b.querySelectorAll("[oncommand]")):l([b])}});c.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]"));let u=new WeakSet;function d(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;let p=f.composedPath().find(w=>w.matches?.("button[commandfor], button[command]"));if(!p)return;if(p.form&&p.getAttribute("type")!=="button")throw f.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(p.hasAttribute("command")!==p.hasAttribute("commandfor")){let w=p.hasAttribute("command")?"command":"commandfor",x=p.hasAttribute("command")?"commandfor":"command";throw Error(`Element with ${w} attribute must also have a ${x} attribute to function.`)}if(p.command!=="show-popover"&&p.command!=="hide-popover"&&p.command!=="toggle-popover"&&p.command!=="show-modal"&&p.command!=="request-close"&&p.command!=="close"&&!p.command.startsWith("--")){console.warn(`"${p.command}" is not a valid command value. Custom commands must begin with --`);return}let b=p.commandForElement;if(!b)return;let y=new i("command",{command:p.command,source:p,cancelable:!0});if(b.dispatchEvent(y),y.defaultPrevented)return;let _=y.command.toLowerCase();if(b.popover){let w=!b.matches(":popover-open");w&&(_==="toggle-popover"||_==="show-popover")?b.showPopover({source:p}):!w&&_==="hide-popover"&&b.hidePopover()}else if(b.localName==="dialog"){let w=!b.hasAttribute("open");w&&_=="show-modal"?b.showModal():!w&&_=="close"?b.close(p.value?p.value:void 0):!w&&_=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let x=new Event("cancel",{cancelable:!0});this.dispatchEvent(x),x.defaultPrevented||this.close()}),b.requestClose(p.value?p.value:void 0))}}function m(f){f.addEventListener("click",d,!0)}function h(f,p){let b=f.prototype.attachShadow;f.prototype.attachShadow=function(_){let w=b.call(this,_);return p(w),w};let y=f.prototype.attachInternals;f.prototype.attachInternals=function(){let _=y.call(this);return _.shadowRoot&&p(_.shadowRoot),_}}s(HTMLButtonElement),h(HTMLElement,f=>{m(f),c.observe(f,{attributeFilter:["oncommand"]}),l(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i})}const z={passive:!0,capture:!0},G=()=>typeof window<"u"&&typeof document<"u",qs=()=>G()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),ae=typeof HTMLElement>"u"?class{}:HTMLElement;function mo(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const mt=(t,...e)=>!G()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${t}`,...e),v=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Ge=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),Hs=/^["']|["']$/g,Ct=(t,e)=>{let n=v(t,e);return n||=Ge(t,`--_ds-${e}`).replace(Hs,"").trim(),n||mt(`Missing ${e} on:`,t),n||null},I=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>je(t,...e)},je=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},tt=(t,e)=>{G()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(n=>n()),window._dsHotReloadCleanup?.set(t,e()))},et=(t,e,n)=>{let o=()=>i.disconnect(),i=new MutationObserver(r=>{if(!G()||!t.isConnected)return o();e(t,r)});return e(t),i.observe(t,n),o},po=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))v(n,o,i);return n},nt={define:(t,e)=>!G()||window.customElements.get(t)||window.customElements.define(t,e)};let Bs=0;function ot(t){return G()?(window.dsUseId||(window.dsUseId=0),t&&!t.id&&(t.id=`:ds:${++window.dsUseId}`),t?.id||""):`:ds:${++Bs}`}let j,zs=0,ho=0;const Xe=t=>{clearTimeout(ho),j&&(j.textContent=`${t}${zs++%2?" ":""}`),t&&(ho=setTimeout(Xe,2e3,""))},Fs=()=>{document.readyState==="complete"&&(j||(j=po("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))};tt("announce",()=>[I(document,"focus mouseover",Fs,z)]);const go=":click-delegate-hover",bo="data-clickdelegatefor",Us=`[${bo}]`,Vs=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.button<2&&vo(t);if(!(!n||n.contains(t.target))){if(e&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);t.stopImmediatePropagation(),n.click()}};let le;const Ws=t=>{let e=vo(t);le!==e&&(le&&le.classList.remove(go),e&&e.classList.add(go),le=e)},vo=({target:t})=>{let e=(t instanceof Element?t.closest(Us):null)?.getAttribute(bo),n=e&&document.getElementById(e)||void 0,o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&!n?.disabled?n:void 0};tt("clickdelegatefor",()=>[I(window,"click auxclick",Vs,!0),I(document,"mouseover",Ws,z)]);let Ke=!1;const Gs=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();Ke=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!Ke&&v(e,"closedby")==="any";Ke=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}},js=G()?document.getElementsByTagName("button"):[],Xs=()=>{for(let t of js)t.getAttribute("command")?.endsWith("-modal")&&t.setAttribute("aria-haspopup","dialog")},Ks=({command:t,target:e})=>t==="--show-non-modal"&&e instanceof HTMLDialogElement&&e.show();tt("dialog",()=>[I(document,"command",Ks,z),I(document,"pointerdown pointerup",Gs,z),et(document,Xs,{attributeFilter:["command"],attributes:!0,childList:!0,subtree:!0})]);const Ys=G()?document.getElementsByTagName("fieldset"):[],Qs=()=>{for(let t of Ys)t.hasAttribute("aria-labelledby")||v(t,"aria-labelledby",`${ot(t.querySelector("legend"))} ${ot(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim()||null)};tt("fieldset",()=>[et(document,Qs,{childList:!0,subtree:!0})]);const At=Math.min,q=Math.max,ce=Math.round,de=Math.floor,X=t=>({x:t,y:t}),Js={left:"right",right:"left",bottom:"top",top:"bottom"};function yo(t,e,n){return q(t,At(e,n))}function pt(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function Bt(t){return t.split("-")[1]}function Ye(t){return t==="x"?"y":"x"}function wo(t){return t==="y"?"height":"width"}function K(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function _o(t){return Ye(K(t))}function Zs(t,e,n){n===void 0&&(n=!1);const o=Bt(t),i=_o(t),r=wo(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ue(s)),[s,ue(s)]}function ta(t){const e=ue(t);return[Qe(t),e,Qe(e)]}function Qe(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const xo=["left","right"],So=["right","left"],ea=["top","bottom"],na=["bottom","top"];function oa(t,e,n){switch(t){case"top":case"bottom":return n?e?So:xo:e?xo:So;case"left":case"right":return e?ea:na;default:return[]}}function ia(t,e,n,o){const i=Bt(t);let r=oa(it(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(Qe)))),r}function ue(t){const e=it(t);return Js[e]+t.slice(e.length)}function ra(t){return{top:0,right:0,bottom:0,left:0,...t}}function sa(t){return typeof t!="number"?ra(t):{top:t,right:t,bottom:t,left:t}}function fe(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Eo(t,e,n){let{reference:o,floating:i}=t;const r=K(e),s=_o(e),a=wo(s),l=it(e),c=r==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Bt(e)){case"start":h[s]-=m*(n&&c?-1:1);break;case"end":h[s]+=m*(n&&c?-1:1);break}return h}async function aa(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=pt(e,t),f=sa(h),b=a[m?d==="floating"?"reference":"floating":d],y=fe(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),x=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},A=fe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:w,strategy:l}):_);return{top:(y.top-A.top+f.top)/x.y,bottom:(A.bottom-y.bottom+f.bottom)/x.y,left:(y.left-A.left+f.left)/x.x,right:(A.right-y.right+f.right)/x.x}}const la=50,ca=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:aa},l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Eo(c,o,l),m=o,h=0;const f={};for(let p=0;p<r.length;p++){const b=r[p];if(!b)continue;const{name:y,fn:_}=b,{x:w,y:x,data:A,reset:k}=await _({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});u=w??u,d=x??d,f[y]={...f[y],...A},k&&h<la&&(h++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:u,y:d}=Eo(c,m,l)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:f}},da=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...b}=pt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=it(i),_=K(a),w=it(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=m||(w||!p?[ue(a)]:ta(a)),k=f!=="none";!m&&k&&A.push(...ia(a,p,f,x));const Z=[a,...A],xt=await l.detectOverflow(e,b),St=[];let lt=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&St.push(xt[y]),d){const Et=Zs(i,s,x);St.push(xt[Et[0]],xt[Et[1]])}if(lt=[...lt,{placement:i,overflows:St}],!St.every(Et=>Et<=0)){var ee,ne;const Et=(((ee=r.flip)==null?void 0:ee.index)||0)+1,io=Z[Et];if(io&&(!(d==="alignment"?_!==K(io):!1)||lt.every(W=>K(W.placement)===_?W.overflows[0]>0:!0)))return{data:{index:Et,overflows:lt},reset:{placement:io}};let ie=(ne=lt.filter($t=>$t.overflows[0]<=0).sort(($t,W)=>$t.overflows[1]-W.overflows[1])[0])==null?void 0:ne.placement;if(!ie)switch(h){case"bestFit":{var oe;const $t=(oe=lt.filter(W=>{if(k){const ft=K(W.placement);return ft===_||ft==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ft=>ft>0).reduce((ft,xu)=>ft+xu,0)]).sort((W,ft)=>W[1]-ft[1])[0])==null?void 0:oe[0];$t&&(ie=$t);break}case"initialPlacement":ie=a;break}if(i!==ie)return{reset:{placement:ie}}}return{}}}},$o=new Set(["left","top"]);async function ua(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=it(n),a=Bt(n),l=K(n)==="y",c=$o.has(s)?-1:1,u=r&&l?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:h,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*u,y:m*c}:{x:m*c,y:h*u}}const fa=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await ua(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},ma=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:_,y:w}=y;return{x:_,y:w}}},...c}=pt(t,e),u={x:n,y:o},d=await r.detectOverflow(e,c),m=K(it(i)),h=Ye(m);let f=u[h],p=u[m];if(s){const y=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=f+d[y],x=f-d[_];f=yo(w,f,x)}if(a){const y=m==="y"?"top":"left",_=m==="y"?"bottom":"right",w=p+d[y],x=p-d[_];p=yo(w,p,x)}const b=l.fn({...e,[h]:f,[m]:p});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[h]:s,[m]:a}}}}}},pa=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=pt(t,e),u={x:n,y:o},d=K(i),m=Ye(d);let h=u[m],f=u[d];const p=pt(a,e),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",x=r.reference[m]-r.floating[w]+b.mainAxis,A=r.reference[m]+r.reference[w]-b.mainAxis;h<x?h=x:h>A&&(h=A)}if(c){var y,_;const w=m==="y"?"width":"height",x=$o.has(it(i)),A=r.reference[d]-r.floating[w]+(x&&((y=s.offset)==null?void 0:y[d])||0)+(x?0:b.crossAxis),k=r.reference[d]+r.reference[w]+(x?0:((_=s.offset)==null?void 0:_[d])||0)-(x?b.crossAxis:0);f<A?f=A:f>k&&(f=k)}return{[m]:h,[d]:f}}}},ha=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:a}=e,{apply:l=()=>{},...c}=pt(t,e),u=await s.detectOverflow(e,c),d=it(i),m=Bt(i),h=K(i)==="y",{width:f,height:p}=r.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const _=p-u.top-u.bottom,w=f-u.left-u.right,x=At(p-u[b],_),A=At(f-u[y],w),k=!e.middlewareData.shift;let Z=x,xt=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(xt=w),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(Z=_),k&&!m){const lt=q(u.left,0),ee=q(u.right,0),ne=q(u.top,0),oe=q(u.bottom,0);h?xt=f-2*(lt!==0||ee!==0?lt+ee:q(u.left,u.right)):Z=p-2*(ne!==0||oe!==0?ne+oe:q(u.top,u.bottom))}await l({...e,availableWidth:xt,availableHeight:Z});const St=await s.getDimensions(a.floating);return f!==St.width||p!==St.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<"u"}function Tt(t){return Co(t)?(t.nodeName||"").toLowerCase():"#document"}function H(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(Co(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Co(t){return me()?t instanceof Node||t instanceof H(t).Node:!1}function F(t){return me()?t instanceof Element||t instanceof H(t).Element:!1}function rt(t){return me()?t instanceof HTMLElement||t instanceof H(t).HTMLElement:!1}function Ao(t){return!me()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof H(t).ShadowRoot}function zt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function ga(t){return/^(table|td|th)$/.test(Tt(t))}function pe(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const ba=/transform|translate|scale|rotate|perspective|filter/,va=/paint|layout|strict|content/,ht=t=>!!t&&t!=="none";let Je;function Ze(t){const e=F(t)?U(t):t;return ht(e.transform)||ht(e.translate)||ht(e.scale)||ht(e.rotate)||ht(e.perspective)||!tn()&&(ht(e.backdropFilter)||ht(e.filter))||ba.test(e.willChange||"")||va.test(e.contain||"")}function ya(t){let e=ct(t);for(;rt(e)&&!kt(e);){if(Ze(e))return e;if(pe(e))return null;e=ct(e)}return null}function tn(){return Je==null&&(Je=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Je}function kt(t){return/^(html|body|#document)$/.test(Tt(t))}function U(t){return H(t).getComputedStyle(t)}function he(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ct(t){if(Tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ao(t)&&t.host||Y(t);return Ao(e)?e.host:e}function To(t){const e=ct(t);return kt(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&zt(e)?e:To(e)}function Ft(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=To(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=H(i);if(r){const a=en(s);return e.concat(s,s.visualViewport||[],zt(i)?i:[],a&&n?Ft(a):[])}else return e.concat(i,Ft(i,[],n))}function en(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ko(t){const e=U(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=rt(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=ce(n)!==r||ce(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function nn(t){return F(t)?t:t.contextElement}function Lt(t){const e=nn(t);if(!rt(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ko(e);let s=(r?ce(n.width):n.width)/o,a=(r?ce(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const wa=X(0);function Lo(t){const e=H(t);return!tn()||!e.visualViewport?wa:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _a(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==H(t)?!1:e}function gt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=nn(t);let s=X(1);e&&(o?F(o)&&(s=Lt(o)):s=Lt(t));const a=_a(r,n,o)?Lo(r):X(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=H(r),h=o&&F(o)?H(o):o;let f=m,p=en(f);for(;p&&o&&h!==f;){const b=Lt(p),y=p.getBoundingClientRect(),_=U(p),w=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*b.x,x=y.top+(p.clientTop+parseFloat(_.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=x,f=H(p),p=en(f)}}return fe({width:u,height:d,x:l,y:c})}function ge(t,e){const n=he(t).scrollLeft;return e?e.left+n:gt(Y(t)).left+n}function Ro(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ge(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function xa(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),a=e?pe(e.floating):!1;if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=X(1);const u=X(0),d=rt(o);if((d||!d&&!r)&&((Tt(o)!=="body"||zt(s))&&(l=he(o)),d)){const h=gt(o);c=Lt(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const m=s&&!d&&!r?Ro(s,l):X(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Sa(t){return Array.from(t.getClientRects())}function Ea(t){const e=Y(t),n=he(t),o=t.ownerDocument.body,i=q(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=q(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ge(t);const a=-n.scrollTop;return U(o).direction==="rtl"&&(s+=q(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}const Io=25;function $a(t,e){const n=H(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const u=tn();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=ge(o);if(c<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-h);f<=Io&&(r-=f)}else c<=Io&&(r+=c);return{width:r,height:s,x:a,y:l}}function Ca(t,e){const n=gt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=rt(t)?Lt(t):X(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:s,height:a,x:l,y:c}}function Oo(t,e,n){let o;if(e==="viewport")o=$a(t,n);else if(e==="document")o=Ea(Y(t));else if(F(e))o=Ca(e,n);else{const i=Lo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fe(o)}function Mo(t,e){const n=ct(t);return n===e||!F(n)||kt(n)?!1:U(n).position==="fixed"||Mo(n,e)}function Aa(t,e){const n=e.get(t);if(n)return n;let o=Ft(t,[],!1).filter(a=>F(a)&&Tt(a)!=="body"),i=null;const r=U(t).position==="fixed";let s=r?ct(t):t;for(;F(s)&&!kt(s);){const a=U(s),l=Ze(s);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||zt(s)&&!l&&Mo(t,s))?o=o.filter(u=>u!==s):i=a,s=ct(s)}return e.set(t,o),o}function Ta(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pe(e)?[]:Aa(e,this._c):[].concat(n),o],a=Oo(e,s[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let m=1;m<s.length;m++){const h=Oo(e,s[m],i);l=q(h.top,l),c=At(h.right,c),u=At(h.bottom,u),d=q(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function ka(t){const{width:e,height:n}=ko(t);return{width:e,height:n}}function La(t,e,n){const o=rt(e),i=Y(e),r=n==="fixed",s=gt(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=X(0);function c(){l.x=ge(i)}if(o||!o&&!r)if((Tt(e)!=="body"||zt(i))&&(a=he(e)),o){const h=gt(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();r&&!o&&i&&c();const u=i&&!o&&!r?Ro(i,a):X(0),d=s.left+a.scrollLeft-l.x-u.x,m=s.top+a.scrollTop-l.y-u.y;return{x:d,y:m,width:s.width,height:s.height}}function on(t){return U(t).position==="static"}function Do(t,e){if(!rt(t)||U(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Po(t,e){const n=H(t);if(pe(t))return n;if(!rt(t)){let i=ct(t);for(;i&&!kt(i);){if(F(i)&&!on(i))return i;i=ct(i)}return n}let o=Do(t,e);for(;o&&ga(o)&&on(o);)o=Do(o,e);return o&&kt(o)&&on(o)&&!Ze(o)?n:o||ya(t)||n}const Ra=async function(t){const e=this.getOffsetParent||Po,n=this.getDimensions,o=await n(t.floating);return{reference:La(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ia(t){return U(t).direction==="rtl"}const Oa={convertOffsetParentRelativeRectToViewportRelativeRect:xa,getDocumentElement:Y,getClippingRect:Ta,getOffsetParent:Po,getElementRects:Ra,getClientRects:Sa,getDimensions:ka,getScale:Lt,isElement:F,isRTL:Ia};function No(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ma(t,e){let n=null,o;const i=Y(t);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:u,top:d,width:m,height:h}=c;if(a||e(),!m||!h)return;const f=de(d),p=de(i.clientWidth-(u+m)),b=de(i.clientHeight-(d+h)),y=de(u),w={rootMargin:-f+"px "+-p+"px "+-b+"px "+-y+"px",threshold:q(0,At(1,l))||1};let x=!0;function A(k){const Z=k[0].intersectionRatio;if(Z!==l){if(!x)return s();Z?s(!1,Z):o=setTimeout(()=>{s(!1,1e-7)},1e3)}Z===1&&!No(c,t.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return s(!0),r}function Da(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=nn(t),u=i||r?[...c?Ft(c):[],...e?Ft(e):[]]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=c&&a?Ma(c,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let f,p=l?gt(t):null;l&&b();function b(){const y=gt(t);p&&!No(p,y)&&n(),p=y,f=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(_=>{i&&_.removeEventListener("scroll",n),r&&_.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Pa=fa,Na=ma,qa=da,Ha=ha,Ba=pa,za=(t,e,n)=>{const o=new Map,i={platform:Oa,...n},r={...i.platform,_c:o};return ca(t,e,{...i,platform:r})},qo="data-placement",Ho="data-autoplacement",Ut=new Map;function Fa(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,r=o instanceof HTMLElement&&v(o,"popover")!==null&&Ge(o,"--_ds-floating");if(!r)return;if(e==="closed")return Ut.get(o)?.();if(!i){let f=o.getRootNode(),p=`[popovertarget="${o.id}"],[commandfor="${o.id}"]`;i=o.id&&f?.querySelector?.(p)||void 0}if(!i||i===o||n&&n===e)return;let s=Ge(o,"--_ds-floating-overscroll"),a=v(o,qo)||v(i,qo)||r,l=v(o,Ho)||v(i,Ho),c=parseFloat(getComputedStyle(o,"::before").height)||0,u=a.match(/left|right/gi)?"Height":"Width",d=i[`offset${u}`]/2+c;if(a==="none")return;let m={strategy:"absolute",placement:a,middleware:[Pa(c||0),Na({padding:10,limiter:Ba({offset:{mainAxis:d}})}),Va(),...l==="false"?[]:[qa({padding:10,crossAxis:!1})],...s?[Ha({apply({availableHeight:f}){s==="fit"&&(o.style.width=`${i.offsetWidth}px`),o.style.maxHeight=`${Math.max(50,f-20)}px`}})]:[]]},h=Da(i,o,async()=>{if(!i?.isConnected)return Ut.get(o)?.();let{x:f,y:p}=await za(i,o,m);o.style.translate=`${f}px ${p}px`});Ut.set(o,()=>Ut.delete(o)&&h())}let be;const Ua=({type:t})=>{if(t==="mousedown"&&(be=!1),t==="scroll"&&be===!1&&(be=!0),t==="mouseup"&&be)for(let[e]of Ut)e.showPopover()};tt("popover",()=>[I(document,"mousedown scroll mouseup",Ua,!0),I(document,"toggle ds-toggle-source",Fa,z)]);const Va=()=>({name:"arrowPseudo",fn(t){let e=t.elements.floating,n=t.rects.reference,o=`${Math.round(n.width/2+n.x-t.x)}px`,i=`${Math.round(n.height/2+n.y-t.y)}px`;return e.style.setProperty("--_ds-floating-arrow-x",o),e.style.setProperty("--_ds-floating-arrow-y",i),v(e,"data-floating",t.placement),t}}),rn=t=>(t instanceof HTMLSelectElement||t instanceof HTMLInputElement)&&(t.hasAttribute("readonly")||v(t,"aria-readonly")==="true"),Wa=t=>{if(t.key!=="Tab"&&rn(t.target)){let e=t.key?.startsWith("Arrow"),n=t.altKey||t.ctrlKey||t.metaKey;if((e||!n)&&t.preventDefault(),e&&v(t.target,"type")==="radio"){let o=document.querySelectorAll(`input[name="${t.target.name}"]`),i=t.key?.match(/Arrow(Right|Down)/)?1:-1;o[(o.length+[...o].indexOf(t.target)+i)%o.length]?.focus()}}},Ga=t=>{let e=t.target?.closest?.("label")?.control||t.target;rn(e)&&(t.preventDefault(),e.focus())},ja=t=>{t.target instanceof HTMLSelectElement&&rn(t.target)&&t.preventDefault()};tt("readonly",()=>[I(document,"keydown",Wa),I(document,"click",Ga),I(document,"mousedown",ja)]);const Bo="aria-label",ve="data-toggle-group",zo=`[${ve}]`,Xa=()=>{for(let t of document.querySelectorAll(zo))v(t,"aria-label",Ct(t,ve))},Ka=t=>{let{key:e,target:n}=t,o=n instanceof HTMLInputElement&&n.closest(zo);if(o&&(!v(o,Bo)&&!v(o,"aria-labelledby")&&v(o,Bo,Ct(o,ve)),e==="Enter"&&n.click(),e?.startsWith("Arrow"))){t.preventDefault?.();let i=[...o.getElementsByTagName("input")],r=i.indexOf(n),s=e.match(/Arrow(Right|Down)/)?1:-1,a=r;for(let l=0;l<i.length;l++)if(a=(i.length+a+s)%i.length,!i[a]?.disabled){i[a]?.focus();break}}};tt("toggle-group",()=>[I(document,"keydown",Ka),et(document,Xa,{attributeFilter:[ve],attributes:!0,childList:!0,subtree:!0})]);let T,Vt,ye=!1,sn=0,an=0;const Ya=G()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Rt="data-tooltip",ln="data-color",Fo="aria-label",Uo="aria-description",Qa=`[${ln}]`,Ja=`[${Rt}]`,cn="data-color-scheme",Za=`[${cn}]`,Vo=t=>{t&&!(t instanceof HTMLElement)&&mt("setTooltipElement expects an HTMLElement, got: ",t),clearTimeout(an),clearTimeout(sn),Vt=void 0,ye=!1,T=t||void 0},tl=()=>{for(let t of document.querySelectorAll(Ja)){let e=Ct(t,Rt);if(!e)return;if(e!==(t.getAttribute(Fo)||t.getAttribute(Uo))){let i=v(t,"role")!=="img"&&t.textContent?.trim();v(t,Rt,e),v(t,Fo,i?null:e),v(t,Uo,i?e:null),t.matches("a,button,input,label,select,textarea,[tabindex]")||mt('Missing tabindex="0" attribute on: ',t)}let n=t===Vt&&T?.offsetHeight&&T?.offsetWidth,o=n&&e&&T?.textContent!==e;n&&o&&(T&&(T.textContent=e),document.activeElement===t&&Xe(e))}},Wo=({type:t,target:e})=>{if(clearTimeout(sn),e===T)return;if(t==="mouseover"&&!ye&&!Ya){sn=setTimeout(Wo,300,{target:e});return}let n=e?.closest?.(`[${Rt}]`);if(n===Vt)return;if(!n)return Go();T||=po("div",{class:"ds-tooltip"}),T.isConnected||document.body.appendChild(T);let o=n.closest(Qa),i=n.closest(Za),r=o!==i&&o?.contains(i);clearTimeout(an),v(T,"popover","manual"),v(T,cn,i?.getAttribute(cn)||null),v(T,ln,r&&o?.getAttribute(ln)||null),T.textContent=v(n,Rt),T.showPopover(),T.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),ye=!0,Vt=n},Go=()=>T?.isConnected&&T.popover&&T.hidePopover(),jo=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&Go();t?t.target===T&&t.newState==="closed"&&(Vt=void 0,an=setTimeout(jo,300)):ye=!1};tt("tooltip",()=>[I(document,"blur focus mouseover",Wo,z),I(document,"toggle keydown",jo,z),et(document,tl,{attributeFilter:[Rt],attributes:!0,childList:!0,subtree:!0})]);const dn="aria-label";var Xo=class extends ae{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[dn]}connectedCallback(){let e=mo(()=>un(this),100);this._label=Ct(this,dn),this._items=this.getElementsByTagName("a"),this._unresize=I(window,"resize",e),this._unmutate=et(this,un,{childList:!0,subtree:!0})}attributeChangedCallback(e,n,o){!this._unmutate||!o||(this._label=o,un(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};const un=t=>{let e=t._items?.[t._items.length-1],n=e?.parentElement===t?null:e,o=!n?.offsetHeight;v(t,"role",o?null:"navigation"),v(t,dn,o?null:t._label);for(let i of t._items||[])v(i,"aria-current",i===n?"page":null)};nt.define("ds-breadcrumbs",Xo);var Ko=class extends ae{_unmutate;connectedCallback(){I(this,"animationend",this,z),v(this,"role","group"),v(this,"tabindex","-1"),this._unmutate=et(this,el,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){je(this,"animationend",this,z),this._unmutate?.(),this._unmutate=void 0}};const el=t=>{let e=v(t,"aria-label")?.trim(),n=v(t,"aria-labelledby")?.trim(),o=t.querySelector("h2,h3,h4,h5,h6");o&&!e&&!n&&v(t,"aria-labelledby",ot(o)),!o&&!e&&!n&&mt("Missing accessible name on:",t,`
6
+ Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an accessible name for screen readers.`)};nt.define("ds-error-summary",Ko);const fn="aria-invalid",Yo="aria-describedby",Qo="data-indeterminate",nl=qs()?800:200,Jo=new WeakMap,Wt=new Map,mn=new WeakSet,ol=(t,e=[])=>{for(let{target:n}of e){let o=n instanceof HTMLFieldSetElement;for(let[i]of Wt)(o?n.contains(i):i.contains(n))&&Zo(i)}},Zo=t=>{let e=[],n=[],o=Wt.get(t)||[],i,r,s=!1,a=!1;for(let m of t.getElementsByTagName("*"))if(m instanceof HTMLLabelElement&&e.push(m),!m.hidden)if(sl(m))i?mt("Fields should only have one input element. Use <fieldset> to group multiple fields:",t):i=m;else{let h=m.getAttribute("data-field");h==="counter"&&(r=m),h==="validation"?(n.unshift(ot(m)),s=!0,a||=ei(m)):h&&n.push(ot(m))}if(!i)return;r&&Jo.set(i,r);for(let m of e)v(m,"for",ot(i));let l=t.closest("fieldset")?.querySelector(':scope > [data-field="validation"]');l&&!l?.hidden&&(s=!0,a||=ei(l),n.unshift(ot(l)));let c=v(i,Qo);c&&(i.indeterminate=c==="true"),(i.type==="radio"||i.type==="checkbox")&&v(t,"data-clickdelegatefor",ot(i));let u=v(i,Yo)?.trim().split(/\s+/)?.filter(m=>!o.includes(m))||[];v(i,Yo,[...n,...u].join(" ")||null),Wt.set(t,n);let d=mn.has(i);s&&!d&&!i.hasAttribute(fn)?(v(i,fn,"true"),mn.add(i)):!s&&d&&(v(i,fn,null),mn.delete(i)),ti(i)},il={over:"%d tegn for mye",under:"%d tegn igjen"},ti=t=>{let e=t.target||t,n=Jo.get(e);if(n?.isConnected){let o=(Number(v(n,"data-limit"))||0)-e.value.length,i=o<0?"over":"under",r=(Ct(n,`data-${i}`)||il[i])?.replace("%d",`${Math.abs(o)}`);v(n,"data-label",r),v(n,"data-state",i),v(n,"data-color",o<0?"danger":null),t.type==="input"&&r&&rl(e,r)}e instanceof HTMLTextAreaElement&&(e.style.setProperty("--_ds-field-sizing","auto"),e.style.setProperty("--_ds-field-sizing",`${e.scrollHeight}px`))},rl=mo((t,e)=>{document.activeElement===t&&Xe(e)},nl),ei=t=>t.getAttribute("data-color")!=="success",sl=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement)&&t.type!=="hidden";var we=class extends ae{connectedCallback(){Wt.set(this,[]),Zo(this)}disconnectedCallback(){Wt.delete(this)}};nt.define("ds-field",we),tt("field",()=>[I(document,"input",ti,z),et(document,ol,{attributeFilter:["data-field","data-limit","hidden","id","value",Qo],attributes:!0,childList:!0,subtree:!0})]);const pn="aria-label",_e="data-current",xe="data-total",ni="data-href",oi=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:al(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))});var ii=class extends ae{_unmutate;_render;static get observedAttributes(){return[pn,_e,xe,ni]}connectedCallback(){let t=v(this,xe),e=v(this,_e);e&&!t&&mt(`Missing ${xe} attribute on:`,this),t&&!e&&mt(`Missing ${_e} attribute on:`,this),v(this,pn,Ct(this,pn)),v(this,"role","navigation"),this._unmutate=et(this,ri,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&ri(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};const ri=t=>{let e=Number(v(t,_e)),n=Number(v(t,xe));if(e&&n){let o=t.querySelectorAll("button,a"),i=o.length-2,r=v(t,ni),{next:s,prev:a,pages:l}=oi({current:e,total:n,show:i});o.forEach((c,u)=>{let d=u?o[u+1]?l[u-1]?.page:s:a;v(c,"aria-current",l[u-1]?.current?"true":null),v(c,"aria-label",`${d??"hidden"}`),v(c,"role",d?null:"none"),v(c,"tabindex",d?null:"-1"),c instanceof HTMLButtonElement&&v(c,"value",`${d}`),r&&c instanceof HTMLAnchorElement&&v(c,"href",r.replace("%d",`${d}`))})}},al=(t,e,n=1/0)=>{let o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),r=Math.min(Math.max(t+Math.ceil(o),n),e),s=Array.from({length:r+1-i},(a,l)=>l+i);return n>4&&i>1&&s.splice(0,2,1,0),n>3&&r<e&&s.splice(-2,2,0,e),s};nt.define("ds-pagination",ii);var ll=Object.defineProperty,si=Object.getOwnPropertySymbols,cl=Object.prototype.hasOwnProperty,dl=Object.prototype.propertyIsEnumerable,ai=(t,e,n)=>e in t?ll(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ul=(t,e)=>{for(var n in e||(e={}))cl.call(e,n)&&ai(t,n,e[n]);if(si)for(var n of si(e))dl.call(e,n)&&ai(t,n,e[n]);return t},hn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Se=hn(),gn=Se?navigator.userAgent:"",li=/android/i.test(gn),fl=/firefox/i.test(gn),ci=/iPad|iPhone|iPod/.test(gn),di,ml=Se&&/^Mac/i.test(((di=navigator.userAgentData)==null?void 0:di.platform)||navigator.platform),pl=Se&&window.CSSStyleSheet&&document.adoptedStyleSheets,ui={once:!0,capture:!0,passive:!0},hl=":host(:not([hidden])) { display: block }",gl="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",bl=`${li?"data":"aria"}-multiselectable`,vl=typeof HTMLElement>"u"?class{}:HTMLElement,S=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),bn=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>fi(t,...e)},fi=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},yl=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Gt("slot")),!n.querySelector("style"))if(!pl)n.append(Gt("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},wl=(t,e,n)=>{const o=new MutationObserver(r=>{if(!hn()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},_l=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},vn=t=>_l(t).activeElement,xl=t=>{var e;const n=S(t,"aria-label")||"";return[...(((e=S(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,r)=>{var s;return i||((s=r?.innerText)==null?void 0:s.trim())||""},n).trim()},Sl=t=>{if(!t||!Se)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Gt=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))S(o,i,r);return o},El={define:(t,e)=>!hn()||window.customElements.get(t)||window.customElements.define(t,e)},mi=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},s=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(s,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},yn=new WeakSet,pi=(t,e)=>(e?.type==="pointerdown"&&(yn.add(t),bn(document,"pointerup",()=>yn.delete(t),ui)),yn.has(t)),$l=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Cl=t=>{const e=S(t,"form");S(t,"form","#"),setTimeout(Al,0,t,e)},Al=(t,e)=>S(t,"form",e),It=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},Q,Tl=0,hi=0,Ee=t=>{clearTimeout(hi),Q||(Q=Gt("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),t===""&&(Q.textContent=""),t&&(Q.textContent=`${t}${Tl++%2?" ":""}`,hi=setTimeout(Ee,!ml&&fl?2e3:300,""))},wn=`${hl}
2
7
  :is(:host(:not([data-multiple])), :host([data-multiple="false"])) [part="items"] { display: none }
3
8
  [role="listbox"] { display: contents }
4
9
  ::slotted(button[type="reset"]),::slotted(del) { font: inherit; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-decoration: none }
5
10
  ::slotted(data) { cursor: pointer; pointer-events: none }
6
11
  ::slotted(data)::after { padding-inline: .5ch; pointer-events: auto }
7
12
  ::slotted(data)::after,::slotted(button[type="reset"]:empty)::before,::slotted(del:empty)::before { content: '\\00D7'; content: '\\00D7' / '' }
8
- ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Xr} }`,aa=oa(tn),ct="aria-label",la='button[type="reset"],del',ca='datalist,[role="listbox"]',da='option,[role="option"]',$o="blur focus click input keydown pointerdown",ae="false",le={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"},en=class extends Yr{constructor(){super(),this._focusMoved=!1,this._itemSingleVale="",this._speak="",this._texts=Fr({},le),this._value="";const t=Qr(this,tn);this._listbox=t.querySelector('[role="listbox"]')||Ut("div"),this._listbox.innerHTML='<slot name="items"></slot>',E(this._listbox,"aria-orientation","horizontal"),E(this._listbox,"role","listbox"),E(this._listbox,"part","items"),E(this._listbox,"tabindex","-1"),t.prepend(this._listbox)}static get observedAttributes(){return Object.keys(le).map(t=>`data-sr-${t}`)}connectedCallback(){Qe(this,$o,this,!0),this._umutate=Jr(this,va,{attributeFilter:["id","value","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),ce(this),nn(this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];le[o]&&(this._texts[o]=n||le[o]),o==="clear"&&this.clear&&E(this.clear,ct,this._texts.clear)}disconnectedCallback(){var t;_o(this,$o,this,!0),(t=this._umutate)==null||t.call(this),this._umutate=this._list=this._options=this._match=void 0,this._items=this._clear=this._control=this._select=void 0}handleEvent(t){var e,n;(e=this.control)!=null&&e.disabled||(n=this.control)!=null&&n.readOnly||(t.type==="blur"&&ua(this),t.type==="click"&&ma(this,t),t.type==="focus"&&re(),t.type==="input"&&pa(this,t),t.type==="keydown"&&ha(this,t),t.type==="pointerdown"&&xo(this,t))}get multiple(){var t;return((t=E(this,"data-multiple"))!=null?t:ae)!==ae}set multiple(t){E(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=E(this,"data-creatable"))!=null?t:ae)!==ae}set creatable(t){E(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector(ca),this._options=void 0),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector(la)),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e,n;const o=!this._options&&((e=(t=this.list)==null?void 0:t.querySelector(da))==null?void 0:e.nodeName);return o&&(this._options=(n=this.list)==null?void 0:n.getElementsByTagName(o)),this._options||this.getElementsByTagName("-")}get values(){return Array.from(this.items,({value:t})=>t)}},To=t=>{var e;const{creatable:n,control:o,options:i,multiple:s}=t,r=((e=o?.value)==null?void 0:e.trim())||"",a=r.toLowerCase()||null;let l=[...i].find(u=>u.label.trim().toLowerCase()===a);const c={bubbles:!0,cancelable:!0,detail:l};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",c))||(l=[...i].find(u=>u.selected)),s)Ao(t);else for(const u of i)u.selected=u===l;return!l&&n&&r?{value:r,label:r}:l&&{value:l.value,label:l.label}},Ct=(t,e,n=!0)=>{const{_texts:o,control:i,items:s,multiple:r}=t;if(!e)return r?re(o.invalid):!i?.value&&s[0]?Ct(t,s[0]):ce(t);const a=[...s].findIndex(m=>m.value===e.value),l=s[a],c=l===Je(t)&&(r&&(s[a-1]||s[a+1])||i);if(l&&!n)return ce(t);c&&c.focus(),t._focusMoved=!!c;const u=Ut("data",{value:e.value},e.label||e.value),d={bubbles:!0,cancelable:!0,detail:l||u};if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",d))){if(!r)for(const m of[...s])m.remove();l?l.remove():i?.insertAdjacentElement("beforebegin",u),t.dispatchEvent(new CustomEvent("comboboxafterselect",d))}},ua=t=>xo(t)||setTimeout(fa,0,t),fa=t=>t.multiple||t.contains(Je(t))||Ct(t,t._match,!1),ma=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:s,control:r,items:a}=t;if(r&&s?.contains(i))return e.preventDefault(),So(r,"","deleteContentBackward"),r.focus();for(const l of a){if(l.contains(i))return Ct(t,l);const c=l.getBoundingClientRect(),{top:u,right:d,bottom:m,left:h,width:f,height:p}=c;if(f&&p&&o>=u&&o<=m&&n>=h&&n<=d)return l.focus()}i===t&&r?.focus()},pa=(t,e)=>{var n;const{control:o,options:i,multiple:s}=t,r=o?.value||null,a=e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!o?.value;if(a||(t._value=o?.value||""),a){(n=e.stopImmediatePropagation)==null||n.call(e);const l=[...i].find(c=>c.value===r);if(o&&(o.value=t._value),l)return Ct(t,l,s)}else s||(t._match=To(t));nn(t)},ha=(t,e)=>{e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt"||(t.control===e.target?ga(t,e):ba(t,e))},ga=(t,e)=>{var n;const{_match:o,clear:i,control:s,items:r,multiple:a}=t;(e.key==="ArrowLeft"||e.key==="Backspace")&&!s?.selectionEnd&&((n=r[r.length-1])==null||n.focus()),e.key==="Enter"&&s&&(ia(s),Ct(t,a?To(t):o,a)),e.key==="Tab"&&!e.shiftKey&&i&&!i.hidden&&(e.preventDefault(),E(i,"aria-hidden","false"),E(i,"tabindex","0"),i.focus(),Qe(i,"blur",()=>nn(t),wo))},ba=(t,e)=>{var n,o,i;const{clear:s,control:r,items:a}=t,{key:l,repeat:c,target:u}=e,d=[...a].indexOf(u);if((l===" "||l==="Enter")&&(a[d]||u===s))return(n=a[d]||s)==null||n.click(),e.preventDefault();if(a[d]){if(l==="ArrowLeft")return(o=a[d-1])==null?void 0:o.focus();if(l==="ArrowRight")return(i=a[d+1]||r)==null?void 0:i.focus();if(l==="Backspace")return e.preventDefault(),c||Ct(t,a[d]);r?.focus()}},va=(t,e)=>{var n;if(!t.control)return;const{_texts:o,control:i,items:s,list:r,multiple:a}=t,l=[];for(const{addedNodes:m,removedNodes:h}of e||[]){for(const f of m)f instanceof HTMLDataElement&&l.unshift(f);for(const f of h)f instanceof HTMLDataElement&&l.push(f)}const c=Je(t);if((a?l.length===1:l[0]===c)&&t.contains(c)){const m=i?E(i,ct):null;t._speak=`${o[l[0].isConnected?"added":"removed"]} ${Tt(l[0])}, `,E(i,ct,`${t._speak}${ta(i)}`),t._focusMoved||setTimeout(()=>re(t._speak.slice(0,-2))),setTimeout(ya,300,t,m)}if(!a){const m=Tt(s[0]);m!==t._itemSingleVale&&ce(t),t._itemSingleVale=m}Co(t),Ao(t),wa(t);const d=`${s.length?o.found.replace("%d",`${s.length}`):o.empty}`;E(i,"aria-description",a?d:null),E(i,"list",ea(r)),E(t._listbox,ct,o.items),(n=t._umutate)==null||n.takeRecords()},ya=(t,e)=>{t._speak="",t.control&&E(t.control,ct,e),Co(t)},Co=t=>{const{_texts:e,_speak:n,items:o}=t;let i=0;for(const s of o){const r=`${n}${Tt(s)}, ${e.remove}${vo?`, ${++i} ${e.of} ${o.length}`:""}`;E(s,ct,r),E(s,"role","option"),E(s,"slot","items"),E(s,"tabindex","-1"),E(s,"value",s.value||Tt(s))}},wa=t=>{var e,n;if((e=t._select)!=null&&e.isConnected||(t._select=t.querySelector("select")),!t._select)return;const{_select:o,items:i,multiple:s}=t,r=[];let a=0;E(o,"multiple",s?"":null);for(const l of i){const c=o?.options[a++],u=Tt(l),d=l?.value;c?Object.assign(c,{defaultSelected:!0,selected:!0,text:u,value:d}):r.push(new Option(u,d,!0,!0))}if(r.length)o.append(...r);else for(const l of[...o.options].slice(a))l.remove();(n=t._umutate)==null||n.takeRecords()},nn=t=>{if(!t.clear)return;const{clear:e,control:n}=t,o=!n?.value||n?.disabled||n?.readOnly;e.nodeName==="DEL"&&E(e,"role","button"),E(e,ct)||E(e,ct,t._texts.clear),E(e,"aria-hidden",`${vo||bo}`),E(e,"hidden",o?"":null),E(e,"tabindex","-1")},Ao=t=>{if(!t.list)return;const{_texts:e,list:n,multiple:o,options:i,values:s}=t;E(n,"data-sr-of",e.of),E(n,Kr,`${o}`);for(const r of i)r.selected=s.includes(r.value)},ce=t=>{if(!t.control||t.multiple)return;const{control:e,items:n}=t,o=Tt(n[0]),i=o?"insertText":"deleteContentBackward";o!==e.value&&So(e,o,i)};na.define("u-combobox",en);var on=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",de=on(),_a=de?navigator.userAgent:"",Sa=/android/i.test(_a),ko;de&&/^Mac/i.test(((ko=navigator.userAgentData)==null?void 0:ko.platform)||navigator.platform);var xa=de&&window.CSSStyleSheet&&document.adoptedStyleSheets,sn=":host(:not([hidden])) { display: block }",Ea=`${Sa?"data":"aria"}-labelledby`,ue=typeof HTMLElement>"u"?class{}:HTMLElement,L=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),$a=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Lo(t,...e)},Lo=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},rn=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Mo("slot")),!n.querySelector("style"))if(!xa)n.append(Mo("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Ta=(t,e,n)=>{const o=new MutationObserver(s=>{if(!on()||!t.isConnected)return i();e(t,s)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Ro=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},an=t=>{if(!t||!de)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Mo=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))L(o,i,s);return o},fe={define:(t,e)=>!on()||window.customElements.get(t)||window.customElements.define(t,e)},ln=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,At="aria-controls",Io="aria-disabled",zt="aria-selected",Ft="tabindex",cn=sn,dn=sn,Ca="",un=`${sn}
13
+ ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${gl} }`,kl=$l(wn),dt="aria-label",Ll='button[type="reset"],del',Rl='datalist,[role="listbox"]',Il='option,[role="option"]',gi="blur focus click input keydown pointerdown",$e="false",Ce={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"},_n=class extends vl{constructor(){super(),this._focusMoved=!1,this._itemSingleVale="",this._speak="",this._texts=ul({},Ce),this._value="";const t=yl(this,wn);this._listbox=t.querySelector('[role="listbox"]')||Gt("div"),this._listbox.innerHTML='<slot name="items"></slot>',S(this._listbox,"aria-orientation","horizontal"),S(this._listbox,"role","listbox"),S(this._listbox,"part","items"),S(this._listbox,"tabindex","-1"),t.prepend(this._listbox)}static get observedAttributes(){return Object.keys(Ce).map(t=>`data-sr-${t}`)}connectedCallback(){bn(this,gi,this,!0),this._umutate=wl(this,Bl,{attributeFilter:["id","value","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),Ae(this),xn(this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];Ce[o]&&(this._texts[o]=n||Ce[o]),o==="clear"&&this.clear&&S(this.clear,dt,this._texts.clear)}disconnectedCallback(){var t;fi(this,gi,this,!0),(t=this._umutate)==null||t.call(this),this._umutate=this._list=this._options=this._match=void 0,this._items=this._clear=this._control=this._select=void 0}handleEvent(t){var e,n;(e=this.control)!=null&&e.disabled||(n=this.control)!=null&&n.readOnly||(t.type==="blur"&&Ol(this),t.type==="click"&&Dl(this,t),t.type==="focus"&&Ee(),t.type==="input"&&Pl(this,t),t.type==="keydown"&&Nl(this,t),t.type==="pointerdown"&&pi(this,t))}get multiple(){var t;return((t=S(this,"data-multiple"))!=null?t:$e)!==$e}set multiple(t){S(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=S(this,"data-creatable"))!=null?t:$e)!==$e}set creatable(t){S(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector(Rl),this._options=void 0),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector(Ll)),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e,n;const o=!this._options&&((e=(t=this.list)==null?void 0:t.querySelector(Il))==null?void 0:e.nodeName);return o&&(this._options=(n=this.list)==null?void 0:n.getElementsByTagName(o)),this._options||this.getElementsByTagName("-")}get values(){return Array.from(this.items,({value:t})=>t)}},bi=t=>{var e;const{creatable:n,control:o,options:i,multiple:r}=t,s=((e=o?.value)==null?void 0:e.trim())||"",a=s.toLowerCase()||null;let l=[...i].find(u=>u.label.trim().toLowerCase()===a);const c={bubbles:!0,cancelable:!0,detail:l};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",c))||(l=[...i].find(u=>u.selected)),r)yi(t);else for(const u of i)u.selected=u===l;return!l&&n&&s?{value:s,label:s}:l&&{value:l.value,label:l.label}},Ot=(t,e,n=!0)=>{const{_texts:o,control:i,items:r,multiple:s}=t;if(!e)return s?Ee(o.invalid):!i?.value&&r[0]?Ot(t,r[0]):Ae(t);const a=[...r].findIndex(m=>m.value===e.value),l=r[a],c=l===vn(t)&&(s&&(r[a-1]||r[a+1])||i);if(l&&!n)return Ae(t);c&&c.focus(),t._focusMoved=!!c;const u=Gt("data",{value:e.value},e.label||e.value),d={bubbles:!0,cancelable:!0,detail:l||u};if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",d))){if(!s)for(const m of[...r])m.remove();l?l.remove():i?.insertAdjacentElement("beforebegin",u),t.dispatchEvent(new CustomEvent("comboboxafterselect",d))}},Ol=t=>pi(t)||setTimeout(Ml,0,t),Ml=t=>t.multiple||t.contains(vn(t))||Ot(t,t._match,!1),Dl=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:r,control:s,items:a}=t;if(s&&r?.contains(i))return e.preventDefault(),mi(s,"","deleteContentBackward"),s.focus();for(const l of a){if(l.contains(i))return Ot(t,l);const c=l.getBoundingClientRect(),{top:u,right:d,bottom:m,left:h,width:f,height:p}=c;if(f&&p&&o>=u&&o<=m&&n>=h&&n<=d)return l.focus()}i===t&&s?.focus()},Pl=(t,e)=>{var n;const{control:o,options:i,multiple:r}=t,s=o?.value||null,a=e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!o?.value;if(a||(t._value=o?.value||""),a){(n=e.stopImmediatePropagation)==null||n.call(e);const l=[...i].find(c=>c.value===s);if(o&&(o.value=t._value),l)return Ot(t,l,r)}else r||(t._match=bi(t));xn(t)},Nl=(t,e)=>{e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt"||(t.control===e.target?ql(t,e):Hl(t,e))},ql=(t,e)=>{var n;const{_match:o,clear:i,control:r,items:s,multiple:a}=t;(e.key==="ArrowLeft"||e.key==="Backspace")&&!r?.selectionEnd&&((n=s[s.length-1])==null||n.focus()),e.key==="Enter"&&r&&(Cl(r),Ot(t,a?bi(t):o,a)),e.key==="Tab"&&!e.shiftKey&&i&&!i.hidden&&(e.preventDefault(),S(i,"aria-hidden","false"),S(i,"tabindex","0"),i.focus(),bn(i,"blur",()=>xn(t),ui))},Hl=(t,e)=>{var n,o,i;const{clear:r,control:s,items:a}=t,{key:l,repeat:c,target:u}=e,d=[...a].indexOf(u);if((l===" "||l==="Enter")&&(a[d]||u===r))return(n=a[d]||r)==null||n.click(),e.preventDefault();if(a[d]){if(l==="ArrowLeft")return(o=a[d-1])==null?void 0:o.focus();if(l==="ArrowRight")return(i=a[d+1]||s)==null?void 0:i.focus();if(l==="Backspace")return e.preventDefault(),c||Ot(t,a[d]);s?.focus()}},Bl=(t,e)=>{var n;if(!t.control)return;const{_texts:o,control:i,items:r,list:s,multiple:a}=t,l=[];for(const{addedNodes:m,removedNodes:h}of e||[]){for(const f of m)f instanceof HTMLDataElement&&l.unshift(f);for(const f of h)f instanceof HTMLDataElement&&l.push(f)}const c=vn(t);if((a?l.length===1:l[0]===c)&&t.contains(c)){const m=i?S(i,dt):null;t._speak=`${o[l[0].isConnected?"added":"removed"]} ${It(l[0])}, `,S(i,dt,`${t._speak}${xl(i)}`),t._focusMoved||setTimeout(()=>Ee(t._speak.slice(0,-2))),setTimeout(zl,300,t,m)}if(!a){const m=It(r[0]);m!==t._itemSingleVale&&Ae(t),t._itemSingleVale=m}vi(t),yi(t),Fl(t);const d=`${r.length?o.found.replace("%d",`${r.length}`):o.empty}`;S(i,"aria-description",a?d:null),S(i,"list",Sl(s)),S(t._listbox,dt,o.items),(n=t._umutate)==null||n.takeRecords()},zl=(t,e)=>{t._speak="",t.control&&S(t.control,dt,e),vi(t)},vi=t=>{const{_texts:e,_speak:n,items:o}=t;let i=0;for(const r of o){const s=`${n}${It(r)}, ${e.remove}${ci?`, ${++i} ${e.of} ${o.length}`:""}`;S(r,dt,s),S(r,"role","option"),S(r,"slot","items"),S(r,"tabindex","-1"),S(r,"value",r.value||It(r))}},Fl=t=>{var e,n;if((e=t._select)!=null&&e.isConnected||(t._select=t.querySelector("select")),!t._select)return;const{_select:o,items:i,multiple:r}=t,s=[];let a=0;S(o,"multiple",r?"":null);for(const l of i){const c=o?.options[a++],u=It(l),d=l?.value;c?Object.assign(c,{defaultSelected:!0,selected:!0,text:u,value:d}):s.push(new Option(u,d,!0,!0))}if(s.length)o.append(...s);else for(const l of[...o.options].slice(a))l.remove();(n=t._umutate)==null||n.takeRecords()},xn=t=>{if(!t.clear)return;const{clear:e,control:n}=t,o=!n?.value||n?.disabled||n?.readOnly;e.nodeName==="DEL"&&S(e,"role","button"),S(e,dt)||S(e,dt,t._texts.clear),S(e,"aria-hidden",`${ci||li}`),S(e,"hidden",o?"":null),S(e,"tabindex","-1")},yi=t=>{if(!t.list)return;const{_texts:e,list:n,multiple:o,options:i,values:r}=t;S(n,"data-sr-of",e.of),S(n,bl,`${o}`);for(const s of i)s.selected=r.includes(s.value)},Ae=t=>{if(!t.control||t.multiple)return;const{control:e,items:n}=t,o=It(n[0]),i=o?"insertText":"deleteContentBackward";o!==e.value&&mi(e,o,i)};El.define("u-combobox",_n);var wi=class extends _n{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=et(this,Ul,{childList:!0}),I(this,"toggle",_i,z)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,je(this,"toggle",_i,z)}};const Ul=({control:t,list:e})=>{t&&!t.placeholder&&v(t,"placeholder"," "),t&&v(t,"popovertarget",ot(e)||null),e&&v(e,"popover","manual"),e&&v(e,"data-is-floating","true")},_i=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};nt.define("ds-suggestion",wi);var Sn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Te=Sn(),Vl=Te?navigator.userAgent:"",Wl=/android/i.test(Vl),xi;Te&&/^Mac/i.test(((xi=navigator.userAgentData)==null?void 0:xi.platform)||navigator.platform);var Gl=Te&&window.CSSStyleSheet&&document.adoptedStyleSheets,En=":host(:not([hidden])) { display: block }",jl=`${Wl?"data":"aria"}-labelledby`,ke=typeof HTMLElement>"u"?class{}:HTMLElement,L=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Xl=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Si(t,...e)},Si=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},$n=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append($i("slot")),!n.querySelector("style"))if(!Gl)n.append($i("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Kl=(t,e,n)=>{const o=new MutationObserver(r=>{if(!Sn()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Ei=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Cn=t=>{if(!t||!Te)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},$i=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))L(o,i,r);return o},Le={define:(t,e)=>!Sn()||window.customElements.get(t)||window.customElements.define(t,e)},Mt="aria-controls",Ci="aria-disabled",jt="aria-selected",Xt="tabindex",Yl=En,Ql=En,Jl=`${En}
9
14
  ::slotted([role="tab"]:not([hidden])) { display: inline-block; cursor: pointer }
10
- ::slotted([role="tab"][${Io}="true"]) { cursor: default }`,Aa=ln(cn),ka=ln(un),La="",Ra=ln(dn),me=class extends ue{constructor(){super(),rn(this,cn)}get tabList(){return this.querySelector('[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])')}get selectedIndex(){const t=pt(this.tabList);return t.indexOf(Lt(t))}set selectedIndex(t){ht(this.tabs[t])}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"])')}},pe=class extends ue{constructor(){super(),rn(this,un)}connectedCallback(){L(this,"role","tablist"),$a(this,"click keydown",this),this._umutate=Ta(this,Ma,{attributeFilter:["id","role",At,zt],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;Lo(this,"click keydown",this),(t=this._umutate)==null||t.call(this),this._umutate=void 0}handleEvent(t){var e,n,o,i;const{key:s,type:r,target:a}=t,l=pt(this),c=l.findIndex(m=>m.contains(a)),u=s===" "||s==="Enter";let d=c;if(!(t.defaultPrevented||c===-1)&&(r==="click"&&ht(l[c]),r==="keydown")){if(u){(e=t.preventDefault)==null||e.call(t);const m={bubbles:!0,cancelable:!0,composed:!0};return l[c].dispatchEvent(new MouseEvent("click",m))}if(s==="ArrowDown"||s==="ArrowRight")d=(c+1)%l.length;else if(s==="ArrowUp"||s==="ArrowLeft")d=(c||l.length)-1;else if(s==="End")d=l.length-1;else if(s==="Home")d=0;else if(s==="Tab"&&!kt(l[c])){const m=Lt(l);return m&&L(m,Ft,"-1"),m&&setTimeout(()=>L(m,Ft,"0"))}else return;(n=t.preventDefault)==null||n.call(t),(i=(o=l[d]).focus)==null||i.call(o)}}get tabsElement(){return Rt(this)}get tabs(){return this.querySelectorAll(':scope > [role="tab"]')}get selectedIndex(){const t=pt(this);return t.indexOf(Lt(t))}set selectedIndex(t){ht(this.tabs[t])}},fn=class extends ue{static get observedAttributes(){return["id",zt,At]}connectedCallback(){var t;L(this,"role","tab"),L(this,zt,`${this.selected}`),L(this,Ft,this.selected?"0":"-1"),Lt((t=this.parentElement)==null?void 0:t.children)||ht(this)}attributeChangedCallback(){!pn.has(this.parentElement)&&this.selected&&ht(this)}get tabsElement(){return Rt(this)}get tabList(){const t=this.parentElement;return t instanceof pe?t:null}get selected(){return kt(this)}set selected(t){t&&ht(this)}get index(){return Math.max(pt(this.parentElement).indexOf(this),0)}get panel(){var t;const e=(t=Rt(this))==null?void 0:t.panels,n=pt(this.parentElement).indexOf(this);return hn(this,e?.[n])}},mn=class extends ue{constructor(){super(),rn(this,dn)}connectedCallback(){L(this,"role","tabpanel");const t=new Set(this.tabs),e=Rt(this),n=e?.tabs[Array.prototype.indexOf.call(e?.panels,this)];n&&!n.hasAttribute(At)&&t.add(n);const o=Lt(t)||t.values().next().value;Do(o,()=>Oo(this,o,!!o&&kt(o)))}get tabsElement(){return Rt(this)}get tabs(){return Ro(this).querySelectorAll(`[${At}="${an(this)}"]`)}},Ma=(t,e=[])=>{let n;const o=pt(t);for(const{target:i}of e)i instanceof Element&&L(i,"role")==="tab"&&kt(i)&&(n=i);!n&&!Lt(o)&&(n=o.find(Po)),ht(n)},Oo=(t,e,n=!1)=>{L(t,"aria-hidden",`${!n}`),L(t,"hidden",n?null:""),L(t,Ft,n?"0":null),e&&L(e,At,an(t)),e&&n&&kt(e)&&L(t,Ea,an(e))},pn=new Set,Do=(t,e)=>{var n;const o=t?.parentElement;o&&pn.add(o),e(),o&&pn.delete(o),(n=o?._umutate)==null||n.takeRecords()},Po=t=>L(t,Io)!=="true",kt=t=>L(t,zt)==="true",Lt=(t=[])=>{for(const e of t)if(kt(e))return e},pt=t=>{const e=[];for(const n of t?.children||[])n.getAttribute("role")==="tab"&&e.push(n);return e},hn=(t,e=null)=>{const n=L(t,At);return n?Ro(t).getElementById(n):e},Rt=t=>{for(let e=t;e;e=e.parentNode||e.host)if(e instanceof me)return e;return null},ht=t=>t&&Po(t)&&Do(t,()=>{var e;const n=pt(t.parentElement),o=((e=Rt(t))==null?void 0:e.panels)||[],i=hn(t,o?.[n.indexOf(t)]);let s=0;for(const r of n){const a=hn(r,o[s++]);L(r,zt,`${r===t}`),L(r,Ft,r===t?"0":"-1"),a&&Oo(a,r,a===i)}});fe.define("u-tabs",me),fe.define("u-tablist",pe),fe.define("u-tab",fn),fe.define("u-tabpanel",mn);var Ho=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",No=Ho(),qo;No&&/^Mac/i.test(((qo=navigator.userAgentData)==null?void 0:qo.platform)||navigator.platform);var Ia=No&&window.CSSStyleSheet&&document.adoptedStyleSheets,Oa=":host(:not([hidden])) { display: block }",Bo=typeof HTMLElement>"u"?class{}:HTMLElement,tt=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Uo=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>gn(t,...e)},gn=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},Da=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(he("slot")),!n.querySelector("style"))if(!Ia)n.append(he("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Pa=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},he=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))tt(o,i,s);return o},zo={define:(t,e)=>!Ho()||window.customElements.get(t)||window.customElements.define(t,e)},Ha=`${Oa}
11
- ::slotted([slot="summary"]) { cursor: pointer; display: block }
12
- ::slotted([slot="summary"])::before { content: ''; display: inline-block; vertical-align: middle; margin-inline: .05em .3125em; border-block: .3125em solid transparent; border-inline-start: .5em solid }
13
- ::slotted([slot="summary"][aria-expanded="true"])::before { rotate: 90deg }
14
- :host > [part="details-content"]:not([hidden=""]) { display: block }`,Na=class extends Bo{static get observedAttributes(){return["open"]}constructor(){var t;super(),Da(this,Ha),(t=this.shadowRoot)==null||t.prepend(he("slot",{name:"summary"}),he("slot",{part:"details-content"})),console.warn(`\x1B[1m<u-details> is deprecated as <details> now has sufficient screen reader support 🎉\x1B[0m
15
- Please use <details> and <summary>, but import '@u-elements/u-details/polyfill' to polyfill support for Talkback screen reader when used with Firefox on Android.`,this)}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],tt(this,"role","group"),Uo(this._content,"beforematch",this),Uo(this,"click keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&gn(this._content,"beforematch",this),gn(this,"click keydown",this),this._content=void 0}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const s of this.children)s.nodeName==="U-SUMMARY"&&tt(s,"aria-expanded",`${i}`);if(this._content&&(tt(this._content,"aria-hidden",`${!i}`),tt(this._content,"tabindex",i?null:"-1"),this._content.hidden=i?!1:o),i&&this.name){const s=Pa(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const r of s)r!==this&&(r.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){var e,n;const o=t.key===" "||t.key==="Enter",i=t.target instanceof Element&&((e=t.target.closest('[slot="summary"]'))==null?void 0:e.parentElement)===this;t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),i&&t.type==="click"&&(this.open=!this.open),i&&t.type==="keydown"&&o&&((n=t.preventDefault)==null||n.call(t),t.target.dispatchEvent(new MouseEvent("click",t))))}get open(){return this.hasAttribute("open")}set open(t){tt(this,"open",t?"":null)}get name(){return tt(this,"name")||""}set name(t){tt(this,"name",t)}},qa=class extends Bo{connectedCallback(){tt(this,"role","button"),this.slot="summary",this.tabIndex=0}};zo.define("u-details",Na),zo.define("u-summary",qa);function Ba(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function Ua(){document.addEventListener("invoke",f=>{f.type=="invoke"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0),document.addEventListener("command",f=>{f.type=="command"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0);function t(f,p,b=!0){Object.defineProperty(f,p,{...Object.getOwnPropertyDescriptor(f,p),enumerable:b})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}let n=new WeakMap,o=new WeakMap;class i extends Event{constructor(p,b={}){super(p,b);let{source:y,command:_}=b;if(y!=null&&!(y instanceof Element))throw TypeError("source must be an element");n.set(this,y||null),o.set(this,_===void 0?"":String(_))}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw TypeError("illegal invocation");let p=n.get(this);if(!(p instanceof Element))return null;let b=e(p);return b===e(this.target||document)?p:b.host}get command(){if(!o.has(this))throw TypeError("illegal invocation");return o.get(this)}}t(i.prototype,"source"),t(i.prototype,"command");let s=new WeakMap;function r(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(p){if(p===null)this.removeAttribute("commandfor"),s.delete(this);else if(p instanceof Element){this.setAttribute("commandfor","");let b=e(p);e(this)===b||b===this.ownerDocument?s.set(this,p):s.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 p=s.get(this);if(p)return p.isConnected?p:(s.delete(this),null);let b=e(this),y=this.getAttribute("commandfor");return(b instanceof Document||b instanceof ShadowRoot)&&y&&b.getElementById(y)||null}},command:{enumerable:!0,configurable:!0,get(){let p=this.getAttribute("command")||"";if(p.startsWith("--"))return p;let b=p.toLowerCase();switch(b){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return b}return""},set(p){this.setAttribute("command",p)}}})}let a=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return c.takeRecords(),a.get(this)||null},set(f){let p=a.get(this)||null;p&&this.removeEventListener("command",p),a.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function l(f){for(let p of f)p.oncommand=Function("event",p.getAttribute("oncommand"))}let c=new MutationObserver(f=>{for(let p of f){let{target:b}=p;p.type==="childList"?l(b.querySelectorAll("[oncommand]")):l([b])}});c.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]"));let u=new WeakSet;function d(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;let p=f.composedPath().find(w=>w.matches?.("button[commandfor], button[command]"));if(!p)return;if(p.form&&p.getAttribute("type")!=="button")throw f.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(p.hasAttribute("command")!==p.hasAttribute("commandfor")){let w=p.hasAttribute("command")?"command":"commandfor",x=p.hasAttribute("command")?"commandfor":"command";throw Error(`Element with ${w} attribute must also have a ${x} attribute to function.`)}if(p.command!=="show-popover"&&p.command!=="hide-popover"&&p.command!=="toggle-popover"&&p.command!=="show-modal"&&p.command!=="request-close"&&p.command!=="close"&&!p.command.startsWith("--")){console.warn(`"${p.command}" is not a valid command value. Custom commands must begin with --`);return}let b=p.commandForElement;if(!b)return;let y=new i("command",{command:p.command,source:p,cancelable:!0});if(b.dispatchEvent(y),y.defaultPrevented)return;let _=y.command.toLowerCase();if(b.popover){let w=!b.matches(":popover-open");w&&(_==="toggle-popover"||_==="show-popover")?b.showPopover({source:p}):!w&&_==="hide-popover"&&b.hidePopover()}else if(b.localName==="dialog"){let w=!b.hasAttribute("open");w&&_=="show-modal"?b.showModal():!w&&_=="close"?b.close(p.value?p.value:void 0):!w&&_=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let x=new Event("cancel",{cancelable:!0});this.dispatchEvent(x),x.defaultPrevented||this.close()}),b.requestClose(p.value?p.value:void 0))}}function m(f){f.addEventListener("click",d,!0)}function h(f,p){let b=f.prototype.attachShadow;f.prototype.attachShadow=function(_){let w=b.call(this,_);return p(w),w};let y=f.prototype.attachInternals;f.prototype.attachInternals=function(){let _=y.call(this);return _.shadowRoot&&p(_.shadowRoot),_}}r(HTMLButtonElement),h(HTMLElement,f=>{m(f),c.observe(f,{attributeFilter:["oncommand"]}),l(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i})}const B={passive:!0,capture:!0},j=()=>typeof window<"u"&&typeof document<"u",za=()=>j()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),ge=typeof HTMLElement>"u"?class{}:HTMLElement;function Fo(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const Mt=(t,...e)=>!j()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${t}`,...e),v=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),bn=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),Fa=/^["']|["']$/g,It=(t,e)=>{let n=v(t,e);return n||=bn(t,`--_ds-${e}`).replace(Fa,"").trim(),n||Mt(`Missing ${e} on:`,t),n||null},M=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>vn(t,...e)},vn=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},et=(t,e)=>{j()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(n=>n()),window._dsHotReloadCleanup?.set(t,e()))},nt=(t,e,n)=>{let o=()=>i.disconnect(),i=new MutationObserver(s=>{if(!j()||!t.isConnected)return o();e(t,s)});return e(t),i.observe(t,n),o},Wo=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))v(n,o,i);return n},ot={define:(t,e)=>!j()||window.customElements.get(t)||window.customElements.define(t,e)};let Wa=0;function it(t){return j()?(window.dsUseId||(window.dsUseId=0),t&&!t.id&&(t.id=`:ds:${++window.dsUseId}`),t?.id||""):`:ds:${++Wa}`}let X,Va=0,Vo=0;const yn=t=>{clearTimeout(Vo),X&&(X.textContent=`${t}${Va++%2?" ":""}`),t&&(Vo=setTimeout(yn,2e3,""))},Ga=()=>{document.readyState==="complete"&&(X||(X=Wo("div",{"aria-live":"assertive"}),X.style.overflow="hidden",X.style.position="fixed",X.style.whiteSpace="nowrap",X.style.width="1px"),X.isConnected||document.body.appendChild(X))};et("announce",()=>[M(document,"focus mouseover",Ga,B)]);const Go=":click-delegate-hover",jo="data-clickdelegatefor",ja=`[${jo}]`,Xa=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.button<2&&Xo(t);if(!(!n||n.contains(t.target))){if(e&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);t.stopImmediatePropagation(),n.click()}};let be;const Ka=t=>{let e=Xo(t);be!==e&&(be&&be.classList.remove(Go),e&&e.classList.add(Go),be=e)},Xo=({target:t})=>{let e=(t instanceof Element?t.closest(ja):null)?.getAttribute(jo),n=e&&document.getElementById(e)||void 0,o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&!n?.disabled?n:void 0};et("clickdelegatefor",()=>[M(window,"click auxclick",Xa,!0),M(document,"mouseover",Ka,B)]);let wn=!1;const Ya=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();wn=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!wn&&v(e,"closedby")==="any";wn=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}},Qa=j()?document.getElementsByTagName("button"):[],Ja=()=>{for(let t of Qa)t.getAttribute("command")?.endsWith("-modal")&&t.setAttribute("aria-haspopup","dialog")},Za=({command:t,target:e})=>t==="--show-non-modal"&&e instanceof HTMLDialogElement&&e.show();et("dialog",()=>[M(document,"command",Za,B),M(document,"pointerdown pointerup",Ya,B),nt(document,Ja,{attributeFilter:["command"],attributes:!0,childList:!0,subtree:!0})]);const tl=j()?document.getElementsByTagName("fieldset"):[],el=()=>{for(let t of tl)t.hasAttribute("aria-labelledby")||v(t,"aria-labelledby",`${it(t.querySelector("legend"))} ${it(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim()||null)};et("fieldset",()=>[nt(document,el,{childList:!0,subtree:!0})]);const Ot=Math.min,H=Math.max,ve=Math.round,ye=Math.floor,K=t=>({x:t,y:t}),nl={left:"right",right:"left",bottom:"top",top:"bottom"};function Ko(t,e,n){return H(t,Ot(e,n))}function gt(t,e){return typeof t=="function"?t(e):t}function st(t){return t.split("-")[0]}function Wt(t){return t.split("-")[1]}function _n(t){return t==="x"?"y":"x"}function Yo(t){return t==="y"?"height":"width"}function Y(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Qo(t){return _n(Y(t))}function ol(t,e,n){n===void 0&&(n=!1);const o=Wt(t),i=Qo(t),s=Yo(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=we(r)),[r,we(r)]}function il(t){const e=we(t);return[Sn(t),e,Sn(e)]}function Sn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Jo=["left","right"],Zo=["right","left"],sl=["top","bottom"],rl=["bottom","top"];function al(t,e,n){switch(t){case"top":case"bottom":return n?e?Zo:Jo:e?Jo:Zo;case"left":case"right":return e?sl:rl;default:return[]}}function ll(t,e,n,o){const i=Wt(t);let s=al(st(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(Sn)))),s}function we(t){const e=st(t);return nl[e]+t.slice(e.length)}function cl(t){return{top:0,right:0,bottom:0,left:0,...t}}function dl(t){return typeof t!="number"?cl(t):{top:t,right:t,bottom:t,left:t}}function _e(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function ti(t,e,n){let{reference:o,floating:i}=t;const s=Y(e),r=Qo(e),a=Yo(r),l=st(e),c=s==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Wt(e)){case"start":h[r]-=m*(n&&c?-1:1);break;case"end":h[r]+=m*(n&&c?-1:1);break}return h}async function ul(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=gt(e,t),f=dl(h),b=a[m?d==="floating"?"reference":"floating":d],y=_e(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=_e(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:w,strategy:l}):_);return{top:(y.top-C.top+f.top)/x.y,bottom:(C.bottom-y.bottom+f.bottom)/x.y,left:(y.left-C.left+f.left)/x.x,right:(C.right-y.right+f.right)/x.x}}const fl=50,ml=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=r.detectOverflow?r:{...r,detectOverflow:ul},l=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=ti(c,o,l),m=o,h=0;const f={};for(let p=0;p<s.length;p++){const b=s[p];if(!b)continue;const{name:y,fn:_}=b,{x:w,y:x,data:C,reset:k}=await _({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});u=w??u,d=x??d,f[y]={...f[y],...C},k&&h<fl&&(h++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:u,y:d}=ti(c,m,l)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:f}},pl=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...b}=gt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=st(i),_=Y(a),w=st(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(w||!p?[we(a)]:il(a)),k=f!=="none";!m&&k&&C.push(...ll(a,p,f,x));const Z=[a,...C],St=await l.detectOverflow(e,b),xt=[];let lt=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&xt.push(St[y]),d){const Et=ol(i,r,x);xt.push(St[Et[0]],St[Et[1]])}if(lt=[...lt,{placement:i,overflows:xt}],!xt.every(Et=>Et<=0)){var ee,ne;const Et=(((ee=s.flip)==null?void 0:ee.index)||0)+1,po=Z[Et];if(po&&(!(d==="alignment"?_!==Y(po):!1)||lt.every(V=>Y(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:Et,overflows:lt},reset:{placement:po}};let ie=(ne=lt.filter($t=>$t.overflows[0]<=0).sort(($t,V)=>$t.overflows[1]-V.overflows[1])[0])==null?void 0:ne.placement;if(!ie)switch(h){case"bestFit":{var oe;const $t=(oe=lt.filter(V=>{if(k){const mt=Y(V.placement);return mt===_||mt==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(mt=>mt>0).reduce((mt,zu)=>mt+zu,0)]).sort((V,mt)=>V[1]-mt[1])[0])==null?void 0:oe[0];$t&&(ie=$t);break}case"initialPlacement":ie=a;break}if(i!==ie)return{reset:{placement:ie}}}return{}}}},ei=new Set(["left","top"]);async function hl(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=st(n),a=Wt(n),l=Y(n)==="y",c=ei.has(r)?-1:1,u=s&&l?-1:1,d=gt(e,t);let{mainAxis:m,crossAxis:h,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*u,y:m*c}:{x:m*c,y:h*u}}const gl=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:a}=e,l=await hl(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},bl=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:_,y:w}=y;return{x:_,y:w}}},...c}=gt(t,e),u={x:n,y:o},d=await s.detectOverflow(e,c),m=Y(st(i)),h=_n(m);let f=u[h],p=u[m];if(r){const y=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=f+d[y],x=f-d[_];f=Ko(w,f,x)}if(a){const y=m==="y"?"top":"left",_=m==="y"?"bottom":"right",w=p+d[y],x=p-d[_];p=Ko(w,p,x)}const b=l.fn({...e,[h]:f,[m]:p});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[h]:r,[m]:a}}}}}},vl=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gt(t,e),u={x:n,y:o},d=Y(i),m=_n(d);let h=u[m],f=u[d];const p=gt(a,e),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",x=s.reference[m]-s.floating[w]+b.mainAxis,C=s.reference[m]+s.reference[w]-b.mainAxis;h<x?h=x:h>C&&(h=C)}if(c){var y,_;const w=m==="y"?"width":"height",x=ei.has(st(i)),C=s.reference[d]-s.floating[w]+(x&&((y=r.offset)==null?void 0:y[d])||0)+(x?0:b.crossAxis),k=s.reference[d]+s.reference[w]+(x?0:((_=r.offset)==null?void 0:_[d])||0)-(x?b.crossAxis:0);f<C?f=C:f>k&&(f=k)}return{[m]:h,[d]:f}}}},yl=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:r,elements:a}=e,{apply:l=()=>{},...c}=gt(t,e),u=await r.detectOverflow(e,c),d=st(i),m=Wt(i),h=Y(i)==="y",{width:f,height:p}=s.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const _=p-u.top-u.bottom,w=f-u.left-u.right,x=Ot(p-u[b],_),C=Ot(f-u[y],w),k=!e.middlewareData.shift;let Z=x,St=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(St=w),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(Z=_),k&&!m){const lt=H(u.left,0),ee=H(u.right,0),ne=H(u.top,0),oe=H(u.bottom,0);h?St=f-2*(lt!==0||ee!==0?lt+ee:H(u.left,u.right)):Z=p-2*(ne!==0||oe!==0?ne+oe:H(u.top,u.bottom))}await l({...e,availableWidth:St,availableHeight:Z});const xt=await r.getDimensions(a.floating);return f!==xt.width||p!==xt.height?{reset:{rects:!0}}:{}}}};function Se(){return typeof window<"u"}function Dt(t){return ni(t)?(t.nodeName||"").toLowerCase():"#document"}function N(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Q(t){var e;return(e=(ni(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ni(t){return Se()?t instanceof Node||t instanceof N(t).Node:!1}function z(t){return Se()?t instanceof Element||t instanceof N(t).Element:!1}function rt(t){return Se()?t instanceof HTMLElement||t instanceof N(t).HTMLElement:!1}function oi(t){return!Se()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof N(t).ShadowRoot}function Vt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=F(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function wl(t){return/^(table|td|th)$/.test(Dt(t))}function xe(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const _l=/transform|translate|scale|rotate|perspective|filter/,Sl=/paint|layout|strict|content/,bt=t=>!!t&&t!=="none";let xn;function En(t){const e=z(t)?F(t):t;return bt(e.transform)||bt(e.translate)||bt(e.scale)||bt(e.rotate)||bt(e.perspective)||!$n()&&(bt(e.backdropFilter)||bt(e.filter))||_l.test(e.willChange||"")||Sl.test(e.contain||"")}function xl(t){let e=dt(t);for(;rt(e)&&!Pt(e);){if(En(e))return e;if(xe(e))return null;e=dt(e)}return null}function $n(){return xn==null&&(xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xn}function Pt(t){return/^(html|body|#document)$/.test(Dt(t))}function F(t){return N(t).getComputedStyle(t)}function Ee(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dt(t){if(Dt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||oi(t)&&t.host||Q(t);return oi(e)?e.host:e}function ii(t){const e=dt(t);return Pt(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&Vt(e)?e:ii(e)}function Gt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=ii(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=N(i);if(s){const a=Tn(r);return e.concat(r,r.visualViewport||[],Vt(i)?i:[],a&&n?Gt(a):[])}else return e.concat(i,Gt(i,[],n))}function Tn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function si(t){const e=F(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=rt(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=ve(n)!==s||ve(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function Cn(t){return z(t)?t:t.contextElement}function Ht(t){const e=Cn(t);if(!rt(e))return K(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=si(e);let r=(s?ve(n.width):n.width)/o,a=(s?ve(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const El=K(0);function ri(t){const e=N(t);return!$n()||!e.visualViewport?El:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $l(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==N(t)?!1:e}function vt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Cn(t);let r=K(1);e&&(o?z(o)&&(r=Ht(o)):r=Ht(t));const a=$l(s,n,o)?ri(s):K(0);let l=(i.left+a.x)/r.x,c=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(s){const m=N(s),h=o&&z(o)?N(o):o;let f=m,p=Tn(f);for(;p&&o&&h!==f;){const b=Ht(p),y=p.getBoundingClientRect(),_=F(p),w=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*b.x,x=y.top+(p.clientTop+parseFloat(_.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=x,f=N(p),p=Tn(f)}}return _e({width:u,height:d,x:l,y:c})}function $e(t,e){const n=Ee(t).scrollLeft;return e?e.left+n:vt(Q(t)).left+n}function ai(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-$e(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Tl(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=Q(o),a=e?xe(e.floating):!1;if(o===r||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=K(1);const u=K(0),d=rt(o);if((d||!d&&!s)&&((Dt(o)!=="body"||Vt(r))&&(l=Ee(o)),d)){const h=vt(o);c=Ht(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const m=r&&!d&&!s?ai(r,l):K(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Cl(t){return Array.from(t.getClientRects())}function Al(t){const e=Q(t),n=Ee(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+$e(t);const a=-n.scrollTop;return F(o).direction==="rtl"&&(r+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}const li=25;function kl(t,e){const n=N(t),o=Q(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,l=0;if(i){s=i.width,r=i.height;const u=$n();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=$e(o);if(c<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-h);f<=li&&(s-=f)}else c<=li&&(s+=c);return{width:s,height:r,x:a,y:l}}function Ll(t,e){const n=vt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=rt(t)?Ht(t):K(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=o*s.y;return{width:r,height:a,x:l,y:c}}function ci(t,e,n){let o;if(e==="viewport")o=kl(t,n);else if(e==="document")o=Al(Q(t));else if(z(e))o=Ll(e,n);else{const i=ri(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _e(o)}function di(t,e){const n=dt(t);return n===e||!z(n)||Pt(n)?!1:F(n).position==="fixed"||di(n,e)}function Rl(t,e){const n=e.get(t);if(n)return n;let o=Gt(t,[],!1).filter(a=>z(a)&&Dt(a)!=="body"),i=null;const s=F(t).position==="fixed";let r=s?dt(t):t;for(;z(r)&&!Pt(r);){const a=F(r),l=En(r);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Vt(r)&&!l&&di(t,r))?o=o.filter(u=>u!==r):i=a,r=dt(r)}return e.set(t,o),o}function Ml(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?xe(e)?[]:Rl(e,this._c):[].concat(n),o],a=ci(e,r[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let m=1;m<r.length;m++){const h=ci(e,r[m],i);l=H(h.top,l),c=Ot(h.right,c),u=Ot(h.bottom,u),d=H(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Il(t){const{width:e,height:n}=si(t);return{width:e,height:n}}function Ol(t,e,n){const o=rt(e),i=Q(e),s=n==="fixed",r=vt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=K(0);function c(){l.x=$e(i)}if(o||!o&&!s)if((Dt(e)!=="body"||Vt(i))&&(a=Ee(e)),o){const h=vt(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();s&&!o&&i&&c();const u=i&&!o&&!s?ai(i,a):K(0),d=r.left+a.scrollLeft-l.x-u.x,m=r.top+a.scrollTop-l.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function An(t){return F(t).position==="static"}function ui(t,e){if(!rt(t)||F(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Q(t)===n&&(n=n.ownerDocument.body),n}function fi(t,e){const n=N(t);if(xe(t))return n;if(!rt(t)){let i=dt(t);for(;i&&!Pt(i);){if(z(i)&&!An(i))return i;i=dt(i)}return n}let o=ui(t,e);for(;o&&wl(o)&&An(o);)o=ui(o,e);return o&&Pt(o)&&An(o)&&!En(o)?n:o||xl(t)||n}const Dl=async function(t){const e=this.getOffsetParent||fi,n=this.getDimensions,o=await n(t.floating);return{reference:Ol(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pl(t){return F(t).direction==="rtl"}const Hl={convertOffsetParentRelativeRectToViewportRelativeRect:Tl,getDocumentElement:Q,getClippingRect:Ml,getOffsetParent:fi,getElementRects:Dl,getClientRects:Cl,getDimensions:Il,getScale:Ht,isElement:z,isRTL:Pl};function mi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Nl(t,e){let n=null,o;const i=Q(t);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=t.getBoundingClientRect(),{left:u,top:d,width:m,height:h}=c;if(a||e(),!m||!h)return;const f=ye(d),p=ye(i.clientWidth-(u+m)),b=ye(i.clientHeight-(d+h)),y=ye(u),w={rootMargin:-f+"px "+-p+"px "+-b+"px "+-y+"px",threshold:H(0,Ot(1,l))||1};let x=!0;function C(k){const Z=k[0].intersectionRatio;if(Z!==l){if(!x)return r();Z?r(!1,Z):o=setTimeout(()=>{r(!1,1e-7)},1e3)}Z===1&&!mi(c,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(C,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(t)}return r(!0),s}function ql(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=Cn(t),u=i||s?[...c?Gt(c):[],...e?Gt(e):[]]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=c&&a?Nl(c,n):null;let m=-1,h=null;r&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let f,p=l?vt(t):null;l&&b();function b(){const y=vt(t);p&&!mi(p,y)&&n(),p=y,f=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(_=>{i&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Bl=gl,Ul=bl,zl=pl,Fl=yl,Wl=vl,Vl=(t,e,n)=>{const o=new Map,i={platform:Hl,...n},s={...i.platform,_c:o};return ml(t,e,{...i,platform:s})},pi="data-placement",hi="data-autoplacement",jt=new Map;function Gl(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,s=o instanceof HTMLElement&&v(o,"popover")!==null&&bn(o,"--_ds-floating");if(!s)return;if(e==="closed")return jt.get(o)?.();if(!i){let f=o.getRootNode(),p=`[popovertarget="${o.id}"],[commandfor="${o.id}"]`;i=o.id&&f?.querySelector?.(p)||void 0}if(!i||i===o||n&&n===e)return;let r=bn(o,"--_ds-floating-overscroll"),a=v(o,pi)||v(i,pi)||s,l=v(o,hi)||v(i,hi),c=parseFloat(getComputedStyle(o,"::before").height)||0,u=a.match(/left|right/gi)?"Height":"Width",d=i[`offset${u}`]/2+c;if(a==="none")return;let m={strategy:"absolute",placement:a,middleware:[Bl(c||0),Ul({padding:10,limiter:Wl({offset:{mainAxis:d}})}),Xl(),...l==="false"?[]:[zl({padding:10,crossAxis:!1})],...r?[Fl({apply({availableHeight:f}){r==="fit"&&(o.style.width=`${i.clientWidth}px`),o.style.maxHeight=`${Math.max(50,f-20)}px`}})]:[]]},h=ql(i,o,async()=>{if(!i?.isConnected)return jt.get(o)?.();let{x:f,y:p}=await Vl(i,o,m);o.style.translate=`${f}px ${p}px`});jt.set(o,()=>jt.delete(o)&&h())}let Te;const jl=({type:t})=>{if(t==="mousedown"&&(Te=!1),t==="scroll"&&Te===!1&&(Te=!0),t==="mouseup"&&Te)for(let[e]of jt)e.showPopover()};et("popover",()=>[M(document,"mousedown scroll mouseup",jl,!0),M(document,"toggle ds-toggle-source",Gl,B)]);const Xl=()=>({name:"arrowPseudo",fn(t){let e=t.elements.floating,n=t.rects.reference,o=`${Math.round(n.width/2+n.x-t.x)}px`,i=`${Math.round(n.height/2+n.y-t.y)}px`;return e.style.setProperty("--_ds-floating-arrow-x",o),e.style.setProperty("--_ds-floating-arrow-y",i),v(e,"data-floating",t.placement),t}}),kn=t=>(t instanceof HTMLSelectElement||t instanceof HTMLInputElement)&&(t.hasAttribute("readonly")||v(t,"aria-readonly")==="true"),Kl=t=>{if(t.key!=="Tab"&&kn(t.target)){let e=t.key?.startsWith("Arrow"),n=t.altKey||t.ctrlKey||t.metaKey;if((e||!n)&&t.preventDefault(),e&&v(t.target,"type")==="radio"){let o=document.querySelectorAll(`input[name="${t.target.name}"]`),i=t.key?.match(/Arrow(Right|Down)/)?1:-1;o[(o.length+[...o].indexOf(t.target)+i)%o.length]?.focus()}}},Yl=t=>{let e=t.target?.closest?.("label")?.control||t.target;kn(e)&&(t.preventDefault(),e.focus())},Ql=t=>{t.target instanceof HTMLSelectElement&&kn(t.target)&&t.preventDefault()};et("readonly",()=>[M(document,"keydown",Kl),M(document,"click",Yl),M(document,"mousedown",Ql)]);const gi="aria-label",Ce="data-toggle-group",bi=`[${Ce}]`,Jl=()=>{for(let t of document.querySelectorAll(bi))v(t,"aria-label",It(t,Ce))},Zl=t=>{let{key:e,target:n}=t,o=n instanceof HTMLInputElement&&n.closest(bi);if(o&&(!v(o,gi)&&!v(o,"aria-labelledby")&&v(o,gi,It(o,Ce)),e==="Enter"&&n.click(),e?.startsWith("Arrow"))){t.preventDefault?.();let i=[...o.getElementsByTagName("input")],s=i.indexOf(n),r=e.match(/Arrow(Right|Down)/)?1:-1,a=s;for(let l=0;l<i.length;l++)if(a=(i.length+a+r)%i.length,!i[a]?.disabled){i[a]?.focus();break}}};et("toggle-group",()=>[M(document,"keydown",Zl),nt(document,Jl,{attributeFilter:[Ce],attributes:!0,childList:!0,subtree:!0})]);let A,Xt,Ae=!1,Ln=0,Rn=0;const tc=j()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Nt="data-tooltip",Mn="data-color",vi="aria-label",yi="aria-description",ec=`[${Mn}]`,nc=`[${Nt}]`,In="data-color-scheme",oc=`[${In}]`,wi=t=>{t&&!(t instanceof HTMLElement)&&Mt("setTooltipElement expects an HTMLElement, got: ",t),clearTimeout(Rn),clearTimeout(Ln),Xt=void 0,Ae=!1,A=t||void 0},ic=()=>{for(let t of document.querySelectorAll(nc)){let e=It(t,Nt);if(!e)return;if(e!==(t.getAttribute(vi)||t.getAttribute(yi))){let i=v(t,"role")!=="img"&&t.textContent?.trim();v(t,Nt,e),v(t,vi,i?null:e),v(t,yi,i?e:null),t.matches("a,button,input,label,select,textarea,[tabindex]")||Mt('Missing tabindex="0" attribute on: ',t)}let n=t===Xt&&A?.offsetHeight&&A?.offsetWidth,o=n&&e&&A?.textContent!==e;n&&o&&(A&&(A.textContent=e),document.activeElement===t&&yn(e))}},_i=({type:t,target:e})=>{if(clearTimeout(Ln),e===A)return;if(t==="mouseover"&&!Ae&&!tc){Ln=setTimeout(_i,300,{target:e});return}let n=e?.closest?.(`[${Nt}]`);if(n===Xt)return;if(!n)return Si();A||=Wo("div",{class:"ds-tooltip"}),A.isConnected||document.body.appendChild(A);let o=n.closest(ec),i=n.closest(oc),s=o!==i&&o?.contains(i);clearTimeout(Rn),v(A,"popover","manual"),v(A,In,i?.getAttribute(In)||null),v(A,Mn,s&&o?.getAttribute(Mn)||null),A.textContent=v(n,Nt),A.showPopover(),A.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),Ae=!0,Xt=n},Si=()=>A?.isConnected&&A.popover&&A.hidePopover(),xi=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&Si();t?t.target===A&&t.newState==="closed"&&(Xt=void 0,Rn=setTimeout(xi,300)):Ae=!1};et("tooltip",()=>[M(document,"blur focus mouseover",_i,B),M(document,"toggle keydown",xi,B),nt(document,ic,{attributeFilter:[Nt],attributes:!0,childList:!0,subtree:!0})]);const On="aria-label";var Ei=class extends ge{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[On]}connectedCallback(){let e=Fo(()=>Dn(this),100);this._label=It(this,On),this._items=this.getElementsByTagName("a"),this._unresize=M(window,"resize",e),this._unmutate=nt(this,Dn,{childList:!0,subtree:!0})}attributeChangedCallback(e,n,o){!this._unmutate||!o||(this._label=o,Dn(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};const Dn=t=>{let e=t._items?.[t._items.length-1],n=e?.parentElement===t?null:e,o=!n?.offsetHeight;v(t,"role",o?null:"navigation"),v(t,On,o?null:t._label);for(let i of t._items||[])v(i,"aria-current",i===n?"page":null)};ot.define("ds-breadcrumbs",Ei);var $i=class extends ge{_unmutate;connectedCallback(){M(this,"animationend",this,B),v(this,"tabindex","-1"),this._unmutate=nt(this,sc,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){vn(this,"animationend",this,B),this._unmutate?.(),this._unmutate=void 0}};const sc=t=>{let e=t.querySelector("h2,h3,h4,h5,h6");e&&v(t,"aria-labelledby",it(e))};ot.define("ds-error-summary",$i);const Pn="aria-invalid",Ti="aria-describedby",Ci="data-indeterminate",rc=za()?800:200,Ai=new WeakMap,Kt=new Map,Hn=new WeakSet,ac=(t,e=[])=>{for(let{target:n}of e){let o=n instanceof HTMLFieldSetElement;for(let[i]of Kt)(o?n.contains(i):i.contains(n))&&ki(i)}},ki=t=>{let e=[],n=[],o=Kt.get(t)||[],i,s,r=!1,a=!1;for(let m of t.getElementsByTagName("*"))if(m instanceof HTMLLabelElement&&e.push(m),!m.hidden)if(dc(m))i?Mt("Fields should only have one input element. Use <fieldset> to group multiple fields:",t):i=m;else{let h=m.getAttribute("data-field");h==="counter"&&(s=m),h==="validation"?(n.unshift(it(m)),r=!0,a||=Ri(m)):h&&n.push(it(m))}if(!i)return;s&&Ai.set(i,s);for(let m of e)v(m,"for",it(i));let l=t.closest("fieldset")?.querySelector(':scope > [data-field="validation"]');l&&!l?.hidden&&(r=!0,a||=Ri(l),n.unshift(it(l)));let c=v(i,Ci);c&&(i.indeterminate=c==="true"),(i.type==="radio"||i.type==="checkbox")&&v(t,"data-clickdelegatefor",it(i));let u=v(i,Ti)?.trim().split(/\s+/)?.filter(m=>!o.includes(m))||[];v(i,Ti,[...n,...u].join(" ")||null),Kt.set(t,n);let d=Hn.has(i);r&&!d&&!i.hasAttribute(Pn)?(v(i,Pn,"true"),Hn.add(i)):!r&&d&&(v(i,Pn,null),Hn.delete(i)),Li(i)},lc={over:"%d tegn for mye",under:"%d tegn igjen"},Li=t=>{let e=t.target||t,n=Ai.get(e);if(n?.isConnected){let o=(Number(v(n,"data-limit"))||0)-e.value.length,i=o<0?"over":"under",s=(It(n,`data-${i}`)||lc[i])?.replace("%d",`${Math.abs(o)}`);v(n,"data-label",s),v(n,"data-state",i),v(n,"data-color",o<0?"danger":null),t.type==="input"&&s&&cc(e,s)}e instanceof HTMLTextAreaElement&&(e.style.setProperty("--_ds-field-sizing","auto"),e.style.setProperty("--_ds-field-sizing",`${e.scrollHeight}px`))},cc=Fo((t,e)=>{document.activeElement===t&&yn(e)},rc),Ri=t=>t.getAttribute("data-color")!=="success",dc=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement)&&t.type!=="hidden";var ke=class extends ge{connectedCallback(){Kt.set(this,[]),ki(this)}disconnectedCallback(){Kt.delete(this)}};ot.define("ds-field",ke),et("field",()=>[M(document,"input",Li,B),nt(document,ac,{attributeFilter:["data-field","data-limit","hidden","id","value",Ci],attributes:!0,childList:!0,subtree:!0})]);const Nn="aria-label",Le="data-current",Re="data-total",Mi="data-href",Ii=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:uc(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))});var Oi=class extends ge{_unmutate;_render;static get observedAttributes(){return[Nn,Le,Re,Mi]}connectedCallback(){let t=v(this,Re),e=v(this,Le);e&&!t&&Mt(`Missing ${Re} attribute on:`,this),t&&!e&&Mt(`Missing ${Le} attribute on:`,this),v(this,Nn,It(this,Nn)),v(this,"role","navigation"),this._unmutate=nt(this,Di,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&Di(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};const Di=t=>{let e=Number(v(t,Le)),n=Number(v(t,Re));if(e&&n){let o=t.querySelectorAll("button,a"),i=o.length-2,s=v(t,Mi),{next:r,prev:a,pages:l}=Ii({current:e,total:n,show:i});o.forEach((c,u)=>{let d=u?o[u+1]?l[u-1]?.page:r:a;v(c,"aria-current",l[u-1]?.current?"true":null),v(c,"aria-label",`${d??"hidden"}`),v(c,"role",d?null:"none"),v(c,"tabindex",d?null:"-1"),c instanceof HTMLButtonElement&&v(c,"value",`${d}`),s&&c instanceof HTMLAnchorElement&&v(c,"href",s.replace("%d",`${d}`))})}},uc=(t,e,n=1/0)=>{let o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),s=Math.min(Math.max(t+Math.ceil(o),n),e),r=Array.from({length:s+1-i},(a,l)=>l+i);return n>4&&i>1&&r.splice(0,2,1,0),n>3&&s<e&&r.splice(-2,2,0,e),r};ot.define("ds-pagination",Oi);var Pi=class extends en{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=nt(this,fc,{childList:!0}),M(this,"toggle",Hi,B)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,vn(this,"toggle",Hi,B)}};const fc=({control:t,list:e})=>{t&&!t.placeholder&&v(t,"placeholder"," "),t&&v(t,"popovertarget",it(e)||null),e&&v(e,"popover","manual"),e&&v(e,"data-is-floating","true")},Hi=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};ot.define("ds-suggestion",Pi);var Ni=class extends me{},qi=class extends pe{},Bi=class extends fn{},Ui=class extends mn{};ot.define("ds-tabs",Ni),ot.define("ds-tablist",qi),ot.define("ds-tab",Bi),ot.define("ds-tabpanel",Ui);var qn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",zi=qn(),Fi=zi?navigator.userAgent:"",mc=/android/i.test(Fi),pc=/firefox/i.test(Fi),Wi;zi&&/^Mac/i.test(((Wi=navigator.userAgentData)==null?void 0:Wi.platform)||navigator.platform);var Vi=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),hc=(t,e,n)=>{const o=new MutationObserver(s=>{if(!qn()||!t.isConnected)return i();e(t,s)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Gi="__uDetailsPolyfillSummarys";if(qn()&&mc&&pc&&!window[Gi]){const t=document.getElementsByTagName("summary"),e=()=>{for(const n of t){const o=n.parentElement;Vi(n,"role","button"),Vi(n,"aria-expanded",`${!!o?.open}`)}};window[Gi]=hc(document,e,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})}var gc=Object.defineProperty,ji=Object.getOwnPropertySymbols,bc=Object.prototype.hasOwnProperty,vc=Object.prototype.propertyIsEnumerable,Xi=(t,e,n)=>e in t?gc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yc=(t,e)=>{for(var n in e||(e={}))bc.call(e,n)&&Xi(t,n,e[n]);if(ji)for(var n of ji(e))vc.call(e,n)&&Xi(t,n,e[n]);return t},Me=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Ie=Me(),Bn=Ie?navigator.userAgent:"",Oe=/android/i.test(Bn),wc=/firefox/i.test(Bn),_c=/iPad|iPhone|iPod/.test(Bn),Ki,Sc=Ie&&/^Mac/i.test(((Ki=navigator.userAgentData)==null?void 0:Ki.platform)||navigator.platform),xc=Ie&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ec={once:!0,capture:!0,passive:!0},$c=":host(:not([hidden])) { display: block }",Tc="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Cc=`${Oe?"data":"aria"}-multiselectable`,Yi=typeof HTMLElement>"u"?class{}:HTMLElement,$=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Un=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>De(t,...e)},De=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},Ac=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(zn("slot")),!n.querySelector("style"))if(!xc)n.append(zn("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},kc=(t,e,n)=>{const o=new MutationObserver(s=>{if(!Me()||!t.isConnected)return i();e(t,s)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Pe=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Qi=t=>Pe(t).activeElement,Yt=t=>{if(!t||!Ie)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},zn=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))$(o,i,s);return o},Ji={define:(t,e)=>!Me()||window.customElements.get(t)||window.customElements.define(t,e)},Lc=(t,e,n="")=>{var o,i;const s={bubbles:!0,composed:!0,data:e,inputType:n},r=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",s)),(i=(o=Object.getOwnPropertyDescriptor(r,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",s)),t.dispatchEvent(new Event("change",{bubbles:!0}))},Fn=!1,Wn=t=>(t?.type==="pointerup"&&(Fn=!1),t?.type==="pointerdown"&&(Fn=!0,Un(document,"pointerup",Wn,Ec)),Fn),Rc=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Mc=t=>{const e=$(t,"form");$(t,"form","#"),setTimeout(Ic,0,t,e)},Ic=(t,e)=>$(t,"form",e),J,Oc=0,Zi=0,Vn=t=>{clearTimeout(Zi),J||(J=zn("div",{"aria-live":"assertive"}),J.style.overflow="hidden",J.style.position="fixed",J.style.whiteSpace="nowrap",J.style.width="1px"),J.isConnected||document.body.append(J),t===""&&(J.textContent=""),t&&(J.textContent=`${t}${Oc++%2?" ":""}`,Zi=setTimeout(Vn,!Sc&&wc?2e3:300,""))},Gn="disabled",Qt="selected",Dc=class extends Yi{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return["id",Gn,Qt]}connectedCallback(){Oe&&(this.tabIndex=-1),this.hasAttribute("role")||$(this,"role","option"),$(this,"aria-disabled",`${this.disabled}`),$(this,"aria-selected",`${this.selected}`),Yt(this)}attributeChangedCallback(t){this._skipAttrChange||(this._skipAttrChange=!0,t==="id"?Yt(this):$(this,`aria-${t}`,`${this[t]}`),this._skipAttrChange=!1)}get defaultSelected(){return this[Qt]}set defaultSelected(t){this[Qt]=t}get disabled(){return $(this,Gn)!==null}set disabled(t){$(this,Gn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=$(this,"label"))!=null?t:this.text}set label(t){$(this,"label",t)}get selected(){return $(this,Qt)!==null}set selected(t){$(this,Qt,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=$(this,"value"))!=null?t:this.text}set value(t){$(this,"value",t)}};Ji.define("u-option",Dc);var ts="data-activedescendant",He="aria-hidden",jn=`${$c}
15
+ ::slotted([role="tab"][${Ci}="true"]) { cursor: default }`,An=class extends ke{constructor(){super(),$n(this,Yl)}get tabList(){return this.querySelector('[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])')}get selectedIndex(){const t=bt(this.tabList);return t.indexOf(Pt(t))}set selectedIndex(t){vt(this.tabs[t])}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"])')}},Tn=class extends ke{constructor(){super(),$n(this,Jl)}connectedCallback(){L(this,"role","tablist"),Xl(this,"click keydown",this),this._umutate=Kl(this,Zl,{attributeFilter:["id","role",Mt,jt],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;Si(this,"click keydown",this),(t=this._umutate)==null||t.call(this),this._umutate=void 0}handleEvent(t){var e,n,o,i;const{key:r,type:s,target:a}=t,l=bt(this),c=l.findIndex(m=>m.contains(a)),u=r===" "||r==="Enter";let d=c;if(!(t.defaultPrevented||c===-1)&&(s==="click"&&vt(l[c]),s==="keydown")){if(u){(e=t.preventDefault)==null||e.call(t);const m={bubbles:!0,cancelable:!0,composed:!0};return l[c].dispatchEvent(new MouseEvent("click",m))}if(r==="ArrowDown"||r==="ArrowRight")d=(c+1)%l.length;else if(r==="ArrowUp"||r==="ArrowLeft")d=(c||l.length)-1;else if(r==="End")d=l.length-1;else if(r==="Home")d=0;else if(r==="Tab"&&!Dt(l[c])){const m=Pt(l);return m&&L(m,Xt,"-1"),m&&setTimeout(()=>L(m,Xt,"0"))}else return;(n=t.preventDefault)==null||n.call(t),(i=(o=l[d]).focus)==null||i.call(o)}}get tabsElement(){return Nt(this)}get tabs(){return this.querySelectorAll(':scope > [role="tab"]')}get selectedIndex(){const t=bt(this);return t.indexOf(Pt(t))}set selectedIndex(t){vt(this.tabs[t])}},Ai=class extends ke{static get observedAttributes(){return["id",jt,Mt]}connectedCallback(){var t;L(this,"role","tab"),L(this,jt,`${this.selected}`),L(this,Xt,this.selected?"0":"-1"),Pt((t=this.parentElement)==null?void 0:t.children)||vt(this)}attributeChangedCallback(){!kn.has(this.parentElement)&&this.selected&&vt(this)}get tabsElement(){return Nt(this)}get tabList(){const t=this.parentElement;return t instanceof Tn?t:null}get selected(){return Dt(this)}set selected(t){t&&vt(this)}get index(){return Math.max(bt(this.parentElement).indexOf(this),0)}get panel(){var t;const e=(t=Nt(this))==null?void 0:t.panels,n=bt(this.parentElement).indexOf(this);return Ln(this,e?.[n])}},Ti=class extends ke{constructor(){super(),$n(this,Ql)}connectedCallback(){L(this,"role","tabpanel");const t=new Set(this.tabs),e=Nt(this),n=e?.tabs[Array.prototype.indexOf.call(e?.panels,this)];n&&!n.hasAttribute(Mt)&&t.add(n);const o=Pt(t)||t.values().next().value;Li(o,()=>ki(this,o,!!o&&Dt(o)))}get tabsElement(){return Nt(this)}get tabs(){return Ei(this).querySelectorAll(`[${Mt}="${Cn(this)}"]`)}},Zl=(t,e=[])=>{let n;const o=bt(t);for(const{target:i}of e)i instanceof Element&&L(i,"role")==="tab"&&Dt(i)&&(n=i);!n&&!Pt(o)&&(n=o.find(Ri)),vt(n)},ki=(t,e,n=!1)=>{L(t,"aria-hidden",`${!n}`),L(t,"hidden",n?null:""),L(t,Xt,n?"0":null),e&&L(e,Mt,Cn(t)),e&&n&&Dt(e)&&L(t,jl,Cn(e))},kn=new Set,Li=(t,e)=>{var n;const o=t?.parentElement;o&&kn.add(o),e(),o&&kn.delete(o),(n=o?._umutate)==null||n.takeRecords()},Ri=t=>L(t,Ci)!=="true",Dt=t=>L(t,jt)==="true",Pt=(t=[])=>{for(const e of t)if(Dt(e))return e},bt=t=>{const e=[];for(const n of t?.children||[])n.getAttribute("role")==="tab"&&e.push(n);return e},Ln=(t,e=null)=>{const n=L(t,Mt);return n?Ei(t).getElementById(n):e},Nt=t=>{for(let e=t;e;e=e.parentNode||e.host)if(e instanceof An)return e;return null},vt=t=>t&&Ri(t)&&Li(t,()=>{var e;const n=bt(t.parentElement),o=((e=Nt(t))==null?void 0:e.panels)||[],i=Ln(t,o?.[n.indexOf(t)]);let r=0;for(const s of n){const a=Ln(s,o[r++]);L(s,jt,`${s===t}`),L(s,Xt,s===t?"0":"-1"),a&&ki(a,s,a===i)}});Le.define("u-tabs",An),Le.define("u-tablist",Tn),Le.define("u-tab",Ai),Le.define("u-tabpanel",Ti);var Ii=class extends An{},Oi=class extends Tn{},Mi=class extends Ai{},Di=class extends Ti{};nt.define("ds-tabs",Ii),nt.define("ds-tablist",Oi),nt.define("ds-tab",Mi),nt.define("ds-tabpanel",Di);var Rn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Pi=Rn(),Ni=Pi?navigator.userAgent:"",tc=/android/i.test(Ni),ec=/firefox/i.test(Ni),qi;Pi&&/^Mac/i.test(((qi=navigator.userAgentData)==null?void 0:qi.platform)||navigator.platform);var Hi=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),nc=(t,e,n)=>{const o=new MutationObserver(r=>{if(!Rn()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Bi="__uDetailsPolyfillSummarys";if(Rn()&&tc&&ec&&!window[Bi]){const t=document.getElementsByTagName("summary"),e=()=>{for(const n of t){const o=n.parentElement;Hi(n,"role","button"),Hi(n,"aria-expanded",`${!!o?.open}`)}};window[Bi]=nc(document,e,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})}var oc=Object.defineProperty,zi=Object.getOwnPropertySymbols,ic=Object.prototype.hasOwnProperty,rc=Object.prototype.propertyIsEnumerable,Fi=(t,e,n)=>e in t?oc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sc=(t,e)=>{for(var n in e||(e={}))ic.call(e,n)&&Fi(t,n,e[n]);if(zi)for(var n of zi(e))rc.call(e,n)&&Fi(t,n,e[n]);return t},Re=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Ie=Re(),In=Ie?navigator.userAgent:"",Oe=/android/i.test(In),ac=/firefox/i.test(In),lc=/iPad|iPhone|iPod/.test(In),Ui,cc=Ie&&/^Mac/i.test(((Ui=navigator.userAgentData)==null?void 0:Ui.platform)||navigator.platform),dc=Ie&&window.CSSStyleSheet&&document.adoptedStyleSheets,uc={once:!0,capture:!0,passive:!0},fc=":host(:not([hidden])) { display: block }",mc="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",pc=`${Oe?"data":"aria"}-multiselectable`,Vi=typeof HTMLElement>"u"?class{}:HTMLElement,E=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),On=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Me(t,...e)},Me=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},hc=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Mn("slot")),!n.querySelector("style"))if(!dc)n.append(Mn("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},gc=(t,e,n)=>{const o=new MutationObserver(r=>{if(!Re()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},De=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Wi=t=>De(t).activeElement,Kt=t=>{if(!t||!Ie)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Mn=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))E(o,i,r);return o},Gi={define:(t,e)=>!Re()||window.customElements.get(t)||window.customElements.define(t,e)},bc=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},s=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(s,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},Dn=!1,Pn=t=>(t?.type==="pointerup"&&(Dn=!1),t?.type==="pointerdown"&&(Dn=!0,On(document,"pointerup",Pn,uc)),Dn),vc=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,yc=t=>{const e=E(t,"form");E(t,"form","#"),setTimeout(wc,0,t,e)},wc=(t,e)=>E(t,"form",e),J,_c=0,ji=0,Nn=t=>{clearTimeout(ji),J||(J=Mn("div",{"aria-live":"assertive"}),J.style.overflow="hidden",J.style.position="fixed",J.style.whiteSpace="nowrap",J.style.width="1px"),J.isConnected||document.body.append(J),t===""&&(J.textContent=""),t&&(J.textContent=`${t}${_c++%2?" ":""}`,ji=setTimeout(Nn,!cc&&ac?2e3:300,""))},qn="disabled",Yt="selected",xc=class extends Vi{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return["id",qn,Yt]}connectedCallback(){Oe&&(this.tabIndex=-1),this.hasAttribute("role")||E(this,"role","option"),E(this,"aria-disabled",`${this.disabled}`),E(this,"aria-selected",`${this.selected}`),Kt(this)}attributeChangedCallback(t){this._skipAttrChange||(this._skipAttrChange=!0,t==="id"?Kt(this):E(this,`aria-${t}`,`${this[t]}`),this._skipAttrChange=!1)}get defaultSelected(){return this[Yt]}set defaultSelected(t){this[Yt]=t}get disabled(){return E(this,qn)!==null}set disabled(t){E(this,qn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=E(this,"label"))!=null?t:this.text}set label(t){E(this,"label",t)}get selected(){return E(this,Yt)!==null}set selected(t){E(this,Yt,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=E(this,"value"))!=null?t:this.text}set value(t){E(this,"value",t)}};Gi.define("u-option",xc);var Xi="data-activedescendant",Pe="aria-hidden",Hn=`${fc}
16
16
  ::slotted([role="option"]) { display: block; cursor: pointer }
17
- ::slotted([role="option"][${ts}]) { ${Tc} }
18
- ::slotted([role="option"]:is([${He}="true"], [disabled], [hidden])) { display: none !important }`,Pc=Rc(jn),Xn,es="focus click keydown",Kn="focusout input pointerdown",Ne={of:"of",plural:"%d hits",singular:"%d hit"},ns=class extends Yi{constructor(){super(),this._texts=yc({},Ne),Ac(this,jn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this._root=Pe(this),$(this,"hidden",""),$(this,"role","listbox"),$(this,"tabindex","-1"),Un(this._root,es,this,!0),this._umutate=kc(this,ss,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;this._root&&De(this._root,es,this,!0),this._root&&De(this._root,Kn,this),qe(this,null),(t=this._umutate)==null||t.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1];if(Ne[o])this._texts[o]=n||Ne[o];else if(this.id){const i=`input[list="${this.id}"]`,s=Pe(this).querySelector(i);s&&qe(this,s)}}handleEvent(t){t.defaultPrevented||(t.type==="focus"&&Qn(this,t),t.type==="focusout"&&Nc(this,t),t.type==="click"&&Bc(this,t),t.type==="input"&&ss(this),t.type==="keydown"&&Uc(this,t),t.type==="pointerdown"&&qc(this,t))}get options(){const t=!this._options&&this.querySelector('[role="option"],option');return t&&(this._options=this.getElementsByTagName(t?.nodeName)),this._options||this.getElementsByTagName("option")}},os=t=>t.disabled||t.readOnly,Yn=t=>t instanceof HTMLInputElement,Hc=t=>$(t,He)!=="true"&&t.clientHeight,Jt=(t,e)=>{t._input&&$(t._input,"aria-expanded",`${e}`),!(!t.isConnected||t.hidden!==e)&&(e||is(t),t.popover&&t.togglePopover(e),e&&setTimeout(()=>clearTimeout(Xn)),t.hidden=!e)},is=(t,e)=>{t._input&&$(t._input,"aria-activedescendant",Yt(e));for(const n of t.options)$(n,ts,n===e?"":null);e?.scrollIntoView({block:"nearest"})},qe=(t,e)=>{const n=e||t._input;n&&(t.popover&&($(t,"popover","manual"),$(n,"popovertarget",e&&Yt(t))),$(n,"aria-autocomplete",e&&"list"),$(n,"aria-controls",e&&Yt(t)),$(n,"autocomplete",e&&"off"),$(n,"enterkeyhint","done"),$(n,"role",e&&!os(n)?"combobox":null))},Qn=(t,{target:e})=>{var n,o;if(t._input!==e)if(Yn(e)&&e.getAttribute("list")===t.id){if(qe(t,null),qe(t,e),os(e))return;t._root&&Un(t._root,Kn,t),$(t,"aria-label",((o=(n=e.labels)==null?void 0:n[0])==null?void 0:o.textContent.trim())||null),Vn(),t._input=e,Oe&&Jt(t,!0)}else Jn(t)},Nc=(t,e)=>{Wn()?e.stopImmediatePropagation():Oe||setTimeout(Jn,0,t,e)},Jn=t=>{const e=Qi(t);t._input===e||t.contains(e)||(t._root&&De(t._root,Kn,t),Jt(t,!1),t._input=void 0)},qc=(t,e)=>t.contains(e.target)&&Wn(e),Bc=(t,e)=>{var n;if(Yn(e.target)&&Qn(t,e),t._input===e.target)return Jt(t,!0);if(!t.contains(e.target))return Jn(t);for(const o of t.options)if(o.contains(e.target))return(n=t._input)==null||n.focus(),t._input&&Lc(t._input,o.value),Jt(t,$(t,Cc)==="true")},Uc=(t,e)=>{if(Yn(e.target)&&Qn(t,e),t._input!==e.target)return;const{key:n,ctrlKey:o,metaKey:i,shiftKey:s,altKey:r}=e;if(o||i||s||n==="Tab"||r&&!n.startsWith("Arrow"))return;n==="Escape"&&!t.hidden&&e.preventDefault(),Jt(t,n!=="Escape");const a=n==="Enter",l=$(t._input,"aria-activedescendant"),c=[];let u=-1,d=-1;for(const m of t.options)Hc(m)&&(c.push(m),m.id===l&&(u=c.length-1));!r&&n==="ArrowDown"&&(d=(u+1)%c.length),!r&&n==="ArrowUp"&&(d=(u||c.length)-1),~u&&((n==="Home"||n==="PageUp")&&(d=0),(n==="End"||n==="PageDown")&&(d=c.length-1),a&&(d=u)),c[d]&&(e.preventDefault(),t._input.focus()),a&&c[d]?(e.stopImmediatePropagation(),Mc(t._input),c[d].click()):is(t,c[d])},ss=t=>{var e;if(!t._input||t.hidden)return;const n=t._input.value.toLowerCase().trim()||"",o=!t.hasAttribute("data-nofilter"),i=[],s=[];for(const r of t.options)(r.disabled||r.hidden||o&&!r.label.toLowerCase().includes(n)?i:s).push(r);for(const r of i)$(r,He,"true");for(const r of s)$(r,He,"false");clearTimeout(Xn),Xn=setTimeout(zc,500,t,s),_c&&s.forEach((r,a,{length:l})=>{$(r,"title",`${a+1} ${t._texts.of} ${l}`)}),(e=t._umutate)==null||e.takeRecords()},zc=(t,e)=>!t.hidden&&t._input===Qi(t)&&Vn(`${e.some(({value:n})=>n)?`${t._texts[e[1]?"plural":"singular"]}`.replace("%d",`${e.length}`):t.innerText}`);Me()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){const t=$(this,"list");return t&&Pe(this).getElementById(t)}}),Ji.define("u-datalist",ns),j()&&!Ba()&&Ua();const Fc="3.2.8",rs="_alert_14zqc_1 _ds-alert_1dsd4_3",as="_app_14zqc_1",ls="_sticky_14zqc_1",cs="_avatar_14zqc_1 _ds-avatar_1dsd4_1",ds="_badge_14zqc_1",us="_breadcrumbs_14zqc_1 _ds-breadcrumbs_1dsd4_5",fs="_button_14zqc_1 _ds-button_1dsd4_1",ms="_card_14zqc_1",ps="_group_14zqc_1",hs="_chip_14zqc_1 _ds-chip_1dsd4_5",gs="_details_14zqc_1 _ds-details_1dsd4_3",bs="_dialog_14zqc_1 _ds-dialog_1dsd4_5",vs="__drawer_14zqc_1",ys="_divider_14zqc_1",ws="_errorsummary_14zqc_1 _ds-error-summary_1dsd4_5",_s="_field_14zqc_1 _ds-field_1dsd4_1",Ss="_suggestion_14zqc_1 _ds-suggestion_1dsd4_5",xs="_affixes_14zqc_1 _ds-field-affixes_1dsd4_3",Es="_fieldset_14zqc_1 _ds-fieldset_1dsd4_3",$s="_fileupload_14zqc_1",Ts="_helptext_14zqc_1 _ds-focus_1dsd4_1",Cs="_input_14zqc_1 _ds-input_1dsd4_1",As="_law_14zqc_1",ks="_grid_14zqc_1",Ls="_flex_14zqc_1",Rs="_link_14zqc_1",Ms="_logo_14zqc_1",Is="__logo_14zqc_1",Os="_pagination_14zqc_1 _ds-pagination_1dsd4_5",Ds="_popover_14zqc_1 _ds-popover_1dsd4_3",Ps="_print_14zqc_1",Hs="_progress_14zqc_1",Ns="__indeterminate_14zqc_1",qs="_skeleton_14zqc_1 _ds-skeleton_1dsd4_5",Bs="__skeleton_14zqc_1",Us="_spinner_14zqc_1",zs="_steps_14zqc_1",Fs="_table_14zqc_1 _ds-table_1dsd4_5",Ws="__scrollShadow_14zqc_1",Vs="_tabs_14zqc_1 _ds-tabs_1dsd4_5",Gs="__scrollMask_14zqc_1",js="_tag_14zqc_1 _ds-tag_1dsd4_5",Xs="_toast_14zqc_1",Ks="__toastClose_14zqc_1",Ys="__toastOpen_14zqc_1",Qs="__toastTimeout_14zqc_1",Js="_togglegroup_14zqc_1 _ds-toggle-group_1dsd4_5",Zs="__tooltip_14zqc_1 _ds-tooltip_1dsd4_5",tr="_heading_14zqc_1 _ds-heading_1dsd4_1",er="_ingress_14zqc_1",nr="_muted_14zqc_1",or="_info_14zqc_1",ir="_prose_14zqc_1",sr="_validation_14zqc_1 _ds-validation-message_1dsd4_1",rr="_body_14zqc_162",ar="__checked_14zqc_1",T={alert:rs,app:as,sticky:ls,avatar:cs,badge:ds,breadcrumbs:us,button:fs,card:ms,group:ps,chip:hs,details:gs,dialog:bs,_drawer:vs,divider:ys,errorsummary:ws,field:_s,suggestion:Ss,affixes:xs,fieldset:Es,fileupload:$s,helptext:Ts,input:Cs,law:As,grid:ks,flex:Ls,link:Rs,logo:Ms,_logo:Is,pagination:Os,popover:Ds,print:Ps,progress:Hs,_indeterminate:Ns,skeleton:qs,_skeleton:Bs,spinner:Us,steps:zs,table:Fs,_scrollShadow:Ws,tabs:Vs,_scrollMask:Gs,tag:js,toast:Xs,_toastClose:Ks,_toastOpen:Ys,_toastTimeout:Qs,togglegroup:Js,_tooltip:Zs,heading:tr,ingress:er,muted:nr,info:or,prose:ir,validation:sr,body:rr,_checked:ar},Wc=Object.freeze(Object.defineProperty({__proto__:null,_checked:ar,_drawer:vs,_indeterminate:Ns,_logo:Is,_scrollMask:Gs,_scrollShadow:Ws,_skeleton:Bs,_toastClose:Ks,_toastOpen:Ys,_toastTimeout:Qs,_tooltip:Zs,affixes:xs,alert:rs,app:as,avatar:cs,badge:ds,body:rr,breadcrumbs:us,button:fs,card:ms,chip:hs,default:T,details:gs,dialog:bs,divider:ys,errorsummary:ws,field:_s,fieldset:Es,fileupload:$s,flex:Ls,grid:ks,group:ps,heading:tr,helptext:Ts,info:or,ingress:er,input:Cs,law:As,link:Rs,logo:Ms,muted:nr,pagination:Os,popover:Ds,print:Ps,progress:Hs,prose:ir,skeleton:qs,spinner:Us,steps:zs,sticky:ls,suggestion:Ss,table:Fs,tabs:Vs,tag:js,toast:Xs,togglegroup:Js,validation:sr},Symbol.toStringTag,{value:"Module"}));function lr(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=lr(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Vc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=lr(t))&&(o&&(o+=" "),o+=e);return o}const Zt={capture:!0,passive:!0},U=()=>typeof window<"u"&&typeof document<"u",yt=t=>U()?document.getElementsByClassName(T[t].split(" ")[0]):[];function qt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const g=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),I=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>cr(t,...e)},cr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},ut=(t,e)=>{if(!U())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?I(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Be=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return s();e(r),r.takeRecords(),o=0},s=()=>r?.disconnect?.(),r=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return r.observe(t,n),i(),s},R=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))g(o,i,s);return o},Gc=typeof HTMLElement>"u"?class{}:HTMLElement,jc=(t,e)=>!U()||window.customElements.get(t)||window.customElements.define(t,e),Xc=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,Kc=(t,e)=>{if(!Xc)return;t.shadowRoot||t.attachShadow({mode:"open"}).append(R("slot"));const n=new CSSStyleSheet;n.replaceSync(e),t.shadowRoot.adoptedStyleSheets=[n]},Yc=`[data-command="toggle-app-expanded"],.${T.app.split(" ")[0]} > [command="show-modal"]`,Qc=`.${T.breadcrumbs.split(" ")[0]}`,Jc=`.${T.card.split(" ")[0]}`,dr=`.${T.chip.split(" ")[0]}`,Zc=`.${T.helptext.split(" ")[0]}`,td=`.${T.pagination.split(" ")[0]}`,ed='summary,u-summary,a,button,[role="tab"],[role="button"]',Zn="mattilsynet.matomo.cloud",nd=["setCustomUrl","setDocumentTitle","setReferrerUrl"],W="mtds-analytics-banner",od="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function ur(t,e={}){if(U()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Zn}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:s}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&id();const r=s?`https://cdn.matomo.cloud/${Zn}/container_${s}.js`:`https://cdn.matomo.cloud/${Zn}/matomo.js`;document.querySelector(`script[src="${r}"]`)||document.head.append(R("script",{async:"",src:r}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:s}=e,r=["trackEvent",n,o,i,s];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(r.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",a])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;nd.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function id(){if(document.getElementById(W)||window.localStorage.getItem(W))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${W}" data-analytics="ignore"><style>
19
- #${W}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
20
- #${W} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
21
- #${W} button:focus-visible { outline: 2px solid }
22
- #${W} button:hover { background: #0a4e4f }
23
- #${W} button:active { background: #054449; scale: .9 }
24
- #${W} p { margin: 0 .25em }
17
+ ::slotted([role="option"][${Xi}]) { ${mc} }
18
+ ::slotted([role="option"]:is([${Pe}="true"], [disabled], [hidden])) { display: none !important }`,Sc=vc(Hn),Bn,Ki="focus click keydown",zn="focusout input pointerdown",Ne={of:"of",plural:"%d hits",singular:"%d hit"},Yi=class extends Vi{constructor(){super(),this._texts=sc({},Ne),hc(this,Hn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this._root=De(this),E(this,"hidden",""),E(this,"role","listbox"),E(this,"tabindex","-1"),On(this._root,Ki,this,!0),this._umutate=gc(this,Zi,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;this._root&&Me(this._root,Ki,this,!0),this._root&&Me(this._root,zn,this),qe(this,null),(t=this._umutate)==null||t.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1];if(Ne[o])this._texts[o]=n||Ne[o];else if(this.id){const i=`input[list="${this.id}"]`,r=De(this).querySelector(i);r&&qe(this,r)}}handleEvent(t){t.defaultPrevented||(t.type==="focus"&&Un(this,t),t.type==="focusout"&&$c(this,t),t.type==="click"&&Ac(this,t),t.type==="input"&&Zi(this),t.type==="keydown"&&Tc(this,t),t.type==="pointerdown"&&Cc(this,t))}get options(){const t=!this._options&&this.querySelector('[role="option"],option');return t&&(this._options=this.getElementsByTagName(t?.nodeName)),this._options||this.getElementsByTagName("option")}},Qi=t=>t.disabled||t.readOnly,Fn=t=>t instanceof HTMLInputElement,Ec=t=>E(t,Pe)!=="true"&&t.clientHeight,Qt=(t,e)=>{t._input&&E(t._input,"aria-expanded",`${e}`),!(!t.isConnected||t.hidden!==e)&&(e||Ji(t),t.popover&&t.togglePopover(e),e&&setTimeout(()=>clearTimeout(Bn)),t.hidden=!e)},Ji=(t,e)=>{t._input&&E(t._input,"aria-activedescendant",Kt(e));for(const n of t.options)E(n,Xi,n===e?"":null);e?.scrollIntoView({block:"nearest"})},qe=(t,e)=>{const n=e||t._input;n&&(t.popover&&(E(t,"popover","manual"),E(n,"popovertarget",e&&Kt(t))),E(n,"aria-autocomplete",e&&"list"),E(n,"aria-controls",e&&Kt(t)),E(n,"autocomplete",e&&"off"),E(n,"enterkeyhint","done"),E(n,"role",e&&!Qi(n)?"combobox":null))},Un=(t,{target:e})=>{var n,o;if(t._input!==e)if(Fn(e)&&e.getAttribute("list")===t.id){if(qe(t,null),qe(t,e),Qi(e))return;t._root&&On(t._root,zn,t),E(t,"aria-label",((o=(n=e.labels)==null?void 0:n[0])==null?void 0:o.textContent.trim())||null),Nn(),t._input=e,Oe&&Qt(t,!0)}else Vn(t)},$c=(t,e)=>{Pn()?e.stopImmediatePropagation():Oe||setTimeout(Vn,0,t,e)},Vn=t=>{const e=Wi(t);t._input===e||t.contains(e)||(t._root&&Me(t._root,zn,t),Qt(t,!1),t._input=void 0)},Cc=(t,e)=>t.contains(e.target)&&Pn(e),Ac=(t,e)=>{var n;if(Fn(e.target)&&Un(t,e),t._input===e.target)return Qt(t,!0);if(!t.contains(e.target))return Vn(t);for(const o of t.options)if(o.contains(e.target))return(n=t._input)==null||n.focus(),t._input&&bc(t._input,o.value),Qt(t,E(t,pc)==="true")},Tc=(t,e)=>{if(Fn(e.target)&&Un(t,e),t._input!==e.target)return;const{key:n,ctrlKey:o,metaKey:i,shiftKey:r,altKey:s}=e;if(o||i||r||n==="Tab"||s&&!n.startsWith("Arrow"))return;n==="Escape"&&!t.hidden&&e.preventDefault(),Qt(t,n!=="Escape");const a=n==="Enter",l=E(t._input,"aria-activedescendant"),c=[];let u=-1,d=-1;for(const m of t.options)Ec(m)&&(c.push(m),m.id===l&&(u=c.length-1));!s&&n==="ArrowDown"&&(d=(u+1)%c.length),!s&&n==="ArrowUp"&&(d=(u||c.length)-1),~u&&((n==="Home"||n==="PageUp")&&(d=0),(n==="End"||n==="PageDown")&&(d=c.length-1),a&&(d=u)),c[d]&&(e.preventDefault(),t._input.focus()),a&&c[d]?(e.stopImmediatePropagation(),yc(t._input),c[d].click()):Ji(t,c[d])},Zi=t=>{var e;if(!t._input||t.hidden)return;const n=t._input.value.toLowerCase().trim()||"",o=!t.hasAttribute("data-nofilter"),i=[],r=[];for(const s of t.options)(s.disabled||s.hidden||o&&!s.label.toLowerCase().includes(n)?i:r).push(s);for(const s of i)E(s,Pe,"true");for(const s of r)E(s,Pe,"false");clearTimeout(Bn),Bn=setTimeout(kc,500,t,r),lc&&r.forEach((s,a,{length:l})=>{E(s,"title",`${a+1} ${t._texts.of} ${l}`)}),(e=t._umutate)==null||e.takeRecords()},kc=(t,e)=>!t.hidden&&t._input===Wi(t)&&Nn(`${e.some(({value:n})=>n)?`${t._texts[e[1]?"plural":"singular"]}`.replace("%d",`${e.length}`):t.innerText}`);Re()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){const t=E(this,"list");return t&&De(this).getElementById(t)}}),Gi.define("u-datalist",Yi),G()&&!Ps()&&Ns();const Lc="3.2.9",tr="_alert_14zqc_1 _ds-alert_o04yn_1",er="_app_14zqc_1",nr="_sticky_14zqc_1",or="_avatar_14zqc_1 _ds-avatar_o04yn_1",ir="_badge_14zqc_1",rr="_breadcrumbs_14zqc_1 _ds-breadcrumbs_o04yn_3",sr="_button_14zqc_1 _ds-button_o04yn_1",ar="_card_14zqc_1",lr="_group_14zqc_1",cr="_chip_14zqc_1 _ds-chip_o04yn_3",dr="_details_14zqc_1 _ds-details_o04yn_1",ur="_dialog_14zqc_1 _ds-dialog_o04yn_3",fr="__drawer_14zqc_1",mr="_divider_14zqc_1",pr="_errorsummary_14zqc_1 _ds-error-summary_o04yn_3",hr="_field_14zqc_1 _ds-field_o04yn_1",gr="_suggestion_14zqc_1 _ds-suggestion_o04yn_3",br="_affixes_14zqc_1 _ds-field-affixes_o04yn_1",vr="_fieldset_14zqc_1 _ds-fieldset_o04yn_1",yr="_fileupload_14zqc_1",wr="_helptext_14zqc_1 _ds-focus_o04yn_1",_r="_input_14zqc_1 _ds-input_o04yn_1",xr="_law_14zqc_1",Sr="_grid_14zqc_1",Er="_flex_14zqc_1",$r="_link_14zqc_1",Cr="_logo_14zqc_1",Ar="__logo_14zqc_1",Tr="_pagination_14zqc_1 _ds-pagination_o04yn_3",kr="_popover_14zqc_1 _ds-popover_o04yn_1",Lr="_print_14zqc_1",Rr="_progress_14zqc_1",Ir="__indeterminate_14zqc_1",Or="_skeleton_14zqc_1 _ds-skeleton_o04yn_3",Mr="__skeleton_14zqc_1",Dr="_spinner_14zqc_1",Pr="_steps_14zqc_1",Nr="_table_14zqc_1 _ds-table_o04yn_3",qr="__scrollShadow_14zqc_1",Hr="_tabs_14zqc_1 _ds-tabs_o04yn_3",Br="__scrollMask_14zqc_1",zr="_tag_14zqc_1 _ds-tag_o04yn_3",Fr="_toast_14zqc_1",Ur="__toastClose_14zqc_1",Vr="__toastOpen_14zqc_1",Wr="__toastTimeout_14zqc_1",Gr="_togglegroup_14zqc_1 _ds-toggle-group_o04yn_3",jr="__tooltip_14zqc_1 _ds-tooltip_o04yn_3",Xr="_heading_14zqc_1 _ds-heading_o04yn_1",Kr="_ingress_14zqc_1",Yr="_muted_14zqc_1",Qr="_info_14zqc_1",Jr="_prose_14zqc_1",Zr="_validation_14zqc_1 _ds-validation-message_o04yn_1",ts="_body_14zqc_162",es="__checked_14zqc_1",C={alert:tr,app:er,sticky:nr,avatar:or,badge:ir,breadcrumbs:rr,button:sr,card:ar,group:lr,chip:cr,details:dr,dialog:ur,_drawer:fr,divider:mr,errorsummary:pr,field:hr,suggestion:gr,affixes:br,fieldset:vr,fileupload:yr,helptext:wr,input:_r,law:xr,grid:Sr,flex:Er,link:$r,logo:Cr,_logo:Ar,pagination:Tr,popover:kr,print:Lr,progress:Rr,_indeterminate:Ir,skeleton:Or,_skeleton:Mr,spinner:Dr,steps:Pr,table:Nr,_scrollShadow:qr,tabs:Hr,_scrollMask:Br,tag:zr,toast:Fr,_toastClose:Ur,_toastOpen:Vr,_toastTimeout:Wr,togglegroup:Gr,_tooltip:jr,heading:Xr,ingress:Kr,muted:Yr,info:Qr,prose:Jr,validation:Zr,body:ts,_checked:es},Rc=Object.freeze(Object.defineProperty({__proto__:null,_checked:es,_drawer:fr,_indeterminate:Ir,_logo:Ar,_scrollMask:Br,_scrollShadow:qr,_skeleton:Mr,_toastClose:Ur,_toastOpen:Vr,_toastTimeout:Wr,_tooltip:jr,affixes:br,alert:tr,app:er,avatar:or,badge:ir,body:ts,breadcrumbs:rr,button:sr,card:ar,chip:cr,default:C,details:dr,dialog:ur,divider:mr,errorsummary:pr,field:hr,fieldset:vr,fileupload:yr,flex:Er,grid:Sr,group:lr,heading:Xr,helptext:wr,info:Qr,ingress:Kr,input:_r,law:xr,link:$r,logo:Cr,muted:Yr,pagination:Tr,popover:kr,print:Lr,progress:Rr,prose:Jr,skeleton:Or,spinner:Dr,steps:Pr,sticky:nr,suggestion:gr,table:Nr,tabs:Hr,tag:zr,toast:Fr,togglegroup:Gr,validation:Zr},Symbol.toStringTag,{value:"Module"}));function ns(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=ns(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Ic(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=ns(t))&&(o&&(o+=" "),o+=e);return o}const Jt={capture:!0,passive:!0},B=()=>typeof window<"u"&&typeof document<"u",yt=t=>B()?document.getElementsByClassName(C[t].split(" ")[0]):[];function qt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const g=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),O=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>os(t,...e)},os=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},st=(t,e)=>{if(!B())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?O(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Zt=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(s),s.takeRecords(),o=0},r=()=>s?.disconnect?.(),s=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return s.observe(t,n),i(),r},R=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))g(o,i,r);return o},Oc=typeof HTMLElement>"u"?class{}:HTMLElement,Mc=(t,e)=>!B()||window.customElements.get(t)||window.customElements.define(t,e),Dc=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,Pc=(t,e)=>{if(!Dc)return;t.shadowRoot||t.attachShadow({mode:"open"}).append(R("slot"));const n=new CSSStyleSheet;n.replaceSync(e),t.shadowRoot.adoptedStyleSheets=[n]},Nc=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,qc=`.${C.breadcrumbs.split(" ")[0]}`,Hc=`.${C.card.split(" ")[0]}`,is=`.${C.chip.split(" ")[0]}`,Bc=`.${C.helptext.split(" ")[0]}`,zc=`.${C.pagination.split(" ")[0]}`,Fc='summary,u-summary,a,button,[role="tab"],[role="button"]',Wn="mattilsynet.matomo.cloud",Uc=["setCustomUrl","setDocumentTitle","setReferrerUrl"],V="mtds-analytics-banner",Vc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function rs(t,e={}){if(B()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Wn}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&Wc();const s=r?`https://cdn.matomo.cloud/${Wn}/container_${r}.js`:`https://cdn.matomo.cloud/${Wn}/matomo.js`;document.querySelector(`script[src="${s}"]`)||document.head.append(R("script",{async:"",src:s}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,s=["trackEvent",n,o,i,r];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(s.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",a])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;Uc.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function Wc(){if(document.getElementById(V)||window.localStorage.getItem(V))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${V}" data-analytics="ignore"><style>
19
+ #${V}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
20
+ #${V} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
21
+ #${V} button:focus-visible { outline: 2px solid }
22
+ #${V} button:hover { background: #0a4e4f }
23
+ #${V} button:active { background: #054449; scale: .9 }
24
+ #${V} p { margin: 0 .25em }
25
25
  </style>
26
- <p>Vi bruker <a href="${od}" target="_blank">informasjonskapsler</a> for å forbedre brukeropplevelsen.</p>
26
+ <p>Vi bruker <a href="${Vc}" target="_blank">informasjonskapsler</a> for å forbedre brukeropplevelsen.</p>
27
27
  <form method="dialog" data-analytics="ignore"><button type="submit" aria-label="OK">&times;</button></form>
28
- </dialog>`);const e=document.getElementById(W),n=()=>window.localStorage.setItem(W,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function sd(t){window._mtdsTracking?.enabled&&setTimeout(rd,0,t)}function rd({type:t,target:e}){const n=t==="click"?e?.closest?.(ed):e;if(!(n instanceof Element)||n.closest('[data-analytics="ignore"]'))return;let o="click",i="Button",s=fr(n)||cd(n)||g(n,"data-tooltip")||"";if(t==="submit")i="Form",o="submit",s=s||document.title;else if(t==="toggle"){if(!n.matches("dialog:modal"))return;i="Dialog",o="open"}else if(t==="change"){const r=g(n,"type"),a=r==="checkbox"||r==="radio"?n.closest("fieldset"):null;i=n.closest(dr)?"Chip":"Form",o="change",s=fr(a||n)||te(a?.querySelector("legend"))||te(n?.labels?.[0])}else if(g(n,"role")==="tab")i="Tab",o="navigate";else if(g(n,"popovertarget")){if(!ad(n)?.matches(":popover-open"))return;i=n.closest(Zc)?"HelpText":"Popover",o="open"}else if(n.nodeName.endsWith("SUMMARY")){if(!n.parentElement.open)return;i="Details",o="open"}else if(n.matches(Yc)){const r=ld(n,"--mtds-tooltip-position")==="none";i="Sidebar",o=r?"expand":"minimize",s=r&&g(n,"data-tooltip")||te(n)}else if(n.closest(Qc))i="Breadcrumbs",o="navigate";else if(n.closest(td))i="Pagination",o="navigate";else if(n.closest(Jc))i="Card",o=n instanceof HTMLAnchorElement?"navigate":"click";else if(n.closest(dr))i="Chip",o=n.hasAttribute("data-removable")?"remove":"click";else if(n.closest("th[aria-sort]"))i="Table",o="sort";else if(n instanceof HTMLAnchorElement)i="Link",o=n.protocol==="mailto:"?"email":"navigate",n.hasAttribute("download")?o="download":n.hash&&n.href.startsWith(location.href.split("#")[0])&&(o="anchor");else if(n.hasAttribute("aria-expanded")){if(g(n,"aria-expanded")!=="true")return;i="Expand",o="open"}else n.nodeName.startsWith("MTDS-ATLAS-")&&(i="Map Marker",o="open");(t==="change"||t==="submit")&&(i=n.closest("form")?.getAttribute("data-analytics-category")||i),ur("event",{category:g(n,"data-analytics-category")??i,action:g(n,"data-analytics-action")??o,name:g(n,"data-analytics-name")??s})}const te=t=>t?.textContent?.trim()||"",fr=t=>t&&g(t,"aria-label")||"",ad=t=>document.getElementById(g(t,"popovertarget")||""),ld=(t,e)=>window.getComputedStyle(t).getPropertyValue(e)?.trim(),cd=t=>{const e=te(t),n=te(t.querySelector("h1,h2,h3,h4,h5,h6"));return e.startsWith(n)&&n||e.slice(0,100).trim()};ut("analytics",()=>[I(document,"click toggle submit change",sd,Zt)]),typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const to=T.app.split(" ")[0],dd=`[data-command="toggle-app-expanded"],.${to} > [command="show-modal"]`,eo=`.${to} > dialog,.${to} dialog ~ main`,mr=yt("sticky"),pr=t=>{document.startViewTransition?document.startViewTransition(t):t()},hr=t=>pr(()=>window.mtdsToggleAppExpanded?.(t));function ud(t){const{target:e,defaultPrevented:n}=t,o=e?.closest?.("a");if(o?.closest("dialog")&&o?.closest(eo))return gr();if(n||!(e instanceof HTMLButtonElement)||!e.matches(dd))return;const i=getComputedStyle(e).position==="sticky";t.preventDefault(),i?hr():pr(()=>{const s=document.querySelector(eo);s?.setAttribute("closedby","any"),s?.showModal()})}function gr(){document.querySelector(eo)?.close()}let no=0,Bt,at=0,oo=0,Ue=0,io=!1,so=0,wt=0;function fd(){if(!mr?.length)return;const t=mr[0],e=window.scrollY,n=e<wt;wt=e,n!==Bt&&(no=(t.parentElement?.getBoundingClientRect().top||0)+wt,Bt=n,oo=t.offsetHeight,Ue=t.getBoundingClientRect().top+wt,io=t.offsetHeight<=window.innerHeight,so=window.innerHeight),!(at===-1&&io)&&(at!==-1&&(io||Bt&&wt<=Ue)?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top","0px"),at=-1):at===-1&&!Bt?(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Math.max(0,wt-no)}px`),at=0):at!==1&&!Bt&&wt+so>=Ue+oo?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top",`${so-oo}px`),at=1):at===1&&Bt&&(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Ue-no}px`),at=0))}ut("app",()=>[I(document,"click",ud,!0),I(window,"resize",qt(gr,100),Zt),I(window,"scroll",fd,Zt)]);const md=/<[^>]+\bid="([^"]+)[^>]+>/gi,br=/\([^)]{1,4}\).{1,9}\d+\/\d+/i,pd=/<(h\d|[^>]+role="heading")[^>]*>(.*?)<\/?(h\d|br|div)/i,hd=/kapittel-\d+-ledd-\d+/,gd=/<button[^>]+>.*?<\/button>/g,bd=/►m\d+/i,ze=/<[^>]+>/g,vd=/<dt([^>]*class="([^"]+)")?[^>]*>(.*?)<\/dt><dd[^>]*>(.*?)<\/dd>/gis,yd=/<(\/?)(article|footer|section)/gi,wd=/(src|href)="([^"]+)"/gi,_d=/(<li[^>]*)>\s*<div([^>]*>)|<\/div>(<\/li>)/gi,Sd=/(<li[^>]+data-name="([^"]+)[^>]+>)(\s*<(ul|ol|div)[^>]+>)/gis,xd=/(<[^>]+class="[^"]*\bnumberedLegalP\b[^>]+>\s*)(\d+\.)(.*?)(?=<\/?(ul|ol|div)|$)/gis,vr="https://lovdata.no/",Ed="https://www.mattilsynet.no/regelveiledning/?regelverk=",$d={dokid:{label:"DokumentID",value:""},legacyid:{label:"Datokode",value:""},refid:{label:"RefID",value:""},title:{label:"Tittel",value:""},titleshort:{label:"Korttittel",value:""},url:{label:"Url",value:""}},ro=t=>Array.from(Array.isArray(t)?t:[t],e=>e instanceof HTMLButtonElement?e.value:e),Td=t=>Array.from(t?.querySelectorAll('button[aria-checked="true"]')||[],e=>e.value),Cd=(t,e)=>{const n=ro(t);e?.querySelectorAll("button").forEach(o=>{n.includes(o.value)&&g(o,"aria-checked",`${g(o,"aria-checked")!=="true"}`)})},Ad=(t,e)=>{const n=ro(t);e?.querySelectorAll("button").forEach(o=>{g(o,"aria-checked",`${n.includes(o.value)||!1}`)})},kd=(t,e)=>{const n=yr(e);return ro(t).map(o=>Rd(o,n)).filter(o=>!!o)},Ld=t=>{const e=t.slice(0,t.indexOf("</dl>")),n={...$d};for(const o of e.matchAll(vd)){const i=o[2].replace(/-/g,"").toLowerCase();n[i]={label:o[3],value:o[4]}}return n},yr=t=>t.includes("<main")?(t.split(/<\/?main[^>]*>/)[1]||"").replace(yd,"<$1div").replace(_d,"$1$2$3").replace(wd,(e,n,o)=>`${n}="${o.includes(":")?"":vr}${o}" ${n==="href"?'rel="noopener noreferrer" target="_blank"':""}`).replace(xd,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span><div class="legalP" id="${_t("id",n)}-ledd-0">${i}</div>`).replace(Sd,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span>${i}`).replace(md,(e,n,o,i)=>{const s=wr(e,n,o,i);return`${e}${s?`<button type="button" role="checkbox" aria-label="${s}" value="${n}"></button>`:""}`}):t,Rd=(t,e)=>{const n=hd.test(t),o=t.split("-").map((c,u,d)=>u%2?Md(d.slice(0,u+1).join("-"),e,n):null).filter(c=>!!c);if(!o.length)return null;const i=o.filter(({guideUrl:c})=>c).pop()?.guideUrl,s=o.filter(({url:c})=>c).pop(),r=o.filter(c=>c.className==="section"&&br.test(c.label)).pop(),a=s?`${vr}${s.url}`:"",l=o.slice(o.indexOf(r||o[0])).map(({label:c})=>c).join(", ");return{...o.slice(-1)[0],path:o,label:l,url:a,guideUrl:i}},Md=(t,e,n)=>{const o=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),i=e.slice(o,e.indexOf(">",o)+1),s=_t("class",i),r=_t("data-lovdata-url",i),a=wr(i,t,o,e),[l,c,u]=r.match(/(lov|forskrift)\/([^/]+)/)||[],d=`${c?.slice(0,3).toUpperCase()}-${u}`;return{id:t,className:s,guideUrl:r&&`${Ed}${d}_${t}`,html:Id(t,e),url:r,label:!n&&s==="section"&&a?.match(br)?.[0]||a}},_t=(t,e)=>{const n=` ${t.toLowerCase()}="`,o=e.toLowerCase().indexOf(n),i=o+n.length;return o===-1?"":e.slice(i,e.indexOf('"',i))},Id=(t,e)=>{const n=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),o=e.length;let i=n+1,s=0;for(;i&&i<o;)if(i=e.indexOf("<",i)+1,e[i]!=="/")s++;else if(--s<0)break;const r=e.indexOf(">",i)+1;return i?e.slice(n,r).replace(gd,""):""},wr=(t,e,n,o)=>Od[_t("class",t)]?.(t,e,n,o)||"",Od={numberedLegalP:t=>`nr. ${_t("data-numerator",t)}.`,section:(t,e,n,o)=>o.slice(n).match(pd)?.[2]?.replace(ze,"")?.replace(bd,"").trim()||"",legalArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("legalArticleValue",n));return o.slice(i+1,o.indexOf("</span>",i)).replace(ze,"").replace("Artikkel","artikkel")},legalP:(t,e)=>{const[n,o,i,s]=e.split("-").reverse();return`avsnitt ${(o==="nummer"?1:Number(n))+(s==="nummer"?1:0)}`},listArticle:(t,e,n,o)=>{const i=e.split("-"),s=` id="${i.slice(0,-2).join("-")}"`,r=o.lastIndexOf(s,n),a=o.slice(o.indexOf("<ol",r),n),l=_t("data-name",t)||"-",c=_t("type",a)||"-";let u="punkt";return c==="1"&&(u="tall"),c==="a"&&(u="bokstav"),c==="i"&&(u="romtertall"),`${u} ${l==="-"?i.pop():l.replace(ze,"")}`},marginIdArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("data-marginOriginalId",n));return`nr. ${o.slice(i+1,o.indexOf("</span>",i)).replace(ze,"")}`}};function D(t,e={}){const n=document.getElementById(e.id||"")||R("dialog");return g(n,"aria-busy",e.busy?"true":null),g(n,"class",Vc(T.toast,e.className)),g(n,"closedby",e.closedby||null),g(n,"data-color",e.color||null),g(n,"data-icon",`${e.icon??""}`||null),g(n,"data-timeout",`${e.timeout??""}`||null),g(n,"id",e.id||`${Date.now()}`),g(n,"open",e.open===!1?null:""),n.innerHTML=t,I(n,"animationend",Dd,{once:!0}),document.body.appendChild(n),n.id}function Dd({animationName:t,target:e}){t===T._toastClose&&e.remove()}D.success=(t,e)=>D(t,{color:"success",...e}),D.danger=(t,e)=>D(t,{color:"danger",...e}),D.info=(t,e)=>D(t,{color:"info",...e}),D.warning=(t,e)=>D(t,{color:"warning",...e}),D.neutral=(t,e)=>D(t,{color:"neutral",...e}),D.promise=async function(e,n){const{loading:o,success:i,error:s,...r}=n,a=D(o,{busy:!0,...r});try{const l=await e();return D.success(i,{id:a,busy:!1}),l}catch(l){throw D.danger(s,{id:a,busy:!1}),l}};const Pd=`/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
28
+ </dialog>`);const e=document.getElementById(V),n=()=>window.localStorage.setItem(V,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function Gc(t){window._mtdsTracking?.enabled&&setTimeout(jc,0,t)}function jc({type:t,target:e}){const n=t==="click"?e?.closest?.(Fc):e;if(!(n instanceof Element)||n.closest('[data-analytics="ignore"]'))return;let o="click",i="Button",r=ss(n)||Yc(n)||g(n,"data-tooltip")||"";if(t==="submit")i="Form",o="submit",r=r||document.title;else if(t==="toggle"){if(!n.matches("dialog:modal"))return;i="Dialog",o="open"}else if(t==="change"){const s=g(n,"type"),a=s==="checkbox"||s==="radio"?n.closest("fieldset"):null;i=n.closest(is)?"Chip":"Form",o="change",r=ss(a||n)||te(a?.querySelector("legend"))||te(n?.labels?.[0])}else if(g(n,"role")==="tab")i="Tab",o="navigate";else if(g(n,"popovertarget")){if(!Xc(n)?.matches(":popover-open"))return;i=n.closest(Bc)?"HelpText":"Popover",o="open"}else if(n.nodeName.endsWith("SUMMARY")){if(!n.parentElement.open)return;i="Details",o="open"}else if(n.matches(Nc)){const s=Kc(n,"--mtds-tooltip-position")==="none";i="Sidebar",o=s?"expand":"minimize",r=s&&g(n,"data-tooltip")||te(n)}else if(n.closest(qc))i="Breadcrumbs",o="navigate";else if(n.closest(zc))i="Pagination",o="navigate";else if(n.closest(Hc))i="Card",o=n instanceof HTMLAnchorElement?"navigate":"click";else if(n.closest(is))i="Chip",o=n.hasAttribute("data-removable")?"remove":"click";else if(n.closest("th[aria-sort]"))i="Table",o="sort";else if(n instanceof HTMLAnchorElement)i="Link",o=n.protocol==="mailto:"?"email":"navigate",n.hasAttribute("download")?o="download":n.hash&&n.href.startsWith(location.href.split("#")[0])&&(o="anchor");else if(n.hasAttribute("aria-expanded")){if(g(n,"aria-expanded")!=="true")return;i="Expand",o="open"}else n.nodeName.startsWith("MTDS-ATLAS-")&&(i="Map Marker",o="open");(t==="change"||t==="submit")&&(i=n.closest("form")?.getAttribute("data-analytics-category")||i),rs("event",{category:g(n,"data-analytics-category")??i,action:g(n,"data-analytics-action")??o,name:g(n,"data-analytics-name")??r})}const te=t=>t?.textContent?.trim()||"",ss=t=>t&&g(t,"aria-label")||"",Xc=t=>document.getElementById(g(t,"popovertarget")||""),Kc=(t,e)=>window.getComputedStyle(t).getPropertyValue(e)?.trim(),Yc=t=>{const e=te(t),n=te(t.querySelector("h1,h2,h3,h4,h5,h6"));return e.startsWith(n)&&n||e.slice(0,100).trim()};st("analytics",()=>[O(document,"click toggle submit change",Gc,Jt)]),typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const Gn=C.app.split(" ")[0],Qc=`[data-command="toggle-app-expanded"],.${Gn} > [command="show-modal"]`,jn=`.${Gn} > dialog,.${Gn} dialog ~ main`,as=yt("sticky"),ls=t=>{document.startViewTransition?document.startViewTransition(t):t()},cs=t=>ls(()=>window.mtdsToggleAppExpanded?.(t));function Jc(t){const{target:e,defaultPrevented:n}=t,o=e?.closest?.("a");if(o?.closest("dialog")&&o?.closest(jn))return ds();if(n||!(e instanceof HTMLButtonElement)||!e.matches(Qc))return;const i=getComputedStyle(e).position==="sticky";t.preventDefault(),i?cs():ls(()=>{const r=document.querySelector(jn);r?.setAttribute("closedby","any"),r?.showModal()})}function ds(){document.querySelector(jn)?.close()}let Xn=0,Ht,at=0,Kn=0,He=0,Yn=!1,Qn=0,wt=0;function Zc(){if(!as?.length)return;const t=as[0],e=window.scrollY,n=e<wt;wt=e,n!==Ht&&(Xn=(t.parentElement?.getBoundingClientRect().top||0)+wt,Ht=n,Kn=t.offsetHeight,He=t.getBoundingClientRect().top+wt,Yn=t.offsetHeight<=window.innerHeight,Qn=window.innerHeight),!(at===-1&&Yn)&&(at!==-1&&(Yn||Ht&&wt<=He)?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top","0px"),at=-1):at===-1&&!Ht?(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Math.max(0,wt-Xn)}px`),at=0):at!==1&&!Ht&&wt+Qn>=He+Kn?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top",`${Qn-Kn}px`),at=1):at===1&&Ht&&(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${He-Xn}px`),at=0))}st("app",()=>[O(document,"click",Jc,!0),O(window,"resize",qt(ds,100),Jt),O(window,"scroll",Zc,Jt)]);const td=/<[^>]+\bid="([^"]+)[^>]+>/gi,us=/\([^)]{1,4}\).{1,9}\d+\/\d+/i,ed=/<(h\d|[^>]+role="heading")[^>]*>(.*?)<\/?(h\d|br|div)/i,nd=/kapittel-\d+-ledd-\d+/,od=/<button[^>]+>.*?<\/button>/g,id=/►m\d+/i,Be=/<[^>]+>/g,rd=/<dt([^>]*class="([^"]+)")?[^>]*>(.*?)<\/dt><dd[^>]*>(.*?)<\/dd>/gis,sd=/<(\/?)(article|footer|section)/gi,ad=/(src|href)="([^"]+)"/gi,ld=/(<li[^>]*)>\s*<div([^>]*>)|<\/div>(<\/li>)/gi,cd=/(<li[^>]+data-name="([^"]+)[^>]+>)(\s*<(ul|ol|div)[^>]+>)/gis,dd=/(<[^>]+class="[^"]*\bnumberedLegalP\b[^>]+>\s*)(\d+\.)(.*?)(?=<\/?(ul|ol|div)|$)/gis,fs="https://lovdata.no/",ud="https://www.mattilsynet.no/regelveiledning/?regelverk=",fd={dokid:{label:"DokumentID",value:""},legacyid:{label:"Datokode",value:""},refid:{label:"RefID",value:""},title:{label:"Tittel",value:""},titleshort:{label:"Korttittel",value:""},url:{label:"Url",value:""}},Jn=t=>Array.from(Array.isArray(t)?t:[t],e=>e instanceof HTMLButtonElement?e.value:e),md=t=>Array.from(t?.querySelectorAll('button[aria-checked="true"]')||[],e=>e.value),pd=(t,e)=>{const n=Jn(t);e?.querySelectorAll("button").forEach(o=>{n.includes(o.value)&&g(o,"aria-checked",`${g(o,"aria-checked")!=="true"}`)})},hd=(t,e)=>{const n=Jn(t);e?.querySelectorAll("button").forEach(o=>{g(o,"aria-checked",`${n.includes(o.value)||!1}`)})},gd=(t,e)=>{const n=ms(e);return Jn(t).map(o=>vd(o,n)).filter(o=>!!o)},bd=t=>{const e=t.slice(0,t.indexOf("</dl>")),n={...fd};for(const o of e.matchAll(rd)){const i=o[2].replace(/-/g,"").toLowerCase();n[i]={label:o[3],value:o[4]}}return n},ms=t=>t.includes("<main")?(t.split(/<\/?main[^>]*>/)[1]||"").replace(sd,"<$1div").replace(ld,"$1$2$3").replace(ad,(e,n,o)=>`${n}="${o.includes(":")?"":fs}${o}" ${n==="href"?'rel="noopener noreferrer" target="_blank"':""}`).replace(dd,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span><div class="legalP" id="${_t("id",n)}-ledd-0">${i}</div>`).replace(cd,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span>${i}`).replace(td,(e,n,o,i)=>{const r=ps(e,n,o,i);return`${e}${r?`<button type="button" role="checkbox" aria-label="${r}" value="${n}"></button>`:""}`}):t,vd=(t,e)=>{const n=nd.test(t),o=t.split("-").map((c,u,d)=>u%2?yd(d.slice(0,u+1).join("-"),e,n):null).filter(c=>!!c);if(!o.length)return null;const i=o.filter(({guideUrl:c})=>c).pop()?.guideUrl,r=o.filter(({url:c})=>c).pop(),s=o.filter(c=>c.className==="section"&&us.test(c.label)).pop(),a=r?`${fs}${r.url}`:"",l=o.slice(o.indexOf(s||o[0])).map(({label:c})=>c).join(", ");return{...o.slice(-1)[0],path:o,label:l,url:a,guideUrl:i}},yd=(t,e,n)=>{const o=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),i=e.slice(o,e.indexOf(">",o)+1),r=_t("class",i),s=_t("data-lovdata-url",i),a=ps(i,t,o,e),[l,c,u]=s.match(/(lov|forskrift)\/([^/]+)/)||[],d=`${c?.slice(0,3).toUpperCase()}-${u}`;return{id:t,className:r,guideUrl:s&&`${ud}${d}_${t}`,html:wd(t,e),url:s,label:!n&&r==="section"&&a?.match(us)?.[0]||a}},_t=(t,e)=>{const n=` ${t.toLowerCase()}="`,o=e.toLowerCase().indexOf(n),i=o+n.length;return o===-1?"":e.slice(i,e.indexOf('"',i))},wd=(t,e)=>{const n=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),o=e.length;let i=n+1,r=0;for(;i&&i<o;)if(i=e.indexOf("<",i)+1,e[i]!=="/")r++;else if(--r<0)break;const s=e.indexOf(">",i)+1;return i?e.slice(n,s).replace(od,""):""},ps=(t,e,n,o)=>_d[_t("class",t)]?.(t,e,n,o)||"",_d={numberedLegalP:t=>`nr. ${_t("data-numerator",t)}.`,section:(t,e,n,o)=>o.slice(n).match(ed)?.[2]?.replace(Be,"")?.replace(id,"").trim()||"",legalArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("legalArticleValue",n));return o.slice(i+1,o.indexOf("</span>",i)).replace(Be,"").replace("Artikkel","artikkel")},legalP:(t,e)=>{const[n,o,i,r]=e.split("-").reverse();return`avsnitt ${(o==="nummer"?1:Number(n))+(r==="nummer"?1:0)}`},listArticle:(t,e,n,o)=>{const i=e.split("-"),r=` id="${i.slice(0,-2).join("-")}"`,s=o.lastIndexOf(r,n),a=o.slice(o.indexOf("<ol",s),n),l=_t("data-name",t)||"-",c=_t("type",a)||"-";let u="punkt";return c==="1"&&(u="tall"),c==="a"&&(u="bokstav"),c==="i"&&(u="romtertall"),`${u} ${l==="-"?i.pop():l.replace(Be,"")}`},marginIdArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("data-marginOriginalId",n));return`nr. ${o.slice(i+1,o.indexOf("</span>",i)).replace(Be,"")}`}};function D(t,e={}){const n=document.getElementById(e.id||"")||R("dialog");return g(n,"aria-busy",e.busy?"true":null),g(n,"class",Ic(C.toast,e.className)),g(n,"closedby",e.closedby||null),g(n,"data-color",e.color||null),g(n,"data-icon",`${e.icon??""}`||null),g(n,"data-timeout",`${e.timeout??""}`||null),g(n,"id",e.id||`${Date.now()}`),g(n,"open",e.open===!1?null:""),n.innerHTML=t,O(n,"animationend",xd,{once:!0}),document.body.appendChild(n),n.id}function xd({animationName:t,target:e}){t===C._toastClose&&e.remove()}D.success=(t,e)=>D(t,{color:"success",...e}),D.danger=(t,e)=>D(t,{color:"danger",...e}),D.info=(t,e)=>D(t,{color:"info",...e}),D.warning=(t,e)=>D(t,{color:"warning",...e}),D.neutral=(t,e)=>D(t,{color:"neutral",...e}),D.promise=async function(e,n){const{loading:o,success:i,error:r,...s}=n,a=D(o,{busy:!0,...s});try{const l=await e();return D.success(i,{id:a,busy:!1}),l}catch(l){throw D.danger(r,{id:a,busy:!1}),l}};const Sd=`/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
29
29
  :host(:not([hidden])) { display: grid; gap: var(--mtds-6) }
30
30
  [data-event] { cursor: pointer } /* Used to forward clicks from Chart ShaowDOM to relevant cell in child table */
31
31
 
@@ -192,8 +192,4 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
192
192
  vertical-align: middle;
193
193
  width: var(--mtds-5);
194
194
  }
195
- `,Hd=[.1,.2,.25,.5,1];function Nd(t,{aspect:e,type:n}){const i=n==="stacked",s=t[0].reduce((f,p,b)=>{const y=t.map(w=>w[b].number),_=y.reduce((w,x)=>w+x,0);return Math.max(f,...i?[_]:y)},0),r=s/10,a=10**`${Math.round(r)}`.length,l=r/a,c=(Hd.find(f=>f>l)||1)*a,u=Math.ceil(s/c)*c,d=R("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure"});e&&d.style.setProperty("--mtdsc-chart-aspect",e),d.style.setProperty("--bars",`${t[0]?.length-1}`),d.style.setProperty("--groups",`${t.length-1}`),d.style.setProperty("--total",`${u}`);const m=d.appendChild(R("div",{class:"axisSteps"})),h=d.appendChild(R("div",{class:"axisGroups"}));return Array.from({length:u/c+1},(f,p)=>qd(c*p)).reverse().map(f=>m.append(R("div",{class:"axisStep","data-label":f}))),{total:u,groups:h,axis:d}}const qd=new Intl.NumberFormat().format;function Bd(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=R("div",{class:"axisGroup","data-label":e}),s=i.appendChild(R("div",{class:"axisGroupContent"}));return t.slice(1).map(r=>r[o+1]).map(({tooltip:r,color:a,number:l})=>{const c=R("div",{"aria-label":r,"data-event":n,class:"bar",role:"img",tabindex:"0"});return c.style.setProperty("--color",a),c.style.setProperty("--value",`${l}`),s.appendChild(c)}),i})}function Ud(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,s=R("div",{class:"axisGroup"});return t.slice(1).forEach(([,...r])=>{const a=R("div",{class:"lineContainer",role:"list"});a.style.setProperty("--color",r[0].color);const l=zd(r.map(({number:d},m,{length:h})=>[100/(h-1)*m,100-d/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");g(c,"aria-hidden","true"),g(c,"preserveAspectRatio","none"),g(c,"viewBox","0 0 100 100");const u=document.createElementNS("http://www.w3.org/2000/svg","path");if(g(u,"class","line"),g(u,"d",l),g(u,"fill","none"),g(u,"stroke","currentColor"),o==="area"){const d=u.cloneNode(!0);g(d,"d",`M-100,100 L${l.slice(1)}L200,100`),g(d,"class","lineShade"),c.append(d)}r.forEach(({number:d,tooltip:m,event:h})=>{const f=R("div",{role:"listitem"}),p=R("div",{"aria-label":m,"data-event":h,tabindex:"0",class:"linePoint",role:"img"});p.style.setProperty("--value",`${d}`),f.appendChild(p),a.append(f)}),a.appendChild(c).append(u),s.append(a)}),s}const zd=(t,e)=>t.map(([n,o],i,s)=>i?Fd(i,s,e):`M${n},${o}`).join(" "),_r=([t,e],[n,o])=>[t+n,e+o],Sr=([t,e],[n,o])=>[t-n,e-o],xr=(t,[e,n])=>[t*e,t*n],Fd=(t,e,n)=>{const o=e[t-1],i=e[t],[s,r]=_r(o,xr(n,Sr(i,e[t-2]||o))),[a,l]=_r(i,xr(n,Sr(o,e[t+1]||i)));return`C ${s},${r} ${a},${l} ${i[0]},${i[1]}`};function Wd(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),g(o,"class","pie"),g(o,"viewBox","0 0 100 100");let i=0;const s=50,r=n==="doughnut"?25:0,a=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:u,color:d}])=>{if(!c)return;const m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=i/a;i+=c;const f=Math.min(i/a,.99999),p=f-h>.5?1:0,b=2*Math.PI*(h-.25),y=2*Math.PI*(f-.25),_=Math.cos(b),w=Math.sin(b),x=Math.cos(y),C=Math.sin(y),k=`M ${s+r*_} ${s+r*w} L ${s+s*_} ${s+s*w} A ${s} ${s} 0 ${p} 1 ${s+s*x} ${s+s*C} L ${s+r*x} ${s+r*C} A ${r} ${r} 0 ${p} 0 ${s+r*_} ${s+r*w}`;m.style.setProperty("--color",d),g(m,"aria-label",l),g(m,"data-event",u),g(m,"d",k),g(m,"role","img"),g(m,"tabindex","0"),o.appendChild(m)}),o}const Er="click keydown mousemove mouseout",$r="mtds-chart-tooltip",ft=U()?document.getElementById($r)||R("div",{"aria-hidden":"true",class:T._tooltip,hidden:"",id:$r}):null;class Vd extends Gc{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=qt(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=Be(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),I(this,Er,this)}disconnectedCallback(){ft&&(ft.hidden=!0),cr(this,Er,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=Xd(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(c=>c.remove());const[n,o]=(g(this,"data-variant")||"column").split("-"),i=g(this,"data-aspect")||void 0,s=R("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:c,color:u}])=>{const d=R("div",{class:"legend"},c);s.appendChild(d).style.setProperty("--color",u)});const{axis:r,groups:a,total:l}=Nd(e,{aspect:i,type:o});(n==="column"||n==="bar")&&a.append(...Bd(e)),(n==="line"||n==="area")&&a.append(Ud(e,{total:l,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(Wd(e,{aspect:i,variant:n})),this.shadowRoot?.append(r,s),Kc(this,Pd)}handleEvent(e){e.type==="click"||e.type==="keydown"?Gd(e,this):jd(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function Gd(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,s]=n instanceof Element&&g(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[s]?.querySelector("a,button")?.click?.()}let Tr="";function jd(t){if(!ft)return;ft?.isConnected||document.body.append(ft);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(ft.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==Tr&&(n&&(ft.textContent=n),Tr=n,ft.hidden=!n)}const ao=t=>t?.textContent?.trim()||"",Xd=t=>Array.from(t?.rows||[]).map((e,n,{length:o})=>Array.from(e.cells,(i,s)=>{const r=ao(e.cells[0]),a=ao(t?.rows[0].cells[s]),l=ao(i),c=o===2?`${a}: ${l}`:`${r}: ${l}${a?` (${a})`:""}`;return g(i,"tabindex","-1"),{number:s&&n&&Number.parseFloat(l)||0,event:i.querySelector("a,button")&&`${n}-${s}`,color:`var(--mtdsc-chart-color-${n}-${s}, var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base)))`,value:l,tooltip:g(i,"data-tooltip")||c}}));jc("mtds-chart",Vd);const Cr=new WeakSet,P=t=>!Cr.has(t)&&Cr.add(t),O=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),Kd=yt("togglegroup"),Ar=T.button.split(" "),Yd=()=>{for(const t of Kd){P(t)&&!t.hasAttribute("data-toggle-group")&&(g(t,"data-toggle-group","Valgknapper"),O('Only setting class="styles.togglegroup"','data-toggle-group="LABEL-HERE" attribute also for better accessibility',t));for(const e of t.getElementsByTagName("label"))P(e)&&!e.classList.contains(Ar[0])&&(e.classList.add(...Ar),O('Only setting class="styles.button"','<label class="styles.button">',e))}},Qd=yt("breadcrumbs"),Jd=()=>{for(const t of Qd)P(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...T.breadcrumbs.split(" ")),O('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},Zd=yt("errorsummary"),tu=()=>{for(const t of Zd)P(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&O('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},eu=yt("dialog"),kr=()=>{for(const t of eu){if(P(t)){const e=g(t,"data-closedby");e&&(g(t,"closedby",e),O(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.hasAttribute("data-variant")&&O('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t)}t.isConnected&&t.showModal&&t.close&&(t.matches('[open][data-modal]:not([data-modal="false"]):not(:modal)')?(O('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),g(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(g(t,"open",""),t.close()))}},nu=()=>{for(const t of document.querySelectorAll("[data-count]"))if(P(t)){const e=g(t,"data-count");t.classList.add(...T.validation.split(" ")),g(t,"data-limit",e),O(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},ou=()=>{for(const t of document.querySelectorAll("[data-command]"))if(P(t)){const e=g(t,"data-command");e==="row"?O(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):O(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},iu=U()?document.getElementsByTagName("u-tabs"):[],su=()=>{for(const t of iu)P(t)&&O("u-tabs","ds-tabs",t)},lo=T.suggestion.split(" "),ru=U()?document.getElementsByTagName("u-combobox"):[],au=U()?document.getElementsByTagName("ds-suggestion"):[],lu=()=>{for(const t of ru)P(t)&&(t.classList.add(...lo),O("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of au)P(t)&&!t.classList.contains(lo[0])&&(t.classList.add(...lo),O("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},cu=({target:t})=>{if(!(t instanceof Element))return;const e=t?.closest("tr")?.querySelector('[data-command="row"]');e&&!t?.closest('a,button,label,input,select,textarea,[role="button"]')&&e.click();const o=t?.closest("dialog");o&&t?.closest('[data-command="close"]')&&o.close()},du=yt("field"),Fe=new Set,uu=()=>{for(const t of du)t.nodeName!=="DS-FIELD"&&(P(t)||O('Only setting class="styles.field"','<ds-field class="styles.field">',t),!Fe.has(t)&&Fe.add(t)&&ke.prototype.connectedCallback.call(t))},fu=()=>{for(const t of Fe)ke.prototype.disconnectedCallback.call(t),Fe.delete(t)},mu=`[data-description], .${T.field.split(" ")[0]} label + p`,pu=()=>{for(const t of document.querySelectorAll(mu))P(t)&&t.getAttribute("data-field")!=="description"&&(g(t,"data-field","description"),O("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},hu=yt("validation"),gu=()=>{for(const t of hu)P(t)&&!t.hasAttribute("data-field")&&(g(t,"data-field","validation"),O('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},bu=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))P(t)&&(g(t,"data-placement",g(t,"data-position")),O("data-position","data-placement",t))},vu=qt(()=>{U()&&(nu(),ou(),Jd(),kr(),tu(),pu(),gu(),bu(),uu(),Yd(),lu(),su())},200);ut("deprecations",()=>[fu,I(document,"click",cu,Zt),I(document,"toggle",kr,!0),Be(document,vu,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const yu=qt(t=>{if(t.animationName!==T._logo)return;const e=t.target.closest?.(`.${T.logo.split(" ")[0]}`),n=e?.firstElementChild;if(n instanceof SVGSVGElement){for(const l of document.head.querySelectorAll("link[rel~='icon']"))l.setAttribute("rel","disabled");const o=e?.hasAttribute("data-env"),i=window.getComputedStyle(n),s=i.getPropertyValue("color"),r=i.getPropertyValue("--mtdsc-logo-background"),a=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${s}"`);document.head.appendChild(R("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":r}' width='51' height='51' x='2' y='2' stroke='${s}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${a}</g></svg>`)}`,rel:"icon"}))}},200);ut("logo",()=>[I(document,"animationend",yu)]);const wu=T.popover.split(" ")[0];function _u({target:t}){const e=t?.closest?.('a,button,[role="button"]'),n=e instanceof HTMLButtonElement,o=e&&g(e,"popovertarget"),i=o?document.getElementById(o):e?.closest("[popover]");if(!(o&&n)&&i?.classList.contains(wu)&&e){const s=g(e,"popovertargetaction"),r=s==="show"||(s==="hide"?!1:void 0);if(n&&!s&&i.contains(e))return;i instanceof HTMLElement&&i.popover&&i.togglePopover(r)}}ut("popover",()=>[I(document,"click",_u)]);const Su=U()?document.getElementsByTagName("table"):[],xu=()=>{for(const t of Su){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>n.innerText.trim());for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)g(i,"data-th",e[i.cellIndex]||":empty")}};ut("table",()=>[Be(document,qt(xu,200),{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const Lr=T.toast.split(" ")[0],We="data-sort";function Eu({animationName:t,target:e}){const n=e;if(t===T._toastTimeout&&n.close(),t!==T._toastOpen)return;const o=Number(g(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(We)||g(n,We,`${Date.now()}`),g(n,"tabindex","0"),[...document.querySelectorAll(`.${Lr}[open]`)].sort((i,s)=>Number(g(s,We))-Number(g(i,We))).reduce((i,s)=>(s.style.translate=`0 ${s===e?0:i}px`,i+s.offsetHeight+5),0)}function $u({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(Lr)&&g(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),s=window.getComputedStyle(t,"::after"),r=o.top+Number.parseInt(i.paddingTop,10),a=r+Number.parseInt(s.height,10),l=o.right-Number.parseInt(i.paddingRight,10),c=l-Number.parseInt(s.width,10);r<=n&&n<=a&&c<=e&&e<=l&&t.close()}}ut("toast",()=>[I(document,"animationstart",Eu),I(document,"click",$u)]),U()&&wi(document.getElementById("mtds-tooltip")||R("div",{class:T._tooltip,id:"mtds-tooltip",popover:"manual"}));const co=`.${T.field.split(" ")[0]}`,Tu=`${co} :is(input,textarea,select)`,Cu="ds-suggestion,u-combobox",Au=T.validation.split(" ")[0],Ve=t=>t instanceof HTMLFormElement&&g(t,"data-validation")==="form",uo=t=>t.closest(co),fo=t=>t?.querySelectorAll(Tu)||[],Ge=t=>t?.getElementsByClassName(Au)||[],Rr=t=>{const e=!t.clientHeight||t.disabled||t.readOnly||g(t,"aria-readonly")==="true"||g(t,"aria-disabled")==="true",n=t.closest(Cu)?.items,o=g(t,"aria-required")!=="true"||!!n?.length;return n&&t.setCustomValidity(e||o?"":"Required"),e?!1:t.matches(":user-invalid")},Mr=t=>{const e=t.target?.form||t.target;let n;if(Ve(e)){for(const o of e.querySelectorAll(co)){const i=[...fo(o)].find(Rr);!n&&i&&(n=i);for(const s of Ge(o))g(s,"hidden",i?null:"")}for(const o of e.querySelectorAll("fieldset")){const i=[...fo(o)].some(Rr);for(const s of Ge(o))uo(s)||g(s,"hidden",i?null:"")}n&&(t.preventDefault(),n.focus())}},ku=({target:t})=>{const e=t;if(Ve(e.form))for(const n of Ge(e.closest("fieldset")||uo(e)))g(n,"hidden","")},Lu=t=>Ve(t.target.form)&&t?.preventDefault(),Ru=U()?Ge(document):[],Mu=()=>{for(const t of Ru)if(!t.hasAttribute("data-validation")){const e=fo(uo(t))[0];g(t,"data-validation","form"),Ve(e?.form)&&g(t,"hidden","")}};ut("validations",()=>[I(document,"input comboboxbeforeselect",ku,!0),I(document,"invalid",Lu,!0),I(document,"invalid",qt(Mr,10),Zt),I(document,"submit",Mr,!0),Be(document,Mu,{childList:!0,subtree:!0})]);var Ir=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",je=Ir(),Iu=je?navigator.userAgent:"",Or=/iPad|iPhone|iPod/.test(Iu),Dr;je&&/^Mac/i.test(((Dr=navigator.userAgentData)==null?void 0:Dr.platform)||navigator.platform);var Ou=je&&window.CSSStyleSheet&&document.adoptedStyleSheets,Du=typeof HTMLElement>"u"?class{}:HTMLElement,q=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Pu=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Pr("slot")),!n.querySelector("style"))if(!Ou)n.append(Pr("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Hu=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Nu=t=>{var e;const n=q(t,"aria-label")||"";return[...(((e=q(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,s)=>{var r;return i||((r=s?.innerText)==null?void 0:r.trim())||""},n).trim()},qu=t=>{if(!t||!je)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Pr=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))q(o,i,s);return o},Bu={define:(t,e)=>!Ir()||window.customElements.get(t)||window.customElements.define(t,e)},Xe="value",mo="max",Uu=`:host(:not([hidden])) { box-sizing: border-box; border: 1px solid; display: inline-block; height: .5em; width: 10em; overflow: hidden }
196
- :host::before { content: ''; display: block; height: 100%; background: currentColor; width: var(--percentage, 0%); transition: width .2s }
197
- :host(:not([value])) { background: linear-gradient(90deg,currentColor 25%, transparent 50%, currentColor 75%) 50%/400% }
198
- @media (prefers-reduced-motion: no-preference) { :host { animation: indeterminate 2s linear infinite } }
199
- @keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,Hr=class extends Du{constructor(){var t;super(),this._skipAttrChange=!1,Pu(this,Uu),this._internals=(t=this.attachInternals)==null?void 0:t.call(this)}static get observedAttributes(){return["aria-label","aria-labelledby",Xe,mo]}connectedCallback(){q(this,"aria-valuemin","0"),q(this,"aria-valuemax","100"),q(this,"role",Or?"img":"progressbar"),this.attributeChangedCallback()}attributeChangedCallback(){if(this._skipAttrChange||!this.hasAttribute("role"))return;this._skipAttrChange=!0;const t=this.position,e=Math.max(0,Math.round(t*100));this.style.setProperty("--percentage",`${e}%`);let n=Nu(this);Or&&(n=`${n.replace(/\(\d+%\)$/,"")} (${e}%)`.trim()),q(this,"aria-busy",`${t===-1}`),q(this,"aria-label",n),q(this,"aria-labelledby",null),q(this,"aria-valuenow",t===-1?null:`${e}`),this._skipAttrChange=!1}get labels(){var t;const e=(t=this._internals)==null?void 0:t.labels;if(e)return e;const n=qu(this),o=this.closest("label:not([for])");return o&&q(o,"for",n),Hu(this).querySelectorAll(`label[for="${n}"]`)}get position(){return this.hasAttribute(Xe)?Math.min(this.value/this.max,1):-1}get value(){return Math.min(Nr(this,Xe),this.max)}set value(t){qr(this,Xe,t)}get max(){return Nr(this,mo,1)}set max(t){qr(this,mo,t,1)}};Hr.formAssociated=!0;var Nr=(t,e,n=0)=>{const o=q(t,e),i=Number(o);return o===null?n:Number.isFinite(i)&&Math.max(n,i)||n},qr=(t,e,n,o=0)=>{const i=Number(n);if(Number.isFinite(i))return q(t,e,`${Math.max(o,i)||o}`);throw new Error(`Failed to set the '${e}' property on 'UHTMLProgressElement': The provided double value is non-finite.`)};return Bu.define("u-progress",Hr),S.DSBreadcrumbsElement=Ei,S.DSErrorSummaryElement=$i,S.DSFieldElement=ke,S.DSPaginationElement=Oi,S.DSSuggestionElement=Pi,S.DSTabElement=Bi,S.DSTabListElement=qi,S.DSTabPanelElement=Ui,S.DSTabsElement=Ni,S.UHTMLComboboxElement=en,S.UHTMLComboboxShadowRoot=aa,S.UHTMLComboboxStyle=tn,S.UHTMLDataListElement=ns,S.UHTMLDataListShadowRoot=Pc,S.UHTMLDataListStyle=jn,S.UHTMLTabElement=fn,S.UHTMLTabListElement=pe,S.UHTMLTabListShadowRoot=ka,S.UHTMLTabListStyle=un,S.UHTMLTabPanelElement=mn,S.UHTMLTabPanelShadowRoot=Ra,S.UHTMLTabPanelStyle=dn,S.UHTMLTabShadowRoot=La,S.UHTMLTabStyle=Ca,S.UHTMLTabsElement=me,S.UHTMLTabsShadowRoot=Aa,S.UHTMLTabsStyle=cn,S.analytics=ur,S.fixLawHtml=yr,S.getLawChecked=Td,S.pagination=Ii,S.parseLawIds=kd,S.parseLawMeta=Ld,S.setLawChecked=Ad,S.setTooltipElement=wi,S.styles=Wc,S.toast=D,S.toggleAppExpanded=hr,S.toggleLawChecked=Cd,S.version=Fc,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),S})({});
195
+ `,Ed=[.1,.2,.25,.5,1];function $d(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((f,p,b)=>{const y=t.map(w=>w[b].number),_=y.reduce((w,x)=>w+x,0);return Math.max(f,...i?[_]:y)},0),s=r/10,a=10**`${Math.round(s)}`.length,l=s/a,c=(Ed.find(f=>f>l)||1)*a,u=Math.ceil(r/c)*c,d=R("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure"});e&&d.style.setProperty("--mtdsc-chart-aspect",e),d.style.setProperty("--bars",`${t[0]?.length-1}`),d.style.setProperty("--groups",`${t.length-1}`),d.style.setProperty("--total",`${u}`);const m=d.appendChild(R("div",{class:"axisSteps"})),h=d.appendChild(R("div",{class:"axisGroups"}));return Array.from({length:u/c+1},(f,p)=>Cd(c*p)).reverse().map(f=>m.append(R("div",{class:"axisStep","data-label":f}))),{total:u,groups:h,axis:d}}const Cd=new Intl.NumberFormat().format;function Ad(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=R("div",{class:"axisGroup","data-label":e}),r=i.appendChild(R("div",{class:"axisGroupContent"}));return t.slice(1).map(s=>s[o+1]).map(({tooltip:s,color:a,number:l})=>{const c=R("div",{"aria-label":s,"data-event":n,class:"bar",role:"img",tabindex:"0"});return c.style.setProperty("--color",a),c.style.setProperty("--value",`${l}`),r.appendChild(c)}),i})}function Td(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=R("div",{class:"axisGroup"});return t.slice(1).forEach(([,...s])=>{const a=R("div",{class:"lineContainer",role:"list"});a.style.setProperty("--color",s[0].color);const l=kd(s.map(({number:d},m,{length:h})=>[100/(h-1)*m,100-d/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");g(c,"aria-hidden","true"),g(c,"preserveAspectRatio","none"),g(c,"viewBox","0 0 100 100");const u=document.createElementNS("http://www.w3.org/2000/svg","path");if(g(u,"class","line"),g(u,"d",l),g(u,"fill","none"),g(u,"stroke","currentColor"),o==="area"){const d=u.cloneNode(!0);g(d,"d",`M-100,100 L${l.slice(1)}L200,100`),g(d,"class","lineShade"),c.append(d)}s.forEach(({number:d,tooltip:m,event:h})=>{const f=R("div",{role:"listitem"}),p=R("div",{"aria-label":m,"data-event":h,tabindex:"0",class:"linePoint",role:"img"});p.style.setProperty("--value",`${d}`),f.appendChild(p),a.append(f)}),a.appendChild(c).append(u),r.append(a)}),r}const kd=(t,e)=>t.map(([n,o],i,r)=>i?Ld(i,r,e):`M${n},${o}`).join(" "),hs=([t,e],[n,o])=>[t+n,e+o],gs=([t,e],[n,o])=>[t-n,e-o],bs=(t,[e,n])=>[t*e,t*n],Ld=(t,e,n)=>{const o=e[t-1],i=e[t],[r,s]=hs(o,bs(n,gs(i,e[t-2]||o))),[a,l]=hs(i,bs(n,gs(o,e[t+1]||i)));return`C ${r},${s} ${a},${l} ${i[0]},${i[1]}`};function Rd(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),g(o,"class","pie"),g(o,"viewBox","0 0 100 100");let i=0;const r=50,s=n==="doughnut"?25:0,a=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:u,color:d}])=>{if(!c)return;const m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=i/a;i+=c;const f=Math.min(i/a,.99999),p=f-h>.5?1:0,b=2*Math.PI*(h-.25),y=2*Math.PI*(f-.25),_=Math.cos(b),w=Math.sin(b),x=Math.cos(y),A=Math.sin(y),k=`M ${r+s*_} ${r+s*w} L ${r+r*_} ${r+r*w} A ${r} ${r} 0 ${p} 1 ${r+r*x} ${r+r*A} L ${r+s*x} ${r+s*A} A ${s} ${s} 0 ${p} 0 ${r+s*_} ${r+s*w}`;m.style.setProperty("--color",d),g(m,"aria-label",l),g(m,"data-event",u),g(m,"d",k),g(m,"role","img"),g(m,"tabindex","0"),o.appendChild(m)}),o}const vs="click keydown mousemove mouseout",ys="mtds-chart-tooltip",ut=B()?document.getElementById(ys)||R("div",{"aria-hidden":"true",class:C._tooltip,hidden:"",id:ys}):null;class Id extends Oc{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=qt(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=Zt(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),O(this,vs,this)}disconnectedCallback(){ut&&(ut.hidden=!0),os(this,vs,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=Dd(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(c=>c.remove());const[n,o]=(g(this,"data-variant")||"column").split("-"),i=g(this,"data-aspect")||void 0,r=R("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:c,color:u}])=>{const d=R("div",{class:"legend"},c);r.appendChild(d).style.setProperty("--color",u)});const{axis:s,groups:a,total:l}=$d(e,{aspect:i,type:o});(n==="column"||n==="bar")&&a.append(...Ad(e)),(n==="line"||n==="area")&&a.append(Td(e,{total:l,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(Rd(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,r),Pc(this,Sd)}handleEvent(e){e.type==="click"||e.type==="keydown"?Od(e,this):Md(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function Od(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&g(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let ws="";function Md(t){if(!ut)return;ut?.isConnected||document.body.append(ut);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(ut.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==ws&&(n&&(ut.textContent=n),ws=n,ut.hidden=!n)}const Zn=t=>t?.textContent?.trim()||"",Dd=t=>Array.from(t?.rows||[]).map((e,n,{length:o})=>Array.from(e.cells,(i,r)=>{const s=Zn(e.cells[0]),a=Zn(t?.rows[0].cells[r]),l=Zn(i),c=o===2?`${a}: ${l}`:`${s}: ${l}${a?` (${a})`:""}`;return g(i,"tabindex","-1"),{number:r&&n&&Number.parseFloat(l)||0,event:i.querySelector("a,button")&&`${n}-${r}`,color:`var(--mtdsc-chart-color-${n}-${r}, var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base)))`,value:l,tooltip:g(i,"data-tooltip")||c}}));Mc("mtds-chart",Id);const _s=new WeakSet,P=t=>!_s.has(t)&&_s.add(t),M=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),Pd=yt("togglegroup"),xs=C.button.split(" "),Nd=()=>{for(const t of Pd){P(t)&&!t.hasAttribute("data-toggle-group")&&(g(t,"data-toggle-group","Valgknapper"),M('Only setting class="styles.togglegroup"','data-toggle-group="LABEL-HERE" attribute also for better accessibility',t));for(const e of t.getElementsByTagName("label"))P(e)&&!e.classList.contains(xs[0])&&(e.classList.add(...xs),M('Only setting class="styles.button"','<label class="styles.button">',e))}},qd=yt("breadcrumbs"),Hd=()=>{for(const t of qd)P(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...C.breadcrumbs.split(" ")),M('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},Bd=yt("errorsummary"),zd=()=>{for(const t of Bd)P(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&M('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},Fd=yt("dialog"),Ss=()=>{for(const t of Fd){if(P(t)){const e=g(t,"data-closedby");e&&(g(t,"closedby",e),M(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.hasAttribute("data-variant")&&M('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t)}t.isConnected&&t.showModal&&t.close&&(t.matches('[open][data-modal]:not([data-modal="false"]):not(:modal)')?(M('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),g(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(g(t,"open",""),t.close()))}},Ud=()=>{for(const t of document.querySelectorAll("[data-count]"))if(P(t)){const e=g(t,"data-count");t.classList.add(...C.validation.split(" ")),g(t,"data-limit",e),M(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},Vd=()=>{for(const t of document.querySelectorAll("[data-command]"))if(P(t)){const e=g(t,"data-command");e==="row"?M(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):M(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},Wd=B()?document.getElementsByTagName("u-tabs"):[],Gd=()=>{for(const t of Wd)P(t)&&M("u-tabs","ds-tabs",t)},to=C.suggestion.split(" "),jd=B()?document.getElementsByTagName("u-combobox"):[],Xd=B()?document.getElementsByTagName("ds-suggestion"):[],Kd=()=>{for(const t of jd)P(t)&&(t.classList.add(...to),M("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of Xd)P(t)&&!t.classList.contains(to[0])&&(t.classList.add(...to),M("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},Yd=({target:t})=>{if(!(t instanceof Element))return;const e=t?.closest("tr")?.querySelector('[data-command="row"]');e&&!t?.closest('a,button,label,input,select,textarea,[role="button"]')&&e.click();const o=t?.closest("dialog");o&&t?.closest('[data-command="close"]')&&o.close()},Qd=yt("field"),ze=new Set,Jd=()=>{for(const t of Qd)t.nodeName!=="DS-FIELD"&&(P(t)||M('Only setting class="styles.field"','<ds-field class="styles.field">',t),!ze.has(t)&&ze.add(t)&&we.prototype.connectedCallback.call(t))},Zd=()=>{for(const t of ze)we.prototype.disconnectedCallback.call(t),ze.delete(t)},tu=`[data-description], .${C.field.split(" ")[0]} label + p`,eu=()=>{for(const t of document.querySelectorAll(tu))P(t)&&t.getAttribute("data-field")!=="description"&&(g(t,"data-field","description"),M("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},nu=yt("validation"),ou=()=>{for(const t of nu)P(t)&&!t.hasAttribute("data-field")&&(g(t,"data-field","validation"),M('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},iu=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))P(t)&&(g(t,"data-placement",g(t,"data-position")),M("data-position","data-placement",t))},ru=qt(()=>{B()&&(Ud(),Vd(),Hd(),Ss(),zd(),eu(),ou(),iu(),Jd(),Nd(),Kd(),Gd())},200);st("deprecations",()=>[Zd,O(document,"click",Yd,Jt),O(document,"toggle",Ss,!0),Zt(document,ru,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const su=qt(t=>{if(t.animationName!==C._logo)return;const e=t.target.closest?.(`.${C.logo.split(" ")[0]}`),n=e?.firstElementChild;if(n instanceof SVGSVGElement){for(const l of document.head.querySelectorAll("link[rel~='icon']"))l.setAttribute("rel","disabled");const o=e?.hasAttribute("data-env"),i=window.getComputedStyle(n),r=i.getPropertyValue("color"),s=i.getPropertyValue("--mtdsc-logo-background"),a=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${r}"`);document.head.appendChild(R("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":s}' width='51' height='51' x='2' y='2' stroke='${r}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${a}</g></svg>`)}`,rel:"icon"}))}},200);st("logo",()=>[O(document,"animationend",su)]);const au=C.popover.split(" ")[0];function lu({target:t}){const e=t?.closest?.('a,button,[role="button"]'),n=e instanceof HTMLButtonElement,o=e&&g(e,"popovertarget"),i=o?document.getElementById(o):e?.closest("[popover]");if(!(o&&n)&&i?.classList.contains(au)&&e){const r=g(e,"popovertargetaction"),s=r==="show"||(r==="hide"?!1:void 0);if(n&&!r&&i.contains(e))return;i instanceof HTMLElement&&i.popover&&i.togglePopover(s)}}st("popover",()=>[O(document,"click",lu)]);const cu=B()?document.getElementsByTagName("table"):[],du=()=>{for(const t of cu){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>n.innerText.trim());for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)g(i,"data-th",e[i.cellIndex]||":empty")}};st("table",()=>[Zt(document,qt(du,200),{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const Es=C.toast.split(" ")[0],Fe="data-sort";function uu({animationName:t,target:e}){const n=e;if(t===C._toastTimeout&&n.close(),t!==C._toastOpen)return;const o=Number(g(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(Fe)||g(n,Fe,`${Date.now()}`),g(n,"tabindex","0"),[...document.querySelectorAll(`.${Es}[open]`)].sort((i,r)=>Number(g(r,Fe))-Number(g(i,Fe))).reduce((i,r)=>(r.style.translate=`0 ${r===e?0:i}px`,i+r.offsetHeight+5),0)}function fu({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(Es)&&g(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),r=window.getComputedStyle(t,"::after"),s=o.top+Number.parseInt(i.paddingTop,10),a=s+Number.parseInt(r.height,10),l=o.right-Number.parseInt(i.paddingRight,10),c=l-Number.parseInt(r.width,10);s<=n&&n<=a&&c<=e&&e<=l&&t.close()}}st("toast",()=>[O(document,"animationstart",uu),O(document,"click",fu)]),B()&&Vo(document.getElementById("mtds-tooltip")||R("div",{class:C._tooltip,id:"mtds-tooltip",popover:"manual"}));const eo=`.${C.field.split(" ")[0]}`,mu=`${eo} :is(input,textarea,select)`,pu="ds-suggestion,u-combobox",hu=C.validation.split(" ")[0],Ue=t=>t instanceof HTMLFormElement&&g(t,"data-validation")==="form",no=t=>t.closest(eo),oo=t=>t?.querySelectorAll(mu)||[],Ve=t=>t?.getElementsByClassName(hu)||[],$s=t=>{const e=!t.clientHeight||t.disabled||t.readOnly||g(t,"aria-readonly")==="true"||g(t,"aria-disabled")==="true",n=t.closest(pu)?.items,o=g(t,"aria-required")!=="true"||!!n?.length;return n&&t.setCustomValidity(e||o?"":"Required"),e?!1:t.matches(":user-invalid")},Cs=t=>{const e=t.target?.form||t.target;let n;if(Ue(e)){for(const o of e.querySelectorAll(eo)){const i=[...oo(o)].find($s);!n&&i&&(n=i);for(const r of Ve(o))g(r,"hidden",i?null:"")}for(const o of e.querySelectorAll("fieldset")){const i=[...oo(o)].some($s);for(const r of Ve(o))no(r)||g(r,"hidden",i?null:"")}n&&(t.preventDefault(),n.focus())}},gu=({target:t})=>{const e=t;if(Ue(e.form))for(const n of Ve(e.closest("fieldset")||no(e)))g(n,"hidden","")},bu=t=>Ue(t.target.form)&&t?.preventDefault(),vu=B()?Ve(document):[],yu=()=>{for(const t of vu)if(!t.hasAttribute("data-validation")){const e=oo(no(t))[0];g(t,"data-validation","form"),Ue(e?.form)&&g(t,"hidden","")}};st("validations",()=>[O(document,"input comboboxbeforeselect",gu,!0),O(document,"invalid",bu,!0),O(document,"invalid",qt(Cs,10),Jt),O(document,"submit",Cs,!0),Zt(document,yu,{childList:!0,subtree:!0})]);const wu=B()?document.getElementsByTagName("u-datalist"):[],_u=()=>{for(const t of wu)t.closest("ds-suggestion")?.connectedCallback()};return st("deprecations",()=>[Zt(document,_u,{childList:!0,subtree:!0})]),$.DSBreadcrumbsElement=Xo,$.DSErrorSummaryElement=Ko,$.DSFieldElement=we,$.DSPaginationElement=ii,$.DSSuggestionElement=wi,$.DSTabElement=Mi,$.DSTabListElement=Oi,$.DSTabPanelElement=Di,$.DSTabsElement=Ii,$.UHTMLComboboxElement=_n,$.UHTMLComboboxShadowRoot=kl,$.UHTMLComboboxStyle=wn,$.UHTMLDataListElement=Yi,$.UHTMLDataListShadowRoot=Sc,$.UHTMLDataListStyle=Hn,$.analytics=rs,$.fixLawHtml=ms,$.getLawChecked=md,$.pagination=oi,$.parseLawIds=gd,$.parseLawMeta=bd,$.setLawChecked=hd,$.setTooltipElement=Vo,$.styles=Rc,$.toast=D,$.toggleAppExpanded=cs,$.toggleLawChecked=pd,$.version=Lc,Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),$})({});