nish-ui 1.8.0 → 1.9.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.
@@ -1,2 +1,95 @@
1
- // Hand-written public types for dist/elements-data.d.ts: filled in by later tasks (no lit import).
2
- export {};
1
+ // The published types of nish-ui/elements/data (copied to dist/elements-data.d.ts by
2
+ // tsup.config.ts). Hand-written so the package never imports 'lit' (a devDependency) and every
3
+ // element stays an HTMLElement for consumers. Keep it in step with the classes in this folder.
4
+
5
+ /** Base of every nish-ui element (light DOM). */
6
+ export declare class NishElement extends HTMLElement {
7
+ readonly updateComplete: Promise<boolean>;
8
+ requestUpdate(): void;
9
+ }
10
+
11
+ /** Register a custom element unless the tag is already defined. */
12
+ export declare function define(tag: string, ctor: CustomElementConstructor): void;
13
+
14
+ export interface NishResizeDetail {
15
+ /** Each pane's share in percent, summing to 100. */
16
+ sizes: number[];
17
+ }
18
+
19
+ export interface NishCommandItem {
20
+ id: string;
21
+ label: string;
22
+ group?: string;
23
+ hint?: string;
24
+ keywords?: string[];
25
+ href?: string;
26
+ }
27
+
28
+ export interface NishCommandSelectDetail {
29
+ id: string;
30
+ }
31
+
32
+ export declare class NishTableSort extends NishElement {
33
+ /** Only fire `nish-sort` (the server sorts); the rows are not reordered. */
34
+ manual: boolean;
35
+ }
36
+
37
+ export declare class NishFilterBar extends NishElement {
38
+ activeCount: number;
39
+ sheetTitle: string;
40
+ /** `md` (default) or `lg`: the width below which the filters move into a sheet. */
41
+ sheetBelow: 'md' | 'lg';
42
+ sticky: boolean;
43
+ }
44
+
45
+ export declare class NishSplit extends NishElement {
46
+ /** `row` (default) or `column`. */
47
+ orientation: 'row' | 'column';
48
+ /** Each pane's share in percent; the attribute is a comma list: `50,50`. */
49
+ sizes: number[] | null;
50
+ /** Smallest pane length in pixels. */
51
+ min: number;
52
+ storageKey: string | null;
53
+ }
54
+
55
+ export declare class NishNavRail extends NishElement {
56
+ label: string;
57
+ }
58
+
59
+ export declare class NishScrollRow extends NishElement {
60
+ label: string;
61
+ bleed: boolean;
62
+ snap: boolean;
63
+ /** On by default; `fade="false"` turns the edge fades off. */
64
+ fade: boolean;
65
+ }
66
+
67
+ export declare class NishSectionNav extends NishElement {
68
+ label: string;
69
+ /** On by default; `sticky="false"` turns it off. */
70
+ sticky: boolean;
71
+ /** On by default; `update-hash="false"` leaves the URL alone. */
72
+ updateHash: boolean;
73
+ }
74
+
75
+ export declare class NishCommandPalette extends NishElement {
76
+ open: boolean;
77
+ hotkey: boolean;
78
+ placeholder: string;
79
+ emptyText: string;
80
+ items: NishCommandItem[];
81
+ show(): void;
82
+ close(): void;
83
+ }
84
+
85
+ declare global {
86
+ interface HTMLElementTagNameMap {
87
+ 'nish-table-sort': NishTableSort;
88
+ 'nish-filter-bar': NishFilterBar;
89
+ 'nish-split': NishSplit;
90
+ 'nish-nav-rail': NishNavRail;
91
+ 'nish-scroll-row': NishScrollRow;
92
+ 'nish-section-nav': NishSectionNav;
93
+ 'nish-command-palette': NishCommandPalette;
94
+ }
95
+ }
@@ -1 +1,47 @@
1
+ function At(s,e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return!0;let n=[s.label,s.hint??"",...s.keywords??[]].join(`
2
+ `).toLowerCase();return t.every(i=>n.includes(i))}function Ve(s,e){let t=[],n=new Map;for(let i of s){if(!At(i,e))continue;let r=i.group??null,o=n.get(r);o||(o=[],n.set(r,o),t.push(r)),o.push(i)}return t.sort((i,r)=>i===null?-1:r===null?1:0),t.flatMap(i=>n.get(i)).slice(0,50)}var Fe=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 x=function(s,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!i:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(s,t):i?i.value=t:e.set(s,t),t},E=function(s,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(s):n?n.value:e.get(s)},B,re,oe,j,Se,q,ae,$,G,k,le,je;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var Ae=(k=class{constructor(e,t={}){if(B.set(this,!1),re.set(this,!1),oe.set(this,!1),j.set(this,!1),Se.set(this,Date.now()),q.set(this,!1),ae.set(this,void 0),$.set(this,void 0),G.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:i,composed:r}=t;x(this,B,!!i,"f"),x(this,re,!!n,"f"),x(this,oe,!!r,"f"),x(this,ae,`${e}`,"f"),x(this,$,null,"f"),x(this,G,!1,"f")}initEvent(e,t,n){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,j,!0,"f")}get target(){return E(this,$,"f")}get currentTarget(){return E(this,$,"f")}get srcElement(){return E(this,$,"f")}get type(){return E(this,ae,"f")}get cancelable(){return E(this,B,"f")}get defaultPrevented(){return E(this,B,"f")&&E(this,j,"f")}get timeStamp(){return E(this,Se,"f")}composedPath(){return E(this,G,"f")?[E(this,$,"f")]:[]}get returnValue(){return!E(this,B,"f")||!E(this,j,"f")}get bubbles(){return E(this,re,"f")}get composed(){return E(this,oe,"f")}get eventPhase(){return E(this,G,"f")?k.AT_TARGET:k.NONE}get cancelBubble(){return E(this,q,"f")}set cancelBubble(e){e&&x(this,q,!0,"f")}stopPropagation(){x(this,q,!0,"f")}get isTrusted(){return!1}},B=new WeakMap,re=new WeakMap,oe=new WeakMap,j=new WeakMap,Se=new WeakMap,q=new WeakMap,ae=new WeakMap,$=new WeakMap,G=new WeakMap,k.NONE=0,k.CAPTURING_PHASE=1,k.AT_TARGET=2,k.BUBBLING_PHASE=3,k);Object.defineProperties(Ae.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var qe=(je=class extends Ae{constructor(e,t={}){super(e,t),le.set(this,void 0),x(this,le,t?.detail??null,"f")}initCustomEvent(e,t,n,i){throw new Error("Method not implemented.")}get detail(){return E(this,le,"f")}},le=new WeakMap,je);Object.defineProperties(qe.prototype,{detail:b});var L=Ae,Te=qe;var _;var pn=(_=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}},_.STYLE_RULE=1,_.CHARSET_RULE=2,_.IMPORT_RULE=3,_.MEDIA_RULE=4,_.FONT_FACE_RULE=5,_.PAGE_RULE=6,_.NAMESPACE_RULE=10,_.KEYFRAMES_RULE=7,_.KEYFRAME_RULE=8,_.SUPPORTS_RULE=12,_.COUNTER_STYLE_RULE=11,_.FONT_FEATURE_VALUES_RULE=14,_.MARGIN_RULE=9,_);globalThis.Event??=L;globalThis.CustomEvent??=Te;var Le=Symbol(),Ge=s=>typeof s=="boolean"?s:s?.capture??!1,C={__proto__:null};C.enumerable=!0;Object.freeze(C);var ce=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,n){if(t==null)return;let i=Ge(n)?this.__captureEventListeners:this.__eventListeners,r=i.get(e);if(r===void 0)r=new Map,i.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 i=Ge(n)?this.__captureEventListeners:this.__eventListeners,r=i.get(e);r!==void 0&&(r.delete(t),r.size||i.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let n=!1,i=!1,r=L.NONE,o=null,l=null,a=null,h=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...C},srcElement:{get(){return e.target},...C},currentTarget:{get(){return a},...C},eventPhase:{get(){return r},...C},composedPath:{value:()=>t,...C},stopPropagation:{value:()=>{n=!0,h.call(e)},...C},stopImmediatePropagation:{value:()=>{i=!0,d.call(e)},...C}});let c=(f,A,T)=>{typeof f=="function"?f(e):typeof f?.handleEvent=="function"&&f.handleEvent(e),A.once&&T.delete(f)},u=()=>(a=null,r=L.NONE,!e.defaultPrevented),p=t.slice().reverse();o=!this.__host||!e.composed?this:null;let m=f=>{for(l=this;l.__host&&f.includes(l.__host);)l=l.__host};for(let f of p){!o&&(!l||l===f.__host)&&m(p.slice(p.indexOf(f))),a=f,r=f===e.target?L.AT_TARGET:L.CAPTURING_PHASE;let A=f.__captureEventListeners.get(e.type);if(A){for(let[T,U]of A)if(c(T,U,A),i)return u()}if(n)return u()}let v=e.bubbles?t:[this];l=null;for(let f of v){!o&&(!l||f===l.__host)&&m(v.slice(0,v.indexOf(f)+1)),a=f,r=f===e.target?L.AT_TARGET:L.BUBBLING_PHASE;let A=f.__eventListeners.get(e.type);if(A){for(let[T,U]of A)if(c(T,U,A),i)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,Xe,Lt]}};var Ke=new WeakMap,K=s=>{let e=Ke.get(s);return e===void 0&&Ke.set(s,e=new Map),e},Y=class extends ce{getRootNode(e){return e?.composed?xe:this.__host?.__shadowRoot??xe}};var Ye=class extends Y{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Xe=new Ye,xe=Xe;var Qe=class extends Y{constructor(e){if(super(),e!==Le)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:he,customElements:Me,document:xe,Document:Ye,Element:Je,EventTarget:ce,HTMLElement:Ze,Node:Y,ShadowRoot:et,window:this,Window:Qe})}};var Je=class extends Y{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(K(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){K(this).set(e,String(t))}removeAttribute(e){K(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 K(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new et(Le,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 Fe(this);return this.__internals=e,e}getAttribute(e){return K(this).get(e)??null}};var Ze=class extends Je{},Ce=Ze;var et=class extends Y{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 Ce,"localName",{get(){return"lit-server-root"}});function Tt(){let s,e;return{promise:new Promise((n,i)=>{s=n,e=i}),resolve:s,reject:e}}var he=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.
3
+ 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=Tt(),this.__pendingWhenDefineds.set(e,n)),n.promise}},xt=he;var Me=new xt,Lt=new Qe(Le);var X=globalThis,ue=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nt=Symbol(),tt=new WeakMap,de=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==nt)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(ue&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=tt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&tt.set(t,e))}return e}toString(){return this.cssText}},it=s=>new de(typeof s=="string"?s:s+"",void 0,nt);var st=(s,e)=>{if(ue)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),i=X.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,s.appendChild(n)}},ke=ue||X.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return it(t)})(s):s;var{is:Ct,defineProperty:Mt,getOwnPropertyDescriptor:kt,getOwnPropertyNames:Rt,getOwnPropertySymbols:Nt,getPrototypeOf:$t}=Object,J=globalThis;J.customElements??=Me;var rt=J.trustedTypes,Ht=rt?rt.emptyScript:"",Pt=J.reactiveElementPolyfillSupport,Q=(s,e)=>s,Re={toAttribute(s,e){switch(e){case Boolean:s=s?Ht:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},at=(s,e)=>!Ct(s,e),ot={attribute:!0,type:String,converter:Re,reflect:!1,useDefault:!1,hasChanged:at};Symbol.metadata??=Symbol("metadata"),J.litPropertyMetadata??=new WeakMap;var M=class extends(globalThis.HTMLElement??Ce){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ot){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(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Mt(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:r}=kt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){let l=i?.call(this);r?.call(this,o),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ot}static _$Ei(){if(this.hasOwnProperty(Q("elementProperties")))return;let e=$t(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Q("properties"))){let t=this.properties,n=[...Rt(t),...Nt(t)];for(let i of n)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,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 i of n)t.unshift(ke(i))}else e!==void 0&&t.push(ke(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 st(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),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Re).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let r=n.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Re;this._$Em=i;let l=o.fromAttribute(t,r.type);this[i]=l??this._$Ej?.get(i)??l,this._$Em=null}}requestUpdate(e,t,n,i=!1,r){if(e!==void 0){let o=this.constructor;if(i===!1&&(r=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??at)(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:i,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)),i===!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[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,r]of n){let{wrapped:o}=r,l=this[i];o!==!0||this._$AL.has(i)||l===void 0||this.C(i,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){}};M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[Q("elementProperties")]=new Map,M[Q("finalized")]=new Map,Pt?.({ReactiveElement:M}),(J.reactiveElementVersions??=[]).push("2.1.2");var pe=globalThis,lt=s=>s,me=pe.trustedTypes,ct=me?me.createPolicy("lit-html",{createHTML:s=>s}):void 0,ft="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+R,Ot=`<${bt}>`,O=pe.document===void 0?{createTreeWalker:()=>({})}:document,ee=()=>O.createComment(""),te=s=>s===null||typeof s!="object"&&typeof s!="function",De=Array.isArray,It=s=>De(s)||typeof s?.[Symbol.iterator]=="function",Ne=`[
4
+ \f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,dt=/>/g,H=RegExp(`>|${Ne}(?:([^\\s"'>=/]+)(${Ne}*=${Ne}*(?:[^
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ut=/'/g,mt=/"/g,vt=/^(?:script|style|textarea|title)$/i,Ue=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),Kn=Ue(1),Yn=Ue(2),Xn=Ue(3),I=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),pt=new WeakMap,P=O.createTreeWalker(O,129);function gt(s,e){if(!De(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ct!==void 0?ct.createHTML(e):e}var Dt=(s,e)=>{let t=s.length-1,n=[],i,r=e===2?"<svg>":e===3?"<math>":"",o=Z;for(let l=0;l<t;l++){let a=s[l],h,d,c=-1,u=0;for(;u<a.length&&(o.lastIndex=u,d=o.exec(a),d!==null);)u=o.lastIndex,o===Z?d[1]==="!--"?o=ht:d[1]!==void 0?o=dt:d[2]!==void 0?(vt.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=H):d[3]!==void 0&&(o=H):o===H?d[0]===">"?(o=i??Z,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?H:d[3]==='"'?mt:ut):o===mt||o===ut?o=H:o===ht||o===dt?o=Z:(o=H,i=void 0);let p=o===H&&s[l+1].startsWith("/>")?" ":"";r+=o===Z?a+Ot:c>=0?(n.push(h),a.slice(0,c)+ft+a.slice(c)+R+p):a+R+(c===-2?l:p)}return[gt(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ne=class s{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[h,d]=Dt(e,t);if(this.el=s.createElement(h,n),P.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=P.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(ft)){let u=d[o++],p=i.getAttribute(c).split(R),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:m[2],strings:p,ctor:m[1]==="."?He:m[1]==="?"?Pe:m[1]==="@"?Oe:W}),i.removeAttribute(c)}else c.startsWith(R)&&(a.push({type:6,index:r}),i.removeAttribute(c));if(vt.test(i.tagName)){let c=i.textContent.split(R),u=c.length-1;if(u>0){i.textContent=me?me.emptyScript:"";for(let p=0;p<u;p++)i.append(c[p],ee()),P.nextNode(),a.push({type:2,index:++r});i.append(c[u],ee())}}}else if(i.nodeType===8)if(i.data===bt)a.push({type:2,index:r});else{let c=-1;for(;(c=i.data.indexOf(R,c+1))!==-1;)a.push({type:7,index:r}),c+=R.length-1}r++}}static createElement(e,t){let n=O.createElement("template");return n.innerHTML=e,n}};function z(s,e,t=s,n){if(e===I)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl,r=te(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(s),i._$AT(s,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=z(s,i._$AS(s,e.values),i,n)),e}var $e=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,i=(e?.creationScope??O).importNode(t,!0);P.currentNode=i;let r=P.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new ie(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Ie(r,this,e)),this._$AV.push(h),a=n[++l]}o!==a?.index&&(r=P.nextNode(),o++)}return P.currentNode=O,i}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++}},ie=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.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=z(this,e,t),te(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):It(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!==g&&te(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ne.createElement(gt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{let r=new $e(i,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=pt.get(e.strings);return t===void 0&&pt.set(e.strings,t=new ne(e)),t}k(e){De(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let r of e)i===t.length?t.push(n=new s(this.O(ee()),this.O(ee()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=lt(e).nextSibling;lt(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},W=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=g}_$AI(e,t=this,n,i){let r=this.strings,o=!1;if(r===void 0)e=z(this,e,t,0),o=!te(e)||e!==this._$AH&&e!==I,o&&(this._$AH=e);else{let l=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=z(this,l[n+a],t,a),h===I&&(h=this._$AH[a]),o||=!te(h)||h!==this._$AH[a],h===g?e=g:e!==g&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},He=class extends W{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},Pe=class extends W{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},Oe=class extends W{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??g)===I)return;let n=this._$AH,i=e===g&&n!==g||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==g&&(n===g||i);i&&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)}},Ie=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){z(this,e)}};var Ut=pe.litHtmlPolyfillSupport;Ut?.(ne,ie),(pe.litHtmlVersions??=[]).push("3.3.3");var Et=(s,e,t)=>{let n=t?.renderBefore??e,i=n._$litPart$;if(i===void 0){let r=t?.renderBefore??null;n._$litPart$=i=new ie(e.insertBefore(ee(),r),r,void 0,t??{})}return i._$AI(s),i};var Be=globalThis,N=class extends M{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=Et(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};N._$litElement$=!0,N.finalized=!0,Be.litElementHydrateSupport?.({LitElement:N});var Bt=Be.litElementPolyfillSupport;Bt?.({LitElement:N});(Be.litElementVersions??=[]).push("4.2.2");var y=class extends N{createRenderRoot(){return this}};function S(s){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s,{once:!0}):s()}function w(s,e){customElements.get(s)||customElements.define(s,e)}var Wt=0,se="http://www.w3.org/2000/svg",Vt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Ft(){let s=document.createElementNS(se,"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"}))s.setAttribute(t,n);let e=document.createElementNS(se,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),s.append(e),s}function jt(){let s=document.createElementNS(se,"svg");for(let[n,i]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"}))s.setAttribute(n,i);let e=document.createElementNS(se,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(se,"path");return t.setAttribute("d","m21 21-4.3-4.3"),s.append(e,t),s}function qt(s){if(!(s instanceof HTMLElement))return!1;let e=s.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||s.isContentEditable}var fe=class extends y{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=++Wt;#t=null;#n=null;#r=null;#o=null;#a="";#i=0;#s=[];#l=new Map;#c=null;#d;#v=!1;#h=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="Search\u2026",this.emptyText="No results",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#u(),this.#t){this.#E();return}this.#v||(this.#v=!0,S(()=>{this.#v=!1,this.isConnected&&this.#p()}))}disconnectedCallback(){super.disconnectedCallback(),this.#m(!1),window.clearTimeout(this.#d),this.#t?.open&&(this.open=!1,this.#t.close())}show(){this.open=!0}close(){this.open=!1}#m(e){e!==this.#h&&(this.#h=e,e?document.addEventListener("keydown",this.#g):document.removeEventListener("keydown",this.#g))}#u(){this.#m(this.hotkey&&this.isConnected)}#g=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||qt(e.target)||(e.preventDefault(),this.open=!0)};#p(){if(this.#t)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let h=new Set,d=[];for(let c of e){let u=c.dataset.id||c.getAttribute("href")||`item-${d.length+1}`;for(;h.has(u);)u=`${u}-${d.length+1}`;h.add(u);let p=(c.dataset.keywords??"").split(/[,\s]+/).map(m=>m.trim()).filter(Boolean);d.push({id:u,label:c.textContent?.trim()??u,group:c.dataset.group||void 0,hint:c.dataset.hint||void 0,keywords:p.length?p:void 0,href:c.getAttribute("href")??void 0}),this.#l.set(u,c)}this.items=d}for(let h of e)h.hidden=!0;let t=document.createElement("dialog");t.className="nish-command",t.setAttribute("aria-label","Search");let n=`nish-command-list-${this.#e}`,i=document.createElement("input");i.type="text",i.setAttribute("role","combobox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-controls",n),i.setAttribute("aria-autocomplete","list"),i.autocomplete="off",i.setAttribute("autocapitalize","off"),i.setAttribute("autocorrect","off"),i.spellcheck=!1,i.addEventListener("input",()=>this.#S(i.value)),i.addEventListener("keydown",h=>this.#A(h)),i.addEventListener("change",h=>h.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.setAttribute("aria-label","Close"),o.append(Ft()),o.addEventListener("click",()=>{this.open=!1}),r.append(jt(),i,o);let l=document.createElement("div");l.className="nish-command-list",l.id=n,l.setAttribute("role","listbox"),l.setAttribute("aria-label","Results"),l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("mousemove",h=>{let d=h.target?.closest("[data-index]");if(!d)return;let c=Number(d.dataset.index);c!==this.#i&&this.#b(c,!1)}),l.addEventListener("click",h=>{let d=h.target?.closest("[data-index]"),c=d?this.#s[Number(d.dataset.index)]:void 0;c&&this.#y(c)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=Vt,t.append(r,l,a),t.addEventListener("click",this.#T),t.addEventListener("cancel",this.#x),t.addEventListener("close",this.#L),t.addEventListener("keydown",h=>{h.key==="Escape"&&h.stopPropagation()}),this.append(t),this.#t=t,this.#n=i,this.#r=l,this.#o=a,this.#f(),this.#E()}updated(e){e.has("hotkey")&&this.#u(),(e.has("placeholder")||e.has("emptyText"))&&this.#f(),e.has("items")&&this.#t?.open&&this.#w(),e.has("open")&&this.#E()}#f(){let e=this.#n;e&&(e.placeholder=this.placeholder,e.setAttribute("aria-label",this.placeholder.replace(/…$/,"")||"Search"))}#E(){let e=this.#t;!e||!this.isConnected||(this.open&&!e.open?(this.#c=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#a="",this.#i=0,this.#n&&(this.#n.value=""),e.showModal(),this.#w(),this.#n?.focus()):!this.open&&e.open&&e.close())}#_(e){return`nish-command-${this.#e}-opt-${e}`}#w(){let e=this.#r,t=this.#n;if(!e||!t)return;this.#s=Ve(this.items,this.#a),this.#i>=this.#s.length&&(this.#i=0),e.textContent="";let n=0,i,r=e;for(let o of this.#s){let l=o.group??null;if(l!==i)if(i=l,l===null)r=e;else{let d=document.createElement("div");d.className="nish-command-group",d.setAttribute("role","group");let c=document.createElement("div");c.id=`nish-command-${this.#e}-group-${n}`,c.textContent=l,d.setAttribute("aria-labelledby",c.id),d.append(c),e.append(d),r=d}let a=document.createElement("div");a.className="nish-command-item",a.id=this.#_(n),a.dataset.index=String(n),a.setAttribute("role","option"),a.setAttribute("aria-selected",n===this.#i?"true":"false");let h=document.createElement("span");if(h.textContent=o.label,a.append(h),o.hint){let d=document.createElement("span");d.className="nish-command-item-hint",d.textContent=o.hint,a.append(d)}r.append(a),n++}if(this.#s.length===0){let o=document.createElement("div");o.className="nish-command-empty",o.textContent=this.emptyText,e.append(o)}this.#s.length?t.setAttribute("aria-activedescendant",this.#_(this.#i)):t.removeAttribute("aria-activedescendant"),this.#o&&(this.#o.textContent=this.#s.length?`${this.#s.length} result${this.#s.length===1?"":"s"}`:this.emptyText)}#b(e,t=!0){let n=this.#s.length;if(n===0)return;this.#i=(e%n+n)%n;let i=this.#r;if(i){for(let r of Array.from(i.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#i;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#n?.setAttribute("aria-activedescendant",this.#_(this.#i))}}#S(e){this.#a=e,this.#i=0,this.#w(),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.#s.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#b(this.#i+1);break;case"ArrowUp":e.preventDefault(),this.#b(this.#i-1);break;case"Home":t&&!this.#a&&(e.preventDefault(),this.#b(0));break;case"End":t&&!this.#a&&(e.preventDefault(),this.#b(t-1));break;case"Enter":{e.preventDefault();let n=this.#s[this.#i];n&&this.#y(n);break}}}#y(e){let t=this.#l.get(e.id);this.open=!1,this.#t?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t?t.click():e.href&&window.location.assign(e.href)}#T=e=>{let t=this.#t;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)};#x=e=>{e.preventDefault(),this.open=!1};#L=()=>{window.clearTimeout(this.#d),this.open&&(this.open=!1);let e=this.#c;this.#c=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};w("nish-command-palette",fe);var Gt=["emerald","indigo","amber","lime","rose","sky","violet","teal"],pi=["accent","ok","loss","warn","info",...Gt],V={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Kt={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Yt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],Xt=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],D=s=>Object.fromEntries(s.map((e,t)=>[`chart-${t+1}`,e])),F={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d",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",...D(Yt),...V}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd",hi:"#17171c",hi2:"#4f515c",hi3:"#666874",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",...D(Xt),...Kt}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b",hi:"#f4f4f5",hi2:"#a1a1aa",hi3:"#8f8f99",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",...D(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...V,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",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",...D(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...V}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e",hi:"#f5f0eb",hi2:"#b3ada8",hi3:"#a39d98",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",...D(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...V,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",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",...D(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...V}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#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",...D(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...V}}};for(let s of Object.values(F)){for(let e of["ok","loss","warn","info"])s.colors[`${e}-fill`]??=s.colors[e],s.colors[`on-${e}`]??=s.colors["on-accent"];s.colors["on-accent2"]??=s.colors["on-accent"]}var gi=Object.keys(F).map(s=>({id:s,label:F[s].label,scheme:F[s].scheme,colors:F[s].colors}));var Ei=3600*24*365;function Qt(s,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=s.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let i;return typeof ResizeObserver<"u"?(i=new ResizeObserver(n),i.observe(s)):window.addEventListener("resize",n),()=>{i?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}function yt(s,e={}){if(typeof document>"u")return()=>{};let t=Array.from(s.querySelectorAll('a[href^="#"]')).filter(m=>m.hash.length>1),n=m=>{try{return document.getElementById(decodeURIComponent(m.hash.slice(1)))}catch{return null}},i=e.height===!1?()=>{}:Qt(s,"--nish-sticky-extra"),r=null,o=()=>{let m=s.scrollWidth-s.clientWidth;s.dataset.atStart=String(s.scrollLeft<=1),s.dataset.atEnd=String(m<=1||s.scrollLeft>=m-1)},l=m=>{let v=m.offsetLeft-s.offsetLeft,f=s.clientWidth;v<s.scrollLeft+24?s.scrollLeft=Math.max(0,v-24):v+m.offsetWidth>s.scrollLeft+f-24&&(s.scrollLeft=v+m.offsetWidth-f+24)},a=m=>{m!==r&&(r?.removeAttribute("aria-current"),r=m,m&&(m.setAttribute("aria-current","true"),l(m)))},h=()=>{let m=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,v=e.offset??m+s.offsetHeight+8,f=t[0]??null;for(let T of t){let U=n(T);U&&U.getBoundingClientRect().top<=v+1&&(f=T)}let A=document.documentElement;if(window.innerHeight+window.scrollY>=A.scrollHeight-2)for(let T of t)n(T)&&(f=T);a(f)},d=0,c=()=>{d||(d=requestAnimationFrame(()=>{d=0,h()}))},u=m=>{let v=m.target instanceof Element?m.target.closest('a[href^="#"]'):null;v&&t.includes(v)&&a(v)};o(),h(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),s.addEventListener("scroll",o,{passive:!0}),s.addEventListener("click",u);let p;return typeof ResizeObserver<"u"&&(p=new ResizeObserver(()=>{o(),c()}),p.observe(s)),()=>{d&&cancelAnimationFrame(d),window.removeEventListener("scroll",c),window.removeEventListener("resize",c),s.removeEventListener("scroll",o),s.removeEventListener("click",u),p?.disconnect(),i(),r?.removeAttribute("aria-current"),delete s.dataset.atStart,delete s.dataset.atEnd}}var Jt='<svg width="16" height="16" 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="M22 3H2l8 9.46V19l4 2v-8.54L22 3z"></path></svg>',Zt='<svg width="16" height="16" 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>',en={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},tn=0;function be(s){let e=document.createElement("div");return e.className=s,e}var ve=class extends y{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;#t=be("nish-filter-bar-search");#n=be("nish-filter-bar-chips");#r=be("nish-filter-bar-trailing");#o=be("nish-filter-bar-summary");#a=null;#i=null;#s=null;#l=null;#c=null;#d=null;#v=null;#h=[];#m=null;#u=null;#g="";#p=null;#f=()=>this.#y();constructor(){super(),this.activeCount=0,this.sheetTitle="Filters",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),S(()=>this.#E())}disconnectedCallback(){if(super.disconnectedCallback(),this.#u?.removeEventListener("change",this.#f),this.#u=null,this.#g="",this.#p?.disconnect(),this.#p=null,this.#e){this.#l?.close();for(let e of this.#h)this.appendChild(e);for(let e of[this.#t,this.#r,this.#o])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#l?.remove(),this.#e=null,this.#a=null,this.#s=null,this.#l=null,this.#c=null,this.#h=[],this.#m=null}}updated(e){this.#e&&(this.#A(),this.#y())}#E(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#o.setAttribute("aria-live","polite"),e.append(this.#t,this.#n,this.#r,this.#o),this.#e=e;for(let t of Array.from(this.childNodes))this.#w(t);this.appendChild(e),this.#b(),this.#A(),this.#y(),this.#p=new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(i=>{i!==e&&i.parentNode===this&&this.#w(i)});this.#y()}),this.#p.observe(this,{childList:!0}),this.#p.observe(this.#n,{childList:!0}),this.#c&&this.#p.observe(this.#c,{childList:!0})}#_(){this.#h=this.#h.filter(e=>e.parentNode===this.#n||e.parentNode===this.#c)}#w(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.#r.appendChild(e):t==="summary"?this.#o.appendChild(e):e.localName==="nish-search"&&!this.#t.firstChild?this.#t.appendChild(e):(this.#_(),this.#h.includes(e)||this.#h.push(e),(this.#m==="compact"?this.#c??this.#n:this.#n).appendChild(e))}#b(){let e=++tn,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),t.innerHTML=Jt,t.append(document.createTextNode("Filters"));let n=document.createElement("span");n.className="nish-badge nish-badge--accent",t.appendChild(n),t.addEventListener("click",()=>this.#l?.show()),this.#a=t,this.#i=n;let i=document.createElement("button");i.type="button",i.className="nish-btn nish-btn--ghost nish-filter-bar-clear",i.textContent="Clear filters",i.addEventListener("click",()=>this.#S()),this.#s=i;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",""),a.setAttribute("aria-label","Close"),a.innerHTML=Zt,o.appendChild(a);let h=document.createElement("div");h.className="nish-sheet-body nish-filter-sheet-body";let d=document.createElement("footer");d.className="nish-sheet-footer";let c=document.createElement("button");c.type="button",c.className="nish-btn nish-btn--ghost",c.textContent="Clear",c.addEventListener("click",()=>this.#S());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",u.textContent="Show results",u.addEventListener("click",()=>this.#l?.close()),d.append(c,u),r.append(o,h,d),this.#l=r,this.#c=h,this.#d=c,this.#v=l}#S(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#A(){let e=en[this.sheetBelow==="lg"?"lg":"md"];e!==this.#g&&(this.#u?.removeEventListener("change",this.#f),this.#g=e,this.#u=typeof matchMedia>"u"?null:matchMedia(e),this.#u?.addEventListener("change",this.#f))}#y(){let e=this.#e,t=this.#l,n=this.#c,i=this.#a,r=this.#s;if(!e||!t||!n||!i||!r)return;this.#_();let o=this.#u?.matches?"compact":"wide";o!==this.#m&&(o==="compact"?(this.#n.remove(),r.remove(),this.#t.after(i),n.append(...this.#h),e.appendChild(t)):(t.close(),i.remove(),this.#n.append(...this.#h,r),this.#t.after(this.#n),t.remove()),this.#m=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),i.hidden=this.#h.length===0,r.hidden=l===0,this.#i&&(this.#i.textContent=String(l),this.#i.hidden=l===0,this.#i.setAttribute("aria-label",`${l} active`)),this.#d&&(this.#d.disabled=l===0),this.#v&&(this.#v.textContent=this.sheetTitle||"Filters")}};w("nish-filter-bar",ve);function _t(s,e){let t=null,n=()=>Array.from(s.querySelectorAll(":scope > a")),i=()=>{let o=location.pathname,l=null,a=-1;for(let h of n()){if(e?.(h),!h.getAttribute("href"))continue;let d;try{d=new URL(h.getAttribute("href"),location.href)}catch{continue}if(d.origin!==location.origin)continue;if(d.hash&&d.pathname===location.pathname){d.hash===location.hash&&(l=h,a=1/0);continue}let c=d.pathname;(c==="/"?o==="/":o===c||o.startsWith(c.endsWith("/")?c:`${c}/`))&&c.length>a&&(l=h,a=c.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let h of n())h.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),i(),r.observe(s,{childList:!0})});return i(),window.addEventListener("popstate",i),window.addEventListener("hashchange",i),r.observe(s,{childList:!0}),()=>{window.removeEventListener("popstate",i),window.removeEventListener("hashchange",i),r.disconnect()}}var ge=class extends y{static properties={label:{type:String,reflect:!0}};#e=null;#t=null;constructor(){super(),this.label="Sections"}connectedCallback(){super.connectedCallback(),S(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#t?.(),this.#t=null}updated(e){this.#r()}#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;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"),t&&e.appendChild(t),n&&e.appendChild(n);for(let i of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))i.classList.add("nish-nav-rail-item");this.#r(),this.#t=_t(e,i=>i.classList.add("nish-nav-rail-item"))}#r(){this.#e&&this.#e.setAttribute("aria-label",this.label||"Sections")}};w("nish-nav-rail",ge);var nn='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',Ee=class extends y{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;#t=null;#n=null;#r=()=>this.#i();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),S(()=>this.#o())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#r),this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e=null}updated(e){this.#s()}#o(){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.#n?.disconnect(),this.#n=new MutationObserver(()=>{let n=this.#e;if(n)for(let i of Array.from(this.childNodes))i!==n&&i.nodeType===1&&n.appendChild(i)}),this.#n.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#r,{passive:!0}),typeof ResizeObserver<"u"&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(e));let t=e.querySelector(nn);t&&this.#a(e,t),this.#i()}#a(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=8;i.left<n.left+r?e.scrollLeft+=i.left-n.left-r:i.right>n.right-r&&(e.scrollLeft+=i.right-n.right+r)}#i(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth;e.dataset.atStart=String(e.scrollLeft<=1),e.dataset.atEnd=String(t<=1||e.scrollLeft>=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",Ee);var wt={fromAttribute:s=>s!=="false",toAttribute:s=>s?null:"false"},ye=class extends y{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:wt},updateHash:{attribute:"update-hash",reflect:!0,converter:wt}};#e=null;#t=null;#n=null;#r=e=>this.#l(e);constructor(){super(),this.label="Sections",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),S(()=>this.#o())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=null,this.#i=null,this.#n?.disconnect(),this.#n=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#a()}#o(){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.#a(),e.addEventListener("click",this.#r),this.#s(e),this.#n=new MutationObserver(()=>{this.#t?.(),this.#s(e)}),this.#n.observe(e,{childList:!0})}#a(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||"Sections"),e.style.position=this.sticky?"":"static",this.#i!==null&&this.#i!==this.sticky&&this.#s(e))}#i=null;#s(e){this.#t?.(),this.#t=yt(e,{height:this.sticky}),this.#i=this.sticky}#l(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 i=document.getElementById(n);if(!i)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(i.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:n}}))}};w("nish-section-nav",ye);var St=5,sn="(max-width: 639.98px) and (pointer: coarse)";function ze(s,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!s||s.length!==e||!s.every(i=>Number.isFinite(i)&&i>0))return t();let n=s.reduce((i,r)=>i+r,0);return s.map(i=>i/n*100)}var rn={fromAttribute(s){if(s==null||s.trim()==="")return null;let e=s.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(s){return s&&s.length?s.map(e=>Math.round(e*100)/100).join(","):null}},_e=class extends y{static properties={orientation:{type:String,reflect:!0},sizes:{converter:rn,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#t=[];#n=null;#r=null;#o=!1;#a=null;#i=!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.#r=window.matchMedia(sn),this.#o=this.#r.matches,this.#r.addEventListener("change",this.#u)),this.#s){this.#c(),this.#d();return}this.#i||(this.#i=!0,S(()=>{this.#i=!1,this.isConnected&&(this.#s=!0,this.#c(),this.#d())}))}disconnectedCallback(){super.disconnectedCallback(),this.#r?.removeEventListener("change",this.#u),this.#r=null,this.#n?.disconnect(),this.#n=null,this.#S()}updated(e){this.#s&&(e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#m()}#c(){typeof MutationObserver>"u"||(this.#n??=new MutationObserver(()=>this.#d()),this.#n.observe(this,{childList:!0}))}#d(){if(!this.isConnected)return;this.#n?.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.#t=[];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",i=>this.#_(i,t)),n.addEventListener("pointermove",i=>this.#w(i)),n.addEventListener("pointerup",i=>this.#b(i)),n.addEventListener("pointercancel",i=>this.#b(i)),n.addEventListener("keydown",i=>this.#y(i,t)),n.addEventListener("dblclick",()=>this.#A()),this.insertBefore(n,e[t+1]),this.#t.push(n)}this.#v(),this.#m(),this.#n?.observe(this,{childList:!0})}#v(){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=ze(t,this.#e.length))}catch{}}}get#h(){return ze(this.sizes,this.#e.length)}#m(){let e=this.orientation!=="column",t=this.#h;this.style.display="flex",this.style.flexDirection=this.#o?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((n,i)=>{n.style.minWidth="0",this.#o?(n.style.minHeight="var(--nish-split-stack-h, 16rem)",n.style.flex="none"):(n.style.minHeight="0",n.style.flex=`${t[i]} 1 0%`);let r=n.children.length===1?n.firstElementChild:null;r?.localName==="nish-split"&&(n.style.display="flex",r.style.flex="1 1 auto")}),this.#t.forEach((n,i)=>{n.hidden=this.#o,n.classList.toggle("nish-split-divider--v",e),n.classList.toggle("nish-split-divider--h",!e),n.setAttribute("aria-orientation",e?"vertical":"horizontal"),n.setAttribute("aria-label",e?"Resize columns":"Resize rows"),n.setAttribute("aria-valuenow",String(Math.round(t[i]))),n.setAttribute("aria-valuemin","0"),n.setAttribute("aria-valuemax","100")})}#u=e=>{this.#o=e.matches,this.#m()};#g(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#p(e,t,n,i){let r=e[t]+e[t+1],o=Math.min(i,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}#f(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}}))}#_(e,t){if(e.button!==0||this.#o)return;let n=this.#t[t];if(!n)return;e.preventDefault(),n.setPointerCapture?.(e.pointerId);let i=[];for(let o of Array.from(this.querySelectorAll("iframe")))i.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.#h,total:r,restore:i},this.setAttribute("data-dragging","")}#w(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let i=((this.orientation==="column"?e.clientY:e.clientX)-t.start)/t.total*100;i!==0&&this.#E(this.#p(t.sizes,t.index,i,this.min/t.total*100))}#b(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;let n=this.#t[t.index];n?.hasPointerCapture?.(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.#S()}#S(){let e=this.#a;if(e){this.#a=null,this.sizes&&this.#f(this.sizes);for(let[t,n]of e.restore)t.style.pointerEvents=n;this.removeAttribute("data-dragging")}}#A(){if(this.#o||this.#e.length<2)return;let e=ze(null,this.#e.length);this.#E(e),this.#f(e)}#y(e,t){if(e.key==="Enter"){e.preventDefault(),this.#A();return}let n=this.orientation!=="column",i=n?"ArrowLeft":"ArrowUp",r=n?"ArrowRight":"ArrowDown";if(e.key!==i&&e.key!==r)return;e.preventDefault();let o=this.#e.reduce((d,c)=>d+this.#g(c),0),l=o>0?this.min/o*100:0,a=this.#h,h=this.#p(a,t,e.key===r?St:-St,l);h[t]!==a[t]&&(this.#E(h),this.#f(h))}};w("nish-split",_e);var We="http://www.w3.org/2000/svg";function on(){let s=document.createElementNS(We,"svg");s.setAttribute("width","10"),s.setAttribute("height","10"),s.setAttribute("viewBox","0 0 10 10"),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(We,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),s.appendChild(t)}return s}function an(s){let e=s.replace(/[\s,$€£%]/g,"");if(e===""||e==="-"||e==="+")return null;let t=Number(e);return Number.isFinite(t)?t:null}var we=class extends y{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#t=e=>this.#l(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#t),S(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#t),this.#e?.disconnect(),this.#e=null}#n(){!this.isConnected||this.#e||(this.#a(),this.#e=new MutationObserver(()=>{this.#e?.disconnect(),this.#a(),this.#r()}),this.#r())}#r(){for(let e of Array.from(this.querySelectorAll("thead")))this.#e?.observe(e,{childList:!0,subtree:!0})}#o(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#a(){for(let e of this.#o()){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(on()),e.appendChild(t),this.#i(e)}}#i(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"),i="";return(n??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==We)&&(i+=r.textContent??"")}),i.trim()}#l(e){let n=e.target?.closest(".nish-th-sort"),i=n?.closest("th[data-sort]");if(!n||!i||!this.contains(i))return;let r=i.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#o())o.setAttribute("aria-sort",o===i?r:"none"),this.#i(o);this.manual||this.#c(i,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(i),direction:r==="ascending"?"asc":"desc"}}))}#c(e,t){let n=e.cellIndex,i=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base"});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((p,m)=>{let v=p.cells[n],f=v?(v.getAttribute("data-value")??v.textContent??"").trim():"";return{row:p,key:f,num:an(f),order:m}}),h=a.filter(p=>p.key!==""),d=a.filter(p=>p.key===""),c=e.classList.contains("nish-th--num")||h.length>0&&h.every(p=>p.num!==null);h.sort((p,m)=>(c?(p.num??0)-(m.num??0):o.compare(p.key,m.key))*i||p.order-m.order);let u=document.createDocumentFragment();for(let p of[...h,...d])u.appendChild(p.row);l.appendChild(u)}}};w("nish-table-sort",we);export{fe as NishCommandPalette,y as NishElement,ve as NishFilterBar,ge as NishNavRail,Ee as NishScrollRow,ye as NishSectionNav,_e as NishSplit,we as NishTableSort,w as define};
6
+ /*! Bundled license information:
7
+
8
+ @lit-labs/ssr-dom-shim/lib/element-internals.js:
9
+ @lit-labs/ssr-dom-shim/lib/events.js:
10
+ (**
11
+ * @license
12
+ * Copyright 2023 Google LLC
13
+ * SPDX-License-Identifier: BSD-3-Clause
14
+ *)
15
+
16
+ @lit-labs/ssr-dom-shim/lib/css.js:
17
+ @lit-labs/ssr-dom-shim/lib/observers.js:
18
+ (**
19
+ * @license
20
+ * Copyright 2024 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ *)
23
+
24
+ @lit-labs/ssr-dom-shim/index.js:
25
+ @lit/reactive-element/node/css-tag.js:
26
+ (**
27
+ * @license
28
+ * Copyright 2019 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *)
31
+
32
+ lit-html/node/lit-html.js:
33
+ lit-element/lit-element.js:
34
+ (**
35
+ * @license
36
+ * Copyright 2017 Google LLC
37
+ * SPDX-License-Identifier: BSD-3-Clause
38
+ *)
39
+
40
+ lit-html/node/is-server.js:
41
+ (**
42
+ * @license
43
+ * Copyright 2022 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ *)
46
+ */
1
47
  //# sourceMappingURL=elements-data.js.map