efficient-shell 8.35.1 → 8.39.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 (193) hide show
  1. package/README.md +13 -2
  2. package/dist/{Browser-F67PEY2U.js → Browser-BIGK2F75.js} +14 -14
  3. package/dist/Calculator-7O7HXEKH.js +29 -0
  4. package/dist/{CurrencyConverter-Z6L7QAZU.js → CurrencyConverter-IVJJCYZ7.js} +12 -12
  5. package/dist/{Documents-MQDSI27F.js → Documents-UHTD6M24.js} +22 -22
  6. package/dist/Files-PWYUTAQW.js +87 -0
  7. package/dist/{Notepad-2IRVJ7MB.js → Notepad-54N54RYN.js} +11 -11
  8. package/dist/PdfViewer-KJCJ6EPG.js +1 -0
  9. package/dist/{PomodoroTimer-TRGMI4YT.js → PomodoroTimer-ZCJBTFV5.js} +19 -19
  10. package/dist/{Preview-PXOEKXSR.js → Preview-3LOY6L4G.js} +33 -33
  11. package/dist/Sidebar-6I4FC5AK.js +43 -0
  12. package/dist/{Spreadsheet-WROI4P6D.js → Spreadsheet-ANBJSAHB.js} +12 -12
  13. package/dist/{Stock-SUDCDSUL.js → Stock-PHY6Z26A.js} +1 -1
  14. package/dist/{Weather-WQE4ZQAL.js → Weather-YQA5CAFQ.js} +19 -19
  15. package/dist/{WorldClock-2AGEYLZP.js → WorldClock-J6L7FWI2.js} +6 -6
  16. package/dist/ai/index.d.ts +118 -3
  17. package/dist/ai/index.js +53 -43
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/{chunk-ZRHQGFO5.js → chunk-3CST4ZDP.js} +2 -2
  23. package/dist/chunk-454DAGYG.js +19 -0
  24. package/dist/{chunk-TRD22FC7.js → chunk-45S6M77O.js} +6 -6
  25. package/dist/chunk-4IVT244O.js +8 -0
  26. package/dist/{chunk-G2MJTE6X.js → chunk-4OFD6ICH.js} +10 -10
  27. package/dist/{chunk-5N5DBTTF.js → chunk-4SZDP3JF.js} +12 -12
  28. package/dist/{chunk-FMKTVZAO.js → chunk-4Y4PWKMM.js} +1 -1
  29. package/dist/{chunk-DIN3EFOM.js → chunk-5BZMSSOV.js} +8 -8
  30. package/dist/chunk-5JYBYMZT.js +29 -0
  31. package/dist/{chunk-64ZHCEZN.js → chunk-5TFTSYOD.js} +1 -1
  32. package/dist/{chunk-GK3QH63P.js → chunk-63EK6S3W.js} +1 -1
  33. package/dist/{chunk-ECCUEG3J.js → chunk-6BCFVOG7.js} +1 -1
  34. package/dist/{chunk-M2KV4WKR.js → chunk-6GWZ5UPX.js} +1 -1
  35. package/dist/{chunk-EBC4XFL2.js → chunk-6SMQNPWS.js} +1 -1
  36. package/dist/{chunk-EW6FRPFJ.js → chunk-6WWAQC5V.js} +1 -1
  37. package/dist/{chunk-TTY62G5D.js → chunk-7C56GLLI.js} +16 -16
  38. package/dist/{chunk-MICWRC72.js → chunk-7MSFHQAY.js} +7 -7
  39. package/dist/{chunk-XZL3HCWH.js → chunk-7OCNF4AI.js} +1 -1
  40. package/dist/chunk-AAW27HJY.js +3 -0
  41. package/dist/{chunk-WME5DFB6.js → chunk-BIJ7ADTZ.js} +1 -1
  42. package/dist/{chunk-SEXLHFMR.js → chunk-BMPBVI7P.js} +1 -1
  43. package/dist/{chunk-TOVHLONK.js → chunk-BT3XDH3L.js} +4 -4
  44. package/dist/{chunk-JVIOAZHW.js → chunk-BUGAWNOC.js} +4 -4
  45. package/dist/{chunk-R4C3GGCS.js → chunk-BVW5U7QQ.js} +3 -3
  46. package/dist/{chunk-AF7R2MV4.js → chunk-CKZ6ZDU5.js} +1 -1
  47. package/dist/{chunk-IHEEJO5S.js → chunk-CPK7JTN3.js} +1 -1
  48. package/dist/{chunk-EVB35JP5.js → chunk-DOCUM3K7.js} +1 -1
  49. package/dist/{chunk-FKZEGBLK.js → chunk-DXTKNHWG.js} +11 -11
  50. package/dist/chunk-EEHK4IIK.js +14 -0
  51. package/dist/chunk-EGDJEY4K.js +27 -0
  52. package/dist/{chunk-G2V2ADJQ.js → chunk-EIWTOEWV.js} +2 -2
  53. package/dist/{chunk-2U2GJCSP.js → chunk-EL2RLUT6.js} +7 -7
  54. package/dist/{chunk-4GVH4ZUH.js → chunk-ET2EF5CI.js} +1 -1
  55. package/dist/{chunk-MC43PRTL.js → chunk-EXWGPXOS.js} +1 -1
  56. package/dist/{chunk-2SHYR3RA.js → chunk-FSPFV4MI.js} +9 -4
  57. package/dist/{chunk-YBB56N6X.js → chunk-G63BCOQ6.js} +1 -1
  58. package/dist/{chunk-3RPIPYLU.js → chunk-GCGKPDPN.js} +1 -1
  59. package/dist/chunk-GNPTNAZH.js +4 -0
  60. package/dist/{chunk-DG2WU3BU.js → chunk-GSBIJLTD.js} +2 -2
  61. package/dist/{chunk-ZXSMSVLU.js → chunk-I7HDD4IM.js} +1 -1
  62. package/dist/{chunk-JE6TBZGY.js → chunk-J47HXHSL.js} +7 -7
  63. package/dist/{chunk-RB2F65YJ.js → chunk-JPRJQ6B7.js} +11 -11
  64. package/dist/{chunk-PAB2ZU4F.js → chunk-KJY57QPT.js} +49 -49
  65. package/dist/{chunk-M2LLVSBR.js → chunk-KWX6NAOR.js} +1 -1
  66. package/dist/{chunk-OFKWTOXK.js → chunk-L7FDYGGF.js} +3 -3
  67. package/dist/{chunk-6ANFVX4M.js → chunk-L7IKTEOC.js} +11 -11
  68. package/dist/{chunk-EZY4CO4A.js → chunk-LGAN7DNC.js} +5 -5
  69. package/dist/{chunk-PCKYNZ5Y.js → chunk-LGLZTJ2W.js} +6 -6
  70. package/dist/{chunk-7ACSSYEZ.js → chunk-MEJK6PBN.js} +1 -1
  71. package/dist/{chunk-IUCIYWTT.js → chunk-NDO24PK6.js} +8 -8
  72. package/dist/{chunk-XDDTFV32.js → chunk-NESJOC3R.js} +1 -1
  73. package/dist/{chunk-BYCOB6WT.js → chunk-NGBT7AHL.js} +6 -6
  74. package/dist/chunk-PCQPV6MS.js +6 -0
  75. package/dist/{chunk-CCPNMYCK.js → chunk-Q23EHOXW.js} +1 -1
  76. package/dist/{chunk-ACW3J77L.js → chunk-Q7HN6T3H.js} +1 -1
  77. package/dist/{chunk-XNJMLHGK.js → chunk-QDLGU62M.js} +1 -1
  78. package/dist/{chunk-NUSSZJF2.js → chunk-REVC6YPT.js} +5 -5
  79. package/dist/{chunk-EM6BEHAD.js → chunk-RWGSMZGS.js} +1 -1
  80. package/dist/{chunk-4MO375G3.js → chunk-S2OIRC5H.js} +3 -3
  81. package/dist/{chunk-FTKKGGOQ.js → chunk-SR4XAYLC.js} +1 -1
  82. package/dist/{chunk-RPJ2GC3K.js → chunk-SRKSGUGT.js} +20 -20
  83. package/dist/{chunk-2F7ZOMKK.js → chunk-SZIENHKR.js} +1 -1
  84. package/dist/{chunk-UZ3CZQA4.js → chunk-TGLHJS3M.js} +1 -1
  85. package/dist/{chunk-O2YAB6WK.js → chunk-TIQKDAON.js} +6 -6
  86. package/dist/{chunk-TANR67XF.js → chunk-TVJRENCQ.js} +9 -9
  87. package/dist/{chunk-RJZYORCR.js → chunk-U4BMS5EV.js} +1 -1
  88. package/dist/chunk-UJOWORTR.js +1 -0
  89. package/dist/{chunk-MY755PTJ.js → chunk-UZMZ2EDW.js} +1 -1
  90. package/dist/{chunk-S4J4B7LY.js → chunk-WCKZHEFC.js} +5 -5
  91. package/dist/{chunk-AZU7YOES.js → chunk-WRORJNS5.js} +8 -8
  92. package/dist/{chunk-XB2YPUKR.js → chunk-XLD53X4P.js} +8 -8
  93. package/dist/{chunk-4HCRZHIX.js → chunk-XSPDPN5O.js} +1 -1
  94. package/dist/{chunk-TZHWF3P5.js → chunk-Y6IQYQYN.js} +2 -2
  95. package/dist/chunk-YALPQIBR.js +7 -0
  96. package/dist/{chunk-HAIMJAI4.js → chunk-ZCHBOAPA.js} +2 -2
  97. package/dist/{chunk-M2AIC7IK.js → chunk-ZEKM6HAA.js} +2 -2
  98. package/dist/{chunk-5YELPBUT.js → chunk-ZK2SULCA.js} +1 -1
  99. package/dist/{chunk-BHMUOWAE.js → chunk-ZSFUNXRD.js} +4 -4
  100. package/dist/{chunk-JDKRQG7X.js → chunk-ZWAVSUWT.js} +2 -2
  101. package/dist/data/ListLoadError.js +1 -1
  102. package/dist/format/index.js +1 -1
  103. package/dist/forms/BorderInput.js +1 -1
  104. package/dist/forms/BrandAssetEditor.js +1 -1
  105. package/dist/forms/Calendar.js +1 -1
  106. package/dist/forms/ColorPicker.js +1 -1
  107. package/dist/forms/ComposerAttachments.js +1 -1
  108. package/dist/forms/CornersInput.js +1 -1
  109. package/dist/forms/DatePicker.js +1 -1
  110. package/dist/forms/DateRangePicker.js +1 -1
  111. package/dist/forms/DisplayChips.js +1 -1
  112. package/dist/forms/FilePicker.js +1 -1
  113. package/dist/forms/IconPicker.js +1 -1
  114. package/dist/forms/InputNumber.js +1 -1
  115. package/dist/forms/LinkPicker.js +1 -1
  116. package/dist/forms/MediaLibrary.d.ts +31 -1
  117. package/dist/forms/MediaLibrary.js +1 -1
  118. package/dist/forms/MediaUploadField.js +1 -1
  119. package/dist/forms/MediaUploadGrid.d.ts +7 -1
  120. package/dist/forms/MediaUploadGrid.js +1 -1
  121. package/dist/forms/MediaUsedInList.js +1 -1
  122. package/dist/forms/PositionInput.js +1 -1
  123. package/dist/forms/Select.js +1 -1
  124. package/dist/forms/SidesInput.js +1 -1
  125. package/dist/forms/Slider.js +1 -1
  126. package/dist/forms/Snippet.js +1 -1
  127. package/dist/forms/SplitButton.js +1 -1
  128. package/dist/forms/TagInput.js +1 -1
  129. package/dist/forms/TextToolbar.js +1 -1
  130. package/dist/forms/WidthsBar.js +1 -1
  131. package/dist/forms/mediaLibraryMenu.js +1 -1
  132. package/dist/forms/textAlign.js +1 -1
  133. package/dist/icons/index.js +1 -1
  134. package/dist/index.d.ts +1 -1
  135. package/dist/index.js +162 -162
  136. package/dist/map/index.js +3 -3
  137. package/dist/markdown/index.js +1 -1
  138. package/dist/page-tabs/index.js +5 -5
  139. package/dist/pdf/index.js +1 -1
  140. package/dist/shell/Accordion.js +1 -1
  141. package/dist/shell/AppUpdateBanner.js +1 -1
  142. package/dist/shell/Banner.js +1 -1
  143. package/dist/shell/Breadcrumbs.js +1 -1
  144. package/dist/shell/ColoredBadge.js +1 -1
  145. package/dist/shell/ConfirmDialog.js +1 -1
  146. package/dist/shell/ContextMenu.js +1 -1
  147. package/dist/shell/Dialog.d.ts +13 -3
  148. package/dist/shell/Dialog.js +1 -1
  149. package/dist/shell/Drawer.js +1 -1
  150. package/dist/shell/DropdownMenu.js +1 -1
  151. package/dist/shell/EmptyState.js +1 -1
  152. package/dist/shell/HelpCenter.js +1 -1
  153. package/dist/shell/ImageLightbox.js +1 -1
  154. package/dist/shell/LanguageSelect.js +1 -1
  155. package/dist/shell/Markdown.js +1 -1
  156. package/dist/shell/PageHeader.js +1 -1
  157. package/dist/shell/PopupMenu.js +1 -1
  158. package/dist/shell/ProductionTimeline.js +1 -1
  159. package/dist/shell/Result.js +1 -1
  160. package/dist/shell/SearchableSelect.js +1 -1
  161. package/dist/shell/SettingReset.js +1 -1
  162. package/dist/shell/SettingRow.js +1 -1
  163. package/dist/shell/SidebarLayout.js +1 -1
  164. package/dist/shell/SidebarNav.js +1 -1
  165. package/dist/shell/SortableList.js +1 -1
  166. package/dist/shell/StepChain.js +1 -1
  167. package/dist/shell/Stepper.js +1 -1
  168. package/dist/shell/TopNav.js +1 -1
  169. package/dist/shell/Tree.js +1 -1
  170. package/dist/telemetry/index.js +1 -1
  171. package/dist/templates/ChatTemplate.js +1 -1
  172. package/dist/templates/CheckoutTemplate.js +1 -1
  173. package/dist/templates/DataTablePage.js +1 -1
  174. package/dist/templates/EmailTemplate.js +1 -1
  175. package/dist/templates/FormLayoutPage.js +1 -1
  176. package/dist/ui/index.d.ts +1 -1
  177. package/dist/ui/index.js +1 -1
  178. package/dist/version.js +1 -1
  179. package/package.json +1 -1
  180. package/dist/Calculator-6ZU5MKTQ.js +0 -29
  181. package/dist/Files-DEC4KVQM.js +0 -87
  182. package/dist/PdfViewer-KSLOYXMD.js +0 -1
  183. package/dist/Sidebar-QQFJJWE2.js +0 -43
  184. package/dist/chunk-2EOQDYGM.js +0 -29
  185. package/dist/chunk-2PWZNFFP.js +0 -19
  186. package/dist/chunk-5FCEBKT2.js +0 -7
  187. package/dist/chunk-F2AEP37B.js +0 -4
  188. package/dist/chunk-HMHL27AU.js +0 -6
  189. package/dist/chunk-JBQWR4SX.js +0 -8
  190. package/dist/chunk-MOD4PGVF.js +0 -27
  191. package/dist/chunk-NKZNPYDB.js +0 -3
  192. package/dist/chunk-WAZTGEMG.js +0 -1
  193. package/dist/chunk-WKRFD4E4.js +0 -14
@@ -1,15 +1,15 @@
1
- import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-2SHYR3RA.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,R=a(r??null)??C,P=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[P,D,q,R+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-R)/i)),I=a(p??null)??D??R,j=Math.min(Math.max(y??I,R),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(R).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?R:null,z=$?a($.date):null,H=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let J,U;if(H&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},U=E}else if(J=E??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);U=e>=0&&e<t.length-1?t[e+1]:null}else U=null;const Y={};for(const e of U?.items??[])Y[e.part_number]=e;const B=!(!d||J?.id===d),K=d?Math.min(a(p??null)??A,A):A,V=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:R,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:E,nextAfter:$,displayed:J,prevReport:U,prevByPN:Y,isInterpolated:H,playing:v,startPlay:()=>{if(v)return void N();if(K<=R)return void f(K);M(!0),f(R);let e=performance.now(),t=R;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:V,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
- return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:R,poNumber:P,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),H=c().production,J=d(),U=_??H.heading,Y=e=>o(e,J);if(0===D.length&&0===R.length)return null;const B=R.filter(e=>"shipment"===e.kind),K=R.filter(e=>"inspection"===e.kind),V=R.filter(e=>"invoice"===e.kind),X=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
3
- /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?H.pause:H.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
- /* @__PURE__ */b("span",{children:z.playing?H.pause:H.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??H.backTo(String(W))}):null,[re,ne]=p(H.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
1
+ import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,P=a(r??null)??C,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[R,D,q,P+i];return O||e.push(x),Math.max(...e)})(),I=Math.max(1,Math.round((A-P)/i)),T=a(p??null)??D??P,j=Math.min(Math.max(y??T,P),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(P).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?P:null,z=$?a($.date):null,J=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let U,V;if(J&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,U={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},V=E}else if(U=E??t[t.length-1]??null,U){const e=t.findIndex(e=>e.id===U.id);V=e>=0&&e<t.length-1?t[e+1]:null}else V=null;const B={};for(const e of V?.items??[])B[e.part_number]=e;const H=!(!d||U?.id===d),K=d?Math.min(a(p??null)??A,A):A,X=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:P,endMs:A,totalLeadDays:I,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:E,nextAfter:$,displayed:U,prevReport:V,prevByPN:B,isInterpolated:J,playing:v,startPlay:()=>{if(v)return void N();if(K<=P)return void f(K);M(!0),f(P);let e=performance.now(),t=P;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:X,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
+ return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:P,poNumber:R,startMs:O,endMs:q,totalLeadDays:A,scrubMs:I,setScrubMs:T,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),T,C),J=c().production,U=d(),V=_??J.heading,B=e=>o(e,U);if(0===D.length&&0===P.length)return null;const H=P.filter(e=>"shipment"===e.kind),K=P.filter(e=>"inspection"===e.kind),X=P.filter(e=>"invoice"===e.kind),Y=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
3
+ /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?J.pause:J.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
+ /* @__PURE__ */b("span",{children:z.playing?J.pause:J.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??J.backTo(String(W))}):null,[re,ne]=p(J.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
5
5
  /* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
6
- /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(j.date).getTime())," · ",H.overall(Math.round(Z))," · ",H.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:H.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:H.estimatedCompletion,dateText:Y(G)}:null;/* @__PURE__ */
6
+ /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",B(new Date(j.date).getTime())," · ",J.overall(Math.round(Z))," · ",J.inStock(Y)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:J.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:J.estimatedCompletion,dateText:B(G)}:null;/* @__PURE__ */
7
7
  return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
8
- /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??H.start,end:M?.end??(e?H.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
8
+ /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:j?.id??"",onChange:T,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??J.start,end:M?.end??(e?J.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:z.stop}}),
9
9
  /* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
10
- return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:U,subject:P,meta:[`${Y(O)} → ${Y(q)}`,H.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
10
+ return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:V,subject:R,meta:[`${B(O)} → ${B(q)}`,J.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
11
  /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),H.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),H.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),H.inspection]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),H.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
12
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),J.report]}),H.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),J.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),J.inspection]}),X.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),J.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:j?.id??"",onChange:T,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>T(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
@@ -1,9 +1,9 @@
1
- import{ImageFocusPoint as e}from"./chunk-GATKJSGL.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Segmented as i}from"./chunk-N6DTTOB6.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-FMKTVZAO.js";import{TransferProgress as u}from"./chunk-S7VSXUKS.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-YDYDR72S.js";import{Icon as p}from"./chunk-2SHYR3RA.js";import{useShellStrings as b}from"./chunk-E6UCGCOC.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:U,hint:F,error:O,required:S,className:P,accept:$="image/*",maxSizeBytes:z,fit:V="cover",height:A=112,placeholder:B,cta:H,acceptHint:K,showFilename:T=!0,allowReplace:q=!0,allowRemove:D=!0,replaceLabel:G,removeLabel:Y,busy:I=!1,busyLabel:M,choosingLabel:W,pickFailedLabel:_,progress:E,disabled:J=!1,kind:Q,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,re=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof Y&&Y?Y:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=I||ne,me=ne&&!I?W??ie.choosing:M??ie.uploading,he=O??(se?_??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=J||ue,ke=!!w&&(t(w,$)||w===ve),je=B??r($,ie),xe=G??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:K,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?o(w):"",Ue=!ke&&!!ee,Fe=J||!q&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[q&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{FormField as e}from"./chunk-MVQBVPWP.js";import{ImageFocusPoint as a}from"./chunk-GATKJSGL.js";import{Segmented as i}from"./chunk-N6DTTOB6.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-4Y4PWKMM.js";import{TransferProgress as u}from"./chunk-S7VSXUKS.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-YDYDR72S.js";import{Icon as p}from"./chunk-FSPFV4MI.js";import{useShellStrings as b}from"./chunk-E6UCGCOC.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:C,onFile:R,label:F,hint:U,error:P,required:S,className:O,accept:$="image/*",maxSizeBytes:z,fit:V="cover",height:B=112,placeholder:K,cta:M,acceptHint:q,showFilename:D=!0,allowReplace:G=!0,allowRemove:H=!0,replaceLabel:I,removeLabel:T,busy:W=!1,busyLabel:Y,choosingLabel:A,pickFailedLabel:_,progress:E,disabled:J=!1,kind:Q,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=M??ie.cta,re=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof T&&T?T:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=W||ne,me=ne&&!W?A??ie.choosing:Y??ie.uploading,he=P??(se?_??ie.pickFailed:void 0),pe=e=>{if(!C)return;ce(!1);const a=C(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=J||ue,ke=!!w&&(t(w,$)||w===ve),je=K??r($,ie),xe=I??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{C?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:q,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Ce=()=>{ye||(C?pe():we.open())},Re=w?o(w):"",Fe=!ke&&!!ee,Ue=J||!G&&!H?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[G&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Ce(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),D&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Ue?void 0:{height:A},children:[Ue?
4
- /* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:V,objectPosition:Z||void 0}}),T&&w&&/* @__PURE__ */j(n,{children:Ce}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:E,rounded:"rounded-md"})]}),Se=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":S||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:A},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(x,{children:[
3
+ /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),H&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Fe?void 0:{height:B},children:[Fe?
4
+ /* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:V,objectPosition:Z||void 0}}),D&&w&&/* @__PURE__ */j(n,{children:Re}),Ue,ue&&/* @__PURE__ */j(l,{label:me,progress:E,rounded:"rounded-md"})]}),Se=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Ce(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":S||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:B},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(x,{children:[
5
5
  /* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(s,{})}),
6
6
  /* @__PURE__ */j("span",{className:"px-3 text-xs text-gray-500",children:je}),
7
- /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),K&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:K})]})});/* @__PURE__ */
8
- return k(a,{label:U,htmlFor:be,hint:F,error:he,required:S,className:P,children:[X&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Oe:Se,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
7
+ /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),q&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:q})]})});/* @__PURE__ */
8
+ return k(e,{label:F,htmlFor:be,hint:U,error:he,required:S,className:O,children:[X&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Pe:Se,!C&&/* @__PURE__ */j("input",{...we.inputProps}),
9
9
  /* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
@@ -1,9 +1,9 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-KZHPX4FM.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-E6UCGCOC.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:j="bg-white"}){const z="right"===m,O=i().sidebar,P=a(),R=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[W,D]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:W},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),E?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
- /* @__PURE__ */p(t,{side:m,width:W,onResize:D,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:O.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
4
- return f("div",P?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:R,top:l,fallback:O.sections}),K,
6
- /* @__PURE__ */p(v,{phone:R,bottom:n,label:O.sections,closeLabel:O.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:I,K,z?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-KZHPX4FM.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-E6UCGCOC.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:P="bg-white"}){const j="right"===m,z=i().sidebar,O=a(),W=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[D,E]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),I=null!=l||null!=n,M=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:D},children:[
2
+ /* @__PURE__ */f("div",{className:`flex h-full flex-col ${I?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),I?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
+ /* @__PURE__ */p(t,{side:m,width:D,onResize:E,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${P}`,children:u});/* @__PURE__ */
4
+ return f("div",O?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:W,top:l,fallback:z.sections}),K,
6
+ /* @__PURE__ */p(v,{phone:W,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:M,K,j?M:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
7
7
  return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
8
8
  /* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
9
9
  /* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-MY755PTJ.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-454DAGYG.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-UZMZ2EDW.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-ECCUEG3J.js";import{PLACEHOLDER_INK as t}from"./chunk-PF3ANJFI.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{LoadingSpinner as l}from"./chunk-Q5MD3VY6.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as s,useMemo as n}from"react";import{jsxs as o,jsx as i,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */i(r,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:y,emptyMessage:f}){const b=a(),[v,N]=s(""),[w,k]=s(null),[C,j]=s({}),E=v.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let r=e.get(t.category);r||(r={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,r)),r.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,r)=>(t.get(e.key)??1/0)-(t.get(r.key)??1/0))},[h,p]),_=e=>!E||e.title.toLowerCase().includes(E)||e.body.toLowerCase().includes(E)||e.category_label.toLowerCase().includes(E),A=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,E]),L=n(()=>A.flatMap(e=>e.docs),[A]),R=(w?L.find(e=>e.slug===w):void 0)??L[0]??null,z=e=>!!E||(C[e]??e===R?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-6BCFVOG7.js";import{PLACEHOLDER_INK as t}from"./chunk-PF3ANJFI.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as l}from"./chunk-Q5MD3VY6.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as s,useMemo as n}from"react";import{jsxs as o,jsx as i,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */i(r,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:y,emptyMessage:f}){const b=a(),[v,N]=s(""),[w,k]=s(null),[C,j]=s({}),M=v.trim().toLowerCase(),F=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let r=e.get(t.category);r||(r={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,r)),r.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,r)=>(t.get(e.key)??1/0)-(t.get(r.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),L=n(()=>F.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[F,M]),A=n(()=>L.flatMap(e=>e.docs),[L]),B=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,E=e=>!!M||(C[e]??e===B?.category);/* @__PURE__ */
2
2
  return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */o("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */i("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */o("div",{className:"relative",children:[
7
7
  /* @__PURE__ */i(r,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */i("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:b.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===A.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:E?b.help.noResults:f??b.help.empty}):A.map(e=>{const t=z(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===L.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?b.help.noResults:f??b.help.empty}):L.map(e=>{const t=E(e.key);/* @__PURE__ */
10
10
  return o("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!z(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
11
+ /* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!E(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
12
12
  /* @__PURE__ */i(d,{open:t}),
13
- /* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=R?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=B?.slug===e.slug;/* @__PURE__ */
14
14
  return o("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */i("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */i("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:b.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:R?/* @__PURE__ */o(c,{children:[
16
+ /* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:B?/* @__PURE__ */o(c,{children:[
17
17
  /* @__PURE__ */o("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */o("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:R.title}),
20
- /* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[R.category_label,!1===R.is_published&&/* @__PURE__ */o("span",{className:"ml-2 text-amber-600",children:["· ",b.help.draft]})]})]}),u&&x&&/* @__PURE__ */i("button",{type:"button",onClick:()=>x(R),className:"shrink-0 text-sm text-blue-600 hover:underline",children:b.help.edit})]}),
21
- /* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(R):R.body?/* @__PURE__ */i(e,{children:R.body}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500 italic",children:b.help.noBody})})]}):/* @__PURE__ */i("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"",label:b.help.loading}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500",children:b.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:B.title}),
20
+ /* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[B.category_label,!1===B.is_published&&/* @__PURE__ */o("span",{className:"ml-2 text-amber-600",children:["· ",b.help.draft]})]})]}),u&&x&&/* @__PURE__ */i("button",{type:"button",onClick:()=>x(B),className:"shrink-0 text-sm text-blue-600 hover:underline",children:b.help.edit})]}),
21
+ /* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(B):B.body?/* @__PURE__ */i(e,{children:B.body}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500 italic",children:b.help.noBody})})]}):/* @__PURE__ */i("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"",label:b.help.loading}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500",children:b.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -1,4 +1,4 @@
1
- import{InputNumber_default as e}from"./chunk-HAIMJAI4.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{Tooltip as i}from"./chunk-22S6LG6D.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const b=s[f],N=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
1
+ import{InputNumber_default as e}from"./chunk-ZCHBOAPA.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{Tooltip as i}from"./chunk-22S6LG6D.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const b=s[f],N=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
2
2
  return t("div",{"data-side":a.join("-"),className:"min-w-0",children:/* @__PURE__ */t(e,{value:"mixed"===d?null:d,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(a,e),min:h,max:p,step:u,snap:!0,precision:0,steppers:"compact",readOnly:g,placeholder:f,prefix:o,suffix:c.unit,"aria-label":n})})};/* @__PURE__ */
3
3
  return t("div",{role:"group","aria-label":a,"data-sides":d?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */n(o,d?{children:[N(["left"],c.sides.left,b.left),N(["top"],c.sides.top,b.top),N(["right"],c.sides.right,b.right),N(["bottom"],c.sides.bottom,b.bottom)]}:{children:[N(["left","right"],c.horizontal,b.horizontal),N(["top","bottom"],c.vertical,b.vertical)]})})}function p({each:e,onChange:r,label:n,disabled:o}){/* @__PURE__ */
4
4
  return t(i,{content:n,children:/* @__PURE__ */t(a,{size:"sm","aria-label":n,"aria-pressed":e,disabled:o,onClick:()=>r(!e),children:l})})}export{p as SidesEachToggle,h as SidesInput,c as sidesStartEach};
@@ -1,13 +1,13 @@
1
- import{CloseGlyph as e}from"./chunk-FMKTVZAO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-YDYDR72S.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as o,useEffect as l}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{IconButton_default as e}from"./chunk-4CANQ3B3.js";import{CloseGlyph as t}from"./chunk-4Y4PWKMM.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-YDYDR72S.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as o,useEffect as l}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,
5
- /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function b({files:n,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=o(/* @__PURE__ */new Map);l(()=>{const e=new Set(n);for(const[t,n]of m.current)e.has(t)||(URL.revokeObjectURL(n),m.current.delete(t))},[n]),l(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===n.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:n.map((n,s)=>{const c=h(n);/* @__PURE__ */
5
+ /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function b({files:e,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=o(/* @__PURE__ */new Map);l(()=>{const t=new Set(e);for(const[e,n]of m.current)t.has(e)||(URL.revokeObjectURL(n),m.current.delete(e))},[e]),l(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:e.map((e,s)=>{const c=h(e);/* @__PURE__ */
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",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
- /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:n.name,children:n.name}),
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 f({onClick:e,count:t=0,variant:n="button",label:r,disabled:i=!1}){const o=c().files,l=r??o.attach,p=t>0?`${l} (${t})`:l;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-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function g({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:g,trigger:x="button",actions:j,onReject:k,className:N="",children:v}){const y=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),L=o([]);return l(()=>{k&&y.rejections.length>0&&y.rejections!==L.current&&(L.current=y.rejections,k(y.rejections))},[y.rejections,k]),/* @__PURE__ */u(h,{intake:y,dropLabel:p,className:N,children:[v,
7
+ /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
8
+ /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.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(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function f({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const o=c().files,l=a??o.attach,p=n>0?`${l} (${n})`:l;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
+ /* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function g({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:g,trigger:x="button",actions:j,onReject:k,className:N="",children:v}){const y=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),L=o([]);return l(()=>{k&&y.rejections.length>0&&y.rejections!==L.current&&(L.current=y.rejections,k(y.rejections))},[y.rejections,k]),/* @__PURE__ */u(h,{intake:y,dropLabel:p,className:N,children:[v,
10
10
  /* @__PURE__ */d(b,{files:e,disabled:m,onRemove:n=>{y.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(f,{onClick:y.open,count:e.length,variant:x,label:g,disabled:m}),j]}),
13
- /* @__PURE__ */d(r,{rejections:y.rejections})]})}export{f as AttachButton,h as AttachmentDropZone,b as AttachmentList,g as ComposerAttachments,m as PaperclipGlyph};
13
+ /* @__PURE__ */d(a,{rejections:y.rejections})]})}export{f as AttachButton,h as AttachmentDropZone,b as AttachmentList,g as ComposerAttachments,m as PaperclipGlyph};
@@ -0,0 +1,6 @@
1
+ import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-5TFTSYOD.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as o}from"./chunk-FSPFV4MI.js";import{Tooltip as n}from"./chunk-22S6LG6D.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s}){const i=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),t=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);return{words:i>0,paragraph:t>0,oneRow:i>0&&t>0&&i+1+t<=9,flow:i>0&&t>0&&i+1+t>9&&i<=7,cells:{words:i,paragraph:t}}}function w(e,l){/* @__PURE__ */
2
+ return i(n,{content:e,children:l},l.key??void 0)}function g({offered:n,pressed:h,onMark:g,color:f,linkOpen:k=!1,last:v,alignment:N,list:C,letterCase:D,disabled:M=!1,"aria-label":x,windows:y,className:S="",layout:j="grid"}){const A=s().textToolbar,q=m({offered:n,color:f,last:v,alignment:N,list:C,letterCase:D});if(!q.words&&!q.paragraph)return null;const B=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,I=(e,l,r,o)=>n.has(e)?w(l,/* @__PURE__ */i(a,"link"===e?{pressed:k,className:B(k),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":k,"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r}:{className:B(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r},e)):null,L=l(A),T=e.map(e=>[e,L[e],r(e)]),$=N?e.filter(e=>N.allow.includes(e)):[],R=N&&$.includes(N.value)?N.value:$[0],U=[["none",A.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",A.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",A.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],F=/* @__PURE__ */t(d,{children:[I("bold",A.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),I("italic",A.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),I("underline",A.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),I("strike",A.strike,/* @__PURE__ */i(o,{name:"strike"})),f?w(A.color,/* @__PURE__ */i(a,{pressed:f.open,className:B(f.open,"rosh-tb-color"),"aria-label":A.color,"aria-haspopup":"dialog","aria-expanded":f.open,disabled:M,style:f.run?{"--rosh-tb-run":f.run}:void 0,onMouseDown:c,onClick:f.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,I("link",A.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),I("sup",A.sup,/* @__PURE__ */i(o,{name:"superscript"})),I("sub",A.sub,/* @__PURE__ */i(o,{name:"subscript"})),I("code",A.code,/* @__PURE__ */i(o,{name:"code"})),u(v)?v:null]}),K=/* @__PURE__ */t(d,{children:[N&&$.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.alignment,onKeyDown:e=>p(e,$,e=>N.onChange(e)),children:T.map(([e,l,r])=>N.allow.includes(e)?w(l,/* @__PURE__ */i(a,{role:"radio",pressed:N.value===e,className:B(N.value===e),"aria-checked":N.value===e,"aria-label":l,tabIndex:e===R?0:-1,disabled:M||N.disabled,onMouseDown:c,onClick:()=>N.onChange(e),children:r},e)):null)}):null,C&&n.has("bullet")?w(A.bullet,/* @__PURE__ */i(a,{className:B("bullet"===C.pressed),"aria-label":A.bullet,"aria-pressed":"bullet"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,C&&n.has("number")?w(A.number,/* @__PURE__ */i(a,{className:B("number"===C.pressed),"aria-label":A.number,"aria-pressed":"number"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,I("quote",A.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.letterCase,onKeyDown:e=>p(e,U.map(([e])=>e),e=>D.onChange(e)),children:U.map(([e,l,r])=>w(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:B(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:M||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null]}),O="row"===j,E=O?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===v?" is-eight":"",G=b(n,Boolean(f)),H={"--rosh-tb-color-col":String(G.color),"--rosh-tb-link-col":String(G.link),...O?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let P;return P=O?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:F}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:K}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[F,
3
+ /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),K]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
+ /* @__PURE__ */i("div",{className:"rosh-tb-words",children:F}),
5
+ /* @__PURE__ */i("div",{className:"rosh-tb-para",children:K})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===v?" is-eight":""),children:F}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:K}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${E} ${S}`.trim(),style:H,children:[
6
+ /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":x??A.formatting,children:P}),y]})}export{g as TextToolbar,m as textToolbarRows,b as textToolbarWindowColumns};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-PCKYNZ5Y.js";import{Avatar as t}from"./chunk-MMFJBWJC.js";import{Input_default as a}from"./chunk-GX2GSDJP.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-LGLZTJ2W.js";import{Avatar as t}from"./chunk-MMFJBWJC.js";import{Input_default as a}from"./chunk-GX2GSDJP.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
2
2
  return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */l("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */n("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
3
3
  /* @__PURE__ */l(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */n("div",{className:"min-w-0 flex-1",children:[
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-2SHYR3RA.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-FSPFV4MI.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
2
2
  return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
3
3
  /* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
4
4
  return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-PAB2ZU4F.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-KJY57QPT.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[T,A]=i(!1),H=o(null),L=a().copy;c(()=>()=>{H.current&&clearTimeout(H.current)},[]);const M=l(async()=>{await e(n)?(A(!0),H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{A(!1),H.current=null},2e3),v?.(n)):t.error(L.failed)},[n,v,L]),{box:R,button:Y}=p[g],z=!k;/* @__PURE__ */
4
- return m("div",{id:z?void 0:j,"aria-describedby":z?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],R,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[M,T]=i(!1),F=o(null),L=a().copy;c(()=>()=>{F.current&&clearTimeout(F.current)},[]);const P=l(async()=>{await e(n)?(T(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{T(!1),F.current=null},2e3),v?.(n)):t.error(L.failed)},[n,v,L]),{box:z,button:A}=p[g],E=!k;/* @__PURE__ */
4
+ return m("div",{id:E?void 0:j,"aria-describedby":E?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],z,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!k&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?L.copyLabel(x):L.copy,"aria-describedby":C,onClick:M,className:`${Y} text-gray-400`,children:/* @__PURE__ */s(T?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?L.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?L.copyLabel(x):L.copy,"aria-describedby":C,onClick:P,className:`${A} text-gray-400`,children:/* @__PURE__ */s(M?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:M?L.copied:""})]})]})}export{y as Snippet};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-VU6VPKM3.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{FormField as r}from"./chunk-MVQBVPWP.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-7PCI6AUU.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as o}from"./chunk-4IU5BSVE.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-VU6VPKM3.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-454DAGYG.js";import{FormField as r}from"./chunk-MVQBVPWP.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-7PCI6AUU.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as o}from"./chunk-4IU5BSVE.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
2
2
  return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
3
3
  /* @__PURE__ */d("div",{children:[
4
4
  /* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
@@ -1,7 +1,7 @@
1
- import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,A=p??w;/* @__PURE__ */
2
- return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=A.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
1
+ import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,I=p??w;/* @__PURE__ */
2
+ return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=I.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
3
3
  return c("div",{children:[
4
- /* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=A.includes(e)?A.filter(n=>n!==e):v?[...A,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
4
+ /* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=I.includes(e)?I.filter(n=>n!==e):v?[...I,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
5
5
  /* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
6
6
  /* @__PURE__ */c(l,{children:[
7
7
  /* @__PURE__ */o("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */o(e,{count:i.count,tone:"accent"})}),
@@ -1,4 +1,4 @@
1
- import{Banner as e}from"./chunk-MY755PTJ.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
1
+ import{Banner as e}from"./chunk-UZMZ2EDW.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
2
2
  return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
3
3
  /* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
4
4
  /* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
@@ -1,23 +1,23 @@
1
- import{Calendar as e,fromKey as t}from"./chunk-RB2F65YJ.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-PF3ANJFI.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-E6UCGCOC.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${$(e.getMonth()+1)}`,$=e=>String(e).padStart(2,"0");function M(e){return`${e.getFullYear()}-${$(e.getMonth()+1)}-${$(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:M(new Date(r,n,t.getDate()-14)),to:M(a)};case"lastMonth":return{from:M(l(1)),to:M(o)};case"last3Months":return{from:M(l(3)),to:M(o)};case"last6Months":return{from:M(l(6)),to:M(o)};case"last12Months":return{from:M(l(12)),to:M(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function R({from:$,to:M,onChange:R,formatDisplay:O,clearable:J,required:T=!1,name:Y,id:H,"aria-labelledby":B,"aria-label":E,weekStartsOn:G,placeholder:L,fullWidth:U=!1,min:A,max:I,disabled:q=!1,allowOpenEnd:P=!1}){const z=p().dateRange,K=h(),V=O??(K?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(K):S),X=L??z.placeholder,Z=J??!T,[Q,_]=f(!1),[ee,te]=f($),[re,ne]=f(M),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Q,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Q||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Q||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!H&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!E||!!B||Ne,$e=/* @__PURE__ */new Date,[Me,De]=f(()=>$?C(j($)):W($e,A,I)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,$e),A,I)),je=e=>e?V(e):"";x(()=>{if(!Q)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Q]),x(()=>{q&&_(!1)},[q]);const Se=()=>{R("",""),_(!1)},Fe=$&&M?`${je($)} — ${je(M)}`:$?z.fromOnly(je($)):M?z.toOnly(je(M)):"",Re=o(K),Oe=e=>{const r=t(e);return r?Re.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Je=$&&M?z.range(Oe($),Oe(M)):$?z.fromOnly(Oe($)):M?z.toOnly(Oe(M)):X,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Ye=/* @__PURE__ */v(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,$e);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?z[e]:void 0,children:he?ye?z[e]:z[`${e}Short`]:z[e]},e)),
2
- /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:z.custom})]}),He=(e,t)=>P?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Be=e=>P&&le===e?" ring-1 ring-blue-400":"",Ee=
3
- /* @__PURE__ */N(e,{mode:"range",min:A,max:I,value:ee||null,endValue:re||null,month:Me,onMonthChange:De,onSelect:e=>{oe("Custom"),P?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:G,"aria-label":z.dialog});/* @__PURE__ */
1
+ import{Calendar as e,fromKey as t}from"./chunk-JPRJQ6B7.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-PF3ANJFI.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-E6UCGCOC.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(l(1)),to:$(o)};case"last3Months":return{from:$(l(3)),to:$(o)};case"last6Months":return{from:$(l(6)),to:$(o)};case"last12Months":return{from:$(l(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function F(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var S=/* @__PURE__ */new Map;function O({from:M,to:$,onChange:O,formatDisplay:J,clearable:R,required:T=!1,name:B,id:E,"aria-labelledby":G,"aria-label":H,weekStartsOn:I,placeholder:L,fullWidth:U=!1,min:Y,max:P,disabled:q=!1,allowOpenEnd:A=!1}){const V=p().dateRange,z=h(),K=J??(z?function(e){let t=S.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),S.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(z):F),Q=L??V.placeholder,X=R??!T,[Z,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Z,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Z||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Z||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!E&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!H||!!G||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,Y,P)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),Y,P)),je=e=>e?K(e):"";x(()=>{if(!Z)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Z]),x(()=>{q&&_(!1)},[q]);const Fe=()=>{O("",""),_(!1)},Se=M&&$?`${je(M)} — ${je($)}`:M?V.fromOnly(je(M)):$?V.toOnly(je($)):"",Oe=o(z),Je=e=>{const r=t(e);return r?Oe.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=M&&$?V.range(Je(M),Je($)):M?V.fromOnly(Je(M)):$?V.toOnly(Je($)):Q,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Be=/* @__PURE__ */v(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?V[e]:void 0,children:he?ye?V[e]:V[`${e}Short`]:V[e]},e)),
2
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:V.custom})]}),Ee=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ge=e=>A&&le===e?" ring-1 ring-blue-400":"",He=
3
+ /* @__PURE__ */N(e,{mode:"range",min:Y,max:P,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),A?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:I,"aria-label":V.dialog});/* @__PURE__ */
4
4
  return v("div",{className:"relative"+(U?" w-full":""),ref:se,children:[
5
- /* @__PURE__ */v("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${$||M?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{q||(te($),ne(M),oe(null),ie($&&!M?"to":"from"),De($?C(j($)):W($e,A,I)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Q,id:H,disabled:q||void 0,"aria-label":E,"aria-labelledby":B,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Q?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
5
+ /* @__PURE__ */v("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{q||(te(M),ne($),oe(null),ie(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,Y,P)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Z,id:E,disabled:q||void 0,"aria-label":H,"aria-labelledby":G,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Z?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */N(i,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */N("span",{className:"truncate",children:Fe||X})]}),Z&&!q&&($||M)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":z.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Je}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:z.required}),Y&&/* @__PURE__ */v(w,{children:[
9
- /* @__PURE__ */N("input",{type:"hidden",name:Y.from,value:$,disabled:q||void 0}),
10
- /* @__PURE__ */N("input",{type:"hidden",name:Y.to,value:M,disabled:q||void 0})]}),Q&&y(
11
- /* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":z.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
12
- /* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[He("from",/* @__PURE__ */v(w,{children:[
13
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:z.from}),
14
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("from")}`,children:ee?je(ee):z.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),He("to",/* @__PURE__ */v(w,{children:[
15
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:z.to}),
16
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("to")}`,children:re?je(re):z.end})]}))]}),he?/* @__PURE__ */v(w,{children:[We.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:z.lastHeading}),
17
- /* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ye,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:z[e]},e))]})]}),
18
- /* @__PURE__ */N("div",{className:"w-full",children:Ee})]}):
8
+ /* @__PURE__ */N("span",{className:"truncate",children:Se||Q})]}),X&&!q&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Fe,"aria-label":V.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:V.required}),B&&/* @__PURE__ */v(w,{children:[
9
+ /* @__PURE__ */N("input",{type:"hidden",name:B.from,value:M,disabled:q||void 0}),
10
+ /* @__PURE__ */N("input",{type:"hidden",name:B.to,value:$,disabled:q||void 0})]}),Z&&y(
11
+ /* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":V.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
12
+ /* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ee("from",/* @__PURE__ */v(w,{children:[
13
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
14
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ge("from")}`,children:ee?je(ee):V.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Ee("to",/* @__PURE__ */v(w,{children:[
15
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
16
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ge("to")}`,children:re?je(re):V.end})]}))]}),he?/* @__PURE__ */v(w,{children:[We.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:V.lastHeading}),
17
+ /* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Be,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
18
+ /* @__PURE__ */N("div",{className:"w-full",children:He})]}):
19
19
  /* @__PURE__ */v("div",{ref:be,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */N("div",{className:"w-64",children:Ee}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ye})]}),
21
- /* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:l({variant:"ghost"}),children:z.clear}),
22
- /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:z.cancel}),
23
- /* @__PURE__ */N("button",{type:"button",onClick:()=>{R(ee,re),_(!1)},disabled:P?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:z.apply})]})]}),document.body)]})}export{R as DateRangePicker,D as presetRange,M as toISODate};
20
+ /* @__PURE__ */N("div",{className:"w-64",children:He}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Be})]}),
21
+ /* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:Fe,className:l({variant:"ghost"}),children:V.clear}),
22
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:V.cancel}),
23
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>{O(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{O as DateRangePicker,D as presetRange,$ as toISODate};
@@ -1,3 +1,3 @@
1
- import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
1
+ import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
2
2
  /* @__PURE__ */l("span",{children:e}),
3
3
  /* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-DG2WU3BU.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
1
+ import{requestFilesTrashView as n}from"./chunk-GSBIJLTD.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
@@ -1,11 +1,11 @@
1
- import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-FMKTVZAO.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as i}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{buttonClasses as c}from"./chunk-K7U4RWXJ.js";import{Icon as m}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useRef as p,useState as x,useCallback as b,useEffect as g}from"react";import{createPortal as k}from"react-dom";import{jsx as w,jsxs as v,Fragment as y}from"react/jsx-runtime";var N=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function C(e){return e.kind?e.kind:r(e.url)?"video":N.test(e.url)?"file":"image"}var j="flex items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",U=e=>e.stopPropagation();function A({images:r,startIndex:N=0,onClose:A,onIndexChange:L,onOpenFile:R}){const $=f().lightbox,z=u(),D=p(null),I=p(null),[J,W]=x(N),E=r.length,F=z&&E>0,G=b(e=>{if(E<2)return;const t=((J+e)%E+E)%E;W(t),L?.(t)},[J,E,L]);if(i(F),l(D,F,I),a(F),g(()=>{if(F)return h(()=>(A(),!0),()=>D.current)},[F,A]),g(()=>{if(!F)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[F,G]),!F)return null;const K=r[Math.min(J,E-1)],O=C(K),V=K.caption||n(K.url);let M;return M="video"===O?/* @__PURE__ */w("video",{src:K.url,controls:!0,playsInline:!0,"aria-label":V,onClick:U,className:`${e} rounded-lg bg-black`}):"file"===O?/* @__PURE__ */v("div",{onClick:U,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-white px-10 py-8 text-center text-gray-500",children:[
1
+ import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-4Y4PWKMM.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as i}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{buttonClasses as c}from"./chunk-K7U4RWXJ.js";import{Icon as m}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useRef as p,useState as x,useCallback as b,useEffect as g}from"react";import{createPortal as k}from"react-dom";import{jsx as w,jsxs as v,Fragment as y}from"react/jsx-runtime";var N=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function C(e){return e.kind?e.kind:r(e.url)?"video":N.test(e.url)?"file":"image"}var j="flex items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",U=e=>e.stopPropagation();function I({images:r,startIndex:N=0,onClose:I,onIndexChange:L,onOpenFile:W}){const $=f().lightbox,z=u(),A=p(null),D=p(null),[F,J]=x(N),M=r.length,E=z&&M>0,G=b(e=>{if(M<2)return;const t=((F+e)%M+M)%M;J(t),L?.(t)},[F,M,L]);if(i(E),l(A,E,D),a(E),g(()=>{if(E)return h(()=>(I(),!0),()=>A.current)},[E,I]),g(()=>{if(!E)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E,G]),!E)return null;const K=r[Math.min(F,M-1)],P=C(K),R=K.caption||n(K.url);let V;return V="video"===P?/* @__PURE__ */w("video",{src:K.url,controls:!0,playsInline:!0,"aria-label":R,onClick:U,className:`${e} rounded-lg bg-black`}):"file"===P?/* @__PURE__ */v("div",{onClick:U,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-white px-10 py-8 text-center text-gray-500",children:[
2
2
  /* @__PURE__ */w(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
3
- /* @__PURE__ */w("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:V}),R?/* @__PURE__ */w(s,{size:"sm",onClick:()=>R(K),children:$.openFile}):/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:c({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */w(t,{src:K.url,alt:V,className:`${e} object-contain`,frameClassName:"rounded-lg"}),k(
4
- /* @__PURE__ */v("div",{ref:D,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:d.overlay},onClick:A,children:[M,
3
+ /* @__PURE__ */w("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:R}),W?/* @__PURE__ */w(s,{size:"sm",onClick:()=>W(K),children:$.openFile}):/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:c({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */w(t,{src:K.url,alt:R,className:`${e} object-contain`,frameClassName:"rounded-lg"}),k(
4
+ /* @__PURE__ */v("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:d.overlay},onClick:I,children:[V,
5
5
  /* @__PURE__ */v("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:U,children:[
6
- /* @__PURE__ */w("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:$.counter(J+1,E)}),
7
- /* @__PURE__ */w("button",{ref:I,type:"button",onClick:A,"aria-label":$.close,className:`${j} h-8 w-8`,children:/* @__PURE__ */w(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),E>1&&/* @__PURE__ */v(y,{children:[
6
+ /* @__PURE__ */w("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:$.counter(F+1,M)}),
7
+ /* @__PURE__ */w("button",{ref:D,type:"button",onClick:I,"aria-label":$.close,className:`${j} h-8 w-8`,children:/* @__PURE__ */w(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),M>1&&/* @__PURE__ */v(y,{children:[
8
8
  /* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(-1)},"aria-label":$.previous,className:`${j} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
9
  /* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(1)},"aria-label":$.next,className:`${j} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
10
10
  /* @__PURE__ */v("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:U,children:[
11
- /* @__PURE__ */w("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:V}),"file"!==O&&/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-white/70 underline decoration-white/30 underline-offset-2 hover:text-white",children:$.openOriginal})]})]}),document.body)}export{A as ImageLightbox,C as lightboxKind};
11
+ /* @__PURE__ */w("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:R}),"file"!==P&&/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-white/70 underline decoration-white/30 underline-offset-2 hover:text-white",children:$.openOriginal})]})]}),document.body)}export{I as ImageLightbox,C as lightboxKind};