nish-ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/base-tailwind.css +30 -15
- package/dist/base.css +30 -15
- package/dist/elements-all.js +78 -78
- package/dist/elements-charts.js +39 -38
- package/dist/elements-data.d.ts +10 -0
- package/dist/elements-data.js +4 -5
- package/dist/elements-forms.js +5 -5
- package/dist/elements.d.ts +1 -0
- package/dist/elements.js +4 -4
- package/dist/esm/command-filter.js +55 -4
- package/dist/esm/components/accordion.js +3 -2
- package/dist/esm/components/app-shell.js +8 -4
- package/dist/esm/components/breadcrumbs.js +7 -3
- package/dist/esm/components/calendar-base.js +32 -5
- package/dist/esm/components/calendar-classes.js +14 -2
- package/dist/esm/components/canvas/follow-caption.js +31 -21
- package/dist/esm/components/canvas/follow.js +5 -6
- package/dist/esm/components/canvas/minimap.js +3 -3
- package/dist/esm/components/canvas/system-canvas.js +3 -1
- package/dist/esm/components/canvas/view.js +0 -2
- package/dist/esm/components/carousel.js +2 -3
- package/dist/esm/components/charts.js +18 -7
- package/dist/esm/components/combobox.js +18 -7
- package/dist/esm/components/command.js +23 -61
- package/dist/esm/components/context-menu.js +2 -1
- package/dist/esm/components/data-classes.js +5 -4
- package/dist/esm/components/data.js +19 -10
- package/dist/esm/components/display.js +20 -11
- package/dist/esm/components/drawer.js +17 -4
- package/dist/esm/components/error-boundary.js +3 -3
- package/dist/esm/components/feedback.js +3 -3
- package/dist/esm/components/file-dropzone.js +16 -6
- package/dist/esm/components/filters.js +42 -1
- package/dist/esm/components/flow.js +8 -5
- package/dist/esm/components/forms-classes.js +2 -0
- package/dist/esm/components/forms.js +2 -2
- package/dist/esm/components/hooks.js +47 -13
- package/dist/esm/components/hover-card.js +2 -1
- package/dist/esm/components/inbox.js +5 -1
- package/dist/esm/components/latest.js +4 -2
- package/dist/esm/components/layout.js +7 -4
- package/dist/esm/components/menu.js +10 -1
- package/dist/esm/components/modal.js +17 -4
- package/dist/esm/components/multi-select.js +5 -5
- package/dist/esm/components/nav.js +30 -11
- package/dist/esm/components/navigate.js +1 -1
- package/dist/esm/components/overlay-dialog.js +35 -1
- package/dist/esm/components/pagination.js +1 -1
- package/dist/esm/components/primitives.js +17 -4
- package/dist/esm/components/progress.js +2 -1
- package/dist/esm/components/resource.js +14 -4
- package/dist/esm/components/segmented.js +2 -0
- package/dist/esm/components/separator.js +6 -1
- package/dist/esm/components/service-tokens.js +18 -7
- package/dist/esm/components/settings.js +16 -0
- package/dist/esm/components/slider.js +5 -1
- package/dist/esm/components/split.js +4 -2
- package/dist/esm/components/strings.js +17 -4
- package/dist/esm/components/table.js +15 -3
- package/dist/esm/components/tag-input.js +5 -1
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/toast-card.js +5 -3
- package/dist/esm/components/toast.js +4 -1
- package/dist/esm/components/tooltip.js +3 -2
- package/dist/esm/components/url-state.js +3 -1
- package/dist/esm/components/virtual-table.js +2 -2
- package/dist/esm/components/virtual.js +8 -4
- package/dist/esm/format.js +3 -2
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/server/inbox/client.js +4 -0
- package/dist/esm/theme.js +38 -15
- package/dist/esm/tokens.mjs +1 -1
- package/dist/format.d.ts +5 -3
- package/dist/format.js +4 -3
- package/dist/inbox-client.d.ts +1 -1
- package/dist/inbox-client.js +4 -0
- package/dist/index.d.ts +61 -29
- package/dist/nish-components.css +59 -21
- package/dist/nish-components.min.css +1 -1
- package/dist/nish.css +30 -15
- package/dist/nish.min.css +1 -1
- package/dist/node/vite.js +1 -1
- package/dist/server/hono.d.ts +9 -2
- package/dist/server/hono.js +17 -4
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +7 -2
- package/dist/service-tokens.d.ts +4 -4
- package/dist/{spa-BfRDo38r.d.ts → spa-FwS7yZ8p.d.ts} +4 -3
- package/dist/system-canvas.d.ts +11 -10
- package/dist/theme.d.ts +30 -2
- package/dist/theme.global.js +45 -18
- package/dist/theme.js +45 -18
- package/package.json +3 -2
- package/dist/tokens.js +0 -425
package/dist/elements-all.js
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
var Zn=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Xr=["accent","ok","loss","warn","info",...Zn],de={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},es={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},ts=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],is=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],se=n=>Object.fromEntries(n.map((e,t)=>[`chart-${t+1}`,e])),ns={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",hi:"#ececf1",hi2:"#a8aab7",hi3:"#8a8d9b",ghost:"#6b6e7c",accent:"#8b93ff",accent2:"#c084fc","on-accent":"#0a0b0f",ok:"#34d399",loss:"#f87171",warn:"#fbbf24",info:"#38bdf8",scrim:"#000000","invert-bg":"#ececf1","invert-text":"#111218",...se(ts),...de}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",ghost:"#8a8c98",accent:"#4338ca",accent2:"#7e22ce","on-accent":"#ffffff","on-accent2":"#ffffff","on-ok":"#0a0a0c","on-loss":"#ffffff","on-warn":"#0a0a0c","on-info":"#0a0a0c",ok:"#065f46","ok-fill":"#059669","loss-fill":"#dc2626","warn-fill":"#c96d06","info-fill":"#0284c7",loss:"#a91b1b",warn:"#92400e",info:"#075985",scrim:"#17171c","invert-bg":"#17171c","invert-text":"#f7f6f3",...se(is),...es}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",ghost:"#71717a",accent:"#a5b4fc",accent2:"#c084fc","on-accent":"#18181b",ok:"#4ade80",loss:"#fda4af",warn:"#facc15",info:"#38bdf8",scrim:"#000000","invert-bg":"#f4f4f5","invert-text":"#202024",...se(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...de,indigo:"#9aa1ff",rose:"#fc8395",violet:"#c792fc"}},terminal:{label:"Terminal",scheme:"dark",colors:{bg:"#050807",surface:"#0c110e",elevated:"#141c17",overlay:"#1c2820",line:"#233028","line-strong":"#34483b","line-control":"#5c6c61",hi:"#d1fae5",hi2:"#8fc4a8",hi3:"#74a68b",ghost:"#4f7a62",accent:"#34d399",accent2:"#2dd4bf","on-accent":"#050807",ok:"#4ade80",loss:"#f87171",warn:"#fbbf24",info:"#67e8f9",scrim:"#000000","invert-bg":"#d1fae5","invert-text":"#0c110e",...se(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...de}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",ghost:"#78716c",accent:"#fdba74",accent2:"#f472b6","on-accent":"#1c1917",ok:"#4ade80",loss:"#fca5a5",warn:"#facc15",info:"#7dd3fc",scrim:"#000000","invert-bg":"#f5f0eb","invert-text":"#292524",...se(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...de,indigo:"#a9afff",rose:"#fc99a7",sky:"#3ebff8",violet:"#cfa2fd"}},ocean:{label:"Ocean",scheme:"dark",colors:{bg:"#020c18",surface:"#061528",elevated:"#0a243e",overlay:"#103658",line:"#123050","line-strong":"#1f4a72","line-control":"#507291",hi:"#e0f2fe",hi2:"#9ccde6",hi3:"#6fa9c6",ghost:"#3f7392",accent:"#38bdf8",accent2:"#a78bfa","on-accent":"#020c18",ok:"#34d399",loss:"#fb7185",warn:"#fbbf24",info:"#7dd3fc",scrim:"#000000","invert-bg":"#38bdf8","invert-text":"#020c18",...se(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...de}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#8a8a8a",hi:"#ffffff",hi2:"#d4d4d4",hi3:"#bdbdbd",ghost:"#8f8f8f",accent:"#ffd60a",accent2:"#7dd3fc","on-accent":"#000000",ok:"#4ade80",loss:"#ff6b6b",warn:"#ffd60a",info:"#7dd3fc",scrim:"#000000","invert-bg":"#ffffff","invert-text":"#000000",...se(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...de}}},ss=n=>{let e=n.colors,t=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...n,colors:{...e,...t,"on-accent2":e["on-accent2"]??e["on-accent"]}}},ue=Object.fromEntries(Object.entries(ns).map(([n,e])=>[n,ss(e)])),bi="dark";var rs="3.2.0";var os=Symbol.for("nish-ui.runtime.v1");function as(){let n=globalThis;return n[os]??={versions:new Set,slots:{}}}function ls(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}function cs(n){n.versions.add(rs),n.versions.size>1&&!n.warned&&ls()&&(n.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...n.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var gi=!1;function me(n,e){let t=as();return gi||(gi=!0,cs(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}function Se(n){if(n==null)return null;let e=String(n),t=0,i=e.length;for(;t<i&&e.charCodeAt(t)<=32;)t++;for(;i>t&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(t,i).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var xe={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(n,e)=>`Theme: ${n}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var vi={dismiss:"Dismiss",moreCount:n=>`${n} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:n=>`${n}: no data`};var yi="nish-theme",Ei="nish.software",hs=3600*24*365,pe=()=>me("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),ds=n=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${n}`)};function qe(){if(typeof document>"u")return yi;let n=document.documentElement.getAttribute("data-nish-storage-key");return n&&/^[A-Za-z0-9_-]+$/.test(n)?n:yi}var Te=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function Ot(n){return typeof n=="string"&&(Te(ue,n)||Te(pe().extra,n))}function us(){if(typeof document>"u")return null;try{let n=document.cookie.match(new RegExp(`(?:^|;\\s*)${qe()}=([a-z0-9-]+)`));return n?n[1]:null}catch{return null}}var Si=(n,e)=>e===n||e.endsWith("."+n);function ms(n,e){let t=n.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?Si(i,t)?i:null:Si(Ei,t)?Ei:null}function ps(){return typeof location>"u"||typeof document>"u"?null:ms(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function fe(){let n=null;try{n=us()??localStorage.getItem(qe())}catch{}return n==="system"||Ot(n)?n:"system"}function fs(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":bi}function bs(){let n=document.documentElement.getAttribute("data-nish-themes");return n?n.split(/\s+/).filter(Ot):null}function Ai(n=fe()){let e=n==="system"?fs():n,t=typeof document>"u"?null:bs();return t&&!t.includes(e)&&(e=Ve(e)),e}function Ve(n){let{extra:e}=pe();return Te(ue,n)?ue[n].scheme:Te(e,n)?e[n]:"dark"}function Ci(n=fe()){let e=Ai(n),t=document.documentElement,i=t.getAttribute("data-theme");return i&&i!==e&&gs(t),t.setAttribute("data-theme",e),t.setAttribute("data-scheme",Ve(e)),t.setAttribute("data-theme-choice",n),t.style.colorScheme=Ve(e),Es(),pe().listeners.forEach(s=>s(n,e)),e}function gs(n){let e=pe(),t=++e.switchId;n.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===t&&n.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function vs(n){if(n!=="system"&&!Ot(n))return ds(`unknown theme "${String(n)}" ignored. Register it with registerThemes() first.`),Ai(fe());let e=qe();try{localStorage.setItem(e,n)}catch{}try{let t=ps();if(t){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${n}; Domain=.${t}; Path=/; Max-Age=${hs}; SameSite=Lax${i}`}}catch{}return Ci(n)}function ys(n){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${n}`).trim()}function Es(){let n=ys("bg");if(!n)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=n}function Ss(){let n=pe();if(n.watching||typeof window>"u")return;n.watching=!0;let e=()=>{let t=fe();(t!==document.documentElement.getAttribute("data-theme-choice")||t==="system")&&Ci(t)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",t=>{t.key===qe()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function xs(n){Ss();let{listeners:e}=pe();return e.add(n),()=>{e.delete(n)}}var Ge=["system","light","dark"];function ws(){let n=ki(fe());return vs(n),n}var xi="http://www.w3.org/2000/svg";function Rt(n,e,t={}){let i=document.createElementNS(xi,"svg"),s={width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...t};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let l=document.createElementNS(xi,r);for(let a of Object.keys(o))l.setAttribute(a,o[a]);i.appendChild(l)}return i}var wi={system:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["path",{d:"M8 21h8M12 17v4"}]],light:[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2M12 20v2m-7.07-2.93 1.41-1.41M17.66 6.34l1.41-1.41M2 12h2m16 0h2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41"}]],dark:[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"}]]},Ts=()=>({system:xe.themeSystem,light:xe.themeLight,dark:xe.themeDark}),Ls="set on another site";function ki(n){let e=Ge.indexOf(n);return Ge[(e+1)%Ge.length]}function $t(n,e){return n==="system"||n==="light"||n==="dark"?e[n]:Te(ue,n)?ue[n].label:n.charAt(0).toUpperCase()+n.slice(1)}function Mi(n,e={}){let t={...Ts(),...e.labels},i=e.strings?.themeToggleLabel??xe.themeToggleLabel,s=e.elsewhereLabel??Ls;n.tagName==="BUTTON"&&!n.getAttribute("type")&&n.setAttribute("type","button");let r=Object.keys(wi).map(c=>Rt(16,wi[c],{"data-icon":c}));if(e.showLabel){let c=document.createElement("span");c.setAttribute("data-theme-word",""),c.setAttribute("aria-hidden","true"),r.push(c)}n.replaceChildren(...r);let o=n.querySelector("[data-theme-word]"),l=c=>{let h=c==="system"||c==="light"||c==="dark"?c:Ve(c);n.setAttribute("data-choice",c),n.querySelectorAll("svg[data-icon]").forEach(v=>{v.getAttribute("data-icon")===h?v.removeAttribute("display"):v.setAttribute("display","none")});let u=Ge.includes(c)?"":` (${s})`,E=i(`${$t(c,t)}${u}`,$t(ki(c),t));n.setAttribute("aria-label",E),n.setAttribute("title",E),o&&(o.textContent=$t(c,t))},a=()=>{ws()};n.addEventListener("click",a);let d=xs(c=>l(c));return l(fe()),()=>{n.removeEventListener("click",a),d()}}var Ti=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],Li=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],As={neutral:Li,info:Li,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:Ti,loss:Ti},Cs=6e3,Q=null,we=null;function _i(n,e={}){we?.(),(!Q||!Q.isConnected)&&(Q=document.createElement("div"),Q.setAttribute("role","status"),Q.setAttribute("aria-live","polite"),Q.className="nish-toast-region",document.body.appendChild(Q));let t=Q,i=document.createElement("div");i.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Rt(15,As[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof n=="string"?document.createTextNode(n):n),i.append(r);let o=null,l=e.duration==="sticky"?1/0:e.duration??Cs,a=0,d=0,c=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),we===c&&(we=null)},h=m=>{Number.isFinite(m)&&(a=Date.now(),o=setTimeout(c,m))},u=()=>{d+=1,!(d>1||o==null)&&(clearTimeout(o),o=null,l=Math.max(0,l-(Date.now()-a)))},E=()=>{d!==0&&(d-=1,d===0&&h(Math.max(l,1e3)))},v=e.action,b=v?.href!=null?Se(v.href):null;if(v&&(v.href==null||b!=null)){let m=document.createElement(v.href!=null?"a":"button");m.className="nish-toast-action",m.textContent=v.label,b!=null?m.href=b:m.type="button",m.addEventListener("click",()=>{v.onClick?.(),c()}),i.append(m)}let f=document.createElement("button");return f.type="button",f.className="nish-toast-close",f.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??vi.dismiss),f.append(Rt(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),f.addEventListener("click",c),i.append(f),i.addEventListener("pointerenter",m=>m.pointerType==="mouse"&&u()),i.addEventListener("pointerleave",m=>m.pointerType==="mouse"&&E()),i.addEventListener("focusin",m=>!i.contains(m.relatedTarget)&&u()),i.addEventListener("focusout",m=>!i.contains(m.relatedTarget)&&E()),i.addEventListener("keydown",m=>{m.key==="Escape"&&c()}),setTimeout(()=>{we===c&&(t.append(i),h(l))},50),we=c,c}var ks=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Pt(n){if(typeof document>"u")return()=>{};let e=!1,t=!1;if(n.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!n.open)return;e=!0;let m,w=()=>{n.removeEventListener("animationend",g),m!==void 0&&clearTimeout(m),n.removeAttribute("data-closing"),n.style.transform="",n.style.transition="",e=!1,n.open&&n.close()},g=L=>{L.target===n&&w()};if(ks()){w();return}n.style.transform="",n.setAttribute("data-closing",""),n.addEventListener("animationend",g),m=setTimeout(w,260)}let r=m=>{m.preventDefault(),s()},o=m=>{m.key==="Escape"&&m.stopPropagation()},l=m=>{if(m.target===n){let w=n.getBoundingClientRect();m.clientX>=w.left&&m.clientX<=w.right&&m.clientY>=w.top&&m.clientY<=w.bottom||s();return}m.target instanceof Element&&m.target.closest("[data-sheet-close]")&&s()},a=0,d=0,c=0,h=0,u=1,E=m=>{if(m.pointerType==="mouse"||e||!m.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let w=n.getBoundingClientRect();!(m.target instanceof Element&&m.target.closest(".nish-sheet-header")!=null)&&m.clientY-w.top>28||(t=!0,a=d=m.clientY,c=m.timeStamp,h=0,u=w.height||1,n.style.transition="none",n.setPointerCapture?.(m.pointerId))},v=m=>{if(!t)return;let w=m.clientY-a,g=m.timeStamp-c;g>0&&(h=(m.clientY-d)/g),d=m.clientY,c=m.timeStamp,n.style.transform=`translateY(${w>=0?w:w*.3}px)`},b=m=>{if(!t)return;t=!1,n.releasePointerCapture?.(m.pointerId);let w=m.clientY-a;if(m.type!=="pointercancel"&&(w>u*.3||h>.5)){s();return}n.style.transition="transform 180ms var(--nish-ease-out, ease-out)",n.style.transform="",setTimeout(()=>{e||(n.style.transition="")},200)},f=()=>{n.removeEventListener("cancel",r),n.removeEventListener("keydown",o),n.removeEventListener("click",l),n.removeEventListener("pointerdown",E),n.removeEventListener("pointermove",v),n.removeEventListener("pointerup",b),n.removeEventListener("pointercancel",b),n.removeEventListener("close",f),i?.isConnected&&i.focus()};return n.addEventListener("cancel",r),n.addEventListener("keydown",o),n.addEventListener("click",l),n.addEventListener("pointerdown",E),n.addEventListener("pointermove",v),n.addEventListener("pointerup",b),n.addEventListener("pointercancel",b),n.addEventListener("close",f),n.showModal(),s}function It(n,e){if(typeof document>"u")return()=>{};let t=document.documentElement,i=()=>{let r=n.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(n)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),t.style.removeProperty(e)}}function Ni(n,e={}){let t=Object.assign(()=>{},{lock:L=>{}});if(typeof document>"u")return t;let i=Array.from(n.querySelectorAll('a[href^="#"]')).filter(L=>L.hash.length>1),s=L=>{try{return document.getElementById(decodeURIComponent(L.hash.slice(1)))}catch{return null}},r=e.height===!1?()=>{}:It(n,"--nish-sticky-extra"),o=null,l=null,a=null,d=()=>{let L=n.scrollWidth-n.clientWidth,M=getComputedStyle(n).direction==="rtl"?n.scrollLeft+L:n.scrollLeft;n.dataset.atStart=String(M<=1),n.dataset.atEnd=String(L<=1||M>=L-1)},c=L=>{let M=L.getBoundingClientRect().left-n.getBoundingClientRect().left+n.scrollLeft-n.clientLeft,$=n.clientWidth;M<n.scrollLeft+24?n.scrollLeft=Math.max(0,M-24):M+L.offsetWidth>n.scrollLeft+$-24&&(n.scrollLeft=M+L.offsetWidth-$+24)},h=L=>{L!==o&&(o?.removeAttribute("aria-current"),o=L,L&&(L.setAttribute("aria-current","true"),c(L)))},u=()=>{let L=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,M=e.offset??L+n.offsetHeight+8,$=i[0]??null;for(let F of i){let T=s(F);T&&T.getBoundingClientRect().top<=M+1&&($=F)}let G=document.documentElement;if(window.innerHeight+window.scrollY>=G.scrollHeight-2)for(let F of i)s(F)&&($=F);h(l??$)},E=()=>{a?.(),a=null,l=null},v=L=>{let M=i.find(B=>{try{return decodeURIComponent(B.hash.slice(1))===L}catch{return!1}});if(!M)return;E(),l=M,h(M);let $=()=>{E(),f()},G=B=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "].includes(B.key)&&$()},F=!1,T=()=>{F=!0},R=setTimeout(T,400),H=()=>{F?$():(clearTimeout(R),R=setTimeout(T,200))},U=()=>{clearTimeout(R),R=setTimeout(T,50)};window.addEventListener("wheel",$,{passive:!0}),window.addEventListener("touchstart",$,{passive:!0}),window.addEventListener("keydown",G),window.addEventListener("scroll",H,{passive:!0}),window.addEventListener("scrollend",U),a=()=>{clearTimeout(R),window.removeEventListener("wheel",$),window.removeEventListener("touchstart",$),window.removeEventListener("keydown",G),window.removeEventListener("scroll",H),window.removeEventListener("scrollend",U)}},b=0,f=()=>{b||(b=requestAnimationFrame(()=>{b=0,u()}))},m=L=>{let M=L.target instanceof Element?L.target.closest('a[href^="#"]'):null;M&&i.includes(M)&&h(M)};d(),u(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f),n.addEventListener("scroll",d,{passive:!0}),n.addEventListener("click",m);let w;return typeof ResizeObserver<"u"&&(w=new ResizeObserver(()=>{d(),f()}),w.observe(n)),Object.assign(()=>{E(),b&&cancelAnimationFrame(b),window.removeEventListener("scroll",f),window.removeEventListener("resize",f),n.removeEventListener("scroll",d),n.removeEventListener("click",m),w?.disconnect(),r(),o?.removeAttribute("aria-current"),delete n.dataset.atStart,delete n.dataset.atEnd},{lock:v})}var $i=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var V=function(n,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},I=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},be,We,je,Le,Ht,Ae,Ye,re,Ce,J,Ke,Ri;var O={__proto__:null};O.enumerable=!0;Object.freeze(O);var Dt=(J=class{constructor(e,t={}){if(be.set(this,!1),We.set(this,!1),je.set(this,!1),Le.set(this,!1),Ht.set(this,Date.now()),Ae.set(this,!1),Ye.set(this,void 0),re.set(this,void 0),Ce.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=t;V(this,be,!!s,"f"),V(this,We,!!i,"f"),V(this,je,!!r,"f"),V(this,Ye,`${e}`,"f"),V(this,re,null,"f"),V(this,Ce,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){V(this,Le,!0,"f")}get target(){return I(this,re,"f")}get currentTarget(){return I(this,re,"f")}get srcElement(){return I(this,re,"f")}get type(){return I(this,Ye,"f")}get cancelable(){return I(this,be,"f")}get defaultPrevented(){return I(this,be,"f")&&I(this,Le,"f")}get timeStamp(){return I(this,Ht,"f")}composedPath(){return I(this,Ce,"f")?[I(this,re,"f")]:[]}get returnValue(){return!I(this,be,"f")||!I(this,Le,"f")}get bubbles(){return I(this,We,"f")}get composed(){return I(this,je,"f")}get eventPhase(){return I(this,Ce,"f")?J.AT_TARGET:J.NONE}get cancelBubble(){return I(this,Ae,"f")}set cancelBubble(e){e&&V(this,Ae,!0,"f")}stopPropagation(){V(this,Ae,!0,"f")}get isTrusted(){return!1}},be=new WeakMap,We=new WeakMap,je=new WeakMap,Le=new WeakMap,Ht=new WeakMap,Ae=new WeakMap,Ye=new WeakMap,re=new WeakMap,Ce=new WeakMap,J.NONE=0,J.CAPTURING_PHASE=1,J.AT_TARGET=2,J.BUBBLING_PHASE=3,J);Object.defineProperties(Dt.prototype,{initEvent:O,stopImmediatePropagation:O,preventDefault:O,target:O,currentTarget:O,srcElement:O,type:O,cancelable:O,defaultPrevented:O,timeStamp:O,composedPath:O,returnValue:O,bubbles:O,composed:O,eventPhase:O,cancelBubble:O,stopPropagation:O,isTrusted:O});var Oi=(Ri=class extends Dt{constructor(e,t={}){super(e,t),Ke.set(this,void 0),V(this,Ke,t?.detail??null,"f")}initCustomEvent(e,t,i,s){throw new Error("Method not implemented.")}get detail(){return I(this,Ke,"f")}},Ke=new WeakMap,Ri);Object.defineProperties(Oi.prototype,{detail:O});var j=Dt,Bt=Oi;var D;var mo=(D=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},D.STYLE_RULE=1,D.CHARSET_RULE=2,D.IMPORT_RULE=3,D.MEDIA_RULE=4,D.FONT_FACE_RULE=5,D.PAGE_RULE=6,D.NAMESPACE_RULE=10,D.KEYFRAMES_RULE=7,D.KEYFRAME_RULE=8,D.SUPPORTS_RULE=12,D.COUNTER_STYLE_RULE=11,D.FONT_FEATURE_VALUES_RULE=14,D.MARGIN_RULE=9,D);globalThis.Event??=j;globalThis.CustomEvent??=Bt;var Ut=Symbol(),Pi=n=>typeof n=="boolean"?n:n?.capture??!1,Y={__proto__:null};Y.enumerable=!0;Object.freeze(Y);var Xe=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,i){if(t==null)return;let s=Pi(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,i)),r.set(t,o??{})}removeEventListener(e,t,i){if(t==null)return;let s=Pi(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(t),r.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let i=!1,s=!1,r=j.NONE,o=null,l=null,a=null,d=e.stopPropagation,c=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...Y},srcElement:{get(){return e.target},...Y},currentTarget:{get(){return a},...Y},eventPhase:{get(){return r},...Y},composedPath:{value:()=>t,...Y},stopPropagation:{value:()=>{i=!0,d.call(e)},...Y},stopImmediatePropagation:{value:()=>{s=!0,c.call(e)},...Y}});let h=(f,m,w)=>{typeof f=="function"?f(e):typeof f?.handleEvent=="function"&&f.handleEvent(e),m.once&&w.delete(f)},u=()=>(a=null,r=j.NONE,!e.defaultPrevented),E=t.slice().reverse();o=!this.__host||!e.composed?this:null;let v=f=>{for(l=this;l.__host&&f.includes(l.__host);)l=l.__host};for(let f of E){!o&&(!l||l===f.__host)&&v(E.slice(E.indexOf(f))),a=f,r=f===e.target?j.AT_TARGET:j.CAPTURING_PHASE;let m=f.__captureEventListeners.get(e.type);if(m){for(let[w,g]of m)if(h(w,g,m),s)return u()}if(i)return u()}let b=e.bubbles?t:[this];l=null;for(let f of b){!o&&(!l||f===l.__host)&&v(b.slice(0,b.indexOf(f)+1)),a=f,r=f===e.target?j.AT_TARGET:j.BUBBLING_PHASE;let m=f.__eventListeners.get(e.type);if(m){for(let[w,g]of m)if(h(w,g,m),s)return u()}if(i)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Di,Ns]}};var Ii=new WeakMap,ke=n=>{let e=Ii.get(n);return e===void 0&&Ii.set(n,e=new Map),e},Me=class extends Xe{getRootNode(e){return e?.composed?Ft:this.__host?.__shadowRoot??Ft}};var Hi=class extends Me{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Di=new Hi,Ft=Di;var Bi=class extends Me{constructor(e){if(super(),e!==Ut)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Qe,customElements:Gt,document:Ft,Document:Hi,Element:Fi,EventTarget:Xe,HTMLElement:Ui,Node:Me,ShadowRoot:zi,window:this,Window:Bi})}};var Fi=class extends Me{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ke(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){ke(this).set(e,String(t))}removeAttribute(e){ke(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ke(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new zi(Ut,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new $i(this);return this.__internals=e,e}getAttribute(e){return ke(this).get(e)??null}};var Ui=class extends Fi{},zt=Ui;var zi=class extends Me{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new zt,"localName",{get(){return"lit-server-root"}});function Ms(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}var Qe=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
-
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let
|
|
3
|
-
\f\r]`,
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),en=/'/g,tn=/"/g,on=/^(?:script|style|textarea|title)$/i,Zt=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),k=Zt(1),N=Zt(2),jo=Zt(3),ce=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),nn=new WeakMap,ae=le.createTreeWalker(le,129);function an(n,e){if(!Jt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qi!==void 0?Qi.createHTML(e):e}var zs=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Re;for(let l=0;l<t;l++){let a=n[l],d,c,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,c=o.exec(a),c!==null);)u=o.lastIndex,o===Re?c[1]==="!--"?o=Ji:c[1]!==void 0?o=Zi:c[2]!==void 0?(on.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=oe):c[3]!==void 0&&(o=oe):o===oe?c[0]===">"?(o=s??Re,h=-1):c[1]===void 0?h=-2:(h=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?oe:c[3]==='"'?tn:en):o===tn||o===en?o=oe:o===Ji||o===Zi?o=Re:(o=oe,s=void 0);let E=o===oe&&n[l+1].startsWith("/>")?" ":"";r+=o===Re?a+Fs:h>=0?(i.push(d),a.slice(0,h)+sn+a.slice(h)+Z+E):a+Z+(h===-2?l:E)}return[an(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Ie=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[d,c]=zs(e,t);if(this.el=n.createElement(d,i),ae.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=ae.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(sn)){let u=c[o++],E=s.getAttribute(h).split(Z),v=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:v[2],strings:E,ctor:v[1]==="."?Yt:v[1]==="?"?Kt:v[1]==="@"?Xt:ve}),s.removeAttribute(h)}else h.startsWith(Z)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(on.test(s.tagName)){let h=s.textContent.split(Z),u=h.length-1;if(u>0){s.textContent=et?et.emptyScript:"";for(let E=0;E<u;E++)s.append(h[E],Oe()),ae.nextNode(),a.push({type:2,index:++r});s.append(h[u],Oe())}}}else if(s.nodeType===8)if(s.data===rn)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(Z,h+1))!==-1;)a.push({type:7,index:r}),h+=Z.length-1}r++}}static createElement(e,t){let i=le.createElement("template");return i.innerHTML=e,i}};function ge(n,e,t=n,i){if(e===ce)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,r=Pe(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=ge(n,s._$AS(n,e.values),s,i)),e}var jt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??le).importNode(t,!0);ae.currentNode=s;let r=ae.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new He(r,r.nextSibling,this,e):a.type===1?d=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(d=new Qt(r,this,e)),this._$AV.push(d),a=i[++l]}o!==a?.index&&(r=ae.nextNode(),o++)}return ae.currentNode=le,s}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},He=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ge(this,e,t),Pe(e)?e===y||e==null||e===""?(this._$AH!==y&&this._$AR(),this._$AH=y):e!==this._$AH&&e!==ce&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Us(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==y&&Pe(this._$AH)?this._$AA.nextSibling.data=e:this.T(le.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ie.createElement(an(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new jt(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=nn.get(e.strings);return t===void 0&&nn.set(e.strings,t=new Ie(e)),t}k(e){Jt(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let r of e)s===t.length?t.push(i=new n(this.O(Oe()),this.O(Oe()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let i=Xi(e).nextSibling;Xi(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ve=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=y}_$AI(e,t=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=ge(this,e,t,0),o=!Pe(e)||e!==this._$AH&&e!==ce,o&&(this._$AH=e);else{let l=e,a,d;for(e=r[0],a=0;a<r.length-1;a++)d=ge(this,l[i+a],t,a),d===ce&&(d=this._$AH[a]),o||=!Pe(d)||d!==this._$AH[a],d===y?e=y:e!==y&&(e+=(d??"")+r[a+1]),this._$AH[a]=d}o&&!s&&this.j(e)}j(e){e===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Yt=class extends ve{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===y?void 0:e}},Kt=class extends ve{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==y)}},Xt=class extends ve{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=ge(this,e,t,0)??y)===ce)return;let i=this._$AH,s=e===y&&i!==y||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==y&&(i===y||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Qt=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){ge(this,e)}};var Gs=tt.litHtmlPolyfillSupport;Gs?.(Ie,He),(tt.litHtmlVersions??=[]).push("3.3.3");var ln=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new He(e.insertBefore(Oe(),r),r,void 0,t??{})}return s._$AI(n),s};var ei=globalThis,ee=class extends K{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ln(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ce}};ee._$litElement$=!0,ee.finalized=!0,ei.litElementHydrateSupport?.({LitElement:ee});var Vs=ei.litElementPolyfillSupport;Vs?.({LitElement:ee});(ei.litElementVersions??=[]).push("4.2.2");var ye={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:n=>`${n} result${n===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:n=>`${n} active`,remove:"Remove",removeNamed:n=>`Remove ${n}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:n=>`${n}: no data`,seriesNumber:n=>`Series ${n}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(n,e)=>`Theme: ${n}. Switch to ${e}`,themeElsewhere:"set on another site"};function ti(){return me("element-strings",()=>({values:{...ye},listeners:new Set}))}function qs(n){let e=ti(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(ye,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){let n=ti(),e=n.values;return Object.keys(ye).some(i=>e[i]===void 0)&&(n.values={...ye,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),n.values}function cn(n){let e=ti().listeners;return e.add(n),()=>{e.delete(n)}}var S=class extends ee{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=cn(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function _(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function x(n,e){customElements.get(n)||customElements.define(n,e)}function z(n){return!!n&&getComputedStyle(n).direction==="rtl"}function it(n,e){let t=null,i=()=>Array.from(n.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let d of i()){if(e?.(d),!d.getAttribute("href"))continue;let c;try{c=new URL(d.getAttribute("href"),location.href)}catch{continue}if(c.origin!==location.origin)continue;let h=d.getAttribute("href").trim();if(h==="#"||h.startsWith("?")||c.pathname===location.pathname&&!c.hash&&h.startsWith("#"))continue;if(c.hash&&c.pathname===location.pathname){c.hash===location.hash&&(l=d,a=1/0);continue}let u=c.pathname;(u==="/"?o==="/":o===u||o.startsWith(u.endsWith("/")?u:`${u}/`))&&u.length>a&&(l=d,a=u.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let d of i())d.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(n,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(n,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var nt=class extends S{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),_(()=>this.#n())}#n(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-bottom-nav");if(!e){for(e=document.createElement("nav"),e.className="nish-bottom-nav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(),this.#t=it(e,t=>t.classList.add("nish-bottom-nav-item")),this.#i=It(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#t?.(),this.#t=null,this.#i?.(),this.#i=null}updated(e){this.#r()}#r(){this.#e&&(this.#e.setAttribute("aria-label",this.label||A().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};x("nish-bottom-nav",nt);var hn=0,st=class extends S{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-dialog-open]");t&&t.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");t?(t.id||(t.id=`nish-dialog-title-${++hn}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++hn}`),e.setAttribute("aria-describedby",i.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let t=this.dialog;if(t){if(e.target===t){let i=t.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||this.close();return}if(e.target instanceof Element){let i=e.target.closest("[data-dialog-close]");i&&i.closest("dialog")===t&&this.close(i.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let t=this.opener;this.opener=null,t?.isConnected&&t.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};x("nish-dialog",st);var Ws=0,rt=class extends S{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-sheet-open]");t&&t.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-sheet-title");t?(t.id||(t.id=`nish-sheet-title-${++Ws}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=Pt(e):this.open&&e.hasAttribute("data-closing")?this.reopen=!0:!this.open&&e.open&&(this.reopen=!1,this.closeSheet?.()))}reopen=!1;onDialogClose=()=>{if(this.closeSheet=null,this.reopen){this.reopen=!1,setTimeout(()=>{this.open&&this.isConnected&&this.dialog&&!this.dialog.open&&(this.closeSheet=Pt(this.dialog))},0);return}this.open&&(this.open=!1),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};x("nish-sheet",rt);var ot=class extends S{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#i=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#c()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}updated(e){this.#e&&this.#t!==this.#r()&&this.#c()}#t="";#n(){let e=A();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#r(){let e=A();return JSON.stringify([this.labelled,this.pill,...this.#n(),e.themeToggleLabel?.("{a}","{b}"),e.themeElsewhere])}#a(){this.#i?.(),this.#i=null,this.#e?.remove(),this.#e=null}#c(){this.#a(),this.#t=this.#r();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[t,i,s]=this.#n(),r={system:t,light:i,dark:s},o=A();this.#i=Mi(e,{showLabel:this.labelled,labels:r,...o.themeToggleLabel?{strings:{themeToggleLabel:o.themeToggleLabel}}:{},...o.themeElsewhere?{elsewhereLabel:o.themeElsewhere}:{}})}};x("nish-theme-toggle",ot);var dn="http://www.w3.org/2000/svg";function un(n,e){let t=document.createElementNS(dn,"svg");for(let[i,s]of Object.entries({width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(i,s);for(let i of e){let s=document.createElementNS(dn,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var at=n=>un(n,["M18 6 6 18M6 6l12 12"]),mn=n=>un(n,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var lt=class extends S{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;#n=e=>this.#u(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#s(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),i=!1;for(let s of this.#a()){let r=t.has(this.#s(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),_(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#o(),this.#r()}#r(){if(!this.#e)return;let e=A();for(let t of this.#a()){let i=t.querySelector(":scope > [data-nish-remove]");if(!i)continue;let s=this.#c(t);i.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(i=>{(i.nodeType===Node.TEXT_NODE||i instanceof HTMLElement&&!i.hasAttribute("data-nish-remove"))&&(t+=i.textContent??"")}),t.trim()}#s(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#n),this.#o(),this.#d(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#d(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#o(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#d(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),i=document.createElement("button");i.type="button",i.className="nish-icon-btn nish-icon-btn--xs",i.setAttribute("data-nish-remove",""),i.setAttribute("aria-label",t?A().removeNamed(t):A().remove),i.appendChild(at(12)),e.appendChild(i)}}#u(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let o=i.parentElement,l=this.#s(o),a=null;if(o.contains(document.activeElement)){let d=this.#a(),c=d.indexOf(o);for(let h of[...d.slice(c+1),...d.slice(0,c).reverse()]){if(a=h.matches("button")?h:h.querySelector("button, a[href], [tabindex]"),a&&!a.disabled)break;a=null}a||(this.#e.tabIndex=-1,a=this.#e)}o.remove(),a?.focus(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};x("nish-chip-group",lt);var pn=(n,e)=>js(n.label.toLowerCase(),n.hint?.toLowerCase(),e.trim().toLowerCase());function js(n,e,t){return t?n.includes(t)||(e?.includes(t)??!1):!0}var Xs=0,fn="http://www.w3.org/2000/svg",Qs="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function bn(n){let e=document.createElementNS(fn,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(fn,"path");return t.setAttribute("d",n),e.append(t),e}var ct=class extends S{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++Xs;#i=null;#t=null;#n=null;#r=null;#a=null;#c=null;#s=!1;#l="";#h=!1;#o=-1;#d;#u=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#i){this.#w();return}this.#u||(this.#u=!0,_(()=>{this.#u=!1,this.isConnected&&this.#m()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#d),this.#f()}#m(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let i=document.createElement("div");i.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#M(s.value)),s.addEventListener("keydown",a=>this.#N(a)),s.addEventListener("focus",()=>this.#x()),s.addEventListener("click",()=>this.#x()),s.addEventListener("blur",()=>{this.#k()||(this.#f(),this.#v(),this.#w())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(bn("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#f(),this.#L(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=Qs;let l=document.createElement("input");l.type="hidden",i.append(s,r,o),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#r=o,this.#c=l,this.#w()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#v(),e.has("disabled")&&this.disabled&&this.#f(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#E(),this.#w()}get#g(){return this.options.find(e=>e.value===this.value)??null}get#b(){return this.value!=null&&this.value!==""}get#S(){return this.#h?this.#l:this.#g?.label??this.value??""}get#p(){let e=this.filter??pn;return(this.#h?this.options.filter(i=>e(i,this.#l)):this.options).slice(0,50)}#E(){this.#o>=this.#p.length&&(this.#o=-1)}#v(){this.#h=!1,this.#l=""}#x(){if(this.#s||this.disabled||!this.#t)return;this.#s=!0;let e=this.#g,t=e?this.#p.findIndex(i=>i.value===e.value):-1;this.#o=t>=0?t:-1,this.#w()}#f(){this.#s=!1,this.#o=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#r&&(this.#r.textContent="")}#y(e,t){let i=this.#p,s=i.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#T(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#L(e,t){this.value=e,this.#v(),this.#w();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#A(e){e.disabled||(this.#f(),this.#L(e.value,e))}#k(){return!this.#h||this.#l.trim()!==""||!this.#b?!1:(this.#f(),this.#L(null,null),!0)}#C(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(i=>!i.disabled&&i.label.toLowerCase()===e.toLowerCase());return this.#f(),t?this.#L(t.value,t):this.#L(e,null),!0}#M(e){this.#l=e,this.#h=!0,this.#s=!0,this.allowCustom||e.trim()===""?this.#o=-1:this.#o=this.#p.findIndex(t=>!t.disabled),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#w()}#N(e){if(this.disabled)return;let t=this.#p;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#s){this.#_(this.#o<0?this.#T(i):this.#y(this.#o,i));break}else{this.#s=!0;let s=this.#g,r=s?t.findIndex(o=>o.value===s.value):-1;this.#o=r>=0?r:this.#T(i)}this.#w();break}case"Home":case"End":this.#s&&(e.preventDefault(),this.#_(this.#T(e.key==="Home"?1:-1)));break;case"Enter":this.#s&&this.#o>=0&&t[this.#o]?(e.preventDefault(),this.#A(t[this.#o])):(this.#k()||this.#C()||this.#s)&&e.preventDefault();break;case"Escape":this.#s?(e.preventDefault(),e.stopPropagation(),this.#f(),this.#w()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#v(),this.#w());break;case"Tab":this.#f();break}}#w(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#r)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#S;e.value!==i&&(e.value=i),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#n.setAttribute("aria-label",A().clear),this.#n.hidden=!(this.#b&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#s){this.#a&&this.#f();return}this.#$(e,t,this.#r)}#_(e){let t=this.#o;this.#o=e;let i=this.#a,s=this.#t;if(!i||!s||!this.#s){this.#w();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#w():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#$(e,t,i){let s=A(),r=`nish-cb-list-${this.#e}`,o=this.#p,l=this.#g,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let c=h=>{let u=h.target?.closest("li[data-index]");if(!u||!a.contains(u))return null;let E=Number(u.dataset.index),v=this.#p[E];return v?{o:v,i:E}:null};a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("mousemove",h=>{let u=c(h);u&&!u.o.disabled&&this.#o!==u.i&&this.#_(u.i)}),a.addEventListener("click",h=>{let u=c(h);u&&this.#A(u.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let d=o.map((c,h)=>{let u=document.createElement("li");u.id=`${r}-opt-${h}`,u.className="nish-combobox-option",u.setAttribute("role","option"),u.dataset.index=String(h),u.setAttribute("aria-selected",String(l?.value===c.value)),c.disabled&&u.setAttribute("aria-disabled","true"),h===this.#o&&(u.dataset.active="");let E=document.createElement("span");if(E.className="nish-combobox-label",E.textContent=c.label,u.append(E),c.hint){let v=document.createElement("span");v.className="nish-combobox-hint",v.textContent=c.hint,u.append(v)}return l?.value===c.value&&u.append(bn("M20 6 9 17l-5-5")),u});if(this.loading){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-loading";let h=document.createElement("span");h.className="nish-spinner nish-spinner--sm",h.setAttribute("aria-hidden","true"),c.append(h,document.createTextNode(s.searching)),d.push(c)}else if(o.length===0){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-empty",c.textContent=this.emptyText||s.noMatches,d.push(c)}a.replaceChildren(...d),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#o>=0&&o[this.#o]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#o}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#R(a,e),a.querySelector(`[data-index="${this.#o}"]`)?.scrollIntoView?.({block:"nearest"})}#R(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let i=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-i.bottom;s>r&&i.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};x("nish-combobox",ct);var ii=1500,Js=15e3,gn="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",Zs=N`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,er=N`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function tr(n){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(n),!0}catch{}let e=document.createElement("textarea");e.value=n,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:-1000px;opacity:0";let t=document.activeElement;document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.(),i}var ht=class extends S{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#i(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#i();if(!await tr(e)){await this.#n();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},ii)}async#n(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select();let i=new AbortController,s=()=>{i.abort(),this.#e&&clearTimeout(this.#e),this.#e=null,this.manual=!1};t?.addEventListener("copy",()=>{i.abort(),this.#e&&clearTimeout(this.#e),this.querySelector("button")?.focus(),this.manual=!1,this.copied=!0,this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},ii)},{signal:i.signal}),t?.addEventListener("blur",s,{signal:i.signal})}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},e?ii:Js)}render(){let e=A(),t=/Mac|iPhone|iPad/.test(navigator.platform||"")?e.copyManual.replace("Ctrl+C","Cmd+C"):e.copyManual,i=this.copiedLabel||e.copied,s=this.copied?i:this.manual?t:this.label||e.copy,r=this.copied?er:Zs;return k`${this.icon?k`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${s} title=${s} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
1
|
+
var ts=["emerald","indigo","amber","lime","rose","sky","violet","teal"],to=["accent","ok","loss","warn","info",...ts],ue={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},ns={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},is=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],ss=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],se=i=>Object.fromEntries(i.map((e,t)=>[`chart-${t+1}`,e])),rs={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",hi:"#ececf1",hi2:"#a8aab7",hi3:"#8a8d9b",ghost:"#6b6e7c",accent:"#8b93ff",accent2:"#c084fc","on-accent":"#0a0b0f",ok:"#34d399",loss:"#f87171",warn:"#fbbf24",info:"#38bdf8",scrim:"#000000","invert-bg":"#ececf1","invert-text":"#111218",...se(is),...ue}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",ghost:"#8a8c98",accent:"#4338ca",accent2:"#7e22ce","on-accent":"#ffffff","on-accent2":"#ffffff","on-ok":"#0a0a0c","on-loss":"#ffffff","on-warn":"#0a0a0c","on-info":"#0a0a0c",ok:"#065f46","ok-fill":"#059669","loss-fill":"#dc2626","warn-fill":"#c96d06","info-fill":"#0284c7",loss:"#a91b1b",warn:"#92400e",info:"#075985",scrim:"#17171c","invert-bg":"#17171c","invert-text":"#f7f6f3",...se(ss),...ns}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",ghost:"#71717a",accent:"#a5b4fc",accent2:"#c084fc","on-accent":"#18181b",ok:"#4ade80",loss:"#fda4af",warn:"#facc15",info:"#38bdf8",scrim:"#000000","invert-bg":"#f4f4f5","invert-text":"#202024",...se(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...ue,indigo:"#9aa1ff",rose:"#fc8395",violet:"#c792fc"}},terminal:{label:"Terminal",scheme:"dark",colors:{bg:"#050807",surface:"#0c110e",elevated:"#141c17",overlay:"#1c2820",line:"#233028","line-strong":"#34483b","line-control":"#5c6c61",hi:"#d1fae5",hi2:"#8fc4a8",hi3:"#74a68b",ghost:"#4f7a62",accent:"#34d399",accent2:"#2dd4bf","on-accent":"#050807",ok:"#4ade80",loss:"#f87171",warn:"#fbbf24",info:"#67e8f9",scrim:"#000000","invert-bg":"#d1fae5","invert-text":"#0c110e",...se(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...ue}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",ghost:"#78716c",accent:"#fdba74",accent2:"#f472b6","on-accent":"#1c1917",ok:"#4ade80",loss:"#fca5a5",warn:"#facc15",info:"#7dd3fc",scrim:"#000000","invert-bg":"#f5f0eb","invert-text":"#292524",...se(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...ue,indigo:"#a9afff",rose:"#fc99a7",sky:"#3ebff8",violet:"#cfa2fd"}},ocean:{label:"Ocean",scheme:"dark",colors:{bg:"#020c18",surface:"#061528",elevated:"#0a243e",overlay:"#103658",line:"#123050","line-strong":"#1f4a72","line-control":"#507291",hi:"#e0f2fe",hi2:"#9ccde6",hi3:"#6fa9c6",ghost:"#3f7392",accent:"#38bdf8",accent2:"#a78bfa","on-accent":"#020c18",ok:"#34d399",loss:"#fb7185",warn:"#fbbf24",info:"#7dd3fc",scrim:"#000000","invert-bg":"#38bdf8","invert-text":"#020c18",...se(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...ue}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#8a8a8a",hi:"#ffffff",hi2:"#d4d4d4",hi3:"#bdbdbd",ghost:"#8f8f8f",accent:"#ffd60a",accent2:"#7dd3fc","on-accent":"#000000",ok:"#4ade80",loss:"#ff6b6b",warn:"#ffd60a",info:"#7dd3fc",scrim:"#000000","invert-bg":"#ffffff","invert-text":"#000000",...se(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...ue}}},os=i=>{let e=i.colors,t=Object.fromEntries(["ok","loss","warn","info"].flatMap(n=>[[`${n}-fill`,e[`${n}-fill`]??e[n]],[`on-${n}`,e[`on-${n}`]??e["on-accent"]]]));return{...i,colors:{...e,...t,"on-accent2":e["on-accent2"]??e["on-accent"]}}},me=Object.fromEntries(Object.entries(rs).map(([i,e])=>[i,os(e)])),bn="dark";var as="3.3.0";var ls=Symbol.for("nish-ui.runtime.v1");function cs(){let i=globalThis;return i[ls]??={versions:new Set,slots:{}}}function hs(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}function ds(i){i.versions.add(as),i.versions.size>1&&!i.warned&&hs()&&(i.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...i.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var vn=!1;function pe(i,e){let t=cs();return vn||(vn=!0,ds(t)),i in t.slots||(t.slots[i]=e()),t.slots[i]}function we(i){if(i==null)return null;let e=String(i),t=0,n=e.length;for(;t<n&&e.charCodeAt(t)<=32;)t++;for(;n>t&&e.charCodeAt(n-1)<=32;)n--;let s=e.slice(t,n).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var Te={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(i,e)=>`Theme: ${i}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var yn={dismiss:"Dismiss",moreCount:i=>`${i} more`,copy:"Copy",copied:"Copied",copyFailed:"Copy failed",legend:"Legend",noData:"No data",noDataNamed:i=>`${i}: no data`,rangeLabel:(i,e,t,n,s)=>`Range ${i} to ${e}${t!=null?`, current ${t}`:""}, within ${n} to ${s}`,chartTruncated:(i,e)=>`First ${i} of ${e} points`};var En="nish-theme",Sn="nish.software",us=3600*24*365,re=()=>pe("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),ms=i=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${i}`)};function We(){if(typeof document>"u")return En;let i=document.documentElement.getAttribute("data-nish-storage-key");return i&&/^[A-Za-z0-9_-]+$/.test(i)?i:En}var fe=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);function Ot(i){return typeof i=="string"&&(fe(me,i)||fe(re().extra,i))}function ps(){if(typeof document>"u")return null;try{let i=document.cookie.match(new RegExp(`(?:^|;\\s*)${We()}=([a-z0-9-]+)(?:;|$)`));return i?i[1]:null}catch{return null}}var xn=(i,e)=>e===i||e.endsWith("."+i);function fs(i,e){let t=i.toLowerCase(),n=(e??"").trim().toLowerCase().replace(/^\./,"");return n?xn(n,t)?n:null:xn(Sn,t)?Sn:null}function gs(){return typeof location>"u"||typeof document>"u"?null:fs(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function ge(){let i=null;try{i=ps()??localStorage.getItem(We())}catch{}return i==="system"||Ot(i)?i:"system"}function bs(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":bn}function vs(){let i=document.documentElement.getAttribute("data-nish-themes");return i?i.split(/\s+/).filter(Ot):null}function kn(i=ge()){let e=i==="system"?bs():i,t=typeof document>"u"?null:vs();return t&&!t.includes(e)&&(e=qe(e)),e}function qe(i){let{extra:e}=re();return fe(me,i)?me[i].scheme:fe(e,i)?e[i]:"dark"}function Mn(i=ge()){let e=kn(i),t=document.documentElement,n=t.getAttribute("data-theme");return n&&n!==e&&ys(t),t.setAttribute("data-theme",e),t.setAttribute("data-scheme",qe(e)),t.setAttribute("data-theme-choice",i),t.style.colorScheme=qe(e),xs(),re().listeners.forEach(s=>s(i,e)),e}function ys(i){let e=re(),t=++e.switchId;i.setAttribute("data-nish-theme-switching","");let n=()=>{e.switchId===t&&i.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(n)):setTimeout(n,32)}function Es(i){if(i!=="system"&&!Ot(i))return ms(`unknown theme "${String(i)}" ignored. Register it with registerThemes() first.`),kn(ge());let e=We();try{localStorage.setItem(e,i)}catch{}try{let t=gs();if(t){let n=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${i}; Domain=.${t}; Path=/; Max-Age=${us}; SameSite=Lax${n}`}}catch{}return Mn(i)}function Ss(i){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${i}`).trim()}function xs(){let i=Ss("bg");if(!i)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=i}function ws(){let i=re();if(i.watching||typeof window>"u")return;i.watching=!0;let e=()=>{let t=ge();(t!==document.documentElement.getAttribute("data-theme-choice")||t==="system")&&Mn(t)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",t=>{t.key===We()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Ts(i){ws();let{listeners:e}=re();return e.add(i),()=>{e.delete(i)}}var Ve=["system","light","dark"];function Ls(){let i=_n(ge());return Es(i),i}var wn="http://www.w3.org/2000/svg";function Rt(i,e,t={}){let n=document.createElementNS(wn,"svg"),s={width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...t};for(let r of Object.keys(s))n.setAttribute(r,s[r]);for(let[r,o]of e){let l=document.createElementNS(wn,r);for(let a of Object.keys(o))l.setAttribute(a,o[a]);n.appendChild(l)}return n}var Tn={system:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["path",{d:"M8 21h8M12 17v4"}]],light:[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2M12 20v2m-7.07-2.93 1.41-1.41M17.66 6.34l1.41-1.41M2 12h2m16 0h2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41"}]],dark:[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"}]]},As=()=>({system:Te.themeSystem,light:Te.themeLight,dark:Te.themeDark}),Cs="set on another site";function _n(i){let e=Ve.indexOf(i);return Ve[(e+1)%Ve.length]}function $t(i,e){return i==="system"||i==="light"||i==="dark"?e[i]:fe(me,i)?me[i].label:i.charAt(0).toUpperCase()+i.slice(1)}function Nn(i,e={}){let t={...As(),...e.labels},n=e.strings?.themeToggleLabel??Te.themeToggleLabel,s=e.elsewhereLabel??Cs;i.tagName==="BUTTON"&&!i.getAttribute("type")&&i.setAttribute("type","button");let r=Object.keys(Tn).map(c=>Rt(16,Tn[c],{"data-icon":c}));if(e.showLabel){let c=document.createElement("span");c.setAttribute("data-theme-word",""),c.setAttribute("aria-hidden","true"),r.push(c)}i.replaceChildren(...r);let o=i.querySelector("[data-theme-word]"),l=c=>{let h=c==="system"||c==="light"||c==="dark"?c:qe(c);i.setAttribute("data-choice",c),i.querySelectorAll("svg[data-icon]").forEach(S=>{S.getAttribute("data-icon")===h?S.removeAttribute("display"):S.setAttribute("display","none")});let u=Ve.includes(c)||fe(re().extra,c)?"":` (${s})`,v=n(`${$t(c,t)}${u}`,$t(_n(c),t));i.setAttribute("aria-label",v),i.setAttribute("title",v),o&&(o.textContent=$t(c,t))},a=()=>{Ls()};i.addEventListener("click",a);let d=Ts(c=>l(c));return l(ge()),()=>{i.removeEventListener("click",a),d()}}var Ln=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],An=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],ks={neutral:An,info:An,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:Ln,loss:Ln},Ms=6e3,V=null,Le=null;function $n(i,e={}){Le?.(),(!V||!V.isConnected)&&(V=document.querySelector(".nish-toast-region")),V||(V=document.createElement("div"),V.setAttribute("role","status"),V.setAttribute("aria-live","polite"),V.className="nish-toast-region",document.body.appendChild(V));let t=V,n=document.createElement("div");n.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Rt(15,ks[e.tone??"neutral"])),n.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof i=="string"?document.createTextNode(i):i),n.append(r);let o=null,l=e.duration==="sticky"?1/0:e.duration??Ms,a=0,d=0,c=null,h=()=>{o!=null&&clearTimeout(o),o=null;let b=n.contains(document.activeElement);n.remove(),b&&c?.isConnected&&c.focus(),Le===h&&(Le=null)},u=b=>{Number.isFinite(b)&&(a=Date.now(),o=setTimeout(h,b))},v=()=>{d+=1,!(d>1||o==null)&&(clearTimeout(o),o=null,l=Math.max(0,l-(Date.now()-a)))},S=()=>{d!==0&&(d-=1,d===0&&u(Math.max(l,1e3)))},g=e.action,f=g?.href!=null?we(g.href):null;if(g&&(g.href==null||f!=null)){let b=document.createElement(g.href!=null?"a":"button");b.className="nish-toast-action",b.textContent=g.label,f!=null?b.href=f:b.type="button",b.addEventListener("click",()=>{g.onClick?.(),h()}),n.append(b)}let L=document.createElement("button");return L.type="button",L.className="nish-toast-close",L.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??yn.dismiss),L.append(Rt(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),L.addEventListener("click",h),n.append(L),n.addEventListener("pointerenter",b=>b.pointerType==="mouse"&&v()),n.addEventListener("pointerleave",b=>b.pointerType==="mouse"&&S()),n.addEventListener("focusin",b=>{n.contains(b.relatedTarget)||(b.relatedTarget instanceof HTMLElement&&(c=b.relatedTarget),v())}),n.addEventListener("focusout",b=>!n.contains(b.relatedTarget)&&S()),n.addEventListener("keydown",b=>{b.key==="Escape"&&h()}),setTimeout(()=>{Le===h&&(t.append(n),u(l))},50),Le=h,h}function Cn(i,e){if(e.target!==i)return!1;let t=i.getBoundingClientRect();return!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)}var _s=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Pt(i){if(typeof document>"u")return()=>{};let e=!1,t=!1;if(i.open)return()=>s();let n=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!i.open)return;e=!0;let m,y=()=>{i.removeEventListener("animationend",C),m!==void 0&&clearTimeout(m),i.removeAttribute("data-closing"),i.style.transform="",i.style.transition="",e=!1,i.open&&i.close()},C=_=>{_.target===i&&y()};if(_s()){y();return}i.style.transform="",i.setAttribute("data-closing",""),i.addEventListener("animationend",C),m=setTimeout(y,260)}let r=m=>{m.preventDefault(),s()},o=m=>{m.key==="Escape"&&m.stopPropagation()},l=null,a=m=>{l=Cn(i,m)},d=m=>{if(m.target===i){let y=l;l=null,y!==!1&&Cn(i,m)&&s();return}m.target instanceof Element&&m.target.closest("[data-sheet-close]")&&s()},c=0,h=0,u=0,v=0,S=1,g=m=>{if(m.pointerType==="mouse"||e||!m.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let y=i.getBoundingClientRect();!(m.target instanceof Element&&m.target.closest(".nish-sheet-header")!=null)&&m.clientY-y.top>44||(t=!0,c=h=m.clientY,u=m.timeStamp,v=0,S=y.height||1,i.style.transition="none",i.setPointerCapture?.(m.pointerId))},f=m=>{if(!t)return;let y=m.clientY-c,C=m.timeStamp-u;C>0&&(v=(m.clientY-h)/C),h=m.clientY,u=m.timeStamp,i.style.transform=`translateY(${y>=0?y:y*.3}px)`},L=m=>{if(!t)return;t=!1,i.releasePointerCapture?.(m.pointerId);let y=m.clientY-c;if(m.type!=="pointercancel"&&(y>S*.3||v>.5)){s();return}i.style.transition="transform 180ms var(--nish-ease-out, ease-out)",i.style.transform="",setTimeout(()=>{e||(i.style.transition="")},200)},b=()=>{i.removeEventListener("cancel",r),i.removeEventListener("keydown",o),i.removeEventListener("click",d),i.removeEventListener("pointerdown",a),i.removeEventListener("pointerdown",g),i.removeEventListener("pointermove",f),i.removeEventListener("pointerup",L),i.removeEventListener("pointercancel",L),i.removeEventListener("close",b),n?.isConnected&&n.focus()};return i.addEventListener("cancel",r),i.addEventListener("keydown",o),i.addEventListener("click",d),i.addEventListener("pointerdown",a),i.addEventListener("pointerdown",g),i.addEventListener("pointermove",f),i.addEventListener("pointerup",L),i.addEventListener("pointercancel",L),i.addEventListener("close",b),i.showModal(),s}function It(i,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=i.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(n),s.observe(i)):window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}function Rn(i,e={}){let t=Object.assign(()=>{},{lock:y=>{}});if(typeof document>"u")return t;let n=Array.from(i.querySelectorAll('a[href^="#"]')).filter(y=>y.hash.length>1),s=y=>{try{return document.getElementById(decodeURIComponent(y.hash.slice(1)))}catch{return null}},r=e.height===!1?()=>{}:It(i,"--nish-sticky-extra"),o=null,l=null,a=null,d=()=>{let y=i.scrollWidth-i.clientWidth,C=getComputedStyle(i).direction==="rtl"?i.scrollLeft+y:i.scrollLeft;i.dataset.atStart=String(C<=1),i.dataset.atEnd=String(y<=1||C>=y-1)},c=y=>{let C=y.getBoundingClientRect().left-i.getBoundingClientRect().left+i.scrollLeft-i.clientLeft,_=i.clientWidth;C<i.scrollLeft+24?i.scrollLeft=Math.max(0,C-24):C+y.offsetWidth>i.scrollLeft+_-24&&(i.scrollLeft=C+y.offsetWidth-_+24)},h=y=>{y!==o&&(o?.removeAttribute("aria-current"),o=y,y&&(y.setAttribute("aria-current","true"),c(y)))},u=()=>{let y=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,C=e.offset??y+i.offsetHeight+8,_=n[0]??null;for(let F of n){let T=s(F);T&&T.getBoundingClientRect().top<=C+1&&(_=F)}let G=document.documentElement;if(window.innerHeight+window.scrollY>=G.scrollHeight-2)for(let F of n)s(F)&&(_=F);h(l??_)},v=()=>{a?.(),a=null,l=null},S=y=>{let C=n.find(D=>{try{return decodeURIComponent(D.hash.slice(1))===y}catch{return!1}});if(!C)return;v(),l=C,h(C);let _=()=>{v(),f()},G=D=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "].includes(D.key)&&_()},F=!1,T=()=>{F=!0},R=setTimeout(T,400),H=()=>{F?_():(clearTimeout(R),R=setTimeout(T,200))},U=()=>{clearTimeout(R),R=setTimeout(T,50)};window.addEventListener("wheel",_,{passive:!0}),window.addEventListener("touchstart",_,{passive:!0}),window.addEventListener("keydown",G),window.addEventListener("scroll",H,{passive:!0}),window.addEventListener("scrollend",U),a=()=>{clearTimeout(R),window.removeEventListener("wheel",_),window.removeEventListener("touchstart",_),window.removeEventListener("keydown",G),window.removeEventListener("scroll",H),window.removeEventListener("scrollend",U)}},g=0,f=()=>{g||(g=requestAnimationFrame(()=>{g=0,u()}))},L=y=>{let C=y.target instanceof Element?y.target.closest('a[href^="#"]'):null;C&&n.includes(C)&&h(C)};d(),u(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f),i.addEventListener("scroll",d,{passive:!0}),i.addEventListener("click",L);let b;return typeof ResizeObserver<"u"&&(b=new ResizeObserver(()=>{d(),f()}),b.observe(i)),Object.assign(()=>{v(),g&&cancelAnimationFrame(g),window.removeEventListener("scroll",f),window.removeEventListener("resize",f),i.removeEventListener("scroll",d),i.removeEventListener("click",L),b?.disconnect(),r(),o?.removeAttribute("aria-current"),delete i.dataset.atStart,delete i.dataset.atEnd},{lock:S})}var On=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var q=function(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},I=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},be,je,Ke,Ae,Ht,Ce,Ye,oe,ke,Q,Xe,Pn;var O={__proto__:null};O.enumerable=!0;Object.freeze(O);var Dt=(Q=class{constructor(e,t={}){if(be.set(this,!1),je.set(this,!1),Ke.set(this,!1),Ae.set(this,!1),Ht.set(this,Date.now()),Ce.set(this,!1),Ye.set(this,void 0),oe.set(this,void 0),ke.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:n,cancelable:s,composed:r}=t;q(this,be,!!s,"f"),q(this,je,!!n,"f"),q(this,Ke,!!r,"f"),q(this,Ye,`${e}`,"f"),q(this,oe,null,"f"),q(this,ke,!1,"f")}initEvent(e,t,n){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){q(this,Ae,!0,"f")}get target(){return I(this,oe,"f")}get currentTarget(){return I(this,oe,"f")}get srcElement(){return I(this,oe,"f")}get type(){return I(this,Ye,"f")}get cancelable(){return I(this,be,"f")}get defaultPrevented(){return I(this,be,"f")&&I(this,Ae,"f")}get timeStamp(){return I(this,Ht,"f")}composedPath(){return I(this,ke,"f")?[I(this,oe,"f")]:[]}get returnValue(){return!I(this,be,"f")||!I(this,Ae,"f")}get bubbles(){return I(this,je,"f")}get composed(){return I(this,Ke,"f")}get eventPhase(){return I(this,ke,"f")?Q.AT_TARGET:Q.NONE}get cancelBubble(){return I(this,Ce,"f")}set cancelBubble(e){e&&q(this,Ce,!0,"f")}stopPropagation(){q(this,Ce,!0,"f")}get isTrusted(){return!1}},be=new WeakMap,je=new WeakMap,Ke=new WeakMap,Ae=new WeakMap,Ht=new WeakMap,Ce=new WeakMap,Ye=new WeakMap,oe=new WeakMap,ke=new WeakMap,Q.NONE=0,Q.CAPTURING_PHASE=1,Q.AT_TARGET=2,Q.BUBBLING_PHASE=3,Q);Object.defineProperties(Dt.prototype,{initEvent:O,stopImmediatePropagation:O,preventDefault:O,target:O,currentTarget:O,srcElement:O,type:O,cancelable:O,defaultPrevented:O,timeStamp:O,composedPath:O,returnValue:O,bubbles:O,composed:O,eventPhase:O,cancelBubble:O,stopPropagation:O,isTrusted:O});var In=(Pn=class extends Dt{constructor(e,t={}){super(e,t),Xe.set(this,void 0),q(this,Xe,t?.detail??null,"f")}initCustomEvent(e,t,n,s){throw new Error("Method not implemented.")}get detail(){return I(this,Xe,"f")}},Xe=new WeakMap,Pn);Object.defineProperties(In.prototype,{detail:O});var K=Dt,Bt=In;var B;var vo=(B=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},B.STYLE_RULE=1,B.CHARSET_RULE=2,B.IMPORT_RULE=3,B.MEDIA_RULE=4,B.FONT_FACE_RULE=5,B.PAGE_RULE=6,B.NAMESPACE_RULE=10,B.KEYFRAMES_RULE=7,B.KEYFRAME_RULE=8,B.SUPPORTS_RULE=12,B.COUNTER_STYLE_RULE=11,B.FONT_FEATURE_VALUES_RULE=14,B.MARGIN_RULE=9,B);globalThis.Event??=K;globalThis.CustomEvent??=Bt;var Ut=Symbol(),Hn=i=>typeof i=="boolean"?i:i?.capture??!1,Y={__proto__:null};Y.enumerable=!0;Object.freeze(Y);var Ze=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,n){if(t==null)return;let s=Hn(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof n=="object"&&n?n:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,n)),r.set(t,o??{})}removeEventListener(e,t,n){if(t==null)return;let s=Hn(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(t),r.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let n=!1,s=!1,r=K.NONE,o=null,l=null,a=null,d=e.stopPropagation,c=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...Y},srcElement:{get(){return e.target},...Y},currentTarget:{get(){return a},...Y},eventPhase:{get(){return r},...Y},composedPath:{value:()=>t,...Y},stopPropagation:{value:()=>{n=!0,d.call(e)},...Y},stopImmediatePropagation:{value:()=>{s=!0,c.call(e)},...Y}});let h=(f,L,b)=>{typeof f=="function"?f(e):typeof f?.handleEvent=="function"&&f.handleEvent(e),L.once&&b.delete(f)},u=()=>(a=null,r=K.NONE,!e.defaultPrevented),v=t.slice().reverse();o=!this.__host||!e.composed?this:null;let S=f=>{for(l=this;l.__host&&f.includes(l.__host);)l=l.__host};for(let f of v){!o&&(!l||l===f.__host)&&S(v.slice(v.indexOf(f))),a=f,r=f===e.target?K.AT_TARGET:K.CAPTURING_PHASE;let L=f.__captureEventListeners.get(e.type);if(L){for(let[b,m]of L)if(h(b,m,L),s)return u()}if(n)return u()}let g=e.bubbles?t:[this];l=null;for(let f of g){!o&&(!l||f===l.__host)&&S(g.slice(0,g.indexOf(f)+1)),a=f,r=f===e.target?K.AT_TARGET:K.BUBBLING_PHASE;let L=f.__eventListeners.get(e.type);if(L){for(let[b,m]of L)if(h(b,m,L),s)return u()}if(n)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Fn,Rs]}};var Dn=new WeakMap,Me=i=>{let e=Dn.get(i);return e===void 0&&Dn.set(i,e=new Map),e},_e=class extends Ze{getRootNode(e){return e?.composed?Ft:this.__host?.__shadowRoot??Ft}};var Bn=class extends _e{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Fn=new Bn,Ft=Fn;var Un=class extends _e{constructor(e){if(super(),e!==Ut)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Qe,customElements:Gt,document:Ft,Document:Bn,Element:zn,EventTarget:Ze,HTMLElement:Gn,Node:_e,ShadowRoot:Vn,window:this,Window:Un})}};var zn=class extends _e{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Me(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){Me(this).set(e,String(t))}removeAttribute(e){Me(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return Me(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new Vn(Ut,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new On(this);return this.__internals=e,e}getAttribute(e){return Me(this).get(e)??null}};var Gn=class extends zn{},zt=Gn;var Vn=class extends _e{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new zt,"localName",{get(){return"lit-server-root"}});function Ns(){let i,e;return{promise:new Promise((n,s)=>{i=n,e=s}),resolve:i,reject:e}}var Qe=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let n=this.__pendingWhenDefineds.get(e);return n||(n=Ns(),this.__pendingWhenDefineds.set(e,n)),n.promise}},$s=Qe;var Gt=new $s,Rs=new Un(Ut);var Ne=globalThis,et=Ne.ShadowRoot&&(Ne.ShadyCSS===void 0||Ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wn=Symbol(),qn=new WeakMap,Je=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Wn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(et&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=qn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&qn.set(t,e))}return e}toString(){return this.cssText}},jn=i=>new Je(typeof i=="string"?i:i+"",void 0,Wn);var Kn=(i,e)=>{if(et)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=Ne.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Vt=et||Ne.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return jn(t)})(i):i;var{is:Os,defineProperty:Ps,getOwnPropertyDescriptor:Is,getOwnPropertyNames:Hs,getOwnPropertySymbols:Ds,getPrototypeOf:Bs}=Object,Re=globalThis;Re.customElements??=Gt;var Yn=Re.trustedTypes,Fs=Yn?Yn.emptyScript:"",Us=Re.reactiveElementPolyfillSupport,$e=(i,e)=>i,qt={toAttribute(i,e){switch(e){case Boolean:i=i?Fs:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Zn=(i,e)=>!Os(i,e),Xn={attribute:!0,type:String,converter:qt,reflect:!1,useDefault:!1,hasChanged:Zn};Symbol.metadata??=Symbol("metadata"),Re.litPropertyMetadata??=new WeakMap;var X=class extends(globalThis.HTMLElement??zt){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Xn){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Ps(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Is(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let l=s?.call(this);r?.call(this,o),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Xn}static _$Ei(){if(this.hasOwnProperty($e("elementProperties")))return;let e=Bs(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($e("properties"))){let t=this.properties,n=[...Hs(t),...Ds(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Vt(s))}else e!==void 0&&t.push(Vt(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Kn(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:qt).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=n.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:qt;this._$Em=s;let l=o.fromAttribute(t,r.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,n,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??Zn)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[s,r]of n){let{wrapped:o}=r,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,r,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};X.elementStyles=[],X.shadowRootOptions={mode:"open"},X[$e("elementProperties")]=new Map,X[$e("finalized")]=new Map,Us?.({ReactiveElement:X}),(Re.reactiveElementVersions??=[]).push("2.1.2");var nt=globalThis,Qn=i=>i,tt=nt.trustedTypes,Jn=tt?tt.createPolicy("lit-html",{createHTML:i=>i}):void 0,ri="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,oi="?"+J,zs=`<${oi}>`,ce=nt.document===void 0?{createTreeWalker:()=>({})}:document,Pe=()=>ce.createComment(""),Ie=i=>i===null||typeof i!="object"&&typeof i!="function",Qt=Array.isArray,Gs=i=>Qt(i)||typeof i?.[Symbol.iterator]=="function",Wt=`[
|
|
3
|
+
\f\r]`,Oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ei=/-->/g,ti=/>/g,ae=RegExp(`>|${Wt}(?:([^\\s"'>=/]+)(${Wt}*=${Wt}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ni=/'/g,ii=/"/g,ai=/^(?:script|style|textarea|title)$/i,Jt=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),M=Jt(1),$=Jt(2),Qo=Jt(3),he=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),si=new WeakMap,le=ce.createTreeWalker(ce,129);function li(i,e){if(!Qt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Jn!==void 0?Jn.createHTML(e):e}var Vs=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Oe;for(let l=0;l<t;l++){let a=i[l],d,c,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,c=o.exec(a),c!==null);)u=o.lastIndex,o===Oe?c[1]==="!--"?o=ei:c[1]!==void 0?o=ti:c[2]!==void 0?(ai.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=ae):c[3]!==void 0&&(o=ae):o===ae?c[0]===">"?(o=s??Oe,h=-1):c[1]===void 0?h=-2:(h=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?ae:c[3]==='"'?ii:ni):o===ii||o===ni?o=ae:o===ei||o===ti?o=Oe:(o=ae,s=void 0);let v=o===ae&&i[l+1].startsWith("/>")?" ":"";r+=o===Oe?a+zs:h>=0?(n.push(d),a.slice(0,h)+ri+a.slice(h)+J+v):a+J+(h===-2?l:v)}return[li(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},He=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[d,c]=Vs(e,t);if(this.el=i.createElement(d,n),le.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=le.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(ri)){let u=c[o++],v=s.getAttribute(h).split(J),S=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:S[2],strings:v,ctor:S[1]==="."?Kt:S[1]==="?"?Yt:S[1]==="@"?Xt:ye}),s.removeAttribute(h)}else h.startsWith(J)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(ai.test(s.tagName)){let h=s.textContent.split(J),u=h.length-1;if(u>0){s.textContent=tt?tt.emptyScript:"";for(let v=0;v<u;v++)s.append(h[v],Pe()),le.nextNode(),a.push({type:2,index:++r});s.append(h[u],Pe())}}}else if(s.nodeType===8)if(s.data===oi)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(J,h+1))!==-1;)a.push({type:7,index:r}),h+=J.length-1}r++}}static createElement(e,t){let n=ce.createElement("template");return n.innerHTML=e,n}};function ve(i,e,t=i,n){if(e===he)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=Ie(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=ve(i,s._$AS(i,e.values),s,n)),e}var jt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??ce).importNode(t,!0);le.currentNode=s;let r=le.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new De(r,r.nextSibling,this,e):a.type===1?d=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(d=new Zt(r,this,e)),this._$AV.push(d),a=n[++l]}o!==a?.index&&(r=le.nextNode(),o++)}return le.currentNode=ce,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},De=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ve(this,e,t),Ie(e)?e===E||e==null||e===""?(this._$AH!==E&&this._$AR(),this._$AH=E):e!==this._$AH&&e!==he&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Gs(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==E&&Ie(this._$AH)?this._$AA.nextSibling.data=e:this.T(ce.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=He.createElement(li(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new jt(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=si.get(e.strings);return t===void 0&&si.set(e.strings,t=new He(e)),t}k(e){Qt(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(Pe()),this.O(Pe()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Qn(e).nextSibling;Qn(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ye=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=E,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=E}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=ve(this,e,t,0),o=!Ie(e)||e!==this._$AH&&e!==he,o&&(this._$AH=e);else{let l=e,a,d;for(e=r[0],a=0;a<r.length-1;a++)d=ve(this,l[n+a],t,a),d===he&&(d=this._$AH[a]),o||=!Ie(d)||d!==this._$AH[a],d===E?e=E:e!==E&&(e+=(d??"")+r[a+1]),this._$AH[a]=d}o&&!s&&this.j(e)}j(e){e===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Kt=class extends ye{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===E?void 0:e}},Yt=class extends ye{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==E)}},Xt=class extends ye{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=ve(this,e,t,0)??E)===he)return;let n=this._$AH,s=e===E&&n!==E||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==E&&(n===E||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Zt=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ve(this,e)}};var qs=nt.litHtmlPolyfillSupport;qs?.(He,De),(nt.litHtmlVersions??=[]).push("3.3.3");var ci=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new De(e.insertBefore(Pe(),r),r,void 0,t??{})}return s._$AI(i),s};var en=globalThis,ee=class extends X{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ci(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return he}};ee._$litElement$=!0,ee.finalized=!0,en.litElementHydrateSupport?.({LitElement:ee});var Ws=en.litElementPolyfillSupport;Ws?.({LitElement:ee});(en.litElementVersions??=[]).push("4.2.2");var Ee={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:i=>`${i} result${i===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:i=>`${i} active`,remove:"Remove",removeNamed:i=>`Remove ${i}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:i=>`${i}: no data`,seriesNumber:i=>`Series ${i}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(i,e)=>`Theme: ${i}. Switch to ${e}`,themeElsewhere:"set on another site"};function tn(){return pe("element-strings",()=>({values:{...Ee},listeners:new Set}))}function js(i){let e=tn(),t={...e.values};for(let[n,s]of Object.entries(i))s!==void 0&&Object.hasOwn(Ee,n)&&(t[n]=s);e.values=t;for(let n of Array.from(e.listeners))n()}function A(){let i=tn(),e=i.values;return Object.keys(Ee).some(n=>e[n]===void 0)&&(i.values={...Ee,...Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0))}),i.values}function hi(i){let e=tn().listeners;return e.add(i),()=>{e.delete(i)}}var x=class extends ee{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=hi(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function N(i){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}function w(i,e){customElements.get(i)||customElements.define(i,e)}function z(i){return!!i&&getComputedStyle(i).direction==="rtl"}function it(i,e){let t=null,n=()=>Array.from(i.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let d of n()){if(e?.(d),!d.getAttribute("href"))continue;let c;try{c=new URL(d.getAttribute("href"),location.href)}catch{continue}if(c.origin!==location.origin)continue;let h=d.getAttribute("href").trim();if(h==="#"||h.startsWith("?")||c.pathname===location.pathname&&!c.hash&&h.startsWith("#"))continue;if(c.hash&&c.pathname===location.pathname){c.hash===location.hash&&(l=d,a=1/0);continue}let u=c.pathname;(u==="/"?o==="/":o===u||o.startsWith(u.endsWith("/")?u:`${u}/`))&&u.length>a&&(l=d,a=u.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let d of n())d.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(i,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(i,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var st=class extends x{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#n=null;#t=null;#i=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),N(()=>this.#r())}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-bottom-nav");if(!e){for(e=document.createElement("nav"),e.className="nish-bottom-nav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#a(),this.#t=it(e,t=>t.classList.add("nish-bottom-nav-item")),this.#n=It(e,"--nish-bottom-nav-h"),this.#i=new MutationObserver(()=>{let t=this.#e;if(t)for(let n of Array.from(this.children))n!==t&&t.appendChild(n)}),this.#i.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#i?.disconnect(),this.#i=null,this.#t?.(),this.#t=null,this.#n?.(),this.#n=null}updated(e){this.#a()}#a(){this.#e&&(this.#e.setAttribute("aria-label",this.label||A().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};w("nish-bottom-nav",st);var di=0,rt=class extends x{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-dialog-open]");t&&t.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-dialog-title"),n=e.querySelector(".nish-dialog-body");t?(t.id||(t.id=`nish-dialog-title-${++di}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),n?(n.id||(n.id=`nish-dialog-body-${++di}`),e.setAttribute("aria-describedby",n.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let t=this.dialog;if(t){if(e.target===t){let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||this.close();return}if(e.target instanceof Element){let n=e.target.closest("[data-dialog-close]");n&&n.closest("dialog")===t&&this.close(n.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let t=this.opener;this.opener=null,t?.isConnected&&t.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};w("nish-dialog",rt);var Ks=0,ot=class extends x{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-sheet-open]");t&&t.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-sheet-title");t?(t.id||(t.id=`nish-sheet-title-${++Ks}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=Pt(e):this.open&&e.hasAttribute("data-closing")?this.reopen=!0:!this.open&&e.open&&(this.reopen=!1,this.closeSheet?.()))}reopen=!1;onDialogClose=()=>{if(this.closeSheet=null,this.reopen){this.reopen=!1,setTimeout(()=>{this.open&&this.isConnected&&this.dialog&&!this.dialog.open&&(this.closeSheet=Pt(this.dialog))},0);return}this.open&&(this.open=!1),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};w("nish-sheet",ot);var at=class extends x{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#n=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#c()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}updated(e){this.#e&&this.#t!==this.#r()&&this.#c()}#t="";#i(){let e=A();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#r(){let e=A();return JSON.stringify([this.labelled,this.pill,...this.#i(),e.themeToggleLabel?.("{a}","{b}"),e.themeElsewhere])}#a(){this.#n?.(),this.#n=null,this.#e?.remove(),this.#e=null}#c(){this.#a(),this.#t=this.#r();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[t,n,s]=this.#i(),r={system:t,light:n,dark:s},o=A();this.#n=Nn(e,{showLabel:this.labelled,labels:r,...o.themeToggleLabel?{strings:{themeToggleLabel:o.themeToggleLabel}}:{},...o.themeElsewhere?{elsewhereLabel:o.themeElsewhere}:{}})}};w("nish-theme-toggle",at);var ui="http://www.w3.org/2000/svg";function mi(i,e){let t=document.createElementNS(ui,"svg");for(let[n,s]of Object.entries({width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(n,s);for(let n of e){let s=document.createElementNS(ui,"path");s.setAttribute("d",n),t.appendChild(s)}return t}var lt=i=>mi(i,["M18 6 6 18M6 6l12 12"]),pi=i=>mi(i,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var ct=class extends x{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#n=null;#t=null;#i=e=>this.#u(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#s(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),n=!1;for(let s of this.#a()){let r=t.has(this.#s(s))&&!(this.single&&n);r&&(n=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),N(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#e?.removeEventListener("click",this.#i),this.#e=null}updated(e){this.#o(),this.#r()}#r(){if(!this.#e)return;let e=A();for(let t of this.#a()){let n=t.querySelector(":scope > [data-nish-remove]");if(!n)continue;let s=this.#c(t);n.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(n=>{(n.nodeType===Node.TEXT_NODE||n instanceof HTMLElement&&!n.hasAttribute("data-nish-remove"))&&(t+=n.textContent??"")}),t.trim()}#s(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#i),this.#o(),this.#d(),this.#t&&(this.values=this.#t,this.#t=null),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#d(),this.#h()}),this.#h()}#h(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#o(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#d(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),n=document.createElement("button");n.type="button",n.className="nish-icon-btn nish-icon-btn--xs",n.setAttribute("data-nish-remove",""),n.setAttribute("aria-label",t?A().removeNamed(t):A().remove),n.appendChild(lt(12)),e.appendChild(n)}}#u(e){let t=e.target;if(!t||!this.#e)return;let n=t.closest("[data-nish-remove]");if(n&&this.#e.contains(n)){let o=n.parentElement,l=this.#s(o),a=null;if(o.contains(document.activeElement)){let d=this.#a(),c=d.indexOf(o);for(let h of[...d.slice(c+1),...d.slice(0,c).reverse()]){if(a=h.matches("button")?h:h.querySelector("button, a[href], [tabindex]"),a&&!a.disabled)break;a=null}a||(this.#e.tabIndex=-1,a=this.#e)}o.remove(),a?.focus(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};w("nish-chip-group",ct);var fi=(i,e)=>Ys(i.label.toLowerCase(),i.hint?.toLowerCase(),e.trim().toLowerCase());function Ys(i,e,t){return t?i.includes(t)||(e?.includes(t)??!1):!0}var Qs=0,gi="http://www.w3.org/2000/svg",Js="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function bi(i){let e=document.createElementNS(gi,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(gi,"path");return t.setAttribute("d",i),e.append(t),e}var ht=class extends x{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++Qs;#n=null;#t=null;#i=null;#r=null;#a=null;#c=null;#s=!1;#l="";#h=!1;#o=-1;#d;#u=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#n){this.#w();return}this.#u||(this.#u=!0,N(()=>{this.#u=!1,this.isConnected&&this.#p()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#d),this.#m()}#p(){if(this.#n)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.getAttribute("label")||a.textContent?.trim()||a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let n=document.createElement("div");n.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#N(s.value)),s.addEventListener("keydown",a=>this.#$(a)),s.addEventListener("focus",()=>this.#x()),s.addEventListener("click",()=>this.#x()),s.addEventListener("blur",()=>{this.#C()||(this.#m(),this.#E(),this.#w())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(bi("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#L(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=Js;let l=document.createElement("input");l.type="hidden",n.append(s,r,o),this.append(n,l),this.#n=n,this.#t=s,this.#i=r,this.#r=o,this.#c=l,this.#w()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#E(),e.has("disabled")&&this.disabled&&this.#m(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#y(),this.#w()}get#b(){return this.options.find(e=>e.value===this.value)??null}get#g(){return this.value!=null&&this.value!==""}get#S(){return this.#h?this.#l:this.#b?.label??this.value??""}#v=null;get#f(){let e=this.#v;if(e&&e.options===this.options&&e.filter===this.filter&&e.text===this.#l&&e.dirty===this.#h)return e.list;let t=this.filter??fi,n=(this.#h?this.options.filter(s=>t(s,this.#l)):this.options).slice(0,50);return this.#v={options:this.options,filter:this.filter,text:this.#l,dirty:this.#h,list:n},n}#y(){this.#o>=this.#f.length&&(this.#o=-1)}#E(){this.#h=!1,this.#l=""}#x(){if(this.#s||this.disabled||!this.#t)return;this.#s=!0;let e=this.#b,t=e?this.#f.findIndex(n=>n.value===e.value):-1;this.#o=t>=0?t:-1,this.#w()}#m(){this.#s=!1,this.#o=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#r&&(this.#r.textContent="")}#T(e,t){let n=this.#f,s=n.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!n[r].disabled)return r;return-1}#A(e){return e===1?this.#T(-1,1):this.#T(0,-1)}#L(e,t){this.value=e,this.#E(),this.#w();let n={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:n}))}#k(e){e.disabled||(this.#m(),this.#L(e.value,e))}#C(){return!this.#h||this.#l.trim()!==""||!this.#g?!1:(this.#m(),this.#L(null,null),!0)}#M(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(n=>!n.disabled&&n.label.toLowerCase()===e.toLowerCase());return this.#m(),t?this.#L(t.value,t):this.#L(e,null),!0}#N(e){this.#l=e,this.#h=!0,this.#s=!0,this.allowCustom||e.trim()===""?this.#o=-1:this.#o=this.#f.findIndex(t=>!t.disabled),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#w()}#$(e){if(this.disabled)return;let t=this.#f;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let n=e.key==="ArrowDown"?1:-1;if(this.#s){this.#_(this.#o<0?this.#A(n):this.#T(this.#o,n));break}else{this.#s=!0;let s=this.#b,r=s?t.findIndex(o=>o.value===s.value):-1;this.#o=r>=0?r:this.#A(n)}this.#w();break}case"Home":case"End":this.#s&&(e.preventDefault(),this.#_(this.#A(e.key==="Home"?1:-1)));break;case"Enter":this.#s&&this.#o>=0&&t[this.#o]?(e.preventDefault(),this.#k(t[this.#o])):(this.#C()||this.#M()||this.#s)&&e.preventDefault();break;case"Escape":this.#s?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#w()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#w());break;case"Tab":this.#m();break}}#w(){let e=this.#t,t=this.#n;if(!e||!t||!this.#i||!this.#c||!this.#r)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let n=this.#S;e.value!==n&&(e.value=n),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#i.setAttribute("aria-label",A().clear),this.#i.hidden=!(this.#g&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#s){this.#a&&this.#m();return}this.#R(e,t,this.#r)}#_(e){let t=this.#o;this.#o=e;let n=this.#a,s=this.#t;if(!n||!s||!this.#s){this.#w();return}n.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?n.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#w():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#R(e,t,n){let s=A(),r=`nish-cb-list-${this.#e}`,o=this.#f,l=this.#b,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let c=h=>{let u=h.target?.closest("li[data-index]");if(!u||!a.contains(u))return null;let v=Number(u.dataset.index),S=this.#f[v];return S?{o:S,i:v}:null};a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("mousemove",h=>{let u=c(h);u&&!u.o.disabled&&this.#o!==u.i&&this.#_(u.i)}),a.addEventListener("click",h=>{let u=c(h);u&&this.#k(u.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let d=o.map((c,h)=>{let u=document.createElement("li");u.id=`${r}-opt-${h}`,u.className="nish-combobox-option",u.setAttribute("role","option"),u.dataset.index=String(h),u.setAttribute("aria-selected",String(l?.value===c.value)),c.disabled&&u.setAttribute("aria-disabled","true"),h===this.#o&&(u.dataset.active="");let v=document.createElement("span");if(v.className="nish-combobox-label",v.textContent=c.label,u.append(v),c.hint){let S=document.createElement("span");S.className="nish-combobox-hint",S.textContent=c.hint,u.append(S)}return l?.value===c.value&&u.append(bi("M20 6 9 17l-5-5")),u});if(this.loading){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-loading";let h=document.createElement("span");h.className="nish-spinner nish-spinner--sm",h.setAttribute("aria-hidden","true"),c.append(h,document.createTextNode(s.searching)),d.push(c)}else if(o.length===0){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-empty",c.textContent=this.emptyText||s.noMatches,d.push(c)}a.replaceChildren(...d),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#o>=0&&o[this.#o]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#o}`):e.removeAttribute("aria-activedescendant"),n.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#O(a,e),a.querySelector(`[data-index="${this.#o}"]`)?.scrollIntoView?.({block:"nearest"})}#O(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let n=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-n.bottom;s>r&&n.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};w("nish-combobox",ht);var nn=1500,er=15e3,vi="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",tr=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,nr=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function ir(i,e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(i),!0}catch{}let t=document.createElement("textarea");t.value=i,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:-1000px;opacity:0";let n=document.activeElement;(e.closest("dialog[open]")??e).appendChild(t),t.select();let s=!1;try{s=document.execCommand("copy")}catch{s=!1}return t.remove(),n?.focus?.(),s}var dt=class extends x{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#n(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#n();if(!await ir(e,this)){await this.#i();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},nn)}async#i(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select();let n=new AbortController,s=()=>{n.abort(),this.#e&&clearTimeout(this.#e),this.#e=null,this.manual=!1};t?.addEventListener("copy",()=>{n.abort(),this.#e&&clearTimeout(this.#e),this.querySelector("button")?.focus(),this.manual=!1,this.copied=!0,this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},nn)},{signal:n.signal}),t?.addEventListener("blur",s,{signal:n.signal})}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},e?nn:er)}render(){let e=A(),t=/Mac|iPhone|iPad/.test(navigator.platform||"")?e.copyManual.replace("Ctrl+C","Cmd+C"):e.copyManual,n=this.copiedLabel||e.copied,s=this.copied?n:this.manual?t:this.label||e.copy,r=this.copied?nr:tr;return M`${this.icon?M`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${s} title=${s} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
5
5
|
${r}
|
|
6
|
-
</button>`:
|
|
6
|
+
</button>`:M`<button type="button" class="nish-btn nish-btn--sm nish-copy-btn" ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
7
7
|
${r}${s}
|
|
8
|
-
</button>`}<span role="status" aria-live="polite" style=${
|
|
9
|
-
${
|
|
8
|
+
</button>`}<span role="status" aria-live="polite" style=${vi}>${this.copied?n:this.manual?t:E}</span>${this.manual&&this.value!=null?M`<textarea data-copy-source readonly tabindex="-1" aria-label=${this.value} style=${vi} .value=${this.value}></textarea>`:E}`}};w("nish-copy-button",dt);var sr=0,ut=class extends x{static properties={label:{type:String},hint:{type:String},error:{type:String},optional:{type:Boolean,reflect:!0},layout:{type:String,reflect:!0},labelWidth:{attribute:"label-width",reflect:!0}};#e=`nish-field-${++sr}`;#n=null;#t=null;#i=null;#r=null;#a="";#c=!1;constructor(){super(),this.optional=!1,this.layout="stack"}connectedCallback(){super.connectedCallback(),N(()=>this.#s())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#r?.disconnect(),this.#r=null,this.#n=null,this.#t=null}updated(e){this.#o()}#s(){if(!this.isConnected||this.#n)return;let e=this.querySelector(":scope > div.nish-field");if(!e){let t=this.firstElementChild;if(!t){this.#r||(this.#r=new MutationObserver(()=>{this.firstElementChild&&(this.#r?.disconnect(),this.#r=null,this.#s())}),this.#r.observe(this,{childList:!0}));return}e=document.createElement("div"),e.appendChild(t),this.appendChild(e)}e.classList.add("nish-field"),this.#n=e,this.#t=Array.from(e.children).find(t=>!t.matches("label.nish-field-label, small.nish-hint, small.nish-error")),this.#a=(this.#l()?.getAttribute("aria-describedby")??"").split(/\s+/).filter(t=>t&&t!==`${this.#e}-hint`&&t!==`${this.#e}-error`).join(" "),this.#o(),this.#t&&this.#t.localName.startsWith("nish-")&&(this.#i=new MutationObserver(()=>{this.#l()&&!this.#h()&&this.#o()}),this.#i.observe(this.#t,{childList:!0,subtree:!0}))}#l(){let e=this.#t;return e?e.localName==="nish-combobox"||e.localName==="nish-search"?e.querySelector("input"):e:null}#h(){let e=this.#l();return!!e&&!!e.id&&this.#n?.querySelector("label.nish-field-label")?.getAttribute("for")===e.id}#o(){let e=this.#n;if(!e)return;let t=this.layout==="inline";e.classList.toggle("nish-field--inline",t),t&&this.labelWidth?(e.style.setProperty("--nish-field-label-w",this.labelWidth),e.style.setProperty("--nish-field-label-width",this.labelWidth)):(e.style.removeProperty("--nish-field-label-w"),e.style.removeProperty("--nish-field-label-width"));let n=this.#l();n&&!n.id&&(n.id=`${this.#e}-control`);let s=n?.id??"",r=!!this.error,o=!!this.hint&&!r,l=e.querySelector(":scope > label.nish-field-label");if(this.label){if(l||(l=document.createElement("label"),l.className="nish-field-label",e.prepend(l)),s&&(l.htmlFor=s),l.textContent=this.label,this.optional){let c=document.createElement("span");c.className="nish-optional",c.textContent=A().optional,l.appendChild(c)}}else l?.remove();let a=`${this.#e}-hint`,d=`${this.#e}-error`;if(this.#d(e,"hint",o?this.hint:"",a),this.#d(e,"error",r?this.error:"",d),n){let c=[this.#a,r?d:o?a:""].filter(Boolean).join(" ");c?n.setAttribute("aria-describedby",c):n.removeAttribute("aria-describedby"),r?(n.setAttribute("aria-invalid","true"),this.#c=!0):this.#c&&(n.removeAttribute("aria-invalid"),this.#c=!1)}}#d(e,t,n,s){let r=e.querySelector(`:scope > small.nish-${t}`);if(!n){r?.remove();return}r||(r=document.createElement("small"),r.className=`nish-${t}`,t==="error"&&r.setAttribute("role","alert"),e.appendChild(r)),r.id=s,r.textContent!==n&&(r.textContent=n)}};w("nish-field",ut);var rr=i=>$`<svg width=${i} height=${i} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>`,or=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M18 6 6 18M6 6l12 12"></path></svg>`,mt=class extends x{static properties={value:{type:String},placeholder:{type:String},label:{type:String},size:{type:String,reflect:!0},variant:{type:String,reflect:!0},name:{type:String},disabled:{type:Boolean,reflect:!0}};constructor(){super(),this.value="",this.label="",this.size="md",this.variant="field",this.disabled=!1}get input(){return this.querySelector("input.nish-input")}focus(e){this.input?.focus(e)}#e(){this.dispatchEvent(new CustomEvent("nish-input",{bubbles:!0,detail:{value:this.value}}))}#n(e){this.value=e.target.value,this.#e()}#t(){this.value="";let e=this.input;e&&(e.value=""),this.#e(),this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0})),e?.focus()}#i(e){e.key==="Escape"&&this.value&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.#t())}render(){let e=A(),t=["nish-search"];return(this.size==="xs"||this.size==="sm")&&t.push(`nish-search--${this.size}`),this.variant==="bare"&&t.push("nish-search--bare"),M`<label class=${t.join(" ")}>
|
|
9
|
+
${rr(this.size==="md"||!this.size?16:14)}
|
|
10
10
|
<input
|
|
11
11
|
class="nish-input"
|
|
12
12
|
type="search"
|
|
13
13
|
enterkeyhint="search"
|
|
14
14
|
autocomplete="off"
|
|
15
|
-
aria-label=${this.label||(this.closest("nish-field")?
|
|
15
|
+
aria-label=${this.label||(this.closest("nish-field")?E:e.search)}
|
|
16
16
|
placeholder=${this.placeholder??e.search}
|
|
17
|
-
name=${this.name??
|
|
17
|
+
name=${this.name??E}
|
|
18
18
|
?disabled=${this.disabled}
|
|
19
19
|
.value=${this.value??""}
|
|
20
|
-
@input=${
|
|
21
|
-
@keydown=${
|
|
20
|
+
@input=${n=>this.#n(n)}
|
|
21
|
+
@keydown=${n=>this.#i(n)}
|
|
22
22
|
/>
|
|
23
|
-
${this.value&&!this.disabled?
|
|
24
|
-
</label>`}};x("nish-search",ut);function ni(n){let e=()=>{let r=n.scrollWidth-n.clientWidth,l=z(n)?n.scrollLeft+r:n.scrollLeft;n.dataset.atStart=String(l<=1),n.dataset.atEnd=String(r<=1||l>=r-1)};e(),n.addEventListener("scroll",e,{passive:!0});let t,i=()=>{if(t)for(let r of Array.from(n.children))t.observe(r)};typeof ResizeObserver<"u"&&(t=new ResizeObserver(e),t.observe(n),i());let s;return typeof MutationObserver<"u"&&(s=new MutationObserver(()=>{e(),i()}),s.observe(n,{childList:!0})),()=>{n.removeEventListener("scroll",e),t?.disconnect(),s?.disconnect()}}function si(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=8;i.left<t.left+s?n.scrollLeft+=i.left-t.left-s:i.right>t.right-s&&(n.scrollLeft+=i.right-t.right+s)}var rr=0,or=n=>n.replace(/[^\w-]+/g,"-");function ar(n){let e=n.map(or);return e.map((t,i)=>/[A-Za-z0-9_]/.test(t)&&e.indexOf(t)===i&&e.lastIndexOf(t)===i?t:`${t}-${i}`)}var mt=class extends S{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},variant:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0}};#e=null;#i="";#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(a=>a===document.activeElement),s=i>=0?i:Math.max(0,t.findIndex(a=>a.getAttribute("aria-selected")==="true")),r,o=z(this.#e)?"ArrowLeft":"ArrowRight",l=z(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===o)r=t[(s+1)%t.length];else if(e.key===l)r=t[(s-1+t.length)%t.length];else if(e.key==="Home")r=t[0];else if(e.key==="End")r=t[t.length-1];else return;e.preventDefault(),this.#u(r),r.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),_(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#m()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-tabs");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,this.#i=this.id||`nish-tabs-${++rr}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#t=ni(e),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#m(),this.#s()}),this.#s(),this.#m()}#s(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(){let e=this.id?document:this,t=Array.from(e.querySelectorAll("[data-tab-panel]"));return this.id?t.filter(i=>i.getAttribute("data-tabs")===this.id):t}#u(e){if(e.disabled)return;let t=this.#o(e),i=t!==this.value;this.value=t,this.#g(),i&&this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0}))}#m(){let e=this.#e;if(!e)return;e.setAttribute("aria-label",this.label),e.classList.toggle("nish-tabs--pill",this.variant==="pill"),e.classList.toggle("nish-tabs--sm",this.size==="sm"),e.classList.toggle("nish-tabs--xs",this.size==="xs"),e.classList.toggle("nish-tabs--block",this.block);let t=this.#l();if(!t.some(i=>this.#o(i)===this.value&&!i.disabled)){let i=t.find(s=>!s.disabled);i&&(this.value=this.#o(i))}this.#g()}#g(){let e=this.#e;if(!e)return;let t=this.#l(),i=this.#d(),s=null,r=ar(t.map(l=>this.#o(l)));for(let[l,a]of t.entries()){let d=this.#o(a),c=d===this.value&&!a.disabled;c&&(s=a),a.id||(a.id=`${this.#i}-tab-${r[l]}`),a.type="button",a.classList.add("nish-tab"),a.setAttribute("role","tab"),a.setAttribute("aria-selected",String(c));let h=i.find(u=>u.getAttribute("data-tab-panel")===d);h?(h.id||(h.id=`${this.#i}-panel-${r[l]}`),a.setAttribute("aria-controls",h.id),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",a.id),h.hidden=!c):a.removeAttribute("aria-controls")}let o=s??t.find(l=>!l.disabled)??null;for(let l of t)l.tabIndex=l===o?0:-1;s&&si(e,s)}};x("nish-tabs",mt);var pt=class extends S{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0},overflow:{type:String,reflect:!0},name:{type:String,reflect:!0}};#e=null;#i=null;#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(c=>c===document.activeElement),s=t.findIndex(c=>c.getAttribute("aria-checked")==="true"),r=i>=0?i:s,o,l=z(this.#e),a=l?"ArrowLeft":"ArrowRight",d=l?"ArrowRight":"ArrowLeft";if(e.key===a||e.key==="ArrowDown")o=r<0?t[0]:t[(r+1)%t.length];else if(e.key===d||e.key==="ArrowUp")o=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")o=t[0];else if(e.key==="End")o=t[t.length-1];else return;e.preventDefault(),this.#d(o),o.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),_(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#u()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-seg");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,e.classList.add("nish-seg"),e.setAttribute("role","radiogroup"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#u(),this.#s()}),this.#s(),this.#u()}#s(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(e){if(e.disabled)return;let t=this.#o(e),i=t!==this.value;this.value=t,this.#m(),i&&(this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#u(){let e=this.#e;if(!e)return;let t=this.overflow!=="wrap";e.setAttribute("aria-label",this.label),e.classList.toggle("nish-seg--xs",this.size==="xs"),e.classList.toggle("nish-seg--md",this.size==="md"),e.classList.toggle("nish-seg--block",this.block),e.classList.toggle("nish-no-scrollbar",t),e.classList.toggle("nish-scroll-fade",t),e.style.overflowX=t?"auto":"",t&&!this.#t?this.#t=ni(e):!t&&this.#t&&(this.#t(),this.#t=null,delete e.dataset.atStart,delete e.dataset.atEnd),this.name?(this.#i||(this.#i=document.createElement("input"),this.#i.type="hidden",this.appendChild(this.#i)),this.#i.name=this.name):this.#i&&(this.#i.remove(),this.#i=null),this.#m()}#m(){let e=this.#e;if(!e)return;let t=this.#l(),i=null;for(let r of t){let o=this.#o(r)===this.value&&!r.disabled;o&&(i=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(o))}let s=i??t.find(r=>!r.disabled)??null;for(let r of t)r.tabIndex=r===s?0:-1;this.#i&&(this.#i.value=i?this.value:""),i&&this.overflow!=="wrap"&&si(e,i)}};x("nish-segmented",pt);function lr(n,e,t,i){let s=t-e||1,r=[],o=-1,l=n[0],a=n[0],d=()=>{l===a?r.push(l):l.x<=a.x?r.push(l,a):r.push(a,l)};for(let c of n){let h=Math.min(i-1,Math.max(0,Math.floor((c.x-e)/s*i)));h!==o?(o>=0&&d(),o=h,l=c,a=c):(c.y<l.y&&(l=c),c.y>a.y&&(a=c))}return d(),r}function vn(n,e,t,i,s){let r=n.filter(g=>g!=null&&Number.isFinite(g)),o=r.length===0,l=1/0,a=-1/0;for(let g of r)g<l&&(l=g),g>a&&(a=g);let d=i??(o?0:l),c=s??(o?1:a),h=2,u=g=>n.length<=1?e/2:g/(n.length-1)*e,E=g=>c===d?t/2:h+(1-(g-d)/(c-d))*(t-2*h),v=[],b=[];n.forEach((g,L)=>{g==null||!Number.isFinite(g)?(b.length&&v.push(b),b=[]):b.push({x:u(L),y:E(g)})}),b.length&&v.push(b);let f=Math.max(1,Math.floor(e));for(let g=0;g<v.length;g++)v[g].length>f*2&&(v[g]=lr(v[g],0,e,f));let m=g=>g.length===1?`M${g[0].x},${g[0].y}h0`:g.map((L,M)=>`${M?"L":"M"}${L.x},${L.y}`).join(""),w=g=>g.length<2?"":`${m(g)}L${g[g.length-1].x},${t}L${g[0].x},${t}Z`;return{empty:o,lines:v.map(m),areas:v.map(w),baseline:`M0,${t/2}H${e}`}}var yn={"chart-1":"var(--nish-chart-1)","chart-2":"var(--nish-chart-2)","chart-3":"var(--nish-chart-3)","chart-4":"var(--nish-chart-4)","chart-5":"var(--nish-chart-5)","chart-6":"var(--nish-chart-6)","chart-7":"var(--nish-chart-7)","chart-8":"var(--nish-chart-8)",accent:"var(--nish-accent)",ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)"};function cr(n){if(n==null)return[];let e=n.trim();return e?e.split(",").map(t=>{let i=t.trim();if(i==="")return null;let s=Number(i);return Number.isFinite(s)?s:null}):[]}var ft=class extends S{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>cr(e),toAttribute:e=>Array.isArray(e)&&e.length?e.map(t=>t==null?"":String(t)).join(","):null}},tone:{type:String,reflect:!0},label:{type:String,reflect:!0},width:{type:Number,reflect:!0},height:{type:Number,reflect:!0},fill:{type:Boolean,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0}};constructor(){super(),this.values=[],this.tone="chart-1",this.label="",this.width=120,this.height=28,this.fill=!1}render(){let e=Array.isArray(this.values)?this.values:[];if(e.length<2)return y;let t=this.width>0?this.width:120,i=this.height>0?this.height:28,{empty:s,lines:r,areas:o,baseline:l}=vn(e,t,i,this.min??void 0,this.max??void 0),a=s?"var(--nish-line-strong)":Object.hasOwn(yn,this.tone)?yn[this.tone]:"var(--nish-chart-1)",d=A(),c=this.label||d.trend;return k`<svg
|
|
23
|
+
${this.value&&!this.disabled?M`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label=${e.clear} @click=${()=>this.#t()}>${or}</button>`:E}
|
|
24
|
+
</label>`}};w("nish-search",mt);function sn(i){let e=()=>{let r=i.scrollWidth-i.clientWidth,l=z(i)?i.scrollLeft+r:i.scrollLeft;i.dataset.atStart=String(l<=1),i.dataset.atEnd=String(r<=1||l>=r-1)};e(),i.addEventListener("scroll",e,{passive:!0});let t,n=()=>{if(t)for(let r of Array.from(i.children))t.observe(r)};typeof ResizeObserver<"u"&&(t=new ResizeObserver(e),t.observe(i),n());let s;return typeof MutationObserver<"u"&&(s=new MutationObserver(()=>{e(),n()}),s.observe(i,{childList:!0})),()=>{i.removeEventListener("scroll",e),t?.disconnect(),s?.disconnect()}}function rn(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),s=8;n.left<t.left+s?i.scrollLeft+=n.left-t.left-s:n.right>t.right-s&&(i.scrollLeft+=n.right-t.right+s)}var ar=0,lr=i=>i.replace(/[^\w-]+/g,"-");function cr(i){let e=i.map(lr);return e.map((t,n)=>/[A-Za-z0-9_]/.test(t)&&e.indexOf(t)===n&&e.lastIndexOf(t)===n?t:`${t}-${n}`)}var pt=class extends x{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},variant:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0}};#e=null;#n="";#t=null;#i=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#a=e=>{let t=this.#h();if(!t.length)return;let n=t.findIndex(a=>a===document.activeElement),s=n>=0?n:Math.max(0,t.findIndex(a=>a.getAttribute("aria-selected")==="true")),r,o=z(this.#e)?"ArrowLeft":"ArrowRight",l=z(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===o)r=t[(s+1)%t.length];else if(e.key===l)r=t[(s-1+t.length)%t.length];else if(e.key==="Home")r=t[0];else if(e.key==="End")r=t[t.length-1];else return;e.preventDefault(),this.#u(r),r.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),N(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#i?.disconnect(),this.#i=null}updated(e){this.#p()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-tabs");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,this.#n=this.id||`nish-tabs-${++ar}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#t=sn(e),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#p(),this.#s()}),this.#s(),this.#p()}#s(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(){let e=this.id?document:this,t=Array.from(e.querySelectorAll("[data-tab-panel]"));return this.id?t.filter(n=>n.getAttribute("data-tabs")===this.id):t}#u(e){if(e.disabled)return;let t=this.#o(e),n=t!==this.value;this.value=t,this.#b(),n&&this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0}))}#p(){let e=this.#e;if(!e)return;e.setAttribute("aria-label",this.label),e.classList.toggle("nish-tabs--pill",this.variant==="pill"),e.classList.toggle("nish-tabs--sm",this.size==="sm"),e.classList.toggle("nish-tabs--xs",this.size==="xs"),e.classList.toggle("nish-tabs--block",this.block);let t=this.#l();if(!t.some(n=>this.#o(n)===this.value&&!n.disabled)){let n=t.find(s=>!s.disabled);n&&(this.value=this.#o(n))}this.#b()}#b(){let e=this.#e;if(!e)return;let t=this.#l(),n=this.#d(),s=null,r=cr(t.map(l=>this.#o(l)));for(let[l,a]of t.entries()){let d=this.#o(a),c=d===this.value&&!a.disabled;c&&(s=a),a.id||(a.id=`${this.#n}-tab-${r[l]}`),a.type="button",a.classList.add("nish-tab"),a.setAttribute("role","tab"),a.setAttribute("aria-selected",String(c));let h=n.find(u=>u.getAttribute("data-tab-panel")===d);h?(h.id||(h.id=`${this.#n}-panel-${r[l]}`),a.setAttribute("aria-controls",h.id),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",a.id),h.hidden=!c):a.removeAttribute("aria-controls")}let o=s??t.find(l=>!l.disabled)??null;for(let l of t)l.tabIndex=l===o?0:-1;s&&rn(e,s)}};w("nish-tabs",pt);var ft=class extends x{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0},overflow:{type:String,reflect:!0},name:{type:String,reflect:!0}};#e=null;#n=null;#t=null;#i=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#a=e=>{let t=this.#h();if(!t.length)return;let n=t.findIndex(c=>c===document.activeElement),s=t.findIndex(c=>c.getAttribute("aria-checked")==="true"),r=n>=0?n:s,o,l=z(this.#e),a=l?"ArrowLeft":"ArrowRight",d=l?"ArrowRight":"ArrowLeft";if(e.key===a||e.key==="ArrowDown")o=r<0?t[0]:t[(r+1)%t.length];else if(e.key===d||e.key==="ArrowUp")o=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")o=t[0];else if(e.key==="End")o=t[t.length-1];else return;e.preventDefault(),this.#d(o),o.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),N(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#i?.disconnect(),this.#i=null}updated(e){this.#u()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-seg");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,e.classList.add("nish-seg"),e.setAttribute("role","radiogroup"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#u(),this.#s()}),this.#s(),this.#u()}#s(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(e){if(e.disabled)return;let t=this.#o(e),n=t!==this.value;this.value=t,this.#p(),n&&(this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#u(){let e=this.#e;if(!e)return;let t=this.overflow!=="wrap";e.setAttribute("aria-label",this.label),e.classList.toggle("nish-seg--xs",this.size==="xs"),e.classList.toggle("nish-seg--md",this.size==="md"),e.classList.toggle("nish-seg--block",this.block),e.classList.toggle("nish-no-scrollbar",t),e.classList.toggle("nish-scroll-fade",t),e.style.overflowX=t?"auto":"",t&&!this.#t?this.#t=sn(e):!t&&this.#t&&(this.#t(),this.#t=null,delete e.dataset.atStart,delete e.dataset.atEnd),this.name?(this.#n||(this.#n=document.createElement("input"),this.#n.type="hidden",this.appendChild(this.#n)),this.#n.name=this.name):this.#n&&(this.#n.remove(),this.#n=null),this.#p()}#p(){let e=this.#e;if(!e)return;let t=this.#l(),n=null;for(let r of t){let o=this.#o(r)===this.value&&!r.disabled;o&&(n=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(o))}let s=n??t.find(r=>!r.disabled)??null;for(let r of t)r.tabIndex=r===s?0:-1;this.#n&&(this.#n.value=n?this.value:""),n&&this.overflow!=="wrap"&&rn(e,n)}};w("nish-segmented",ft);function hr(i,e,t,n){let s=t-e||1,r=[],o=-1,l=i[0],a=i[0],d=()=>{l===a?r.push(l):l.x<=a.x?r.push(l,a):r.push(a,l)};for(let c of i){let h=Math.min(n-1,Math.max(0,Math.floor((c.x-e)/s*n)));h!==o?(o>=0&&d(),o=h,l=c,a=c):(c.y<l.y&&(l=c),c.y>a.y&&(a=c))}return d(),r}function yi(i,e,t,n,s){let r=i.filter(m=>m!=null&&Number.isFinite(m)),o=r.length===0,l=1/0,a=-1/0;for(let m of r)m<l&&(l=m),m>a&&(a=m);let d=n??(o?0:l),c=s??(o?1:a),h=2,u=m=>i.length<=1?e/2:m/(i.length-1)*e,v=m=>c===d?t/2:h+(1-(m-d)/(c-d))*(t-2*h),S=[],g=[];i.forEach((m,y)=>{m==null||!Number.isFinite(m)?(g.length&&S.push(g),g=[]):g.push({x:u(y),y:v(m)})}),g.length&&S.push(g);let f=Math.max(1,Math.floor(e));for(let m=0;m<S.length;m++)S[m].length>f*2&&(S[m]=hr(S[m],0,e,f));let L=m=>m.length===1?`M${m[0].x},${m[0].y}h0`:m.map((y,C)=>`${C?"L":"M"}${y.x},${y.y}`).join(""),b=m=>m.length<2?"":`${L(m)}L${m[m.length-1].x},${t}L${m[0].x},${t}Z`;return{empty:o,lines:S.map(L),areas:S.map(b),baseline:`M0,${t/2}H${e}`}}var Ei={"chart-1":"var(--nish-chart-1)","chart-2":"var(--nish-chart-2)","chart-3":"var(--nish-chart-3)","chart-4":"var(--nish-chart-4)","chart-5":"var(--nish-chart-5)","chart-6":"var(--nish-chart-6)","chart-7":"var(--nish-chart-7)","chart-8":"var(--nish-chart-8)",accent:"var(--nish-accent)",ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)"};function dr(i){if(i==null)return[];let e=i.trim();return e?e.split(",").map(t=>{let n=t.trim();if(n==="")return null;let s=Number(n);return Number.isFinite(s)?s:null}):[]}var gt=class extends x{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>dr(e),toAttribute:e=>Array.isArray(e)&&e.length?e.map(t=>t==null?"":String(t)).join(","):null}},tone:{type:String,reflect:!0},label:{type:String,reflect:!0},width:{type:Number,reflect:!0},height:{type:Number,reflect:!0},fill:{type:Boolean,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0}};constructor(){super(),this.values=[],this.tone="chart-1",this.label="",this.width=120,this.height=28,this.fill=!1}render(){let e=Array.isArray(this.values)?this.values:[];if(e.length<2)return E;let t=this.width>0?this.width:120,n=this.height>0?this.height:28,{empty:s,lines:r,areas:o,baseline:l}=yi(e,t,n,this.min??void 0,this.max??void 0),a=s?"var(--nish-line-strong)":Object.hasOwn(Ei,this.tone)?Ei[this.tone]:"var(--nish-chart-1)",d=A(),c=this.label||d.trend;return M`<svg
|
|
25
25
|
class="nish-sparkline"
|
|
26
26
|
role="img"
|
|
27
27
|
aria-label=${s?d.noDataNamed(c):c}
|
|
28
28
|
width=${t}
|
|
29
|
-
height=${
|
|
30
|
-
viewBox="0 0 ${t} ${
|
|
29
|
+
height=${n}
|
|
30
|
+
viewBox="0 0 ${t} ${n}"
|
|
31
31
|
preserveAspectRatio="none"
|
|
32
32
|
style="color:${a}"
|
|
33
33
|
>
|
|
34
|
-
${s
|
|
35
|
-
</svg>`}};
|
|
36
|
-
${e?
|
|
37
|
-
${this.description?
|
|
38
|
-
</span>`:
|
|
34
|
+
${s?$`<path d=${l} stroke="currentColor" stroke-width="1.5" stroke-dasharray="3 3" vector-effect="non-scaling-stroke"></path>`:$`${this.fill?o.map(h=>$`<path d=${h} fill="currentColor" fill-opacity="0.15"></path>`):E}${r.map(h=>$`<path d=${h} fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path>`)}`}
|
|
35
|
+
</svg>`}};w("nish-sparkline",gt);var ur=0,bt=class extends x{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},description:{type:String},size:{type:String,reflect:!0},labelSide:{attribute:"label-side",reflect:!0},name:{type:String},ariaName:{type:String,attribute:"aria-label"}};#e=`nish-switch-${++ur}`;constructor(){super(),this.checked=!1,this.disabled=!1,this.size="md",this.labelSide="end"}get button(){return this.querySelector("button.nish-switch")}focus(e){this.button?.focus(e)}#n(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{checked:this.checked}})))}updated(e){e.has("checked")&&this.button?.setAttribute("aria-checked",String(this.checked))}render(){let e=!!this.label,n=e||!!this.description?M`<span style="min-width:0">
|
|
36
|
+
${e?M`<span id=${`${this.#e}-label`} style="display:block;line-height:1.375">${this.label}</span>`:E}
|
|
37
|
+
${this.description?M`<span id=${`${this.#e}-desc`} style="display:block;margin-top:2px;font-size:var(--nish-text-xs);color:var(--nish-hi3)">${this.description}</span>`:E}
|
|
38
|
+
</span>`:E,s=this.labelSide==="start",r=M`<button
|
|
39
39
|
type="button"
|
|
40
40
|
class=${this.size==="sm"?"nish-switch nish-switch--sm":"nish-switch"}
|
|
41
41
|
role="switch"
|
|
42
42
|
aria-checked=${String(this.checked)}
|
|
43
|
-
aria-labelledby=${e?`${this.#e}-label`:
|
|
44
|
-
aria-label=${!e&&this.ariaName?this.ariaName:
|
|
45
|
-
aria-describedby=${this.description?`${this.#e}-desc`:
|
|
43
|
+
aria-labelledby=${e?`${this.#e}-label`:E}
|
|
44
|
+
aria-label=${!e&&this.ariaName?this.ariaName:E}
|
|
45
|
+
aria-describedby=${this.description?`${this.#e}-desc`:E}
|
|
46
46
|
?disabled=${this.disabled}
|
|
47
|
-
@click=${()=>this.#
|
|
48
|
-
></button>`;return
|
|
49
|
-
${s?
|
|
50
|
-
${this.name?
|
|
51
|
-
</label>`}};x("nish-switch",bt);function dr(n,e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return!0;let i=[n.label,n.hint??"",...n.keywords??[]].join(`
|
|
52
|
-
`).toLowerCase();return t.every(s=>i.includes(s))}function En(n,e){let t=[],i=new Map;for(let s of n){if(!dr(s,e))continue;let r=s.group??null,o=i.get(r);o||(o=[],i.set(r,o),t.push(r)),o.push(s)}return t.sort((s,r)=>s===null?-1:r===null?1:0),t.flatMap(s=>i.get(s)).slice(0,50)}var mr=0,De="http://www.w3.org/2000/svg",pr="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function fr(){let n=document.createElementNS(De,"svg");for(let[t,i]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))n.setAttribute(t,i);let e=document.createElementNS(De,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),n.append(e),n}function br(){let n=document.createElementNS(De,"svg");for(let[i,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))n.setAttribute(i,s);let e=document.createElementNS(De,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(De,"path");return t.setAttribute("d","m21 21-4.3-4.3"),n.append(e,t),n}function Sn(n){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(n.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function gr(n){if(!(n instanceof HTMLElement))return!1;let e=n.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||n.isContentEditable}var gt=class extends S{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++mr;#i=null;#t=null;#n=null;#r=null;#a=null;#c="";#s=0;#l=[];#h=new Map;#o=null;#d;#u=!1;#m=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#b(),this.#i){this.#v();return}this.#u||(this.#u=!0,_(()=>{this.#u=!1,this.isConnected&&this.#p()}))}disconnectedCallback(){super.disconnectedCallback(),this.#g(!1),window.clearTimeout(this.#d),this.#i?.open&&(this.open=!1,this.#i.close())}show(){this.open=!0}close(){this.open=!1}#g(e){e!==this.#m&&(this.#m=e,e?document.addEventListener("keydown",this.#S):document.removeEventListener("keydown",this.#S))}#b(){this.#g(this.hotkey&&this.isConnected)}#S=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||gr(e.target)||(e.preventDefault(),this.open=!0)};#p(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let d=new Set,c=[];for(let h of e){let u=h.dataset.id||h.getAttribute("href")||`item-${c.length+1}`;for(;d.has(u);)u=`${u}-${c.length+1}`;d.add(u);let E=(h.dataset.keywords??"").split(/[,\s]+/).map(v=>v.trim()).filter(Boolean);c.push({id:u,label:h.textContent?.trim()??u,group:h.dataset.group||void 0,hint:h.dataset.hint||void 0,keywords:E.length?E:void 0,href:h.getAttribute("href")??void 0}),this.#h.set(u,h)}this.items=c}for(let d of e)d.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let i=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",i),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#T(s.value)),s.addEventListener("keydown",d=>this.#L(d)),s.addEventListener("change",d=>d.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(fr()),o.addEventListener("click",()=>{this.open=!1}),r.append(br(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=i,l.setAttribute("role","listbox"),l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("mousemove",d=>{let c=d.target?.closest("[data-index]");if(!c)return;let h=Number(c.dataset.index);h!==this.#s&&this.#y(h,!1)}),l.addEventListener("click",d=>{let c=d.target?.closest("[data-index]"),h=c?this.#l[Number(c.dataset.index)]:void 0;h&&this.#A(h)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=pr,t.append(r,l,a),t.addEventListener("click",this.#k),t.addEventListener("cancel",this.#C),t.addEventListener("close",this.#M),t.addEventListener("keydown",d=>{d.key==="Escape"&&d.stopPropagation()}),this.append(t),this.#i=t,this.#t=s,this.#n=l,this.#r=a,this.#a=o,this.#E(),this.#v()}updated(e){e.has("hotkey")&&this.#b(),(e.has("placeholder")||e.has("emptyText"))&&this.#E(),e.has("items")&&this.#i?.open&&this.#f(),e.has("open")&&this.#v()}stringsChanged(){this.#E(),this.#i?.open&&this.#f(),super.stringsChanged()}#E(){let e=this.#t;if(!e)return;let t=A(),i=this.placeholder||t.searchPlaceholder;e.placeholder=i,e.setAttribute("aria-label",i.replace(/…$/,"")||t.search),this.#i?.setAttribute("aria-label",t.search),this.#a?.setAttribute("aria-label",t.close),this.#n?.setAttribute("aria-label",t.results)}#v(){let e=this.#i;!e||!this.isConnected||(this.open&&!e.open?(this.#o=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#c="",this.#s=0,this.#t&&(this.#t.value=""),e.showModal(),this.#f(),this.#t?.focus()):!this.open&&e.open&&e.close())}#x(e){return`nish-command-${this.#e}-opt-${e}`}#f(){let e=this.#n,t=this.#t;if(!e||!t)return;let i=A();this.#l=En(this.items,this.#c),this.#s>=this.#l.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#l){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let h=document.createElement("div");h.className="nish-command-group",h.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,h.setAttribute("aria-labelledby",u.id),h.append(u),e.append(h),o=h}let d=document.createElement("div");d.className="nish-command-item",d.id=this.#x(s),d.dataset.index=String(s),d.setAttribute("role","option"),d.setAttribute("aria-selected",s===this.#s?"true":"false");let c=document.createElement("span");if(c.textContent=l.label,d.append(c),l.hint){let h=document.createElement("span");h.className="nish-command-item-hint",h.textContent=l.hint,d.append(h)}o.append(d),s++}if(this.#l.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||i.noResults,e.append(l)}this.#l.length?t.setAttribute("aria-activedescendant",this.#x(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#l.length?i.resultCount(this.#l.length):this.emptyText||i.noResults)}#y(e,t=!0){let i=this.#l.length;if(i===0)return;this.#s=(e%i+i)%i;let s=this.#n;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#t?.setAttribute("aria-activedescendant",this.#x(this.#s))}}#T(e){this.#c=e,this.#s=0,this.#f(),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#L(e){if(e.isComposing)return;let t=this.#l.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#y(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#y(this.#s-1);break;case"Home":t&&!this.#c&&(e.preventDefault(),this.#y(0));break;case"End":t&&!this.#c&&(e.preventDefault(),this.#y(t-1));break;case"Enter":{e.preventDefault();let i=this.#l[this.#s];i&&this.#A(i);break}}}#A(e){let t=this.#h.get(e.id);if(this.open=!1,this.#i?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let i=t.getAttribute("href");i!==null&&Se(i)===null?Sn(i):t.click()}else if(e.href){let i=Se(e.href);i===null?Sn(e.href):window.location.assign(i)}}#k=e=>{let t=this.#i;if(!t||e.target!==t)return;let i=t.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||(this.open=!1)};#C=e=>{e.preventDefault(),this.open=!1};#M=()=>{window.clearTimeout(this.#d),this.open&&(this.open=!1);let e=this.#o;this.#o=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};x("nish-command-palette",gt);var vr={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},yr=0;function vt(n){let e=document.createElement("div");return e.className=n,e}var yt=class extends S{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#i=vt("nish-filter-bar-search");#t=vt("nish-filter-bar-chips");#n=vt("nish-filter-bar-trailing");#r=vt("nish-filter-bar-summary");#a=null;#c=null;#s=null;#l=null;#h=null;#o=null;#d=null;#u=null;#m=null;#g=null;#b=[];#S=null;#p=null;#E="";#v=null;#x=()=>this.#C();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),_(()=>this.#f())}disconnectedCallback(){if(super.disconnectedCallback(),this.#p?.removeEventListener("change",this.#x),this.#p=null,this.#E="",this.#v?.disconnect(),this.#v=null,this.#e){this.#h?.close();for(let e of this.#b)this.appendChild(e);for(let e of[this.#i,this.#n,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#h?.remove(),this.#e=null,this.#a=null,this.#c=null,this.#d=null,this.#u=null,this.#m=null,this.#l=null,this.#h=null,this.#o=null,this.#b=[],this.#S=null}}updated(e){this.#e&&(this.#k(),this.#C())}#f(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#i,this.#t,this.#n,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#T(t);this.appendChild(e),this.#L(),this.#k(),this.#C(),this.#v=new MutationObserver(t=>{for(let i of t)i.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#T(s)});this.#C()}),this.#v.observe(this,{childList:!0}),this.#v.observe(this.#t,{childList:!0}),this.#o&&this.#v.observe(this.#o,{childList:!0})}#y(){this.#b=this.#b.filter(e=>e.parentNode===this.#t||e.parentNode===this.#o)}#T(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#n.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#i.firstChild?this.#i.appendChild(e):(this.#y(),this.#b.includes(e)||this.#b.push(e),(this.#S==="compact"?this.#o??this.#t:this.#t).appendChild(e))}#L(){let e=++yr,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#c=document.createTextNode(""),t.append(mn(16),this.#c);let i=document.createElement("span");i.className="nish-badge nish-badge--accent",t.appendChild(i),t.addEventListener("click",()=>this.#h?.show()),this.#a=t,this.#s=i;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#A()),this.#l=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#u=a,a.appendChild(at(16)),o.appendChild(a);let d=document.createElement("div");d.className="nish-sheet-body nish-filter-sheet-body";let c=document.createElement("footer");c.className="nish-sheet-footer";let h=document.createElement("button");h.type="button",h.className="nish-btn nish-btn--ghost",h.addEventListener("click",()=>this.#A());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#m=u,u.addEventListener("click",()=>this.#h?.close()),c.append(h,u),r.append(o,d,c),this.#h=r,this.#o=d,this.#d=h,this.#g=l}#A(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#k(){let e=vr[this.sheetBelow==="lg"?"lg":"md"];e!==this.#E&&(this.#p?.removeEventListener("change",this.#x),this.#E=e,this.#p=typeof matchMedia>"u"?null:matchMedia(e),this.#p?.addEventListener("change",this.#x))}#C(){let e=this.#e,t=this.#h,i=this.#o,s=this.#a,r=this.#l;if(!e||!t||!i||!s||!r)return;this.#y();let o=this.#p?.matches?"compact":"wide";o!==this.#S&&(o==="compact"?(this.#t.remove(),r.remove(),this.#i.after(s),i.append(...this.#b),e.appendChild(t)):(t.close(),s.remove(),this.#t.append(...this.#b,r),this.#i.after(this.#t),t.remove()),this.#S=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#b.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",A().activeCount(l))),this.#d&&(this.#d.disabled=l===0);let a=A();this.#g&&(this.#g.textContent=this.sheetTitle||a.filters),this.#c&&(this.#c.data=a.filters),r.textContent=a.clearFilters,this.#d&&(this.#d.textContent=a.clear),this.#m&&(this.#m.textContent=a.showResults),this.#u?.setAttribute("aria-label",a.close)}};x("nish-filter-bar",yt);var Et=class extends S{static properties={label:{type:String,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),_(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.disconnect(),this.#t=null,this.#e=null,this.#i?.(),this.#i=null}updated(e){this.#a()}#n(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#a(),this.#i=it(e,t=>t.classList.add("nish-nav-rail-item")),this.#t=new MutationObserver(t=>{let i=this.#e;if(!i)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==i&&o.nodeType===1&&o.parentNode===this&&(i.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(i)}),this.#t.observe(this,{childList:!0}),this.#t.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),i=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),i?.classList.add("nish-nav-rail-footer");let s=[t,i].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,d)=>r[r.length-o+d]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#a(){this.#e&&this.#e.setAttribute("aria-label",this.label||A().sections)}};x("nish-nav-rail",Et);var Er='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',St=class extends S{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#i=null;#t=null;#n=()=>this.#c();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),_(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#n),this.#i?.disconnect(),this.#i=null,this.#t?.disconnect(),this.#t=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#t?.disconnect(),this.#t=new MutationObserver(()=>{let i=this.#e;if(i)for(let s of Array.from(this.childNodes))s!==i&&s.nodeType===1&&i.appendChild(s)}),this.#t.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#n,{passive:!0}),typeof ResizeObserver<"u"&&(this.#i=new ResizeObserver(()=>this.#c()),this.#i.observe(e));let t=e.querySelector(Er);t&&this.#a(e,t),this.#c()}#a(e,t){let i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<i.left+r?e.scrollLeft+=s.left-i.left-r:s.right>i.right-r&&(e.scrollLeft+=s.right-i.right+r)}#c(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth,i=z(e)?e.scrollLeft+t:e.scrollLeft;e.dataset.atStart=String(i<=1),e.dataset.atEnd=String(t<=1||i>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};x("nish-scroll-row",St);var xn={fromAttribute:n=>n!=="false",toAttribute:n=>n?null:"false"},xt=class extends S{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:xn},updateHash:{attribute:"update-hash",reflect:!0,converter:xn}};#e=null;#i=null;#t=null;#n=null;#r=e=>this.#h(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),_(()=>this.#a())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.(),this.#i=null,this.#s=null,this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#c()}#a(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#c(),e.addEventListener("click",this.#r),this.#l(e),this.#t=new MutationObserver(()=>{this.#i?.(),this.#l(e)}),this.#t.observe(e,{childList:!0}),this.#n=new MutationObserver(()=>{let t=this.#e;if(t)for(let i of Array.from(this.childNodes))i!==t&&i.nodeType===1&&t.appendChild(i)}),this.#n.observe(this,{childList:!0})}#c(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||A().onThisPage||ye.onThisPage),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#l(e))}#s=null;#l(e){this.#i?.(),this.#i=Ni(e,{height:this.sticky}),this.#s=this.sticky}#h(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let i;try{i=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(i);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(this.#i?.lock(i),s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:i}}))}};x("nish-section-nav",xt);var wn=5,Sr="(max-width: 639.98px) and (pointer: coarse)";function ri(n,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!n||n.length!==e||!n.every(s=>Number.isFinite(s)&&s>0))return t();let i=n.reduce((s,r)=>s+r,0);return n.map(s=>s/i*100)}var xr={fromAttribute(n){if(n==null||n.trim()==="")return null;let e=n.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(n){return n&&n.length?n.map(e=>Math.round(e*100)/100).join(","):null}},wt=class extends S{static properties={orientation:{type:String,reflect:!0},sizes:{converter:xr,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#i=[];#t=null;#n=null;#r=!1;#a=null;#c=!1;#s=!1;#l=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#n=window.matchMedia(Sr),this.#r=this.#n.matches,this.#n.addEventListener("change",this.#g)),this.#s){this.#h(),this.#o();return}this.#c||(this.#c=!0,_(()=>{this.#c=!1,this.isConnected&&(this.#s=!0,this.#h(),this.#o())}))}disconnectedCallback(){super.disconnectedCallback(),this.#n?.removeEventListener("change",this.#g),this.#n=null,this.#t?.disconnect(),this.#t=null,this.#y()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#m()}#h(){typeof MutationObserver>"u"||(this.#t??=new MutationObserver(()=>this.#o()),this.#t.observe(this,{childList:!0}))}#o(){if(!this.isConnected)return;this.#t?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let i=document.createElement("div");i.className="nish-split-pane",this.insertBefore(i,t),i.append(t),e.push(i)}this.#e=e,this.#i=[];for(let t=0;t<e.length-1;t++){let i=document.createElement("div");i.className="nish-split-divider",i.setAttribute("role","separator"),i.tabIndex=0,i.style.touchAction="none",i.addEventListener("pointerdown",s=>this.#v(s,t)),i.addEventListener("pointermove",s=>this.#x(s)),i.addEventListener("pointerup",s=>this.#f(s)),i.addEventListener("pointercancel",s=>this.#f(s)),i.addEventListener("keydown",s=>this.#L(s,t)),i.addEventListener("dblclick",()=>this.#T()),this.insertBefore(i,e[t+1]),this.#i.push(i)}this.#d(),this.#m(),this.#t?.observe(this,{childList:!0})}#d(){if(!(this.#l||!this.storageKey||this.#e.length===0)){this.#l=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(i=>typeof i=="number"&&Number.isFinite(i)&&i>0)&&(this.sizes=ri(t,this.#e.length))}catch{}}}get#u(){return ri(this.sizes,this.#e.length)}#m(){let e=this.orientation!=="column",t=this.#u,i=A();this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#i.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?i.resizeColumns:i.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#g=e=>{this.#r=e.matches,this.#m()};#b(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#S(e,t,i,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+i,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#p(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#E(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#v(e,t){if(e.button!==0||this.#r)return;let i=this.#i[t];if(!i)return;e.preventDefault(),i.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#b(l),0);this.#a={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#u,total:r,restore:s},this.setAttribute("data-dragging","")}#x(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let i=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&z(this)?-1:1,r=(i-t.start)*s/t.total*100;r!==0&&this.#E(this.#S(t.sizes,t.index,r,this.min/t.total*100))}#f(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;let i=this.#i[t.index];i?.hasPointerCapture?.(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.#y()}#y(){let e=this.#a;if(e){this.#a=null,this.sizes&&this.#p(this.sizes);for(let[t,i]of e.restore)t.style.pointerEvents=i;this.removeAttribute("data-dragging")}}#T(){if(this.#r||this.#e.length<2)return;let e=ri(null,this.#e.length);this.#E(e),this.#p(e)}#L(e,t){if(e.key==="Enter"){e.preventDefault(),this.#T();return}let i=this.orientation!=="column",s=i&&z(this),r=i?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=i?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((h,u)=>h+this.#b(u),0),a=l>0?this.min/l*100:0,d=this.#u,c=this.#S(d,t,e.key===o?wn:-wn,a);c[t]!==d[t]&&(this.#E(c),this.#p(c))}};x("nish-split",wt);var oi="http://www.w3.org/2000/svg";function wr(){let n=document.createElementNS(oi,"svg");n.setAttribute("width","10"),n.setAttribute("height","10"),n.setAttribute("viewBox","0 0 10 10"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(oi,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),n.appendChild(t)}return n}function Tr(n){return(n.target instanceof Element?n.target:n.target.parentElement)?.closest("thead")?!0:Array.from(n.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}function Lr(n){let e=n.replace(/\u2212/g,"-").replace(/[\s,$€£%]/g,""),t=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)[a-z/]*$/i.exec(e);if(!t)return null;let i=Number(t[1]);return Number.isFinite(i)?i:null}var Ar=/^[\u2013\u2014]$/,Tt=class extends S{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#i=e=>this.#l(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#i),_(()=>this.#t())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#i),this.#e?.disconnect(),this.#e=null}#t(){!this.isConnected||this.#e||(this.#a(),this.#e=new MutationObserver(e=>{e.some(Tr)&&(this.#e?.disconnect(),this.#a(),this.#n())}),this.#n())}#n(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#a(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(wr()),e.appendChild(t),this.#c(e)}}#c(e){let t=e.querySelectorAll(".nish-th-sort svg path"),i=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",i==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",i==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let i=e.querySelector(".nish-th-sort"),s="";return(i??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==oi)&&(s+=r.textContent??"")}),s.trim()}#l(e){let i=e.target?.closest(".nish-th-sort"),s=i?.closest("th[data-sort]");if(!i||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#c(o);this.manual||this.#h(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#h(e,t){let i=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((b,f)=>{let m=b.cells[i],w=m?(m.getAttribute("data-value")??m.textContent??"").trim():"",g=Ar.test(w)?"":w;return{row:b,key:g,num:Lr(g),order:f}}),d=a.filter(b=>b.key!==""),c=a.filter(b=>b.key===""),h=e.classList.contains("nish-th--num")||d.length>0&&d.every(b=>b.num!==null),u=h?d.filter(b=>b.num!==null):d,E=h?d.filter(b=>b.num===null):[];u.sort((b,f)=>(h?b.num-f.num:o.compare(b.key,f.key))*s||b.order-f.order),E.sort((b,f)=>o.compare(b.key,f.key)*s||b.order-f.order);let v=document.createDocumentFragment();for(let b of[...u,...E,...c])v.appendChild(b.row);l.appendChild(v)}}};x("nish-table-sort",Tt);var Be="\u2013",ci="\u2212",li="en-US",Cr=me("format",()=>({locale:li})),Tn=new Map;function kr(n){let e=Tn.get(n);if(e===void 0){try{e=Intl.getCanonicalLocales(n)[0]??li}catch{e=li}Tn.set(n,e)}return e}function Fe(n){return n?.locale?kr(n.locale):Cr.locale}function Cn(n){return n==="en"||n==="en-US"}var Ln=new Map;function kn(n,e){let t=Ln.get(n);return t===void 0&&(t=e(),Ln.set(n,t)),t}function Mr(n,e,t){return kn(`n|${n}|${e}|${t}`,()=>new Intl.NumberFormat(n,{minimumFractionDigits:e,maximumFractionDigits:t}))}var Lt=new Map;function _r(n){if(!n)return;let e=Lt.get(n);if(e===void 0){try{new Intl.DateTimeFormat("en-US",{timeZone:n}),e=!0}catch{e=!1}Lt.size>=64&&Lt.clear(),Lt.set(n,e)}return e?n:void 0}function he(n,e,t,i){let s=_r(i);return kn(`d|${n}|${e}|${s??""}`,()=>new Intl.DateTimeFormat(n,s?{...t,timeZone:s}:t))}function hi(n){return typeof n=="number"&&Number.isFinite(n)}function te(n,e,t,i){return Mr(i,e,t).format(n)}var ai=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function Mn(n,e,t){for(let i=0;i<ai.length;i++){let[s,r]=ai[i];if(!(n<s)){if(i>0&&Number((n/s).toFixed(e))>=1e3){let[o,l]=ai[i-1];return te(n/o,0,e,t)+l}return te(n/s,0,e,t)+r}}return te(n,0,e,t)}function _n(n,e){return Number(Math.abs(n).toFixed(e))===0}var An=new Map;function Nr(n,e){let t=`${e}|${n}`,i=An.get(t);if(i===void 0){try{let s=new Intl.NumberFormat(e,{style:"currency",currency:n,currencyDisplay:"narrowSymbol"}),r=s.formatToParts(0).find(o=>o.type==="currency")?.value??n;/\p{L}$/u.test(r)&&(r+="\xA0"),i={symbol:r,digits:s.resolvedOptions().maximumFractionDigits??2}}catch{i={symbol:n+" ",digits:2}}An.set(t,i)}return i}function $r(n,e,t){let{symbol:i,digits:s}=Nr(e.currency??"USD",t);if(e.compact&&n>=1e3)return i+Mn(n,1,t);let r=e.cents??"auto",o=10**s,l=Math.round(n*o)%o!==0,a=s>0&&(r==="always"||r==="auto"&&(n<1e3||l));return i+(a?te(n,s,s,t):te(n,0,0,t))}function Nn(n,e={}){if(!hi(n))return Be;let t=$r(Math.abs(n),e,Fe(e));return n<0&&Math.round(Math.abs(n)*100)>0?ci+t:t}function $n(n,e={}){if(!hi(n))return Be;let t=e.digits??1,i=e.fromRatio??!0?n*100:n,s=te(Math.abs(i),t,t,Fe(e))+"%";return _n(i,t)?s:i<0?ci+s:e.signed?"+"+s:s}function Rn(n,e={}){if(!hi(n))return Be;let t=Fe(e),i=n<0&&!_n(n,e.digits??2)?ci:"",s=Math.abs(n);return e.compact&&s>=1e3?i+Mn(s,e.digits??1,t):i+(e.digits===void 0?te(s,0,2,t):te(s,e.digits,e.digits,t))}var Rr=/^(\d{4})-(\d{2})-(\d{2})$/;function On(n){if(n==null)return null;let e,t=!1;if(n instanceof Date)e=n;else if(typeof n=="number")e=new Date(n);else{let i=Rr.exec(n.trim());t=!!i,e=i?new Date(Number(i[1]),Number(i[2])-1,Number(i[3])):new Date(n)}return Number.isNaN(e.getTime())?null:{d:e,dayOnly:t}}function Pn(n,e){return n.dayOnly?void 0:e.timeZone}function At(n){return n.replace(/[\u202f\u00a0]/g," ")}var ac=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var Or={month:"short",day:"numeric",year:"numeric"},Pr={weekday:"long",month:"long",day:"numeric",year:"numeric"},Ir={month:"short",day:"numeric"},Hr={weekday:"short"},Dr={month:"numeric",day:"numeric"},Br={hour:"numeric",minute:"2-digit"},Fr={hour:"numeric",minute:"2-digit",hour12:!0},Ur={year:"numeric",month:"numeric",day:"numeric"};function zr(n,e){if(!e)return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()};let t={year:0,month:0,day:0};for(let i of he("en-US","ymd",Ur,e).formatToParts(n))(i.type==="year"||i.type==="month"||i.type==="day")&&(t[i.type]=Number(i.value));return t}function Gr(n,e,t,i){let s=Pn(n,t);switch(e){case"medium":return At(he(i,"medium",Or,s).format(n.d));case"long":return At(he(i,"long",Pr,s).format(n.d));case"weekday":{let r=he(i,"weekday",Hr,s).format(n.d);if(!Cn(i))return`${r} ${he(i,"md",Dr,s).format(n.d)}`;let o=zr(n.d,s);return`${r} ${o.month}/${o.day}`}default:return At(he(i,"short",Ir,s).format(n.d))}}function In(n,e="short",t={}){let i=On(n);return i?Gr(i,e,t,Fe(t)):Be}function Vr(n,e,t){let i=Cn(t);return At(he(t,i?"time12":"time",i?Fr:Br,Pn(n,e)).format(n.d))}function Hn(n,e={}){let t=On(n);return t?Vr(t,e,Fe(e)):Be}var Dn={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function X(n,e){return n&&Object.hasOwn(Dn,n)?Dn[n]:n&&/^chart-[1-8]$/.test(n)?`var(--nish-${n})`:`var(--nish-chart-${(Math.trunc(e)%8+8)%8+1})`}var q={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},Bn,qr=n=>Math.abs(n)<1e3?String(Math.round(n*100)/100):(Bn??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),Bn.format(n));function Ee(n,e=qr){let t=(n??"").trim();if(!t)return e;let i=t.indexOf(":"),s=(i<0?t:t.slice(0,i)).toLowerCase(),r=i<0?"":t.slice(i+1).trim();switch(s){case"number":return o=>Rn(o);case"percent":{let o=r!==""&&Number.isInteger(Number(r))&&Number(r)>=0&&Number(r)<=10?Number(r):1;return l=>$n(l,{digits:o})}case"currency":return o=>Nn(o,{currency:r||"USD"});case"date":{let o=r==="medium"||r==="long"||r==="weekday"?r:"short";return l=>In(l,o)}case"time":return o=>Hn(o);default:return e}}function di(n,e,t){let i=Math.max(2,Math.floor(t));return Array.from({length:i},(s,r)=>n+(e-n)*r/(i-1))}function Un(n,e){if(n===e){let i=Math.abs(n)*.05||1;return[n-i,e+i]}let t=(e-n)*.06;return[n-t,e+t]}function zn(n,e){let t=0,i=n.length-1;for(;i-t>1;){let s=t+i>>1;n[s]<e?t=s:i=s}return Math.abs(n[t]-e)<=Math.abs(n[i]-e)?t:i}function ie(n){if(n==null||n==="")return null;let e=typeof n=="number"?n:Number(n);return Number.isFinite(e)?e:null}function ui(n){if(!Array.isArray(n))return[];let e=[];return n.forEach((t,i)=>{if(Array.isArray(t)){let s=ie(t[0]);s!==null&&e.push({x:s,y:ie(t[1])})}else if(t&&typeof t=="object"){let s=t,r=ie(s.x);r!==null&&e.push({x:r,y:ie(s.y)})}else e.push({x:i,y:ie(t)})}),e}function Gn(n){return Array.isArray(n)?n.map((e,t)=>{let i=e&&typeof e=="object"?e:{};return{label:typeof i.label=="string"&&i.label?i.label:A().seriesNumber(t+1),tone:typeof i.tone=="string"?i.tone:void 0,points:ui(i.points??i.data)}}):[]}function Vn(n){return Array.isArray(n)?n.map((e,t)=>{if(Array.isArray(e))return{label:String(e[0]??""),value:ie(e[1])??0};if(e&&typeof e=="object"){let i=e;return{label:i.label==null?String(t+1):String(i.label),value:ie(i.value)??0}}return{label:String(t+1),value:ie(e)??0}}):[]}var Ue={fromAttribute(n){if(!n)return[];try{let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute(n){try{return JSON.stringify(n)}catch{return""}}},ne=class extends S{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;themeObserver=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this)),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null,this.themeObserver?.disconnect(),this.themeObserver=null}get plotHeight(){return this.height>0?this.height:200}},Fn=0;function qn(){return Fn+=1,`nish-chart-${Fn}`}var Ct="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var Wn=18,Wr=22,kt=class extends ne{static properties={...ne.properties,data:{converter:Ue},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let e=A(),t=this.label,i=this.height>0?this.height:140,s=Vn(this.data),r=Ee(this.yFormat),o=Ee(this.xFormat,T=>String(T)),l=T=>this.xFormat&&T.trim()!==""&&Number.isFinite(Number(T))?o(Number(T)):T;if(!s.length)return k`<div class="nish-chart">
|
|
53
|
-
|
|
54
|
-
</div>`;let a=this.width,d=X(this.tone,0),c=s.map(T=>Number.isFinite(T.value)?T.value:0),h=Math.max(0,...c),u=Math.min(0,...c),E=h-u||1,v=Math.max(0,i-Wn-Wr),b=Wn+h/E*v,f=a/s.length,m=Math.max(1,f*.72),w=this.showValues,g=w||this.coarse,L=this.xTicks==="all",M=this.selected!=null&&this.selected<s.length?this.selected:null,$=T=>{let R=T.currentTarget.getBoundingClientRect(),H=Math.floor((T.clientX-R.left)/(R.width||1)*s.length);this.selected=Math.min(s.length-1,Math.max(0,H))},G=T=>{if(T.key==="ArrowLeft"||T.key==="ArrowRight"){T.preventDefault();let R=T.key==="ArrowRight"?1:-1,H=this.selected;this.selected=H==null?R>0?0:s.length-1:Math.min(s.length-1,Math.max(0,H+R))}else T.key==="Escape"&&(this.selected=null)},F=a>0?k`<svg
|
|
47
|
+
@click=${()=>this.#n()}
|
|
48
|
+
></button>`;return M`<label class="nish-check-row" style=${s?"justify-content:space-between":E}>
|
|
49
|
+
${s?n:E}${r}${s?E:n}
|
|
50
|
+
${this.name?M`<input type="hidden" name=${this.name} value="on" ?disabled=${!this.checked||this.disabled} />`:E}
|
|
51
|
+
</label>`}};w("nish-switch",bt);function mr(i,e){return e===0||!/[a-z0-9]/i.test(i[e-1])}function Si(i,e){let t=i.indexOf(e);if(t>=0){let r=t===0?0:2,o=t;if(r===2)for(let l=t;l>=0;l=i.indexOf(e,l+1)){if(mr(i,l)){r=1,o=l;break}if(l+1>=i.length)break}return{tier:r,idx:Array.from({length:e.length},(l,a)=>o+a)}}let n=[],s=0;for(let r of e){let o=i.indexOf(r,s);if(o<0)return null;n.push(o),s=o+1}return{tier:3,idx:n}}function pr(i,e){let t=e.trim().toLowerCase();if(!t)return i.slice(0,50).map(s=>({item:s,marks:[]}));let n=[];return i.forEach((s,r)=>{let o=Si(s.label.toLowerCase(),t);if(o){n.push({r:{item:s,marks:o.idx},score:o.tier,order:r});return}let l=null;for(let a of s.keywords??[]){let d=Si(a.toLowerCase(),t);d&&d.tier<3&&(l===null||d.tier<l)&&(l=d.tier)}l!==null&&n.push({r:{item:s,marks:[]},score:4+l,order:r})}),n.sort((s,r)=>s.score-r.score||s.order-r.order),n.slice(0,50).map(s=>s.r)}function xi(i,e){let t=[],n=new Map;for(let{item:s}of pr(i,e)){let r=s.group??null,o=n.get(r);o||(o=[],n.set(r,o),t.push(r)),o.push(s)}return t.sort((s,r)=>s===null?-1:r===null?1:0),t.flatMap(s=>n.get(s))}var gr=0,Be="http://www.w3.org/2000/svg",br="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function vr(){let i=document.createElementNS(Be,"svg");for(let[t,n]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(t,n);let e=document.createElementNS(Be,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),i.append(e),i}function yr(){let i=document.createElementNS(Be,"svg");for(let[n,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(n,s);let e=document.createElementNS(Be,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(Be,"path");return t.setAttribute("d","m21 21-4.3-4.3"),i.append(e,t),i}function wi(i){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(i.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function Er(i){if(!(i instanceof HTMLElement))return!1;let e=i.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||i.isContentEditable}var vt=class extends x{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++gr;#n=null;#t=null;#i=null;#r=null;#a=null;#c="";#s=0;#l=[];#h=new Map;#o=null;#d;#u=!1;#p=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#g(),this.#n){this.#y();return}this.#u||(this.#u=!0,N(()=>{this.#u=!1,this.isConnected&&this.#v()}))}disconnectedCallback(){super.disconnectedCallback(),this.#b(!1),window.clearTimeout(this.#d),this.#n?.open&&(this.open=!1,this.#n.close())}show(){this.open=!0}close(){this.open=!1}#b(e){e!==this.#p&&(this.#p=e,e?document.addEventListener("keydown",this.#S):document.removeEventListener("keydown",this.#S))}#g(){this.#b(this.hotkey&&this.isConnected)}#S=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||Er(e.target)||(e.preventDefault(),this.open=!0)};#v(){if(this.#n)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let d=new Set,c=[];for(let h of e){let u=h.dataset.id||h.getAttribute("href")||`item-${c.length+1}`;for(;d.has(u);)u=`${u}-${c.length+1}`;d.add(u);let v=(h.dataset.keywords??"").split(/[,\s]+/).map(S=>S.trim()).filter(Boolean);c.push({id:u,label:h.textContent?.trim()??u,group:h.dataset.group||void 0,hint:h.dataset.hint||void 0,keywords:v.length?v:void 0,href:h.getAttribute("href")??void 0}),this.#h.set(u,h)}this.items=c}for(let d of e)d.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let n=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",n),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#T(s.value)),s.addEventListener("keydown",d=>this.#A(d)),s.addEventListener("change",d=>d.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(vr()),o.addEventListener("click",()=>{this.open=!1}),r.append(yr(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=n,l.setAttribute("role","listbox"),l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("mousemove",d=>{let c=d.target?.closest("[data-index]");if(!c)return;let h=Number(c.dataset.index);h!==this.#s&&this.#m(h,!1)}),l.addEventListener("click",d=>{let c=d.target?.closest("[data-index]"),h=c?this.#l[Number(c.dataset.index)]:void 0;h&&this.#L(h)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=br,t.append(r,l,a),t.addEventListener("click",this.#k),t.addEventListener("cancel",this.#C),t.addEventListener("close",this.#M),t.addEventListener("keydown",d=>{d.key==="Escape"&&d.stopPropagation()}),this.append(t),this.#n=t,this.#t=s,this.#i=l,this.#r=a,this.#a=o,this.#f(),this.#y()}updated(e){e.has("hotkey")&&this.#g(),(e.has("placeholder")||e.has("emptyText"))&&this.#f(),e.has("items")&&this.#n?.open&&this.#x(),e.has("open")&&this.#y()}stringsChanged(){this.#f(),this.#n?.open&&this.#x(),super.stringsChanged()}#f(){let e=this.#t;if(!e)return;let t=A(),n=this.placeholder||t.searchPlaceholder;e.placeholder=n,e.setAttribute("aria-label",n.replace(/…$/,"")||t.search),this.#n?.setAttribute("aria-label",t.search),this.#a?.setAttribute("aria-label",t.close),this.#i?.setAttribute("aria-label",t.results)}#y(){let e=this.#n;!e||!this.isConnected||(this.open&&!e.open?(this.#o=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#c="",this.#s=0,this.#t&&(this.#t.value=""),e.showModal(),this.#x(),this.#t?.focus()):!this.open&&e.open&&e.close())}#E(e){return`nish-command-${this.#e}-opt-${e}`}#x(){let e=this.#i,t=this.#t;if(!e||!t)return;let n=A();this.#l=xi(this.items,this.#c),this.#s>=this.#l.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#l){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let h=document.createElement("div");h.className="nish-command-group",h.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,h.setAttribute("aria-labelledby",u.id),h.append(u),e.append(h),o=h}let d=document.createElement("div");d.className="nish-command-item",d.id=this.#E(s),d.dataset.index=String(s),d.setAttribute("role","option"),d.setAttribute("aria-selected",s===this.#s?"true":"false");let c=document.createElement("span");if(c.textContent=l.label,d.append(c),l.hint){let h=document.createElement("span");h.className="nish-command-item-hint",h.textContent=l.hint,d.append(h)}o.append(d),s++}if(this.#l.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||n.noResults,e.append(l)}this.#l.length?t.setAttribute("aria-activedescendant",this.#E(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#l.length?n.resultCount(this.#l.length):this.emptyText||n.noResults)}#m(e,t=!0){let n=this.#l.length;if(n===0)return;this.#s=(e%n+n)%n;let s=this.#i;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#t?.setAttribute("aria-activedescendant",this.#E(this.#s))}}#T(e){this.#c=e,this.#s=0,this.#x(),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#A(e){if(e.isComposing)return;let t=this.#l.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#m(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#m(this.#s-1);break;case"Home":t&&!this.#c&&(e.preventDefault(),this.#m(0));break;case"End":t&&!this.#c&&(e.preventDefault(),this.#m(t-1));break;case"Enter":{e.preventDefault();let n=this.#l[this.#s];n&&this.#L(n);break}}}#L(e){let t=this.#h.get(e.id);if(this.open=!1,this.#n?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let n=t.getAttribute("href");n!==null&&we(n)===null?wi(n):t.click()}else if(e.href){let n=we(e.href);n===null?wi(e.href):window.location.assign(n)}}#k=e=>{let t=this.#n;if(!t||e.target!==t)return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||(this.open=!1)};#C=e=>{e.preventDefault(),this.open=!1};#M=()=>{window.clearTimeout(this.#d),this.open&&(this.open=!1);let e=this.#o;this.#o=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};w("nish-command-palette",vt);var Sr={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},xr=0;function yt(i){let e=document.createElement("div");return e.className=i,e}var Et=class extends x{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#n=yt("nish-filter-bar-search");#t=yt("nish-filter-bar-chips");#i=yt("nish-filter-bar-trailing");#r=yt("nish-filter-bar-summary");#a=null;#c=null;#s=null;#l=null;#h=null;#o=null;#d=null;#u=null;#p=null;#b=null;#g=[];#S=null;#v=null;#f="";#y=null;#E=()=>this.#C();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),N(()=>this.#x())}disconnectedCallback(){if(super.disconnectedCallback(),this.#v?.removeEventListener("change",this.#E),this.#v=null,this.#f="",this.#y?.disconnect(),this.#y=null,this.#e){this.#h?.close();for(let e of this.#g)this.appendChild(e);for(let e of[this.#n,this.#i,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#h?.remove(),this.#e=null,this.#a=null,this.#c=null,this.#d=null,this.#u=null,this.#p=null,this.#l=null,this.#h=null,this.#o=null,this.#g=[],this.#S=null}}updated(e){this.#e&&(this.#k(),this.#C())}#x(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#n,this.#t,this.#i,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#T(t);this.appendChild(e),this.#A(),this.#k(),this.#C(),this.#y=new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#T(s)});this.#C()}),this.#y.observe(this,{childList:!0}),this.#y.observe(this.#t,{childList:!0}),this.#o&&this.#y.observe(this.#o,{childList:!0})}#m(){this.#g=this.#g.filter(e=>e.parentNode===this.#t||e.parentNode===this.#o)}#T(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#i.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#n.firstChild?this.#n.appendChild(e):(this.#m(),this.#g.includes(e)||this.#g.push(e),(this.#S==="compact"?this.#o??this.#t:this.#t).appendChild(e))}#A(){let e=++xr,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#c=document.createTextNode(""),t.append(pi(16),this.#c);let n=document.createElement("span");n.className="nish-badge nish-badge--accent",t.appendChild(n),t.addEventListener("click",()=>this.#h?.show()),this.#a=t,this.#s=n;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#L()),this.#l=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#u=a,a.appendChild(lt(16)),o.appendChild(a);let d=document.createElement("div");d.className="nish-sheet-body nish-filter-sheet-body";let c=document.createElement("footer");c.className="nish-sheet-footer";let h=document.createElement("button");h.type="button",h.className="nish-btn nish-btn--ghost",h.addEventListener("click",()=>this.#L());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#p=u,u.addEventListener("click",()=>this.#h?.close()),c.append(h,u),r.append(o,d,c),this.#h=r,this.#o=d,this.#d=h,this.#b=l}#L(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#k(){let e=Sr[this.sheetBelow==="lg"?"lg":"md"];e!==this.#f&&(this.#v?.removeEventListener("change",this.#E),this.#f=e,this.#v=typeof matchMedia>"u"?null:matchMedia(e),this.#v?.addEventListener("change",this.#E))}#C(){let e=this.#e,t=this.#h,n=this.#o,s=this.#a,r=this.#l;if(!e||!t||!n||!s||!r)return;this.#m();let o=this.#v?.matches?"compact":"wide";o!==this.#S&&(o==="compact"?(this.#t.remove(),r.remove(),this.#n.after(s),n.append(...this.#g),e.appendChild(t)):(t.close(),s.remove(),this.#t.append(...this.#g,r),this.#n.after(this.#t),t.remove()),this.#S=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#g.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",A().activeCount(l))),this.#d&&(this.#d.disabled=l===0);let a=A();this.#b&&(this.#b.textContent=this.sheetTitle||a.filters),this.#c&&(this.#c.data=a.filters),r.textContent=a.clearFilters,this.#d&&(this.#d.textContent=a.clear),this.#p&&(this.#p.textContent=a.showResults),this.#u?.setAttribute("aria-label",a.close)}};w("nish-filter-bar",Et);var St=class extends x{static properties={label:{type:String,reflect:!0}};#e=null;#n=null;#t=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),N(()=>this.#i())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.disconnect(),this.#t=null,this.#e=null,this.#n?.(),this.#n=null}updated(e){this.#a()}#i(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#a(),this.#n=it(e,t=>t.classList.add("nish-nav-rail-item")),this.#t=new MutationObserver(t=>{let n=this.#e;if(!n)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==n&&o.nodeType===1&&o.parentNode===this&&(n.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(n)}),this.#t.observe(this,{childList:!0}),this.#t.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),n=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),n?.classList.add("nish-nav-rail-footer");let s=[t,n].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,d)=>r[r.length-o+d]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#a(){this.#e&&this.#e.setAttribute("aria-label",this.label||A().sections)}};w("nish-nav-rail",St);var wr='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',xt=class extends x{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#n=null;#t=null;#i=()=>this.#c();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),N(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#i),this.#n?.disconnect(),this.#n=null,this.#t?.disconnect(),this.#t=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#t?.disconnect(),this.#t=new MutationObserver(()=>{let n=this.#e;if(n)for(let s of Array.from(this.childNodes))s!==n&&s.nodeType===1&&n.appendChild(s)}),this.#t.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#i,{passive:!0}),typeof ResizeObserver<"u"&&(this.#n=new ResizeObserver(()=>this.#c()),this.#n.observe(e));let t=e.querySelector(wr);t&&this.#a(e,t),this.#c()}#a(e,t){let n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<n.left+r?e.scrollLeft+=s.left-n.left-r:s.right>n.right-r&&(e.scrollLeft+=s.right-n.right+r)}#c(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth,n=z(e)?e.scrollLeft+t:e.scrollLeft;e.dataset.atStart=String(n<=1),e.dataset.atEnd=String(t<=1||n>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};w("nish-scroll-row",xt);var Ti={fromAttribute:i=>i!=="false",toAttribute:i=>i?null:"false"},wt=class extends x{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:Ti},updateHash:{attribute:"update-hash",reflect:!0,converter:Ti}};#e=null;#n=null;#t=null;#i=null;#r=e=>this.#h(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),N(()=>this.#a())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.(),this.#n=null,this.#s=null,this.#t?.disconnect(),this.#t=null,this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#c()}#a(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#c(),e.addEventListener("click",this.#r),this.#l(e),this.#t=new MutationObserver(()=>{this.#n?.(),this.#l(e)}),this.#t.observe(e,{childList:!0}),this.#i=new MutationObserver(()=>{let t=this.#e;if(t)for(let n of Array.from(this.childNodes))n!==t&&n.nodeType===1&&t.appendChild(n)}),this.#i.observe(this,{childList:!0})}#c(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||A().onThisPage||Ee.onThisPage),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#l(e))}#s=null;#l(e){this.#n?.(),this.#n=Rn(e,{height:this.sticky}),this.#s=this.sticky}#h(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n;try{n=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(n);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(this.#n?.lock(n),s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),!s.hasAttribute("tabindex")&&!s.matches("a[href],button,input,select,textarea,summary")&&(s.tabIndex=-1),s.focus({preventScroll:!0}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:n}}))}};w("nish-section-nav",wt);var Li=5,Tr="(max-width: 639.98px) and (pointer: coarse)";function on(i,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!i||i.length!==e||!i.every(s=>Number.isFinite(s)&&s>0))return t();let n=i.reduce((s,r)=>s+r,0);return i.map(s=>s/n*100)}var Lr={fromAttribute(i){if(i==null||i.trim()==="")return null;let e=i.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(i){return i&&i.length?i.map(e=>Math.round(e*100)/100).join(","):null}},Tt=class extends x{static properties={orientation:{type:String,reflect:!0},sizes:{converter:Lr,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#n=[];#t=null;#i=null;#r=!1;#a=null;#c=!1;#s=!1;#l=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#i=window.matchMedia(Tr),this.#r=this.#i.matches,this.#i.addEventListener("change",this.#b)),this.#s){this.#h(),this.#o();return}this.#c||(this.#c=!0,N(()=>{this.#c=!1,this.isConnected&&(this.#s=!0,this.#h(),this.#o())}))}disconnectedCallback(){super.disconnectedCallback(),this.#i?.removeEventListener("change",this.#b),this.#i=null,this.#t?.disconnect(),this.#t=null,this.#m()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#p()}#h(){typeof MutationObserver>"u"||(this.#t??=new MutationObserver(()=>this.#o()),this.#t.observe(this,{childList:!0}))}#o(){if(!this.isConnected)return;this.#t?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let n=document.createElement("div");n.className="nish-split-pane",this.insertBefore(n,t),n.append(t),e.push(n)}this.#e=e,this.#n=[];for(let t=0;t<e.length-1;t++){let n=document.createElement("div");n.className="nish-split-divider",n.setAttribute("role","separator"),n.tabIndex=0,n.style.touchAction="none",n.addEventListener("pointerdown",s=>this.#y(s,t)),n.addEventListener("pointermove",s=>this.#E(s)),n.addEventListener("pointerup",s=>this.#x(s)),n.addEventListener("pointercancel",s=>this.#x(s)),n.addEventListener("keydown",s=>this.#A(s,t)),n.addEventListener("dblclick",()=>this.#T()),this.insertBefore(n,e[t+1]),this.#n.push(n)}this.#d(),this.#p(),this.#t?.observe(this,{childList:!0})}#d(){if(!(this.#l||!this.storageKey||this.#e.length===0)){this.#l=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>0)&&(this.sizes=on(t,this.#e.length))}catch{}}}get#u(){return on(this.sizes,this.#e.length)}#p(){let e=this.orientation!=="column",t=this.#u,n=A();this.classList.add("nish-split"),this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#n.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?n.resizeColumns:n.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#b=e=>{this.#r=e.matches,this.#p()};#g(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#S(e,t,n,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+n,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#v(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#f(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#y(e,t){if(e.button!==0||this.#r)return;let n=this.#n[t];if(!n)return;e.preventDefault(),n.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#g(l),0);this.#a={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#u,total:r,restore:s},this.setAttribute("data-dragging","")}#E(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let n=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&z(this)?-1:1,r=(n-t.start)*s/t.total*100;r!==0&&this.#f(this.#S(t.sizes,t.index,r,this.min/t.total*100))}#x(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;let n=this.#n[t.index];n?.hasPointerCapture?.(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.#m()}#m(){let e=this.#a;if(e){this.#a=null,this.sizes&&this.#v(this.sizes);for(let[t,n]of e.restore)t.style.pointerEvents=n;this.removeAttribute("data-dragging")}}#T(){if(this.#r||this.#e.length<2)return;let e=on(null,this.#e.length);this.#f(e),this.#v(e)}#A(e,t){if(e.key==="Enter"){e.preventDefault(),this.#T();return}let n=this.orientation!=="column",s=n&&z(this),r=n?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=n?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((h,u)=>h+this.#g(u),0),a=l>0?this.min/l*100:0,d=this.#u,c=this.#S(d,t,e.key===o?Li:-Li,a);c[t]!==d[t]&&(this.#f(c),this.#v(c))}};w("nish-split",Tt);var an="http://www.w3.org/2000/svg";function Ar(){let i=document.createElementNS(an,"svg");i.setAttribute("width","10"),i.setAttribute("height","10"),i.setAttribute("viewBox","0 0 10 10"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(an,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),i.appendChild(t)}return i}function Cr(i){return(i.target instanceof Element?i.target:i.target.parentElement)?.closest("thead")?!0:Array.from(i.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}var kr={k:1e3,K:1e3,M:1e6,B:1e9,T:1e12},Mr=new Set(["USD","EUR","GBP","CHF","JPY","CAD","AUD","NZD","SEK","NOK","DKK","PLN","CZK","HUF","INR","CNY","KRW","BRL","MXN","ZAR","SGD","HKD","AED","TRY","RUB","ILS","THB","US","CA","AU","NZ","HK","kr","R","Rs","Fr","A","C"]);function _r(i){let e=i.replace(/−/g,"-").replace(/[\s,%]/g,"").replace(/\p{Sc}/gu,""),t=0;for(;t<e.length&&t<4&&/[A-Za-z]/.test(e[t]);)t++;t>0&&t<=3&&t<e.length&&/\d/.test(e[t])&&Mr.has(e.slice(0,t))||(t=0);let n=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)([a-z/]*)$/i.exec(e.slice(t));if(!n)return null;let s=n[2]==="B"&&/\sB\s*$/.test(i),r=Number(n[1])*(s?1:kr[n[2]]??1);return Number.isFinite(r)?r:null}var Nr=/^[\u2013\u2014]$/,Lt=class extends x{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#n=e=>this.#l(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#n),N(()=>this.#t())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#n),this.#e?.disconnect(),this.#e=null}#t(){!this.isConnected||this.#e||(this.#a(),this.#e=new MutationObserver(e=>{e.some(Cr)&&(this.#e?.disconnect(),this.#a(),this.#i())}),this.#i())}#i(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#a(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(Ar()),e.appendChild(t),this.#c(e)}}#c(e){let t=e.querySelectorAll(".nish-th-sort svg path"),n=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",n==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",n==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let n=e.querySelector(".nish-th-sort"),s="";return(n??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==an)&&(s+=r.textContent??"")}),s.trim()}#l(e){let n=e.target?.closest(".nish-th-sort"),s=n?.closest("th[data-sort]");if(!n||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#c(o);this.manual||this.#h(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#h(e,t){let n=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((g,f)=>{let L=g.cells[n],b=L?(L.getAttribute("data-value")??L.textContent??"").trim():"",m=Nr.test(b)?"":b;return{row:g,key:m,num:_r(m),order:f}}),d=a.filter(g=>g.key!==""),c=a.filter(g=>g.key===""),h=e.classList.contains("nish-th--num")||d.length>0&&d.every(g=>g.num!==null),u=h?d.filter(g=>g.num!==null):d,v=h?d.filter(g=>g.num===null):[];u.sort((g,f)=>(h?g.num-f.num:o.compare(g.key,f.key))*s||g.order-f.order),v.sort((g,f)=>o.compare(g.key,f.key)*s||g.order-f.order);let S=document.createDocumentFragment();for(let g of[...u,...v,...c])S.appendChild(g.row);l.appendChild(S)}}};w("nish-table-sort",Lt);var Fe="\u2013",hn="\u2212",cn="en-US",$r=pe("format",()=>({locale:cn})),Ai=new Map;function Rr(i){let e=Ai.get(i);if(e===void 0){try{e=Intl.getCanonicalLocales(i)[0]??cn}catch{e=cn}Ai.set(i,e)}return e}function Ue(i){return i?.locale?Rr(i.locale):$r.locale}function Mi(i){return i==="en"||i==="en-US"}var Ci=new Map;function _i(i,e){let t=Ci.get(i);return t===void 0&&(t=e(),Ci.set(i,t)),t}function Or(i,e,t){return _i(`n|${i}|${e}|${t}`,()=>new Intl.NumberFormat(i,{minimumFractionDigits:e,maximumFractionDigits:t}))}var At=new Map;function Pr(i){if(!i)return;let e=At.get(i);if(e===void 0){try{new Intl.DateTimeFormat("en-US",{timeZone:i}),e=!0}catch{e=!1}At.size>=64&&At.clear(),At.set(i,e)}return e?i:void 0}function de(i,e,t,n){let s=Pr(n);return _i(`d|${i}|${e}|${s??""}`,()=>new Intl.DateTimeFormat(i,s?{...t,timeZone:s}:t))}function dn(i){return typeof i=="number"&&Number.isFinite(i)}function te(i,e,t,n){return Or(n,e,t).format(i)}var ln=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function Ni(i,e,t){for(let n=0;n<ln.length;n++){let[s,r]=ln[n];if(!(i<s)){if(n>0&&Number((i/s).toFixed(e))>=1e3){let[o,l]=ln[n-1];return te(i/o,0,e,t)+l}return te(i/s,0,e,t)+r}}return te(i,0,e,t)}function $i(i,e){return Number(Math.abs(i).toFixed(e))===0}var ki=new Map;function Ir(i,e){let t=`${e}|${i}`,n=ki.get(t);if(n===void 0){try{let s=new Intl.NumberFormat(e,{style:"currency",currency:i,currencyDisplay:"narrowSymbol"}),r=s.formatToParts(0).find(o=>o.type==="currency")?.value??i;/\p{L}$/u.test(r)&&(r+="\xA0"),n={symbol:r,digits:s.resolvedOptions().maximumFractionDigits??2}}catch{n={symbol:i+" ",digits:2}}ki.set(t,n)}return n}function Hr(i,e,t){let{symbol:n,digits:s}=Ir(e.currency??"USD",t);if(e.compact&&i>=1e3)return n+Ni(i,1,t);let r=e.cents??"auto",o=10**s,l=Math.round(i*o)%o!==0,a=s>0&&(r==="always"||r==="auto"&&(i<1e3||l));return n+(a?te(i,s,s,t):te(i,0,0,t))}function Ri(i,e={}){if(!dn(i))return Fe;let t=Hr(Math.abs(i),e,Ue(e));return i<0&&Math.round(Math.abs(i)*100)>0?hn+t:t}function Oi(i,e={}){if(!dn(i))return Fe;let t=e.digits??1,n=e.fromRatio??!0?i*100:i,s=te(Math.abs(n),t,t,Ue(e))+"%";return $i(n,t)?s:n<0?hn+s:e.signed?"+"+s:s}function Pi(i,e={}){if(!dn(i))return Fe;let t=Ue(e),n=i<0&&!$i(i,e.digits??2)?hn:"",s=Math.abs(i);return e.compact&&s>=1e3?n+Ni(s,e.digits??1,t):n+(e.digits===void 0?te(s,0,2,t):te(s,e.digits,e.digits,t))}var Dr=/^(\d{4})-(\d{2})-(\d{2})$/;function Ii(i){if(i==null)return null;let e,t=!1;if(i instanceof Date)e=i;else if(typeof i=="number")e=new Date(i);else{let n=Dr.exec(i.trim());t=!!n,e=n?new Date(Number(n[1]),Number(n[2])-1,Number(n[3])):new Date(i)}return Number.isNaN(e.getTime())?null:{d:e,dayOnly:t}}function Hi(i,e){return i.dayOnly?void 0:e.timeZone}function Ct(i){return i.replace(/[\u202f\u00a0]/g," ")}var uc=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var Br={month:"short",day:"numeric",year:"numeric"},Fr={weekday:"long",month:"long",day:"numeric",year:"numeric"},Ur={month:"short",day:"numeric"},zr={weekday:"short"},Gr={month:"numeric",day:"numeric"},Vr={hour:"numeric",minute:"2-digit"},qr={hour:"numeric",minute:"2-digit",hour12:!0},Wr={year:"numeric",month:"numeric",day:"numeric"};function jr(i,e){if(!e)return{year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()};let t={year:0,month:0,day:0};for(let n of de("en-US","ymd",Wr,e).formatToParts(i))(n.type==="year"||n.type==="month"||n.type==="day")&&(t[n.type]=Number(n.value));return t}function Kr(i,e,t,n){let s=Hi(i,t);switch(e){case"medium":return Ct(de(n,"medium",Br,s).format(i.d));case"long":return Ct(de(n,"long",Fr,s).format(i.d));case"weekday":{let r=de(n,"weekday",zr,s).format(i.d);if(!Mi(n))return`${r} ${de(n,"md",Gr,s).format(i.d)}`;let o=jr(i.d,s);return`${r} ${o.month}/${o.day}`}default:return Ct(de(n,"short",Ur,s).format(i.d))}}function Di(i,e="short",t={}){let n=Ii(i);return n?Kr(n,e,t,Ue(t)):Fe}function Yr(i,e,t){let n=Mi(t);return Ct(de(t,n?"time12":"time",n?qr:Vr,Hi(i,e)).format(i.d))}function Bi(i,e={}){let t=Ii(i);return t?Yr(t,e,Ue(e)):Fe}var Fi={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function Z(i,e){return i&&Object.hasOwn(Fi,i)?Fi[i]:i&&/^chart-[1-8]$/.test(i)?`var(--nish-${i})`:`var(--nish-chart-${(Math.trunc(e)%8+8)%8+1})`}var W={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},Ui,Xr=i=>Math.abs(i)<1e3?String(Math.round(i*100)/100):(Ui??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),Ui.format(i));function Se(i,e=Xr){let t=(i??"").trim();if(!t)return e;let n=t.indexOf(":"),s=(n<0?t:t.slice(0,n)).toLowerCase(),r=n<0?"":t.slice(n+1).trim();switch(s){case"number":return o=>Pi(o);case"percent":{let o=r!==""&&Number.isInteger(Number(r))&&Number(r)>=0&&Number(r)<=10?Number(r):1;return l=>Oi(l,{digits:o})}case"currency":return o=>Ri(o,{currency:r||"USD"});case"date":{let o=r==="medium"||r==="long"||r==="weekday"?r:"short";return l=>Di(l,o)}case"time":return o=>Bi(o);default:return e}}function un(i,e,t){let n=Math.max(2,Math.floor(t));return Array.from({length:n},(s,r)=>i+(e-i)*r/(n-1))}function Gi(i,e){if(i===e){let n=Math.abs(i)*.05||1;return[i-n,e+n]}let t=(e-i)*.06;return[i-t,e+t]}function Vi(i,e){let t=0,n=i.length-1;for(;n-t>1;){let s=t+n>>1;i[s]<e?t=s:n=s}return Math.abs(i[t]-e)<=Math.abs(i[n]-e)?t:n}function ne(i){if(i==null||i==="")return null;let e=typeof i=="number"?i:Number(i);return Number.isFinite(e)?e:null}function mn(i){if(!Array.isArray(i))return[];let e=[];return i.forEach((t,n)=>{if(Array.isArray(t)){let s=ne(t[0]);s!==null&&e.push({x:s,y:ne(t[1])})}else if(t&&typeof t=="object"){let s=t,r=ne(s.x);r!==null&&e.push({x:r,y:ne(s.y)})}else e.push({x:n,y:ne(t)})}),e}function qi(i){return Array.isArray(i)?i.map((e,t)=>{let n=e&&typeof e=="object"?e:{};return{label:typeof n.label=="string"&&n.label?n.label:A().seriesNumber(t+1),tone:typeof n.tone=="string"?n.tone:void 0,points:mn(n.points??n.data)}}):[]}function Wi(i){return Array.isArray(i)?i.map((e,t)=>{if(Array.isArray(e))return{label:String(e[0]??""),value:ne(e[1])??0};if(e&&typeof e=="object"){let n=e;return{label:n.label==null?String(t+1):String(n.label),value:ne(n.value)??0}}return{label:String(t+1),value:ne(e)??0}}):[]}var ze={fromAttribute(i){if(!i)return[];try{let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute(i){try{return JSON.stringify(i)}catch{return""}}},ie=class extends x{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null}get plotHeight(){return this.height>0?this.height:200}},zi=0;function ji(){return zi+=1,`nish-chart-${zi}`}var Ge="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var Ki=18,Zr=22,kt=class extends ie{static properties={...ie.properties,data:{converter:ze},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let e=A(),t=this.label,n=this.height>0?this.height:140,s=Wi(this.data),r=Se(this.yFormat),o=Se(this.xFormat,T=>String(T)),l=T=>this.xFormat&&T.trim()!==""&&Number.isFinite(Number(T))?o(Number(T)):T;if(!s.length)return M`<div class="nish-chart">
|
|
52
|
+
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${n}px;box-sizing:border-box">${this.empty||e.noDataYet}</div>
|
|
53
|
+
</div>`;let a=this.width,d=Z(this.tone,0),c=s.map(T=>Number.isFinite(T.value)?T.value:0),h=Math.max(0,...c),u=Math.min(0,...c),v=h-u||1,S=Math.max(0,n-Ki-Zr),g=Ki+h/v*S,f=a/s.length,L=Math.max(1,f*.72),b=this.showValues,m=b||this.coarse,y=this.xTicks==="all",C=this.selected!=null&&this.selected<s.length?this.selected:null,_=T=>{let R=T.currentTarget.getBoundingClientRect(),H=Math.floor((T.clientX-R.left)/(R.width||1)*s.length);this.selected=Math.min(s.length-1,Math.max(0,H))},G=T=>{if(T.key==="ArrowLeft"||T.key==="ArrowRight"){T.preventDefault();let R=T.key==="ArrowRight"?1:-1,H=this.selected;this.selected=H==null?R>0?0:s.length-1:Math.min(s.length-1,Math.max(0,H+R))}else T.key==="Escape"&&(this.selected=null)},F=a>0?M`<svg
|
|
55
54
|
width=${a}
|
|
56
|
-
height=${
|
|
55
|
+
height=${n}
|
|
57
56
|
role="img"
|
|
58
57
|
tabindex="0"
|
|
59
58
|
aria-label=${t}
|
|
60
59
|
style="display:block;touch-action:pan-y"
|
|
61
|
-
@pointerdown=${
|
|
62
|
-
@pointermove=${T=>{(T.pointerType==="mouse"||T.buttons)
|
|
60
|
+
@pointerdown=${_}
|
|
61
|
+
@pointermove=${T=>{(T.pointerType==="mouse"||T.buttons)&&_(T)}}
|
|
63
62
|
@pointerleave=${T=>{T.pointerType==="mouse"&&(this.selected=null)}}
|
|
64
63
|
@keydown=${G}
|
|
65
64
|
>
|
|
66
|
-
<line class="nish-chart-grid" x1="0" x2=${a} y1=${
|
|
67
|
-
${c.map((T,R)=>{let H=Math.max(2,Math.abs(T)/
|
|
68
|
-
<rect x=${
|
|
69
|
-
${
|
|
65
|
+
<line class="nish-chart-grid" x1="0" x2=${a} y1=${g} y2=${g} stroke=${W.grid} stroke-width="1"></line>
|
|
66
|
+
${c.map((T,R)=>{let H=Math.max(2,Math.abs(T)/v*S),U=T<0?g:g-H,D=R*f+(f-L)/2,j=C===R,xe=j||m&&(b||f>=26);return $`<g>
|
|
67
|
+
<rect x=${D} y=${U} width=${L} height=${H} rx="2" fill=${d} opacity=${C==null||j?1:.55}></rect>
|
|
68
|
+
${xe?$`<text class="nish-chart-axis" x=${D+L/2} y=${T<0?U+H+11:Math.max(11,U-4)} text-anchor="middle" font-size="11" fill=${W.text} style="font-variant-numeric:tabular-nums">${r(T)}</text>`:E}
|
|
70
69
|
</g>`})}
|
|
71
|
-
${s.map((T,R)=>{if(!(
|
|
72
|
-
</svg>`:
|
|
70
|
+
${s.map((T,R)=>{if(!(y||R===0||R===s.length-1))return E;let H=y?"middle":R===0?"start":"end",U=y?R*f+f/2:R===0?0:a;return $`<text class="nish-chart-axis" x=${U} y=${n-6} text-anchor=${H} font-size="11" fill=${W.text}>${l(T.label)}</text>`})}
|
|
71
|
+
</svg>`:E;return M`<div class="nish-chart" style="position:relative;width:100%">
|
|
73
72
|
${F}
|
|
74
|
-
<div aria-live="polite" style="margin-top:4px;min-height:20px;font-size:14px;font-variant-numeric:tabular-nums;color:var(--nish-hi2)">${
|
|
75
|
-
<table style=${
|
|
73
|
+
<div aria-live="polite" style="margin-top:4px;min-height:20px;font-size:14px;font-variant-numeric:tabular-nums;color:var(--nish-hi2)">${C!=null?`${l(s[C].label)}: ${r(c[C])}`:""}</div>
|
|
74
|
+
<table style=${Ge}>
|
|
76
75
|
<caption>${t}</caption>
|
|
77
76
|
<tbody>
|
|
78
|
-
${s.map((T,R)=>
|
|
77
|
+
${s.map((T,R)=>M`<tr><th scope="row">${l(T.label)}</th><td>${r(c[R])}</td></tr>`)}
|
|
79
78
|
</tbody>
|
|
80
79
|
</table>
|
|
81
|
-
</div>`}};
|
|
82
|
-
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${
|
|
83
|
-
</div>`;let c=s.map(p=>new Map(p.points.filter(l).map(
|
|
80
|
+
</div>`}};w("nish-bar-chart",kt);var Mt=10,Qr=24,Jr=12,eo="position:absolute;top:4px;z-index:10;pointer-events:none;white-space:nowrap;padding:4px 8px;font-variant-numeric:tabular-nums;background:var(--nish-elevated);border:1px solid var(--nish-line-strong);border-radius:var(--nish-radius-sm);box-shadow:var(--nish-shadow-pop);color:var(--nish-hi);font-size:12px",_t=class extends ie{static properties={...ie.properties,data:{converter:ze},series:{converter:ze},area:{type:Boolean,reflect:!0},baseline:{type:Number,reflect:!0},yTicks:{type:Number,attribute:"y-ticks",reflect:!0},xTicks:{type:Number,attribute:"x-ticks",reflect:!0},active:{state:!0}};fromKey=!1;listening=!1;gradId=ji();constructor(){super(),this.data=[],this.series=[],this.area=!1,this.height=200,this.yTicks=4,this.xTicks=4,this.active=null}onDocPointerDown=e=>{this.contains(e.target)||(this.active=null)};disconnectedCallback(){super.disconnectedCallback(),this.stopListening()}stopListening(){this.listening&&(document.removeEventListener("pointerdown",this.onDocPointerDown),this.listening=!1)}updated(){this.active!=null&&!this.listening?(document.addEventListener("pointerdown",this.onDocPointerDown),this.listening=!0):this.active==null&&this.stopListening()}lines(){let e=qi(this.series);if(e.length)return e;let t=mn(this.data);return t.length?[{label:this.label,tone:this.tone||void 0,points:t}]:[]}moveTo(e,t,n,s,r,o,l){let a=t.getBoundingClientRect(),d=o+(e-a.left-s)/(r||1)*(l-o);this.active=Vi(n,d)}render(){let e=A(),t=this.label,n=this.plotHeight,s=this.lines(),r=Se(this.yFormat),o=Se(this.xFormat),l=p=>p.y!=null&&Number.isFinite(p.y)&&Number.isFinite(p.x),a=new Set;for(let p of s)for(let k of p.points)l(k)&&a.add(k.x);let d=[...a].sort((p,k)=>p-k);if(!d.length)return M`<div class="nish-chart">
|
|
81
|
+
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${n}px;box-sizing:border-box">${this.empty||e.noDataYet}</div>
|
|
82
|
+
</div>`;let c=s.map(p=>new Map(p.points.filter(l).map(k=>[k.x,k.y]))),h=1/0,u=-1/0;for(let p of s)for(let k of p.points)l(k)&&(h=Math.min(h,k.y),u=Math.max(u,k.y));let v=this.baseline!=null&&Number.isFinite(this.baseline)?this.baseline:void 0;v!==void 0&&(h=Math.min(h,v),u=Math.max(u,v)),[h,u]=Gi(h,u);let S=d[0],g=d[d.length-1]===S?S+1:d[d.length-1],f=this.width,L=un(h,u,this.yTicks||4).map(p=>({v:p,text:r(p)})),b=Math.ceil(Math.max(...L.map(p=>p.text.length))*6.6)+10,m=Math.max(0,f-b-Jr),y=Math.max(0,n-Mt-Qr),C=p=>b+(p-S)/(g-S)*m,_=p=>Mt+(1-(p-h)/(u-h))*y,G=Mt+y,F=s.map(p=>{let k=[],P=[];for(let Nt of[...p.points].sort((Ji,es)=>Ji.x-es.x))l(Nt)?P.push([Number(C(Nt.x).toFixed(1)),Number(_(Nt.y).toFixed(1))]):(P.length&&k.push(P),P=[]);return P.length&&k.push(P),k}),T=p=>p.map(k=>`${k[0]},${k[1]}`).join(" "),R=Math.min(this.xTicks||4,Math.max(2,Math.floor(m/72))),H=un(S,g,R),U=this.active!=null&&this.active<d.length?this.active:null,D=U!=null?d[U]:null,j=D!=null?C(D):0,xe=D!=null?s.map((p,k)=>({s:p,i:k,y:c[k].get(D)})).filter(p=>p.y!=null):[],Yi=j<f/2,pn=p=>{this.fromKey=!1,this.moveTo(p.clientX,p.currentTarget,d,b,m,S,g)},Xi=p=>{if(p.key==="ArrowLeft"||p.key==="ArrowRight"){p.preventDefault(),this.fromKey=!0;let k=p.key==="ArrowRight"?1:-1,P=this.active;this.active=P==null?k>0?0:d.length-1:Math.min(d.length-1,Math.max(0,P+k))}else p.key==="Escape"&&(this.active=null)},fn=s[0],gn=Z(fn?.tone,0),Zi=f>0?M`<svg
|
|
84
83
|
width=${f}
|
|
85
|
-
height=${
|
|
84
|
+
height=${n}
|
|
86
85
|
role="img"
|
|
87
86
|
tabindex="0"
|
|
88
87
|
aria-label=${t}
|
|
89
88
|
style="display:block;touch-action:pan-y"
|
|
90
|
-
@pointerdown=${
|
|
91
|
-
@pointermove=${
|
|
89
|
+
@pointerdown=${pn}
|
|
90
|
+
@pointermove=${pn}
|
|
92
91
|
@pointerleave=${p=>{p.pointerType==="mouse"&&(this.active=null)}}
|
|
93
|
-
@keydown=${
|
|
92
|
+
@keydown=${Xi}
|
|
94
93
|
@blur=${()=>{this.fromKey&&(this.active=null)}}
|
|
95
94
|
>
|
|
96
|
-
${this.area&&
|
|
97
|
-
${
|
|
98
|
-
<line class="nish-chart-grid" x1=${
|
|
99
|
-
<text class="nish-chart-axis" x=${
|
|
95
|
+
${this.area&&fn?$`<defs><linearGradient id=${this.gradId} x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color=${gn} stop-opacity="0.2"></stop><stop offset="100%" stop-color=${gn} stop-opacity="0"></stop></linearGradient></defs>`:E}
|
|
96
|
+
${L.map(p=>$`<g>
|
|
97
|
+
<line class="nish-chart-grid" x1=${b} x2=${b+m} y1=${_(p.v)} y2=${_(p.v)} stroke=${W.grid} stroke-width="1"></line>
|
|
98
|
+
<text class="nish-chart-axis" x=${b-6} y=${_(p.v)} text-anchor="end" dominant-baseline="middle" font-size="11" fill=${W.text} style="font-variant-numeric:tabular-nums">${p.text}</text>
|
|
100
99
|
</g>`)}
|
|
101
|
-
${H.map((p,
|
|
102
|
-
${
|
|
103
|
-
${this.area?(F[0]??[]).map(p
|
|
104
|
-
${F.map((p,
|
|
105
|
-
${
|
|
106
|
-
<line x1=${
|
|
107
|
-
${
|
|
108
|
-
</g>`:
|
|
109
|
-
</svg>`:
|
|
110
|
-
<div style="color:var(--nish-hi3)">${o(
|
|
111
|
-
${
|
|
112
|
-
<span aria-hidden="true" style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${
|
|
113
|
-
${s.length>1?
|
|
100
|
+
${H.map((p,k)=>$`<text class="nish-chart-axis" x=${C(p)} y=${n-6} text-anchor=${k===0?"start":k===H.length-1?"end":"middle"} font-size="11" fill=${W.text} style="font-variant-numeric:tabular-nums">${o(p)}</text>`)}
|
|
101
|
+
${v!==void 0?$`<line x1=${b} x2=${b+m} y1=${_(v)} y2=${_(v)} stroke=${W.zero} stroke-width="1" stroke-dasharray="4 4"></line>`:E}
|
|
102
|
+
${this.area?(F[0]??[]).map(p=>$`<polygon points="${p[0][0]},${G} ${T(p)} ${p[p.length-1][0]},${G}" fill="url(#${this.gradId})"></polygon>`):E}
|
|
103
|
+
${F.map((p,k)=>p.map(P=>P.length===1?$`<circle cx=${P[0][0]} cy=${P[0][1]} r="2" fill=${Z(s[k].tone,k)}></circle>`:$`<polyline points=${T(P)} fill="none" stroke=${Z(s[k].tone,k)} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></polyline>`))}
|
|
104
|
+
${D!=null?$`<g pointer-events="none">
|
|
105
|
+
<line x1=${j} x2=${j} y1=${Mt} y2=${G} stroke=${W.axis} stroke-width="1"></line>
|
|
106
|
+
${xe.map(p=>$`<circle cx=${j} cy=${_(p.y)} r="4" fill=${Z(p.s.tone,p.i)} stroke="var(--nish-surface)" stroke-width="2"></circle>`)}
|
|
107
|
+
</g>`:E}
|
|
108
|
+
</svg>`:E,Qi=D!=null&&f>0?M`<div class="nish-chart-tooltip" style="${eo};${Yi?`left:${j+10}px`:`right:${f-j+10}px`}">
|
|
109
|
+
<div style="color:var(--nish-hi3)">${o(D)}</div>
|
|
110
|
+
${xe.map(p=>M`<div style="display:flex;align-items:center;gap:6px">
|
|
111
|
+
<span aria-hidden="true" style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${Z(p.s.tone,p.i)}"></span>
|
|
112
|
+
${s.length>1?M`<span style="color:var(--nish-hi3)">${p.s.label}</span>`:E}
|
|
114
113
|
<span style="font-weight:500">${r(p.y)}</span>
|
|
115
114
|
</div>`)}
|
|
116
|
-
</div>`:
|
|
117
|
-
<div style="position:relative;height:${
|
|
118
|
-
${
|
|
119
|
-
<
|
|
115
|
+
</div>`:E;return M`<div class="nish-chart" style="position:relative;width:100%;user-select:none">
|
|
116
|
+
<div style="position:relative;height:${n}px">
|
|
117
|
+
${Zi}${Qi}
|
|
118
|
+
<div aria-live="polite" style=${Ge}>${this.fromKey&&D!=null?`${o(D)}: ${xe.map(p=>`${s.length>1?`${p.s.label} `:""}${r(p.y)}`).join(", ")}`:""}</div>
|
|
119
|
+
<table style=${Ge}>
|
|
120
120
|
<caption>${t}</caption>
|
|
121
121
|
<thead>
|
|
122
122
|
<tr>
|
|
123
123
|
<th scope="col">x</th>
|
|
124
|
-
${s.map(p=>
|
|
124
|
+
${s.map(p=>M`<th scope="col">${p.label}</th>`)}
|
|
125
125
|
</tr>
|
|
126
126
|
</thead>
|
|
127
127
|
<tbody>
|
|
128
|
-
${d.slice(0,200).map(p=>
|
|
128
|
+
${d.slice(0,200).map(p=>M`<tr>
|
|
129
129
|
<th scope="row">${o(p)}</th>
|
|
130
|
-
${s.map((
|
|
130
|
+
${s.map((k,P)=>M`<td>${c[P].has(p)?r(c[P].get(p)):""}</td>`)}
|
|
131
131
|
</tr>`)}
|
|
132
132
|
</tbody>
|
|
133
133
|
</table>
|
|
134
134
|
</div>
|
|
135
|
-
${s.length>1?
|
|
136
|
-
${s.map((p,
|
|
137
|
-
</ul>`:
|
|
138
|
-
</div>`}};
|
|
135
|
+
${s.length>1?M`<ul class="nish-legend" aria-label=${e.legend}>
|
|
136
|
+
${s.map((p,k)=>M`<li class="nish-legend-item" style="--c: ${Z(p.tone,k)}"><i class="nish-legend-swatch" aria-hidden="true"></i>${p.label}</li>`)}
|
|
137
|
+
</ul>`:E}
|
|
138
|
+
</div>`}};w("nish-line-chart",_t);export{kt as NishBarChart,st as NishBottomNav,ct as NishChipGroup,ht as NishCombobox,vt as NishCommandPalette,dt as NishCopyButton,rt as NishDialog,x as NishElement,ut as NishField,Et as NishFilterBar,_t as NishLineChart,St as NishNavRail,xt as NishScrollRow,mt as NishSearch,wt as NishSectionNav,ft as NishSegmented,ot as NishSheet,gt as NishSparkline,Tt as NishSplit,bt as NishSwitch,Lt as NishTableSort,pt as NishTabs,at as NishThemeToggle,js as configureStrings,w as define,$n as toast};
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|