efficient-shell 10.13.0 → 10.14.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/dist/{Browser-36HIDVL6.js → Browser-LAMGXJI6.js} +13 -13
- package/dist/{Documents-ZS4M5I3S.js → Documents-DW7I624C.js} +7 -7
- package/dist/{Files-7XO7A4YT.js → Files-VLSMINW5.js} +88 -88
- package/dist/{Notepad-6CFMSQCK.js → Notepad-54H6KCGS.js} +6 -6
- package/dist/{Preview-HV2KB3IU.js → Preview-OWMTJFTO.js} +13 -13
- package/dist/{Spreadsheet-J5AGNSGN.js → Spreadsheet-HWNS4TSX.js} +7 -7
- package/dist/ai/index.d.ts +7 -1
- package/dist/ai/index.js +32 -30
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-QDQ347RL.js → chunk-6U6WVU5F.js} +1 -1
- package/dist/{chunk-PJQGYKN6.js → chunk-7YZ5TUXE.js} +6 -6
- package/dist/{chunk-2JG5JU4M.js → chunk-ALWVHNUO.js} +4 -4
- package/dist/{chunk-AJO72CPB.js → chunk-C2L33LDZ.js} +2 -2
- package/dist/chunk-DWMOUDMX.js +1 -0
- package/dist/{chunk-WMEYNKXZ.js → chunk-E3HSZQFI.js} +16 -16
- package/dist/{chunk-UDRMZ22J.js → chunk-F5FNYNHF.js} +1 -1
- package/dist/{chunk-RPYFOQM2.js → chunk-FZO6H3ZB.js} +5 -5
- package/dist/{chunk-ZZVE64OI.js → chunk-JAKOZNZK.js} +2 -2
- package/dist/{chunk-F2MWLDN2.js → chunk-KUMEDH5M.js} +1 -1
- package/dist/{chunk-W35N7SL3.js → chunk-LKTBKVN6.js} +4 -4
- package/dist/{chunk-VTFZ6W2D.js → chunk-MKQZINBW.js} +2 -2
- package/dist/{chunk-NPK2TLIU.js → chunk-NSLQ3UYJ.js} +2 -2
- package/dist/{chunk-2SY76NFO.js → chunk-QPJQJRHZ.js} +4 -4
- package/dist/{chunk-CBEKJTXU.js → chunk-RQSVBXBV.js} +5 -5
- package/dist/index.js +63 -63
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/tokens/colour.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-STAVWXWV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BoxPlotChart as default}from"../chunk-
|
|
1
|
+
export{BoxPlotChart as default}from"../chunk-C2L33LDZ.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CandlestickChart as default}from"../chunk-
|
|
1
|
+
export{CandlestickChart as default}from"../chunk-MKQZINBW.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{CartesianPlot as default}from"../chunk-
|
|
2
|
+
export{CartesianPlot as default}from"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ChordChart as default,foldChord}from"../chunk-PN65IIYN.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-
|
|
2
|
+
export{ChordChart as default,foldChord}from"../chunk-PN65IIYN.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ColumnChart as default}from"../chunk-
|
|
2
|
+
export{ColumnChart as default}from"../chunk-RQSVBXBV.js";import"../chunk-465RRWBY.js";import"../chunk-M22B3Y5Y.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{HeatmapChart as default}from"../chunk-
|
|
2
|
+
export{HeatmapChart as default}from"../chunk-7YZ5TUXE.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{HistogramChart as default}from"../chunk-
|
|
1
|
+
export{HistogramChart as default}from"../chunk-JAKOZNZK.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-Y3R267FV.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-
|
|
2
|
+
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-Y3R267FV.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{RangeChart as default}from"../chunk-
|
|
1
|
+
export{RangeChart as default}from"../chunk-FZO6H3ZB.js";import"../chunk-VFC6QUEN.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SankeyChart as default}from"../chunk-TMNAHOJ7.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-
|
|
2
|
+
export{SankeyChart as default}from"../chunk-TMNAHOJ7.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-
|
|
2
|
+
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-LKTBKVN6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/SpecChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SpecChart as default}from"../chunk-
|
|
1
|
+
export{SpecChart as default}from"../chunk-6U6WVU5F.js";import"../chunk-GEYM4WN3.js";import"../chunk-Y3JW2GW5.js";import"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";import"../chunk-E3HSZQFI.js";import"../chunk-CK2YOGUS.js";import"../chunk-W5CJD54C.js";import"../chunk-VFC6QUEN.js";import"../chunk-RQSVBXBV.js";import"../chunk-465RRWBY.js";import"../chunk-M22B3Y5Y.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-INNIWRVU.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SunburstChart as default}from"../chunk-RCPFUDPS.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-
|
|
2
|
+
export{SunburstChart as default}from"../chunk-RCPFUDPS.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TimeSeriesChart as default}from"../chunk-
|
|
2
|
+
export{TimeSeriesChart as default}from"../chunk-E3HSZQFI.js";import"../chunk-CK2YOGUS.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-M22B3Y5Y.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-INNIWRVU.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TreemapChart as default}from"../chunk-JSGQWVYH.js";import"../chunk-46BYGPGD.js";import"../chunk-TKJBZIHT.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-
|
|
2
|
+
export{TreemapChart as default}from"../chunk-JSGQWVYH.js";import"../chunk-46BYGPGD.js";import"../chunk-TKJBZIHT.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{WaterfallChart as default}from"../chunk-
|
|
1
|
+
export{WaterfallChart as default}from"../chunk-QPJQJRHZ.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-ALWVHNUO.js";import"../chunk-QP4UPCXQ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TWVUQUUD.js";import"../chunk-TZFACUMR.js";import"../chunk-4PAWQEXM.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-E3HSZQFI.js";import{ChartFrame as a}from"./chunk-W5CJD54C.js";import{ColumnChart as l}from"./chunk-RQSVBXBV.js";import{TH_ONE_LINE as s}from"./chunk-MVZRZTQP.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{
|
|
2
|
-
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const E=y??
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{resolveSeriesColor as r,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-4PAWQEXM.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),z=$??(e=>o(e,U)),C=b??j.intensity,D=w??j.noActivity,F=h(null),G=t(F),L=g??G,R=c(),[S,V]=s(null);if(m(()=>{if(null!==S)return l(e=>"Escape"===e.key&&(V(null),!0))},[S]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
+
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const E=y??r(0),Q=v??Math.max(1,...p.flat().filter(Number.isFinite)),B=96,K=26*x.length,P=M??K+26+26,T=Math.max(2,(Math.max(97,L)-B)/d.length),W=e=>{const t=Q>0?Math.max(0,Math.min(1,e/Q)):0;return`color-mix(in oklab, ${E} ${(8+92*t).toFixed(1)}%, ${n.surface})`};/* @__PURE__ */
|
|
3
3
|
return u("div",{className:`relative ${k??""}`,ref:F,children:[
|
|
4
4
|
/* @__PURE__ */u("svg",{width:"100%",height:P,viewBox:`0 0 ${L} ${P}`,role:"img","aria-label":j.heatmap(C,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>V(null),onBlur:()=>V(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),V(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
|
|
5
5
|
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:R,x1:"0",x2:"1",children:[
|
|
6
6
|
/* @__PURE__ */f("stop",{offset:"0",stopColor:W(0)}),
|
|
7
|
-
/* @__PURE__ */f("stop",{offset:"1",stopColor:W(Q)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:
|
|
8
|
-
return f("rect",{x:B+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>V({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((L-B)/56))))===0?/* @__PURE__ */f("text",{x:B+t*T+T/2,y:K+15,textAnchor:"middle",fontSize:11,fill:
|
|
7
|
+
/* @__PURE__ */f("stop",{offset:"1",stopColor:W(Q)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:n.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=S&&(S.r!==t||S.c!==r);/* @__PURE__ */
|
|
8
|
+
return f("rect",{x:B+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>V({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((L-B)/56))))===0?/* @__PURE__ */f("text",{x:B+t*T+T/2,y:K+15,textAnchor:"middle",fontSize:11,fill:n.label,children:e},`c${t}`):null),
|
|
9
9
|
/* @__PURE__ */f("rect",{x:B,y:K+26,width:Math.min(180,Math.max(40,L-B)),height:8,rx:4,fill:`url(#${R})`}),
|
|
10
|
-
/* @__PURE__ */f("text",{x:B,y:K+48,fontSize:11,fill:
|
|
11
|
-
/* @__PURE__ */f("text",{x:B+Math.min(180,Math.max(40,L-B)),y:K+48,textAnchor:"end",fontSize:11,fill:
|
|
10
|
+
/* @__PURE__ */f("text",{x:B,y:K+48,fontSize:11,fill:n.label,children:"0"}),
|
|
11
|
+
/* @__PURE__ */f("text",{x:B+Math.min(180,Math.max(40,L-B)),y:K+48,textAnchor:"end",fontSize:11,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:z(Q)})]}),S&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[S.r]} · ${d[S.c]}`,rows:[{key:"v",label:C,color:E,value:null==p[S.r]?.[S.c]?void 0:z(p[S.r][S.c])}]})})]})}export{x as HeatmapChart};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{DragBand as e,tooltipBesideBand as t}from"./chunk-QP4UPCXQ.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{DragBand as e,tooltipBesideBand as t}from"./chunk-QP4UPCXQ.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{CHART_INK as s}from"./chunk-TZFACUMR.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-4PAWQEXM.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:A,max:N,yTickCount:P=4,formatValue:$,yAxisLabel:j,xTickAnchor:E="center",children:U,overlay:R,tooltip:z,onSelect:C,zoom:D,ariaLabel:L,className:Q,emptyLabel:S}){const W=c().charts,F=m(),I=$??(e=>d(e,F)),T=S??W.noData,V=u(null),X=a(V),B=M??X,[Z,H]=f(null),J=g();if(p(()=>{if(null!==Z)return h(e=>"Escape"===e.key&&(H(null),!0))},[Z]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
|
|
2
2
|
return x("div",{className:Q,ref:V,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:T})});const K=b.filter(Number.isFinite),O=K.every(Number.isInteger),q=void 0===A&&void 0===N?r(Math.min(0,...K),Math.max(0,...K),{intervals:P+1,integer:O}):null,G=void 0!==A&&void 0===N?r(A,Math.max(A,...K),{intervals:P+1,integer:O,zero:!1}):null,Y=q?q.lo:A??Math.min(0,...K),_=q?q.hi:G?G.hi:N??i(Math.max(...K,0)),ee=q?q.ticks:G?[Y,...G.ticks.filter(e=>e>Y)]:n([Y,_],{from:0,to:1}).ticks(P+1),te={top:12,right:16,bottom:26,left:o(ee.map(I),48)+(j?10:0)},re=te.left,ie=Math.max(re+1,B-te.right),ne=te.top,oe=k-te.bottom,le=n([Y,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(B/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
3
3
|
return y("div",{className:`relative ${Q??""}`,ref:V,children:[
|
|
4
4
|
/* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${B} ${k}`,role:"img","aria-label":L,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>H(null),onBlur:()=>H(null),onKeyDown:e=>{if(C&&null!==Z&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void C(Z);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;H(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:D?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
|
|
5
|
-
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:
|
|
6
|
-
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:
|
|
7
|
-
/* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:U({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:J,active:Z})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:J,active:Z}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===E?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:
|
|
5
|
+
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:s.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
6
|
+
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:s.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:I(e)},`t${e}`)),j&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:s.label,children:j}),
|
|
7
|
+
/* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:U({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:J,active:Z})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:J,active:Z}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===E?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),D?.drag&&/* @__PURE__ */x(e,{x0:ae.center(D.drag[0])-(ie-re)/v.length/2,x1:ae.center(D.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>H(t),onPointerDown:D?()=>D.press(t):void 0,onPointerEnter:D?()=>D.over(t):void 0,onPointerUp:D?.release,onClick:C?()=>C(t):void 0,style:C?{cursor:"pointer"}:void 0},`h${t}`))]}),z&&null!==Z&&
|
|
8
8
|
/* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(Z),ae.bandwidth,B),children:z(Z)})]})}export{v as CartesianPlot};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-
|
|
2
|
-
return m(t,{labels:s.map(e=>e.label),values:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-ALWVHNUO.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-4PAWQEXM.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),L=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
|
+
return m(t,{labels:s.map(e=>e.label),values:L,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
|
|
3
3
|
return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */m("line",{x1:o,y1:t(r.max),x2:o,y2:t(r.q3),stroke:W,strokeWidth:1.5}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="10.14.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return T("div",{className:wt,ref:Lt,children:/* @__PURE__ */T(
|
|
3
|
-
return T("div",{className:wt,ref:Lt,children:/* @__PURE__ */T("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Wt})});const Zt=X.map((t,e)=>Xt.reduce((t,a)=>t+(G(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=X.map(()=>0);for(const e of Xt)t=t.map((t,a)=>t+(G(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Xt.some(te)&&Xt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Xt.filter(t=>!te(t)):Xt).filter(t=>!re(t)),le=ee?Xt.filter(te).flatMap(t=>t.data.filter(G)):[],ne=Z?(qt.at(-1)??[]).filter(G):oe.flatMap(t=>t.data.filter(G)),ie=ee?
|
|
1
|
+
import{ChartDot as t}from"./chunk-CK2YOGUS.js";import{stepPath as e,curvePath as a,areaBetween as r,areaFrom as o}from"./chunk-VFC6QUEN.js";import{ChartDefs as l,MOTION as n,stagger as i,fillFor as s,dashFor as c,maskId as d}from"./chunk-465RRWBY.js";import{ChartSkeleton as m}from"./chunk-M22B3Y5Y.js";import{useHighlight as h,highlightOpacity as u}from"./chunk-CNYAHYE6.js";import{ChartTooltip as f}from"./chunk-G4GVLK44.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-QP4UPCXQ.js";import{pairedAxes as x,niceAxis as v,niceMax as b,linearScale as M,axisGutter as N,bandScale as w,ladderScale as j}from"./chunk-2JWPNR2U.js";import{usePlotWidth as $}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as V}from"./chunk-TWVUQUUD.js";import{ChartBrush as z}from"./chunk-INNIWRVU.js";import{resolveSeriesColor as A,CHART_INK as W,STATUS_VARS as L}from"./chunk-TZFACUMR.js";import{useShellStrings as R,useShellLocale as C}from"./chunk-4PAWQEXM.js";import{formatPercent as E,formatPlain as S}from"./chunk-C3QOHMR6.js";import{useRef as U,useState as D,useId as P,useEffect as I}from"react";import{jsx as T,jsxs as Q}from"react/jsx-runtime";var Y=12,B=16,F=26,O=52,G=t=>"number"==typeof t&&Number.isFinite(t);function K({series:K,labels:X,height:H=200,stacked:Z=!1,stackMode:J="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=R().charts,Vt=C(),zt=rt??(t=>S(t,Vt)),At=ot??zt,Wt=jt??$t.noData,Lt=U(null),Rt=$(Lt),Ct=Nt??Rt,[Et,St]=D(null),[Ut,Dt]=D(null),{highlighted:Pt}=h(),It=P(),Tt=ut??Ut,Qt=p(ht&&Tt?Tt[1]-Tt[0]+1:X.length,pt);if(I(()=>{if(null!==Et)return V(t=>"Escape"===t.key&&(St(null),!0))},[Et]),kt)/* @__PURE__ */
|
|
2
|
+
return T("div",{className:wt,ref:Lt,children:/* @__PURE__ */T(m,{height:H,width:Nt??Rt})});const Yt=X,Bt=ut??Ut??[0,Math.max(0,Yt.length-1)],[Ft,Ot]=Bt,Gt=t=>Qt.slice(ht?t.slice(Ft,Ot+1):t),Kt=lt?Gt(lt):void 0,Xt=K.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(G)).map(t=>({...t,data:Gt(t.data),pointTones:t.pointTones?Gt(t.pointTones):void 0})),Ht=t=>(ht?Ft:0)+(Qt.view?.[0]??0)+t;if(X=Gt(Yt),0===Xt.length||0===X.length)/* @__PURE__ */
|
|
3
|
+
return T("div",{className:wt,ref:Lt,children:/* @__PURE__ */T("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Wt})});const Zt=X.map((t,e)=>Xt.reduce((t,a)=>t+(G(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=X.map(()=>0);for(const e of Xt)t=t.map((t,a)=>t+(G(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Xt.some(te)&&Xt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Xt.filter(t=>!te(t)):Xt).filter(t=>!re(t)),le=ee?Xt.filter(te).flatMap(t=>t.data.filter(G)):[],ne=Z?(qt.at(-1)??[]).filter(G):oe.flatMap(t=>t.data.filter(G)),ie=ee?x([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:Z&&"percent"===J||_t||void 0!==et?null:v(Z?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=Z&&"percent"===J?1:se?se.hi:et??b(Math.max(...ne,0)),me=Z&&"percent"===J?t=>E(Math.round(100*t),0,Vt):zt,he=_t?q:se?se.ticks:M([ce,de],{from:0,to:1}).ticks(at+1),ue=N(he.map(me),O),fe=ie?N(ie.right.ticks.map(zt),B):B,pe={left:ue,right:Math.max(ue+1,Ct-fe),top:Y,bottom:H-F},ge=w(X.length,{from:pe.left,to:pe.right}),ye=_t?j(q,{from:pe.bottom,to:pe.top}):null,ke=M([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Xt.filter(re),Me=Math.max(0,...X.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?M([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),St(e=>{const a=(e??0)+t;return Math.min(X.length-1,Math.max(0,a))})},ze=Math.max(1,Math.ceil(X.length/Math.max(1,Math.floor(Ct/96))));/* @__PURE__ */
|
|
4
4
|
return Q("div",{className:`relative ${wt??""}`,ref:Lt,children:[
|
|
5
5
|
/* @__PURE__ */Q("svg",{width:"100%",height:H,viewBox:`0 0 ${Ct} ${H}`,role:"img","aria-label":$t.overIntervals(Xt.map(t=>t.label),X.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>St(null),onBlur:()=>St(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Et&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Ht(Et));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
6
|
/* @__PURE__ */T("defs",{children:/* @__PURE__ */T("clipPath",{id:It,children:/* @__PURE__ */T("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
-
/* @__PURE__ */T(
|
|
8
|
-
/* @__PURE__ */T("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:
|
|
9
|
-
/* @__PURE__ */T("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${
|
|
10
|
-
return T("path",{d:a
|
|
11
|
-
return T("rect",{x:ge.center(
|
|
12
|
-
return T("rect",{x:ge.center(
|
|
7
|
+
/* @__PURE__ */T(l,{id:It,fills:Xt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:Z?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */T("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:W.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */T("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:W.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */T("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */T("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */T("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:W.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */T("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${d(It)})`:void 0,children:Xt.map((t,l)=>{const d=A(t.slot,t.color,t.tone),m=t.mode??(Z?"area":"line"),h=u(t.key,Pt);if("step"===m){const a=X.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>G(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return T("path",{d:e(a),fill:"none",stroke:d,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const f=X.map((e,a)=>{const r=Z?qt[l]?.[a]:t.data[a];return G(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===f.length)return null;if("column"===m){const e=Math.max(1,.62*ge.bandwidth),a="solid"===t.fillVariant,r=je(t);return re(t)?/* @__PURE__ */T("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((r,o)=>{const n=t.data[o];if(!G(n)||n<=0)return null;const i=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Xt[t]?.key)).reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))(l,o),s=Ne(i+n),c=Ne(i)-(i>0?1:0);/* @__PURE__ */
|
|
11
|
+
return T("rect",{x:ge.center(o)-e/2,y:s,width:e,height:Math.max(0,c-s),rx:2,fill:t.pointTones?.[o]?L[t.pointTones[o]]:d,fillOpacity:a?1:.55},o)})},t.key):/* @__PURE__ */T("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((o,s)=>{const c=Z?qt[l]?.[s]:t.data[s];if(!G(c))return null;const m=r(c);/* @__PURE__ */
|
|
12
|
+
return T("rect",{x:ge.center(s)-e/2,y:Math.min(m,xe),width:e,height:Math.abs(xe-m),rx:2,fill:d,fillOpacity:a?1:.35,className:xt?n.rise:void 0,style:xt?i(s,26):void 0},s)})},t.key)}const p=a(f,_,tt),g=Z&&l>0?X.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?r(p,g):o(p,f,xe);/* @__PURE__ */
|
|
13
13
|
return Q("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||Z)&&
|
|
14
|
-
/* @__PURE__ */T("path",{d:y,fill:
|
|
15
|
-
/* @__PURE__ */T("path",{d:p,fill:"none",stroke:
|
|
14
|
+
/* @__PURE__ */T("path",{d:y,fill:s(It,l,t.fillVariant??bt,d),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */T("path",{d:p,fill:"none",stroke:d,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:c(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?n.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??L[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
16
|
return Q("g",{children:[
|
|
17
|
-
/* @__PURE__ */T("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */T("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Xt.map((
|
|
18
|
-
return Q("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:
|
|
17
|
+
/* @__PURE__ */T("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */T("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Xt.map((e,a)=>{if("column"===e.mode)return null;const r=ct??(st?"last":"none"),o=A(e.slot,e.color,e.tone),l=[...e.data].map(G).lastIndexOf(!0),n="all"===r?X.map((t,e)=>e).filter(t=>G(Z?qt[a]?.[t]:e.data[t])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return Q("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:e.data[r];return G(n)?/* @__PURE__ */T(t,{cx:ge.center(r),cy:je(e)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${X[r]}: ${e.label} ${zt(n)}`},r):null}),st&&l>=0&&G(Z?qt[a]?.[l]:e.data[l])&&/* @__PURE__ */T("text",{x:ge.center(l)-10,y:je(e)(Z?qt[a]?.[l]:e.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Z?qt[a]?.[l]:e.data[l])})]},`dots-${e.key}`)}),X.map((t,e)=>e%ze===0?/* @__PURE__ */T("text",{x:ge.center(e),y:H-8,textAnchor:"middle",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */T("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:W.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
19
|
/* @__PURE__ */Q("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
-
/* @__PURE__ */T("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:
|
|
21
|
-
/* @__PURE__ */T("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:
|
|
22
|
-
/* @__PURE__ */T("div",{className:"pointer-events-none absolute top-2 z-10",style:
|
|
20
|
+
/* @__PURE__ */T("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:W.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */T("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Me)})]}),Qt.drag&&/* @__PURE__ */T(g,{x0:ge(Qt.drag[0]),x1:ge(Qt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),X.map((t,e)=>/* @__PURE__ */T("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>St(e),onPointerDown:()=>Qt.press(e),onPointerEnter:()=>Qt.over(e),onPointerUp:Qt.release,onClick:yt?()=>yt(Ht(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Qt.view&&/* @__PURE__ */T(y,{from:Kt?.[0]??X[0],to:Kt?.at(-1)??X[X.length-1],count:X.length,total:Z&&"percent"!==J?At(Zt.reduce((t,e)=>t+e,0)):ae?At(be.reduce((t,e)=>t+e.data.filter(G).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Xt).filter(t=>t.data.some(G)).map(t=>{const e=t.data.filter(G),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=Z||"column"===t.mode?At(r):$t.zoomLevel(At(r/e.length),At(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Qt.clear}),ht&&Yt.length>2&&/* @__PURE__ */T(z,{className:"mt-1",labels:Yt,width:Ct,data:K[0]?.data??[],range:Bt,onRangeChange:t=>{ft?ft(t):Dt(t)}}),null!==Et&&
|
|
22
|
+
/* @__PURE__ */T("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Et),ge.bandwidth,Ct),children:/* @__PURE__ */T(f,{title:Kt?.[Et]??X[Et],rows:Xt.map((t,e)=>({key:t.key,label:t.label,color:A(t.slot,t.color,t.tone),value:G(t.data[Et])?Z&&"percent"===J?`${E(100*(Jt(t.data[Et],Et)??0),1,Vt)} · ${At(t.data[Et])}`:At(t.data[Et]):void 0})),footnote:Z&&"percent"===J?$t.inBucket(At(Zt[Et])):void 0})})]})}export{K as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Avatar as e}from"./chunk-DKGZPVLL.js";import{StatCard as a,Card as t}from"./chunk-TOVKWNI2.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-LCJRTJXT.js";import{ColumnChart as l}from"./chunk-
|
|
1
|
+
import{Avatar as e}from"./chunk-DKGZPVLL.js";import{StatCard as a,Card as t}from"./chunk-TOVKWNI2.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-LCJRTJXT.js";import{ColumnChart as l}from"./chunk-RQSVBXBV.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-TXDA7TTP.js";import{Button_default as c}from"./chunk-I4VIEGCX.js";import{TH_ONE_LINE as n}from"./chunk-MVZRZTQP.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-
|
|
2
|
-
return s(t,{labels:d,values:F,height:k,width:g,max:b,min:x,formatValue:W,yAxisLabel:y,className:M,emptyLabel:A,bandPadding:"bar"===p?.34:0,ariaLabel:O.rangeLabel(C,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:O.high,color:
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-ALWVHNUO.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-4PAWQEXM.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:L,tone:j,label:v,className:M,emptyLabel:A,radius:N=3}){const O=o().charts,V=n(),W=w??(e=>h(e,V)),C=v??O.range,F=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),Q=r(0,L,j);/* @__PURE__ */
|
|
2
|
+
return s(t,{labels:d,values:F,height:k,width:g,max:b,min:x,formatValue:W,yAxisLabel:y,className:M,emptyLabel:A,bandPadding:"bar"===p?.34:0,ariaLabel:O.rangeLabel(C,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:O.high,color:Q,value:null==u[e]?void 0:W(u[e].high)},{key:"low",label:O.low,color:Q,value:null==u[e]?void 0:W(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:Q,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
3
|
return m(c,{children:[
|
|
4
|
-
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:
|
|
5
|
-
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:
|
|
6
|
-
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:
|
|
4
|
+
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:Q,fillOpacity:.2,stroke:"none"}),
|
|
5
|
+
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:Q,strokeWidth:2,strokeLinejoin:"round"}),
|
|
6
|
+
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:Q,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as o}from"./chunk-
|
|
2
|
-
return l(o,{labels:
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as o}from"./chunk-ALWVHNUO.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-4PAWQEXM.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const A=e().charts,L=i(),v=d??(t=>Number.isInteger(t)?m(t,L):n(t,1,L)),w=x??(t=>m(t,L)),M=g??A.countAxis,N=k??A.distribution,C=h??r(c??[],s),O=a(0,b,f),P=C.map(t=>v(t.from)),R=C.map(t=>t.count);/* @__PURE__ */
|
|
2
|
+
return l(o,{labels:P,values:R,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:w,yAxisLabel:M,className:y,emptyLabel:j,ariaLabel:A.histogram(N,C.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${v(C[o].from)} – ${v(C[o].to)}`,rows:[{key:"count",label:A.observations,color:O,value:w(C[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:C.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:O,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-STAVWXWV.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},V=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,W=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,J=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,K=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(V,"[redacted]").replace(W,"[redacted]").replace(J,"[url]").replace(K,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
1
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-DWMOUDMX.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,M=0,z=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),M=Math.max(M,t.interactionId),k=M?(M-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],z,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],U=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},D=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,K=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,V=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,U,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,U,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,U,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(D,"[redacted]").replace(J,"[redacted]").replace(K,"[url]").replace(W,"[id]").replace(V,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{CHART_INK as s,resolveSeriesColorWithin as c}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-4PAWQEXM.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:L=[4,22],className:S,emptyLabel:U}){const D=m().charts,P=h(),W=z??(e=>f(e,P)),E=$??(e=>f(e,P)),V=U??D.noObservations,C=u(null),O=n(C),Q=v??O,X=p(),[B,F]=d(null);x(()=>{if(null!==B)return a(e=>"Escape"===e.key&&(F(null),!0))},[B]);const G=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),I=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),K=j||w?I.map(e=>({...e,points:e.points.filter(e=>G(e.x,j)&&G(e.y,w))})).filter(e=>e.points.length>0):I,T=I.reduce((e,t)=>e+t.points.length,0)-K.reduce((e,t)=>e+t.points.length,0);if(0===K.length)/* @__PURE__ */
|
|
2
2
|
return y("div",{className:S,ref:C,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const Z=K.flatMap(e=>e.points),H=Z.some(e=>null!=e.size),J=14,Y=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Z.map(e=>e.y),w,R,{from:k-q,to:J}),ie=t(te.ticks(5).map(E),_),le=Math.max(ie+1,Q-Y),re=ee(Z.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Z.map(e=>e.size??1))],{from:L[0],to:L[1]}),ne=B?K[B.s]:void 0,ae=B&&ne?ne.points[B.i]:void 0,se=K.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
3
|
return g("div",{className:`relative ${S??""}`,ref:C,children:[
|
|
4
4
|
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${Q} ${k}`,role:"img","aria-label":D.scatter(K.map(e=>e.label),A??D.yAxis,M??D.xAxis)+(T>0?`. ${D.outsideRange(T)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>F(null),onBlur:()=>F(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=B?se.findIndex(e=>e.s===B.s&&e.i===B.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
5
|
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:X,children:/* @__PURE__ */y("rect",{x:ie-L[1],y:J-L[1],width:le-ie+2*L[1],height:k-q-J+2*L[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
-
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:
|
|
7
|
-
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${X})`,children:K.map((e,t)=>{const i=
|
|
6
|
+
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:s.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:E(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:W(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:s.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:s.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${X})`,children:K.map((e,t)=>{const i=c(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:H?oe(l.size??0):L[0]+1,fill:i,fillOpacity:B&&B.s!==t?.25:.62,stroke:s.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),B&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??D.xAxis,color:c(ne.slot,3,ne.color,ne.tone),value:W(ae.x)},{key:"y",label:A??D.yAxis,color:c(ne.slot,3,ne.color,ne.tone),value:E(ae.y)},...null!=ae.size?[{key:"size",label:D.size,color:s.muted,value:f(ae.size,P)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as l}from"./chunk-
|
|
2
|
-
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as l}from"./chunk-ALWVHNUO.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-4PAWQEXM.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),L=Math.min(...v),j=Math.max(...v),A=.08*(j-L)||1;/* @__PURE__ */
|
|
2
|
+
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:L-A,max:j+A,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
|
|
3
3
|
return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:u?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-UNRPRMQO.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-UNRPRMQO.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-DWMOUDMX.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-4PAWQEXM.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,M]=a(b.partOf);/* @__PURE__ */
|
|
2
2
|
return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
|
|
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[n]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),M]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{w as AboutApp,u as BUILTIN_APP_INFO};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as a}from"./chunk-
|
|
2
|
-
return i(a,{labels:c.map(t=>t.label),values:
|
|
3
|
-
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&
|
|
4
|
-
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as a}from"./chunk-ALWVHNUO.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-4PAWQEXM.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),L=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
|
+
return i(a,{labels:c.map(t=>t.label),values:L,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
|
+
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
|
|
4
|
+
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
5
5
|
return i("rect",{x:t(r),y:s,width:Math.max(1,t.bandwidth),height:c,rx:b,fill:n,fillOpacity:null===o||o===r?1:.45},r)})]})})}export{c as WaterfallChart};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-M22B3Y5Y.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-G4GVLK44.js";import{CartesianPlot as m}from"./chunk-
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-M22B3Y5Y.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-G4GVLK44.js";import{CartesianPlot as m}from"./chunk-ALWVHNUO.js";import{useDragZoom as u,ChartZoomSummary as c}from"./chunk-QP4UPCXQ.js";import{CHART_INK as d,resolveSeriesColor as h,STATUS_VARS as f}from"./chunk-TZFACUMR.js";import{useShellStrings as p,useShellLocale as b}from"./chunk-4PAWQEXM.js";import{formatPercent as x,formatPlain as y}from"./chunk-C3QOHMR6.js";import{useId as v}from"react";import{jsx as M,jsxs as g,Fragment as k}from"react/jsx-runtime";function w({stacked:w=!1,stackMode:N="value",height:$=220,width:C,max:j,formatValue:L,yAxisLabel:A,className:F,emptyLabel:V,radius:z=3,loading:T=!1,animate:S=!0,glow:Y=!1,emphasise:E=!1,activeKey:O,highlight:Q="none",valueLabels:R=!1,onSelect:W,min:B,formatTooltipValue:G,tooltipLabels:H,barGap:P=4,seriesLabels:U=!1,zoomable:K=!0,series:X,labels:Z}){const q=v(),D=u(Z.length,K),I=D.view?.[0]??0,J=D.slice(Z),_=H?D.slice(H):void 0,tt=X.map(t=>({...t,data:D.slice(t.data),pointTones:t.pointTones?D.slice(t.pointTones):void 0,pointColors:t.pointColors?D.slice(t.pointColors):void 0})),{highlighted:et}=o(),at=p().charts,it=b(),nt=L??(t=>y(t,it)),ot=G??nt;if(T)/* @__PURE__ */return M(n,{height:$,width:C,variant:"bars",className:F});const lt=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const i=t.pointTones?.[e];return i?f[i]:h(t.slot,t.color,t.tone)},rt=tt.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),st=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},mt=J.map((t,e)=>rt.reduce((t,a)=>t+st(a,e),0)),ut=J.map((t,e)=>rt.reduce((t,a)=>t+Math.max(0,st(a,e)),0)),ct=J.map((t,e)=>rt.reduce((t,a)=>t+Math.min(0,st(a,e)),0)),dt=w&&"percent"===N,ht=(t,e)=>mt[e]>0?t/mt[e]:null,ft=dt?[1]:w?[...ut,...ct]:rt.flatMap(t=>t.data.filter(Number.isFinite)),pt=(t,e)=>{const a=t.bandwidth/Math.max(1,rt.length),i=rt.length>1?Math.min(P,.25*a):0;return{offset:e*a+i/2,width:Math.max(1,a-i)}},bt=U&&!w?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return J.map((i,n)=>rt.map((i,o)=>{const l=i.data[n];if(!Number.isFinite(l))return null;const r=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:s,width:m}=pt(t,o),u=t(n)+s+m/2,c=Math.min(e(r),e(a)),h=Math.max(e(r),e(a));if(m<13)return null;const f=Math.floor((h-c-12)/6.6),p=f>=Math.min(4,i.label.length),b=p&&i.label.length>f?`${i.label.slice(0,f-1).trimEnd()}…`:i.label,x=p?h-6:c-4;/* @__PURE__ */
|
|
2
2
|
return M("text",{"data-series-label":"true",x:u,y:x,transform:`rotate(-90 ${u} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?d.surface:d.label,children:b},`n${i.key}-${n}`)}))}:null;/* @__PURE__ */
|
|
3
3
|
return g(k,{children:[
|
|
4
|
-
/* @__PURE__ */M(m,{labels:
|
|
4
|
+
/* @__PURE__ */M(m,{labels:J,values:ft,height:$,width:C,max:dt?1:j,min:dt?void 0:B,formatValue:dt?t=>x(Math.round(100*t),0,it):nt,yAxisLabel:A,className:F,emptyLabel:V,onSelect:W?t=>W(I+t):void 0,zoom:K?D:void 0,ariaLabel:at.acrossCategories(rt.map(t=>t.label),J.length),tooltip:t=>/* @__PURE__ */M(s,{title:_?.[t]??J[t],rows:rt.map(e=>({key:e.key,label:e.label,color:lt(e,t),value:Number.isFinite(e.data[t])?dt?`${x(100*(ht(e.data[t],t)??0),1,it)} · ${ot(e.data[t])}`:ot(e.data[t]):void 0})),footnote:dt?at.inCategory(ot(mt[t])):void 0}),overlay:R&&!dt||bt?({x:t,y:e})=>/* @__PURE__ */g("g",{pointerEvents:"none",children:[bt?.({x:t,y:e}),R&&!dt&&J.map((a,i)=>{if(w){if(!rt.some(t=>Number.isFinite(t.data[i])))return null;const a=rt.reduce((t,e)=>t+st(e,i),0),n=a>=0?ut[i]:ct[i];/* @__PURE__ */
|
|
5
5
|
return M("text",{"data-value-label":"true",x:t.center(i),y:a>=0?e(n)-4:e(n)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(a)},`v${i}`)}return rt.map((a,n)=>{const o=a.data[i];if(!Number.isFinite(o))return null;const l=o,{offset:r,width:s}=pt(t,n);/* @__PURE__ */
|
|
6
|
-
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=
|
|
6
|
+
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=O?J.indexOf(O):-1,c=l(w?mt:rt[0]?.data??[],Q),h=m??(u>=0?u:c);/* @__PURE__ */
|
|
7
7
|
return g("g",{children:[
|
|
8
|
-
/* @__PURE__ */M(t,{id:
|
|
9
|
-
return M("rect",{x:y,y:g,width:v,height:$,rx:
|
|
8
|
+
/* @__PURE__ */M(t,{id:q,glow:Y}),J.map((t,l)=>{let s=0,m=0;const u=o(Math.min(o.domain[1],Math.max(o.domain[0],0)));return rt.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const p=dt?ht(f,l):f;if(null===p)return null;const b=lt(t,l),x=pt(n,c),y=w?n(l):n(l)+x.offset,v=w?Math.max(1,n.bandwidth):x.width;let g,k,N=!0;if(w){const t=p>=0?s:m,e=t+p;p>=0?s=e:m=e,g=o(Math.max(t,e)),k=o(Math.min(t,e)),N=0===t}else g=Math.min(o(p),u),k=Math.max(o(p),u);const $=Math.max(0,k-g-(w&&!N?2:0)),C=null===h||h===l,j=C?b:E?d.muted:b,L=r(t.key,et);/* @__PURE__ */
|
|
9
|
+
return M("rect",{x:y,y:g,width:v,height:$,rx:z,fill:j,fillOpacity:L??(C?1:E?.32:.45),filter:Y&&h===l?`url(#${i(q)})`:void 0,className:"rosh-viz-mark"+(S?` ${e.rise}`:""),style:S?a(l*(w?1:rt.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==m&&!E&&/* @__PURE__ */M("line",{x1:n.center(m),y1:o(o.domain[1]),x2:n.center(m),y2:s,stroke:d.axis,strokeWidth:1})]})}}),D.view&&/* @__PURE__ */M(c,{from:_?.[0]??J[0],to:_?.at(-1)??J[J.length-1],count:J.length,total:w?ot(mt.reduce((t,e)=>t+e,0)):void 0,rows:rt.map(t=>({s:t,sum:t.data.reduce((e,a,i)=>e+st(t,i),0)})).sort((t,e)=>e.sum-t.sum).map(({s:t,sum:e})=>({key:t.key,label:t.label,color:h(t.slot,t.color,t.tone),value:ot(e)})),onClear:D.clear})]})}export{w as ColumnChart};
|