efficient-shell 13.11.0 → 13.12.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 +1 -1
- package/dist/{Browser-S2ISEYGX.js → Browser-TPLE4RMX.js} +17 -17
- package/dist/{Calculator-TJ4XFVNQ.js → Calculator-3PVLP3UK.js} +22 -22
- package/dist/{CurrencyConverter-6H3QM3TU.js → CurrencyConverter-JLRIAP2Z.js} +6 -6
- package/dist/{Files-37P4KZOM.js → Files-4UFXW2K7.js} +77 -77
- package/dist/{Notepad-4PQFMUYM.js → Notepad-MASOWEW7.js} +8 -8
- package/dist/PdfViewer-PFQGQRQX.js +1 -0
- package/dist/{PomodoroTimer-2MFWO3KK.js → PomodoroTimer-I575OSRR.js} +46 -46
- package/dist/{Preview-CC7QJZGV.js → Preview-TX6BB4UW.js} +46 -46
- package/dist/Sidebar-GYGYAXS2.js +44 -0
- package/dist/{Stock-OYUZ4D3M.js → Stock-EPJQJ3XE.js} +3 -3
- package/dist/{Weather-377NKPA5.js → Weather-RPCD2UW3.js} +22 -22
- package/dist/{WorldClock-M6AMXQY2.js → WorldClock-AC3EUSVG.js} +7 -7
- package/dist/ai/index.js +93 -93
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.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/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.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/Meter.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/RankedBars.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/StatTile.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-MZCYB2MW.js → chunk-223XYIIH.js} +1 -1
- package/dist/{chunk-R5SVNFUG.js → chunk-22N3KA7A.js} +4 -4
- package/dist/{chunk-7WMFHPKS.js → chunk-2GMYO6ET.js} +1 -1
- package/dist/{chunk-FCWBO7I3.js → chunk-2QE6QD4Y.js} +7 -7
- package/dist/{chunk-H4GOJ26X.js → chunk-2YK6ZB7C.js} +1 -1
- package/dist/{chunk-5UPLN44S.js → chunk-3PLQKRD4.js} +12 -12
- package/dist/chunk-47UTEV3P.js +23 -0
- package/dist/{chunk-65JCQLM4.js → chunk-4F3SUYN5.js} +1 -1
- package/dist/{chunk-TAEO2JC6.js → chunk-4IYHQNKZ.js} +1 -1
- package/dist/chunk-4Q2CZ4US.js +7 -0
- package/dist/{chunk-CVXJKHPD.js → chunk-4S3E3VJH.js} +6 -6
- package/dist/{chunk-5LHEPE4B.js → chunk-4U5M37SF.js} +1 -1
- package/dist/{chunk-F3MO56N4.js → chunk-5HFKVEWW.js} +1 -1
- package/dist/{chunk-YMUHIJDJ.js → chunk-5POQCJL6.js} +4 -4
- package/dist/chunk-65FZQ572.js +8 -0
- package/dist/{chunk-VWYICGVA.js → chunk-6AUQWWUA.js} +1 -1
- package/dist/{chunk-RJ24VXBZ.js → chunk-6HYO2W3O.js} +4 -4
- package/dist/{chunk-FOE2QHDE.js → chunk-6LYKIC7W.js} +9 -9
- package/dist/{chunk-EQFWFQOZ.js → chunk-6QKTQOEV.js} +27 -27
- package/dist/{chunk-2FQBY4ED.js → chunk-7RGHV3J5.js} +5 -5
- package/dist/chunk-7TJZ5AJE.js +11 -0
- package/dist/{chunk-VMKTA5HL.js → chunk-AEEK74UI.js} +6 -6
- package/dist/{chunk-CCPUNN4F.js → chunk-AHMYBYXJ.js} +1 -1
- package/dist/{chunk-VOD5MRBF.js → chunk-AQUHVWWO.js} +1 -1
- package/dist/chunk-B53VREFW.js +8 -0
- package/dist/{chunk-GHLXZDLU.js → chunk-BG3C4ALM.js} +1 -1
- package/dist/{chunk-GAGCE2ML.js → chunk-CKTFXTJL.js} +1 -1
- package/dist/{chunk-BXZLSY2S.js → chunk-CWVQH2SP.js} +1 -1
- package/dist/chunk-DEYVAMJQ.js +19 -0
- package/dist/{chunk-IODIQ77P.js → chunk-DO3DSSAW.js} +1 -1
- package/dist/chunk-DQTYV6AC.js +9 -0
- package/dist/{chunk-4RSBPRCQ.js → chunk-DVVB2CY5.js} +1 -1
- package/dist/{chunk-O5UD3ZWM.js → chunk-EHM3ZVVT.js} +10 -10
- package/dist/{chunk-XOZ5VPXF.js → chunk-EHNQGKW4.js} +1 -1
- package/dist/{chunk-75TPMXA7.js → chunk-ELPW25CA.js} +1 -1
- package/dist/{chunk-BNPJHOAC.js → chunk-EMRTVPQ5.js} +9 -9
- package/dist/chunk-EX34TQ3V.js +28 -0
- package/dist/chunk-EZQHUQOP.js +1 -0
- package/dist/{chunk-4HJNHI4A.js → chunk-F4VILY3O.js} +1 -1
- package/dist/{chunk-ZDCCYRFF.js → chunk-F5B5WOQ7.js} +2 -2
- package/dist/{chunk-AJ5GLMGD.js → chunk-FBS55WOX.js} +7 -7
- package/dist/{chunk-TDG5WGLR.js → chunk-FDDM7VMQ.js} +1 -1
- package/dist/{chunk-CUJA3HBZ.js → chunk-FMERX3PG.js} +8 -8
- package/dist/chunk-FQD6P6EZ.js +4 -0
- package/dist/{chunk-PR6FNBKR.js → chunk-FTKLODQK.js} +1 -1
- package/dist/chunk-G3MJO3A6.js +22 -0
- package/dist/{chunk-VUM6BYAX.js → chunk-G4D2WM3J.js} +1 -1
- package/dist/{chunk-H7CIK74N.js → chunk-G53Y6EPJ.js} +13 -13
- package/dist/{chunk-ZDDMFFQK.js → chunk-GITRDCHS.js} +1 -1
- package/dist/{chunk-4YWQE67T.js → chunk-GO2TZ35U.js} +1 -1
- package/dist/{chunk-6XPS3H5Z.js → chunk-GYPYOBG5.js} +8 -8
- package/dist/{chunk-ZGIAMYTI.js → chunk-HK53EKZH.js} +1 -1
- package/dist/{chunk-X22SFR5F.js → chunk-HOROMBJB.js} +8 -8
- package/dist/{chunk-XCY7A5UM.js → chunk-HZ7TUMNL.js} +1 -1
- package/dist/{chunk-Z62HFEFS.js → chunk-I6QVXM2M.js} +15 -15
- package/dist/{chunk-6SOS6OBB.js → chunk-IE6TRMIW.js} +1 -1
- package/dist/{chunk-NVAH2NQI.js → chunk-IG7JPSBG.js} +1 -1
- package/dist/chunk-IJNQ2BUY.js +2 -0
- package/dist/{chunk-NUDL6UO3.js → chunk-IOLUF3UL.js} +1 -1
- package/dist/chunk-IUVGHHR3.js +1 -0
- package/dist/chunk-J6QC45OS.js +8 -0
- package/dist/{chunk-57GRXAXJ.js → chunk-JDSOHBO7.js} +1 -1
- package/dist/{chunk-KV6XCHAG.js → chunk-JGKDWDVM.js} +16 -16
- package/dist/{chunk-JOYGSKWG.js → chunk-JHGBFZHL.js} +5 -5
- package/dist/{chunk-PZNF2TEB.js → chunk-JNSRDEB6.js} +9 -9
- package/dist/{chunk-SC3AQXJY.js → chunk-JPCPO4MX.js} +8 -8
- package/dist/{chunk-BSEQJM7X.js → chunk-JPKNVTTK.js} +1 -1
- package/dist/{chunk-NDWX5Z4D.js → chunk-JR2HHKVP.js} +1 -1
- package/dist/{chunk-2A2C2YBE.js → chunk-JWLOERV5.js} +1 -1
- package/dist/{chunk-DU7TJVX5.js → chunk-KEVJBI5Q.js} +1 -1
- package/dist/{chunk-R5TSUJTK.js → chunk-KLUCEASW.js} +6 -6
- package/dist/{chunk-2UBR4YUF.js → chunk-KNZ7YTFH.js} +1 -1
- package/dist/{chunk-3DV5YLAI.js → chunk-KYQKMBSY.js} +5 -5
- package/dist/{chunk-3YCU6V3U.js → chunk-L2WBCXG7.js} +1 -1
- package/dist/{chunk-ROKUEMAK.js → chunk-L3BECLHD.js} +1 -1
- package/dist/{chunk-YW6BODBX.js → chunk-LURBH6G4.js} +1 -1
- package/dist/{chunk-PC3MYH2K.js → chunk-LXPDURUL.js} +2 -2
- package/dist/{chunk-DASRJ26L.js → chunk-M2TQOJ3G.js} +1 -1
- package/dist/{chunk-IRCASURW.js → chunk-M7W63T6H.js} +8 -8
- package/dist/{chunk-ZHR2HNT2.js → chunk-MEF4JVXP.js} +15 -15
- package/dist/{chunk-VVXBBU6R.js → chunk-MHCNQKEK.js} +3 -3
- package/dist/{chunk-FEQQMRHJ.js → chunk-MOKABQCY.js} +2 -2
- package/dist/{chunk-ARBS2EZ6.js → chunk-NA4XPE7S.js} +3 -3
- package/dist/{chunk-HWJQLLJA.js → chunk-NEHVW324.js} +8 -8
- package/dist/{chunk-AKKDFFUO.js → chunk-NILGK2KJ.js} +1 -1
- package/dist/{chunk-6D6Q3ZCG.js → chunk-NJD7HVTP.js} +5 -5
- package/dist/{chunk-XPSWZQR4.js → chunk-OEPQIIYL.js} +1 -1
- package/dist/{chunk-FVORTWUY.js → chunk-ORV2AVIJ.js} +1 -1
- package/dist/chunk-OWAYSIQH.js +8 -0
- package/dist/{chunk-YM7AWNMY.js → chunk-OZ4R6U2M.js} +1 -1
- package/dist/{chunk-G5U7IRH4.js → chunk-P5C7DI5A.js} +5 -5
- package/dist/{chunk-F3G7S5HO.js → chunk-PALWXHBQ.js} +27 -27
- package/dist/{chunk-QO7UHTUE.js → chunk-PKXHAF43.js} +6 -6
- package/dist/{chunk-NZKR3JPM.js → chunk-QBMMORYP.js} +1 -1
- package/dist/{chunk-AEMTJGD4.js → chunk-QNWC3RWK.js} +1 -1
- package/dist/{chunk-QDEQHT2T.js → chunk-QQGNTDMO.js} +1 -1
- package/dist/{chunk-V5VAKDLS.js → chunk-QTVE3OSD.js} +6 -6
- package/dist/{chunk-ZAL72BPF.js → chunk-R6GXVLY7.js} +1 -1
- package/dist/chunk-RDGXSAOD.js +2 -0
- package/dist/{chunk-OAKXWYZD.js → chunk-RFR2K7JO.js} +2 -2
- package/dist/{chunk-Y43S6YS5.js → chunk-RZJ63ZM4.js} +10 -10
- package/dist/{chunk-OZV5P5A7.js → chunk-SNHBDP4X.js} +10 -10
- package/dist/{chunk-ROPVIMIR.js → chunk-SR6DDTUN.js} +1 -1
- package/dist/chunk-TNNH6F3V.js +11 -0
- package/dist/{chunk-IEW5JTIR.js → chunk-U2ZTHOQL.js} +1 -1
- package/dist/{chunk-BRFUQAVC.js → chunk-U7WDBCVV.js} +1 -1
- package/dist/{chunk-HTHNDX32.js → chunk-UFX7F3KG.js} +1 -1
- package/dist/{chunk-TZBNN6HD.js → chunk-UGEA3C5C.js} +8 -8
- package/dist/{chunk-Q6GECV4J.js → chunk-UXGNF3OG.js} +1 -1
- package/dist/{chunk-2LRSUDGN.js → chunk-VADWTS7H.js} +5 -5
- package/dist/{chunk-IYTOOV7Q.js → chunk-VCR3RADH.js} +1 -1
- package/dist/{chunk-ITEOA45V.js → chunk-VFSAJMNX.js} +1 -1
- package/dist/{chunk-TMSSR5UH.js → chunk-VQ35LXDC.js} +1 -1
- package/dist/{chunk-3TCGXYUC.js → chunk-VXSYHTBP.js} +1 -1
- package/dist/{chunk-WEZ2RO72.js → chunk-VYHVIKP6.js} +8 -8
- package/dist/{chunk-YAM3L5N4.js → chunk-W2TPXKCV.js} +1 -1
- package/dist/{chunk-DFOKJAIS.js → chunk-WBXPA7TY.js} +1 -1
- package/dist/{chunk-FXG7TOZN.js → chunk-WF4A2HSB.js} +1 -1
- package/dist/{chunk-PGATHOTX.js → chunk-WIFK6TLB.js} +1 -1
- package/dist/{chunk-IOZSLFGR.js → chunk-WJMPTW3G.js} +1 -1
- package/dist/chunk-WWCAVO3R.js +14 -0
- package/dist/{chunk-WAKWESOR.js → chunk-WX5MRNAY.js} +1 -1
- package/dist/{chunk-4HJX2M4W.js → chunk-XEPA5J6K.js} +1 -1
- package/dist/{chunk-YEEMRWBS.js → chunk-XHD6Q6JV.js} +1 -1
- package/dist/{chunk-P62QGXRW.js → chunk-XMFJDT6Y.js} +13 -13
- package/dist/{chunk-BLXHT72M.js → chunk-XOQGBU25.js} +1 -1
- package/dist/{chunk-H4LUHKUJ.js → chunk-XRTH47EO.js} +49 -49
- package/dist/chunk-XSHDPG45.js +9 -0
- package/dist/{chunk-ID35S5Y6.js → chunk-XWJT6TFU.js} +1 -1
- package/dist/{chunk-PA3OU3Y7.js → chunk-YDFDTRZF.js} +5 -5
- package/dist/{chunk-44ZHEIJZ.js → chunk-YGKLZBWC.js} +11 -11
- package/dist/{chunk-5PSFENSW.js → chunk-YM2Z4LZ2.js} +16 -16
- package/dist/{chunk-LOFFHXZ4.js → chunk-YMHCLK3F.js} +10 -10
- package/dist/{chunk-KGBB6REQ.js → chunk-YNVH2EIE.js} +3 -3
- package/dist/{chunk-O32GIVYD.js → chunk-YY7OFUT2.js} +3 -3
- package/dist/{chunk-JWUNK2PW.js → chunk-ZCGT5YNR.js} +1 -1
- package/dist/{chunk-NLHGFQ54.js → chunk-ZNV75GAG.js} +1 -1
- package/dist/{chunk-E44RNULN.js → chunk-ZYU5HAIC.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.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/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.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/PositionInput.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/TagInput.d.ts +5 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +665 -665
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +4 -4
- package/dist/model-viewer/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.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/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.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/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +3 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.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.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/PdfViewer-OLQBTKOC.js +0 -1
- package/dist/Sidebar-7SHI7P5Z.js +0 -44
- package/dist/chunk-3RX5KCUH.js +0 -9
- package/dist/chunk-B3KQELHS.js +0 -7
- package/dist/chunk-B447IHIL.js +0 -4
- package/dist/chunk-BKZOTBDP.js +0 -23
- package/dist/chunk-BLXEDMZM.js +0 -8
- package/dist/chunk-D53FU245.js +0 -8
- package/dist/chunk-DEJIH3ZQ.js +0 -1
- package/dist/chunk-FBMYLCCE.js +0 -11
- package/dist/chunk-FW6KE6OU.js +0 -1
- package/dist/chunk-HTHD7STJ.js +0 -9
- package/dist/chunk-KITSIQCV.js +0 -19
- package/dist/chunk-QXXMRV4E.js +0 -2
- package/dist/chunk-R3R6ZJNW.js +0 -28
- package/dist/chunk-RMEYKJEH.js +0 -8
- package/dist/chunk-UF76AFFY.js +0 -22
- package/dist/chunk-UHQBHSWL.js +0 -11
- package/dist/chunk-V3KQIY6T.js +0 -8
- package/dist/chunk-WUEH6DLJ.js +0 -14
- package/dist/chunk-YJGA4LPG.js +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...
|
|
3
|
-
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-AHMYBYXJ.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-VFSAJMNX.js";import{ColoredBadge as u}from"./chunk-HK53EKZH.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-IUVGHHR3.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:A,label:I,hint:S,error:O,required:F,className:H,accept:P="image/*",maxSizeBytes:z,maxFiles:E,fit:L="cover",thumbSize:M=96,placeholder:$,cta:R,acceptHint:B,showCover:W=!1,coverLabel:V,busy:Y=!1,busyLabel:q,progress:J,disabled:Q=!1,readOnly:U=!1,selected:X,onItemClick:Z,onItemDoubleClick:G,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=R??te.cta,ae=V??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=Q||Y,de=!(!k&&!N||se||U),ce=!!w&&!se&&!U,ue=!!j&&!se&&!U,me=!!K&&!Q&&!ue,pe=!(!C||!A||se||U),fe=t(se),he=$??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:E,acceptHint:B,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&A(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:M,height:M},Ke=null==X?null:new Set(X),Te=!!Z,Ce=M<112,Ae=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=W&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:G?()=>G(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:L}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:L}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
|
+
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ie=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Se=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:M+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:M+32},children:/* @__PURE__ */x("span",{className:Y?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:I,labelId:I?`${le}-label`:void 0,htmlFor:le,hint:S,error:O,required:F,className:H,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":I?`${le}-label`:void 0,"aria-describedby":O?`${le}-error`:S?`${le}-hint`:void 0,"aria-busy":Y||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Se:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof I?I:te.files,className:"contents",children:p.map(Ae)}):p.map(Ae),Ie]}),Y&&/* @__PURE__ */x(l,{label:ne,progress:J})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-2QE6QD4Y.js";import{ImageLightbox as r}from"./chunk-NEHVW324.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{Drawer as i}from"./chunk-XSHDPG45.js";import{EmptyState as t}from"./chunk-VXSYHTBP.js";import{DescriptionList as o}from"./chunk-SACUSHVN.js";import{Breadcrumbs as d}from"./chunk-OZ4R6U2M.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-L2WBCXG7.js";import{useMediaMoveItems as u}from"./chunk-ZCGT5YNR.js";import{RenameField as m}from"./chunk-QIPO4EVJ.js";import{NativeSelect as p}from"./chunk-DEYVAMJQ.js";import{MediaUploadGrid as h}from"./chunk-EMRTVPQ5.js";import{MediaUsedInList as f}from"./chunk-GITRDCHS.js";import{useGridSelection as g}from"./chunk-VLKDWKVR.js";import{useMarquee as v}from"./chunk-OLFYNMTD.js";import{Segmented as k}from"./chunk-HNIIDDLJ.js";import{copyToClipboard as y}from"./chunk-UFX7F3KG.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-QMBMK6PP.js";import{Banner as C}from"./chunk-XWJT6TFU.js";import{Input_default as N}from"./chunk-PT4GMPUB.js";import{DropdownMenu as I}from"./chunk-3DSGJIC7.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-VFSAJMNX.js";import{setModalDragAside as T,modalIdHolding as z}from"./chunk-EIFNESXS.js";import{ColoredBadge as F}from"./chunk-HK53EKZH.js";import{Button_default as E}from"./chunk-EVYD6UFQ.js";import{Icon as L}from"./chunk-ISVODSRP.js";import{Tooltip as O}from"./chunk-SOZCWT6I.js";import{buttonClasses as P}from"./chunk-UQYNPYF4.js";import{usePlotWidth as M}from"./chunk-MAFUXCPZ.js";import{useShellStrings as A}from"./chunk-IUVGHHR3.js";import{useRef as R,useMemo as U,useCallback as V,useState as B,useEffect as H}from"react";import{jsxs as K,Fragment as G,jsx as J}from"react/jsx-runtime";var Q="application/x-efficient-media-files",W="application/x-efficient-media-folder",X="application/x-efficient-media-file";function Y(e){if(!e||!Array.from(e.types).includes(X))return null;try{const n=JSON.parse(e.getData(X));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 $={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */J(L,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */J(L,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */J(L,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */J(L,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */J(L,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */J(L,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */J(L,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */J(L,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */J(L,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */J(L,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */J(L,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */J(L,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */J(L,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */J(L,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */J(L,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */J(L,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */J(L,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */J(L,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */J(L,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */J(L,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(L){const{mode:Y="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ce,onRename:Ne,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:Te,onEmptyTrash:ze,onReplace:Fe,onCropEdit:Ee,onOpenInDesign:Le,onChoose:Oe,onCancel:Pe,pickNote:Me,onDragOut:Ae,className:Re=""}=L,Ue=A().mediaLibrary,Ve=A().media,Be="pick"===Y,He=!Be,Ke=R(null),Ge=M(Ke,"phone"===_?343:1200),Je="phone"===_||"auto"===_&&Ge<640,Qe=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),We=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Xe=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&We.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,We]),Ye=V(e=>{const n=[];for(let l=e?We.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?We.get(l.parentId):void 0);return n},[We,le.length]),$e=V((e,n)=>Ye(e).some(e=>e.id===n),[Ye]),[Ze,qe]=B(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=V(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;H(()=>{if("files"===ee.place)en(["@files",...Ye(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Qe.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?Qe.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=g(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=R(!0);H(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");H(()=>{he&&mn.setSelection(he)},[gn]);const vn=R(gn??""),kn=pn.join("\0");H(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Be?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=B(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?We.get(n.id)?.name:un.get(n.id)?.name)&&Ne?.(n,e)},Cn=async e=>{if(!Ce)return;const n=await Ce(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Nn=V(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=We.get(e.id);return n===e.id||n&&$e(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:s,label:Ue.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of Xe.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[Xe,We,tn,$e,on,Ue]),In=V(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=B(null),jn={words:Ue,media:Ve,denied:ve,moveTargets:Nn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ce&&He?e=>{Cn(e)}:void 0,rename:Ne&&He?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&He?Ie:void 0,trash:De&&He?De:void 0,deleteFolder:Se&&He?Se:void 0,folderNotEmpty:e=>!!We.get(e)?.notEmpty,replace:Fe&&He?Fe:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Ue.urlLabel,n)},openInDesign:Le,restore:je,deleteForever:Te},Tn=e=>c(e,jn),zn=w(),Fn=(e,n)=>{Be||(mn.isSelected(e)||mn.select(e),zn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[En,Ln]=B(null),[On,Pn]=B(null),[Mn,An]=B(null);H(()=>{if(!On&&!En)return;const e=()=>{Pn(null),Ln(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,En]);const Rn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Be)&&(!!Rn(e,Q)||!(!Rn(e,W)||!Mn)&&(n!==Mn&&!(n&&$e(n,Mn)))),Vn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),Ln(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",En!==e&&Ln(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),Ln(null),Rn(e,Q)){let l;try{l=JSON.parse(e.dataTransfer.getData(Q))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else Mn&&(Ie({kind:"folder",id:Mn},n),An(null))}}),Bn=e=>{const n=e=>Rn(e,Q)||Rn(e,W)||Rn(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&On!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Hn=(e,n,l)=>/* @__PURE__ */J(O,{side:"right",content:On===e?Ue.noDropProducts:sn(l),open:On===e||!On&&void 0,children:/* @__PURE__ */J("span",{children:n})}),Kn=e=>({onContextMenu:n=>{zn.open(n,e)}}),Gn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */J(n,{label:Hn(i,e.name,t),level:r,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Bn(i),...He?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */J(l,{children:Gn(d,r+1,t)})]},e.id)}),Jn=(e,r)=>(Xe.get(e)??[]).map(e=>{const a=Xe.get(e.id),i=Ze.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=Tn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */J(n,{label:e.name,level:r,icon:a&&i?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:En===e.id?"into":void 0,dragging:Mn===e.id,draggable:He&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */J(m,{value:e.name,label:Ue.folderName,onDone:xn}):void 0,actions:He&&o.length?/* @__PURE__ */J(I,{align:"end","aria-label":Ue.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Vn(e.id,e.id),...He?Kn({kind:"folder",id:e.id}):{},...He&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(W,e.id),An(e.id)},onDragEnd:()=>{An(null),Ln(null)}}:{}}}),a&&i&&/* @__PURE__ */J(l,{children:Jn(e.id,r+1)})]},e.id)}),Qn=Ze.has("@files"),Wn=Ze.has("@products"),Xn=/* @__PURE__ */K(e,{"aria-label":Ue.folders,children:[re&&/* @__PURE__ */K(G,{children:[
|
|
6
|
+
/* @__PURE__ */J(n,{label:Hn("@products",Ue.products),level:1,icon:Z.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:re.length?Wn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Wn&&re.length>0&&/* @__PURE__ */J(l,{children:Gn(re,2)})]}),
|
|
7
|
+
/* @__PURE__ */J(n,{label:Ue.allFiles,level:1,icon:Qn?Z.folderOpen:Z.folder,count:ae,countLabel:null!=ae?Ue.fileCount(ae):void 0,expanded:Xe.get(null)?.length?Qn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===En?"into":void 0,rowProps:{"data-media-row":"@files",...Vn("@files",null)}}),Qn&&(Xe.get(null)?.length??0)>0&&/* @__PURE__ */J(l,{children:Jn(null,2)}),He&&/* @__PURE__ */J(n,{label:Ue.trash,level:1,icon:Z.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Yn=(()=>{if(an)return[{label:Ue.trash}];if(rn){const e=ee.nodeId?Qe.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=Ye(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=rn?Ue.readOnly:ve.upload,Zn=!!xe&&!an&&!$n,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Zn,onAccept:e=>xe?.(e,on)}),_n=rn?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[He&&Ce&&!an&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{Cn(on)},...el(_n),children:Ue.newFolder}),xe&&!an&&/* @__PURE__ */J(E,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>qn.open(),...el($n),children:Ue.upload}),He&&an&&ze&&te.length>0&&/* @__PURE__ */J(E,{variant:"danger",size:"sm",onClick:ze,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */J("div",{style:{width:Je?void 0:a,flex:Je?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */J(p,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */J("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */J(N,{size:"sm",type:"search",leftIcon:Z.search,placeholder:rn?Ue.searchProducts:Ue.search,"aria-label":rn?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],rl("use"),130),ce&&He&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */J(k,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:Z.grid},{value:"list",label:Ue.list,icon:Z.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */J(F,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=He&&tn&&!!Ie&&!ve.move,dl=!!Ae&&!an,sl=R(""),cl=R(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=R(Ae);ml.current=Ae;const pl=V(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),T(sl.current,!1),e&&ml.current?.(e))},[]),hl=V(e=>{pl(ul());const n=Ke.current?.ownerDocument;if(!n)return;sl.current=z(Ke.current);const l=Ke.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&T(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,T(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);H(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Ae(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[X]:gl(e)}}:{}})),kl=Je?Math.max(72,Math.floor((Ge-24-16-1)/3)):112,yl=R(null),bl=v({containerRef:yl,enabled:He&&!Je&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Be){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},xl=te.length?null:oe?/* @__PURE__ */J(t,{variant:"dashed",title:Ue.noMatches}):rn?/* @__PURE__ */J(t,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */J(t,{variant:"dashed",title:Ue.trashEmpty}):!Zn||Be?/* @__PURE__ */J(t,{variant:"dashed",title:Ue.emptyFolder}):null,Cl="list"===me&&te.length>0,Nl=xl??(Cl?/* @__PURE__ */J("ul",{role:"listbox","aria-multiselectable":He||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>Fn(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(X,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(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)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */J("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */J("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */J("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */J(h,{items:vl,readOnly:!Zn||Be,onFiles:Zn&&!Be?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?Q:dl?X:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:He?Fn:void 0,menuOnMedia:He})),Il=u({count:pn.length,kind:In(pn),targets:Nn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Dl=P({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */J(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */K(G,{children:[Z.folder,Ue.moveTo]}),items:Il,disabled:!!ve.move}),jl=He&&pn.length>1&&!rn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */J(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */K(G,an?{children:[je&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>je(pn),...el(ve.restore),children:Ue.restore}),Te&&/* @__PURE__ */J(E,{variant:"secondary-danger",size:"sm",onClick:()=>Te(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Sl,Ne&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
|
|
12
|
+
/* @__PURE__ */J(E,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,Tl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,r?/* @__PURE__ */J(m,{value:e.name,label:Ue.fileName,onDone:xn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),rn?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const a=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return K("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */J("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */J(C,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
|
|
15
|
+
/* @__PURE__ */J(o,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */K("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */J("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */J(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>jn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&He&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[Fe&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>Fe(e.id),...el(ve.replace),children:Ue.replace}),Ee&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Ee(e.id),children:Ue.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */J(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */K(G,{children:[Z.folder,Ue.moveTo]}),items:a.items,disabled:!!ve.move}),Ne&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */J(D,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:Z.trash})]}),an&&He&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */J(E,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Ue.restore}),Te&&/* @__PURE__ */J(E,{variant:"danger",size:"sm",onClick:()=>Te([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),rn&&Le&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Le({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */J(f,{items:ge})]})},zl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,Fl=Be?/* @__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:[
|
|
18
|
+
/* @__PURE__ */J("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
|
|
19
|
+
/* @__PURE__ */K("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */J(E,{variant:"secondary",size:"sm",onClick:Pe,children:Ue.cancel}),
|
|
20
|
+
/* @__PURE__ */J(E,{variant:"primary",size:"sm",disabled:!hn,...el(zl),onClick:()=>{hn&&!zl&&Oe?.(hn)},children:Ue.chooseImage})]})]}):null,El=He&&!!hn,Ll=/* @__PURE__ */K("div",{className:"flex min-w-0 flex-col gap-3",children:[Me&&/* @__PURE__ */J(C,{tone:"neutral",children:Me}),
|
|
21
|
+
/* @__PURE__ */K("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */J(d,{items:Yn}),nl]}),al,jl,
|
|
23
|
+
/* @__PURE__ */K("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{He&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
|
|
24
|
+
/* @__PURE__ */J(a,{rect:bl.rect})]}),Zn&&/* @__PURE__ */J("input",{...qn.inputProps}),
|
|
25
|
+
/* @__PURE__ */J(j,{rejections:qn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return K("div",{ref:Ke,"data-media-library":"","data-layout":Je?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Re}`.trim(),children:[/* @__PURE__ */K("div",Je?{className:"flex flex-col gap-3 p-3",children:[Xn,Ll]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */J("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Xn}),
|
|
28
|
+
/* @__PURE__ */J("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Ll}),El&&/* @__PURE__ */J("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:Tl(hn)})]}),Fl,Je&&/* @__PURE__ */J(i,{open:El,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&Tl(hn)}),zn.state&&/* @__PURE__ */J(x,{...zn.props,items:Tn(zn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */J(r,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{Q as MEDIA_FILES_DRAG_TYPE,X as MEDIA_FILE_DRAG_TYPE,W as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,Y as readMediaFileDrag};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="13.12.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-IUVGHHR3.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
|
|
2
2
|
return r(e,{name:"align-left"});case"center":/* @__PURE__ */
|
|
3
3
|
return r(e,{name:"align-center"});case"right":/* @__PURE__ */
|
|
4
4
|
return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{unitBox as e}from"./chunk-QOYKBINM.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-
|
|
2
|
-
return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Pe,
|
|
1
|
+
import{unitBox as e}from"./chunk-QOYKBINM.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:n,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":n,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(t,{size:"sm",...v,children:u})}var j=c(function({value:t,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:B,disabled:D,readOnly:E,invalid:S,placeholder:C,size:O,prefix:$,suffix:M,suffixControl:R,units:F,id:K,name:P,className:U="",onBlur:V,onFocus:I,steppers:T,stepFrom:W,snap:z=!1,allowEmpty:L=!0,appearance:Y="box",display:A,reportWhileTyping:H=!0,onRevert:Q,"aria-label":G,"aria-labelledby":J,"aria-describedby":X,auto:Z,...q},_){const ee="bare"===Y,re=R??("string"==typeof M?e(M,F,D||E):void 0),te=r(),ne=Z??te,oe=s(),ie="string"==typeof M&&""!==M.trim()?M.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(M||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(t,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(t),he=d(t);he.current=t;const be=Boolean(D||E),ge=T??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==t&&de(x(t,g))},[t,g]);const Be=e=>{if(be)return;let r=(ae(pe.current)??W??(C?ae(C):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Me()},De=d(Be);De.current=Be;const Ee=d({unit:j??1,big:B??10*(j??1),locked:be});Ee.current={unit:j??1,big:B??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Ee.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),De.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Se,Ce]=u(!1),[Oe,$e]=u(0),Me=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Se&&document.activeElement===fe.current&&fe.current?.select()},[ee,Se,Oe]);const Re=d(!1);f(()=>{if(Se&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(Q??o)(r),Me(),!0})},[Se,be,g,o,Q]);const Fe=()=>{const e=ae(pe.current);if(null==e){if(!L){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(z?Math.max(b(j??1),b(i??0)):void 0);z&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Ke=/* @__PURE__ */m("input",{ref:me,id:K,"data-number-input":"",name:P,type:"text",inputMode:0===g?"numeric":"decimal",value:!Se&&A?A(t):ue,disabled:D,readOnly:E,placeholder:C,step:j,role:"spinbutton","aria-valuenow":t??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==t?C||void 0:`${x(t,g)}${ee&&ie?ie:""}`,"aria-describedby":[X,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":S||void 0,"aria-label":G,"aria-labelledby":J,onChange:e=>(e=>{if(E)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!H)return;const t=ae(e);(null!==t||L)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Fe(),void Me();const r=j??1,t=B??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Be(n))},onFocus:()=>{ve.current=he.current,Ce(!0),Re.current=!0,I?.()},onMouseUp:ee?e=>{Re.current&&(Re.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Ce(!1),Re.current=!1,Fe(),V?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Se?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",U].filter(Boolean).join(" "):n({invalid:S,size:O,readOnly:E,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Se?"text-ellipsis":"",U].filter(Boolean).join(" ")})}),Pe=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Pe?/* @__PURE__ */v(h,{children:[Ke,Pe]}):Ke;const Ue=ae(ue);/* @__PURE__ */
|
|
2
|
+
return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Ke,Pe,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):M&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:M}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ue&&Ue<=i,onStep:e=>De.current(-(e?B??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ue&&Ue>=c,onStep:e=>De.current(e?B??10*(j??1):j??1)});/* @__PURE__ */
|
|
3
3
|
return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-
|
|
2
|
-
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,B=s(),A=w??j.noData,
|
|
3
|
-
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${
|
|
1
|
+
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-IUVGHHR3.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
|
|
2
|
+
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,B=s(),A=w??j.noData,F=null!=p&&Number.isFinite(p)?p:null,G=Number.isFinite(f)&&f>0?f:null;null==G&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const H=e(v,"MetricBar"),R=null!=F?H??t(l(F,g,b)):null,C=n(g),D=n(b),E=null!=F&&null!=G?x(F/G*100):0,L=null!=F?(y??(a=>100===G?u(a,1,B):m(a,B)))(F):"—",P=null!=F&&null!=G&&(null!=C||null!=D),S="md"===k||"lg"===k,U=S?"h-2":"h-1.5",V=null!=F&&null!=G,z=/* @__PURE__ */c("div",{...V?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":G,"aria-valuenow":Math.min(G,Math.max(0,F)),"aria-valuetext":L}:{"aria-hidden":!0},className:V&&R?`relative mt-2 ${U} rounded-full bg-gray-200`:`relative mt-2 ${U} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[V&&
|
|
3
|
+
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${R?R.fill:"bg-gray-400"}`,style:{width:`${E}%`}}),P&&null!=G&&null!=C&&/* @__PURE__ */o(d,{at:x(C/G*100),title:j.warningAt(C),className:i.warning}),P&&null!=G&&null!=D&&/* @__PURE__ */o(d,{at:x(D/G*100),title:j.criticalAt(D),className:i.critical})]}),I=R?R.ink:null!=F?"text-gray-900":"text-gray-400";if(S){const a="lg"===k;/* @__PURE__ */
|
|
4
4
|
return c("div",{className:M,children:[null!=h&&/* @__PURE__ */o("div",{className:(a?"text-xs":"text-3xs")+" font-medium uppercase tracking-wide text-gray-500",children:h}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
6
|
-
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${I}`,children:
|
|
7
|
-
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=
|
|
6
|
+
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${I}`,children:L}),
|
|
7
|
+
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=F?N:A})]}),z]})}/* @__PURE__ */
|
|
8
8
|
return c("div",{className:M,children:[
|
|
9
9
|
/* @__PURE__ */c("div",{className:"flex items-baseline gap-2",children:[null!=h&&/* @__PURE__ */o("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:h}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${I}`,children:
|
|
11
|
-
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=
|
|
10
|
+
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${I}`,children:L}),
|
|
11
|
+
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=F?N:A})]}),z]})}export{h as MetricBar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e,useShellLocale as a}from"./chunk-
|
|
1
|
+
import{useShellStrings as e,useShellLocale as a}from"./chunk-IUVGHHR3.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{useState as i,useId as d}from"react";import{jsx as r,jsxs as c,Fragment as s}from"react/jsx-runtime";var o={band:"es-group-head",row:"es-group-sub"},l=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function t({items:t,defaultOpenIds:u=[],openIds:p,onOpenChange:m,allowMultiple:h=!1,level:N=3,tier:g="band",keepMounted:b=!1,className:$=""}){const v=e(),f=a(),[x,y]=i(u),I=d(),j=`h${N}`,k=p??x;/* @__PURE__ */
|
|
2
2
|
return r("div",{"data-accordion":g,className:$||void 0,children:t.map(e=>{const a=k.includes(e.id),i=e.headId??`${I}-${l(e.id)}-head`,d=e.headId?`${e.headId}-body`:`${I}-${l(e.id)}-panel`,t=a||b;/* @__PURE__ */
|
|
3
3
|
return c("div",{className:e.className?`es-group ${e.className}`:"es-group",children:[
|
|
4
4
|
/* @__PURE__ */r(j,{className:"es-group-title",children:/* @__PURE__ */c("button",{type:"button",id:i,disabled:e.disabled,"aria-expanded":a,"aria-controls":t?d:void 0,onClick:()=>(e=>{const a=k.includes(e)?k.filter(a=>a!==e):h?[...k,e]:[e];void 0===p&&y(a),m?.(a)})(e.id),className:o[g],children:[null!=e.icon&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"es-group-icon",children:e.icon}),e.title,"number"==typeof e.count&&e.count>0&&
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-
|
|
2
|
-
return g("div",{className:`relative ${S??""}`,ref:
|
|
3
|
-
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":
|
|
4
|
-
/* @__PURE__ */p("title",{id:
|
|
5
|
-
return p("path",{d:l(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:F?e.sweep:void 0,style:F?t(r,55):void 0,onMouseEnter:()=>
|
|
1
|
+
import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-IUVGHHR3.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:P=.04,className:S,emptyLabel:A}){const C=h().charts,R=c(),W=$??(e=>u(e,R)),V=I??C.other,z=A??C.nothingToBreakDown,E=d(),[T,U]=f(null),{highlighted:_}=a(),H=y(null),L=r(H,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${S??""}`,children:z});const B=[...Y].sort((e,t)=>t.value-e.value),O=B.slice(0,N),Q=B.slice(N),D=Q.length>0?[...O,{key:"__other__",label:V,value:Q.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:O,Z=e=>i(e.slot,e.color,e.tone),q=D.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&L>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,L-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=n(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?n(D.length,b).step:t.value/q*Math.PI*2,r="rose"===v?n(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==T?T!==e:null!==_&&_!==t,me=null!==T?D[T]:void 0;/* @__PURE__ */
|
|
2
|
+
return g("div",{className:`relative ${S??""}`,ref:H,children:[
|
|
3
|
+
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":E,onMouseLeave:()=>U(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:E,children:C.breakdown(W(q),D.length)}),D.map((a,r)=>{const n=Z(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/q*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
5
|
+
return p("path",{d:l(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:F?e.sweep:void 0,style:F?t(r,55):void 0,onMouseEnter:()=>U(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
|
|
6
6
|
return g("g",{children:[
|
|
7
7
|
/* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
9
|
-
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,
|
|
10
|
-
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:
|
|
9
|
+
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:j})]}),me&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(o,{title:me.label,rows:[{key:"value",label:C.value,color:Z(me),value:W(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/q*100,1,R)}]})}),
|
|
10
|
+
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:D.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
11
11
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Z(e)}}),
|
|
12
12
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
13
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/
|
|
13
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/q*100,1,R)})]},e.key))})]})}export{x as PieChart};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,usePopupLevel as t,usePopupLevelBindings as a,windowScrimStyle as o,OverlayLayerProvider as l,scrimHasCorners as n,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as d}from"./chunk-JR2HHKVP.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-7QSDPSXP.js";import{useFocusTrap as u,useScrollLock as p}from"./chunk-DWGYC7OD.js";import{Icon as f}from"./chunk-ISVODSRP.js";import{useHydrated as h}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-IUVGHHR3.js";import{useRef as b,useId as y,useState as g,useEffect as k}from"react";import{createPortal as w}from"react-dom";import{jsxs as j,Fragment as N,jsx as $}from"react/jsx-runtime";var C="bg-black/30 backdrop-blur-sm",D={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function V({open:V,onClose:H,title:S,description:W,role:G="dialog",children:I,footer:P,blocking:R=!1,size:U="md",aside:T=!1,dirty:E=!1,initialFocus:F,"aria-label":J,"aria-labelledby":O,"aria-describedby":Q,className:Y=""}){const z=b(null),A=y(),B=y(),K=!R,L=y(),X=x().dialog,Z=e(h()),[q,M]=g(null),_=d({open:V,dirty:E,onClose:H,title:S,layer:q}),ee=b(null),re=r(V&&null!==Z,ee),ie=i(re,z),te=t(V&&null!==Z,ee),ae=a(te,q),oe=o(te),le=null!==te.host;if(m(V),u(z,V&&null!==Z,F,ae),p(V),k(()=>{if(V)return v(()=>!ae.current?.(document.activeElement)&&(R||_(),!0),()=>z.current)},[V,R,_,ae]),!V||!Z)return null;/* @__PURE__ */
|
|
2
|
+
return j(N,{children:[/* @__PURE__ */$("span",{ref:ee,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
+
/* @__PURE__ */$(l,{value:q,children:/* @__PURE__ */j("div",{ref:M,className:"fixed inset-0"+(T?" pointer-events-none opacity-0":le?" pointer-events-none":""),style:s(te),role:"presentation","data-overlay-layer":"","data-aside":T?"":void 0,children:[!le&&/* @__PURE__ */$("div",{className:`fixed inset-0 ${C}`,"aria-hidden":"true","data-popup-scrim":"system"}),oe&&/* @__PURE__ */$("div",{className:`fixed ${C}${T?"":" pointer-events-auto"}${n(te)?" rounded-(--radius-window)":""}`,style:oe,onClick:R?void 0:_,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
+
/* @__PURE__ */$("div",{className:re?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:R||le?void 0:e=>{e.target===e.currentTarget&&_()},children:/* @__PURE__ */j("div",{ref:z,"data-popup-panel":"",style:re?{left:ie?.left??0,top:ie?.top??0,visibility:ie?void 0:"hidden"}:void 0,...c({role:G,modal:!0,titleId:S?L:void 0,labelledBy:O,label:J}),"aria-describedby":Q??(W?B:I?A:void 0),className:`${re?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${D[U]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl${le&&!T?" pointer-events-auto":""} ${Y}`.trim(),children:[S&&/* @__PURE__ */$("h2",{id:L,className:(K?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:S}),W&&/* @__PURE__ */$("p",{id:B,className:((S?"mt-1":K?"pr-8":"")+" text-sm text-gray-500").trim(),children:W}),I&&/* @__PURE__ */$("div",{id:A,className:"mt-2 text-sm text-gray-600",children:I}),P&&/* @__PURE__ */$("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:P}),K&&/* @__PURE__ */$("button",{type:"button",onClick:_,"aria-label":X.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */$(f,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),Z)]})}export{V as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-IUVGHHR3.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
2
|
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
3
|
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,fillFor as r,dashFor as o,maskId as l}from"./chunk-465RRWBY.js";import{ChartBrush as n}from"./chunk-MOKABQCY.js";import{ChartDot as i}from"./chunk-CK2YOGUS.js";import{ChartSkeleton as s}from"./chunk-ZNV75GAG.js";import{stepPath as c,curvePath as d,areaBetween as m,areaFrom as h}from"./chunk-VFC6QUEN.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-KNZ7YTFH.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as A,CHART_INK as z,STATUS_VARS as R}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as W}from"./chunk-TWVUQUUD.js";import{useShellStrings as C,useShellLocale as L}from"./chunk-IUVGHHR3.js";import{formatPercent as S,formatPlain as D}from"./chunk-C3QOHMR6.js";import{useRef as E,useState as T,useId as U,useEffect as I}from"react";import{jsx as F,jsxs as P}from"react/jsx-runtime";var O=12,Y=16,B=26,H=52,Q=t=>"number"==typeof t&&Number.isFinite(t);function G({series:G,labels:K,height:Z=200,stacked:J=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=C().charts,Vt=L(),At=rt??(t=>D(t,Vt)),zt=ot??At,Rt=jt??$t.noData,Wt=E(null),Ct=x(Wt),Lt=Nt??Ct,[St,Dt]=T(null),[Et,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Ft=ut??Et,Pt=p(ht&&Ft?Ft[1]-Ft[0]+1:K.length,pt);if(I(()=>{if(null!==St)return W(t=>"Escape"===t.key&&(Dt(null),!0))},[St]),kt)/* @__PURE__ */
|
|
2
|
+
return F("div",{className:wt,ref:Wt,children:/* @__PURE__ */F(s,{height:Z,width:Nt??Ct})});const Ot=K,Yt=ut??Et??[0,Math.max(0,Ot.length-1)],[Bt,Ht]=Yt,Qt=t=>Pt.slice(ht?t.slice(Bt,Ht+1):t),Gt=lt?Qt(lt):void 0,Kt=G.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Q)).map(t=>({...t,data:Qt(t.data),pointTones:t.pointTones?Qt(t.pointTones):void 0})),Zt=t=>(ht?Bt:0)+(Pt.view?.[0]??0)+t;if(K=Qt(Ot),0===Kt.length||0===K.length)/* @__PURE__ */
|
|
3
|
+
return F("div",{className:wt,ref:Wt,children:/* @__PURE__ */F("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:Z},children:Rt})});const Jt=K.map((t,e)=>Kt.reduce((t,a)=>t+(Q(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Jt[e]>0?t/Jt[e]:null,qt=[];if(J){let t=K.map(()=>0);for(const e of Kt)t=t.map((t,a)=>t+(Q(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!J&&!_t&&void 0===et&&Kt.some(te)&&Kt.some(t=>!te(t)),ae=gt&&!J?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Kt.filter(t=>!te(t)):Kt).filter(t=>!re(t)),le=ee?Kt.filter(te).flatMap(t=>t.data.filter(Q)):[],ne=J?(qt.at(-1)??[]).filter(Q):oe.flatMap(t=>t.data.filter(Q)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:J&&"percent"===X||_t||void 0!==et?null:b(J?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=J&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=J&&"percent"===X?t=>S(Math.round(100*t),0,Vt):At,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),H),fe=ie?w(ie.right.ticks.map(At),Y):Y,pe={left:ue,right:Math.max(ue+1,Lt-fe),top:O,bottom:Z-B},ge=j(K.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Kt.filter(re),Me=Math.max(0,...K.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Dt(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},Ae=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(Lt/96))));/* @__PURE__ */
|
|
4
|
+
return P("div",{className:`relative ${wt??""}`,ref:Wt,children:[
|
|
5
|
+
/* @__PURE__ */P("svg",{width:"100%",height:Z,viewBox:`0 0 ${Lt} ${Z}`,role:"img","aria-label":$t.overIntervals(Kt.map(t=>t.label),K.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Dt(null),onBlur:()=>Dt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==St&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Zt(St));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
|
+
/* @__PURE__ */F("defs",{children:/* @__PURE__ */F("clipPath",{id:It,children:/* @__PURE__ */F("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
+
/* @__PURE__ */F(t,{id:It,fills:Kt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:J?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */F("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:z.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:z.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */F("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */F("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:At(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */F("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:z.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */F("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${l(It)})`:void 0,children:Kt.map((t,l)=>{const n=A(t.slot,t.color,t.tone),i=t.mode??(J?"area":"line"),s=f(t.key,Ut);if("step"===i){const e=K.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Q(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return F("path",{d:c(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},t.key)}const u=K.map((e,a)=>{const r=J?qt[l]?.[a]:t.data[a];return Q(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===i){const r=Math.max(1,.62*ge.bandwidth),o="solid"===t.fillVariant,i=je(t);return re(t)?/* @__PURE__ */F("g",{opacity:s??void 0,className:"rosh-viz-mark",children:K.map((e,a)=>{const i=t.data[a];if(!Q(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Kt[t]?.key)).reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))(l,a),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
+
return F("rect",{x:ge.center(a)-r/2,y:c,width:r,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[a]?R[t.pointTones[a]]:n,fillOpacity:o?1:.55},a)})},t.key):/* @__PURE__ */F("g",{opacity:s??void 0,className:"rosh-viz-mark",children:K.map((s,c)=>{const d=J?qt[l]?.[c]:t.data[c];if(!Q(d))return null;const m=i(d);/* @__PURE__ */
|
|
12
|
+
return F("rect",{x:ge.center(c)-r/2,y:Math.min(m,xe),width:r,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:o?1:.35,className:xt?e.rise:void 0,style:xt?a(c,26):void 0},c)})},t.key)}const p=d(u,_,tt),g=J&&l>0?K.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?m(p,g):h(p,u,xe);/* @__PURE__ */
|
|
13
|
+
return P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===i||J)&&
|
|
14
|
+
/* @__PURE__ */F("path",{d:y,fill:r(It,l,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */F("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:o(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?e.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??R[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
|
+
return P("g",{children:[
|
|
17
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */F("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Kt.map((t,e)=>{if("column"===t.mode)return null;const a=ct??(st?"last":"none"),r=A(t.slot,t.color,t.tone),o=[...t.data].map(Q).lastIndexOf(!0),l="all"===a?K.map((t,e)=>e).filter(a=>Q(J?qt[e]?.[a]:t.data[a])):o>=0?[o]:[];/* @__PURE__ */
|
|
18
|
+
return P("g",{children:[l.map(a=>{const l=J?qt[e]?.[a]:t.data[a];return Q(l)?/* @__PURE__ */F(i,{cx:ge.center(a),cy:je(t)(l),color:r,variant:dt,pulse:mt&&a===o,title:`${K[a]}: ${t.label} ${At(l)}`},a):null}),st&&o>=0&&Q(J?qt[e]?.[o]:t.data[o])&&/* @__PURE__ */F("text",{x:ge.center(o)-10,y:je(t)(J?qt[e]?.[o]:t.data[o])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:At(J?qt[e]?.[o]:t.data[o])})]},`dots-${t.key}`)}),K.map((t,e)=>e%Ae===0?/* @__PURE__ */F("text",{x:ge.center(e),y:Z-8,textAnchor:"middle",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==St&&/* @__PURE__ */F("line",{x1:ge.center(St),y1:pe.top,x2:ge.center(St),y2:pe.bottom,stroke:z.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
|
+
/* @__PURE__ */P("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:z.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */F("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Pt.drag&&/* @__PURE__ */F(g,{x0:ge(Pt.drag[0]),x1:ge(Pt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),K.map((t,e)=>/* @__PURE__ */F("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Dt(e),onPointerDown:()=>Pt.press(e),onPointerEnter:()=>Pt.over(e),onPointerUp:Pt.release,onClick:yt?()=>yt(Zt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Pt.view&&/* @__PURE__ */F(y,{from:Gt?.[0]??K[0],to:Gt?.at(-1)??K[K.length-1],count:K.length,total:J&&"percent"!==X?zt(Jt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Q).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Kt).filter(t=>t.data.some(Q)).map(t=>{const e=t.data.filter(Q),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=J||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Pt.clear}),ht&&Ot.length>2&&/* @__PURE__ */F(n,{className:"mt-1",labels:Ot,width:Lt,data:G[0]?.data??[],range:Yt,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==St&&
|
|
22
|
+
/* @__PURE__ */F("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(St),ge.bandwidth,Lt),children:/* @__PURE__ */F(V,{title:Gt?.[St]??K[St],rows:Kt.map((t,e)=>({key:t.key,label:t.label,color:A(t.slot,t.color,t.tone),value:Q(t.data[St])?J&&"percent"===X?`${S(100*(Xt(t.data[St],St)??0),1,Vt)} · ${zt(t.data[St])}`:zt(t.data[St]):void 0})),footnote:J&&"percent"===X?$t.inBucket(zt(Jt[St])):void 0})})]})}export{G as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-FTKLODQK.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
3
|
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),I=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(S,()=>C.current,I.current)},[j,d,S]);const D=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:v?"spread":"linear",labels:v?"none":"active",endMark:v?M:null,items:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:
|
|
4
|
-
/* @__PURE__ */b("span",{children:
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(F.date).getTime())," · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-PALWXHBQ.js";import{toDayMs as a,fmtSliderDate as i}from"./chunk-5CFERCYW.js";import{DAY_MS as o}from"./chunk-JRQMX4PK.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-IUVGHHR3.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:i,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),[_,v]=u(null),M=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[w,P]=u(!1),N=g(null),S=()=>{null!=N.current&&(cancelAnimationFrame(N.current),N.current=null),P(!1)};m(()=>()=>S(),[]),m(()=>{S()},[d]);const x=t.map(e=>a(e.date)).filter(e=>null!=e),R=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=x.length?Math.min(...x):R,D=x.length?Math.max(...x):R,q=a(r??null)??C,O=a(n??null)??0,j=k.has((i||"").toLowerCase()),I=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),T=(()=>{const e=[O,D,I,q+o];return j||e.push(R),Math.max(...e)})(),$=Math.max(1,Math.round((T-q)/o)),A=a(p??null)??D??q,L=e=>Math.min(Math.max(e,q),T),F=L(y??A),H=null!=_?L(_):F,z=t.find(e=>{const t=a(e.date);return null!=t&&t<=H})??null;let B=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>H){B=t[e];break}}const E=(()=>{if(z||!B||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:M.start,date:r||new Date(q).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),G=z??E,J=z?a(z.date):E?q:null,K=B?a(B.date):null,Q=!!(G&&B&&null!=J&&null!=K&&H>J&&H<K),V=a(n??null),W=!!(z&&!B&&null!=J&&null!=V&&V>J&&H>J);let X,U;if(Q&&null!=J&&null!=K){const e=(H-J)/Math.max(K-J,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of G?.items??[])r[e.part_number]=e;const n={};for(const e of B?.items??[])n[e.part_number]=e;const i=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const i=r[e]??{},o=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:i.description??o.description??"",order_qty:s(i.order_qty??o.order_qty??0),casting:t(s(i.casting),s(o.casting)),cnc:t(s(i.cnc),s(o.cnc)),painting:t(s(i.painting),s(o.painting)),packing:t(s(i.packing),s(o.packing)),finished_goods:t(s(i.finished_goods),s(o.finished_goods)),stock_qty:t(s(i.stock_qty),s(o.stock_qty))}}),o=a(G?.est_completion_date),s=a(B?.est_completion_date);let l;l=null!=o&&null!=s?new Date(Math.round(o+(s-o)*e)).toISOString().slice(0,10):G?.est_completion_date||B?.est_completion_date||null,X={id:`interp-${H}`,progress_number:M.estimated,date:new Date(H).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:i,notes:""},U=G}else if(W&&z&&null!=J&&null!=V){const e=Math.min(1,(H-J)/Math.max(V-J,1)),t=e=>Number(e)||0,r=(z.items??[]).map((r,n)=>{const a=t(r.order_qty),i=r=>{const n=t(r);return n>=a?n:Math.round(n+(a-n)*e)};return{id:`proj-${r.part_number}-${n}`,part_number:r.part_number,description:r.description??"",order_qty:a,casting:i(r.casting),cnc:i(r.cnc),painting:i(r.painting),packing:i(r.packing),finished_goods:i(r.finished_goods),stock_qty:i(r.stock_qty)}});X={id:`proj-${H}`,progress_number:M.estimated,date:new Date(H).toISOString().slice(0,10),created_by_name:"",est_completion_date:n??z.est_completion_date??null,items:r,notes:""},U=z}else if(X=G??t[t.length-1]??null,X){const e=t.findIndex(e=>e.id===X.id);U=e>=0&&e<t.length-1?t[e+1]:null}else U=null;const Y={};for(const e of U?.items??[])Y[e.part_number]=e;const Z=!(!d||X?.id===d),ee=d?Math.min(a(p??null)??T,T):T,te=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:q,endMs:T,totalLeadDays:$,scrubMs:H,setScrubMs:e=>{S(),v(null),f(e)},committedScrubMs:F,setPreviewMs:e=>{w||v(e)},previewing:null!=_,resetToCurrent:()=>{S(),p&&f(new Date(p).getTime())},scrubbedAway:Z,beforeAnchor:G,nextAfter:B,displayed:X,prevReport:U,prevByPN:Y,isInterpolated:Q,isProjected:W,playing:w,startPlay:()=>{if(w)return void S();if(ee<=q)return void f(ee);P(!0),f(q);let e=performance.now(),t=q;const r=n=>{const a=n-e;if(e=n,t+=a/h*o,t>=ee)return f(ee),N.current=null,void P(!1);f(t),N.current=requestAnimationFrame(r)};N.current=requestAnimationFrame(r)},stopPlay:S,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:te,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:s,activeId:l,onChange:p,onPickReport:u,onOpenReport:m,onOpenMarker:g,onDragStart:h,renderReportPreview:y,reportLabel:k,playback:f,edgeCaptions:_,bare:v=!1,endMark:M=null,onPreview:w,restMs:P}){const N=c().production,S=d(),x=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),R=x.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:k(e),preview:e.preview??y?.(e),onOpen:m?()=>m(e.id):void 0})),C=new Map(x.map(({report:e,ms:t})=>[e.id,t])),D=e=>Math.round(e/o)*o,q=g?a.map(e=>({...e,onOpen:g})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:v?"spread":"linear",labels:v?"none":"active",endMark:v?M:null,items:R,markers:q,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=C.get(e);null!=t&&p(t),u(e)},playback:f,edgeCaptions:_,thumb:{valueMs:s,onChange:e=>p(D(e)),onDragStart:h,onPreview:w?e=>w(null==e?null:D(e)):void 0,restMs:P,ariaLabel:N.scrub,valueText:e=>{const t=(e=>x.find(t=>t.ms===e)?.report)(e);return t?`${k(t)} · ${i(e,S)}`:i(e,S)}},ariaLabel:N.label(i(e,S),i(t,S))})})}function P({snapshot:n,onPickReport:o,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:P=e=>e.progress_number,resetLabel:N,variant:S="card",onPlayStart:x}){const{reports:R,markers:C,poNumber:D,startMs:q,endMs:O,totalLeadDays:j,scrubMs:I,setScrubMs:T,committedScrubMs:$,setPreviewMs:A,previewing:L,displayed:F,scrubbedAway:H,resetToCurrent:z,currentReportId:B,currentReportProgressNumber:E,estCompletionMs:G,isInterpolated:J,isProjected:K}=n,Q=!(!J&&!K),V=function(e,t,r){const[n,a]=u(!1),i=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),i.current||(i.current=!0,t(e[0])),a(!0))},stop:()=>{i.current=!1,a(!1)}}}(R.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),T,x),W=c().production,X=d(),U=_??W.heading,Y=e=>i(e,X);if(0===R.length&&0===C.length)return null;const Z=C.filter(e=>"shipment"===e.kind),ee=C.filter(e=>"inspection"===e.kind),te=C.filter(e=>"invoice"===e.kind),re=(F?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),ne=F?v(F):0,ae=R.find(e=>e.id===B),ie=ae?P(ae):E,oe=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:V.toggle,"aria-pressed":V.playing,title:V.playing?W.pause:W.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[V.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:V.playing?W.pause:W.play})]}),se=H&&(N??ie)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{V.stop(),z()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:N??W.backTo(String(ie))}):null,[le,ce]=p(W.showing),de=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:F?/* @__PURE__ */h(y,{children:[e&&le,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:Q?W.estimated:P(F)}),e&&ce,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(F.date).getTime())," · ",W.overall(Math.round(ne))," · ",W.inStock(re)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:W.noReport})});if("rail"===S){const e=null!=G&&G>=O&&O>q,t=e?{key:"__estimate__",label:W.estimatedCompletion,dateText:Y(G)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:q,endMs:O,reports:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:q,endMs:O,reports:R,markers:C,valueMs:I,activeId:F?.id??"",onChange:T,onPreview:A,restMs:L?$:void 0,onPickReport:o,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:P,edgeCaptions:{start:M?.start??W.start,end:M?.end??(e?W.estDone:void 0)},onDragStart:V.stop,playback:{playing:V.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:V.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[oe,se,de(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
11
|
-
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[
|
|
12
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),
|
|
13
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),
|
|
14
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:U,subject:D,meta:[`${Y(q)} → ${Y(O)}`,W.leadTime(j)],actions:/* @__PURE__ */h(y,{children:[se,oe]}),footer:/* @__PURE__ */h(y,{children:[de(!0),
|
|
11
|
+
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[R.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),W.report]}),Z.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),W.shipment]}),ee.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),W.inspection]}),te.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),W.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:q,endMs:O,reports:R,markers:C,valueMs:I,activeId:F?.id??"",onChange:T,onPreview:A,restMs:L?$:void 0,onPickReport:o,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:P,edgeCaptions:M,onDragStart:V.stop,playback:{playing:V.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:V.stop}})})})}export{k as POST_PRODUCTION_STATUSES,P as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-HK53EKZH.js";import{Button_default as n}from"./chunk-EVYD6UFQ.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e,stepRounding as a}from"./chunk-F5B5WOQ7.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-SOZCWT6I.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */n(i,{name:"padding-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"padding-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"padding-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"padding-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"padding-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"padding-left-right","aria-hidden":"true",className:l})},crop:{top:/* @__PURE__ */n(i,{name:"crop-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"crop-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"crop-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"crop-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"crop-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"crop-left-right","aria-hidden":"true",className:l})}},m=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","PageUp","PageDown"]),p=e=>{m.has(e.key)&&(e.preventDefault(),e.stopPropagation())},c=e=>e.stopPropagation(),h=/* @__PURE__ */n(i,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var u=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function g(e,a){const r=r=>u(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function f({label:r,value:i,onChange:t,each:l,placeholder:m,words:h,min:g=0,max:f=200,step:b=4,readOnly:v,glyphs:N="padding",units:y,sideDisplay:w}){const x=s[N],C=(e,a)=>{const r={...i};for(const i of e)r[i]=a;t(r)},j=(r,t,o)=>{const d=r.map(e=>w?.[e]?.word),l=d[0]&&d.every(e=>e===d[0])?d[0]:void 0;if(l)/* @__PURE__ */
|
|
2
2
|
return n("div",{"data-side":r.join("-"),className:"min-w-0",onKeyDownCapture:p,onWheelCapture:c,children:/* @__PURE__ */n(e,{value:null,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),readOnly:v,placeholder:l,display:()=>l,reportWhileTyping:!1,prefix:o,"aria-label":t})});const s=d.some(Boolean)?"mixed":function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(i,r),N=r.map(e=>u(i,m,e)),x="mixed"!==s&&N.every(e=>e===N[0])?N[0]:"–";/* @__PURE__ */
|
|
3
3
|
return n("div",{"data-side":r.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),steppers:"compact",readOnly:v,placeholder:x,prefix:o,suffix:h.unit,units:y,"aria-label":t})})};/* @__PURE__ */
|
|
4
4
|
return n("div",{role:"group","aria-label":r,"data-sides":l?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,l?{children:[j(["left"],h.sides.left,x.left),j(["top"],h.sides.top,x.top),j(["right"],h.sides.right,x.right),j(["bottom"],h.sides.bottom,x.bottom)]}:{children:[j(["left","right"],h.horizontal,x.horizontal),j(["top","bottom"],h.vertical,x.vertical)]})})}function b({each:e,onChange:a,label:i,disabled:o}){/* @__PURE__ */
|