nish-ui 3.1.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 +13 -6
- package/dist/base-tailwind.css +30 -15
- package/dist/base.css +30 -15
- package/dist/chart.js +2 -2
- package/dist/elements-all.js +78 -78
- package/dist/elements-charts.d.ts +1 -1
- package/dist/elements-charts.js +43 -42
- package/dist/elements-data.d.ts +10 -0
- package/dist/elements-data.js +4 -5
- package/dist/elements-forms.js +9 -9
- package/dist/elements.d.ts +1 -0
- package/dist/elements.js +4 -4
- package/dist/esm/chart-values.js +2 -1
- package/dist/esm/combobox-filter.js +6 -5
- package/dist/esm/command-filter.js +83 -0
- package/dist/esm/components/accordion.js +5 -3
- package/dist/esm/components/app-shell.js +9 -5
- package/dist/esm/components/breadcrumbs.js +8 -4
- package/dist/esm/components/calendar-base.js +33 -6
- 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 +20 -9
- package/dist/esm/components/command.js +25 -63
- package/dist/esm/components/context-menu.js +2 -1
- package/dist/esm/components/data-classes.js +23 -8
- package/dist/esm/components/data.js +19 -10
- package/dist/esm/components/display.js +24 -15
- package/dist/esm/components/drawer.js +17 -4
- package/dist/esm/components/error-boundary.js +3 -3
- package/dist/esm/components/feedback.js +4 -4
- package/dist/esm/components/file-dropzone.js +39 -7
- package/dist/esm/components/filters.js +42 -1
- package/dist/esm/components/flow.js +12 -9
- package/dist/esm/components/forms-classes.js +3 -1
- package/dist/esm/components/forms.js +8 -6
- package/dist/esm/components/hooks.js +47 -13
- package/dist/esm/components/hover-card.js +2 -1
- package/dist/esm/components/inbox.js +9 -2
- package/dist/esm/components/latest.js +4 -2
- package/dist/esm/components/layout.js +7 -4
- package/dist/esm/components/menu.js +14 -1
- package/dist/esm/components/modal.js +17 -4
- package/dist/esm/components/multi-select.js +7 -7
- package/dist/esm/components/nav-classes.js +9 -0
- package/dist/esm/components/nav.js +32 -12
- 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-classes.js +4 -4
- package/dist/esm/components/primitives.js +18 -5
- package/dist/esm/components/progress.js +2 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/resource-classes.js +7 -3
- package/dist/esm/components/resource.js +17 -6
- 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 +21 -1
- 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/tabs.js +3 -2
- 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-store.js +16 -4
- package/dist/esm/components/toast.js +4 -1
- package/dist/esm/components/tooltip.js +3 -2
- package/dist/esm/components/url-state.js +5 -2
- package/dist/esm/components/virtual-table.js +2 -2
- package/dist/esm/components/virtual.js +8 -4
- package/dist/esm/format.js +27 -4
- package/dist/esm/runtime.js +9 -2
- package/dist/esm/server/inbox/client.js +4 -0
- package/dist/esm/split-layout.js +2 -1
- 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 +36 -7
- package/dist/inbox-client.d.ts +6 -2
- package/dist/inbox-client.js +4 -1
- package/dist/index.d.ts +65 -30
- package/dist/nish-components.css +70 -23
- 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 +10 -3
- package/dist/server/hono.js +108 -11
- package/dist/server/index.d.ts +21 -13
- package/dist/server/index.js +124 -29
- package/dist/service-tokens.d.ts +4 -4
- package/dist/{spa-7myD4xvA.d.ts → spa-FwS7yZ8p.d.ts} +36 -7
- package/dist/split-layout.js +2 -2
- package/dist/system-canvas.d.ts +11 -10
- package/dist/theme.d.ts +30 -2
- package/dist/theme.global.js +53 -21
- package/dist/theme.js +53 -20
- package/package.json +3 -2
- package/dist/tokens.js +0 -425
package/dist/elements-forms.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Ke=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 T=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},_=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)},V,oe,ae,G
|
|
1
|
+
var Ke=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 T=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},_=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)},V,oe,ae,G,Ce,q,le,I,K,k,he,Ye;var g={__proto__:null};g.enumerable=!0;Object.freeze(g);var $e=(k=class{constructor(e,t={}){if(V.set(this,!1),oe.set(this,!1),ae.set(this,!1),G.set(this,!1),Ce.set(this,Date.now()),q.set(this,!1),le.set(this,void 0),I.set(this,void 0),K.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;T(this,V,!!s,"f"),T(this,oe,!!i,"f"),T(this,ae,!!r,"f"),T(this,le,`${e}`,"f"),T(this,I,null,"f"),T(this,K,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){T(this,G,!0,"f")}get target(){return _(this,I,"f")}get currentTarget(){return _(this,I,"f")}get srcElement(){return _(this,I,"f")}get type(){return _(this,le,"f")}get cancelable(){return _(this,V,"f")}get defaultPrevented(){return _(this,V,"f")&&_(this,G,"f")}get timeStamp(){return _(this,Ce,"f")}composedPath(){return _(this,K,"f")?[_(this,I,"f")]:[]}get returnValue(){return!_(this,V,"f")||!_(this,G,"f")}get bubbles(){return _(this,oe,"f")}get composed(){return _(this,ae,"f")}get eventPhase(){return _(this,K,"f")?k.AT_TARGET:k.NONE}get cancelBubble(){return _(this,q,"f")}set cancelBubble(e){e&&T(this,q,!0,"f")}stopPropagation(){T(this,q,!0,"f")}get isTrusted(){return!1}},V=new WeakMap,oe=new WeakMap,ae=new WeakMap,G=new WeakMap,Ce=new WeakMap,q=new WeakMap,le=new WeakMap,I=new WeakMap,K=new WeakMap,k.NONE=0,k.CAPTURING_PHASE=1,k.AT_TARGET=2,k.BUBBLING_PHASE=3,k);Object.defineProperties($e.prototype,{initEvent:g,stopImmediatePropagation:g,preventDefault:g,target:g,currentTarget:g,srcElement:g,type:g,cancelable:g,defaultPrevented:g,timeStamp:g,composedPath:g,returnValue:g,bubbles:g,composed:g,eventPhase:g,cancelBubble:g,stopPropagation:g,isTrusted:g});var Xe=(Ye=class extends $e{constructor(e,t={}){super(e,t),he.set(this,void 0),T(this,he,t?.detail??null,"f")}initCustomEvent(e,t,i,s){throw new Error("Method not implemented.")}get detail(){return _(this,he,"f")}},he=new WeakMap,Ye);Object.defineProperties(Xe.prototype,{detail:g});var M=$e,Te=Xe;var w;var Ti=(w=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}},w.STYLE_RULE=1,w.CHARSET_RULE=2,w.IMPORT_RULE=3,w.MEDIA_RULE=4,w.FONT_FACE_RULE=5,w.PAGE_RULE=6,w.NAMESPACE_RULE=10,w.KEYFRAMES_RULE=7,w.KEYFRAME_RULE=8,w.SUPPORTS_RULE=12,w.COUNTER_STYLE_RULE=11,w.FONT_FEATURE_VALUES_RULE=14,w.MARGIN_RULE=9,w);globalThis.Event??=M;globalThis.CustomEvent??=Te;var Me=Symbol(),Ze=n=>typeof n=="boolean"?n:n?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var ce=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,i){if(t==null)return;let s=Ze(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 a=typeof i=="object"&&i?i:{};a.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,i)),r.set(t,a??{})}removeEventListener(e,t,i){if(t==null)return;let s=Ze(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=M.NONE,a=null,l=null,o=null,u=e.stopPropagation,h=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return a??l},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return o},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>t,...R},stopPropagation:{value:()=>{i=!0,u.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,h.call(e)},...R}});let c=(b,x,H)=>{typeof b=="function"?b(e):typeof b?.handleEvent=="function"&&b.handleEvent(e),x.once&&H.delete(b)},d=()=>(o=null,r=M.NONE,!e.defaultPrevented),v=t.slice().reverse();a=!this.__host||!e.composed?this:null;let f=b=>{for(l=this;l.__host&&b.includes(l.__host);)l=l.__host};for(let b of v){!a&&(!l||l===b.__host)&&f(v.slice(v.indexOf(b))),o=b,r=b===e.target?M.AT_TARGET:M.CAPTURING_PHASE;let x=b.__captureEventListeners.get(e.type);if(x){for(let[H,m]of x)if(c(H,m,x),s)return d()}if(i)return d()}let $=e.bubbles?t:[this];l=null;for(let b of $){!a&&(!l||b===l.__host)&&f($.slice(0,$.indexOf(b)+1)),o=b,r=b===e.target?M.AT_TARGET:M.BUBBLING_PHASE;let x=b.__eventListeners.get(e.type);if(x){for(let[H,m]of x)if(c(H,m,x),s)return d()}if(i)return d()}return d()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,et,Bt]}};var Je=new WeakMap,Y=n=>{let e=Je.get(n);return e===void 0&&Je.set(n,e=new Map),e},X=class extends ce{getRootNode(e){return e?.composed?Le:this.__host?.__shadowRoot??Le}};var Qe=class extends X{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var et=new Qe,Le=et;var tt=class extends X{constructor(e){if(super(),e!==Me)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ue,customElements:Ne,document:Le,Document:Qe,Element:it,EventTarget:ce,HTMLElement:st,Node:X,ShadowRoot:nt,window:this,Window:tt})}};var it=class extends X{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Y(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){Y(this).set(e,String(t))}removeAttribute(e){Y(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 Y(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new nt(Me,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 Ke(this);return this.__internals=e,e}getAttribute(e){return Y(this).get(e)??null}};var st=class extends it{},Re=st;var nt=class extends X{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 Re,"localName",{get(){return"lit-server-root"}});function Ht(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}var ue=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
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 i=this.__pendingWhenDefineds.get(e);return i||(i=Ht(),this.__pendingWhenDefineds.set(e,i)),i.promise}},It=ue;var Ne=new It,Bt=new tt(Me);var Z=globalThis,pe=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ot=Symbol(),rt=new WeakMap,de=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==ot)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(pe&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=rt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&rt.set(t,e))}return e}toString(){return this.cssText}},at=n=>new de(typeof n=="string"?n:n+"",void 0,ot);var lt=(n,e)=>{if(pe)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),s=Z.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},ke=pe||Z.CSSStyleSheet===void 0?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return at(t)})(n):n;var{is:Ut,defineProperty:Dt,getOwnPropertyDescriptor:zt,getOwnPropertyNames:Vt,getOwnPropertySymbols:Wt,getPrototypeOf:jt}=Object,Q=globalThis;Q.customElements??=Ne;var ht=Q.trustedTypes,Ft=ht?ht.emptyScript:"",Gt=Q.reactiveElementPolyfillSupport,J=(n,e)=>n,Pe={toAttribute(n,e){switch(e){case Boolean:n=n?Ft:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ut=(n,e)=>!Ut(n,e),ct={attribute:!0,type:String,converter:Pe,reflect:!1,useDefault:!1,hasChanged:ut};Symbol.metadata??=Symbol("metadata"),Q.litPropertyMetadata??=new WeakMap;var N=class extends(globalThis.HTMLElement??Re){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ct){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 i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Dt(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:r}=zt(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:s,set(a){let l=s?.call(this);r?.call(this,a),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ct}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let e=jt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let t=this.properties,i=[...Vt(t),...Wt(t)];for(let s of i)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)t.unshift(ke(s))}else e!==void 0&&t.push(ke(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return lt(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,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let r=(i.converter?.toAttribute!==void 0?i.converter:Pe).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=i.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Pe;this._$Em=s;let l=a.fromAttribute(t,r.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,i,s=!1,r){if(e!==void 0){let a=this.constructor;if(s===!1&&(r=this[e]),i??=a.getPropertyOptions(e),!((i.hasChanged??ut)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},a){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),r!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(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 i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:a}=r,l=this[s];a!==!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(i=>i.hostUpdate?.()),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}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){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[J("elementProperties")]=new Map,N[J("finalized")]=new Map,Gt?.({ReactiveElement:N}),(Q.reactiveElementVersions??=[]).push("2.1.2");var fe=globalThis,dt=n=>n,me=fe.trustedTypes,pt=me?me.createPolicy("lit-html",{createHTML:n=>n}):void 0,Et="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,yt="?"+P,qt=`<${yt}>`,D=fe.document===void 0?{createTreeWalker:()=>({})}:document,te=()=>D.createComment(""),ie=n=>n===null||typeof n!="object"&&typeof n!="function",ze=Array.isArray,Kt=n=>ze(n)||typeof n?.[Symbol.iterator]=="function",Oe=`[
|
|
3
3
|
\f\r]`,ee=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,mt=/-->/g,ft=/>/g,B=RegExp(`>|${Oe}(?:([^\\s"'>=/]+)(${Oe}*=${Oe}*(?:[^
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,vt=/"/g,_t=/^(?:script|style|textarea|title)$/i,Ve=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),S=Ve(1),$=Ve(2),os=Ve(3),z=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),gt=new WeakMap,U=D.createTreeWalker(D,129);function St(n,e){if(!ze(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return pt!==void 0?pt.createHTML(e):e}var Yt=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",a=ee;for(let l=0;l<t;l++){let o=n[l],u,h,c=-1,d=0;for(;d<o.length&&(a.lastIndex=d,h=a.exec(o),h!==null);)d=a.lastIndex,a===ee?h[1]==="!--"?a=mt:h[1]!==void 0?a=ft:h[2]!==void 0?(_t.test(h[2])&&(s=RegExp("</"+h[2],"g")),a=B):h[3]!==void 0&&(a=B):a===B?h[0]===">"?(a=s??ee,c=-1):h[1]===void 0?c=-2:(c=a.lastIndex-h[2].length,u=h[1],a=h[3]===void 0?B:h[3]==='"'?vt:bt):a===vt||a===bt?a=B:a===mt||a===ft?a=ee:(a=B,s=void 0);let v=a===B&&n[l+1].startsWith("/>")?" ":"";r+=a===ee?o+qt:c>=0?(i.push(u),o.slice(0,c)+Et+o.slice(c)+P+v):o+P+(c===-2?l:v)}return[St(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},se=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,a=0,l=e.length-1,o=this.parts,[u,h]=Yt(e,t);if(this.el=n.createElement(u,i),U.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=U.nextNode())!==null&&o.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(Et)){let d=h[a++],v=s.getAttribute(c).split(P),f=/([.?@])?(.*)/.exec(d);o.push({type:1,index:r,name:f[2],strings:v,ctor:f[1]==="."?Ie:f[1]==="?"?Be:f[1]==="@"?Ue:j}),s.removeAttribute(c)}else c.startsWith(P)&&(o.push({type:6,index:r}),s.removeAttribute(c));if(_t.test(s.tagName)){let c=s.textContent.split(P),d=c.length-1;if(d>0){s.textContent=me?me.emptyScript:"";for(let v=0;v<d;v++)s.append(c[v],te()),U.nextNode(),o.push({type:2,index:++r});s.append(c[d],te())}}}else if(s.nodeType===8)if(s.data===yt)o.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)o.push({type:7,index:r}),c+=P.length-1}r++}}static createElement(e,t){let i=D.createElement("template");return i.innerHTML=e,i}};function W(n,e,t=n,i){if(e===z)return e;let s=i!==void 0?t._$Co?.[i]: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(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=W(n,s._$AS(n,e.values),s,i)),e}var He=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??D).importNode(t,!0);U.currentNode=s;let r=U.nextNode(),a=0,l=0,o=i[0];for(;o!==void 0;){if(a===o.index){let u;o.type===2?u=new ne(r,r.nextSibling,this,e):o.type===1?u=new o.ctor(r,o.name,o.strings,this,e):o.type===6&&(u=new De(r,this,e)),this._$AV.push(u),o=i[++l]}a!==o?.index&&(r=U.nextNode(),a++)}return U.currentNode=D,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++}},ne=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=p,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=W(this,e,t),ie(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Kt(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!==p&&ie(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.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=se.createElement(St(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new He(s,this),a=r.u(this.options);r.p(t),this.T(a),this._$AH=r}}_$AC(e){let t=gt.get(e.strings);return t===void 0&>.set(e.strings,t=new se(e)),t}k(e){ze(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(te()),this.O(te()),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=dt(e).nextSibling;dt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=p,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=p}_$AI(e,t=this,i,s){let r=this.strings,a=!1;if(r===void 0)e=W(this,e,t,0),a=!ie(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{let l=e,o,u;for(e=r[0],o=0;o<r.length-1;o++)u=W(this,l[i+o],t,o),u===z&&(u=this._$AH[o]),a||=!ie(u)||u!==this._$AH[o],u===p?e=p:e!==p&&(e+=(u??"")+r[o+1]),this._$AH[o]=u}a&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ie=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Be=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Ue=class extends j{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??p)===z)return;let i=this._$AH,s=e===p&&i!==p||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==p&&(i===p||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)}},De=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){W(this,e)}};var Xt=fe.litHtmlPolyfillSupport;Xt?.(se,ne),(fe.litHtmlVersions??=[]).push("3.3.3");var wt=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new ne(e.insertBefore(te(),r),r,void 0,t??{})}return s._$AI(n),s};var We=globalThis,O=class extends N{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=wt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};O._$litElement$=!0,O.finalized=!0,We.litElementHydrateSupport?.({LitElement:O});var Zt=We.litElementPolyfillSupport;Zt?.({LitElement:O});(We.litElementVersions??=[]).push("4.2.2");var Jt="3.1.0";var Qt=Symbol.for("nish-ui.runtime.v1");function ei(){let n=globalThis;return n[Qt]??={versions:new Set,slots:{}}}function ti(n){n.versions.add(Jt),n.versions.size>1&&!n.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(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 At=!1;function xt(n,e){let t=ei();return At||(At=!0,ti(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}var be={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 je(){return xt("element-strings",()=>({values:{...be},listeners:new Set}))}function ii(n){let e=je(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(be,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){let n=je(),e=n.values;return Object.keys(be).some(i=>e[i]===void 0)&&(n.values={...be,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),n.values}function $t(n){let e=je().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends O{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=$t(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function L(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function y(n,e){customElements.get(n)||customElements.define(n,e)}function F(n){return!!n&&getComputedStyle(n).direction==="rtl"}var Ct="http://www.w3.org/2000/svg";function si(n,e){let t=document.createElementNS(Ct,"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(Ct,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var Tt=n=>si(n,["M18 6 6 18M6 6l12 12"]);var ve=class extends E{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.#d(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#o().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#r(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.#o()){let r=t.has(this.#r(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),L(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#s(),this.#a()}#a(){if(!this.#e)return;let e=A();for(let t of this.#o()){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)}}#o(){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()}#r(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.#s(),this.#u(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#u(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#s(){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))}#u(){for(let e of this.#o())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(Tt(12)),e.appendChild(i)}}#d(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let a=i.parentElement,l=this.#r(a),o=null;if(a.contains(document.activeElement)){let u=this.#o(),h=u.indexOf(a);for(let c of[...u.slice(h+1),...u.slice(0,h).reverse()]){if(o=c.matches("button")?c:c.querySelector("button, a[href], [tabindex]"),o&&!o.disabled)break;o=null}o||(this.#e.tabIndex=-1,o=this.#e)}a.remove(),o?.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 a of this.#o())a!==s&&a.hasAttribute("aria-pressed")&&a.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};y("nish-chip-group",ve);var Lt=(n,e)=>{let t=e.trim().toLowerCase();return t?n.label.toLowerCase().includes(t)||(n.hint?.toLowerCase().includes(t)??!1):!0};var oi=0,Mt="http://www.w3.org/2000/svg",ai="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Rt(n){let e=document.createElementNS(Mt,"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(Mt,"path");return t.setAttribute("d",n),e.append(t),e}var ge=class extends E{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=++oi;#i=null;#t=null;#n=null;#a=null;#o=null;#c=null;#r=!1;#l="";#h=!1;#s=-1;#u;#d=!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.#p();return}this.#d||(this.#d=!0,L(()=>{this.#d=!1,this.isConnected&&this.#f()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#u),this.#m()}#f(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(o=>({value:o.value,label:o.textContent?.trim()??o.value,hint:o.dataset.hint||void 0,disabled:o.disabled||void 0}));for(let o of e)o.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",o=>this.#R(o)),s.addEventListener("focus",()=>this.#A()),s.addEventListener("click",()=>this.#A()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#p())}),s.addEventListener("change",o=>o.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(Rt("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",o=>o.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=ai;let l=document.createElement("input");l.type="hidden",i.append(s,r,a),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#a=a,this.#c=l,this.#p()}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.#T(),this.#p()}get#b(){return this.options.find(e=>e.value===this.value)??null}get#w(){return this.value!=null&&this.value!==""}get#C(){return this.#h?this.#l:this.#b?.label??this.value??""}get#v(){let e=this.filter??Lt;return(this.#h?this.options.filter(i=>e(i,this.#l)):this.options).slice(0,50)}#T(){this.#s>=this.#v.length&&(this.#s=-1)}#E(){this.#h=!1,this.#l=""}#A(){if(this.#r||this.disabled||!this.#t)return;this.#r=!0;let e=this.#b,t=e?this.#v.findIndex(i=>i.value===e.value):-1;this.#s=t>=0?t:-1,this.#p()}#m(){this.#r=!1,this.#s=-1,this.#o?.remove(),this.#o=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#a&&(this.#a.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let r=e;for(let a=0;a<s;a++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#_(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#g(e,t){this.value=e,this.#E(),this.#p();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#x(e){e.disabled||(this.#m(),this.#g(e.value,e))}#$(){return!this.#h||this.#l.trim()!==""||!this.#w?!1:(this.#m(),this.#g(null,null),!0)}#L(){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.#m(),t?this.#g(t.value,t):this.#g(e,null),!0}#M(e){this.#l=e,this.#h=!0,this.#r=!0,this.allowCustom||e.trim()===""?this.#s=-1:this.#s=this.#v.findIndex(t=>!t.disabled),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#p()}#R(e){if(this.disabled)return;let t=this.#v;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#r){this.#S(this.#s<0?this.#_(i):this.#y(this.#s,i));break}else{this.#r=!0;let s=this.#b,r=s?t.findIndex(a=>a.value===s.value):-1;this.#s=r>=0?r:this.#_(i)}this.#p();break}case"Home":case"End":this.#r&&(e.preventDefault(),this.#S(this.#_(e.key==="Home"?1:-1)));break;case"Enter":this.#r&&this.#s>=0&&t[this.#s]?(e.preventDefault(),this.#x(t[this.#s])):(this.#$()||this.#L()||this.#r)&&e.preventDefault();break;case"Escape":this.#r?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#p()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#p());break;case"Tab":this.#m();break}}#p(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#a)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#C;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.#w&&!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.#r){this.#o&&this.#m();return}this.#N(e,t,this.#a)}#S(e){let t=this.#s;this.#s=e;let i=this.#o,s=this.#t;if(!i||!s||!this.#r){this.#p();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#p():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#N(e,t,i){let s=A(),r=`nish-cb-list-${this.#e}`,a=this.#v,l=this.#b,o=this.#o;if(!o){o=document.createElement("ul"),o.id=r,o.className="nish-combobox-list",o.setAttribute("role","listbox");let h=c=>{let d=c.target?.closest("li[data-index]");if(!d||!o.contains(d))return null;let v=Number(d.dataset.index),f=this.#v[v];return f?{o:f,i:v}:null};o.addEventListener("mousedown",c=>c.preventDefault()),o.addEventListener("mousemove",c=>{let d=h(c);d&&!d.o.disabled&&this.#s!==d.i&&this.#S(d.i)}),o.addEventListener("click",c=>{let d=h(c);d&&this.#x(d.o)}),this.#o=o,t.append(o)}this.label?(o.setAttribute("aria-label",this.label),o.removeAttribute("aria-labelledby")):(o.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),o.setAttribute("aria-labelledby",e.id));let u=a.map((h,c)=>{let d=document.createElement("li");d.id=`${r}-opt-${c}`,d.className="nish-combobox-option",d.setAttribute("role","option"),d.dataset.index=String(c),d.setAttribute("aria-selected",String(l?.value===h.value)),h.disabled&&d.setAttribute("aria-disabled","true"),c===this.#s&&(d.dataset.active="");let v=document.createElement("span");if(v.className="nish-combobox-label",v.textContent=h.label,d.append(v),h.hint){let f=document.createElement("span");f.className="nish-combobox-hint",f.textContent=h.hint,d.append(f)}return l?.value===h.value&&d.append(Rt("M20 6 9 17l-5-5")),d});if(this.loading){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-loading";let c=document.createElement("span");c.className="nish-spinner nish-spinner--sm",c.setAttribute("aria-hidden","true"),h.append(c,document.createTextNode(s.searching)),u.push(h)}else if(a.length===0){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-empty",h.textContent=this.emptyText||s.noMatches,u.push(h)}o.replaceChildren(...u),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#s>=0&&a[this.#s]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:a.length===0?this.emptyText||s.noMatches:s.resultCount(a.length),this.#k(o,e),o.querySelector(`[data-index="${this.#s}"]`)?.scrollIntoView?.({block:"nearest"})}#k(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")}};y("nish-combobox",ge);var Fe=1500,li=15e3,Nt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",hi=$`<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>`,ci=$`<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 ui(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 Ee=class extends E{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 ui(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},Fe)}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},Fe)},{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?Fe:li)}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?ci:hi;return S`${this.icon?S`<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()}>
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,vt=/"/g,_t=/^(?:script|style|textarea|title)$/i,Ve=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),S=Ve(1),C=Ve(2),ls=Ve(3),z=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),gt=new WeakMap,U=D.createTreeWalker(D,129);function St(n,e){if(!ze(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return pt!==void 0?pt.createHTML(e):e}var Yt=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",a=ee;for(let l=0;l<t;l++){let o=n[l],u,h,c=-1,d=0;for(;d<o.length&&(a.lastIndex=d,h=a.exec(o),h!==null);)d=a.lastIndex,a===ee?h[1]==="!--"?a=mt:h[1]!==void 0?a=ft:h[2]!==void 0?(_t.test(h[2])&&(s=RegExp("</"+h[2],"g")),a=B):h[3]!==void 0&&(a=B):a===B?h[0]===">"?(a=s??ee,c=-1):h[1]===void 0?c=-2:(c=a.lastIndex-h[2].length,u=h[1],a=h[3]===void 0?B:h[3]==='"'?vt:bt):a===vt||a===bt?a=B:a===mt||a===ft?a=ee:(a=B,s=void 0);let v=a===B&&n[l+1].startsWith("/>")?" ":"";r+=a===ee?o+qt:c>=0?(i.push(u),o.slice(0,c)+Et+o.slice(c)+P+v):o+P+(c===-2?l:v)}return[St(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},se=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,a=0,l=e.length-1,o=this.parts,[u,h]=Yt(e,t);if(this.el=n.createElement(u,i),U.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=U.nextNode())!==null&&o.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(Et)){let d=h[a++],v=s.getAttribute(c).split(P),f=/([.?@])?(.*)/.exec(d);o.push({type:1,index:r,name:f[2],strings:v,ctor:f[1]==="."?Ie:f[1]==="?"?Be:f[1]==="@"?Ue:j}),s.removeAttribute(c)}else c.startsWith(P)&&(o.push({type:6,index:r}),s.removeAttribute(c));if(_t.test(s.tagName)){let c=s.textContent.split(P),d=c.length-1;if(d>0){s.textContent=me?me.emptyScript:"";for(let v=0;v<d;v++)s.append(c[v],te()),U.nextNode(),o.push({type:2,index:++r});s.append(c[d],te())}}}else if(s.nodeType===8)if(s.data===yt)o.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)o.push({type:7,index:r}),c+=P.length-1}r++}}static createElement(e,t){let i=D.createElement("template");return i.innerHTML=e,i}};function W(n,e,t=n,i){if(e===z)return e;let s=i!==void 0?t._$Co?.[i]: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(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=W(n,s._$AS(n,e.values),s,i)),e}var He=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??D).importNode(t,!0);U.currentNode=s;let r=U.nextNode(),a=0,l=0,o=i[0];for(;o!==void 0;){if(a===o.index){let u;o.type===2?u=new ne(r,r.nextSibling,this,e):o.type===1?u=new o.ctor(r,o.name,o.strings,this,e):o.type===6&&(u=new De(r,this,e)),this._$AV.push(u),o=i[++l]}a!==o?.index&&(r=U.nextNode(),a++)}return U.currentNode=D,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++}},ne=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=p,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=W(this,e,t),ie(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Kt(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!==p&&ie(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.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=se.createElement(St(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new He(s,this),a=r.u(this.options);r.p(t),this.T(a),this._$AH=r}}_$AC(e){let t=gt.get(e.strings);return t===void 0&>.set(e.strings,t=new se(e)),t}k(e){ze(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(te()),this.O(te()),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=dt(e).nextSibling;dt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=p,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=p}_$AI(e,t=this,i,s){let r=this.strings,a=!1;if(r===void 0)e=W(this,e,t,0),a=!ie(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{let l=e,o,u;for(e=r[0],o=0;o<r.length-1;o++)u=W(this,l[i+o],t,o),u===z&&(u=this._$AH[o]),a||=!ie(u)||u!==this._$AH[o],u===p?e=p:e!==p&&(e+=(u??"")+r[o+1]),this._$AH[o]=u}a&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ie=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Be=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Ue=class extends j{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??p)===z)return;let i=this._$AH,s=e===p&&i!==p||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==p&&(i===p||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)}},De=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){W(this,e)}};var Xt=fe.litHtmlPolyfillSupport;Xt?.(se,ne),(fe.litHtmlVersions??=[]).push("3.3.3");var wt=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new ne(e.insertBefore(te(),r),r,void 0,t??{})}return s._$AI(n),s};var We=globalThis,O=class extends N{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=wt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};O._$litElement$=!0,O.finalized=!0,We.litElementHydrateSupport?.({LitElement:O});var Zt=We.litElementPolyfillSupport;Zt?.({LitElement:O});(We.litElementVersions??=[]).push("4.2.2");var Jt="3.3.0";var Qt=Symbol.for("nish-ui.runtime.v1");function ei(){let n=globalThis;return n[Qt]??={versions:new Set,slots:{}}}function ti(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}function ii(n){n.versions.add(Jt),n.versions.size>1&&!n.warned&&ti()&&(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 At=!1;function xt(n,e){let t=ei();return At||(At=!0,ii(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}var be={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 je(){return xt("element-strings",()=>({values:{...be},listeners:new Set}))}function si(n){let e=je(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(be,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){let n=je(),e=n.values;return Object.keys(be).some(i=>e[i]===void 0)&&(n.values={...be,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),n.values}function Ct(n){let e=je().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends O{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=Ct(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function L(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function y(n,e){customElements.get(n)||customElements.define(n,e)}function F(n){return!!n&&getComputedStyle(n).direction==="rtl"}var $t="http://www.w3.org/2000/svg";function ni(n,e){let t=document.createElementNS($t,"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($t,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var Tt=n=>ni(n,["M18 6 6 18M6 6l12 12"]);var ve=class extends E{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.#d(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#o().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#r(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.#o()){let r=t.has(this.#r(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),L(()=>this.#a())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#s(),this.#l()}#l(){if(!this.#e)return;let e=A();for(let t of this.#o()){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)}}#o(){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()}#r(e){return e.getAttribute("value")??this.#c(e)}#a(){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.#s(),this.#u(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#u(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#s(){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))}#u(){for(let e of this.#o())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(Tt(12)),e.appendChild(i)}}#d(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let a=i.parentElement,l=this.#r(a),o=null;if(a.contains(document.activeElement)){let u=this.#o(),h=u.indexOf(a);for(let c of[...u.slice(h+1),...u.slice(0,h).reverse()]){if(o=c.matches("button")?c:c.querySelector("button, a[href], [tabindex]"),o&&!o.disabled)break;o=null}o||(this.#e.tabIndex=-1,o=this.#e)}a.remove(),o?.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 a of this.#o())a!==s&&a.hasAttribute("aria-pressed")&&a.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};y("nish-chip-group",ve);var Lt=(n,e)=>ri(n.label.toLowerCase(),n.hint?.toLowerCase(),e.trim().toLowerCase());function ri(n,e,t){return t?n.includes(t)||(e?.includes(t)??!1):!0}var li=0,Mt="http://www.w3.org/2000/svg",hi="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Rt(n){let e=document.createElementNS(Mt,"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(Mt,"path");return t.setAttribute("d",n),e.append(t),e}var ge=class extends E{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=++li;#i=null;#t=null;#n=null;#l=null;#o=null;#c=null;#r=!1;#a="";#h=!1;#s=-1;#u;#d=!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.#p();return}this.#d||(this.#d=!0,L(()=>{this.#d=!1,this.isConnected&&this.#f()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#u),this.#m()}#f(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(o=>({value:o.value,label:o.getAttribute("label")||o.textContent?.trim()||o.value,hint:o.dataset.hint||void 0,disabled:o.disabled||void 0}));for(let o of e)o.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.#R(s.value)),s.addEventListener("keydown",o=>this.#N(o)),s.addEventListener("focus",()=>this.#x()),s.addEventListener("click",()=>this.#x()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#p())}),s.addEventListener("change",o=>o.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(Rt("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",o=>o.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=hi;let l=document.createElement("input");l.type="hidden",i.append(s,r,a),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#l=a,this.#c=l,this.#p()}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.#L(),this.#p()}get#b(){return this.options.find(e=>e.value===this.value)??null}get#w(){return this.value!=null&&this.value!==""}get#T(){return this.#h?this.#a:this.#b?.label??this.value??""}#A=null;get#v(){let e=this.#A;if(e&&e.options===this.options&&e.filter===this.filter&&e.text===this.#a&&e.dirty===this.#h)return e.list;let t=this.filter??Lt,i=(this.#h?this.options.filter(s=>t(s,this.#a)):this.options).slice(0,50);return this.#A={options:this.options,filter:this.filter,text:this.#a,dirty:this.#h,list:i},i}#L(){this.#s>=this.#v.length&&(this.#s=-1)}#E(){this.#h=!1,this.#a=""}#x(){if(this.#r||this.disabled||!this.#t)return;this.#r=!0;let e=this.#b,t=e?this.#v.findIndex(i=>i.value===e.value):-1;this.#s=t>=0?t:-1,this.#p()}#m(){this.#r=!1,this.#s=-1,this.#o?.remove(),this.#o=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#l&&(this.#l.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let r=e;for(let a=0;a<s;a++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#_(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#g(e,t){this.value=e,this.#E(),this.#p();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#C(e){e.disabled||(this.#m(),this.#g(e.value,e))}#$(){return!this.#h||this.#a.trim()!==""||!this.#w?!1:(this.#m(),this.#g(null,null),!0)}#M(){let e=this.#a.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(i=>!i.disabled&&i.label.toLowerCase()===e.toLowerCase());return this.#m(),t?this.#g(t.value,t):this.#g(e,null),!0}#R(e){this.#a=e,this.#h=!0,this.#r=!0,this.allowCustom||e.trim()===""?this.#s=-1:this.#s=this.#v.findIndex(t=>!t.disabled),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#p()}#N(e){if(this.disabled)return;let t=this.#v;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#r){this.#S(this.#s<0?this.#_(i):this.#y(this.#s,i));break}else{this.#r=!0;let s=this.#b,r=s?t.findIndex(a=>a.value===s.value):-1;this.#s=r>=0?r:this.#_(i)}this.#p();break}case"Home":case"End":this.#r&&(e.preventDefault(),this.#S(this.#_(e.key==="Home"?1:-1)));break;case"Enter":this.#r&&this.#s>=0&&t[this.#s]?(e.preventDefault(),this.#C(t[this.#s])):(this.#$()||this.#M()||this.#r)&&e.preventDefault();break;case"Escape":this.#r?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#p()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#p());break;case"Tab":this.#m();break}}#p(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#l)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#T;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.#w&&!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.#r){this.#o&&this.#m();return}this.#k(e,t,this.#l)}#S(e){let t=this.#s;this.#s=e;let i=this.#o,s=this.#t;if(!i||!s||!this.#r){this.#p();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#p():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#k(e,t,i){let s=A(),r=`nish-cb-list-${this.#e}`,a=this.#v,l=this.#b,o=this.#o;if(!o){o=document.createElement("ul"),o.id=r,o.className="nish-combobox-list",o.setAttribute("role","listbox");let h=c=>{let d=c.target?.closest("li[data-index]");if(!d||!o.contains(d))return null;let v=Number(d.dataset.index),f=this.#v[v];return f?{o:f,i:v}:null};o.addEventListener("mousedown",c=>c.preventDefault()),o.addEventListener("mousemove",c=>{let d=h(c);d&&!d.o.disabled&&this.#s!==d.i&&this.#S(d.i)}),o.addEventListener("click",c=>{let d=h(c);d&&this.#C(d.o)}),this.#o=o,t.append(o)}this.label?(o.setAttribute("aria-label",this.label),o.removeAttribute("aria-labelledby")):(o.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),o.setAttribute("aria-labelledby",e.id));let u=a.map((h,c)=>{let d=document.createElement("li");d.id=`${r}-opt-${c}`,d.className="nish-combobox-option",d.setAttribute("role","option"),d.dataset.index=String(c),d.setAttribute("aria-selected",String(l?.value===h.value)),h.disabled&&d.setAttribute("aria-disabled","true"),c===this.#s&&(d.dataset.active="");let v=document.createElement("span");if(v.className="nish-combobox-label",v.textContent=h.label,d.append(v),h.hint){let f=document.createElement("span");f.className="nish-combobox-hint",f.textContent=h.hint,d.append(f)}return l?.value===h.value&&d.append(Rt("M20 6 9 17l-5-5")),d});if(this.loading){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-loading";let c=document.createElement("span");c.className="nish-spinner nish-spinner--sm",c.setAttribute("aria-hidden","true"),h.append(c,document.createTextNode(s.searching)),u.push(h)}else if(a.length===0){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-empty",h.textContent=this.emptyText||s.noMatches,u.push(h)}o.replaceChildren(...u),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#s>=0&&a[this.#s]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:a.length===0?this.emptyText||s.noMatches:s.resultCount(a.length),this.#P(o,e),o.querySelector(`[data-index="${this.#s}"]`)?.scrollIntoView?.({block:"nearest"})}#P(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")}};y("nish-combobox",ge);var Fe=1500,ci=15e3,Nt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",ui=C`<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>`,di=C`<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 pi(n,e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(n),!0}catch{}let t=document.createElement("textarea");t.value=n,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:-1000px;opacity:0";let i=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(),i?.focus?.(),s}var Ee=class extends E{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 pi(e,this)){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},Fe)}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},Fe)},{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?Fe:ci)}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?di:ui;return S`${this.icon?S`<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
6
|
</button>`:S`<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=${Nt}>${this.copied?i:this.manual?t:p}</span>${this.manual&&this.value!=null?S`<textarea data-copy-source readonly tabindex="-1" aria-label=${this.value} style=${Nt} .value=${this.value}></textarea>`:p}`}};y("nish-copy-button",Ee);var
|
|
9
|
-
${
|
|
8
|
+
</button>`}<span role="status" aria-live="polite" style=${Nt}>${this.copied?i:this.manual?t:p}</span>${this.manual&&this.value!=null?S`<textarea data-copy-source readonly tabindex="-1" aria-label=${this.value} style=${Nt} .value=${this.value}></textarea>`:p}`}};y("nish-copy-button",Ee);var mi=0,ye=class extends E{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-${++mi}`;#i=null;#t=null;#n=null;#l=null;#o="";#c=!1;constructor(){super(),this.optional=!1,this.layout="stack"}connectedCallback(){super.connectedCallback(),L(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#l?.disconnect(),this.#l=null,this.#i=null,this.#t=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#i)return;let e=this.querySelector(":scope > div.nish-field");if(!e){let t=this.firstElementChild;if(!t){this.#l||(this.#l=new MutationObserver(()=>{this.firstElementChild&&(this.#l?.disconnect(),this.#l=null,this.#r())}),this.#l.observe(this,{childList:!0}));return}e=document.createElement("div"),e.appendChild(t),this.appendChild(e)}e.classList.add("nish-field"),this.#i=e,this.#t=Array.from(e.children).find(t=>!t.matches("label.nish-field-label, small.nish-hint, small.nish-error")),this.#o=(this.#a()?.getAttribute("aria-describedby")??"").split(/\s+/).filter(t=>t&&t!==`${this.#e}-hint`&&t!==`${this.#e}-error`).join(" "),this.#s(),this.#t&&this.#t.localName.startsWith("nish-")&&(this.#n=new MutationObserver(()=>{this.#a()&&!this.#h()&&this.#s()}),this.#n.observe(this.#t,{childList:!0,subtree:!0}))}#a(){let e=this.#t;return e?e.localName==="nish-combobox"||e.localName==="nish-search"?e.querySelector("input"):e:null}#h(){let e=this.#a();return!!e&&!!e.id&&this.#i?.querySelector("label.nish-field-label")?.getAttribute("for")===e.id}#s(){let e=this.#i;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 i=this.#a();i&&!i.id&&(i.id=`${this.#e}-control`);let s=i?.id??"",r=!!this.error,a=!!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 h=document.createElement("span");h.className="nish-optional",h.textContent=A().optional,l.appendChild(h)}}else l?.remove();let o=`${this.#e}-hint`,u=`${this.#e}-error`;if(this.#u(e,"hint",a?this.hint:"",o),this.#u(e,"error",r?this.error:"",u),i){let h=[this.#o,r?u:a?o:""].filter(Boolean).join(" ");h?i.setAttribute("aria-describedby",h):i.removeAttribute("aria-describedby"),r?(i.setAttribute("aria-invalid","true"),this.#c=!0):this.#c&&(i.removeAttribute("aria-invalid"),this.#c=!1)}}#u(e,t,i,s){let r=e.querySelector(`:scope > small.nish-${t}`);if(!i){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!==i&&(r.textContent=i)}};y("nish-field",ye);var fi=n=>C`<svg width=${n} height=${n} 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>`,bi=C`<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>`,_e=class extends E{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}}))}#i(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()}#n(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"),S`<label class=${t.join(" ")}>
|
|
9
|
+
${fi(this.size==="md"||!this.size?16:14)}
|
|
10
10
|
<input
|
|
11
11
|
class="nish-input"
|
|
12
12
|
type="search"
|
|
@@ -20,8 +20,8 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
20
20
|
@input=${i=>this.#i(i)}
|
|
21
21
|
@keydown=${i=>this.#n(i)}
|
|
22
22
|
/>
|
|
23
|
-
${this.value&&!this.disabled?S`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label=${e.clear} @click=${()=>this.#t()}>${
|
|
24
|
-
</label>`}};y("nish-search",_e);function Ge(n){let e=()=>{let r=n.scrollWidth-n.clientWidth,l=F(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 qe(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 fi=0,bi=n=>n.replace(/[^\w-]+/g,"-");function vi(n){let e=n.map(bi);return e.map((t,i)=>/[A-Za-z0-9_]/.test(t)&&e.indexOf(t)===i&&e.lastIndexOf(t)===i?t:`${t}-${i}`)}var Se=class extends E{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;#a=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#o=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(o=>o===document.activeElement),s=i>=0?i:Math.max(0,t.findIndex(o=>o.getAttribute("aria-selected")==="true")),r,a=F(this.#e)?"ArrowLeft":"ArrowRight",l=F(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===a)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.#d(r),r.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),L(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#a),this.#e?.removeEventListener("keydown",this.#o),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#f()}#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-${++fi}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#a),e.addEventListener("keydown",this.#o),this.#t=Ge(e),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#f(),this.#r()}),this.#r(),this.#f()}#r(){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)}#s(e){return e.getAttribute("value")??(e.textContent??"").trim()}#u(){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}#d(e){if(e.disabled)return;let t=this.#s(e),i=t!==this.value;this.value=t,this.#b(),i&&this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0}))}#f(){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.#s(i)===this.value&&!i.disabled)){let i=t.find(s=>!s.disabled);i&&(this.value=this.#s(i))}this.#b()}#b(){let e=this.#e;if(!e)return;let t=this.#l(),i=this.#u(),s=null,r=vi(t.map(l=>this.#s(l)));for(let[l,o]of t.entries()){let u=this.#s(o),h=u===this.value&&!o.disabled;h&&(s=o),o.id||(o.id=`${this.#i}-tab-${r[l]}`),o.type="button",o.classList.add("nish-tab"),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(h));let c=i.find(d=>d.getAttribute("data-tab-panel")===u);c?(c.id||(c.id=`${this.#i}-panel-${r[l]}`),o.setAttribute("aria-controls",c.id),c.setAttribute("role","tabpanel"),c.setAttribute("aria-labelledby",o.id),c.hidden=!h):o.removeAttribute("aria-controls")}let a=s??t.find(l=>!l.disabled)??null;for(let l of t)l.tabIndex=l===a?0:-1;s&&qe(e,s)}};y("nish-tabs",Se);var we=class extends E{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;#a=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#o=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(h=>h===document.activeElement),s=t.findIndex(h=>h.getAttribute("aria-checked")==="true"),r=i>=0?i:s,a,l=F(this.#e),o=l?"ArrowLeft":"ArrowRight",u=l?"ArrowRight":"ArrowLeft";if(e.key===o||e.key==="ArrowDown")a=r<0?t[0]:t[(r+1)%t.length];else if(e.key===u||e.key==="ArrowUp")a=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")a=t[0];else if(e.key==="End")a=t[t.length-1];else return;e.preventDefault(),this.#u(a),a.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),L(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#a),this.#e?.removeEventListener("keydown",this.#o),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#d()}#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.#a),e.addEventListener("keydown",this.#o),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#d(),this.#r()}),this.#r(),this.#d()}#r(){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)}#s(e){return e.getAttribute("value")??(e.textContent??"").trim()}#u(e){if(e.disabled)return;let t=this.#s(e),i=t!==this.value;this.value=t,this.#f(),i&&(this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#d(){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=Ge(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.#f()}#f(){let e=this.#e;if(!e)return;let t=this.#l(),i=null;for(let r of t){let a=this.#s(r)===this.value&&!r.disabled;a&&(i=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(a))}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"&&qe(e,i)}};y("nish-segmented",we);function gi(n,e,t,i){let s=t-e||1,r=[],a=-1,l=n[0],o=n[0],u=()=>{l===o?r.push(l):l.x<=o.x?r.push(l,o):r.push(o,l)};for(let h of n){let c=Math.min(i-1,Math.max(0,Math.floor((h.x-e)/s*i)));c!==a?(a>=0&&u(),a=c,l=h,o=h):(h.y<l.y&&(l=h),h.y>o.y&&(o=h))}return u(),r}function kt(n,e,t,i,s){let r=n.filter(m=>m!=null&&Number.isFinite(m)),a=r.length===0,l=1/0,o=-1/0;for(let m of r)m<l&&(l=m),m>o&&(o=m);let u=i??(a?0:l),h=s??(a?1:o),c=2,d=m=>n.length<=1?e/2:m/(n.length-1)*e,v=m=>h===u?t/2:c+(1-(m-u)/(h-u))*(t-2*c),f=[],C=[];n.forEach((m,re)=>{m==null||!Number.isFinite(m)?(C.length&&f.push(C),C=[]):C.push({x:d(re),y:v(m)})}),C.length&&f.push(C);let b=Math.max(1,Math.floor(e));for(let m=0;m<f.length;m++)f[m].length>b*2&&(f[m]=gi(f[m],0,e,b));let x=m=>m.length===1?`M${m[0].x},${m[0].y}h0`:m.map((re,Ot)=>`${Ot?"L":"M"}${re.x},${re.y}`).join(""),H=m=>m.length<2?"":`${x(m)}L${m[m.length-1].x},${t}L${m[0].x},${t}Z`;return{empty:a,lines:f.map(x),areas:f.map(H),baseline:`M0,${t/2}H${e}`}}var Pt={"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 Ei(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 Ae=class extends E{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>Ei(e),toAttribute:e=>e.map(t=>t==null?"":String(t)).join(",")}},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 p;let t=this.width>0?this.width:120,i=this.height>0?this.height:28,{empty:s,lines:r,areas:a,baseline:l}=kt(e,t,i,this.min??void 0,this.max??void 0),o=s?"var(--nish-line-strong)":Object.hasOwn(Pt,this.tone)?Pt[this.tone]:"var(--nish-chart-1)",u=A(),h=this.label||u.trend;return S`<svg
|
|
23
|
+
${this.value&&!this.disabled?S`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label=${e.clear} @click=${()=>this.#t()}>${bi}</button>`:p}
|
|
24
|
+
</label>`}};y("nish-search",_e);function Ge(n){let e=()=>{let r=n.scrollWidth-n.clientWidth,l=F(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 qe(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 vi=0,gi=n=>n.replace(/[^\w-]+/g,"-");function Ei(n){let e=n.map(gi);return e.map((t,i)=>/[A-Za-z0-9_]/.test(t)&&e.indexOf(t)===i&&e.lastIndexOf(t)===i?t:`${t}-${i}`)}var Se=class extends E{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;#l=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#o=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(o=>o===document.activeElement),s=i>=0?i:Math.max(0,t.findIndex(o=>o.getAttribute("aria-selected")==="true")),r,a=F(this.#e)?"ArrowLeft":"ArrowRight",l=F(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===a)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.#d(r),r.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),L(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#l),this.#e?.removeEventListener("keydown",this.#o),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#f()}#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-${++vi}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#l),e.addEventListener("keydown",this.#o),this.#t=Ge(e),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#f(),this.#r()}),this.#r(),this.#f()}#r(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#a().filter(e=>!e.disabled)}#s(e){return e.getAttribute("value")??(e.textContent??"").trim()}#u(){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}#d(e){if(e.disabled)return;let t=this.#s(e),i=t!==this.value;this.value=t,this.#b(),i&&this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0}))}#f(){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.#a();if(!t.some(i=>this.#s(i)===this.value&&!i.disabled)){let i=t.find(s=>!s.disabled);i&&(this.value=this.#s(i))}this.#b()}#b(){let e=this.#e;if(!e)return;let t=this.#a(),i=this.#u(),s=null,r=Ei(t.map(l=>this.#s(l)));for(let[l,o]of t.entries()){let u=this.#s(o),h=u===this.value&&!o.disabled;h&&(s=o),o.id||(o.id=`${this.#i}-tab-${r[l]}`),o.type="button",o.classList.add("nish-tab"),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(h));let c=i.find(d=>d.getAttribute("data-tab-panel")===u);c?(c.id||(c.id=`${this.#i}-panel-${r[l]}`),o.setAttribute("aria-controls",c.id),c.setAttribute("role","tabpanel"),c.setAttribute("aria-labelledby",o.id),c.hidden=!h):o.removeAttribute("aria-controls")}let a=s??t.find(l=>!l.disabled)??null;for(let l of t)l.tabIndex=l===a?0:-1;s&&qe(e,s)}};y("nish-tabs",Se);var we=class extends E{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;#l=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#o=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(h=>h===document.activeElement),s=t.findIndex(h=>h.getAttribute("aria-checked")==="true"),r=i>=0?i:s,a,l=F(this.#e),o=l?"ArrowLeft":"ArrowRight",u=l?"ArrowRight":"ArrowLeft";if(e.key===o||e.key==="ArrowDown")a=r<0?t[0]:t[(r+1)%t.length];else if(e.key===u||e.key==="ArrowUp")a=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")a=t[0];else if(e.key==="End")a=t[t.length-1];else return;e.preventDefault(),this.#u(a),a.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),L(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#l),this.#e?.removeEventListener("keydown",this.#o),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#d()}#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.#l),e.addEventListener("keydown",this.#o),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#d(),this.#r()}),this.#r(),this.#d()}#r(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#a().filter(e=>!e.disabled)}#s(e){return e.getAttribute("value")??(e.textContent??"").trim()}#u(e){if(e.disabled)return;let t=this.#s(e),i=t!==this.value;this.value=t,this.#f(),i&&(this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#d(){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=Ge(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.#f()}#f(){let e=this.#e;if(!e)return;let t=this.#a(),i=null;for(let r of t){let a=this.#s(r)===this.value&&!r.disabled;a&&(i=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(a))}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"&&qe(e,i)}};y("nish-segmented",we);function yi(n,e,t,i){let s=t-e||1,r=[],a=-1,l=n[0],o=n[0],u=()=>{l===o?r.push(l):l.x<=o.x?r.push(l,o):r.push(o,l)};for(let h of n){let c=Math.min(i-1,Math.max(0,Math.floor((h.x-e)/s*i)));c!==a?(a>=0&&u(),a=c,l=h,o=h):(h.y<l.y&&(l=h),h.y>o.y&&(o=h))}return u(),r}function kt(n,e,t,i,s){let r=n.filter(m=>m!=null&&Number.isFinite(m)),a=r.length===0,l=1/0,o=-1/0;for(let m of r)m<l&&(l=m),m>o&&(o=m);let u=i??(a?0:l),h=s??(a?1:o),c=2,d=m=>n.length<=1?e/2:m/(n.length-1)*e,v=m=>h===u?t/2:c+(1-(m-u)/(h-u))*(t-2*c),f=[],$=[];n.forEach((m,re)=>{m==null||!Number.isFinite(m)?($.length&&f.push($),$=[]):$.push({x:d(re),y:v(m)})}),$.length&&f.push($);let b=Math.max(1,Math.floor(e));for(let m=0;m<f.length;m++)f[m].length>b*2&&(f[m]=yi(f[m],0,e,b));let x=m=>m.length===1?`M${m[0].x},${m[0].y}h0`:m.map((re,Ot)=>`${Ot?"L":"M"}${re.x},${re.y}`).join(""),H=m=>m.length<2?"":`${x(m)}L${m[m.length-1].x},${t}L${m[0].x},${t}Z`;return{empty:a,lines:f.map(x),areas:f.map(H),baseline:`M0,${t/2}H${e}`}}var Pt={"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 _i(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 Ae=class extends E{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>_i(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 p;let t=this.width>0?this.width:120,i=this.height>0?this.height:28,{empty:s,lines:r,areas:a,baseline:l}=kt(e,t,i,this.min??void 0,this.max??void 0),o=s?"var(--nish-line-strong)":Object.hasOwn(Pt,this.tone)?Pt[this.tone]:"var(--nish-chart-1)",u=A(),h=this.label||u.trend;return S`<svg
|
|
25
25
|
class="nish-sparkline"
|
|
26
26
|
role="img"
|
|
27
27
|
aria-label=${s?u.noDataNamed(h):h}
|
|
@@ -31,8 +31,8 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
31
31
|
preserveAspectRatio="none"
|
|
32
32
|
style="color:${o}"
|
|
33
33
|
>
|
|
34
|
-
${s
|
|
35
|
-
</svg>`}};y("nish-sparkline",Ae);var
|
|
34
|
+
${s?C`<path d=${l} stroke="currentColor" stroke-width="1.5" stroke-dasharray="3 3" vector-effect="non-scaling-stroke"></path>`:C`${this.fill?a.map(c=>C`<path d=${c} fill="currentColor" fill-opacity="0.15"></path>`):p}${r.map(c=>C`<path d=${c} fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path>`)}`}
|
|
35
|
+
</svg>`}};y("nish-sparkline",Ae);var Si=0,xe=class extends E{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-${++Si}`;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)}#i(){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,i=e||!!this.description?S`<span style="min-width:0">
|
|
36
36
|
${e?S`<span id=${`${this.#e}-label`} style="display:block;line-height:1.375">${this.label}</span>`:p}
|
|
37
37
|
${this.description?S`<span id=${`${this.#e}-desc`} style="display:block;margin-top:2px;font-size:var(--nish-text-xs);color:var(--nish-hi3)">${this.description}</span>`:p}
|
|
38
38
|
</span>`:p,s=this.labelSide==="start",r=S`<button
|
|
@@ -48,7 +48,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
48
48
|
></button>`;return S`<label class="nish-check-row" style=${s?"justify-content:space-between":p}>
|
|
49
49
|
${s?i:p}${r}${s?p:i}
|
|
50
50
|
${this.name?S`<input type="hidden" name=${this.name} value="on" ?disabled=${!this.checked||this.disabled} />`:p}
|
|
51
|
-
</label>`}};y("nish-switch",xe);export{ve as NishChipGroup,ge as NishCombobox,Ee as NishCopyButton,E as NishElement,ye as NishField,_e as NishSearch,we as NishSegmented,Ae as NishSparkline,xe as NishSwitch,Se as NishTabs,
|
|
51
|
+
</label>`}};y("nish-switch",xe);export{ve as NishChipGroup,ge as NishCombobox,Ee as NishCopyButton,E as NishElement,ye as NishField,_e as NishSearch,we as NishSegmented,Ae as NishSparkline,xe as NishSwitch,Se as NishTabs,si as configureStrings,y as define};
|
|
52
52
|
/*! Bundled license information:
|
|
53
53
|
|
|
54
54
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
package/dist/elements.d.ts
CHANGED
|
@@ -127,6 +127,7 @@ export interface ToastOptions {
|
|
|
127
127
|
duration?: number | 'sticky';
|
|
128
128
|
action?: { label: string; href?: string; onClick?: () => void };
|
|
129
129
|
dismissLabel?: string;
|
|
130
|
+
strings?: { dismiss?: string };
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
/** Show a toast. Returns a function that hides it now. Needs nish-components.css. */
|