nish-ui 1.9.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +218 -58
  2. package/dist/base-tailwind.css +1757 -0
  3. package/dist/base.css +1590 -1445
  4. package/dist/chart.d.ts +4 -1
  5. package/dist/chart.js +122 -49
  6. package/dist/elements-all.d.ts +8 -0
  7. package/dist/elements-all.js +178 -0
  8. package/dist/elements-charts.d.ts +71 -0
  9. package/dist/elements-charts.js +56 -57
  10. package/dist/elements-data.d.ts +71 -0
  11. package/dist/elements-data.js +5 -6
  12. package/dist/elements-forms.d.ts +71 -0
  13. package/dist/elements-forms.js +24 -25
  14. package/dist/elements.d.ts +71 -0
  15. package/dist/elements.js +4 -5
  16. package/dist/esm/chart-values.js +58 -0
  17. package/dist/esm/chart.js +10 -0
  18. package/dist/esm/cn.js +19 -0
  19. package/dist/esm/combobox-filter.js +13 -0
  20. package/dist/esm/components/accordion.js +166 -0
  21. package/dist/esm/components/app-shell.js +198 -0
  22. package/dist/esm/components/avatar-classes.js +28 -0
  23. package/dist/esm/components/avatar.js +113 -0
  24. package/dist/esm/components/breadcrumbs.js +154 -0
  25. package/dist/esm/components/canvas/follow-caption.js +32 -0
  26. package/dist/esm/components/canvas/follow.js +119 -0
  27. package/dist/esm/components/canvas/icons.js +70 -0
  28. package/dist/esm/components/canvas/index.js +10 -0
  29. package/dist/esm/components/canvas/layout.js +258 -0
  30. package/dist/esm/components/canvas/legend.js +93 -0
  31. package/dist/esm/components/canvas/minimap.js +127 -0
  32. package/dist/esm/components/canvas/node.js +87 -0
  33. package/dist/esm/components/canvas/route.js +262 -0
  34. package/dist/esm/components/canvas/system-canvas.js +837 -0
  35. package/dist/esm/components/canvas/types.js +10 -0
  36. package/dist/esm/components/canvas/view.js +47 -0
  37. package/dist/esm/components/chart-hooks.js +19 -0
  38. package/dist/esm/components/charts.js +467 -0
  39. package/dist/esm/components/client.js +24 -0
  40. package/dist/esm/components/combobox.js +343 -0
  41. package/dist/esm/components/command.js +403 -0
  42. package/dist/esm/components/data-classes.js +159 -0
  43. package/dist/esm/components/data.js +517 -0
  44. package/dist/esm/components/display-classes.js +130 -0
  45. package/dist/esm/components/display.js +755 -0
  46. package/dist/esm/components/error-boundary.js +64 -0
  47. package/dist/esm/components/feedback.js +136 -0
  48. package/dist/esm/components/file-dropzone.js +184 -0
  49. package/dist/esm/components/filters.js +108 -0
  50. package/dist/esm/components/flow.js +746 -0
  51. package/dist/esm/components/forms-classes.js +43 -0
  52. package/dist/esm/components/forms.js +581 -0
  53. package/dist/esm/components/hooks-classes.js +9 -0
  54. package/dist/esm/components/hooks.js +236 -0
  55. package/dist/esm/components/icons.js +96 -0
  56. package/dist/esm/components/inbox-classes.js +29 -0
  57. package/dist/esm/components/inbox.js +257 -0
  58. package/dist/esm/components/latest.js +13 -0
  59. package/dist/esm/components/layout-vars.js +96 -0
  60. package/dist/esm/components/layout.js +272 -0
  61. package/dist/esm/components/media.js +143 -0
  62. package/dist/esm/components/nav.js +614 -0
  63. package/dist/esm/components/overlay-classes.js +66 -0
  64. package/dist/esm/components/overlay.js +1461 -0
  65. package/dist/esm/components/pagination-classes.js +29 -0
  66. package/dist/esm/components/pagination.js +154 -0
  67. package/dist/esm/components/portal.js +16 -0
  68. package/dist/esm/components/primitives-classes.js +198 -0
  69. package/dist/esm/components/primitives.js +268 -0
  70. package/dist/esm/components/progress.js +77 -0
  71. package/dist/esm/components/provider.js +32 -0
  72. package/dist/esm/components/radio-group.js +186 -0
  73. package/dist/esm/components/resource-classes.js +133 -0
  74. package/dist/esm/components/resource.js +209 -0
  75. package/dist/esm/components/segmented.js +178 -0
  76. package/dist/esm/components/separator.js +38 -0
  77. package/dist/esm/components/service-tokens.js +221 -0
  78. package/dist/esm/components/settings.js +301 -0
  79. package/dist/esm/components/slider.js +262 -0
  80. package/dist/esm/components/split-classes.js +8 -0
  81. package/dist/esm/components/split.js +411 -0
  82. package/dist/esm/components/strings.js +119 -0
  83. package/dist/esm/components/table.js +144 -0
  84. package/dist/esm/components/tabs-classes.js +21 -0
  85. package/dist/esm/components/tabs.js +201 -0
  86. package/dist/esm/components/tag-input.js +257 -0
  87. package/dist/esm/components/theme-toggle.js +177 -0
  88. package/dist/esm/components/toast.js +361 -0
  89. package/dist/esm/components/url-state.js +118 -0
  90. package/dist/esm/components/visually-hidden.js +20 -0
  91. package/dist/esm/format.js +320 -0
  92. package/dist/esm/inbox-client.js +2 -0
  93. package/dist/esm/inbox-types.js +2 -0
  94. package/dist/esm/index.js +320 -0
  95. package/dist/esm/runtime.js +37 -0
  96. package/dist/esm/server/inbox/client.js +297 -0
  97. package/dist/esm/server/inbox/types.js +24 -0
  98. package/dist/esm/sparkline-path.js +59 -0
  99. package/dist/esm/split-layout.js +419 -0
  100. package/dist/esm/system-canvas.js +2 -0
  101. package/dist/esm/theme.js +804 -0
  102. package/dist/esm/tokens.mjs +425 -0
  103. package/dist/esm/url.js +20 -0
  104. package/dist/files.json +5 -1
  105. package/dist/fonts/LICENSE-Inter.txt +93 -0
  106. package/dist/format.d.ts +32 -18
  107. package/dist/format.js +227 -82
  108. package/dist/inbox-client.js +3 -1
  109. package/dist/index.d.ts +1686 -667
  110. package/dist/nish-components.css +4649 -4506
  111. package/dist/nish-components.min.css +1 -0
  112. package/dist/nish.css +1603 -1450
  113. package/dist/nish.min.css +1 -0
  114. package/dist/node/eslint.js +29 -14
  115. package/dist/node/th-check.js +29 -14
  116. package/dist/node/vite.d.ts +12 -0
  117. package/dist/node/vite.js +12 -2
  118. package/dist/server/hono.d.ts +15 -6
  119. package/dist/server/hono.js +30 -25
  120. package/dist/server/index.d.ts +3 -10
  121. package/dist/server/index.js +71 -38
  122. package/dist/{spa-DuVB5O7S.d.ts → spa-BLlMc0eI.d.ts} +38 -5
  123. package/dist/system-canvas-BLuWd69H.d.ts +183 -0
  124. package/dist/system-canvas.d.ts +2 -168
  125. package/dist/tailwind-core.css +114 -0
  126. package/dist/tailwind.css +3 -7
  127. package/dist/theme-init.js +23 -9
  128. package/dist/theme-init.sha256 +1 -0
  129. package/dist/theme.d.ts +243 -4
  130. package/dist/theme.global.js +356 -89
  131. package/dist/theme.js +337 -67
  132. package/dist/tokens.css +14 -6
  133. package/dist/tokens.dtcg.json +1513 -0
  134. package/dist/tokens.js +29 -14
  135. package/dist/tokens.json +512 -0
  136. package/package.json +51 -13
  137. package/dist/chart.js.map +0 -1
  138. package/dist/elements-charts.js.map +0 -1
  139. package/dist/elements-data.js.map +0 -1
  140. package/dist/elements-forms.js.map +0 -1
  141. package/dist/elements.js.map +0 -1
  142. package/dist/format.js.map +0 -1
  143. package/dist/inbox-client.js.map +0 -1
  144. package/dist/index.js +0 -10260
  145. package/dist/index.js.map +0 -1
  146. package/dist/server/hono.js.map +0 -1
  147. package/dist/server/index.js.map +0 -1
  148. package/dist/split-layout.js.map +0 -1
  149. package/dist/system-canvas.js +0 -2204
  150. package/dist/system-canvas.js.map +0 -1
  151. package/dist/theme.global.js.map +0 -1
  152. package/dist/theme.js.map +0 -1
@@ -1,41 +1,41 @@
1
- var ze=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var x=function(r,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"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},E=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},U,ie,se,V,Se,j,ne,P,F,M,re,Ve;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var we=(M=class{constructor(e,t={}){if(U.set(this,!1),ie.set(this,!1),se.set(this,!1),V.set(this,!1),Se.set(this,Date.now()),j.set(this,!1),ne.set(this,void 0),P.set(this,void 0),F.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:n}=t;x(this,U,!!s,"f"),x(this,ie,!!i,"f"),x(this,se,!!n,"f"),x(this,ne,`${e}`,"f"),x(this,P,null,"f"),x(this,F,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,V,!0,"f")}get target(){return E(this,P,"f")}get currentTarget(){return E(this,P,"f")}get srcElement(){return E(this,P,"f")}get type(){return E(this,ne,"f")}get cancelable(){return E(this,U,"f")}get defaultPrevented(){return E(this,U,"f")&&E(this,V,"f")}get timeStamp(){return E(this,Se,"f")}composedPath(){return E(this,F,"f")?[E(this,P,"f")]:[]}get returnValue(){return!E(this,U,"f")||!E(this,V,"f")}get bubbles(){return E(this,ie,"f")}get composed(){return E(this,se,"f")}get eventPhase(){return E(this,F,"f")?M.AT_TARGET:M.NONE}get cancelBubble(){return E(this,j,"f")}set cancelBubble(e){e&&x(this,j,!0,"f")}stopPropagation(){x(this,j,!0,"f")}get isTrusted(){return!1}},U=new WeakMap,ie=new WeakMap,se=new WeakMap,V=new WeakMap,Se=new WeakMap,j=new WeakMap,ne=new WeakMap,P=new WeakMap,F=new WeakMap,M.NONE=0,M.CAPTURING_PHASE=1,M.AT_TARGET=2,M.BUBBLING_PHASE=3,M);Object.defineProperties(we.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var je=(Ve=class extends we{constructor(e,t={}){super(e,t),re.set(this,void 0),x(this,re,t?.detail??null,"f")}initCustomEvent(e,t,i,s){throw new Error("Method not implemented.")}get detail(){return E(this,re,"f")}},re=new WeakMap,Ve);Object.defineProperties(je.prototype,{detail:b});var C=we,Ae=je;var _;var ai=(_=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},_.STYLE_RULE=1,_.CHARSET_RULE=2,_.IMPORT_RULE=3,_.MEDIA_RULE=4,_.FONT_FACE_RULE=5,_.PAGE_RULE=6,_.NAMESPACE_RULE=10,_.KEYFRAMES_RULE=7,_.KEYFRAME_RULE=8,_.SUPPORTS_RULE=12,_.COUNTER_STYLE_RULE=11,_.FONT_FEATURE_VALUES_RULE=14,_.MARGIN_RULE=9,_);globalThis.Event??=C;globalThis.CustomEvent??=Ae;var $e=Symbol(),Fe=r=>typeof r=="boolean"?r:r?.capture??!1,T={__proto__:null};T.enumerable=!0;Object.freeze(T);var oe=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,i){if(t==null)return;let s=Fe(i)?this.__captureEventListeners:this.__eventListeners,n=s.get(e);if(n===void 0)n=new Map,s.set(e,n);else if(n.has(t))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,i)),n.set(t,o??{})}removeEventListener(e,t,i){if(t==null)return;let s=Fe(i)?this.__captureEventListeners:this.__eventListeners,n=s.get(e);n!==void 0&&(n.delete(t),n.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,n=C.NONE,o=null,a=null,l=null,h=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??a},...T},srcElement:{get(){return e.target},...T},currentTarget:{get(){return l},...T},eventPhase:{get(){return n},...T},composedPath:{value:()=>t,...T},stopPropagation:{value:()=>{i=!0,h.call(e)},...T},stopImmediatePropagation:{value:()=>{s=!0,d.call(e)},...T}});let c=(u,S,N)=>{typeof u=="function"?u(e):typeof u?.handleEvent=="function"&&u.handleEvent(e),S.once&&N.delete(u)},m=()=>(l=null,n=C.NONE,!e.defaultPrevented),f=t.slice().reverse();o=!this.__host||!e.composed?this:null;let A=u=>{for(a=this;a.__host&&u.includes(a.__host);)a=a.__host};for(let u of f){!o&&(!a||a===u.__host)&&A(f.slice(f.indexOf(u))),l=u,n=u===e.target?C.AT_TARGET:C.CAPTURING_PHASE;let S=u.__captureEventListeners.get(e.type);if(S){for(let[N,_e]of S)if(c(N,_e,S),s)return m()}if(i)return m()}let z=e.bubbles?t:[this];a=null;for(let u of z){!o&&(!a||u===a.__host)&&A(z.slice(0,z.indexOf(u)+1)),l=u,n=u===e.target?C.AT_TARGET:C.BUBBLING_PHASE;let S=u.__eventListeners.get(e.type);if(S){for(let[N,_e]of S)if(c(N,_e,S),s)return m()}if(i)return m()}return m()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Ke,Tt]}};var qe=new WeakMap,q=r=>{let e=qe.get(r);return e===void 0&&qe.set(r,e=new Map),e},G=class extends oe{getRootNode(e){return e?.composed?xe:this.__host?.__shadowRoot??xe}};var Ge=class extends G{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Ke=new Ge,xe=Ke;var Xe=class extends G{constructor(e){if(super(),e!==$e)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ae,customElements:Te,document:xe,Document:Ge,Element:Ye,EventTarget:oe,HTMLElement:Ze,Node:G,ShadowRoot:Je,window:this,Window:Xe})}};var Ye=class extends G{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(q(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){q(this).set(e,String(t))}removeAttribute(e){q(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 q(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new Je($e,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 ze(this);return this.__internals=e,e}getAttribute(e){return q(this).get(e)??null}};var Ze=class extends Ye{},Ce=Ze;var Je=class extends G{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new Ce,"localName",{get(){return"lit-server-root"}});function $t(){let r,e;return{promise:new Promise((i,s)=>{r=i,e=s}),resolve:r,reject:e}}var ae=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=$t(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Ct=ae;var Te=new Ct,Tt=new Xe($e);var K=globalThis,he=K.ShadowRoot&&(K.ShadyCSS===void 0||K.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol(),Qe=new WeakMap,le=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==et)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(he&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=Qe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Qe.set(t,e))}return e}toString(){return this.cssText}},tt=r=>new le(typeof r=="string"?r:r+"",void 0,et);var it=(r,e)=>{if(he)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),s=K.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,r.appendChild(i)}},Le=he||K.CSSStyleSheet===void 0?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return tt(t)})(r):r;var{is:Lt,defineProperty:Mt,getOwnPropertyDescriptor:Rt,getOwnPropertyNames:kt,getOwnPropertySymbols:Nt,getPrototypeOf:Pt}=Object,Y=globalThis;Y.customElements??=Te;var st=Y.trustedTypes,Ot=st?st.emptyScript:"",Ht=Y.reactiveElementPolyfillSupport,X=(r,e)=>r,Me={toAttribute(r,e){switch(e){case Boolean:r=r?Ot:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},rt=(r,e)=>!Lt(r,e),nt={attribute:!0,type:String,converter:Me,reflect:!1,useDefault:!1,hasChanged:rt};Symbol.metadata??=Symbol("metadata"),Y.litPropertyMetadata??=new WeakMap;var L=class extends(globalThis.HTMLElement??Ce){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=nt){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&&Mt(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:n}=Rt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);n?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??nt}static _$Ei(){if(this.hasOwnProperty(X("elementProperties")))return;let e=Pt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(X("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X("properties"))){let t=this.properties,i=[...kt(t),...Nt(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(Le(s))}else e!==void 0&&t.push(Le(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 it(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 n=(i.converter?.toAttribute!==void 0?i.converter:Me).toAttribute(t,i.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let n=i.getPropertyOptions(s),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:Me;this._$Em=s;let a=o.fromAttribute(t,n.type);this[s]=a??this._$Ej?.get(s)??a,this._$Em=null}}requestUpdate(e,t,i,s=!1,n){if(e!==void 0){let o=this.constructor;if(s===!1&&(n=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??rt)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==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,n]of this._$Ep)this[s]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,n]of i){let{wrapped:o}=n,a=this[s];o!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,n,a)}}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){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[X("elementProperties")]=new Map,L[X("finalized")]=new Map,Ht?.({ReactiveElement:L}),(Y.reactiveElementVersions??=[]).push("2.1.2");var de=globalThis,ot=r=>r,ce=de.trustedTypes,at=ce?ce.createPolicy("lit-html",{createHTML:r=>r}):void 0,pt="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+R,Bt=`<${mt}>`,B=de.document===void 0?{createTreeWalker:()=>({})}:document,J=()=>B.createComment(""),Q=r=>r===null||typeof r!="object"&&typeof r!="function",Be=Array.isArray,It=r=>Be(r)||typeof r?.[Symbol.iterator]=="function",Re=`[
3
- \f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,O=RegExp(`>|${Re}(?:([^\\s"'>=/]+)(${Re}*=${Re}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,Ie=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),y=Ie(1),w=Ie(2),Wi=Ie(3),I=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ut=new WeakMap,H=B.createTreeWalker(B,129);function bt(r,e){if(!Be(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(e):e}var Ut=(r,e)=>{let t=r.length-1,i=[],s,n=e===2?"<svg>":e===3?"<math>":"",o=Z;for(let a=0;a<t;a++){let l=r[a],h,d,c=-1,m=0;for(;m<l.length&&(o.lastIndex=m,d=o.exec(l),d!==null);)m=o.lastIndex,o===Z?d[1]==="!--"?o=lt:d[1]!==void 0?o=ht:d[2]!==void 0?(ft.test(d[2])&&(s=RegExp("</"+d[2],"g")),o=O):d[3]!==void 0&&(o=O):o===O?d[0]===">"?(o=s??Z,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?O:d[3]==='"'?dt:ct):o===dt||o===ct?o=O:o===lt||o===ht?o=Z:(o=O,s=void 0);let f=o===O&&r[a+1].startsWith("/>")?" ":"";n+=o===Z?l+Bt:c>=0?(i.push(h),l.slice(0,c)+pt+l.slice(c)+R+f):l+R+(c===-2?a:f)}return[bt(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},ee=class r{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0,a=e.length-1,l=this.parts,[h,d]=Ut(e,t);if(this.el=r.createElement(h,i),H.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=H.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(pt)){let m=d[o++],f=s.getAttribute(c).split(R),A=/([.?@])?(.*)/.exec(m);l.push({type:1,index:n,name:A[2],strings:f,ctor:A[1]==="."?Ne:A[1]==="?"?Pe:A[1]==="@"?Oe:W}),s.removeAttribute(c)}else c.startsWith(R)&&(l.push({type:6,index:n}),s.removeAttribute(c));if(ft.test(s.tagName)){let c=s.textContent.split(R),m=c.length-1;if(m>0){s.textContent=ce?ce.emptyScript:"";for(let f=0;f<m;f++)s.append(c[f],J()),H.nextNode(),l.push({type:2,index:++n});s.append(c[m],J())}}}else if(s.nodeType===8)if(s.data===mt)l.push({type:2,index:n});else{let c=-1;for(;(c=s.data.indexOf(R,c+1))!==-1;)l.push({type:7,index:n}),c+=R.length-1}n++}}static createElement(e,t){let i=B.createElement("template");return i.innerHTML=e,i}};function D(r,e,t=r,i){if(e===I)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,n=Q(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=D(r,s._$AS(r,e.values),s,i)),e}var ke=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??B).importNode(t,!0);H.currentNode=s;let n=H.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new te(n,n.nextSibling,this,e):l.type===1?h=new l.ctor(n,l.name,l.strings,this,e):l.type===6&&(h=new He(n,this,e)),this._$AV.push(h),l=i[++a]}o!==l?.index&&(n=H.nextNode(),o++)}return H.currentNode=B,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++}},te=class r{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=D(this,e,t),Q(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):It(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==p&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(B.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=ee.createElement(bt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let n=new ke(s,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=ut.get(e.strings);return t===void 0&&ut.set(e.strings,t=new ee(e)),t}k(e){Be(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let n of e)s===t.length?t.push(i=new r(this.O(J()),this.O(J()),this,this.options)):i=t[s],i._$AI(n),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=ot(e).nextSibling;ot(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},W=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,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 n=this.strings,o=!1;if(n===void 0)e=D(this,e,t,0),o=!Q(e)||e!==this._$AH&&e!==I,o&&(this._$AH=e);else{let a=e,l,h;for(e=n[0],l=0;l<n.length-1;l++)h=D(this,a[i+l],t,l),h===I&&(h=this._$AH[l]),o||=!Q(h)||h!==this._$AH[l],h===p?e=p:e!==p&&(e+=(h??"")+n[l+1]),this._$AH[l]=h}o&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ne=class extends W{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Pe=class extends W{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Oe=class extends W{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=D(this,e,t,0)??p)===I)return;let i=this._$AH,s=e===p&&i!==p||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==p&&(i===p||s);s&&this.element.removeEventListener(this.name,this,i),n&&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)}},He=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){D(this,e)}};var Dt=de.litHtmlPolyfillSupport;Dt?.(ee,te),(de.litHtmlVersions??=[]).push("3.3.3");var vt=(r,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let n=t?.renderBefore??null;i._$litPart$=s=new te(e.insertBefore(J(),n),n,void 0,t??{})}return s._$AI(r),s};var Ue=globalThis,k=class extends L{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=vt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};k._$litElement$=!0,k.finalized=!0,Ue.litElementHydrateSupport?.({LitElement:k});var Wt=Ue.litElementPolyfillSupport;Wt?.({LitElement:k});(Ue.litElementVersions??=[]).push("4.2.2");var v=class extends k{createRenderRoot(){return this}};function $(r){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r,{once:!0}):r()}function g(r,e){customElements.get(r)||customElements.define(r,e)}var zt='<svg width="12" height="12" 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>',ue=class extends v{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.#r().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#c(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.#r()){let n=t.has(this.#c(s))&&!(this.single&&i);n&&(i=!0),s.setAttribute("aria-pressed",String(n))}}connectedCallback(){super.connectedCallback(),$(()=>this.#o())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#h()}#r(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#l(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()}#c(e){return e.getAttribute("value")??this.#l(e)}#o(){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.#h(),this.#s(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#s(),this.#a()}),this.#a()}#a(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#h(){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))}#s(){for(let e of this.#r())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.#l(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?`Remove ${t}`:"Remove"),i.innerHTML=zt,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 o=i.parentElement,a=this.#c(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:a}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let n=s.getAttribute("aria-pressed")!=="true";if(n&&this.single)for(let o of this.#r())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(n)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};g("nish-chip-group",ue);var gt=(r,e)=>{let t=e.trim().toLowerCase();return t?r.label.toLowerCase().includes(t)||(r.hint?.toLowerCase().includes(t)??!1):!0};var Ft=0,Et="http://www.w3.org/2000/svg",qt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function yt(r){let e=document.createElementNS(Et,"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(Et,"path");return t.setAttribute("d",r),e.append(t),e}var pe=class extends v{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=++Ft;#i=null;#t=null;#n=null;#r=null;#l=null;#c=null;#o=!1;#a="";#h=!1;#s=-1;#d;#p=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="No matches",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.#u();return}this.#p||(this.#p=!0,$(()=>{this.#p=!1,this.isConnected&&this.#f()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#d),this.#m()}#f(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(l=>({value:l.value,label:l.textContent?.trim()??l.value,hint:l.dataset.hint||void 0,disabled:l.disabled||void 0}));for(let l of e)l.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",l=>this.#R(l)),s.addEventListener("focus",()=>this.#A()),s.addEventListener("click",()=>this.#A()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#u())}),s.addEventListener("change",l=>l.stopPropagation());let n=document.createElement("button");n.type="button",n.className="nish-icon-btn nish-combobox-clear",n.setAttribute("aria-label","Clear"),n.tabIndex=-1,n.hidden=!0,n.append(yt("M18 6 6 18M6 6l12 12")),n.addEventListener("mousedown",l=>l.preventDefault()),n.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=qt;let a=document.createElement("input");a.type="hidden",i.append(s,n,o),this.append(i,a),this.#i=i,this.#t=s,this.#n=n,this.#r=o,this.#c=a,this.#u()}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.#u()}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.#a:this.#b?.label??this.value??""}get#v(){let e=this.filter??gt;return(this.#h?this.options.filter(i=>e(i,this.#a)):this.options).slice(0,50)}#T(){this.#s>=this.#v.length&&(this.#s=-1)}#E(){this.#h=!1,this.#a=""}#A(){if(this.#o||this.disabled||!this.#t)return;this.#o=!0;let e=this.#b,t=e?this.#v.findIndex(i=>i.value===e.value):-1;this.#s=t>=0?t:-1,this.#u()}#m(){this.#o=!1,this.#s=-1,this.#l?.remove(),this.#l=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#r&&(this.#r.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let n=e;for(let o=0;o<s;o++)if(n=(n+t+s)%s,!i[n].disabled)return n;return-1}#_(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#g(e,t){this.value=e,this.#E(),this.#u();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.#a.trim()!==""||!this.#w?!1:(this.#m(),this.#g(null,null),!0)}#L(){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}#M(e){this.#a=e,this.#h=!0,this.#o=!0,this.allowCustom||e.trim()===""?this.#s=-1:this.#s=this.#v.findIndex(t=>!t.disabled),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#u()}#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.#o){this.#S(this.#s<0?this.#_(i):this.#y(this.#s,i));break}else{this.#o=!0;let s=this.#b,n=s?t.findIndex(o=>o.value===s.value):-1;this.#s=n>=0?n:this.#_(i)}this.#u();break}case"Home":case"End":this.#o&&(e.preventDefault(),this.#S(this.#_(e.key==="Home"?1:-1)));break;case"Enter":this.#o&&this.#s>=0&&t[this.#s]?(e.preventDefault(),this.#x(t[this.#s])):(this.#$()||this.#L()||this.#o)&&e.preventDefault();break;case"Escape":this.#o?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#u()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#u());break;case"Tab":this.#m();break}}#u(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#r)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#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.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.#o){this.#l&&this.#m();return}this.#k(e,t,this.#r)}#S(e){let t=this.#s;this.#s=e;let i=this.#l,s=this.#t;if(!i||!s||!this.#o){this.#u();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let n=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!n){t!==e?this.#u():s.removeAttribute("aria-activedescendant");return}n.dataset.active="",s.setAttribute("aria-activedescendant",n.id),n.scrollIntoView?.({block:"nearest"})}#k(e,t,i){let s=`nish-cb-list-${this.#e}`,n=this.#v,o=this.#b,a=this.#l;if(!a){a=document.createElement("ul"),a.id=s,a.className="nish-combobox-list",a.setAttribute("role","listbox");let h=d=>{let c=d.target?.closest("li[data-index]");if(!c||!a.contains(c))return null;let m=Number(c.dataset.index),f=this.#v[m];return f?{o:f,i:m}:null};a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("mousemove",d=>{let c=h(d);c&&!c.o.disabled&&this.#s!==c.i&&this.#S(c.i)}),a.addEventListener("click",d=>{let c=h(d);c&&this.#x(c.o)}),this.#l=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let l=n.map((h,d)=>{let c=document.createElement("li");c.id=`${s}-opt-${d}`,c.className="nish-combobox-option",c.setAttribute("role","option"),c.dataset.index=String(d),c.setAttribute("aria-selected",String(o?.value===h.value)),h.disabled&&c.setAttribute("aria-disabled","true"),d===this.#s&&(c.dataset.active="");let m=document.createElement("span");if(m.className="nish-combobox-label",m.textContent=h.label,c.append(m),h.hint){let f=document.createElement("span");f.className="nish-combobox-hint",f.textContent=h.hint,c.append(f)}return o?.value===h.value&&c.append(yt("M20 6 9 17l-5-5")),c});if(this.loading){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-loading";let d=document.createElement("span");d.className="nish-spinner nish-spinner--sm",d.setAttribute("aria-hidden","true"),h.append(d,document.createTextNode("Searching\u2026")),l.push(h)}else if(n.length===0){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-empty",h.textContent=this.emptyText,l.push(h)}a.replaceChildren(...l),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",s),this.#s>=0&&n[this.#s]?e.setAttribute("aria-activedescendant",`${s}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?"Searching\u2026":n.length===0?this.emptyText:`${n.length} ${n.length===1?"result":"results"}`,this.#N(a,e),a.querySelector(`[data-index="${this.#s}"]`)?.scrollIntoView?.({block:"nearest"})}#N(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,n=window.innerHeight-i.bottom;s>n&&i.top>n&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};g("nish-combobox",pe);var _t=1500,St="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",Gt=w`<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>`,Kt=w`<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 Xt(r){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(r),!0}catch{}let e=document.createElement("textarea");e.value=r,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 me=class extends v{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="Copy",this.copiedLabel="Copied",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 Xt(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},_t)}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()}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},_t)}render(){let e=this.copied?this.copiedLabel:this.manual?"Press Ctrl+C":this.label,t=this.copied?Kt:Gt;return y`${this.icon?y`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${e} title=${e} ?data-copied=${this.copied} @click=${()=>this.#t()}>
5
- ${t}
6
- </button>`:y`<button type="button" class="nish-btn nish-btn--sm nish-copy-btn" ?data-copied=${this.copied} @click=${()=>this.#t()}>
7
- ${t}${e}
8
- </button>`}<span role="status" aria-live="polite" style=${St}>${this.copied?this.copiedLabel:this.manual?"Press Ctrl+C":p}</span>${this.manual&&this.value!=null?y`<textarea data-copy-source readonly tabindex="-1" aria-label=${this.value} style=${St} .value=${this.value}></textarea>`:p}`}};g("nish-copy-button",me);var Yt=0,fe=class extends v{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-${++Yt}`;#i=null;#t=null;#n=null;#r=null;#l="";#c=!1;constructor(){super(),this.optional=!1,this.layout="stack"}connectedCallback(){super.connectedCallback(),$(()=>this.#o())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#r?.disconnect(),this.#r=null,this.#i=null,this.#t=null}updated(e){this.#s()}#o(){if(!this.isConnected||this.#i)return;let e=this.querySelector(":scope > div.nish-field");if(!e){let t=this.firstElementChild;if(!t){this.#r||(this.#r=new MutationObserver(()=>{this.firstElementChild&&(this.#r?.disconnect(),this.#r=null,this.#o())}),this.#r.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.#l=(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??"",n=!!this.error,o=!!this.hint&&!n,a=e.querySelector(":scope > label.nish-field-label");if(this.label){if(a||(a=document.createElement("label"),a.className="nish-field-label",e.prepend(a)),s&&(a.htmlFor=s),a.textContent=this.label,this.optional){let d=document.createElement("span");d.className="nish-optional",d.textContent="Optional",a.appendChild(d)}}else a?.remove();let l=`${this.#e}-hint`,h=`${this.#e}-error`;if(this.#d(e,"hint",o?this.hint:"",l),this.#d(e,"error",n?this.error:"",h),i){let d=[this.#l,n?h:o?l:""].filter(Boolean).join(" ");d?i.setAttribute("aria-describedby",d):i.removeAttribute("aria-describedby"),n?(i.setAttribute("aria-invalid","true"),this.#c=!0):this.#c&&(i.removeAttribute("aria-invalid"),this.#c=!1)}}#d(e,t,i,s){let n=e.querySelector(`:scope > small.nish-${t}`);if(!i){n?.remove();return}n||(n=document.createElement("small"),n.className=`nish-${t}`,t==="error"&&n.setAttribute("role","alert"),e.appendChild(n)),n.id=s,n.textContent!==i&&(n.textContent=i)}};g("nish-field",fe);var Zt=r=>w`<svg width=${r} height=${r} 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>`,Jt=w`<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>`,be=class extends v{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.placeholder="Search",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=["nish-search"];return(this.size==="xs"||this.size==="sm")&&e.push(`nish-search--${this.size}`),this.variant==="bare"&&e.push("nish-search--bare"),y`<label class=${e.join(" ")}>
9
- ${Zt(this.size==="md"||!this.size?16:14)}
1
+ var Ge=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,F,xe,G,le,I,q,k,he,qe;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),F.set(this,!1),xe.set(this,Date.now()),G.set(this,!1),le.set(this,void 0),I.set(this,void 0),q.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,q,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){T(this,F,!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,F,"f")}get timeStamp(){return _(this,xe,"f")}composedPath(){return _(this,q,"f")?[_(this,I,"f")]:[]}get returnValue(){return!_(this,V,"f")||!_(this,F,"f")}get bubbles(){return _(this,oe,"f")}get composed(){return _(this,ae,"f")}get eventPhase(){return _(this,q,"f")?k.AT_TARGET:k.NONE}get cancelBubble(){return _(this,G,"f")}set cancelBubble(e){e&&T(this,G,!0,"f")}stopPropagation(){T(this,G,!0,"f")}get isTrusted(){return!1}},V=new WeakMap,oe=new WeakMap,ae=new WeakMap,F=new WeakMap,xe=new WeakMap,G=new WeakMap,le=new WeakMap,I=new WeakMap,q=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 Ke=(qe=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,qe);Object.defineProperties(Ke.prototype,{detail:g});var M=$e,Ce=Ke;var w;var Ai=(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??=Ce;var Le=Symbol(),Ye=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=Ye(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,i)),r.set(t,o??{})}removeEventListener(e,t,i){if(t==null)return;let s=Ye(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,o=null,l=null,a=null,u=e.stopPropagation,h=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return a},...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=()=>(a=null,r=M.NONE,!e.defaultPrevented),v=t.slice().reverse();o=!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){!o&&(!l||l===b.__host)&&f(v.slice(v.indexOf(b))),a=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 C=e.bubbles?t:[this];l=null;for(let b of C){!o&&(!l||b===l.__host)&&f(C.slice(0,C.indexOf(b)+1)),a=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,Je,Ut]}};var Xe=new WeakMap,K=n=>{let e=Xe.get(n);return e===void 0&&Xe.set(n,e=new Map),e},Y=class extends ce{getRootNode(e){return e?.composed?Te:this.__host?.__shadowRoot??Te}};var Ze=class extends Y{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Je=new Ze,Te=Je;var Qe=class extends Y{constructor(e){if(super(),e!==Le)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ue,customElements:Re,document:Te,Document:Ze,Element:et,EventTarget:ce,HTMLElement:tt,Node:Y,ShadowRoot:it,window:this,Window:Qe})}};var et=class extends Y{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(K(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){K(this).set(e,String(t))}removeAttribute(e){K(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return K(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new it(Le,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new Ge(this);return this.__internals=e,e}getAttribute(e){return K(this).get(e)??null}};var tt=class extends et{},Me=tt;var it=class extends Y{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new Me,"localName",{get(){return"lit-server-root"}});function It(){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
+ 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=It(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Bt=ue;var Re=new Bt,Ut=new Qe(Le);var X=globalThis,pe=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nt=Symbol(),st=new WeakMap,de=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==nt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(pe&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=st.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&st.set(t,e))}return e}toString(){return this.cssText}},rt=n=>new de(typeof n=="string"?n:n+"",void 0,nt);var ot=(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=X.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Ne=pe||X.CSSStyleSheet===void 0?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return rt(t)})(n):n;var{is:Dt,defineProperty:zt,getOwnPropertyDescriptor:Vt,getOwnPropertyNames:Wt,getOwnPropertySymbols:jt,getPrototypeOf:Ft}=Object,J=globalThis;J.customElements??=Re;var at=J.trustedTypes,Gt=at?at.emptyScript:"",qt=J.reactiveElementPolyfillSupport,Z=(n,e)=>n,ke={toAttribute(n,e){switch(e){case Boolean:n=n?Gt: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}},ht=(n,e)=>!Dt(n,e),lt={attribute:!0,type:String,converter:ke,reflect:!1,useDefault:!1,hasChanged:ht};Symbol.metadata??=Symbol("metadata"),J.litPropertyMetadata??=new WeakMap;var N=class extends(globalThis.HTMLElement??Me){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=lt){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&&zt(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:r}=Vt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let l=s?.call(this);r?.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??lt}static _$Ei(){if(this.hasOwnProperty(Z("elementProperties")))return;let e=Ft(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){let t=this.properties,i=[...Wt(t),...jt(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(Ne(s))}else e!==void 0&&t.push(Ne(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 ot(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:ke).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),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ke;this._$Em=s;let l=o.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 o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??ht)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$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},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||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:o}=r,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,r,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(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[Z("elementProperties")]=new Map,N[Z("finalized")]=new Map,qt?.({ReactiveElement:N}),(J.reactiveElementVersions??=[]).push("2.1.2");var fe=globalThis,ct=n=>n,me=fe.trustedTypes,ut=me?me.createPolicy("lit-html",{createHTML:n=>n}):void 0,vt="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+P,Kt=`<${gt}>`,D=fe.document===void 0?{createTreeWalker:()=>({})}:document,ee=()=>D.createComment(""),te=n=>n===null||typeof n!="object"&&typeof n!="function",De=Array.isArray,Yt=n=>De(n)||typeof n?.[Symbol.iterator]=="function",Pe=`[
3
+ \f\r]`,Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,pt=/>/g,B=RegExp(`>|${Pe}(?:([^\\s"'>=/]+)(${Pe}*=${Pe}*(?:[^
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,ft=/"/g,Et=/^(?:script|style|textarea|title)$/i,ze=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),S=ze(1),$=ze(2),ns=ze(3),z=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),bt=new WeakMap,U=D.createTreeWalker(D,129);function yt(n,e){if(!De(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ut!==void 0?ut.createHTML(e):e}var Xt=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let l=0;l<t;l++){let a=n[l],u,h,c=-1,d=0;for(;d<a.length&&(o.lastIndex=d,h=o.exec(a),h!==null);)d=o.lastIndex,o===Q?h[1]==="!--"?o=dt:h[1]!==void 0?o=pt:h[2]!==void 0?(Et.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=B):h[3]!==void 0&&(o=B):o===B?h[0]===">"?(o=s??Q,c=-1):h[1]===void 0?c=-2:(c=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?B:h[3]==='"'?ft:mt):o===ft||o===mt?o=B:o===dt||o===pt?o=Q:(o=B,s=void 0);let v=o===B&&n[l+1].startsWith("/>")?" ":"";r+=o===Q?a+Kt:c>=0?(i.push(u),a.slice(0,c)+vt+a.slice(c)+P+v):a+P+(c===-2?l:v)}return[yt(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},ie=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[u,h]=Xt(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&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(vt)){let d=h[o++],v=s.getAttribute(c).split(P),f=/([.?@])?(.*)/.exec(d);a.push({type:1,index:r,name:f[2],strings:v,ctor:f[1]==="."?He:f[1]==="?"?Ie:f[1]==="@"?Be:j}),s.removeAttribute(c)}else c.startsWith(P)&&(a.push({type:6,index:r}),s.removeAttribute(c));if(Et.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],ee()),U.nextNode(),a.push({type:2,index:++r});s.append(c[d],ee())}}}else if(s.nodeType===8)if(s.data===gt)a.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)a.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=te(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 Oe=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(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new se(r,r.nextSibling,this,e):a.type===1?u=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(u=new Ue(r,this,e)),this._$AV.push(u),a=i[++l]}o!==a?.index&&(r=U.nextNode(),o++)}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++}},se=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),te(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):Yt(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&&te(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=ie.createElement(yt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Oe(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=bt.get(e.strings);return t===void 0&&bt.set(e.strings,t=new ie(e)),t}k(e){De(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(ee()),this.O(ee()),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=ct(e).nextSibling;ct(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,o=!1;if(r===void 0)e=W(this,e,t,0),o=!te(e)||e!==this._$AH&&e!==z,o&&(this._$AH=e);else{let l=e,a,u;for(e=r[0],a=0;a<r.length-1;a++)u=W(this,l[i+a],t,a),u===z&&(u=this._$AH[a]),o||=!te(u)||u!==this._$AH[a],u===p?e=p:e!==p&&(e+=(u??"")+r[a+1]),this._$AH[a]=u}o&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},He=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Ie=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Be=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)}},Ue=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 Zt=fe.litHtmlPolyfillSupport;Zt?.(ie,se),(fe.litHtmlVersions??=[]).push("3.3.3");var _t=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new se(e.insertBefore(ee(),r),r,void 0,t??{})}return s._$AI(n),s};var Ve=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=_t(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,Ve.litElementHydrateSupport?.({LitElement:O});var Jt=Ve.litElementPolyfillSupport;Jt?.({LitElement:O});(Ve.litElementVersions??=[]).push("4.2.2");var Qt="2.0.1";var ei=Symbol.for("nish-ui.runtime.v1");function ti(){let n=globalThis;return n[ei]??={versions:new Set,slots:{}}}function ii(n){n.versions.add(Qt),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 St=!1;function wt(n,e){let t=ti();return St||(St=!0,ii(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}var At={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",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"};function We(){return wt("element-strings",()=>({values:{...At},listeners:new Set}))}function si(n){let e=We(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(At,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){return We().values}function xt(n){let e=We().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends O{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=xt(()=>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 ne(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 Ct=n=>ni(n,["M18 6 6 18M6 6l12 12"]);var be=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.#a().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.#a()){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.#o()}#o(){if(!this.#e)return;let e=A();for(let t of this.#a()){let i=t.querySelector(":scope > [data-nish-remove]");if(!i)continue;let s=this.#c(t);i.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(i=>{(i.nodeType===Node.TEXT_NODE||i instanceof HTMLElement&&!i.hasAttribute("data-nish-remove"))&&(t+=i.textContent??"")}),t.trim()}#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.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),i=document.createElement("button");i.type="button",i.className="nish-icon-btn nish-icon-btn--xs",i.setAttribute("data-nish-remove",""),i.setAttribute("aria-label",t?A().removeNamed(t):A().remove),i.appendChild(Ct(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 o=i.parentElement,l=this.#r(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};y("nish-chip-group",be);var Tt=(n,e)=>{let t=e.trim().toLowerCase();return t?n.label.toLowerCase().includes(t)||(n.hint?.toLowerCase().includes(t)??!1):!0};var ai=0,Lt="http://www.w3.org/2000/svg",li="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Mt(n){let e=document.createElementNS(Lt,"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(Lt,"path");return t.setAttribute("d",n),e.append(t),e}var ve=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=++ai;#i=null;#t=null;#n=null;#o=null;#a=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(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let i=document.createElement("div");i.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#M(s.value)),s.addEventListener("keydown",a=>this.#R(a)),s.addEventListener("focus",()=>this.#A()),s.addEventListener("click",()=>this.#A()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#p())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(Mt("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=li;let l=document.createElement("input");l.type="hidden",i.append(s,r,o),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#o=o,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??Tt;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.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#o&&(this.#o.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#_(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(o=>o.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.#o)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.#a&&this.#m();return}this.#N(e,t,this.#o)}#S(e){let t=this.#s;this.#s=e;let i=this.#a,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}`,o=this.#v,l=this.#b,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let h=c=>{let d=c.target?.closest("li[data-index]");if(!d||!a.contains(d))return null;let v=Number(d.dataset.index),f=this.#v[v];return f?{o:f,i:v}:null};a.addEventListener("mousedown",c=>c.preventDefault()),a.addEventListener("mousemove",c=>{let d=h(c);d&&!d.o.disabled&&this.#s!==d.i&&this.#S(d.i)}),a.addEventListener("click",c=>{let d=h(c);d&&this.#x(d.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let u=o.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(Mt("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(o.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)}a.replaceChildren(...u),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#s>=0&&o[this.#s]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#k(a,e),a.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",ve);var Rt=1500,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 ge=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},Rt)}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()}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},Rt)}render(){let e=A(),t=this.copiedLabel||e.copied,i=this.copied?t:this.manual?e.copyManual:this.label||e.copy,s=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=${i} title=${i} ?data-copied=${this.copied} @click=${()=>this.#t()}>
5
+ ${s}
6
+ </button>`:S`<button type="button" class="nish-btn nish-btn--sm nish-copy-btn" ?data-copied=${this.copied} @click=${()=>this.#t()}>
7
+ ${s}${i}
8
+ </button>`}<span role="status" aria-live="polite" style=${Nt}>${this.copied?t:this.manual?e.copyManual: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",ge);var di=0,Ee=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-${++di}`;#i=null;#t=null;#n=null;#o=null;#a="";#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.#o?.disconnect(),this.#o=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.#o||(this.#o=new MutationObserver(()=>{this.firstElementChild&&(this.#o?.disconnect(),this.#o=null,this.#r())}),this.#o.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.#a=(this.#l()?.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.#l()&&!this.#h()&&this.#s()}),this.#n.observe(this.#t,{childList:!0,subtree:!0}))}#l(){let e=this.#t;return e?e.localName==="nish-combobox"||e.localName==="nish-search"?e.querySelector("input"):e:null}#h(){let e=this.#l();return!!e&&!!e.id&&this.#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.#l();i&&!i.id&&(i.id=`${this.#e}-control`);let s=i?.id??"",r=!!this.error,o=!!this.hint&&!r,l=e.querySelector(":scope > label.nish-field-label");if(this.label){if(l||(l=document.createElement("label"),l.className="nish-field-label",e.prepend(l)),s&&(l.htmlFor=s),l.textContent=this.label,this.optional){let h=document.createElement("span");h.className="nish-optional",h.textContent=A().optional,l.appendChild(h)}}else l?.remove();let a=`${this.#e}-hint`,u=`${this.#e}-error`;if(this.#u(e,"hint",o?this.hint:"",a),this.#u(e,"error",r?this.error:"",u),i){let h=[this.#a,r?u:o?a:""].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",Ee);var pi=n=>$`<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>`,mi=$`<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>`,ye=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
+ ${pi(this.size==="md"||!this.size?16:14)}
10
10
  <input
11
11
  class="nish-input"
12
12
  type="search"
13
13
  enterkeyhint="search"
14
14
  autocomplete="off"
15
- aria-label=${this.label||(this.closest("nish-field")?p:"Search")}
16
- placeholder=${this.placeholder??""}
15
+ aria-label=${this.label||(this.closest("nish-field")?p:e.search)}
16
+ placeholder=${this.placeholder??e.search}
17
17
  name=${this.name??p}
18
18
  ?disabled=${this.disabled}
19
19
  .value=${this.value??""}
20
- @input=${t=>this.#i(t)}
21
- @keydown=${t=>this.#n(t)}
20
+ @input=${i=>this.#i(i)}
21
+ @keydown=${i=>this.#n(i)}
22
22
  />
23
- ${this.value&&!this.disabled?y`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label="Clear" @click=${()=>this.#t()}>${Jt}</button>`:p}
24
- </label>`}};g("nish-search",be);function De(r){let e=()=>{let n=r.scrollWidth-r.clientWidth;r.dataset.atStart=String(r.scrollLeft<=1),r.dataset.atEnd=String(n<=1||r.scrollLeft>=n-1)};e(),r.addEventListener("scroll",e,{passive:!0});let t,i=()=>{if(t)for(let n of Array.from(r.children))t.observe(n)};typeof ResizeObserver<"u"&&(t=new ResizeObserver(e),t.observe(r),i());let s;return typeof MutationObserver<"u"&&(s=new MutationObserver(()=>{e(),i()}),s.observe(r,{childList:!0})),()=>{r.removeEventListener("scroll",e),t?.disconnect(),s?.disconnect()}}function We(r,e){let t=r.getBoundingClientRect(),i=e.getBoundingClientRect(),s=8;i.left<t.left+s?r.scrollLeft+=i.left-t.left-s:i.right>t.right-s&&(r.scrollLeft+=i.right-t.right+s)}var Qt=0,wt=r=>r.replace(/[^\w-]+/g,"-"),ve=class extends v{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},variant:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0}};#e=null;#i="";#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#p(t)};#l=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")),n;if(e.key==="ArrowRight")n=t[(s+1)%t.length];else if(e.key==="ArrowLeft")n=t[(s-1+t.length)%t.length];else if(e.key==="Home")n=t[0];else if(e.key==="End")n=t[t.length-1];else return;e.preventDefault(),this.#p(n),n.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),$(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#l),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-${++Qt}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#l),this.#t=De(e),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#f(),this.#o()}),this.#o(),this.#f()}#o(){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()}#d(){let e=this.id?document:this,t=Array.from(e.querySelectorAll("[data-tab-panel]"));return this.id?t.filter(i=>i.getAttribute("data-tabs")===this.id):t}#p(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.#d(),s=null;for(let o of t){let a=this.#s(o),l=a===this.value&&!o.disabled;l&&(s=o),o.id||(o.id=`${this.#i}-tab-${wt(a)}`),o.type="button",o.classList.add("nish-tab"),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(l));let h=i.find(d=>d.getAttribute("data-tab-panel")===a);h?(h.id||(h.id=`${this.#i}-panel-${wt(a)}`),o.setAttribute("aria-controls",h.id),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",o.id),h.hidden=!l):o.removeAttribute("aria-controls")}let n=s??t.find(o=>!o.disabled)??null;for(let o of t)o.tabIndex=o===n?0:-1;s&&We(e,s)}};g("nish-tabs",ve);var ge=class extends v{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0},overflow:{type:String,reflect:!0},name:{type:String,reflect:!0}};#e=null;#i=null;#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#l=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(a=>a===document.activeElement),s=t.findIndex(a=>a.getAttribute("aria-checked")==="true"),n=i>=0?i:s,o;if(e.key==="ArrowRight"||e.key==="ArrowDown")o=n<0?t[0]:t[(n+1)%t.length];else if(e.key==="ArrowLeft"||e.key==="ArrowUp")o=n<0?t[t.length-1]:t[(n-1+t.length)%t.length];else if(e.key==="Home")o=t[0];else if(e.key==="End")o=t[t.length-1];else return;e.preventDefault(),this.#d(o),o.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),$(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#l),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#p()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-seg");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,e.classList.add("nish-seg"),e.setAttribute("role","radiogroup"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#l),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#p(),this.#o()}),this.#o(),this.#p()}#o(){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()}#d(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})))}#p(){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=De(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 n of t){let o=this.#s(n)===this.value&&!n.disabled;o&&(i=n),n.type="button",n.setAttribute("role","radio"),n.setAttribute("aria-checked",String(o))}let s=i??t.find(n=>!n.disabled)??null;for(let n of t)n.tabIndex=n===s?0:-1;this.#i&&(this.#i.value=i?this.value:""),i&&this.overflow!=="wrap"&&We(e,i)}};g("nish-segmented",ge);function At(r,e,t,i,s){let n=r.filter(u=>u!=null&&Number.isFinite(u)),o=n.length===0,a=i??(o?0:Math.min(...n)),l=s??(o?1:Math.max(...n)),h=2,d=u=>r.length<=1?e/2:u/(r.length-1)*e,c=u=>l===a?t/2:h+(1-(u-a)/(l-a))*(t-2*h),m=[],f=[];r.forEach((u,S)=>{u==null||!Number.isFinite(u)?(f.length&&m.push(f),f=[]):f.push({x:d(S),y:c(u)})}),f.length&&m.push(f);let A=u=>u.length===1?`M${u[0].x},${u[0].y}h0`:u.map((S,N)=>`${N?"L":"M"}${S.x},${S.y}`).join(""),z=u=>u.length<2?"":`${A(u)}L${u[u.length-1].x},${t}L${u[0].x},${t}Z`;return{empty:o,lines:m.map(A),areas:m.map(z),baseline:`M0,${t/2}H${e}`}}var xt={"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(r){if(r==null)return[];let e=r.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 Ee=class extends v{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:n,areas:o,baseline:a}=At(e,t,i,this.min??void 0,this.max??void 0),l=s?"var(--nish-line-strong)":Object.hasOwn(xt,this.tone)?xt[this.tone]:"var(--nish-chart-1)",h=this.label||"Trend";return y`<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()}>${mi}</button>`:p}
24
+ </label>`}};y("nish-search",ye);function je(n){let e=()=>{let r=n.scrollWidth-n.clientWidth;n.dataset.atStart=String(n.scrollLeft<=1),n.dataset.atEnd=String(r<=1||n.scrollLeft>=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 Fe(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,kt=n=>n.replace(/[^\w-]+/g,"-"),_e=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;#o=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(a=>a===document.activeElement),s=i>=0?i:Math.max(0,t.findIndex(a=>a.getAttribute("aria-selected")==="true")),r,o=ne(this.#e)?"ArrowLeft":"ArrowRight",l=ne(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===o)r=t[(s+1)%t.length];else if(e.key===l)r=t[(s-1+t.length)%t.length];else if(e.key==="Home")r=t[0];else if(e.key==="End")r=t[t.length-1];else return;e.preventDefault(),this.#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.#o),this.#e?.removeEventListener("keydown",this.#a),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.#o),e.addEventListener("keydown",this.#a),this.#t=je(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;for(let o of t){let l=this.#s(o),a=l===this.value&&!o.disabled;a&&(s=o),o.id||(o.id=`${this.#i}-tab-${kt(l)}`),o.type="button",o.classList.add("nish-tab"),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(a));let u=i.find(h=>h.getAttribute("data-tab-panel")===l);u?(u.id||(u.id=`${this.#i}-panel-${kt(l)}`),o.setAttribute("aria-controls",u.id),u.setAttribute("role","tabpanel"),u.setAttribute("aria-labelledby",o.id),u.hidden=!a):o.removeAttribute("aria-controls")}let r=s??t.find(o=>!o.disabled)??null;for(let o of t)o.tabIndex=o===r?0:-1;s&&Fe(e,s)}};y("nish-tabs",_e);var Se=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;#o=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(h=>h===document.activeElement),s=t.findIndex(h=>h.getAttribute("aria-checked")==="true"),r=i>=0?i:s,o,l=ne(this.#e),a=l?"ArrowLeft":"ArrowRight",u=l?"ArrowRight":"ArrowLeft";if(e.key===a||e.key==="ArrowDown")o=r<0?t[0]:t[(r+1)%t.length];else if(e.key===u||e.key==="ArrowUp")o=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")o=t[0];else if(e.key==="End")o=t[t.length-1];else return;e.preventDefault(),this.#u(o),o.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.#o),this.#e?.removeEventListener("keydown",this.#a),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.#o),e.addEventListener("keydown",this.#a),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=je(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 o=this.#s(r)===this.value&&!r.disabled;o&&(i=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(o))}let s=i??t.find(r=>!r.disabled)??null;for(let r of t)r.tabIndex=r===s?0:-1;this.#i&&(this.#i.value=i?this.value:""),i&&this.overflow!=="wrap"&&Fe(e,i)}};y("nish-segmented",Se);function bi(n,e,t,i){let s=t-e||1,r=[],o=-1,l=n[0],a=n[0],u=()=>{l===a?r.push(l):l.x<=a.x?r.push(l,a):r.push(a,l)};for(let h of n){let c=Math.min(i-1,Math.max(0,Math.floor((h.x-e)/s*i)));c!==o?(o>=0&&u(),o=c,l=h,a=h):(h.y<l.y&&(l=h),h.y>a.y&&(a=h))}return u(),r}function Pt(n,e,t,i,s){let r=n.filter(m=>m!=null&&Number.isFinite(m)),o=r.length===0,l=1/0,a=-1/0;for(let m of r)m<l&&(l=m),m>a&&(a=m);let u=i??(o?0:l),h=s??(o?1:a),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]=bi(f[m],0,e,b));let x=m=>m.length===1?`M${m[0].x},${m[0].y}h0`:m.map((re,Ht)=>`${Ht?"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:o,lines:f.map(x),areas:f.map(H),baseline:`M0,${t/2}H${e}`}}var Ot={"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 vi(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 we=class extends E{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>vi(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:o,baseline:l}=Pt(e,t,i,this.min??void 0,this.max??void 0),a=s?"var(--nish-line-strong)":Object.hasOwn(Ot,this.tone)?Ot[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
- aria-label=${s?`${h}: no data`:h}
27
+ aria-label=${s?u.noDataNamed(h):h}
28
28
  width=${t}
29
29
  height=${i}
30
30
  viewBox="0 0 ${t} ${i}"
31
31
  preserveAspectRatio="none"
32
- style="color:${l}"
32
+ style="color:${a}"
33
33
  >
34
- ${s?w`<path d=${a} stroke="currentColor" stroke-width="1.5" stroke-dasharray="3 3" vector-effect="non-scaling-stroke"></path>`:w`${this.fill?o.map(d=>w`<path d=${d} fill="currentColor" fill-opacity="0.15"></path>`):p}${n.map(d=>w`<path d=${d} fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path>`)}`}
35
- </svg>`}};g("nish-sparkline",Ee);var ti=0,ye=class extends v{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}};#e=`nish-switch-${++ti}`;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,t=e?y`<span style="min-width:0">
34
+ ${s?$`<path d=${l} stroke="currentColor" stroke-width="1.5" stroke-dasharray="3 3" vector-effect="non-scaling-stroke"></path>`:$`${this.fill?o.map(c=>$`<path d=${c} fill="currentColor" fill-opacity="0.15"></path>`):p}${r.map(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",we);var gi=0,Ae=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}};#e=`nish-switch-${++gi}`;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,t=e?S`<span style="min-width:0">
36
36
  <span id=${`${this.#e}-label`} style="display:block;line-height:1.375">${this.label}</span>
37
- ${this.description?y`<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
- </span>`:p,i=this.labelSide==="start",s=y`<button
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
+ </span>`:p,i=this.labelSide==="start",s=S`<button
39
39
  type="button"
40
40
  class=${this.size==="sm"?"nish-switch nish-switch--sm":"nish-switch"}
41
41
  role="switch"
@@ -44,10 +44,10 @@ Make sure to test your application with a production build as repeat registratio
44
44
  aria-describedby=${e&&this.description?`${this.#e}-desc`:p}
45
45
  ?disabled=${this.disabled}
46
46
  @click=${()=>this.#i()}
47
- ></button>`;return y`<label class="nish-check-row" style=${i?"justify-content:space-between":p}>
47
+ ></button>`;return S`<label class="nish-check-row" style=${i?"justify-content:space-between":p}>
48
48
  ${i?t:p}${s}${i?p:t}
49
- ${this.name?y`<input type="hidden" name=${this.name} value="on" ?disabled=${!this.checked||this.disabled} />`:p}
50
- </label>`}};g("nish-switch",ye);export{ue as NishChipGroup,pe as NishCombobox,me as NishCopyButton,v as NishElement,fe as NishField,be as NishSearch,ge as NishSegmented,Ee as NishSparkline,ye as NishSwitch,ve as NishTabs,g as define};
49
+ ${this.name?S`<input type="hidden" name=${this.name} value="on" ?disabled=${!this.checked||this.disabled} />`:p}
50
+ </label>`}};y("nish-switch",Ae);export{be as NishChipGroup,ve as NishCombobox,ge as NishCopyButton,E as NishElement,Ee as NishField,ye as NishSearch,Se as NishSegmented,we as NishSparkline,Ae as NishSwitch,_e as NishTabs,si as configureStrings,y as define};
51
51
  /*! Bundled license information:
52
52
 
53
53
  @lit-labs/ssr-dom-shim/lib/element-internals.js:
@@ -89,4 +89,3 @@ lit-html/node/is-server.js:
89
89
  * SPDX-License-Identifier: BSD-3-Clause
90
90
  *)
91
91
  */
92
- //# sourceMappingURL=elements-forms.js.map
@@ -8,6 +8,77 @@ export declare class NishElement extends HTMLElement {
8
8
  requestUpdate(): void;
9
9
  }
10
10
 
11
+ /** The words the custom elements show. Key names match `NishStrings` (the React side) where the
12
+ * same text exists there. */
13
+ export interface NishElementStrings {
14
+ /** nish-command-palette, nish-filter-bar: close button label. */
15
+ close: string;
16
+ /** nish-search (default placeholder and aria-label), nish-command-palette (dialog name). */
17
+ search: string;
18
+ /** nish-command-palette: input placeholder and its accessible name. */
19
+ searchPlaceholder: string;
20
+ /** nish-command-palette: nothing found. */
21
+ noResults: string;
22
+ /** nish-command-palette: listbox label. */
23
+ results: string;
24
+ /** nish-command-palette, nish-combobox: live-region text for a count of matches. */
25
+ resultCount: (count: number) => string;
26
+ /** nish-combobox: empty list. */
27
+ noMatches: string;
28
+ /** nish-combobox: loading row and live-region text. */
29
+ searching: string;
30
+ /** nish-search, nish-combobox, nish-filter-bar: clear button. */
31
+ clear: string;
32
+ /** nish-copy-button: idle label. */
33
+ copy: string;
34
+ /** nish-copy-button: label after copying. */
35
+ copied: string;
36
+ /** nish-copy-button: label while the clipboard is refused and the text is selected. */
37
+ copyManual: string;
38
+ /** nish-field: tag for a non-required field. */
39
+ optional: string;
40
+ /** nish-bottom-nav, nish-nav-rail, nish-section-nav: default landmark label. */
41
+ sections: string;
42
+ /** nish-filter-bar: sheet title and the button that opens it. */
43
+ filters: string;
44
+ /** nish-filter-bar: wide-layout clear button. */
45
+ clearFilters: string;
46
+ /** nish-filter-bar: sheet button that closes it. */
47
+ showResults: string;
48
+ /** nish-filter-bar: label of the active-filter count badge. */
49
+ activeCount: (count: number) => string;
50
+ /** nish-chip-group: remove button without a chip name. */
51
+ remove: string;
52
+ /** nish-chip-group: remove button for a named chip. */
53
+ removeNamed: (name: string) => string;
54
+ /** nish-split: divider label in a row split. */
55
+ resizeColumns: string;
56
+ /** nish-split: divider label in a column split. */
57
+ resizeRows: string;
58
+ /** nish-line-chart: legend landmark. */
59
+ legend: string;
60
+ /** nish-line-chart, nish-bar-chart: text of the empty state. */
61
+ noDataYet: string;
62
+ /** nish-line-chart, nish-bar-chart, nish-sparkline: accessible name of a chart with no data. */
63
+ noDataNamed: (label: string) => string;
64
+ /** nish-line-chart: name of a series without a label (1-based position). */
65
+ seriesNumber: (n: number) => string;
66
+ /** nish-sparkline: accessible name when no `label` is set. */
67
+ trend: string;
68
+ /** nish-theme-toggle: name of the system mode. */
69
+ themeSystem: string;
70
+ /** nish-theme-toggle: name of the light mode. */
71
+ themeLight: string;
72
+ /** nish-theme-toggle: name of the dark mode. */
73
+ themeDark: string;
74
+ }
75
+
76
+ /** Set the words the elements show, once, for the whole page (one store shared by every entry and
77
+ * every copy of the package). Keys you leave out keep their current value (English by default).
78
+ * Elements already on the page update at once. A per-element attribute (`label`, `placeholder`,
79
+ * `empty-text`, ...) always wins over a configured string. */
80
+ export declare function configureStrings(partial: Partial<NishElementStrings>): void;
81
+
11
82
  /** Register a custom element unless the tag is already defined. */
12
83
  export declare function define(tag: string, ctor: CustomElementConstructor): void;
13
84