efficient-shell 10.20.0 → 10.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{Browser-3BZPV4OH.js → Browser-XQ5GO3LJ.js} +15 -15
- package/dist/Calculator-X62IAKQY.js +29 -0
- package/dist/{CurrencyConverter-42IHLJVV.js → CurrencyConverter-PSOBQ6K2.js} +6 -6
- package/dist/{Documents-N2OS46II.js → Documents-7GOEAIJ6.js} +7 -7
- package/dist/{Files-6MMOX77N.js → Files-MMVUWO5F.js} +23 -23
- package/dist/Notepad-FAQBAF36.js +24 -0
- package/dist/PomodoroTimer-ZLS6XCTN.js +91 -0
- package/dist/{Preview-YJPVKRQU.js → Preview-DEK7WTAU.js} +38 -38
- package/dist/Sidebar-JF2KEJT2.js +44 -0
- package/dist/{Spreadsheet-3P3BL6CS.js → Spreadsheet-6C7Q6OQA.js} +13 -13
- package/dist/Stock-XHMTFEOL.js +16 -0
- package/dist/{Weather-4QPYOENN.js → Weather-X5WAHYQ3.js} +19 -19
- package/dist/{WorldClock-3ZVRBLEW.js → WorldClock-ARU7PMVZ.js} +6 -6
- package/dist/ai/index.d.ts +10 -1
- package/dist/ai/index.js +91 -91
- 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/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.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-22LRMKLV.js +6 -0
- package/dist/{chunk-O47HKK6E.js → chunk-3PO4D32J.js} +1 -1
- package/dist/{chunk-5TDQPZDB.js → chunk-4BPIGS2D.js} +5 -5
- package/dist/chunk-4DO47TT5.js +1 -0
- package/dist/{chunk-5QGBVTGS.js → chunk-4UHAQMOT.js} +2 -2
- package/dist/{chunk-Z5A4EY2R.js → chunk-53DO72B2.js} +1 -1
- package/dist/{chunk-6JSXIEH2.js → chunk-5532S4RN.js} +3 -3
- package/dist/{chunk-Y62TTKSY.js → chunk-5DIBDRB6.js} +3 -3
- package/dist/{chunk-ZWMODDVE.js → chunk-5JCHYQYI.js} +2 -2
- package/dist/chunk-5R4X7MFQ.js +1 -0
- package/dist/chunk-5XKCOKYJ.js +1 -0
- package/dist/{chunk-ZQKA2XKH.js → chunk-6CICYVCK.js} +8 -8
- package/dist/{chunk-XK42AQOJ.js → chunk-6XYGA252.js} +6 -6
- package/dist/{chunk-3UXXA2CS.js → chunk-7SMDYBQX.js} +8 -8
- package/dist/{chunk-OORL6BIG.js → chunk-7XNDWW3Y.js} +1 -1
- package/dist/{chunk-WYFMSL4Q.js → chunk-A46WK67X.js} +8 -8
- package/dist/{chunk-LAO5ZHQ6.js → chunk-AFBBNGVO.js} +9 -9
- package/dist/{chunk-G4GVLK44.js → chunk-AGPPZHAH.js} +1 -1
- package/dist/{chunk-VQCSHJEF.js → chunk-AKBGUMLI.js} +5 -5
- package/dist/{chunk-N67QX3WW.js → chunk-ARSOETMP.js} +2 -2
- package/dist/chunk-BB6A5MGA.js +1 -0
- package/dist/{chunk-NFB7PARJ.js → chunk-BJRJODRZ.js} +1 -1
- package/dist/{chunk-OP5DOO3K.js → chunk-BWTK3NUD.js} +3 -3
- package/dist/{chunk-RVRDDTEG.js → chunk-C2ZUYCIM.js} +1 -1
- package/dist/{chunk-YILGAEW3.js → chunk-C4CAPG3D.js} +1 -1
- package/dist/{chunk-W3OWPBQL.js → chunk-CGP2QCIA.js} +2 -2
- package/dist/{chunk-DGZAQXTW.js → chunk-CIXGYZCF.js} +4 -4
- package/dist/{chunk-N6CS2FO2.js → chunk-CIYMGVZC.js} +1 -1
- package/dist/{chunk-DCRLJMQ6.js → chunk-D6ZXMKW2.js} +1 -1
- package/dist/{chunk-4UKGVLFP.js → chunk-DLOJSJWL.js} +1 -1
- package/dist/{chunk-O6JJIR4H.js → chunk-DOWE3ZQR.js} +1 -1
- package/dist/{chunk-JNQKBN5M.js → chunk-E5H5OU3A.js} +5 -5
- package/dist/{chunk-UYRMW5MO.js → chunk-EE56C2JH.js} +5 -5
- package/dist/{chunk-43L5K2IX.js → chunk-ET4726WV.js} +1 -1
- package/dist/{chunk-3PR5YMWZ.js → chunk-F3ZH6UCW.js} +1 -1
- package/dist/chunk-F7U5MVNH.js +2 -0
- package/dist/{chunk-AYDW63LV.js → chunk-FHYETY4V.js} +1 -1
- package/dist/chunk-FX4KK5GE.js +3 -0
- package/dist/{chunk-2VGQS6CW.js → chunk-GCC2OZDG.js} +1 -1
- package/dist/chunk-GCMCXRIN.js +19 -0
- package/dist/{chunk-22RQC4EW.js → chunk-GCP3LGRG.js} +13 -13
- package/dist/{chunk-5SIOCKCK.js → chunk-GEDS6QO7.js} +2 -2
- package/dist/{chunk-RXCGE2AY.js → chunk-GGRD2JLB.js} +1 -1
- package/dist/{chunk-7VBXIIEC.js → chunk-GIK62TW6.js} +3 -3
- package/dist/{chunk-MVZRZTQP.js → chunk-GLE4F5FT.js} +1 -1
- package/dist/{chunk-XLCZHPCQ.js → chunk-H2C5SZKO.js} +1 -1
- package/dist/chunk-H43BVPNN.js +7 -0
- package/dist/{chunk-PW52RXPI.js → chunk-HC2AM2DT.js} +1 -1
- package/dist/{chunk-RUGQO7YF.js → chunk-HWKAFISI.js} +7 -7
- package/dist/chunk-IWOVB4WI.js +9 -0
- package/dist/{chunk-TKJBZIHT.js → chunk-KABWJIY4.js} +1 -1
- package/dist/{chunk-XLWMM53L.js → chunk-KGVNRLWT.js} +2 -2
- package/dist/{chunk-4WEFGKJL.js → chunk-KLAKLVKE.js} +12 -12
- package/dist/{chunk-S74LKSUB.js → chunk-L67WTASI.js} +1 -1
- package/dist/chunk-LIULEXWE.js +14 -0
- package/dist/chunk-LJHVEISA.js +8 -0
- package/dist/chunk-LQVW3SW4.js +6 -0
- package/dist/{chunk-GEP4FROW.js → chunk-MW3FT4WI.js} +3 -3
- package/dist/{chunk-TXDA7TTP.js → chunk-N2RIQ2OU.js} +1 -1
- package/dist/chunk-NGRTW6Y7.js +2 -0
- package/dist/{chunk-FS6EOU4G.js → chunk-NPGFCIHB.js} +1 -1
- package/dist/{chunk-3NW5LD7D.js → chunk-NS2HY4NL.js} +3 -3
- package/dist/{chunk-A42MKJA3.js → chunk-NTVOQHRS.js} +1 -1
- package/dist/{chunk-3ELLBQPS.js → chunk-NWUAATIX.js} +1 -1
- package/dist/{chunk-GMOEYB4X.js → chunk-O64PY7ZJ.js} +11 -11
- package/dist/{chunk-DHIQ46C5.js → chunk-OAVU46YG.js} +1 -1
- package/dist/{chunk-RBBIAIPH.js → chunk-OBNA7GF5.js} +8 -8
- package/dist/{chunk-FOFZI62F.js → chunk-P22NWAFW.js} +1 -1
- package/dist/{chunk-VDUXPMOQ.js → chunk-P3LKCOB4.js} +1 -1
- package/dist/chunk-PBFFKRQF.js +12 -0
- package/dist/{chunk-QHPVAXHR.js → chunk-PJBZ5B54.js} +3 -3
- package/dist/{chunk-VN4KSRZ5.js → chunk-PWUPLXSS.js} +1 -1
- package/dist/chunk-Q5WPHBDB.js +9 -0
- package/dist/{chunk-FKRPQDFX.js → chunk-QA3EAJ5H.js} +17 -17
- package/dist/{chunk-C6Y7B73Q.js → chunk-QDJQ43N4.js} +1 -1
- package/dist/{chunk-77MOYIQW.js → chunk-QFJIMX4A.js} +10 -10
- package/dist/chunk-QIMFBARF.js +8 -0
- package/dist/{chunk-FACWYKL6.js → chunk-QZMGWRZ4.js} +6 -6
- package/dist/{chunk-XCHAU2UN.js → chunk-RAMJFT3D.js} +6 -6
- package/dist/chunk-RRGMXY46.js +29 -0
- package/dist/{chunk-YSDPFDAG.js → chunk-RXO2LNIB.js} +1 -1
- package/dist/{chunk-EPY34L26.js → chunk-SAGI7AWC.js} +1 -1
- package/dist/chunk-SETRKP7W.js +11 -0
- package/dist/{chunk-LYHJHUQH.js → chunk-SRYX6AQ6.js} +1 -1
- package/dist/{chunk-GISDIVFK.js → chunk-TBQLPMW5.js} +1 -1
- package/dist/chunk-TLJWBRLI.js +8 -0
- package/dist/{chunk-PN5FQVMB.js → chunk-URQWWOHM.js} +5 -5
- package/dist/{chunk-NVD4AI5Y.js → chunk-UXPKCDEF.js} +1 -1
- package/dist/{chunk-4HBSQGRI.js → chunk-VKP2WRJJ.js} +1 -1
- package/dist/{chunk-VWIYC2NB.js → chunk-VQIG5N6D.js} +9 -9
- package/dist/{chunk-MNNZGO2E.js → chunk-VXQQQDJ3.js} +1 -1
- package/dist/chunk-WBJ6KNUF.js +1 -0
- package/dist/{chunk-UDKTAG57.js → chunk-WE3HINW3.js} +1 -1
- package/dist/chunk-WEPQU5W6.js +22 -0
- package/dist/{chunk-YJXS7BR5.js → chunk-WHISJI5L.js} +1 -1
- package/dist/{chunk-34URULVW.js → chunk-WJ6ZJVAX.js} +1 -1
- package/dist/{chunk-VIQ6OME2.js → chunk-WSMRVWWK.js} +10 -10
- package/dist/{chunk-JYIH2EBG.js → chunk-WUMPTKOG.js} +1 -1
- package/dist/{chunk-PUF75SMJ.js → chunk-WVCX2Y3S.js} +1 -1
- package/dist/{chunk-QRYSL6QU.js → chunk-XAPHUSOR.js} +16 -16
- package/dist/{chunk-HV47GP2C.js → chunk-XDCHB6JA.js} +1 -1
- package/dist/{chunk-5WYRAJ5F.js → chunk-YICFH5KO.js} +1 -1
- package/dist/{chunk-2YSGXZOL.js → chunk-ZT45XXIB.js} +29 -29
- package/dist/data/DataTable.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/format/index.d.ts +2 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/hooks/useRootIsDark.d.ts +22 -0
- package/dist/hooks/useRootIsDark.js +2 -0
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +86 -86
- package/dist/map/index.js +20 -20
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/utils/glass.js +1 -1
- package/dist/utils/rootTheme.d.ts +39 -0
- package/dist/utils/rootTheme.js +1 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-6NJNSIRN.js +0 -29
- package/dist/Notepad-QSF2MA3I.js +0 -24
- package/dist/PomodoroTimer-PD7POYX5.js +0 -91
- package/dist/Sidebar-2HHICMZZ.js +0 -44
- package/dist/Stock-IABQRSXZ.js +0 -16
- package/dist/chunk-2H6YNMBE.js +0 -14
- package/dist/chunk-5HO53ZE7.js +0 -29
- package/dist/chunk-5TQLUPZD.js +0 -6
- package/dist/chunk-67MQ5S32.js +0 -8
- package/dist/chunk-6XBWM453.js +0 -6
- package/dist/chunk-BTFBXZS2.js +0 -1
- package/dist/chunk-DESWIPOZ.js +0 -3
- package/dist/chunk-DYNJ2H6R.js +0 -8
- package/dist/chunk-EJUNGVK2.js +0 -22
- package/dist/chunk-F27JJHNJ.js +0 -1
- package/dist/chunk-FTF6JKD5.js +0 -9
- package/dist/chunk-I33SVQ7P.js +0 -8
- package/dist/chunk-I4VIEGCX.js +0 -2
- package/dist/chunk-JIGFR7Z3.js +0 -11
- package/dist/chunk-MJGK6QTO.js +0 -7
- package/dist/chunk-QDKAA3HR.js +0 -2
- package/dist/chunk-RMUSRDWV.js +0 -1
- package/dist/chunk-SLU45G5J.js +0 -19
- package/dist/chunk-TLMFVEMC.js +0 -9
- package/dist/chunk-XYBI57KO.js +0 -12
- /package/dist/{chunk-NOKZ54GD.js → chunk-CSA6CGXS.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-GEDS6QO7.js";import{Tooltip as i}from"./chunk-22LRMKLV.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:R=""}){const j=l().widths,B=a(),z=m(Math.round(x)||1,1,n),D=e($,z),S=D??[...t[z]??[]],A=[...S,100-p(S)],K=P||M,O=s(null),E=s({onChange:k,shown:S,locked:K,n:z,stored:D});E.current={onChange:k,shown:S,locked:K,n:z,stored:D};const L=t=>{const{onChange:r,shown:n,locked:o,n:i}=E.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},T=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],L(i.slice(0,-1))&&(ne.current=null)},G=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=A[e]+A[e+1],i="ArrowRight"===t.key?A[e]+n:"ArrowLeft"===t.key?A[e]-n:"PageUp"===t.key?A[e]+10:"PageDown"===t.key?A[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),T(A,e,i))},H=s(null),[I,Q]=c(null),F=()=>{H.current=null,Q(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>F,[]);const J=e=>t=>{if(0!==t.button||K)return;t.preventDefault();const r=O.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:A,moved:!1,pointer:t.pointerId},Q(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void F();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}T(t.from,t.i,t.from[t.i]+r/t.width*100)},V=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),F())},W=(e,t)=>{const{shown:n}=E.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return L(o.slice(0,-1))?o:null},[X,q]=c(0);u(()=>{const e=O.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>q(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=E.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=A.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,X]);const le=j.hint(z,r),ae=A.slice(0,-1).map((e,t)=>p(A.slice(0,t+1)));/* @__PURE__ */
|
|
2
|
+
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?B:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${R}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
4
|
/* @__PURE__ */f("div",{ref:O,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:A.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
5
|
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&A.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(A.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
6
|
+
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>X>0&&X*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(t+1),"aria-describedby":B,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||W(t,e)},onRevert:e=>((e,t)=>{E.current.locked||null===t||oe(e,t)||W(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:E.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(t+1,t+2),"aria-valuenow":A[t],"aria-valuemin":r,"aria-valuemax":A[t]+A[t+1]-r,"aria-valuetext":j.dividerValue(t+1,A[t],t+2,A[t+1]),"aria-disabled":K||void 0,onKeyDown:K?void 0:G(t),onPointerDown:J(t),onPointerMove:U,onPointerUp:V,onPointerCancel:V,onLostPointerCapture:()=>{H.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(K?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(K?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${I===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:B,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-WJ6ZJVAX.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{OneLineLabel as o}from"./chunk-GLE4F5FT.js";import{Tooltip as s}from"./chunk-22LRMKLV.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
|
|
2
2
|
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
|
|
3
3
|
/* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
4
|
/* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-XQZL6JDD.js";import{Segmented as i}from"./chunk-NWUAATIX.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-53DO72B2.js";import{TransferProgress as u}from"./chunk-OAVU46YG.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-JTMEFXRL.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{useShellStrings as b}from"./chunk-GDQJBQ5B.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:U,label:F,hint:C,error:O,required:B,className:$,accept:z="image/*",maxSizeBytes:D,fit:P="cover",height:A=112,placeholder:X,cta:q,acceptHint:H,showFilename:I=!0,allowReplace:J=!0,allowRemove:Q=!0,replaceLabel:W,removeLabel:G,busy:K=!1,busyLabel:S,choosingLabel:T,pickFailedLabel:V,progress:Y,disabled:_=!1,kind:E,onKindChange:M,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=q??ie.cta,oe=E??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof G&&G?G:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=K||ne,me=ne&&!K?T??ie.choosing:S??ie.uploading,he=O??(se?V??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=_||ue,ke=!!w&&(t(w,z)||w===ve),je=X??o(z,ie),xe=W??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:D,acceptHint:H,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ue=w?r(w):"",Fe=!ke&&!!ee,Ce=_||!J&&!Q?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[J&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
|
+
/* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),Q&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Fe?void 0:{height:A},children:[Fe?
|
|
4
|
+
/* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:P}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:P,objectPosition:Z||void 0}}),I&&w&&/* @__PURE__ */j(n,{children:Ue}),Ce,ue&&/* @__PURE__ */j(l,{label:me,progress:Y,rounded:"rounded-md"})]}),Be=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":B||void 0,"aria-describedby":he?`${be}-error`:C?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:A},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:Y}):/* @__PURE__ */k(x,{children:[
|
|
5
|
+
/* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
|
|
6
|
+
/* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
|
|
7
|
+
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),H&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:H})]})});/* @__PURE__ */
|
|
8
|
+
return k(e,{label:F,htmlFor:be,hint:C,error:he,required:B,className:$,children:[M&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>M(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Oe:Be,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-2E2SUEEE.js";import{ItemCount as n}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-2E2SUEEE.js";import{ItemCount as n}from"./chunk-P22NWAFW.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-KLAKLVKE.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-GDQJBQ5B.js";import{useState as s,useMemo as d,useRef as c,useEffect as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as h}from"react/jsx-runtime";function g(e){const t=[];let n=0;for(;n<e.length;){const r=e[n].group;let i=n;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;t.push(i>n?{group:r,start:n,end:i}:{start:n,end:n}),n=i+1}return t}function b(e,t){return e.find(e=>t>=e.start&&t<=e.end)}function k(e,t,n,r){const i=e.findIndex(e=>e.key===t.key);let l=e.findIndex(e=>e.key===n);if(i<0||l<0)return null;const o=g(e),a=b(o,i),s="group"===t.kind&&void 0!==a.group?e.slice(a.start,a.end+1).map(e=>e.key):[t.key];if(s.includes(n))return null;const d=b(o,l);if("tab"===t.kind&&void 0!==a.group){if(d!==a)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,t,n,r){const i=k(e,t,n,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),o=l.indexOf(i.key)+("after"===i.side?1:0),a=[...l.slice(0,o),...i.moving,...l.slice(o)];return a.every((t,n)=>t===e[n].key)?null:a}var v="flex-[0_1_15rem]",w=v,N="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function C(){/* @__PURE__ */
|
|
2
2
|
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function $({text:n,label:r,copiedLabel:i}){const{copied:l,copy:o}=e(n);/* @__PURE__ */
|
|
3
|
-
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(t,{copied:l,className:"size-3.5"})})}function z({node:e}){const t=c(null);return f(()=>{const n=t.current;if(n)return n.appendChild(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:t,className:"ml-1 flex shrink-0 items-center"})}function I({tabs:e,activeKey:t,idFor:f,panelMounted:b,onActivate:I,onClose:j,onCloseMany:D,label:E,className:
|
|
3
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(t,{copied:l,className:"size-3.5"})})}function z({node:e}){const t=c(null);return f(()=>{const n=t.current;if(n)return n.appendChild(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:t,className:"ml-1 flex shrink-0 items-center"})}function I({tabs:e,activeKey:t,idFor:f,panelMounted:b,onActivate:I,onClose:j,onCloseMany:D,label:E,className:A,activeClassName:B,end:T,afterPinned:K,onIconMenu:_,menuItems:M,sizing:L="even",tall:O=!1,onReorder:R,groupInfo:S}){const W=a().pageTabs,F=a().count,[X,P]=s(null),Q=O?"h-[34px]":"h-8",U=d(()=>e.map(e=>({key:e.key,group:S?e.group:void 0})),[e,S]),V=d(()=>g(U),[U]),[G,H]=s(()=>/* @__PURE__ */new Set),J=e=>H(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Y=d(()=>{const n=[];for(const r of V)for(let i=r.start;i<=r.end;i++)void 0!==r.group&&G.has(r.group)&&e[i].key!==t||n.push(e[i]);return n},[V,G,e,t]),q=c(null),[Z,ee]=s(null),te=(t,n)=>R?{draggable:!0,onDragStart:n=>{q.current=t,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",e.find(e=>e.key===t.key)?.title??"")},onDragOver:e=>{const r=q.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=n!==t.key||"tab"===t.kind?e.clientX<i.left+i.width/2?"before":"after":"before",o=x(U,r,n,l)?k(U,r,n,l):null;o?(e.preventDefault(),e.dataTransfer.dropEffect="move",Z?.key===o.key&&Z.side===o.side||ee({key:o.key,side:o.side})):Z&&ee(null)},onDrop:e=>{const t=q.current;if(!t||!Z)return;e.preventDefault();const n=x(U,t,Z.key,Z.side);q.current=null,ee(null),n&&R(n)},onDragEnd:()=>{q.current=null,ee(null)}}:{},ne=d(()=>new Set(V.filter(e=>void 0!==e.group&&S).map(t=>e[t.start].key)),[V,e,S]),re=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ie=e=>Z?.key===e&&!("before"===Z.side&&ne.has(e))&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:re(Z.side)}),le=e.length;u(()=>{if(!t)return;const e=document.getElementById(f(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,t,le]);const oe=K?Y.findIndex(e=>!e.pinned):-1,ae=Y.some(e=>e.key===t)?t:Y[0]?.key,se=e=>{const t=Y[(e+Y.length)%Y.length];t&&document.getElementById(f(t.key,"tab"))?.focus()},de=(e,t)=>{const n=Y[e+t];if(!R||!n)return;const r=x(U,{kind:"tab",key:Y[e].key},n.key,t<0?"before":"after");r&&(R(r),setTimeout(()=>document.getElementById(f(Y[e].key,"tab"))?.focus(),0))},ce=X?e.find(e=>e.key===X.key):void 0,ue=ce&&M?M(ce.key):[],me=ce?e.indexOf(ce):-1,fe=e=>e.some(e=>!e.pinned),pe=e=>()=>{P(null),e()},ye=(e,n)=>{const r=e.key===t,i=!!e.dirty,l=e.icon,a=r?B??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!n&&!r&&n.key!==t,d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":b?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===ae?0:-1,title:e.title,onClick:()=>I(e.key)},c={onContextMenu:t=>((e,t)=>{e.preventDefault(),P({x:e.clientX,y:e.clientY,key:t.key})})(t,e),onAuxClick:t=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),j(t.key))})(t,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
4
4
|
/* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
|
|
5
|
-
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!
|
|
5
|
+
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!_&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${Q} ${l?"w-10":""} ${a}`,...c,...te({kind:"tab",key:e.key},e.key),children:[ie(e.key),
|
|
6
6
|
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-md ${l?"w-full":"px-3"} ${N}`,children:[u,
|
|
7
7
|
/* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
8
|
-
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${
|
|
9
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
8
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${Q} ${"active-full"===L&&r?"":"@container"} ${"active-full"===L?r?"flex-[0_0_15rem] min-w-0":w:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===L?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${a}`,...c,...te({kind:"tab",key:e.key},e.key),children:[ie(e.key),h&&
|
|
9
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":W.tabMenu,title:W.tabMenu,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();_?.(e.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${N}`,children:u}),
|
|
10
10
|
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${h?"pl-2":"pl-3"} ${N} ${r?h?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!h&&u,
|
|
11
|
-
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===
|
|
12
|
-
/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
13
|
-
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
14
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":
|
|
11
|
+
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===L&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
12
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":W.favorite,title:W.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(o,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(z,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y($,{text:e.copy,label:W.copy(e.copy),copiedLabel:W.copied}),
|
|
13
|
+
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":W.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
14
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":W.closeTab?.(e.title)??`${W.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(C,{})})]})]})]},e.key)},he=[];let ge,be=0,ke=!K;for(const t of V){const r=Y.filter(n=>{const r=e.indexOf(n);return r>=t.start&&r<=t.end});if(ke||be!==oe||(ke=!0,he.push(/* @__PURE__ */y(m,{children:K},"rosh-after-pinned")),ge=void 0),be+=r.length,void 0===t.group||!S){for(const e of r)he.push(ye(e,ge)),ge=e;continue}ge=void 0;const i=t.group,l=S(i),a=t.end-t.start+1,s=!G.has(i),d=e[t.start].key;he.push(
|
|
15
15
|
/* @__PURE__ */p("div",{role:"group","aria-label":l.label,"data-tab-group":i,className:"relative mx-1 flex shrink-0 items-end first:ml-0 min-w-0",children:[
|
|
16
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":s,title:
|
|
16
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":s,title:W.groupToggle(l.label,a),onClick:()=>J(i),...te({kind:"group",key:d},d),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${N}`,children:[
|
|
17
17
|
/* @__PURE__ */y(o,{name:s?"chevron-down":"chevron-right","aria-hidden":"true",className:"size-3",strokeWidth:2}),l.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:l.icon}),
|
|
18
18
|
/* @__PURE__ */y("span",{className:"max-w-[8rem] truncate",children:l.label}),
|
|
19
|
-
/* @__PURE__ */y(n,{count:a,label:
|
|
20
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${d}`))}return ke||he.push(/* @__PURE__ */y(m,{children:
|
|
19
|
+
/* @__PURE__ */y(n,{count:a,label:F.tabs(a),active:!0})]}),Z?.key===d&&"before"===Z.side&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:re("before")}),r.map((e,t)=>ye(e,t>0?r[t-1]:void 0)),
|
|
20
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${d}`))}return ke||he.push(/* @__PURE__ */y(m,{children:K},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:A??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
21
21
|
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
22
|
-
/* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const t=Y.findIndex(t=>document.getElementById(f(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)de(t,1);else if(n&&"ArrowLeft"===e.key)de(t,-1);else if("ArrowRight"===e.key)se(t+1);else if("ArrowLeft"===e.key)se(t-1);else if("Home"===e.key)se(0);else if("End"===e.key)se(Y.length-1);else{if("Delete"!==e.key||Y[t].pinned)return;j(Y[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:he}),
|
|
22
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const t=Y.findIndex(t=>document.getElementById(f(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)de(t,1);else if(n&&"ArrowLeft"===e.key)de(t,-1);else if("ArrowRight"===e.key)se(t+1);else if("ArrowLeft"===e.key)se(t-1);else if("Home"===e.key)se(0);else if("End"===e.key)se(Y.length-1);else{if("Delete"!==e.key||Y[t].pinned)return;j(Y[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:he}),T&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:T}),X&&ce&&/* @__PURE__ */p(r,{portal:!0,style:{left:X.x,top:X.y},onClose:()=>P(null),children:[ue.length>0&&/* @__PURE__ */p(h,{children:[ue.map((e,t)=>/* @__PURE__ */p(i,{onClick:pe(e.onSelect),children:[e.icon,e.label]},t)),
|
|
23
23
|
/* @__PURE__ */y(l,{})]}),
|
|
24
|
-
/* @__PURE__ */y(i,{disabled:ce.pinned,onClick:pe(()=>j(ce.key)),children:
|
|
24
|
+
/* @__PURE__ */y(i,{disabled:ce.pinned,onClick:pe(()=>j(ce.key)),children:W.close}),
|
|
25
25
|
/* @__PURE__ */y(l,{}),
|
|
26
|
-
/* @__PURE__ */y(i,{disabled:!fe(e.filter(e=>e.key!==ce.key)),onClick:pe(()=>D("others",ce.key)),children:
|
|
27
|
-
/* @__PURE__ */y(i,{disabled:!fe(e.slice(me+1)),onClick:pe(()=>D("right",ce.key)),children:
|
|
28
|
-
/* @__PURE__ */y(i,{disabled:!fe(e),onClick:pe(()=>D("all",null)),children:
|
|
26
|
+
/* @__PURE__ */y(i,{disabled:!fe(e.filter(e=>e.key!==ce.key)),onClick:pe(()=>D("others",ce.key)),children:W.closeOthers}),
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:!fe(e.slice(me+1)),onClick:pe(()=>D("right",ce.key)),children:W.closeRight}),
|
|
28
|
+
/* @__PURE__ */y(i,{disabled:!fe(e),onClick:pe(()=>D("all",null)),children:W.closeAll})]})]})}export{I as TabStrip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-ORIXCEKO.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-ORIXCEKO.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-NGRTW6Y7.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-
|
|
2
|
-
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-KABWJIY4.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-AGPPZHAH.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:W}){const A=m().charts,C=c(),F=N??(e=>h(e,C)),w=W??A.nothingToCompare,B=p(),[R,H]=u(null),{highlighted:L}=a(),Q=x;if(k.length<3||0===Q.length)/* @__PURE__ */
|
|
2
|
+
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const Y=y/2,z=y/2,E=y/2-46,J=n(k.length),P=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...Q.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/P[e])),l=J.center(e)-J.step/2;return[Y+E*r*Math.cos(l),z+E*r*Math.sin(l)]},U=(e,t)=>null!==R?R!==e:null!==L&&L!==t,Z=null!==R?Q[R]:void 0;/* @__PURE__ */
|
|
3
3
|
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
-
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":
|
|
5
|
-
/* @__PURE__ */d("title",{id:
|
|
4
|
+
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":B,onMouseLeave:()=>H(null),children:[
|
|
5
|
+
/* @__PURE__ */d("title",{id:B,children:A.acrossMeasures(Q.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=E*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:Y,cy:z,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(Y,z,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,P[t]);/* @__PURE__ */
|
|
6
6
|
return f("g",{children:[
|
|
7
|
-
/* @__PURE__ */d("line",{x1:
|
|
8
|
-
/* @__PURE__ */d("text",{x:
|
|
9
|
-
/* @__PURE__ */d(r,{id:
|
|
10
|
-
return f("g",{opacity:
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),
|
|
7
|
+
/* @__PURE__ */d("line",{x1:Y,y1:z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:Y+(E+18)*Math.cos(J.center(t)-J.step/2),y:z+(E+18)*Math.sin(J.center(t)-J.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
+
/* @__PURE__ */d(r,{id:B,reveal:!!j&&"center-out"}),Q.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>H(t),mask:j?`url(#${l(B)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Z.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(R,3,Z.color,Z.tone),value:F(Z.values[t]??0)}))})}),
|
|
12
12
|
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:Q.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
13
|
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
14
|
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
-
/* @__PURE__ */d(e,{caption:
|
|
15
|
+
/* @__PURE__ */d(e,{caption:A.acrossMeasures(Q.map(e=>e.label),k.length),head:[A.tableSeries,...k.map(e=>e.label)],rows:Q.map(e=>[e.label,...k.map((t,r)=>F(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-AGPPZHAH.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{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-GDQJBQ5B.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:D=[4,22],className:P,emptyLabel:S}){const U=m().charts,L=h(),B=z??(e=>f(e,L)),Q=$??(e=>f(e,L)),W=S??U.noObservations,C=u(null),E=n(C),H=v??E,O=p(),[V,Z]=d(null);x(()=>{if(null!==V)return c(e=>"Escape"===e.key&&(Z(null),!0))},[V]);const F=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),G=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),I=j||w?G.map(e=>({...e,points:e.points.filter(e=>F(e.x,j)&&F(e.y,w))})).filter(e=>e.points.length>0):G,J=G.reduce((e,t)=>e+t.points.length,0)-I.reduce((e,t)=>e+t.points.length,0);if(0===I.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:P,ref:C,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const T=I.flatMap(e=>e.points),X=T.some(e=>null!=e.size),K=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(T.map(e=>e.y),w,R,{from:k-q,to:K}),ie=t(te.ticks(5).map(Q),_),le=Math.max(ie+1,H-Y),re=ee(T.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...T.map(e=>e.size??1))],{from:D[0],to:D[1]}),ne=V?I[V.s]:void 0,ae=V&&ne?ne.points[V.i]:void 0,se=I.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${P??""}`,ref:C,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${H} ${k}`,role:"img","aria-label":U.scatter(I.map(e=>e.label),A??U.yAxis,M??U.xAxis)+(J>0?`. ${U.outsideRange(J)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Z(null),onBlur:()=>Z(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=V?se.findIndex(e=>e.s===V.s&&e.i===V.i):0;Z(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
+
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:O,children:/* @__PURE__ */y("rect",{x:ie-D[1],y:K-D[1],width:le-ie+2*D[1],height:k-q-K+2*D[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:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:B(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${O})`,children:I.map((e,t)=>{const i=s(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:X?oe(l.size??0):D[0]+1,fill:i,fillOpacity:V&&V.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>Z({s:t,i:r})},`${e.key}-${r}`))})})]}),V&&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??U.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:B(ae.x)},{key:"y",label:A??U.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:Q(ae.y)},...null!=ae.size?[{key:"size",label:U.size,color:a.muted,value:f(ae.size,L)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-SRYX6AQ6.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:P=""}){const A=x||!!p,$=n(u),I=l(null),K=s(),R=[B?.["aria-describedby"],j?K:void 0].filter(Boolean).join(" ")||void 0,S=B?.tabIndex;a(()=>{const e=I.current;if(!e||void 0!==S)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===$?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},X=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":
|
|
5
|
-
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":A||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":A?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;I.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":R,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",P].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[X&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[X,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:X})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:K})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(t,{side:m,width:P,onResize:T,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:
|
|
4
|
-
return f("div",
|
|
5
|
-
/* @__PURE__ */p(g,{phone:W,top:l,fallback:
|
|
6
|
-
/* @__PURE__ */p(v,{phone:W,bottom:n,label:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-4UHAQMOT.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:j="bg-white"}){const z="right"===m,C=i().sidebar,D=a(),W=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[P,T]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:P},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),E?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
+
/* @__PURE__ */p(t,{side:m,width:P,onResize:T,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:C.resize})]}),M=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
|
|
4
|
+
return f("div",D?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
+
/* @__PURE__ */p(g,{phone:W,top:l,fallback:C.sections}),M,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:W,bottom:n,label:C.sections,closeLabel:C.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:I,M,z?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
|
|
7
7
|
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
8
|
/* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
9
|
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-HWKAFISI.js";import{ImageLightbox as a}from"./chunk-WSMRVWWK.js";import{MarqueeBox as i}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-QVZKRROQ.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-V6Y4OC6K.js";import{Breadcrumbs as d}from"./chunk-XYECIBVX.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-MS5APD3V.js";import{useMediaMoveItems as p}from"./chunk-OPN4I565.js";import{copyToClipboard as h}from"./chunk-TMMNCXQT.js";import{DropdownMenu as f}from"./chunk-URQWWOHM.js";import{NativeSelect as g}from"./chunk-GCMCXRIN.js";import{MediaUploadGrid as v}from"./chunk-7SMDYBQX.js";import{MediaUsedInList as k}from"./chunk-WE3HINW3.js";import{Segmented as y}from"./chunk-NWUAATIX.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as C}from"./chunk-CGP2QCIA.js";import{Banner as x}from"./chunk-ZGOHRLXG.js";import{Input_default as N}from"./chunk-MAMWQCJ6.js";import{IconButton_default as I}from"./chunk-WVCX2Y3S.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-JTMEFXRL.js";import{ColoredBadge as j}from"./chunk-SAGI7AWC.js";import{Button_default as z}from"./chunk-NGRTW6Y7.js";import{buttonClasses as T}from"./chunk-UQYNPYF4.js";import{Icon as F}from"./chunk-2UO47XB4.js";import{Tooltip as O}from"./chunk-22LRMKLV.js";import{usePlotWidth as L}from"./chunk-MAFUXCPZ.js";import{useShellStrings as A}from"./chunk-GDQJBQ5B.js";import{useRef as M,useMemo as P,useCallback as E,useState as R,useEffect as W}from"react";import{jsxs as K,Fragment as U,jsx as B}from"react/jsx-runtime";var V="application/x-efficient-media-files",G="application/x-efficient-media-folder",Q="application/x-efficient-media-file";function X(e){if(!e||!Array.from(e.types).includes(Q))return null;try{const n=JSON.parse(e.getData(Q));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var H={type:"all",use:"any",sort:"newest"},Y={lock:/* @__PURE__ */B(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */B(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */B(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */B(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */B(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */B(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */B(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */B(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */B(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */B(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */B(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */B(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */B(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */B(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */B(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */B(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},J={link:/* @__PURE__ */B(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */B(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */B(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */B(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $({value:e,label:n,onDone:l}){const[a,i]=R(e),r=M(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return B(N,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function q(F){const{mode:X="manage",layout:q="auto",location:Z,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=H,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:Ce,onMove:xe,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Fe,onChoose:Oe,onCancel:Le,pickNote:Ae,onDragOut:Me,className:Pe=""}=F,Ee=A().mediaLibrary,Re=A().media,We="pick"===X,Ke=!We,Ue=M(null),Be=L(Ue,"phone"===q?343:1200),Ve="phone"===q||"auto"===q&&Be<640,Ge=P(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Qe=P(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Xe=P(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Qe.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Qe]),He=E(e=>{const n=[];for(let l=e?Qe.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Qe.get(l.parentId):void 0);return n},[Qe,ee.length]),Ye=E((e,n)=>He(e).some(e=>e.id===n),[He]),[Je,$e]=R(()=>/* @__PURE__ */new Set(["@files"])),qe=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Ze=E(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=Z).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;W(()=>{if("files"===Z.place)Ze(["@files",...He(Z.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===Z.place){const e=Z.nodeId?Ge.get(Z.nodeId)?.path??[]:[];Ze(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===Z.place,ln="trash"===Z.place,an="files"===Z.place,rn=an?Z.folderId:null,tn=nn&&Z.nodeId?Ge.get(Z.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=P(()=>ie.map(e=>e.id),[ie]),sn=P(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=P(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=M(!0);W(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");W(()=>{me&&cn.setSelection(me)},[hn]);const fn=M(hn??""),gn=un.join("\0");W(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{We?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=R(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Qe.get(n.id)?.name:sn.get(n.id)?.name)&&Ce?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);Ze(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},Cn=E(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=Qe.get(e.id);return n===e.id||n&&Ye(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:u,label:Ee.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Xe.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Xe,Qe,an,Ye,rn,Ee]),xn=E(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=R(null),Dn={words:Ee,media:Re,denied:fe,moveTargets:Cn,kindOf:xn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Ke?e=>{wn(e)}:void 0,rename:Ce&&Ke?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:xe&&Ke?xe:void 0,trash:Ne&&Ke?Ne:void 0,deleteFolder:Ie&&Ke?Ie:void 0,folderNotEmpty:e=>!!Qe.get(e)?.notEmpty,replace:ze&&Ke?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&h(Ee.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),zn=(e,n)=>{We||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Tn,Fn]=R(null),[On,Ln]=R(null),[An,Mn]=R(null);W(()=>{if(!On&&!Tn)return;const e=()=>{Ln(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const Pn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!xe||fe.move||We)&&(!!Pn(e,V)||!(!Pn(e,G)||!An)&&(n!==An&&!(n&&Ye(n,An)))),Rn=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),Fn(null),Pn(e,V)){let l;try{l=JSON.parse(e.dataTransfer.getData(V))}catch{l=null}Array.isArray(l)&&l.length&&xe({kind:"files",ids:l.map(String)},n)}else An&&(xe({kind:"folder",id:An},n),Mn(null))}}),Wn=e=>{const n=e=>Pn(e,V)||Pn(e,G)||Pn(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&On!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Kn=(e,n,l)=>/* @__PURE__ */B(O,{side:"right",content:On===e?Ee.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */B("span",{children:n})}),Un=e=>({onContextMenu:n=>{jn.open(n,e)}}),Bn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Je.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */B(n,{label:Kn(r,e.name,t),level:a,icon:d&&o?Y.folderOpen:Y.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:nn&&Z.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>qe(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Wn(r),...Ke?Un({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */B(l,{children:Bn(d,a+1,t)})]},e.id)}),Vn=(e,a)=>(Xe.get(e)??[]).map(e=>{const i=Xe.get(e.id),r=Je.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */B(n,{label:e.name,level:a,icon:i&&r?Y.folderOpen:Y.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:t||an&&Z.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:An===e.id,draggable:Ke&&!!xe&&!fe.move,rename:t?/* @__PURE__ */B($,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Ke&&o.length?/* @__PURE__ */B(f,{align:"end","aria-label":Ee.folderActions,trigger:Y.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Rn(e.id,e.id),...Ke?Un({kind:"folder",id:e.id}):{},...Ke&&xe&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(G,e.id),Mn(e.id)},onDragEnd:()=>{Mn(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */B(l,{children:Vn(e.id,a+1)})]},e.id)}),Gn=Je.has("@files"),Qn=Je.has("@products"),Xn=/* @__PURE__ */K(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */K(U,{children:[
|
|
7
|
+
/* @__PURE__ */B(n,{label:Kn("@products",Ee.products),level:1,icon:Y.lock,badge:{label:Ee.readOnlyBadge,tone:"neutral"},expanded:ne.length?Qn:void 0,onToggle:()=>qe("@products"),selected:nn&&null==Z.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Wn("@products")}}),Qn&&ne.length>0&&/* @__PURE__ */B(l,{children:Bn(ne,2)})]}),
|
|
8
|
+
/* @__PURE__ */B(n,{label:Ee.allFiles,level:1,icon:Gn?Y.folderOpen:Y.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Xe.get(null)?.length?Gn:void 0,onToggle:()=>qe("@files"),selected:an&&null==Z.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Rn("@files",null)}}),Gn&&(Xe.get(null)?.length??0)>0&&/* @__PURE__ */B(l,{children:Vn(null,2)}),Ke&&/* @__PURE__ */B(n,{label:Ee.trash,level:1,icon:Y.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Hn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=Z.nodeId?Ge.get(Z.nodeId)?.path??[]:[];return[{label:Ee.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=He(rn);return[{label:Ee.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Yn=nn?Ee.readOnly:fe.upload,Jn=!!be&&!ln&&!Yn,$n=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Jn,onAccept:e=>be?.(e,rn)}),qn=nn?Ee.noProductFolder:fe.newFolder,Zn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&we&&!ln&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.folderPlus,onClick:()=>{wn(rn)},...Zn(qn),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */B(z,{variant:"primary",size:"sm",leftIcon:Y.upload,onClick:()=>$n.open(),...Zn(Yn),children:Ee.upload}),Ke&&ln&&je&&ie.length>0&&/* @__PURE__ */B(z,{variant:"danger",size:"sm",onClick:je,...Zn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */B("div",{style:{width:Ve?void 0:i,flex:Ve?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */B(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */B("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */B(N,{size:"sm",type:"search",leftIcon:Y.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Ke&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */B(y,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:Y.grid},{value:"list",label:Ee.list,icon:Y.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:J.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:J.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:J.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:J.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */B(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Ke&&an&&!!xe&&!fe.move,tl=!!Me&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Q]:ol(e)}}:{}})),sl=Ve?Math.max(72,Math.floor((Be-24-16-1)/3)):112,cl=M(null),ul=c({containerRef:cl,enabled:Ke&&!Ve&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(We){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */B(r,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */B(r,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */B(r,{variant:"dashed",title:Ee.trashEmpty}):!Jn||We?/* @__PURE__ */B(r,{variant:"dashed",title:Ee.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */B("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Ee.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Q,ol(e)),Me("start")}:void 0,onDragEnd:ol(e)?e=>Me("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
9
|
+
/* @__PURE__ */B("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */B("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */B("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */B("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */B(v,{items:dl,readOnly:!Jn||We,onFiles:Jn&&!We?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?V:tl?Q:void 0,onDragOutChange:tl?e=>Me(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ke?zn:void 0,menuOnMedia:Ke})),gl=p({count:un.length,kind:xn(un),targets:Cn({kind:"files",ids:un}),onPick:e=>xe?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=T({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */B(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(U,{children:[Y.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Ke&&un.length>1&&!nn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */B(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ee.selected(un.length)}),/* @__PURE__ */K(U,ln?{children:[De&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.undo,onClick:()=>De(un),...Zn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */B(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...Zn(fe.deleteForever),children:Ee.deleteForever})]}:{children:[xe&&kl,Ce&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.edit,disabled:!0,children:Ee.rename}),Ne&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.trash,onClick:()=>Ne({kind:"files",ids:un}),...Zn(fe.trash),children:Ee.moveFilesToTrash(un.length)})]}),
|
|
13
|
+
/* @__PURE__ */B(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ee.name,a?/* @__PURE__ */B($,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return K("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */B("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */B(x,{tone:"neutral",title:Ee.readOnlyBadge,children:on(tn)}),
|
|
16
|
+
/* @__PURE__ */B(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */K("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */B("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */B(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ee.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Ke&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.swap,onClick:()=>ze(e.id),...Zn(fe.replace),children:Ee.replace}),Te&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.crop,onClick:()=>Te(e.id),children:Ee.cropEdit}),xe&&"submenu"===i?.type&&/* @__PURE__ */B(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(U,{children:[Y.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),Ce&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.edit,onClick:()=>yn({kind:"file",id:e.id}),...Zn(fe.rename),children:Ee.rename}),Ne&&/* @__PURE__ */B(I,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:Y.trash})]}),ln&&Ke&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */B(z,{variant:"primary",size:"sm",leftIcon:Y.undo,onClick:()=>De([e.id]),...Zn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */B(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...Zn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Fe&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",leftIcon:Y.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ee.openInDesign}),he&&/* @__PURE__ */B(k,{items:he})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,Cl=We?/* @__PURE__ */K("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
19
|
+
/* @__PURE__ */B("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ee.oneChosen(mn.name):Ee.noneChosen}),
|
|
20
|
+
/* @__PURE__ */K("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */B(z,{variant:"secondary",size:"sm",onClick:Le,children:Ee.cancel}),
|
|
21
|
+
/* @__PURE__ */B(z,{variant:"primary",size:"sm",disabled:!mn,...Zn(wl),onClick:()=>{mn&&!wl&&Oe?.(mn)},children:Ee.chooseImage})]})]}):null,xl=Ke&&!!mn,Nl=/* @__PURE__ */K("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */B(x,{tone:"neutral",children:Ae}),
|
|
22
|
+
/* @__PURE__ */K("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */B(d,{items:Hn}),_n]}),ll,yl,
|
|
24
|
+
/* @__PURE__ */K("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Ke&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
25
|
+
/* @__PURE__ */B(i,{rect:ul.rect})]}),Jn&&/* @__PURE__ */B("input",{...$n.inputProps}),
|
|
26
|
+
/* @__PURE__ */B(S,{rejections:$n.rejections})]});/* @__PURE__ */
|
|
27
|
+
return K("div",{ref:Ue,"data-media-library":"","data-layout":Ve?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Pe}`.trim(),children:[/* @__PURE__ */K("div",Ve?{className:"flex flex-col gap-3 p-3",children:[Xn,Nl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */B("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Xn}),
|
|
29
|
+
/* @__PURE__ */B("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Nl}),xl&&/* @__PURE__ */B("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),Cl,Ve&&/* @__PURE__ */B(o,{open:xl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */B(C,{...jn.props,items:Sn(jn.state.data)}),null!=Nn&&ie.length>0&&/* @__PURE__ */B(a,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Nn,ie.length-1),onClose:()=>In(null)})]})}export{V as MEDIA_FILES_DRAG_TYPE,Q as MEDIA_FILE_DRAG_TYPE,G as MEDIA_FOLDER_DRAG_TYPE,q as MediaLibrary,X as readMediaFileDrag};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-ZGOHRLXG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-ZGOHRLXG.js";import{Button_default as t}from"./chunk-NGRTW6Y7.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-N2RIQ2OU.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-GLE4F5FT.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-AGPPZHAH.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-GDQJBQ5B.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,B=h(null),F=t(B),G=g??F,Q=c(),[R,S]=s(null);if(m(()=>{if(null!==R)return n(e=>"Escape"===e.key&&(S(null),!0))},[R]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
+
return f("div",{className:k,ref:B,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const H=y??l(0),L=v??Math.max(1,...p.flat().filter(Number.isFinite)),P=96,V=26*x.length,Z=M??V+26+26,E=Math.max(2,(Math.max(97,G)-P)/d.length),T=e=>{const t=L>0?Math.max(0,Math.min(1,e/L)):0;return`color-mix(in oklab, ${H} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
|
|
3
|
+
return u("div",{className:`relative ${k??""}`,ref:B,children:[
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:Z,viewBox:`0 0 ${G} ${Z}`,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:()=>S(null),onBlur:()=>S(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(),S(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
|
+
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:Q,x1:"0",x2:"1",children:[
|
|
6
|
+
/* @__PURE__ */f("stop",{offset:"0",stopColor:T(0)}),
|
|
7
|
+
/* @__PURE__ */f("stop",{offset:"1",stopColor:T(L)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=R&&(R.r!==t||R.c!==r);/* @__PURE__ */
|
|
8
|
+
return f("rect",{x:P+r*E+A/2,y:26*t+A/2,width:Math.max(1,E-A),height:26-A,rx:N,fill:T(n),opacity:i?.55:1,onMouseEnter:()=>S({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((G-P)/56))))===0?/* @__PURE__ */f("text",{x:P+t*E+E/2,y:V+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
|
|
9
|
+
/* @__PURE__ */f("rect",{x:P,y:V+26,width:Math.min(180,Math.max(40,G-P)),height:8,rx:4,fill:`url(#${Q})`}),
|
|
10
|
+
/* @__PURE__ */f("text",{x:P,y:V+48,fontSize:11,fill:r.label,children:"0"}),
|
|
11
|
+
/* @__PURE__ */f("text",{x:P+Math.min(180,Math.max(40,G-P)),y:V+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:z(L)})]}),R&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[R.r]} · ${d[R.c]}`,rows:[{key:"v",label:C,color:H,value:null==p[R.r]?.[R.c]?void 0:z(p[R.r][R.c])}]})})]})}export{x as HeatmapChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as r}from"./chunk-
|
|
1
|
+
import{Tooltip as r}from"./chunk-22LRMKLV.js";import{useShellStrings as e}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
2
2
|
/* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
3
3
|
/* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
4
4
|
/* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
1
|
+
import{Tooltip as e}from"./chunk-22LRMKLV.js";import{jsx as a,jsxs as l}from"react/jsx-runtime";function r({options:r,value:i,onChange:o,onClear:s,columns:n,captions:t=!1,label:c,className:d="","aria-labelledby":u}){/* @__PURE__ */
|
|
2
2
|
return a("div",{role:"group","aria-label":u?void 0:c,"aria-labelledby":u,style:n?{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${n?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${d}`.replace(/\s+/g," ").trim(),children:r.map(r=>{const n=r.value===i,c=/* @__PURE__ */l("button",{type:"button","aria-pressed":n,"aria-label":t?void 0:r.label,disabled:r.disabled||void 0,onClick:()=>{n?s?.():o(r.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${t?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${n?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[r.picture,t&&/* @__PURE__ */a("span",{className:"max-w-full truncate text-2xs leading-4",children:r.label})]});return t?/* @__PURE__ */a("div",{className:"flex min-w-0",children:c},r.value):/* @__PURE__ */a(e,{content:r.label,describe:!1,className:"relative flex min-w-0",children:c},r.value)})})}export{r as PictureTiles};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{AccessibleTable as t}from"./chunk-KABWJIY4.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-AGPPZHAH.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),j=M??$.noFlows,[y,A]=c(null),{highlighted:E}=o(),F=h(u,f,x,$.other),{labels:C,matrix:I,otherIndex:Q,foldedCount:z}=F,B=(t,e)=>I[t]?.[e]??0,H=t=>t===Q?r.muted:a(t),P=F.totals,L=C.map((t,e)=>e).sort((t,e)=>P[e]-P[t]),O=L.reduce((t,e)=>t+P[e],0);if(O<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const W=p/2,Y=p/2,G=p/2-44,J=G-b,R=g*L.length,T=/* @__PURE__ */new Map;let U=-Math.PI/2;L.forEach((t,e)=>{const o=P[t]/O*(2*Math.PI-R);T.set(t,{start:U,end:U+o,slot:e}),U+=o+g});const V=/* @__PURE__ */new Map,Z=[];for(const t of L)for(const e of L){const o=B(t,e);if(o<=0)continue;const n=T.get(t),r=o/Math.max(1,P[t])*(n.end-n.start),a=V.get(t)??0;V.set(t,a+r),Z.push({from:t,to:e,value:o,a:n.start+a+r/2,b:T.get(e).start+(T.get(e).end-T.get(e).start)/2})}const D=(t,e)=>[W+e*Math.cos(t),Y+e*Math.sin(t)],K="arc"===y?.kind?y.index:void 0,S="ribbon"===y?.kind?Z[y.index]:void 0;/* @__PURE__ */
|
|
2
|
+
return m("div",{className:`relative ${v??""}`,children:[
|
|
3
|
+
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(L.length),onMouseLeave:()=>A(null),children:[Z.map((t,e)=>{const[o,n]=D(t.a,J),[r,a]=D(t.b,J),l=H(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==E?C[t.from]===E||C[t.to]===E:null)(t,e);/* @__PURE__ */
|
|
4
|
+
return d("path",{d:`M${o},${n} Q${W},${Y} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/O*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>A({kind:"ribbon",index:e})},`${C[t.from]}→${C[t.to]}`)}),L.map(t=>{const o=T.get(t),n=(o.start+o.end)/2,[a,l]=D(n,G+16),i=(t=>y?"arc"===y.kind?y.index===t:Z[y.index].from===t||Z[y.index].to===t:null!==E?C[t]===E:null)(t);/* @__PURE__ */
|
|
5
|
+
return m("g",{onMouseEnter:()=>A({kind:"arc",index:t}),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:e(W,Y,J,G,o.start,o.end),fill:H(t),fillOpacity:null===i||i?1:.45}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:C[t]})]},t)})]}),z>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(z)}),void 0!==K&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:C[K],rows:[{key:"total",label:$.totalFlow,color:H(K),value:N(P[K])}]})}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${C[S.from]} → ${C[S.to]}`,rows:[{key:"value",label:$.flow,color:H(S.from),value:N(S.value)}]})}),
|
|
8
|
+
/* @__PURE__ */d(t,{caption:$.chord(L.length),head:[$.tableFrom,$.tableTo,$.value],rows:Z.map(t=>[C[t.from],C[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-
|
|
2
|
-
return y("div",{ref:
|
|
3
|
-
/* @__PURE__ */x("button",{ref:
|
|
4
|
-
/* @__PURE__ */x(i,{portal:!0,className:
|
|
5
|
-
/* @__PURE__ */x("div",{ref:R,id:X,role:"menu","aria-orientation":"vertical","aria-label":
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-DLOJSJWL.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-KLAKLVKE.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:K="end",side:j="bottom","aria-label":A,className:E="",triggerClassName:S,menuClassName:W="",minWidth:C=180,linkAs:$,disabled:H,id:N,"aria-describedby":J,"aria-disabled":T=!1,onOpenChange:U,footer:B,footerLabel:I}){const[q,G]=m(!1),[M,z]=m(-1),O=h(null),P=h(null),R=h(null),V=h(null),Q=h(null),Y=null!=B&&!1!==B,F=h({text:"",at:0}),X=g(),Z=g(),_=N??Z,ee=h(U);ee.current=U;const te=h(q);te.current=q;const re=v(e=>{G(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&P.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!q)return;const e=e=>{const t=e.target;if(O.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[q,re]);const ie=v(()=>{const e=oe(),t=P.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:K,side:j});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=K},[K,j]);p(()=>{q&&ie()}),b(()=>{if(q)return u(()=>P.current,ie)},[q,ie]),b(()=>{if(!q)return;const t=R.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[q,M]),b(()=>{if(q)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>V.current)},[q,re]),n(V,q&&Y);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{z(le(e)),G(!0),te.current||(te.current=!0,ae.current=e,U?.(!0))};p(()=>{const e=ae.current;if(!q||!e)return;ae.current=null;const t=le(e);t!==M&&z(t)});const de=t(L,X),ce="function"==typeof B?B({close:()=>re(!0)}):B,ue={...k.test(W)?{}:{zIndex:s.popup},minWidth:C};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:O,className:`relative inline-flex ${E}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:P,id:_,type:"button","aria-haspopup":"menu","aria-expanded":q,"aria-controls":q?X:void 0,"aria-label":A,"aria-describedby":J,"aria-disabled":T||void 0,disabled:H,onClick:()=>{T||(q?re(!1):se("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:S??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),q&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:W,style:ue,children:/* @__PURE__ */y("div",{ref:V,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:R,id:X,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),z(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),z(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),z(ne(0,1));else if("End"===t.key)t.preventDefault(),z(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Q.current?o(Q.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-F.current.at<500?F.current.text+n:n;F.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=R.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void z(n)}})(t)},children:r(L,{menuId:X,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||Q.current?.contains(document.activeElement)||z(e)}}),linkAs:$})}),Y&&/* @__PURE__ */y("div",{ref:Q,role:"group","aria-label":I,"data-dropdown-footer":"",onKeyDown:e=>{const t=Q.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
|
|
6
6
|
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
7
|
/* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-ZT45XXIB.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{IconButton_default as e}from"./chunk-
|
|
1
|
+
import{IconButton_default as e}from"./chunk-WVCX2Y3S.js";import{CloseGlyph as t}from"./chunk-53DO72B2.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-JTMEFXRL.js";import{Button_default as s}from"./chunk-NGRTW6Y7.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-GDQJBQ5B.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|