efficient-shell 13.24.1 → 14.0.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.
Files changed (265) hide show
  1. package/README.md +22 -7
  2. package/dist/{Browser-P6CXFZWM.js → Browser-FYVRNXOL.js} +14 -14
  3. package/dist/Calculator-7CY2CRGB.js +29 -0
  4. package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
  5. package/dist/{Files-NTJ4WI6F.js → Files-VDQYQSDZ.js} +79 -79
  6. package/dist/{Notepad-GIRH6KIR.js → Notepad-J3Z3CYEC.js} +8 -8
  7. package/dist/PomodoroTimer-RPGWT26T.js +91 -0
  8. package/dist/{Preview-A4NPS775.js → Preview-ISEPDV3A.js} +22 -22
  9. package/dist/Sidebar-2TYZENQL.js +44 -0
  10. package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
  11. package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
  12. package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
  13. package/dist/ai/index.js +92 -92
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/charts/ChordChart.js +1 -1
  19. package/dist/charts/FlowChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/SankeyChart.js +1 -1
  22. package/dist/charts/SpecChart.js +1 -1
  23. package/dist/charts/SunburstChart.js +1 -1
  24. package/dist/charts/TreemapChart.js +1 -1
  25. package/dist/{chunk-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
  26. package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
  27. package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
  28. package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
  29. package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
  30. package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
  31. package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
  32. package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
  33. package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
  34. package/dist/chunk-4DNPUG3T.js +7 -0
  35. package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
  36. package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
  37. package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
  38. package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
  39. package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
  40. package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
  41. package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
  42. package/dist/{chunk-3OPPTU4V.js → chunk-7KNVO46D.js} +2 -2
  43. package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
  44. package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
  45. package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
  46. package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
  47. package/dist/chunk-AJPQJ7TC.js +6 -0
  48. package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
  49. package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
  50. package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
  51. package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
  52. package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
  53. package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
  54. package/dist/chunk-DBQNYJZ6.js +1 -0
  55. package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
  56. package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
  57. package/dist/chunk-DOJSWVBX.js +6 -0
  58. package/dist/chunk-DTFX624I.js +8 -0
  59. package/dist/chunk-E57C7NBA.js +2 -0
  60. package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
  61. package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
  62. package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
  63. package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
  64. package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
  65. package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
  66. package/dist/chunk-FFPIT2LB.js +3 -0
  67. package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
  68. package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
  69. package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
  70. package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
  71. package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
  72. package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
  73. package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
  74. package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
  75. package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
  76. package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
  77. package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
  78. package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
  79. package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
  80. package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
  81. package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
  82. package/dist/chunk-KEFNQEXZ.js +1 -0
  83. package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
  84. package/dist/chunk-M5IZ7QLQ.js +7 -0
  85. package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
  86. package/dist/chunk-MEP6CZJ3.js +2 -0
  87. package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
  88. package/dist/chunk-MNZAAQLH.js +15 -0
  89. package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
  90. package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
  91. package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
  92. package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
  93. package/dist/chunk-NDCS4COQ.js +11 -0
  94. package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
  95. package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
  96. package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
  97. package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
  98. package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
  99. package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
  100. package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
  101. package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
  102. package/dist/chunk-PU2GJVMG.js +1 -0
  103. package/dist/{chunk-LUARJHUK.js → chunk-PWERFHOU.js} +9 -9
  104. package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
  105. package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
  106. package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
  107. package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
  108. package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
  109. package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
  110. package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
  111. package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
  112. package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
  113. package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
  114. package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
  115. package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
  116. package/dist/{chunk-OE7BXD3M.js → chunk-U6W3OU2X.js} +1 -1
  117. package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
  118. package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
  119. package/dist/chunk-UZESZ3EB.js +1 -0
  120. package/dist/chunk-VUBDHFG5.js +4 -0
  121. package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
  122. package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
  123. package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
  124. package/dist/{chunk-7N6CVTWO.js → chunk-WNFZYTWW.js} +9 -9
  125. package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
  126. package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
  127. package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
  128. package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
  129. package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
  130. package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
  131. package/dist/chunk-Y2M5PP2C.js +28 -0
  132. package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
  133. package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
  134. package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
  135. package/dist/chunk-Y7D2CZ4H.js +13 -0
  136. package/dist/chunk-YTLUSBDY.js +14 -0
  137. package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
  138. package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
  139. package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
  140. package/dist/chunk-ZSVU44OB.js +6 -0
  141. package/dist/data/DataTable.js +1 -1
  142. package/dist/data/EntityList.js +1 -1
  143. package/dist/data/Gantt.js +1 -1
  144. package/dist/data/Kanban.js +1 -1
  145. package/dist/data/ListLoadError.js +1 -1
  146. package/dist/data/ResizableTable.js +1 -1
  147. package/dist/data/statusColumn.js +1 -1
  148. package/dist/data/useColumnConfig.js +1 -1
  149. package/dist/data/useSort.js +1 -1
  150. package/dist/forms/AlignmentGrid.js +1 -1
  151. package/dist/forms/BorderInput.js +1 -1
  152. package/dist/forms/BrandAssetEditor.js +1 -1
  153. package/dist/forms/Button.js +1 -1
  154. package/dist/forms/Calendar.js +1 -1
  155. package/dist/forms/ColorPicker.js +1 -1
  156. package/dist/forms/ComposerAttachments.js +1 -1
  157. package/dist/forms/CornersInput.js +1 -1
  158. package/dist/forms/DatePicker.js +1 -1
  159. package/dist/forms/DateRangePicker.js +1 -1
  160. package/dist/forms/DisplayChips.js +1 -1
  161. package/dist/forms/FilePicker.js +1 -1
  162. package/dist/forms/IconButton.js +1 -1
  163. package/dist/forms/IconPicker.js +1 -1
  164. package/dist/forms/Input.js +1 -1
  165. package/dist/forms/InputNumber.js +1 -1
  166. package/dist/forms/LinkPicker.js +1 -1
  167. package/dist/forms/MediaLibrary.js +1 -1
  168. package/dist/forms/MediaUploadField.js +1 -1
  169. package/dist/forms/MediaUploadGrid.js +1 -1
  170. package/dist/forms/MediaUsedInList.js +1 -1
  171. package/dist/forms/NumericKeypad.js +1 -1
  172. package/dist/forms/PictureTiles.js +1 -1
  173. package/dist/forms/PositionInput.js +1 -1
  174. package/dist/forms/RenameField.js +1 -1
  175. package/dist/forms/Segmented.js +1 -1
  176. package/dist/forms/Select.js +1 -1
  177. package/dist/forms/SidesInput.js +1 -1
  178. package/dist/forms/Slider.js +1 -1
  179. package/dist/forms/Snippet.js +1 -1
  180. package/dist/forms/SplitButton.js +1 -1
  181. package/dist/forms/TagInput.js +1 -1
  182. package/dist/forms/TextToolbar.js +1 -1
  183. package/dist/forms/UnitMenu.js +1 -1
  184. package/dist/forms/WidthsBar.js +1 -1
  185. package/dist/forms/dropdownPosition.js +1 -1
  186. package/dist/hooks/index.d.ts +15 -14
  187. package/dist/hooks/index.js +1 -1
  188. package/dist/hooks/useTheme.js +1 -1
  189. package/dist/index.d.ts +43 -2
  190. package/dist/index.js +86 -86
  191. package/dist/map/index.js +5 -5
  192. package/dist/markdown/index.js +1 -1
  193. package/dist/page-tabs/index.js +5 -5
  194. package/dist/shell/AppUpdateBanner.js +1 -1
  195. package/dist/shell/ColoredBadge.js +1 -1
  196. package/dist/shell/ConfirmDialog.js +1 -1
  197. package/dist/shell/ContextMenu.js +1 -1
  198. package/dist/shell/Dialog.js +1 -1
  199. package/dist/shell/Drawer.js +1 -1
  200. package/dist/shell/DropdownMenu.js +1 -1
  201. package/dist/shell/EditableGrid.js +1 -1
  202. package/dist/shell/FloatingBar.js +1 -1
  203. package/dist/shell/GlobalSearch.js +1 -1
  204. package/dist/shell/HelpCenter.js +1 -1
  205. package/dist/shell/IconRail.js +1 -1
  206. package/dist/shell/ImageLightbox.js +1 -1
  207. package/dist/shell/ItemCount.js +1 -1
  208. package/dist/shell/Kbd.js +1 -1
  209. package/dist/shell/LanguageSelect.js +1 -1
  210. package/dist/shell/Markdown.js +1 -1
  211. package/dist/shell/MilestoneTimeline.js +1 -1
  212. package/dist/shell/Popover.js +1 -1
  213. package/dist/shell/PopupMenu.js +1 -1
  214. package/dist/shell/ProductionTimeline.js +1 -1
  215. package/dist/shell/ResizeHandle.js +1 -1
  216. package/dist/shell/SearchableSelect.js +1 -1
  217. package/dist/shell/SettingReset.js +1 -1
  218. package/dist/shell/ShellPrefs.js +1 -1
  219. package/dist/shell/SidebarLayout.js +1 -1
  220. package/dist/shell/SidebarNav.js +1 -1
  221. package/dist/shell/SortableList.js +1 -1
  222. package/dist/shell/StatusBadge.js +1 -1
  223. package/dist/shell/Tabs.js +1 -1
  224. package/dist/shell/TimelineTrack.js +1 -1
  225. package/dist/shell/Tooltip.js +1 -1
  226. package/dist/shell/TopNav.js +1 -1
  227. package/dist/shell/TransferProgress.js +1 -1
  228. package/dist/shell/Tree.js +1 -1
  229. package/dist/shell/discardGuard.js +1 -1
  230. package/dist/telemetry/index.js +1 -1
  231. package/dist/templates/AuthScreen.js +1 -1
  232. package/dist/templates/ChatTemplate.js +1 -1
  233. package/dist/templates/CheckoutTemplate.js +1 -1
  234. package/dist/templates/DashboardTemplate.js +1 -1
  235. package/dist/templates/DataTablePage.js +1 -1
  236. package/dist/templates/EmailTemplate.js +1 -1
  237. package/dist/templates/ErrorBoundary.js +1 -1
  238. package/dist/templates/FormLayoutPage.js +1 -1
  239. package/dist/templates/GalleryTemplate.js +1 -1
  240. package/dist/ui/index.js +1 -1
  241. package/dist/version.js +1 -1
  242. package/package.json +1 -1
  243. package/dist/Calculator-PKAM5ERT.js +0 -29
  244. package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
  245. package/dist/Sidebar-HAIHWIJD.js +0 -44
  246. package/dist/chunk-2AEYVQ2R.js +0 -2
  247. package/dist/chunk-3GJVTK4H.js +0 -11
  248. package/dist/chunk-3TD3GH53.js +0 -7
  249. package/dist/chunk-44ERJYNW.js +0 -6
  250. package/dist/chunk-AAFPAQXH.js +0 -13
  251. package/dist/chunk-EX3DARI3.js +0 -7
  252. package/dist/chunk-F2RAIGCG.js +0 -6
  253. package/dist/chunk-FLQXMCB3.js +0 -8
  254. package/dist/chunk-I52YJ3QD.js +0 -1
  255. package/dist/chunk-N6PMH6DU.js +0 -6
  256. package/dist/chunk-PP3WUT2G.js +0 -15
  257. package/dist/chunk-RJVIKGHJ.js +0 -4
  258. package/dist/chunk-SRI2D23Y.js +0 -14
  259. package/dist/chunk-UTISUEO4.js +0 -2
  260. package/dist/chunk-UVHXVSB2.js +0 -1
  261. package/dist/chunk-WCCS4VFE.js +0 -1
  262. package/dist/chunk-ZDXRSY2Y.js +0 -1
  263. package/dist/chunk-ZISKHQZY.js +0 -3
  264. package/dist/chunk-ZVNU3WJ3.js +0 -28
  265. /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
@@ -1,15 +1,15 @@
1
- import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i}from"./chunk-WCCS4VFE.js";import{useBrowserLayoutEffect as a}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{glassStyle as c,GLASS_DIVIDER as s}from"./chunk-5FYDNH4Y.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function M(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function T(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),j=d(!1);function D({children:e,style:n,className:a="",onClose:s,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const M=i(),T=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),s?.()},root:p}},[b,x,s]);g(()=>{if(!s)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&s()},t=e=>{"Escape"===e.key&&s()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(s),o=l(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[s,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const j=W(),D=/(^|[\s:])!?z-/.test(a),L=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===j?"py-1":"large"===j?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...D?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...c(),...n},children:/* @__PURE__ */k($.Provider,{value:T,children:e})});return u?M?w(L,document.body):null:L}function L(e,t,n,r=!1,o="kit"){const i=W(),a="tight"===i?"0.25rem":"large"===i?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${"none"===o?"":e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:a,paddingBottom:a,..."normal"===i?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var B=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function R({kind:e,checked:t}){/* @__PURE__ */
2
- return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&B}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&B})}var H=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(j),E=L(o,i,r),M=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
3
- return x("button",{ref:f,id:u,role:"radio"===M?"menuitemradio":"checkbox"===M?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":M?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==M&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[M&&/* @__PURE__ */k(R,{kind:M,checked:!!l}),b?
1
+ import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as a}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{glassStyle as c,GLASS_DIVIDER as s}from"./chunk-5FYDNH4Y.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function M(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function T(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),j=d(!1);function L({children:e,style:n,className:a="",onClose:s,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const M=i(),T=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),s?.()},root:p}},[b,x,s]);g(()=>{if(!s)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&s()},t=e=>{"Escape"===e.key&&s()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(s),o=l(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[s,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const j=W(),L=/(^|[\s:])!?z-/.test(a),B=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===j?"py-1":"large"===j?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...c(),...n},children:/* @__PURE__ */k($.Provider,{value:T,children:e})});return u?M?w(B,document.body):null:B}function B(e,t,n,r=!1,o="kit"){const i=W(),a="tight"===i?"0.25rem":"large"===i?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${"none"===o?"":e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:a,paddingBottom:a,..."normal"===i?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var D=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function P({kind:e,checked:t}){/* @__PURE__ */
2
+ return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var H=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(j),E=B(o,i,r),M=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
3
+ return x("button",{ref:f,id:u,role:"radio"===M?"menuitemradio":"checkbox"===M?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":M?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==M&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[M&&/* @__PURE__ */k(P,{kind:M,checked:!!l}),b?
4
4
  /* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
5
- /* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(P,{children:c}),
5
+ /* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(R,{children:c}),
6
6
  /* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
7
- /* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(P,{children:c}),n]})]})});function P({children:e}){/* @__PURE__ */
8
- return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var F=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function S(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:s=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),j=h(),D=h(!1),B=`${N}-menu`;g(()=>()=>clearTimeout(j.current),[]);const R=f?.depth??0,H=f?.path[R],P=!!H&&H.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(j.current),D.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=R>0&&(f.path[R-1]?.flipped??!1),a=T(r.left,r.right,s,window.innerWidth,4,i);f.open(R,{key:N,y:t.top,...a})},[f,o,R,N,s]),z=e=>{f?.closeBelow(R),C.current?.focus()};g(()=>{if(P)return l(e=>"Escape"===e.key&&(!(f&&f.path.length>R+1)&&(z(),!0)),()=>E.current)}),a(()=>{if(!P||!H)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=R>0&&(f?.path[R-1]?.flipped??!1),o=e.offsetWidth||s,i=T(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=M(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{P&&D.current&&(D.current=!1,S(E.current)[0]?.focus())},[P]);const U=y(()=>f&&{...f,depth:R+1},[f,R]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=L(!1,o,i,P),V=W();/* @__PURE__ */
7
+ /* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(R,{children:c}),n]})]})});function R({children:e}){/* @__PURE__ */
8
+ return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var F=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function S(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:s=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),j=h(),L=h(!1),D=`${N}-menu`;g(()=>()=>clearTimeout(j.current),[]);const P=f?.depth??0,H=f?.path[P],R=!!H&&H.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(j.current),L.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=P>0&&(f.path[P-1]?.flipped??!1),a=T(r.left,r.right,s,window.innerWidth,4,i);f.open(P,{key:N,y:t.top,...a})},[f,o,P,N,s]),z=e=>{f?.closeBelow(P),C.current?.focus()};g(()=>{if(R)return l(e=>"Escape"===e.key&&(!(f&&f.path.length>P+1)&&(z(),!0)),()=>E.current)}),a(()=>{if(!R||!H)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=P>0&&(f?.path[P-1]?.flipped??!1),o=e.offsetWidth||s,i=T(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=M(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{R&&L.current&&(L.current=!1,S(E.current)[0]?.focus())},[R]);const U=y(()=>f&&{...f,depth:P+1},[f,P]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=B(!1,o,i,R),G=W();/* @__PURE__ */
9
9
  return x(v,{children:[
10
- /* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-controls":P?B:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;P?t&&S(E.current)[0]?.focus():I(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),I(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),P?f.closeBelow(R+1):(clearTimeout(j.current),j.current=setTimeout(()=>I(!1),120)))},onMouseLeave:()=>{clearTimeout(j.current),f.scheduleClose(R)},children:[n,
11
- /* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),F]}),P&&w(
12
- /* @__PURE__ */k("div",{ref:E,id:B,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===V?"py-1":"large"===V?"py-2":"py-1"),style:{left:H.left,top:H.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+R+1,animation:(H.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...c()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=S(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),z())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(j.current)},onMouseLeave:()=>f.scheduleClose(R+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function z(){const e=W();/* @__PURE__ */
10
+ /* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":R,"aria-controls":R?D:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;R?t&&S(E.current)[0]?.focus():I(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),I(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),R?f.closeBelow(P+1):(clearTimeout(j.current),j.current=setTimeout(()=>I(!1),120)))},onMouseLeave:()=>{clearTimeout(j.current),f.scheduleClose(P)},children:[n,
11
+ /* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),F]}),R&&w(
12
+ /* @__PURE__ */k("div",{ref:E,id:D,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===G?"py-1":"large"===G?"py-2":"py-1"),style:{left:H.left,top:H.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+P+1,animation:(H.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...c()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=S(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),z())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(j.current)},onMouseLeave:()=>f.scheduleClose(P+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function z(){const e=W();/* @__PURE__ */
13
13
  return k("div",{className:`border-t ${s} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
14
- return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function V({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
15
- return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{R as MenuCheckMark,V as MenuIcon,j as MenuSemanticsContext,D as PopupMenu,z as PopupMenuDivider,H as PopupMenuItem,q as PopupMenuLabel,I as PopupSubmenu,M as clampMenuTop,C as closeMenuBelow,L as itemLook,T as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
14
+ return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function G({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
15
+ return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{P as MenuCheckMark,G as MenuIcon,j as MenuSemanticsContext,L as PopupMenu,z as PopupMenuDivider,H as PopupMenuItem,q as PopupMenuLabel,I as PopupSubmenu,M as clampMenuTop,C as closeMenuBelow,B as itemLook,T as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
@@ -1,4 +1,4 @@
1
- import{CloseGlyph as e}from"./chunk-DTRJLQWO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-NWS5G7FE.js";import{Button_default as s}from"./chunk-UTISUEO4.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{CloseGlyph as e}from"./chunk-MPC3CHAO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-MYH5H43C.js";import{Button_default as s}from"./chunk-MEP6CZJ3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
@@ -6,7 +6,7 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
7
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:n.name,children:n.name}),
8
8
  /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:t(n.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(n.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${n.name}-${n.size}-${s}`)})})}function b({onClick:e,count:t=0,variant:n="button",label:r,disabled:i=!1}){const l=c().files,o=r??l.attach,p=t>0?`${o} (${t})`:o;return"icon"===n?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:N,className:j="",children:v}){const L=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{N&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,N(L.rejections))},[L.rejections,N]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:j,children:[v,
9
+ /* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
10
10
  /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
12
  /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
@@ -1 +1 @@
1
- import{loadIconSet as t,iconSetFor as e}from"./chunk-VQCKMT5F.js";import{hexToRgb as n}from"./chunk-S6OB6HJB.js";import{useShellPrefs as o}from"./chunk-DPFEQQQU.js";import{setIconSet as c}from"./chunk-J75ZT2JQ.js";import{useSyncExternalStore as r,useEffect as s}from"react";function u(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function m(t){const e=u();return e?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):()=>{}}function a(){return u()?.matches??!1}function l(){return!1}function i(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,c=Math.max(e,n,o),r=Math.min(e,n,o);let s=0,u=0;const m=(c+r)/2;if(c!==r){const t=c-r;u=m>.5?t/(2-c-r):t/(c+r),s=c===e?((n-o)/t+(n<o?6:0))/6:c===n?((o-e)/t+2)/6:((e-n)/t+4)/6}return[360*s,100*u,100*m]}function d(t,e,n){n/=100;const o=(e/=100)*Math.min(n,1-n),c=e=>{const c=(e+t/30)%12;return n-o*Math.max(Math.min(c-3,9-c,1),-1)},r=t=>Math.round(255*t).toString(16).padStart(2,"0");return`#${r(c(0))}${r(c(8))}${r(c(4))}`}function h(t){const e=t||"system";return"system"===e?a()?"dark":"light":e}function f(t){const e=document.documentElement;if(t&&/^#[0-9a-fA-F]{6}$/.test(t)){const[n,o,c]=i(t);e.setAttribute("data-custom-accent","true"),e.style.setProperty("--accent-600",t),e.style.setProperty("--accent-700",d(n,o,Math.max(c-10,5))),e.style.setProperty("--accent-500",d(n,o,Math.min(c+10,95))),e.style.setProperty("--accent-400",d(n,o,Math.min(c+20,95))),e.style.setProperty("--accent-300",d(n,Math.min(o+10,100),Math.min(c+30,92))),e.style.setProperty("--accent-200",d(n,Math.min(o+15,100),Math.min(c+38,94))),e.style.setProperty("--accent-100",d(n,Math.min(o+20,100),Math.min(c+42,96))),e.style.setProperty("--accent-50",d(n,Math.min(o+20,100),Math.min(c+46,98)))}else e.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(t=>e.style.removeProperty(t))}function y(t,e,o,c,r){const s=document.documentElement;if(t){const t=(t,e)=>{const o=n(e);o?s.style.setProperty(t,`${o.r} ${o.g} ${o.b}`):s.style.removeProperty(t)};if(e&&s.style.setProperty("--custom-bg-color",e),o&&(t("--window-header-rgb",o),t("--window-footer-rgb",o)),c&&t("--window-content-rgb",c),r){s.style.setProperty("--custom-button-color",r);const[t,e,n]=i(r);s.style.setProperty("--custom-button-hover",d(t,e,Math.max(n-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(t=>s.style.removeProperty(t))}var p=["square","soft","round"];function _(t){return"square"===t||"round"===t?t:"soft"}var b={pink:"round",grey:"square"};function M(t,e,n){return n?"square"===e||"round"===e?e:"soft":b[t]??"soft"}function g(t){const e=_(t);"soft"===e?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",e)}function v(e){const n="string"==typeof e&&e?e:null;c(n),n&&t(n),n?document.documentElement.setAttribute("data-icon-set",n):document.documentElement.removeAttribute("data-icon-set")}function w(t){const n=!!t.accent_color;"corners"in t&&g(M(h(t.theme),t.corners,n)),"icon_set"in t&&v(e(h(t.theme),t.icon_set,n)),document.documentElement.setAttribute("data-theme",h(t.theme)),f(t.accent_color??null),y(t.accent_color??null,t.custom_bg_color??null,t.custom_title_color??null,t.custom_window_color??null,t.custom_button_color??null)}function P(){const{prefs:t}=o(),n=r(m,a,l),c=t.theme||"system",u=t.accent_color||null,i=t.custom_bg_color||null,d=t.custom_title_color||null,h=t.custom_window_color||null,p=t.custom_button_color||null,_=t.corners,b="string"==typeof t.icon_set&&t.icon_set?t.icon_set:null,w="system"===c?n?"dark":"light":c,P=M(w,_,!!u);s(()=>(document.documentElement.setAttribute("data-theme",w),()=>document.documentElement.removeAttribute("data-theme")),[w]),s(()=>(g(P),()=>document.documentElement.removeAttribute("data-corners")),[P]);const E=e(w,b,!!u);return s(()=>(v(E),()=>v(null)),[E]),s(()=>{f(u)},[u]),s(()=>{y(u,i,d,h,p)},[u,i,d,h,p]),{theme:c,resolved:w,corners:P,iconSet:b}}export{p as CORNERS,b as CORNERS_FOR_THEME,g as applyCorners,v as applyIconSet,w as applyThemePrefs,M as cornersFor,_ as resolveCorners,h as resolveTheme,P as useTheme};
1
+ import{loadIconSet as t,iconSetFor as e}from"./chunk-VQCKMT5F.js";import{hexToRgb as n}from"./chunk-S6OB6HJB.js";import{useShellPrefs as o}from"./chunk-POBVGDZP.js";import{setIconSet as c}from"./chunk-J75ZT2JQ.js";import{useSyncExternalStore as r,useEffect as s}from"react";function u(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function m(t){const e=u();return e?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):()=>{}}function a(){return u()?.matches??!1}function l(){return!1}function i(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,c=Math.max(e,n,o),r=Math.min(e,n,o);let s=0,u=0;const m=(c+r)/2;if(c!==r){const t=c-r;u=m>.5?t/(2-c-r):t/(c+r),s=c===e?((n-o)/t+(n<o?6:0))/6:c===n?((o-e)/t+2)/6:((e-n)/t+4)/6}return[360*s,100*u,100*m]}function d(t,e,n){n/=100;const o=(e/=100)*Math.min(n,1-n),c=e=>{const c=(e+t/30)%12;return n-o*Math.max(Math.min(c-3,9-c,1),-1)},r=t=>Math.round(255*t).toString(16).padStart(2,"0");return`#${r(c(0))}${r(c(8))}${r(c(4))}`}function h(t){const e=t||"system";return"system"===e?a()?"dark":"light":e}function f(t){const e=document.documentElement;if(t&&/^#[0-9a-fA-F]{6}$/.test(t)){const[n,o,c]=i(t);e.setAttribute("data-custom-accent","true"),e.style.setProperty("--accent-600",t),e.style.setProperty("--accent-700",d(n,o,Math.max(c-10,5))),e.style.setProperty("--accent-500",d(n,o,Math.min(c+10,95))),e.style.setProperty("--accent-400",d(n,o,Math.min(c+20,95))),e.style.setProperty("--accent-300",d(n,Math.min(o+10,100),Math.min(c+30,92))),e.style.setProperty("--accent-200",d(n,Math.min(o+15,100),Math.min(c+38,94))),e.style.setProperty("--accent-100",d(n,Math.min(o+20,100),Math.min(c+42,96))),e.style.setProperty("--accent-50",d(n,Math.min(o+20,100),Math.min(c+46,98)))}else e.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(t=>e.style.removeProperty(t))}function y(t,e,o,c,r){const s=document.documentElement;if(t){const t=(t,e)=>{const o=n(e);o?s.style.setProperty(t,`${o.r} ${o.g} ${o.b}`):s.style.removeProperty(t)};if(e&&s.style.setProperty("--custom-bg-color",e),o&&(t("--window-header-rgb",o),t("--window-footer-rgb",o)),c&&t("--window-content-rgb",c),r){s.style.setProperty("--custom-button-color",r);const[t,e,n]=i(r);s.style.setProperty("--custom-button-hover",d(t,e,Math.max(n-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(t=>s.style.removeProperty(t))}var p=["square","soft","round"];function _(t){return"square"===t||"round"===t?t:"soft"}var b={pink:"round",grey:"square"};function M(t,e,n){return n?"square"===e||"round"===e?e:"soft":b[t]??"soft"}function P(t){const e=_(t);"soft"===e?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",e)}function g(e){const n="string"==typeof e&&e?e:null;c(n),n&&t(n),n?document.documentElement.setAttribute("data-icon-set",n):document.documentElement.removeAttribute("data-icon-set")}function v(t){const n=!!t.accent_color;"corners"in t&&P(M(h(t.theme),t.corners,n)),"icon_set"in t&&g(e(h(t.theme),t.icon_set,n)),document.documentElement.setAttribute("data-theme",h(t.theme)),f(t.accent_color??null),y(t.accent_color??null,t.custom_bg_color??null,t.custom_title_color??null,t.custom_window_color??null,t.custom_button_color??null)}function w(){const{prefs:t}=o(),n=r(m,a,l),c=t.theme||"system",u=t.accent_color||null,i=t.custom_bg_color||null,d=t.custom_title_color||null,h=t.custom_window_color||null,p=t.custom_button_color||null,_=t.corners,b="string"==typeof t.icon_set&&t.icon_set?t.icon_set:null,v="system"===c?n?"dark":"light":c,w=M(v,_,!!u);s(()=>(document.documentElement.setAttribute("data-theme",v),()=>document.documentElement.removeAttribute("data-theme")),[v]),s(()=>(P(w),()=>document.documentElement.removeAttribute("data-corners")),[w]);const E=e(v,b,!!u);return s(()=>(g(E),()=>g(null)),[E]),s(()=>{f(u)},[u]),s(()=>{y(u,i,d,h,p)},[u,i,d,h,p]),{theme:c,resolved:v,corners:w,iconSet:b}}export{p as CORNERS,b as CORNERS_FOR_THEME,P as applyCorners,g as applyIconSet,v as applyThemePrefs,M as cornersFor,_ as resolveCorners,h as resolveTheme,w as useTheme};
@@ -1,29 +1,29 @@
1
- import{Segmented as e}from"./chunk-TNALBYLY.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-NRHG4R2Q.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},j={day:28,week:84,month:182};function U(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return U(e,t,n)+g[n]/2}function R(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:U(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:U(o,e,t),width:(n-o)*g[t]}),o=n}return a}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:U(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:U(a,n,r),width:(o-a+1)*g[r]}}function X(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function Y(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function I(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function z(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function F(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var H=24;function L({rows:a,groups:o=[],dependencies:U=[],scale:L,onScaleChange:A,onRowClick:K,onRowChange:Q,readOnly:W=!1,today:E,isLoading:O=!1,emptyState:Z,labelHeader:B,labelWidth:G=240,className:J=""}){const V=l().gantt,q=d(),_=t(q),ee=!!Q&&!W,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?F(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=j[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,L)},[a,L,ie]),de=m(()=>function(e,t){return"day"===t?{major:R(e,t,D,M),minor:R(e,t,e=>e,e=>e+1)}:"week"===t?{major:R(e,t,D,M),minor:R(e,t,N,e=>N(e)+7)}:{major:R(e,t,C,$),minor:R(e,t,D,M)}}(le,L),[le,L]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,L),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,le,L),line:n})}),e},[ue,se,le,L]),me=m(()=>{const e=[];for(const t of U){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=X(n.shape),o=X(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=Y(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:I(l),head:z(o.inX,s)})}return e},[U,he]),fe=!O&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-G;e.scrollLeft=Math.max(0,P(ie,le,L)-t/4)},[L,fe]);if(O)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:V.loading});if(!fe)/* @__PURE__ */return f(p,{children:Z??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:V.empty})});const pe=(e,t,n)=>{Q?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,L);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=F(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void K?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=F(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:K?.(e)},ve=e=>n(x(e),{locale:q}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===L?String(r):"week"===L?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===L?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,L),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
2
- return b("div",{className:`flex min-h-0 flex-col ${J}`,children:[
1
+ import{Segmented as e}from"./chunk-ALZHFQRX.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-PU2GJVMG.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-NRHG4R2Q.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},U={day:28,week:84,month:182};function j(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return j(e,t,n)+g[n]/2}function R(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}return a}function X(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:j(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:j(a,n,r),width:(o-a+1)*g[r]}}function S(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function I(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function z(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function F(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function H(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var Y=24;function Q({rows:a,groups:o=[],dependencies:j=[],scale:Q,onScaleChange:A,onRowClick:K,onRowChange:L,readOnly:W=!1,today:E,isLoading:G=!1,emptyState:J,labelHeader:O,labelWidth:V=240,className:Z=""}){const q=l().gantt,B=d(),_=t(B),ee=!!L&&!W,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?H(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=U[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,Q)},[a,Q,ie]),de=m(()=>function(e,t){return"day"===t?{major:R(e,t,D,M),minor:R(e,t,e=>e,e=>e+1)}:"week"===t?{major:R(e,t,D,M),minor:R(e,t,N,e=>N(e)+7)}:{major:R(e,t,C,$),minor:R(e,t,D,M)}}(le,Q),[le,Q]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,Q),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:X(r.start,r.end,le,Q),line:n})}),e},[ue,se,le,Q]),me=m(()=>{const e=[];for(const t of j){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=S(n.shape),o=S(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=I(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:z(l),head:F(o.inX,s)})}return e},[j,he]),fe=!G&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollLeft=Math.max(0,P(ie,le,Q)-t/4)},[Q,fe]);if(G)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:q.loading});if(!fe)/* @__PURE__ */return f(p,{children:J??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:q.empty})});const pe=(e,t,n)=>{L?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,Q);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=H(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void K?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=H(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:K?.(e)},ve=e=>n(x(e),{locale:B}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===Q?String(r):"week"===Q?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===Q?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,Q),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
2
+ return b("div",{className:`flex min-h-0 flex-col ${Z}`,children:[
3
3
  /* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
4
- /* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-G;e.scrollTo?.({left:Math.max(0,P(ie,le,L)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:V.today}),A&&/* @__PURE__ */f(e,{size:"sm",label:V.scale,value:L,onChange:A,options:[{value:"day",label:V.day},{value:"week",label:V.week},{value:"month",label:V.month}]})]}),
5
- /* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:G+ce,minHeight:48+Ne},children:[
4
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollTo?.({left:Math.max(0,P(ie,le,Q)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:q.today}),A&&/* @__PURE__ */f(e,{size:"sm",label:q.scale,value:Q,onChange:A,options:[{value:"day",label:q.day},{value:"week",label:q.week},{value:"month",label:q.month}]})]}),
5
+ /* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:V+ce,minHeight:48+Ne},children:[
6
6
  /* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
7
- /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:G},children:B??V.task}),
8
- /* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:H},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:G},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===L?"text-center":"px-1"} ${e.startDay===ie&&"day"===L?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:H,height:H},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==L&&
9
- /* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:H,height:H},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
7
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:V},children:O??q.task}),
8
+ /* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:Y},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:V},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===Q?"text-center":"px-1"} ${e.startDay===ie&&"day"===Q?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:Y,height:Y},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==Q&&
9
+ /* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:Y,height:Y},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
10
10
  /* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),
11
- /* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:V.today}),
11
+ /* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:q.today}),
12
12
  /* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),Te&&/* @__PURE__ */f("span",{className:"invisible min-w-0 shrink overflow-hidden",children:/* @__PURE__ */f("span",{className:"inline-block whitespace-nowrap px-1",children:ke(Ce,"minor")})})]})]})]}),
13
- /* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:G,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===L&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
13
+ /* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:V,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===Q&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
14
14
  /* @__PURE__ */f("div",{role:"list",children:ue.map(e=>{if("group"===e.kind)/* @__PURE__ */
15
15
  return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
16
- /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:G},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
17
- /* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${V.done}`:"";/* @__PURE__ */
16
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:V},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
17
+ /* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${q.done}`:"";/* @__PURE__ */
18
18
  return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
19
- /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:G},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&K?0:-1,onClick:()=>K?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${K?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
19
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:V},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&K?0:-1,onClick:()=>K?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${K?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
20
20
  /* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:ce},children:["bar"===n.kind&&/* @__PURE__ */b(p,{children:[
21
- /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":V.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
21
+ /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":q.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
22
22
  /* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"start")}),
23
23
  /* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"end")})]})}),
24
24
  /* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(p,{children:[
25
- /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":V.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
25
+ /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":q.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
26
26
  /* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
27
- /* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:G,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
27
+ /* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:V,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
28
28
  /* @__PURE__ */f("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
29
- /* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:G+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:V.moveHint})]})})]})}export{L as Gantt};
29
+ /* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:V+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:q.moveHint})]})})]})}export{Q as Gantt};
@@ -1,3 +1,3 @@
1
- import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-UTISUEO4.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
1
+ import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-MEP6CZJ3.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
2
2
  return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
3
3
  /* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
@@ -1 +1 @@
1
- import{useBrowserLayoutEffect as t}from"./chunk-ZDXRSY2Y.js";import{useState as e}from"react";var o=448,i=240,n=8,h=()=>{const t="object"==typeof window.visualViewport?window.visualViewport:null;return t&&t.width>0&&t.height>0?{left:t.offsetLeft,right:t.offsetLeft+t.width,top:t.offsetTop,bottom:t.offsetTop+t.height}:{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}};function r(t){const e=h(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var a=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);function m(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=h(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let n=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==n;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===n&&"static"===t.position)continue;n=t.position;const o=a.has(t.overflowX),h=a.has(t.overflowY);if(!o&&!h)continue;const r=e.getBoundingClientRect();r.width<=0&&r.height<=0||(o&&(i.left=Math.max(i.left,r.left),i.right=Math.min(i.right,r.right)),h&&(i.top=Math.max(i.top,r.top),i.bottom=Math.min(i.bottom,r.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}var l={top:"bottom",bottom:"top",left:"right",right:"left"},f={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function g(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var d=(t,e,o)=>Math.max(e,Math.min(t,o));function s(t,e,o,i,n){const h=g(t,i,n),r=t=>h[t]-("top"===t||"bottom"===t?e.height:e.width),a=[o,l[o],...f[o]],m=a.find(t=>r(t)>=0)??a.reduce((t,e)=>r(e)>r(t)?e:t),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;let u,p;switch(m){case"top":u=s-e.width/2,p=t.top-n-e.height;break;case"bottom":u=s-e.width/2,p=t.bottom+n;break;case"left":u=t.left-n-e.width,p=c-e.height/2;break;case"right":u=t.right+n,p=c-e.height/2}return{side:m,left:d(u,i.left+8,i.right-8-e.width),top:d(p,i.top+8,i.bottom-8-e.height)}}function c(t,e,o,i,n){const{side:h,left:r,top:a}=e,m=r+o.width,l=a+o.height;if({top:t.top-l,bottom:a-t.bottom,left:t.left-m,right:r-t.right}[h]<n)return null;const f=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),g=(t.left+t.right)/2,d=(t.top+t.bottom)/2;switch(h){case"top":return{side:h,x:f(g,r,o.width),y:l};case"bottom":return{side:h,x:f(g,r,o.width),y:a};case"left":return{side:h,x:m,y:f(d,a,o.height)};case"right":return{side:h,x:r,y:f(d,a,o.height)}}}function u(t,e,o){return p(()=>t()?.getBoundingClientRect(),e,o)}function p(t,e,o){let i=NaN,n=NaN,h=NaN,r=NaN,a=NaN;const m=()=>{const e=t();if(!e)return!1;const m=o?o():NaN,l=e.left!==i||e.top!==n||e.right!==h||e.bottom!==r||m!==a&&!(Number.isNaN(m)&&Number.isNaN(a));return i=e.left,n=e.top,h=e.right,r=e.bottom,a=m,l};m();const l=()=>{m(),e()};let f=requestAnimationFrame(function t(){m()&&e(),f=requestAnimationFrame(t)});return window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(f),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}}function b({trigger:t,menu:e,bounds:o,align:i,side:n}){const h=g(t,o,4),r="bottom"===n?"top":"bottom",a=e.height>h[n]&&(e.height<=h[r]||h[r]>h[n])?r:n,m=Math.max(Math.min(e.height,96),h[a]),l=Math.min(e.height,m),f=d("bottom"===a?t.bottom+4:t.top-4-l,o.top+8,o.bottom-8-l),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:d("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:f,side:a,maxHeight:m,maxWidth:s}}function w(n,h,a={}){const{matchTriggerWidth:m=!1,preferredMaxWidth:l=o,preferredMaxHeight:f=i,popupRef:g}=a,[d,s]=e(null);return t(()=>{if(!h)return void s(null);const t=()=>{const t=n.current,e=t?.getBoundingClientRect();if(!e)return;const o=r(t),i=o.bottom-e.bottom-4-8,h=e.top-o.top-4-8,a=i<Math.min(f,160)&&h>i,d=Math.max(96,Math.min(f,a?h:i)),c=Math.max(0,o.right-o.left-16),u={minWidth:e.width,maxWidth:Math.min(l,c),maxHeight:d};if(m){const t=Math.min(e.width,c);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(o.left+8,e.left),o.right-8-t)}else if(g&&o.right-8-e.left<u.maxWidth&&Math.min(e.right,o.right-8)-o.left-8<u.maxWidth){const t=g.current?.offsetWidth??0,i=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(o.left+8,Math.min(e.left,o.right-8-i))}else if(o.right-8-e.left<u.maxWidth){const t=Math.min(e.right,o.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-o.left-8))}else u.left=Math.max(o.left+8,e.left);a?u.bottom=window.innerHeight-e.top+4:u.top=e.bottom+4,s(u)};return t(),u(()=>n.current,t,g?()=>g.current?.offsetWidth??NaN:void 0)},[h,n,m,l,f,g]),d}function x({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},n=o.right-8-t.x,h=t.x-(o.left+8);return b({trigger:i,menu:e,bounds:o,align:e.width<=n||n>=h?"start":"end",side:"bottom"})}export{i as MENU_MAX_HEIGHT,o as POPUP_MAX_WIDTH,n as VIEWPORT_MARGIN,u as followAnchor,p as followRect,c as placeArrow,x as placeAtPoint,s as placeBeside,b as placeMenu,r as popupBounds,m as showingBox,w as useDropdownPosition};
1
+ import{useBrowserLayoutEffect as t}from"./chunk-PU2GJVMG.js";import{useState as e}from"react";var o=448,i=240,n=8,h=()=>{const t="object"==typeof window.visualViewport?window.visualViewport:null;return t&&t.width>0&&t.height>0?{left:t.offsetLeft,right:t.offsetLeft+t.width,top:t.offsetTop,bottom:t.offsetTop+t.height}:{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}};function r(t){const e=h(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var a=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);function m(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=h(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let n=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==n;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===n&&"static"===t.position)continue;n=t.position;const o=a.has(t.overflowX),h=a.has(t.overflowY);if(!o&&!h)continue;const r=e.getBoundingClientRect();r.width<=0&&r.height<=0||(o&&(i.left=Math.max(i.left,r.left),i.right=Math.min(i.right,r.right)),h&&(i.top=Math.max(i.top,r.top),i.bottom=Math.min(i.bottom,r.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}var l={top:"bottom",bottom:"top",left:"right",right:"left"},f={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function g(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var d=(t,e,o)=>Math.max(e,Math.min(t,o));function s(t,e,o,i,n){const h=g(t,i,n),r=t=>h[t]-("top"===t||"bottom"===t?e.height:e.width),a=[o,l[o],...f[o]],m=a.find(t=>r(t)>=0)??a.reduce((t,e)=>r(e)>r(t)?e:t),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;let u,p;switch(m){case"top":u=s-e.width/2,p=t.top-n-e.height;break;case"bottom":u=s-e.width/2,p=t.bottom+n;break;case"left":u=t.left-n-e.width,p=c-e.height/2;break;case"right":u=t.right+n,p=c-e.height/2}return{side:m,left:d(u,i.left+8,i.right-8-e.width),top:d(p,i.top+8,i.bottom-8-e.height)}}function c(t,e,o,i,n){const{side:h,left:r,top:a}=e,m=r+o.width,l=a+o.height;if({top:t.top-l,bottom:a-t.bottom,left:t.left-m,right:r-t.right}[h]<n)return null;const f=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),g=(t.left+t.right)/2,d=(t.top+t.bottom)/2;switch(h){case"top":return{side:h,x:f(g,r,o.width),y:l};case"bottom":return{side:h,x:f(g,r,o.width),y:a};case"left":return{side:h,x:m,y:f(d,a,o.height)};case"right":return{side:h,x:r,y:f(d,a,o.height)}}}function u(t,e,o){return p(()=>t()?.getBoundingClientRect(),e,o)}function p(t,e,o){let i=NaN,n=NaN,h=NaN,r=NaN,a=NaN;const m=()=>{const e=t();if(!e)return!1;const m=o?o():NaN,l=e.left!==i||e.top!==n||e.right!==h||e.bottom!==r||m!==a&&!(Number.isNaN(m)&&Number.isNaN(a));return i=e.left,n=e.top,h=e.right,r=e.bottom,a=m,l};m();const l=()=>{m(),e()};let f=requestAnimationFrame(function t(){m()&&e(),f=requestAnimationFrame(t)});return window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(f),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}}function b({trigger:t,menu:e,bounds:o,align:i,side:n}){const h=g(t,o,4),r="bottom"===n?"top":"bottom",a=e.height>h[n]&&(e.height<=h[r]||h[r]>h[n])?r:n,m=Math.max(Math.min(e.height,96),h[a]),l=Math.min(e.height,m),f=d("bottom"===a?t.bottom+4:t.top-4-l,o.top+8,o.bottom-8-l),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:d("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:f,side:a,maxHeight:m,maxWidth:s}}function w(n,h,a={}){const{matchTriggerWidth:m=!1,preferredMaxWidth:l=o,preferredMaxHeight:f=i,popupRef:g}=a,[d,s]=e(null);return t(()=>{if(!h)return void s(null);const t=()=>{const t=n.current,e=t?.getBoundingClientRect();if(!e)return;const o=r(t),i=o.bottom-e.bottom-4-8,h=e.top-o.top-4-8,a=i<Math.min(f,160)&&h>i,d=Math.max(96,Math.min(f,a?h:i)),c=Math.max(0,o.right-o.left-16),u={minWidth:e.width,maxWidth:Math.min(l,c),maxHeight:d};if(m){const t=Math.min(e.width,c);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(o.left+8,e.left),o.right-8-t)}else if(g&&o.right-8-e.left<u.maxWidth&&Math.min(e.right,o.right-8)-o.left-8<u.maxWidth){const t=g.current?.offsetWidth??0,i=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(o.left+8,Math.min(e.left,o.right-8-i))}else if(o.right-8-e.left<u.maxWidth){const t=Math.min(e.right,o.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-o.left-8))}else u.left=Math.max(o.left+8,e.left);a?u.bottom=window.innerHeight-e.top+4:u.top=e.bottom+4,s(u)};return t(),u(()=>n.current,t,g?()=>g.current?.offsetWidth??NaN:void 0)},[h,n,m,l,f,g]),d}function x({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},n=o.right-8-t.x,h=t.x-(o.left+8);return b({trigger:i,menu:e,bounds:o,align:e.width<=n||n>=h?"start":"end",side:"bottom"})}export{i as MENU_MAX_HEIGHT,o as POPUP_MAX_WIDTH,n as VIEWPORT_MARGIN,u as followAnchor,p as followRect,c as placeArrow,x as placeAtPoint,s as placeBeside,b as placeMenu,r as popupBounds,m as showingBox,w as useDropdownPosition};
@@ -1,2 +1,2 @@
1
- import{useHydrated as e}from"./chunk-WCCS4VFE.js";import{jsx as t}from"react/jsx-runtime";var r="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),n={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},i=r?0:1,o=n.MOD[i],a=n.ALT[i],l="⇧",_="⏎",d=n.CMD_ENTER[i],f=n.CMD_S[i],m=n.CMD_K[i],s=n.CMD_DOT[i],u=n.CMD_A[i],C=n.CMD_Z[i],D=n.CMD_SHIFT_Z[i],T=n.ALT_SHIFT_D[i],c=n.ALT_SHIFT_E[i],M=n.ALT_SHIFT_N[i],A=new Map(r?Object.values(n).map(([e,t])=>[e,t]):[]);function S(t){return e()?t:A.get(t)??t}var b={neutral:"inline-flex items-center justify-center rounded border border-line bg-surface-sunken font-medium text-ink-faint",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},p={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function x({keys:e,size:r="md",tone:n="neutral",className:i=""}){const o=S(e);/* @__PURE__ */
1
+ import{useHydrated as e}from"./chunk-KEFNQEXZ.js";import{jsx as t}from"react/jsx-runtime";var r="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),n={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},i=r?0:1,o=n.MOD[i],a=n.ALT[i],l="⇧",_="⏎",d=n.CMD_ENTER[i],f=n.CMD_S[i],m=n.CMD_K[i],s=n.CMD_DOT[i],u=n.CMD_A[i],C=n.CMD_Z[i],D=n.CMD_SHIFT_Z[i],T=n.ALT_SHIFT_D[i],c=n.ALT_SHIFT_E[i],M=n.ALT_SHIFT_N[i],A=new Map(r?Object.values(n).map(([e,t])=>[e,t]):[]);function S(t){return e()?t:A.get(t)??t}var b={neutral:"inline-flex items-center justify-center rounded border border-line bg-surface-sunken font-medium text-ink-faint",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},p={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function x({keys:e,size:r="md",tone:n="neutral",className:i=""}){const o=S(e);/* @__PURE__ */
2
2
  return t("kbd",{className:[b[n],p[r],i].filter(Boolean).join(" "),children:o})}export{a as ALT,T as ALT_SHIFT_D,c as ALT_SHIFT_E,M as ALT_SHIFT_N,u as CMD_A,s as CMD_DOT,d as CMD_ENTER,m as CMD_K,f as CMD_S,D as CMD_SHIFT_Z,C as CMD_Z,_ as ENTER,x as Kbd,o as MOD,l as SHIFT,r as isMac,S as useShortcutLabel};
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-I52YJ3QD.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Y=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function X(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Y.exec(n.trim()),i=e&&X(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(D,"[url]").replace(V,"[id]").replace(W,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-UZESZ3EB.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],U=e=>{document.prerendering?C(()=>U(e)):"complete"!==document.readyState?addEventListener("load",()=>U(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);U(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -1,3 +1,3 @@
1
- import{ColoredBadge as e}from"./chunk-UVPDEGIA.js";import{Button_default as n}from"./chunk-UTISUEO4.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.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:[
1
+ import{ColoredBadge as e}from"./chunk-6X32SWQI.js";import{Button_default as n}from"./chunk-MEP6CZJ3.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.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{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-D5PXRJHA.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-B5KX7PDG.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-YDJ5IZOU.js";import{Button_default as l}from"./chunk-UTISUEO4.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-TD3ZQD5R.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-EBODRYXS.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-W6REY3SV.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-EDRELF6L.js";import{Button_default as l}from"./chunk-MEP6CZJ3.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-G3TC2GIA.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
@@ -0,0 +1 @@
1
+ var r="14.0.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -0,0 +1,4 @@
1
+ import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-DWGYC7OD.js";import{DESCRIPTION_TEXT as n}from"./chunk-BWJZTHZ6.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{popupBounds as a,VIEWPORT_MARGIN as c,placeMenu as s,followAnchor as l}from"./chunk-TAHHZGRH.js";import{useHydrated as u}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as d}from"./chunk-PU2GJVMG.js";import{buttonClasses as m}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as p}from"./chunk-TWVUQUUD.js";import{useState as f,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as y}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/;function N({trigger:N,children:C,title:E,description:j,"aria-label":D,align:H="start",side:T="bottom",open:O,defaultOpen:$=!1,onOpenChange:P,matchTriggerWidth:W=!1,maxHeight:L,initialFocus:M,id:G,triggerLabel:K,"aria-describedby":S,disabled:U,className:z="",triggerClassName:F,panelClassName:R=""}){const[Y,Z]=f($),B=(O??Y)&&!U,J=u(),Q=h(null),I=h(null),V=h(null),A=h(null),X=g(),q=G??X,_=g(),ee=g(),te=g(),re=h(null),ne=h(!1),ie=h({openProp:O,onOpenChange:P});ie.current={openProp:O,onOpenChange:P};const oe=v(e=>{void 0===ie.current.openProp&&Z(e),ie.current.onOpenChange?.(e)},[]),ae=v((e=!1)=>{ne.current=e,oe(!1)},[oe]),ce=e=>{re.current=e.nativeEvent},se=v(()=>{const e=V.current,t=I.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),i=Math.max(0,n.right-n.left-2*c),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${i}px`,o.maxHeight="none",o.width=W?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=L??1/0,d=s({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:H,side:T}),m=Math.min(d.maxHeight,u);o.left=`${d.left}px`,o.top=`${d.top}px`,o.maxHeight=`${m}px`,o.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=H},[H,T,W,L]);d(()=>{B&&J&&se()}),b(()=>{if(!B||!J)return;const e=l(()=>I.current,se),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>se());return r.observe(t),()=>{e(),r.disconnect()}},[B,J,se]),b(()=>{if(!B)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(re.current===e)return!1;const t=e.target;return!(t&&(Q.current?.contains(t)||V.current?.contains(t)))})(e)&&ae(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),n=i(()=>ae()),o=p(e=>"Escape"===e.key&&(ae(),I.current?.focus(),!0),()=>V.current);return()=>{t(),r(),n(),o()}},[B,ae]),e(V,B&&J),d(()=>{if(!B||!J)return;const e=V.current;return()=>{if(ne.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||I.current?.focus({preventScroll:!0})}},[B,J]),b(()=>{if(!B||!J)return;const e=V.current;e&&(ne.current=!1,(M?.current??t(e)[0]??e).focus({preventScroll:!0}))},[B,J]);const le="function"==typeof C?C({close:()=>ae()}):C,ue=E?{"aria-labelledby":ee}:D?{"aria-label":D}:{"aria-labelledby":q};/* @__PURE__ */
2
+ return x("div",{ref:Q,className:`relative inline-flex ${z}`.trim(),children:[
3
+ /* @__PURE__ */y("button",{ref:I,id:q,type:"button","aria-haspopup":"dialog","aria-expanded":B,"aria-controls":B&&J?_:void 0,"aria-label":K,"aria-describedby":S,disabled:U,onClick:()=>B?ae():oe(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!B)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:F??m({variant:"secondary"}),children:N}),B&&J&&w(
4
+ /* @__PURE__ */y("div",{ref:V,id:_,role:"dialog",...ue,"aria-describedby":j?te:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ce,onFocusCapture:ce,onKeyDown:e=>{const n=V.current,i=I.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);ae(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${R}`.trim(),style:k.test(R)?void 0:{zIndex:o.popup},children:/* @__PURE__ */x("div",{ref:A,children:[E&&/* @__PURE__ */y("h2",{id:ee,className:"text-sm font-semibold text-gray-900",children:E}),j&&/* @__PURE__ */y("p",{id:te,className:`mt-1 ${n}`,children:j}),E||j?/* @__PURE__ */y("div",{className:"mt-3",children:le}):le]})}),document.body)]})}export{N as Popover};
@@ -1,23 +1,23 @@
1
- import{Calendar as e}from"./chunk-RFWBNKKB.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-B5KX7PDG.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as x}from"./chunk-ZDXRSY2Y.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as w}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as j,useEffect as D}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],R=d;function S(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function H(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function O(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var B=/* @__PURE__ */new Map;function A({from:d,to:u,onChange:h,formatDisplay:R,clearable:A,required:G=!1,name:I,id:K,"aria-labelledby":L,"aria-label":P,weekStartsOn:T,placeholder:V,fullWidth:E=!1,min:U,max:q,disabled:Q=!1,allowOpenEnd:X=!1}){const Z=N().dateRange,J=w(),z=R??(J?function(e){let t=B.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),B.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(J):O),_=V??Z.placeholder,ee=A??!G,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=j(),fe=j(),ge=j(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),Ne=C(null),[we,ke]=k(!0);x(()=>{const e=Ne.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==we&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[je,De]=k(!1);x(()=>{const e=!!K&&(ue.current?.labels?.length??0)>0;e!==je&&De(e)});const Me=!!P||!!L||je,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):H(We,U,q)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),U,q)),Re=e=>e?z(e):"";D(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),D(()=>{Q&&re(!1)},[Q]);const Se=()=>{h("",""),re(!1)},He=ee&&!Q&&Boolean(d||u),Oe=d&&u?`${Re(d)} — ${Re(u)}`:d?Z.fromOnly(Re(d)):u?Z.toOnly(Re(u)):"",Be=c(J),Ae=e=>{const t=m(e);return t?Be.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ge=d&&u?Z.range(Ae(d),Ae(u)):d?Z.fromOnly(Ae(d)):u?Z.toOnly(Ae(u)):_,Ie=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ke=/* @__PURE__ */W($,{children:[Fe.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Ie(e),"aria-label":be?Z[e]:void 0,children:be?we?Z[e]:Z[`${e}Short`]:Z[e]},e)),
2
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Ie("Custom"),children:Z.custom})]}),Le=(e,t)=>X?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Pe=e=>X&&ce===e?" ring-1 ring-blue-400":"",Te=
3
- /* @__PURE__ */Y(e,{mode:"range",min:U,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),X?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:T,"aria-label":Z.dialog});/* @__PURE__ */
4
- return W("div",{className:"relative"+(E?" w-full":""),ref:me,children:[
5
- /* @__PURE__ */W("div",{className:`relative ${E?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${He?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${Q?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{Q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):H(We,U,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:K,disabled:Q||void 0,"aria-label":P,"aria-labelledby":L,"aria-describedby":[Me?fe:void 0,G?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(E?" min-w-0 flex-1 justify-start":""),children:[
1
+ import{Calendar as e}from"./chunk-PPHGBEJA.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-W6REY3SV.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as x}from"./chunk-PU2GJVMG.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as w,useShellLocale as N}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as M,useEffect as j}from"react";import{createPortal as D}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var H=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],F=d;function R(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function S(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function G(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function P({from:d,to:u,onChange:h,formatDisplay:F,clearable:P,required:E=!1,name:T,id:V,"aria-labelledby":A,"aria-label":I,weekStartsOn:L,placeholder:B,fullWidth:J=!1,min:U,max:q,disabled:Q=!1,allowOpenEnd:Z=!1}){const K=w().dateRange,z=N(),X=F??(z?function(e){let t=O.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),O.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(z):G),_=B??K.placeholder,ee=P??!E,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=M(),fe=M(),ge=M(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),we=C(null),[Ne,ke]=k(!0);x(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[Me,je]=k(!1);x(()=>{const e=!!V&&(ue.current?.labels?.length??0)>0;e!==Me&&je(e)});const De=!!I||!!A||Me,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):S(We,U,q)),He=H.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(R(e,We),U,q)),Fe=e=>e?X(e):"";j(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),j(()=>{Q&&re(!1)},[Q]);const Re=()=>{h("",""),re(!1)},Se=ee&&!Q&&Boolean(d||u),Ge=d&&u?`${Fe(d)} — ${Fe(u)}`:d?K.fromOnly(Fe(d)):u?K.toOnly(Fe(u)):"",Oe=c(z),Pe=e=>{const t=m(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ee=d&&u?K.range(Pe(d),Pe(u)):d?K.fromOnly(Pe(d)):u?K.toOnly(Pe(u)):_,Te=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ve=/* @__PURE__ */W($,{children:[He.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=R(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Te(e),"aria-label":be?K[e]:void 0,children:be?Ne?K[e]:K[`${e}Short`]:K[e]},e)),
2
+ /* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Te("Custom"),children:K.custom})]}),Ae=(e,t)=>Z?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ie=e=>Z&&ce===e?" ring-1 ring-blue-400":"",Le=
3
+ /* @__PURE__ */Y(e,{mode:"range",min:U,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),Z?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:L,"aria-label":K.dialog});/* @__PURE__ */
4
+ return W("div",{className:"relative"+(J?" w-full":""),ref:me,children:[
5
+ /* @__PURE__ */W("div",{className:`relative ${J?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${Q?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{Q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):S(We,U,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:V,disabled:Q||void 0,"aria-label":I,"aria-labelledby":A,"aria-describedby":[De?fe:void 0,E?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(J?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */Y(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */Y("span",{className:"truncate",children:Oe||_})]}),He&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:Z.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Se}})})]}),Me&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ge}),G&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:Z.required}),I&&/* @__PURE__ */W($,{children:[
9
- /* @__PURE__ */Y("input",{type:"hidden",name:I.from,value:d,disabled:Q||void 0}),
10
- /* @__PURE__ */Y("input",{type:"hidden",name:I.to,value:u,disabled:Q||void 0})]}),te&&M(
11
- /* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":Z.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
12
- /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Le("from",/* @__PURE__ */W($,{children:[
13
- /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.from}),
14
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("from")}`,children:ne?Re(ne):Z.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Le("to",/* @__PURE__ */W($,{children:[
15
- /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.to}),
16
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("to")}`,children:oe?Re(oe):Z.end})]}))]}),be?/* @__PURE__ */W($,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!we&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
17
- /* @__PURE__ */W("div",{ref:Ne,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ke,Fe.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
18
- /* @__PURE__ */Y("div",{className:"w-full",children:Te})]}):
8
+ /* @__PURE__ */Y("span",{className:"truncate",children:Ge||_})]}),Se&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:K.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Re}})})]}),De&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ee}),E&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:K.required}),T&&/* @__PURE__ */W($,{children:[
9
+ /* @__PURE__ */Y("input",{type:"hidden",name:T.from,value:d,disabled:Q||void 0}),
10
+ /* @__PURE__ */Y("input",{type:"hidden",name:T.to,value:u,disabled:Q||void 0})]}),te&&D(
11
+ /* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":K.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
12
+ /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ae("from",/* @__PURE__ */W($,{children:[
13
+ /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
14
+ /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("from")}`,children:ne?Fe(ne):K.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Ae("to",/* @__PURE__ */W($,{children:[
15
+ /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
16
+ /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("to")}`,children:oe?Fe(oe):K.end})]}))]}),be?/* @__PURE__ */W($,{children:[He.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
17
+ /* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ve,He.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
18
+ /* @__PURE__ */Y("div",{className:"w-full",children:Le})]}):
19
19
  /* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */Y("div",{className:"w-64",children:Te}),Fe.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ke})]}),
21
- /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:Se,className:v({variant:"ghost"}),children:Z.clear}),
22
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:Z.cancel}),
23
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:X?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{A as DateRangePicker,S as presetRange,R as toISODate};
20
+ /* @__PURE__ */Y("div",{className:"w-64",children:Le}),He.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ve})]}),
21
+ /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:Re,className:v({variant:"ghost"}),children:K.clear}),
22
+ /* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:K.cancel}),
23
+ /* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:Z?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{P as DateRangePicker,R as presetRange,F as toISODate};
@@ -1,5 +1,5 @@
1
- import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-EX3DARI3.js";import{IconButton_default as t}from"./chunk-NWS5G7FE.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
1
+ import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-M5IZ7QLQ.js";import{IconButton_default as t}from"./chunk-MYH5H43C.js";import{Tooltip as i}from"./chunk-AJPQJ7TC.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
2
2
  return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
3
3
  return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:e,size:r}){const{label:s,icon:l,onClick:c,menu:m}=e;/* @__PURE__ */
4
- return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(n,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(t,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",N=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),v=
5
- /* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[N,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${r}`,children:t}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):v});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
4
+ return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(n,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(t,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",v=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),N=
5
+ /* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[v,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${r}`,children:t}),N,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):N});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
@@ -1 +1 @@
1
- import{TYPE_SCALE as t,FONT_WEIGHTS as o}from"./chunk-LH7IKIGE.js";import{textWidth as n}from"./chunk-UVCMV2TL.js";import{SPACING_ROLES as e,SPACING_SCALE as m}from"./chunk-AW7TOB6N.js";import{statusLabel as r}from"./chunk-YDJ5IZOU.js";var c=e.controlX,u=m[4],i=t[2],d=o.control,f=.625*i,h=m[1];function p(t){const o="undefined"!=typeof document&&document.body?getComputedStyle(document.body).fontFamily:"";return o?n(t,`${d} ${i}px ${o}`)??t.length*f:t.length*f}function a(t){const o=Object.entries(t).map(([t,o])=>!0===o?r(t):o),n=Math.max(0,...o.map(p)),e=Math.ceil((n+2*c+2*u)/h)*h;return{defaultWidth:e,minWidth:e}}export{c as BADGE_X,u as CELL_X,a as statusColumn};
1
+ import{TYPE_SCALE as t,FONT_WEIGHTS as o}from"./chunk-LH7IKIGE.js";import{textWidth as n}from"./chunk-UVCMV2TL.js";import{SPACING_ROLES as e,SPACING_SCALE as m}from"./chunk-AW7TOB6N.js";import{statusLabel as r}from"./chunk-EDRELF6L.js";var c=e.controlX,u=m[4],i=t[2],d=o.control,f=.625*i,h=m[1];function p(t){const o="undefined"!=typeof document&&document.body?getComputedStyle(document.body).fontFamily:"";return o?n(t,`${d} ${i}px ${o}`)??t.length*f:t.length*f}function a(t){const o=Object.entries(t).map(([t,o])=>!0===o?r(t):o),n=Math.max(0,...o.map(p)),e=Math.ceil((n+2*c+2*u)/h)*h;return{defaultWidth:e,minWidth:e}}export{c as BADGE_X,u as CELL_X,a as statusColumn};