nish-ui 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/chart.d.ts +8 -3
- package/dist/chart.js +2 -417
- package/dist/elements-all.js +71 -70
- package/dist/elements-charts.d.ts +7 -1
- package/dist/elements-charts.js +16 -16
- package/dist/elements-data.d.ts +7 -1
- package/dist/elements-data.js +5 -5
- package/dist/elements-forms.d.ts +7 -1
- package/dist/elements-forms.js +18 -17
- package/dist/elements.d.ts +7 -1
- package/dist/elements.js +4 -4
- package/dist/esm/components/avatar.js +2 -2
- package/dist/esm/components/canvas/legend.js +4 -4
- package/dist/esm/components/canvas/system-canvas.js +24 -1
- package/dist/esm/components/carousel.js +21 -3
- package/dist/esm/components/charts.js +21 -13
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/data-classes.js +5 -4
- package/dist/esm/components/data.js +1 -5
- package/dist/esm/components/date-picker.js +1 -0
- package/dist/esm/components/date-range-picker.js +1 -0
- package/dist/esm/components/display.js +3 -3
- package/dist/esm/components/file-dropzone.js +21 -1
- package/dist/esm/components/filters.js +3 -1
- package/dist/esm/components/flow.js +12 -11
- package/dist/esm/components/forms.js +24 -2
- package/dist/esm/components/hooks.js +20 -17
- package/dist/esm/components/inbox.js +9 -7
- package/dist/esm/components/layout-vars.js +10 -7
- package/dist/esm/components/menu.js +7 -4
- package/dist/esm/components/multi-select.js +7 -4
- package/dist/esm/components/overlay-core.js +31 -10
- package/dist/esm/components/overlay-dialog.js +17 -2
- package/dist/esm/components/pagination.js +4 -1
- package/dist/esm/components/popover.js +15 -9
- package/dist/esm/components/primitives.js +1 -1
- package/dist/esm/components/progress.js +2 -0
- package/dist/esm/components/resource-classes.js +34 -16
- package/dist/esm/components/resource.js +5 -4
- package/dist/esm/components/settings.js +4 -2
- package/dist/esm/components/slider.js +1 -0
- package/dist/esm/components/strings.js +9 -1
- package/dist/esm/components/tag-input.js +15 -7
- package/dist/esm/components/time-field-classes.js +5 -2
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/url-state.js +1 -0
- package/dist/esm/components/virtual-table.js +8 -2
- package/dist/esm/components/virtual.js +16 -2
- package/dist/esm/format.js +17 -14
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/server/inbox/client.js +1 -1
- package/dist/esm/theme.js +66 -6
- package/dist/format.js +18 -15
- package/dist/inbox-client.js +1 -1
- package/dist/index.d.ts +32 -7
- package/dist/nish-components.css +41 -1
- package/dist/nish-components.min.css +1 -1
- package/dist/node/th-check.js +12 -3
- package/dist/server/hono.d.ts +1 -1
- package/dist/server/hono.js +20 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +19 -5
- package/dist/{spa-BLlMc0eI.d.ts → spa-7myD4xvA.d.ts} +3 -2
- package/dist/system-canvas.d.ts +0 -4
- package/dist/theme.d.ts +20 -2
- package/dist/theme.global.js +67 -7
- package/dist/theme.js +67 -7
- package/package.json +1 -1
|
@@ -37,8 +37,10 @@ export interface NishElementStrings {
|
|
|
37
37
|
copyManual: string;
|
|
38
38
|
/** nish-field: tag for a non-required field. */
|
|
39
39
|
optional: string;
|
|
40
|
-
/** nish-bottom-nav, nish-nav-rail
|
|
40
|
+
/** nish-bottom-nav, nish-nav-rail: default landmark label. */
|
|
41
41
|
sections: string;
|
|
42
|
+
/** nish-section-nav: default landmark label. */
|
|
43
|
+
onThisPage: string;
|
|
42
44
|
/** nish-filter-bar: sheet title and the button that opens it. */
|
|
43
45
|
filters: string;
|
|
44
46
|
/** nish-filter-bar: wide-layout clear button. */
|
|
@@ -71,6 +73,10 @@ export interface NishElementStrings {
|
|
|
71
73
|
themeLight: string;
|
|
72
74
|
/** nish-theme-toggle: name of the dark mode. */
|
|
73
75
|
themeDark: string;
|
|
76
|
+
/** nish-theme-toggle: the button's label sentence, from the current mode name to the next one. */
|
|
77
|
+
themeToggleLabel?: (current: string, next: string) => string;
|
|
78
|
+
/** nish-theme-toggle: the words appended when another site set the theme ("set on another site"). */
|
|
79
|
+
themeElsewhere?: string;
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
/** Set the words the elements show, once, for the whole page (one store shared by every entry and
|
package/dist/elements-charts.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
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 "${t}" has already been used with this registry`);if(this.__reverseDefinitions.has(e))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(e)}`);e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:e.observedAttributes??[]}),this.__reverseDefinitions.set(e,t),this.__pendingWhenDefineds.get(t)?.resolve(e),this.__pendingWhenDefineds.delete(t)}get(t){return this.__definitions.get(t)?.ctor}getName(t){return this.__reverseDefinitions.get(t)??null}initialize(t){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(t){let e=this.__definitions.get(t);if(e)return e.ctor;let s=this.__pendingWhenDefineds.get(t);return s||(s=Tn(),this.__pendingWhenDefineds.set(t,s)),s.promise}},Mn=Pt;var
|
|
3
|
-
\f\r]`,gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Be=/'/g,ze=/"/g,Ge=/^(?:script|style|textarea|title)$/i,ae=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),w=ae(1),T=ae(2),nr=ae(3),Q=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),We=new WeakMap,X=Z.createTreeWalker(Z,129);function Ye(n,t){if(!oe(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ue!==void 0?Ue.createHTML(t):t}var Bn=(n,t)=>{let e=n.length-1,s=[],r,i=t===2?"<svg>":t===3?"<math>":"",o=gt;for(let h=0;h<e;h++){let l=n[h],u,g,c=-1,y=0;for(;y<l.length&&(o.lastIndex=y,g=o.exec(l),g!==null);)y=o.lastIndex,o===gt?g[1]==="!--"?o=Fe:g[1]!==void 0?o=He:g[2]!==void 0?(Ge.test(g[2])&&(r=RegExp("</"+g[2],"g")),o=J):g[3]!==void 0&&(o=J):o===J?g[0]===">"?(o=r??gt,c=-1):g[1]===void 0?c=-2:(c=o.lastIndex-g[2].length,u=g[1],o=g[3]===void 0?J:g[3]==='"'?ze:Be):o===ze||o===Be?o=J:o===Fe||o===He?o=gt:(o=J,r=void 0);let _=o===J&&n[h+1].startsWith("/>")?" ":"";i+=o===gt?l+Fn:c>=0?(s.push(u),l.slice(0,c)+je+l.slice(c)+j+_):l+j+(c===-2?h:_)}return[Ye(n,i+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},bt=class n{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,o=0,h=t.length-1,l=this.parts,[u,g]=Bn(t,e);if(this.el=n.createElement(u,s),X.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=X.nextNode())!==null&&l.length<h;){if(r.nodeType===1){if(r.hasAttributes())for(let c of r.getAttributeNames())if(c.endsWith(je)){let y=g[o++],_=r.getAttribute(c).split(j),$=/([.?@])?(.*)/.exec(y);l.push({type:1,index:i,name:$[2],strings:_,ctor:$[1]==="."?ne:$[1]==="?"?se:$[1]==="@"?re:rt}),r.removeAttribute(c)}else c.startsWith(j)&&(l.push({type:6,index:i}),r.removeAttribute(c));if(Ge.test(r.tagName)){let c=r.textContent.split(j),y=c.length-1;if(y>0){r.textContent=It?It.emptyScript:"";for(let _=0;_<y;_++)r.append(c[_],yt()),X.nextNode(),l.push({type:2,index:++i});r.append(c[y],yt())}}}else if(r.nodeType===8)if(r.data===Ve)l.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(j,c+1))!==-1;)l.push({type:7,index:i}),c+=j.length-1}i++}}static createElement(t,e){let s=Z.createElement("template");return s.innerHTML=t,s}};function st(n,t,e=n,s){if(t===Q)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,i=_t(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(n),r._$AT(n,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=st(n,r._$AS(n,t.values),r,s)),t}var ee=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??Z).importNode(e,!0);X.currentNode=r;let i=X.nextNode(),o=0,h=0,l=s[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new vt(i,i.nextSibling,this,t):l.type===1?u=new l.ctor(i,l.name,l.strings,this,t):l.type===6&&(u=new ie(i,this,t)),this._$AV.push(u),l=s[++h]}o!==l?.index&&(i=X.nextNode(),o++)}return X.currentNode=Z,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},vt=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=st(this,t,e),_t(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==Q&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Hn(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==f&&_t(this._$AH)?this._$AA.nextSibling.data=t:this.T(Z.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=bt.createElement(Ye(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let i=new ee(r,this),o=i.u(this.options);i.p(e),this.T(o),this._$AH=i}}_$AC(t){let e=We.get(t.strings);return e===void 0&&We.set(t.strings,e=new bt(t)),e}k(t){oe(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let i of t)r===e.length?e.push(s=new n(this.O(yt()),this.O(yt()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=ke(t).nextSibling;ke(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},rt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=f}_$AI(t,e=this,s,r){let i=this.strings,o=!1;if(i===void 0)t=st(this,t,e,0),o=!_t(t)||t!==this._$AH&&t!==Q,o&&(this._$AH=t);else{let h=t,l,u;for(t=i[0],l=0;l<i.length-1;l++)u=st(this,h[s+l],e,l),u===Q&&(u=this._$AH[l]),o||=!_t(u)||u!==this._$AH[l],u===f?t=f:t!==f&&(t+=(u??"")+i[l+1]),this._$AH[l]=u}o&&!r&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ne=class extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}},se=class extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==f)}},re=class extends rt{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=st(this,t,e,0)??f)===Q)return;let s=this._$AH,r=t===f&&s!==f||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==f&&(s===f||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ie=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){st(this,t)}};var zn=kt.litHtmlPolyfillSupport;zn?.(bt,vt),(kt.litHtmlVersions??=[]).push("3.3.3");var Ke=(n,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let i=e?.renderBefore??null;s._$litPart$=r=new vt(t.insertBefore(yt(),i),i,void 0,e??{})}return r._$AI(n),r};var le=globalThis,V=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ke(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};V._$litElement$=!0,V.finalized=!0,le.litElementHydrateSupport?.({LitElement:V});var Wn=le.litElementPolyfillSupport;Wn?.({LitElement:V});(le.litElementVersions??=[]).push("4.2.2");var jn="3.0.0";var Vn=Symbol.for("nish-ui.runtime.v1");function Gn(){let n=globalThis;return n[Vn]??={versions:new Set,slots:{}}}function Yn(n){n.versions.add(jn),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 qe=!1;function Ut(n,t){let e=Gn();return qe||(qe=!0,Yn(e)),n in e.slots||(e.slots[n]=t()),e.slots[n]}var Je={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 he(){return Ut("element-strings",()=>({values:{...Je},listeners:new Set}))}function Kn(n){let t=he(),e={...t.values};for(let[s,r]of Object.entries(n))r!==void 0&&Object.hasOwn(Je,s)&&(e[s]=r);t.values=e;for(let s of Array.from(t.listeners))s()}function it(){return he().values}function Xe(n){let t=he().listeners;return t.add(n),()=>{t.delete(n)}}var $t=class extends V{#t=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#t??=Xe(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=null}stringsChanged(){this.requestUpdate()}};function St(n,t){customElements.get(n)||customElements.define(n,t)}var Et="\u2013",de="\u2212",ue="en-US",qn=Ut("format",()=>({locale:ue})),Ze=new Map;function Jn(n){let t=Ze.get(n);if(t===void 0){try{t=Intl.getCanonicalLocales(n)[0]??ue}catch{t=ue}Ze.set(n,t)}return t}function xt(n){return n?.locale?Jn(n.locale):qn.locale}function en(n){return n==="en"||n==="en-US"}var Qe=new Map;function nn(n,t){let e=Qe.get(n);return e===void 0&&(e=t(),Qe.set(n,e)),e}function Xn(n,t,e){return nn(`n|${n}|${t}|${e}`,()=>new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:e}))}function tt(n,t,e,s){return nn(`d|${n}|${t}|${s??""}`,()=>new Intl.DateTimeFormat(n,s?{...e,timeZone:s}:e))}function pe(n){return typeof n=="number"&&Number.isFinite(n)}function G(n,t,e,s){return Xn(s,t,e).format(n)}var ce=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function sn(n,t,e){for(let s=0;s<ce.length;s++){let[r,i]=ce[s];if(!(n<r)){if(s>0&&Number((n/r).toFixed(t))>=1e3){let[o,h]=ce[s-1];return G(n/o,0,t,e)+h}return G(n/r,0,t,e)+i}}return G(n,0,t,e)}function rn(n,t){return Number(Math.abs(n).toFixed(t))===0}var tn=new Map;function Zn(n,t){let e=`${t}|${n}`,s=tn.get(e);if(s===void 0){try{s=new Intl.NumberFormat(t,{style:"currency",currency:n,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(i=>i.type==="currency")?.value??n}catch{s=n+" "}tn.set(e,s)}return s}function Qn(n,t,e){let s=Zn(t.currency??"USD",e);if(t.compact&&n>=1e3)return s+sn(n,1,e);let r=t.cents??"auto",i=Math.round(n*100)%100!==0,o=r==="always"||r==="auto"&&(n<1e3||i);return s+(o?G(n,2,2,e):G(n,0,0,e))}function on(n,t={}){if(!pe(n))return Et;let e=Qn(Math.abs(n),t,xt(t));return n<0&&Math.round(Math.abs(n)*100)>0?de+e:e}function an(n,t={}){if(!pe(n))return Et;let e=t.digits??1,s=t.fromRatio??!0?n*100:n,r=G(Math.abs(s),e,e,xt(t))+"%";return rn(s,e)?r:s<0?de+r:t.signed?"+"+r:r}function ln(n,t={}){if(!pe(n))return Et;let e=xt(t),s=n<0&&!rn(n,t.digits??2)?de:"",r=Math.abs(n);return t.compact&&r>=1e3?s+sn(r,t.digits??1,e):s+(t.digits===void 0?G(r,0,2,e):G(r,t.digits,t.digits,e))}var ts=/^(\d{4})-(\d{2})-(\d{2})$/;function hn(n){if(n==null)return null;let t,e=!1;if(n instanceof Date)t=n;else if(typeof n=="number")t=new Date(n);else{let s=ts.exec(n.trim());e=!!s,t=s?new Date(Number(s[1]),Number(s[2])-1,Number(s[3])):new Date(n)}return Number.isNaN(t.getTime())?null:{d:t,dayOnly:e}}function cn(n,t){return n.dayOnly?void 0:t.timeZone}function Ft(n){return n.replace(/[\u202f\u00a0]/g," ")}var Sr=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var es={month:"short",day:"numeric",year:"numeric"},ns={weekday:"long",month:"long",day:"numeric",year:"numeric"},ss={month:"short",day:"numeric"},rs={weekday:"short"},is={month:"numeric",day:"numeric"},os={hour:"numeric",minute:"2-digit"},as={hour:"numeric",minute:"2-digit",hour12:!0},ls={year:"numeric",month:"numeric",day:"numeric"};function hs(n,t){if(!t)return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()};let e={year:0,month:0,day:0};for(let s of tt("en-US","ymd",ls,t).formatToParts(n))(s.type==="year"||s.type==="month"||s.type==="day")&&(e[s.type]=Number(s.value));return e}function cs(n,t,e,s){let r=cn(n,e);switch(t){case"medium":return Ft(tt(s,"medium",es,r).format(n.d));case"long":return Ft(tt(s,"long",ns,r).format(n.d));case"weekday":{let i=tt(s,"weekday",rs,r).format(n.d);if(!en(s))return`${i} ${tt(s,"md",is,r).format(n.d)}`;let o=hs(n.d,r);return`${i} ${o.month}/${o.day}`}default:return Ft(tt(s,"short",ss,r).format(n.d))}}function un(n,t="short",e={}){let s=hn(n);return s?cs(s,t,e,xt(e)):Et}function us(n,t,e){let s=en(e);return Ft(tt(e,s?"time12":"time",s?as:os,cn(n,t)).format(n.d))}function dn(n,t={}){let e=hn(n);return e?us(e,t,xt(t)):Et}var pn={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function B(n,t){return n&&Object.hasOwn(pn,n)?pn[n]:n&&/^chart-[1-8]$/.test(n)?`var(--nish-${n})`:`var(--nish-chart-${(Math.trunc(t)%8+8)%8+1})`}var D={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},mn,ds=n=>Math.abs(n)<1e3?String(Math.round(n*100)/100):(mn??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),mn.format(n));function ot(n,t=ds){let e=(n??"").trim();if(!e)return t;let s=e.indexOf(":"),r=(s<0?e:e.slice(0,s)).toLowerCase(),i=s<0?"":e.slice(s+1).trim();switch(r){case"number":return o=>ln(o);case"percent":{let o=i!==""&&Number.isInteger(Number(i))&&Number(i)>=0&&Number(i)<=10?Number(i):1;return h=>an(h,{digits:o})}case"currency":return o=>on(o,{currency:i||"USD"});case"date":{let o=i==="medium"||i==="long"||i==="weekday"?i:"short";return h=>un(h,o)}case"time":return o=>dn(o);default:return t}}function me(n,t,e){let s=Math.max(2,Math.floor(e));return Array.from({length:s},(r,i)=>n+(t-n)*i/(s-1))}function gn(n,t){if(n===t){let s=Math.abs(n)*.05||1;return[n-s,t+s]}let e=(t-n)*.06;return[n-e,t+e]}function yn(n,t){let e=0,s=n.length-1;for(;s-e>1;){let r=e+s>>1;n[r]<t?e=r:s=r}return Math.abs(n[e]-t)<=Math.abs(n[s]-t)?e:s}function Y(n){if(n==null||n==="")return null;let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:null}function fe(n){if(!Array.isArray(n))return[];let t=[];return n.forEach((e,s)=>{if(Array.isArray(e)){let r=Y(e[0]);r!==null&&t.push({x:r,y:Y(e[1])})}else if(e&&typeof e=="object"){let r=e,i=Y(r.x);i!==null&&t.push({x:i,y:Y(r.y)})}else t.push({x:s,y:Y(e)})}),t}function _n(n){return Array.isArray(n)?n.map((t,e)=>{let s=t&&typeof t=="object"?t:{};return{label:typeof s.label=="string"&&s.label?s.label:it().seriesNumber(e+1),tone:typeof s.tone=="string"?s.tone:void 0,points:fe(s.points??s.data)}}):[]}function bn(n){return Array.isArray(n)?n.map((t,e)=>{if(Array.isArray(t))return{label:String(t[0]??""),value:Y(t[1])??0};if(t&&typeof t=="object"){let s=t;return{label:s.label==null?String(e+1):String(s.label),value:Y(s.value)??0}}return{label:String(e+1),value:Y(t)??0}}):[]}var wt={fromAttribute(n){if(!n)return[];try{let t=JSON.parse(n);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute(n){try{return JSON.stringify(n)}catch{return""}}},K=class extends $t{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;themeObserver=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this)),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null,this.themeObserver?.disconnect(),this.themeObserver=null}get plotHeight(){return this.height>0?this.height:200}},fn=0;function vn(){return fn+=1,`nish-chart-${fn}`}var Ht="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var $n=18,ps=22,Bt=class extends K{static properties={...K.properties,data:{converter:wt},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let t=it(),e=this.label,s=this.height>0?this.height:140,r=bn(this.data),i=ot(this.yFormat),o=ot(this.xFormat,d=>String(d)),h=d=>this.xFormat&&d.trim()!==""&&Number.isFinite(Number(d))?o(Number(d)):d;if(!r.length)return w`<div class="nish-chart">
|
|
1
|
+
var ve=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){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=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var L=function(n,t,e,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(n,e):r?r.value=e:t.set(n,e),e},x=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},nt,Tt,Mt,lt,Gt,ht,Ct,q,ct,W,Nt,$e;var _={__proto__:null};_.enumerable=!0;Object.freeze(_);var Yt=(W=class{constructor(t,e={}){if(nt.set(this,!1),Tt.set(this,!1),Mt.set(this,!1),lt.set(this,!1),Gt.set(this,Date.now()),ht.set(this,!1),Ct.set(this,void 0),q.set(this,void 0),ct.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 e!="object"||!e)throw new Error('The "options" argument must be an object');let{bubbles:s,cancelable:r,composed:i}=e;L(this,nt,!!r,"f"),L(this,Tt,!!s,"f"),L(this,Mt,!!i,"f"),L(this,Ct,`${t}`,"f"),L(this,q,null,"f"),L(this,ct,!1,"f")}initEvent(t,e,s){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){L(this,lt,!0,"f")}get target(){return x(this,q,"f")}get currentTarget(){return x(this,q,"f")}get srcElement(){return x(this,q,"f")}get type(){return x(this,Ct,"f")}get cancelable(){return x(this,nt,"f")}get defaultPrevented(){return x(this,nt,"f")&&x(this,lt,"f")}get timeStamp(){return x(this,Gt,"f")}composedPath(){return x(this,ct,"f")?[x(this,q,"f")]:[]}get returnValue(){return!x(this,nt,"f")||!x(this,lt,"f")}get bubbles(){return x(this,Tt,"f")}get composed(){return x(this,Mt,"f")}get eventPhase(){return x(this,ct,"f")?W.AT_TARGET:W.NONE}get cancelBubble(){return x(this,ht,"f")}set cancelBubble(t){t&&L(this,ht,!0,"f")}stopPropagation(){L(this,ht,!0,"f")}get isTrusted(){return!1}},nt=new WeakMap,Tt=new WeakMap,Mt=new WeakMap,lt=new WeakMap,Gt=new WeakMap,ht=new WeakMap,Ct=new WeakMap,q=new WeakMap,ct=new WeakMap,W.NONE=0,W.CAPTURING_PHASE=1,W.AT_TARGET=2,W.BUBBLING_PHASE=3,W);Object.defineProperties(Yt.prototype,{initEvent:_,stopImmediatePropagation:_,preventDefault:_,target:_,currentTarget:_,srcElement:_,type:_,cancelable:_,defaultPrevented:_,timeStamp:_,composedPath:_,returnValue:_,bubbles:_,composed:_,eventPhase:_,cancelBubble:_,stopPropagation:_,isTrusted:_});var Se=($e=class extends Yt{constructor(t,e={}){super(t,e),Nt.set(this,void 0),L(this,Nt,e?.detail??null,"f")}initCustomEvent(t,e,s,r){throw new Error("Method not implemented.")}get detail(){return x(this,Nt,"f")}},Nt=new WeakMap,$e);Object.defineProperties(Se.prototype,{detail:_});var U=Yt,Kt=Se;var R;var Ss=(R=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}},R.STYLE_RULE=1,R.CHARSET_RULE=2,R.IMPORT_RULE=3,R.MEDIA_RULE=4,R.FONT_FACE_RULE=5,R.PAGE_RULE=6,R.NAMESPACE_RULE=10,R.KEYFRAMES_RULE=7,R.KEYFRAME_RULE=8,R.SUPPORTS_RULE=12,R.COUNTER_STYLE_RULE=11,R.FONT_FEATURE_VALUES_RULE=14,R.MARGIN_RULE=9,R);globalThis.Event??=U;globalThis.CustomEvent??=Kt;var Jt=Symbol(),Ee=n=>typeof n=="boolean"?n:n?.capture??!1,F={__proto__:null};F.enumerable=!0;Object.freeze(F);var Ot=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(t,e,s){if(e==null)return;let r=Ee(s)?this.__captureEventListeners:this.__eventListeners,i=r.get(t);if(i===void 0)i=new Map,r.set(t,i);else if(i.has(e))return;let o=typeof s=="object"&&s?s:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(t,e,s)),i.set(e,o??{})}removeEventListener(t,e,s){if(e==null)return;let r=Ee(s)?this.__captureEventListeners:this.__eventListeners,i=r.get(t);i!==void 0&&(i.delete(e),i.size||r.delete(t))}dispatchEvent(t){let e=this.__resolveFullEventPath();!t.composed&&this.__host&&(e=e.slice(0,e.indexOf(this.__host)));let s=!1,r=!1,i=U.NONE,o=null,h=null,l=null,u=t.stopPropagation,g=t.stopImmediatePropagation;Object.defineProperties(t,{target:{get(){return o??h},...F},srcElement:{get(){return t.target},...F},currentTarget:{get(){return l},...F},eventPhase:{get(){return i},...F},composedPath:{value:()=>e,...F},stopPropagation:{value:()=>{s=!0,u.call(t)},...F},stopImmediatePropagation:{value:()=>{r=!0,g.call(t)},...F}});let c=(m,A,S)=>{typeof m=="function"?m(t):typeof m?.handleEvent=="function"&&m.handleEvent(t),A.once&&S.delete(m)},y=()=>(l=null,i=U.NONE,!t.defaultPrevented),b=e.slice().reverse();o=!this.__host||!t.composed?this:null;let $=m=>{for(h=this;h.__host&&m.includes(h.__host);)h=h.__host};for(let m of b){!o&&(!h||h===m.__host)&&$(b.slice(b.indexOf(m))),l=m,i=m===t.target?U.AT_TARGET:U.CAPTURING_PHASE;let A=m.__captureEventListeners.get(t.type);if(A){for(let[S,N]of A)if(c(S,N,A),r)return y()}if(s)return y()}let C=t.bubbles?e:[this];h=null;for(let m of C){!o&&(!h||m===h.__host)&&$(C.slice(0,C.indexOf(m)+1)),l=m,i=m===t.target?U.AT_TARGET:U.BUBBLING_PHASE;let A=m.__eventListeners.get(t.type);if(A){for(let[S,N]of A)if(c(S,N,A),r)return y()}if(s)return y()}return y()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Ae,Cn]}};var xe=new WeakMap,ut=n=>{let t=xe.get(n);return t===void 0&&xe.set(n,t=new Map),t},dt=class extends Ot{getRootNode(t){return t?.composed?qt:this.__host?.__shadowRoot??qt}};var we=class extends dt{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Ae=new we,qt=Ae;var Re=class extends dt{constructor(t){if(super(),t!==Jt)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Pt,customElements:Zt,document:qt,Document:we,Element:Te,EventTarget:Ot,HTMLElement:Me,Node:dt,ShadowRoot:Ce,window:this,Window:Re})}};var Te=class extends dt{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ut(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(t,e){ut(this).set(t,String(e))}removeAttribute(t){ut(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return ut(this).has(t)}attachShadow(t){this.__shadowRootMode=t.mode;let e=new Ce(Jt,t);return e.__eventTargetParent=this,e.__host=this,this.__shadowRoot=e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new ve(this);return this.__internals=t,t}getAttribute(t){return ut(this).get(t)??null}};var Me=class extends Te{},Xt=Me;var Ce=class extends dt{get host(){return this.__host}constructor(t,e){if(super(),t!==t)throw new TypeError("Illegal constructor");this.mode=e.mode}};globalThis.litServerRoot??=Object.defineProperty(new Xt,"localName",{get(){return"lit-server-root"}});function Tn(){let n,t;return{promise:new Promise((s,r)=>{n=s,t=r}),resolve:n,reject:t}}var Pt=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" 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 "${t}" has already been used with this registry`);if(this.__reverseDefinitions.has(e))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(e)}`);e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:e.observedAttributes??[]}),this.__reverseDefinitions.set(e,t),this.__pendingWhenDefineds.get(t)?.resolve(e),this.__pendingWhenDefineds.delete(t)}get(t){return this.__definitions.get(t)?.ctor}getName(t){return this.__reverseDefinitions.get(t)??null}initialize(t){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(t){let e=this.__definitions.get(t);if(e)return e.ctor;let s=this.__pendingWhenDefineds.get(t);return s||(s=Tn(),this.__pendingWhenDefineds.set(t,s)),s.promise}},Mn=Pt;var Zt=new Mn,Cn=new Re(Jt);var pt=globalThis,Dt=pt.ShadowRoot&&(pt.ShadyCSS===void 0||pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oe=Symbol(),Ne=new WeakMap,Lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Oe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Dt&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Ne.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Ne.set(e,t))}return t}toString(){return this.cssText}},Pe=n=>new Lt(typeof n=="string"?n:n+"",void 0,Oe);var Le=(n,t)=>{if(Dt)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),r=pt.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,n.appendChild(s)}},Qt=Dt||pt.CSSStyleSheet===void 0?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Pe(e)})(n):n;var{is:Nn,defineProperty:On,getOwnPropertyDescriptor:Pn,getOwnPropertyNames:Ln,getOwnPropertySymbols:Dn,getPrototypeOf:In}=Object,ft=globalThis;ft.customElements??=Zt;var De=ft.trustedTypes,kn=De?De.emptyScript:"",Un=ft.reactiveElementPolyfillSupport,mt=(n,t)=>n,te={toAttribute(n,t){switch(t){case Boolean:n=n?kn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ke=(n,t)=>!Nn(n,t),Ie={attribute:!0,type:String,converter:te,reflect:!1,useDefault:!1,hasChanged:ke};Symbol.metadata??=Symbol("metadata"),ft.litPropertyMetadata??=new WeakMap;var H=class extends(globalThis.HTMLElement??Xt){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ie){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&On(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){let{get:r,set:i}=Pn(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){let h=r?.call(this);i?.call(this,o),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ie}static _$Ei(){if(this.hasOwnProperty(mt("elementProperties")))return;let t=In(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(mt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(mt("properties"))){let e=this.properties,s=[...Ln(e),...Dn(e)];for(let r of s)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let r of s)e.unshift(Qt(r))}else t!==void 0&&e.push(Qt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Le(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:te).toAttribute(e,s.type);this._$Em=t,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){let s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let i=s.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:te;this._$Em=r;let h=o.fromAttribute(e,i.type);this[r]=h??this._$Ej?.get(r)??h,this._$Em=null}}requestUpdate(t,e,s,r=!1,i){if(t!==void 0){let o=this.constructor;if(r===!1&&(i=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??ke)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),i!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[r,i]of s){let{wrapped:o}=i,h=this[r];o!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,i,h)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[mt("elementProperties")]=new Map,H[mt("finalized")]=new Map,Un?.({ReactiveElement:H}),(ft.reactiveElementVersions??=[]).push("2.1.2");var kt=globalThis,Ue=n=>n,It=kt.trustedTypes,Fe=It?It.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ve="$lit$",j=`lit$${Math.random().toFixed(9).slice(2)}$`,Ge="?"+j,Fn=`<${Ge}>`,Z=kt.document===void 0?{createTreeWalker:()=>({})}:document,yt=()=>Z.createComment(""),bt=n=>n===null||typeof n!="object"&&typeof n!="function",ae=Array.isArray,Hn=n=>ae(n)||typeof n?.[Symbol.iterator]=="function",ee=`[
|
|
3
|
+
\f\r]`,gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,He=/-->/g,Be=/>/g,J=RegExp(`>|${ee}(?:([^\\s"'>=/]+)(${ee}*=${ee}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ze=/'/g,We=/"/g,Ye=/^(?:script|style|textarea|title)$/i,le=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),w=le(1),T=le(2),nr=le(3),Q=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),je=new WeakMap,X=Z.createTreeWalker(Z,129);function Ke(n,t){if(!ae(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fe!==void 0?Fe.createHTML(t):t}var Bn=(n,t)=>{let e=n.length-1,s=[],r,i=t===2?"<svg>":t===3?"<math>":"",o=gt;for(let h=0;h<e;h++){let l=n[h],u,g,c=-1,y=0;for(;y<l.length&&(o.lastIndex=y,g=o.exec(l),g!==null);)y=o.lastIndex,o===gt?g[1]==="!--"?o=He:g[1]!==void 0?o=Be:g[2]!==void 0?(Ye.test(g[2])&&(r=RegExp("</"+g[2],"g")),o=J):g[3]!==void 0&&(o=J):o===J?g[0]===">"?(o=r??gt,c=-1):g[1]===void 0?c=-2:(c=o.lastIndex-g[2].length,u=g[1],o=g[3]===void 0?J:g[3]==='"'?We:ze):o===We||o===ze?o=J:o===He||o===Be?o=gt:(o=J,r=void 0);let b=o===J&&n[h+1].startsWith("/>")?" ":"";i+=o===gt?l+Fn:c>=0?(s.push(u),l.slice(0,c)+Ve+l.slice(c)+j+b):l+j+(c===-2?h:b)}return[Ke(n,i+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},_t=class n{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,o=0,h=t.length-1,l=this.parts,[u,g]=Bn(t,e);if(this.el=n.createElement(u,s),X.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=X.nextNode())!==null&&l.length<h;){if(r.nodeType===1){if(r.hasAttributes())for(let c of r.getAttributeNames())if(c.endsWith(Ve)){let y=g[o++],b=r.getAttribute(c).split(j),$=/([.?@])?(.*)/.exec(y);l.push({type:1,index:i,name:$[2],strings:b,ctor:$[1]==="."?se:$[1]==="?"?re:$[1]==="@"?ie:rt}),r.removeAttribute(c)}else c.startsWith(j)&&(l.push({type:6,index:i}),r.removeAttribute(c));if(Ye.test(r.tagName)){let c=r.textContent.split(j),y=c.length-1;if(y>0){r.textContent=It?It.emptyScript:"";for(let b=0;b<y;b++)r.append(c[b],yt()),X.nextNode(),l.push({type:2,index:++i});r.append(c[y],yt())}}}else if(r.nodeType===8)if(r.data===Ge)l.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(j,c+1))!==-1;)l.push({type:7,index:i}),c+=j.length-1}i++}}static createElement(t,e){let s=Z.createElement("template");return s.innerHTML=t,s}};function st(n,t,e=n,s){if(t===Q)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,i=bt(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(n),r._$AT(n,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=st(n,r._$AS(n,t.values),r,s)),t}var ne=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??Z).importNode(e,!0);X.currentNode=r;let i=X.nextNode(),o=0,h=0,l=s[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new vt(i,i.nextSibling,this,t):l.type===1?u=new l.ctor(i,l.name,l.strings,this,t):l.type===6&&(u=new oe(i,this,t)),this._$AV.push(u),l=s[++h]}o!==l?.index&&(i=X.nextNode(),o++)}return X.currentNode=Z,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},vt=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=st(this,t,e),bt(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==Q&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Hn(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==f&&bt(this._$AH)?this._$AA.nextSibling.data=t:this.T(Z.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=_t.createElement(Ke(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let i=new ne(r,this),o=i.u(this.options);i.p(e),this.T(o),this._$AH=i}}_$AC(t){let e=je.get(t.strings);return e===void 0&&je.set(t.strings,e=new _t(t)),e}k(t){ae(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let i of t)r===e.length?e.push(s=new n(this.O(yt()),this.O(yt()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Ue(t).nextSibling;Ue(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},rt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=f}_$AI(t,e=this,s,r){let i=this.strings,o=!1;if(i===void 0)t=st(this,t,e,0),o=!bt(t)||t!==this._$AH&&t!==Q,o&&(this._$AH=t);else{let h=t,l,u;for(t=i[0],l=0;l<i.length-1;l++)u=st(this,h[s+l],e,l),u===Q&&(u=this._$AH[l]),o||=!bt(u)||u!==this._$AH[l],u===f?t=f:t!==f&&(t+=(u??"")+i[l+1]),this._$AH[l]=u}o&&!r&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},se=class extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}},re=class extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==f)}},ie=class extends rt{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=st(this,t,e,0)??f)===Q)return;let s=this._$AH,r=t===f&&s!==f||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==f&&(s===f||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},oe=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){st(this,t)}};var zn=kt.litHtmlPolyfillSupport;zn?.(_t,vt),(kt.litHtmlVersions??=[]).push("3.3.3");var qe=(n,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let i=e?.renderBefore??null;s._$litPart$=r=new vt(t.insertBefore(yt(),i),i,void 0,e??{})}return r._$AI(n),r};var he=globalThis,V=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=qe(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};V._$litElement$=!0,V.finalized=!0,he.litElementHydrateSupport?.({LitElement:V});var Wn=he.litElementPolyfillSupport;Wn?.({LitElement:V});(he.litElementVersions??=[]).push("4.2.2");var jn="3.1.0";var Vn=Symbol.for("nish-ui.runtime.v1");function Gn(){let n=globalThis;return n[Vn]??={versions:new Set,slots:{}}}function Yn(n){n.versions.add(jn),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 Je=!1;function Ut(n,t){let e=Gn();return Je||(Je=!0,Yn(e)),n in e.slots||(e.slots[n]=t()),e.slots[n]}var Ft={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:n=>`${n} result${n===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:n=>`${n} active`,remove:"Remove",removeNamed:n=>`Remove ${n}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:n=>`${n}: no data`,seriesNumber:n=>`Series ${n}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(n,t)=>`Theme: ${n}. Switch to ${t}`,themeElsewhere:"set on another site"};function ce(){return Ut("element-strings",()=>({values:{...Ft},listeners:new Set}))}function Kn(n){let t=ce(),e={...t.values};for(let[s,r]of Object.entries(n))r!==void 0&&Object.hasOwn(Ft,s)&&(e[s]=r);t.values=e;for(let s of Array.from(t.listeners))s()}function it(){let n=ce(),t=n.values;return Object.keys(Ft).some(s=>t[s]===void 0)&&(n.values={...Ft,...Object.fromEntries(Object.entries(t).filter(([,s])=>s!==void 0))}),n.values}function Xe(n){let t=ce().listeners;return t.add(n),()=>{t.delete(n)}}var $t=class extends V{#t=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#t??=Xe(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=null}stringsChanged(){this.requestUpdate()}};function St(n,t){customElements.get(n)||customElements.define(n,t)}var Et="\u2013",pe="\u2212",de="en-US",qn=Ut("format",()=>({locale:de})),Ze=new Map;function Jn(n){let t=Ze.get(n);if(t===void 0){try{t=Intl.getCanonicalLocales(n)[0]??de}catch{t=de}Ze.set(n,t)}return t}function xt(n){return n?.locale?Jn(n.locale):qn.locale}function en(n){return n==="en"||n==="en-US"}var Qe=new Map;function nn(n,t){let e=Qe.get(n);return e===void 0&&(e=t(),Qe.set(n,e)),e}function Xn(n,t,e){return nn(`n|${n}|${t}|${e}`,()=>new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:e}))}function tt(n,t,e,s){return nn(`d|${n}|${t}|${s??""}`,()=>new Intl.DateTimeFormat(n,s?{...e,timeZone:s}:e))}function me(n){return typeof n=="number"&&Number.isFinite(n)}function G(n,t,e,s){return Xn(s,t,e).format(n)}var ue=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function sn(n,t,e){for(let s=0;s<ue.length;s++){let[r,i]=ue[s];if(!(n<r)){if(s>0&&Number((n/r).toFixed(t))>=1e3){let[o,h]=ue[s-1];return G(n/o,0,t,e)+h}return G(n/r,0,t,e)+i}}return G(n,0,t,e)}function rn(n,t){return Number(Math.abs(n).toFixed(t))===0}var tn=new Map;function Zn(n,t){let e=`${t}|${n}`,s=tn.get(e);if(s===void 0){try{let r=new Intl.NumberFormat(t,{style:"currency",currency:n,currencyDisplay:"narrowSymbol"}),i=r.formatToParts(0).find(o=>o.type==="currency")?.value??n;/\p{L}$/u.test(i)&&(i+="\xA0"),s={symbol:i,digits:r.resolvedOptions().maximumFractionDigits??2}}catch{s={symbol:n+" ",digits:2}}tn.set(e,s)}return s}function Qn(n,t,e){let{symbol:s,digits:r}=Zn(t.currency??"USD",e);if(t.compact&&n>=1e3)return s+sn(n,1,e);let i=t.cents??"auto",o=10**r,h=Math.round(n*o)%o!==0,l=r>0&&(i==="always"||i==="auto"&&(n<1e3||h));return s+(l?G(n,r,r,e):G(n,0,0,e))}function on(n,t={}){if(!me(n))return Et;let e=Qn(Math.abs(n),t,xt(t));return n<0&&Math.round(Math.abs(n)*100)>0?pe+e:e}function an(n,t={}){if(!me(n))return Et;let e=t.digits??1,s=t.fromRatio??!0?n*100:n,r=G(Math.abs(s),e,e,xt(t))+"%";return rn(s,e)?r:s<0?pe+r:t.signed?"+"+r:r}function ln(n,t={}){if(!me(n))return Et;let e=xt(t),s=n<0&&!rn(n,t.digits??2)?pe:"",r=Math.abs(n);return t.compact&&r>=1e3?s+sn(r,t.digits??1,e):s+(t.digits===void 0?G(r,0,2,e):G(r,t.digits,t.digits,e))}var ts=/^(\d{4})-(\d{2})-(\d{2})$/;function hn(n){if(n==null)return null;let t,e=!1;if(n instanceof Date)t=n;else if(typeof n=="number")t=new Date(n);else{let s=ts.exec(n.trim());e=!!s,t=s?new Date(Number(s[1]),Number(s[2])-1,Number(s[3])):new Date(n)}return Number.isNaN(t.getTime())?null:{d:t,dayOnly:e}}function cn(n,t){return n.dayOnly?void 0:t.timeZone}function Ht(n){return n.replace(/[\u202f\u00a0]/g," ")}var Sr=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var es={month:"short",day:"numeric",year:"numeric"},ns={weekday:"long",month:"long",day:"numeric",year:"numeric"},ss={month:"short",day:"numeric"},rs={weekday:"short"},is={month:"numeric",day:"numeric"},os={hour:"numeric",minute:"2-digit"},as={hour:"numeric",minute:"2-digit",hour12:!0},ls={year:"numeric",month:"numeric",day:"numeric"};function hs(n,t){if(!t)return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()};let e={year:0,month:0,day:0};for(let s of tt("en-US","ymd",ls,t).formatToParts(n))(s.type==="year"||s.type==="month"||s.type==="day")&&(e[s.type]=Number(s.value));return e}function cs(n,t,e,s){let r=cn(n,e);switch(t){case"medium":return Ht(tt(s,"medium",es,r).format(n.d));case"long":return Ht(tt(s,"long",ns,r).format(n.d));case"weekday":{let i=tt(s,"weekday",rs,r).format(n.d);if(!en(s))return`${i} ${tt(s,"md",is,r).format(n.d)}`;let o=hs(n.d,r);return`${i} ${o.month}/${o.day}`}default:return Ht(tt(s,"short",ss,r).format(n.d))}}function un(n,t="short",e={}){let s=hn(n);return s?cs(s,t,e,xt(e)):Et}function us(n,t,e){let s=en(e);return Ht(tt(e,s?"time12":"time",s?as:os,cn(n,t)).format(n.d))}function dn(n,t={}){let e=hn(n);return e?us(e,t,xt(t)):Et}var pn={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function B(n,t){return n&&Object.hasOwn(pn,n)?pn[n]:n&&/^chart-[1-8]$/.test(n)?`var(--nish-${n})`:`var(--nish-chart-${(Math.trunc(t)%8+8)%8+1})`}var D={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},mn,ds=n=>Math.abs(n)<1e3?String(Math.round(n*100)/100):(mn??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),mn.format(n));function ot(n,t=ds){let e=(n??"").trim();if(!e)return t;let s=e.indexOf(":"),r=(s<0?e:e.slice(0,s)).toLowerCase(),i=s<0?"":e.slice(s+1).trim();switch(r){case"number":return o=>ln(o);case"percent":{let o=i!==""&&Number.isInteger(Number(i))&&Number(i)>=0&&Number(i)<=10?Number(i):1;return h=>an(h,{digits:o})}case"currency":return o=>on(o,{currency:i||"USD"});case"date":{let o=i==="medium"||i==="long"||i==="weekday"?i:"short";return h=>un(h,o)}case"time":return o=>dn(o);default:return t}}function fe(n,t,e){let s=Math.max(2,Math.floor(e));return Array.from({length:s},(r,i)=>n+(t-n)*i/(s-1))}function gn(n,t){if(n===t){let s=Math.abs(n)*.05||1;return[n-s,t+s]}let e=(t-n)*.06;return[n-e,t+e]}function yn(n,t){let e=0,s=n.length-1;for(;s-e>1;){let r=e+s>>1;n[r]<t?e=r:s=r}return Math.abs(n[e]-t)<=Math.abs(n[s]-t)?e:s}function Y(n){if(n==null||n==="")return null;let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:null}function ge(n){if(!Array.isArray(n))return[];let t=[];return n.forEach((e,s)=>{if(Array.isArray(e)){let r=Y(e[0]);r!==null&&t.push({x:r,y:Y(e[1])})}else if(e&&typeof e=="object"){let r=e,i=Y(r.x);i!==null&&t.push({x:i,y:Y(r.y)})}else t.push({x:s,y:Y(e)})}),t}function bn(n){return Array.isArray(n)?n.map((t,e)=>{let s=t&&typeof t=="object"?t:{};return{label:typeof s.label=="string"&&s.label?s.label:it().seriesNumber(e+1),tone:typeof s.tone=="string"?s.tone:void 0,points:ge(s.points??s.data)}}):[]}function _n(n){return Array.isArray(n)?n.map((t,e)=>{if(Array.isArray(t))return{label:String(t[0]??""),value:Y(t[1])??0};if(t&&typeof t=="object"){let s=t;return{label:s.label==null?String(e+1):String(s.label),value:Y(s.value)??0}}return{label:String(e+1),value:Y(t)??0}}):[]}var wt={fromAttribute(n){if(!n)return[];try{let t=JSON.parse(n);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute(n){try{return JSON.stringify(n)}catch{return""}}},K=class extends $t{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;themeObserver=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this)),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null,this.themeObserver?.disconnect(),this.themeObserver=null}get plotHeight(){return this.height>0?this.height:200}},fn=0;function vn(){return fn+=1,`nish-chart-${fn}`}var Bt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var $n=18,ps=22,zt=class extends K{static properties={...K.properties,data:{converter:wt},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let t=it(),e=this.label,s=this.height>0?this.height:140,r=_n(this.data),i=ot(this.yFormat),o=ot(this.xFormat,d=>String(d)),h=d=>this.xFormat&&d.trim()!==""&&Number.isFinite(Number(d))?o(Number(d)):d;if(!r.length)return w`<div class="nish-chart">
|
|
5
5
|
<div class="nish-empty" role="img" aria-label=${t.noDataNamed(e)} style="height:${s}px;box-sizing:border-box">${this.empty||t.noDataYet}</div>
|
|
6
|
-
</div>`;let l=this.width,u=B(this.tone,0),g=r.map(d=>Number.isFinite(d.value)?d.value:0),c=Math.max(0,...g),y=Math.min(0,...g),
|
|
6
|
+
</div>`;let l=this.width,u=B(this.tone,0),g=r.map(d=>Number.isFinite(d.value)?d.value:0),c=Math.max(0,...g),y=Math.min(0,...g),b=c-y||1,$=Math.max(0,s-$n-ps),C=$n+c/b*$,m=l/r.length,A=Math.max(1,m*.72),S=this.showValues,N=S||this.coarse,et=this.xTicks==="all",I=this.selected!=null&&this.selected<r.length?this.selected:null,O=d=>{let v=d.currentTarget.getBoundingClientRect(),M=Math.floor((d.clientX-v.left)/(v.width||1)*r.length);this.selected=Math.min(r.length-1,Math.max(0,M))},at=d=>{if(d.key==="ArrowLeft"||d.key==="ArrowRight"){d.preventDefault();let v=d.key==="ArrowRight"?1:-1,M=this.selected;this.selected=M==null?v>0?0:r.length-1:Math.min(r.length-1,Math.max(0,M+v))}else d.key==="Escape"&&(this.selected=null)},At=l>0?w`<svg
|
|
7
7
|
width=${l}
|
|
8
8
|
height=${s}
|
|
9
9
|
role="img"
|
|
@@ -16,7 +16,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
16
16
|
@keydown=${at}
|
|
17
17
|
>
|
|
18
18
|
<line class="nish-chart-grid" x1="0" x2=${l} y1=${C} y2=${C} stroke=${D.grid} stroke-width="1"></line>
|
|
19
|
-
${g.map((d,v)=>{let M=Math.max(2,Math.abs(d)/
|
|
19
|
+
${g.map((d,v)=>{let M=Math.max(2,Math.abs(d)/b*$),z=d<0?C:C-M,P=v*m+(m-A)/2,k=I===v,Rt=k||N&&(S||m>=26);return T`<g>
|
|
20
20
|
<rect x=${P} y=${z} width=${A} height=${M} rx="2" fill=${u} opacity=${I==null||k?1:.55}></rect>
|
|
21
21
|
${Rt?T`<text class="nish-chart-axis" x=${P+A/2} y=${d<0?z+M+11:Math.max(11,z-4)} text-anchor="middle" font-size="11" fill=${D.text} style="font-variant-numeric:tabular-nums">${i(d)}</text>`:f}
|
|
22
22
|
</g>`})}
|
|
@@ -24,38 +24,38 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
24
24
|
</svg>`:f;return w`<div class="nish-chart" style="position:relative;width:100%">
|
|
25
25
|
${At}
|
|
26
26
|
<div aria-live="polite" style="margin-top:4px;min-height:20px;font-size:14px;font-variant-numeric:tabular-nums;color:var(--nish-hi2)">${I!=null?`${h(r[I].label)}: ${i(g[I])}`:""}</div>
|
|
27
|
-
<table style=${
|
|
27
|
+
<table style=${Bt}>
|
|
28
28
|
<caption>${e}</caption>
|
|
29
29
|
<tbody>
|
|
30
30
|
${r.map((d,v)=>w`<tr><th scope="row">${h(d.label)}</th><td>${i(g[v])}</td></tr>`)}
|
|
31
31
|
</tbody>
|
|
32
32
|
</table>
|
|
33
|
-
</div>`}};St("nish-bar-chart",
|
|
33
|
+
</div>`}};St("nish-bar-chart",zt);var Wt=10,ms=24,fs=12,gs="position:absolute;top:4px;z-index:10;pointer-events:none;white-space:nowrap;padding:4px 8px;font-variant-numeric:tabular-nums;background:var(--nish-elevated);border:1px solid var(--nish-line-strong);border-radius:var(--nish-radius-sm);box-shadow:var(--nish-shadow-pop);color:var(--nish-hi);font-size:12px",jt=class extends K{static properties={...K.properties,data:{converter:wt},series:{converter:wt},area:{type:Boolean,reflect:!0},baseline:{type:Number,reflect:!0},yTicks:{type:Number,attribute:"y-ticks",reflect:!0},xTicks:{type:Number,attribute:"x-ticks",reflect:!0},active:{state:!0}};fromKey=!1;listening=!1;gradId=vn();constructor(){super(),this.data=[],this.series=[],this.area=!1,this.height=200,this.yTicks=4,this.xTicks=4,this.active=null}onDocPointerDown=t=>{this.contains(t.target)||(this.active=null)};disconnectedCallback(){super.disconnectedCallback(),this.stopListening()}stopListening(){this.listening&&(document.removeEventListener("pointerdown",this.onDocPointerDown),this.listening=!1)}updated(){this.active!=null&&!this.listening?(document.addEventListener("pointerdown",this.onDocPointerDown),this.listening=!0):this.active==null&&this.stopListening()}lines(){let t=bn(this.series);if(t.length)return t;let e=ge(this.data);return e.length?[{label:this.label,tone:this.tone||void 0,points:e}]:[]}moveTo(t,e,s,r,i,o,h){let l=e.getBoundingClientRect(),u=o+(t-l.left-r)/(i||1)*(h-o);this.active=yn(s,u)}render(){let t=it(),e=this.label,s=this.plotHeight,r=this.lines(),i=ot(this.yFormat),o=ot(this.xFormat),h=a=>a.y!=null&&Number.isFinite(a.y)&&Number.isFinite(a.x),l=new Set;for(let a of r)for(let p of a.points)h(p)&&l.add(p.x);let u=[...l].sort((a,p)=>a-p);if(!u.length)return w`<div class="nish-chart">
|
|
34
34
|
<div class="nish-empty" role="img" aria-label=${t.noDataNamed(e)} style="height:${s}px;box-sizing:border-box">${this.empty||t.noDataYet}</div>
|
|
35
|
-
</div>`;let g=r.map(a=>new Map(a.points.filter(h).map(p=>[p.x,p.y]))),c=1/0,y=-1/0;for(let a of r)for(let p of a.points)h(p)&&(c=Math.min(c,p.y),y=Math.max(y,p.y));let
|
|
35
|
+
</div>`;let g=r.map(a=>new Map(a.points.filter(h).map(p=>[p.x,p.y]))),c=1/0,y=-1/0;for(let a of r)for(let p of a.points)h(p)&&(c=Math.min(c,p.y),y=Math.max(y,p.y));let b=this.baseline!=null&&Number.isFinite(this.baseline)?this.baseline:void 0;b!==void 0&&(c=Math.min(c,b),y=Math.max(y,b)),[c,y]=gn(c,y);let $=u[0],C=u[u.length-1]===$?$+1:u[u.length-1],m=this.width,A=fe(c,y,this.yTicks||4).map(a=>({v:a,text:i(a)})),S=Math.ceil(Math.max(...A.map(a=>a.text.length))*6.6)+10,N=Math.max(0,m-S-fs),et=Math.max(0,s-Wt-ms),I=a=>S+(a-$)/(C-$)*N,O=a=>Wt+(1-(a-c)/(y-c))*et,at=Wt+et,At=r.map(a=>{let p=[],E=[];for(let Vt of[...a.points].sort((An,Rn)=>An.x-Rn.x))h(Vt)?E.push([Number(I(Vt.x).toFixed(1)),Number(O(Vt.y).toFixed(1))]):(E.length&&p.push(E),E=[]);return E.length&&p.push(E),p}),d=a=>a.map(p=>`${p[0]},${p[1]}`).join(" "),v=Math.min(this.xTicks||4,Math.max(2,Math.floor(N/72))),M=fe($,C,v),z=this.active!=null&&this.active<u.length?this.active:null,P=z!=null?u[z]:null,k=P!=null?I(P):0,Rt=P!=null?r.map((a,p)=>({s:a,i:p,y:g[p].get(P)})).filter(a=>a.y!=null):[],Sn=k<m/2,ye=a=>{this.fromKey=!1,this.moveTo(a.clientX,a.currentTarget,u,S,N,$,C)},En=a=>{if(a.key==="ArrowLeft"||a.key==="ArrowRight"){a.preventDefault(),this.fromKey=!0;let p=a.key==="ArrowRight"?1:-1,E=this.active;this.active=E==null?p>0?0:u.length-1:Math.min(u.length-1,Math.max(0,E+p))}else a.key==="Escape"&&(this.active=null)},be=r[0],_e=B(be?.tone,0),xn=m>0?w`<svg
|
|
36
36
|
width=${m}
|
|
37
37
|
height=${s}
|
|
38
38
|
role="img"
|
|
39
39
|
tabindex="0"
|
|
40
40
|
aria-label=${e}
|
|
41
41
|
style="display:block;touch-action:pan-y"
|
|
42
|
-
@pointerdown=${
|
|
43
|
-
@pointermove=${
|
|
42
|
+
@pointerdown=${ye}
|
|
43
|
+
@pointermove=${ye}
|
|
44
44
|
@pointerleave=${a=>{a.pointerType==="mouse"&&(this.active=null)}}
|
|
45
45
|
@keydown=${En}
|
|
46
46
|
@blur=${()=>{this.fromKey&&(this.active=null)}}
|
|
47
47
|
>
|
|
48
|
-
${this.area&&
|
|
48
|
+
${this.area&&be?T`<defs><linearGradient id=${this.gradId} x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color=${_e} stop-opacity="0.2"></stop><stop offset="100%" stop-color=${_e} stop-opacity="0"></stop></linearGradient></defs>`:f}
|
|
49
49
|
${A.map(a=>T`<g>
|
|
50
50
|
<line class="nish-chart-grid" x1=${S} x2=${S+N} y1=${O(a.v)} y2=${O(a.v)} stroke=${D.grid} stroke-width="1"></line>
|
|
51
51
|
<text class="nish-chart-axis" x=${S-6} y=${O(a.v)} text-anchor="end" dominant-baseline="middle" font-size="11" fill=${D.text} style="font-variant-numeric:tabular-nums">${a.text}</text>
|
|
52
52
|
</g>`)}
|
|
53
53
|
${M.map((a,p)=>T`<text class="nish-chart-axis" x=${I(a)} y=${s-6} text-anchor=${p===0?"start":p===M.length-1?"end":"middle"} font-size="11" fill=${D.text} style="font-variant-numeric:tabular-nums">${o(a)}</text>`)}
|
|
54
|
-
${
|
|
54
|
+
${b!==void 0?T`<line x1=${S} x2=${S+N} y1=${O(b)} y2=${O(b)} stroke=${D.zero} stroke-width="1" stroke-dasharray="4 4"></line>`:f}
|
|
55
55
|
${this.area?(At[0]??[]).map(a=>T`<polygon points="${a[0][0]},${at} ${d(a)} ${a[a.length-1][0]},${at}" fill="url(#${this.gradId})"></polygon>`):f}
|
|
56
56
|
${At.map((a,p)=>a.map(E=>E.length===1?T`<circle cx=${E[0][0]} cy=${E[0][1]} r="2" fill=${B(r[p].tone,p)}></circle>`:T`<polyline points=${d(E)} fill="none" stroke=${B(r[p].tone,p)} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></polyline>`))}
|
|
57
57
|
${P!=null?T`<g pointer-events="none">
|
|
58
|
-
<line x1=${k} x2=${k} y1=${
|
|
58
|
+
<line x1=${k} x2=${k} y1=${Wt} y2=${at} stroke=${D.axis} stroke-width="1"></line>
|
|
59
59
|
${Rt.map(a=>T`<circle cx=${k} cy=${O(a.y)} r="4" fill=${B(a.s.tone,a.i)} stroke="var(--nish-surface)" stroke-width="2"></circle>`)}
|
|
60
60
|
</g>`:f}
|
|
61
61
|
</svg>`:f,wn=P!=null&&m>0?w`<div class="nish-chart-tooltip" style="${gs};${Sn?`left:${k+10}px`:`right:${m-k+10}px`}">
|
|
@@ -68,7 +68,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
68
68
|
</div>`:f;return w`<div class="nish-chart" style="position:relative;width:100%;user-select:none">
|
|
69
69
|
<div style="position:relative;height:${s}px">
|
|
70
70
|
${xn}${wn}
|
|
71
|
-
<table style=${
|
|
71
|
+
<table style=${Bt}>
|
|
72
72
|
<caption>${e}</caption>
|
|
73
73
|
<thead>
|
|
74
74
|
<tr>
|
|
@@ -87,7 +87,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
87
87
|
${r.length>1?w`<ul class="nish-legend" aria-label=${t.legend}>
|
|
88
88
|
${r.map((a,p)=>w`<li class="nish-legend-item" style="--c: ${B(a.tone,p)}"><i class="nish-legend-swatch" aria-hidden="true"></i>${a.label}</li>`)}
|
|
89
89
|
</ul>`:f}
|
|
90
|
-
</div>`}};St("nish-line-chart",
|
|
90
|
+
</div>`}};St("nish-line-chart",jt);export{zt as NishBarChart,$t as NishElement,jt as NishLineChart,Kn as configureStrings,St as define};
|
|
91
91
|
/*! Bundled license information:
|
|
92
92
|
|
|
93
93
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
package/dist/elements-data.d.ts
CHANGED
|
@@ -37,8 +37,10 @@ export interface NishElementStrings {
|
|
|
37
37
|
copyManual: string;
|
|
38
38
|
/** nish-field: tag for a non-required field. */
|
|
39
39
|
optional: string;
|
|
40
|
-
/** nish-bottom-nav, nish-nav-rail
|
|
40
|
+
/** nish-bottom-nav, nish-nav-rail: default landmark label. */
|
|
41
41
|
sections: string;
|
|
42
|
+
/** nish-section-nav: default landmark label. */
|
|
43
|
+
onThisPage: string;
|
|
42
44
|
/** nish-filter-bar: sheet title and the button that opens it. */
|
|
43
45
|
filters: string;
|
|
44
46
|
/** nish-filter-bar: wide-layout clear button. */
|
|
@@ -71,6 +73,10 @@ export interface NishElementStrings {
|
|
|
71
73
|
themeLight: string;
|
|
72
74
|
/** nish-theme-toggle: name of the dark mode. */
|
|
73
75
|
themeDark: string;
|
|
76
|
+
/** nish-theme-toggle: the button's label sentence, from the current mode name to the next one. */
|
|
77
|
+
themeToggleLabel?: (current: string, next: string) => string;
|
|
78
|
+
/** nish-theme-toggle: the words appended when another site set the theme ("set on another site"). */
|
|
79
|
+
themeElsewhere?: string;
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
/** Set the words the elements show, once, for the whole page (one store shared by every entry and
|