efficient-shell 12.23.0 → 12.25.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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-G3NJJDFN.js → Browser-XIJNQPN5.js} +16 -16
  3. package/dist/Calculator-LSDVIJVQ.js +29 -0
  4. package/dist/CurrencyConverter-G5IYUCN7.js +21 -0
  5. package/dist/Files-3USUXZM2.js +141 -0
  6. package/dist/Notepad-MXANPUG3.js +24 -0
  7. package/dist/PomodoroTimer-SFTPXEDV.js +91 -0
  8. package/dist/{Preview-DRNDT6WX.js → Preview-UVQVZYR7.js} +18 -18
  9. package/dist/{Stock-JY3PJI2M.js → Stock-YCPMLYPR.js} +3 -3
  10. package/dist/{Weather-POQXLYFA.js → Weather-TLFNIPDG.js} +13 -13
  11. package/dist/{WorldClock-FUJOPJ5G.js → WorldClock-66IRFS2W.js} +6 -6
  12. package/dist/ai/index.d.ts +15 -4
  13. package/dist/ai/index.js +115 -111
  14. package/dist/ai.css +1 -1
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-F4XGUOVL.js → chunk-4BKJ6A5H.js} +4 -4
  20. package/dist/{chunk-RKXCB5ZJ.js → chunk-7MJYT6IW.js} +1 -1
  21. package/dist/chunk-7NYCPO54.js +1 -0
  22. package/dist/{chunk-QJWQ6OMF.js → chunk-AQCUGTOR.js} +6 -6
  23. package/dist/{chunk-T2OSPUS6.js → chunk-BZHP645G.js} +3 -3
  24. package/dist/{chunk-OGWQABFP.js → chunk-CALBDO7B.js} +1 -1
  25. package/dist/chunk-EC3P3W7Z.js +28 -0
  26. package/dist/chunk-EIFNESXS.js +1 -0
  27. package/dist/{chunk-2NZ7CVMW.js → chunk-GBTL3G36.js} +14 -14
  28. package/dist/{chunk-ZLKEPDJE.js → chunk-H6WXTJOT.js} +1 -1
  29. package/dist/{chunk-ZNLCITYY.js → chunk-JVOH7776.js} +2 -2
  30. package/dist/chunk-KZRZYLN7.js +99 -0
  31. package/dist/chunk-LDVDNAXP.js +4 -0
  32. package/dist/{chunk-MFSDS6CN.js → chunk-NPTF6MP4.js} +1 -1
  33. package/dist/{chunk-WLX24TG6.js → chunk-TUPPFC74.js} +4 -4
  34. package/dist/{chunk-HOEHV2J5.js → chunk-WVMCKM5Z.js} +1 -1
  35. package/dist/format/index.js +1 -1
  36. package/dist/forms/BrandAssetEditor.js +1 -1
  37. package/dist/forms/LinkPicker.js +1 -1
  38. package/dist/forms/MediaLibrary.d.ts +4 -3
  39. package/dist/forms/MediaLibrary.js +1 -1
  40. package/dist/forms/MediaUploadField.js +1 -1
  41. package/dist/icons/index.js +1 -1
  42. package/dist/index.js +98 -98
  43. package/dist/shell/Avatar.d.ts +3 -1
  44. package/dist/shell/Avatar.js +1 -1
  45. package/dist/shell/Dialog.d.ts +5 -0
  46. package/dist/shell/LanguageSelect.js +1 -1
  47. package/dist/shell/SettingRow.js +1 -1
  48. package/dist/telemetry/index.js +1 -1
  49. package/dist/templates/ChatTemplate.js +1 -1
  50. package/dist/templates/DashboardTemplate.js +1 -1
  51. package/dist/templates/EmailTemplate.js +1 -1
  52. package/dist/ui/index.js +1 -1
  53. package/dist/version.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/Calculator-OUPD7SZV.js +0 -29
  56. package/dist/CurrencyConverter-CNGYEKE3.js +0 -21
  57. package/dist/Files-A5MD7QNE.js +0 -141
  58. package/dist/Notepad-CUWBPETD.js +0 -24
  59. package/dist/PomodoroTimer-I53C5QYM.js +0 -91
  60. package/dist/chunk-EEGTFJUQ.js +0 -28
  61. package/dist/chunk-MDVABA4H.js +0 -1
  62. package/dist/chunk-WESNFWM4.js +0 -4
  63. package/dist/chunk-XQNZJNEJ.js +0 -99
@@ -1,9 +1,9 @@
1
- import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as n,SettingAutoContext as a}from"./chunk-2NMW66P5.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!i(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!a(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),i=m(h);if(!e&&!i)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
- /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(n.Provider,{value:t,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
3
+ /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
+ /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
5
5
  return r("div",{className:c.join(" "),children:[
6
- /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),i&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(n.Provider,{value:g,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
6
+ /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
7
7
  return r("div",T?{className:B,children:[
8
8
  /* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
9
9
  /* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${J}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,I]})}),
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-JGRDG7CB.js";import{Avatar as t}from"./chunk-WESNFWM4.js";import{Input_default as a}from"./chunk-6RK6R3RY.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{useState as s}from"react";import{jsx as n,jsxs as l}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-JGRDG7CB.js";import{Avatar as t}from"./chunk-LDVDNAXP.js";import{Input_default as a}from"./chunk-6RK6R3RY.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{useState as s}from"react";import{jsx as n,jsxs as l}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 n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("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__ */n(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
@@ -0,0 +1 @@
1
+ var r="12.25.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,11 +1,11 @@
1
- import{MediaUploadField as e}from"./chunk-T2OSPUS6.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,H]=l(""),[I,S]=l(""),[A,C]=l(!1),[F,O]=l(!1),E=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),P=t().brandAsset,B=R||d||g||"",G=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const M=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
- return n("section",{"aria-label":P.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
1
+ import{MediaUploadField as e}from"./chunk-BZHP645G.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,H]=l(""),[I,A]=l(""),[C,F]=l(!1),[B,E]=l(!1),G=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),O=t().brandAsset,P=R||d||g||"",S=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const M=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
+ return n("section",{"aria-label":O.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
3
3
  /* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
4
- /* @__PURE__ */c(e,{value:B,onChange:()=>{},onFile:e=>{if(k)return;M();const r=URL.createObjectURL(e);j.current=r,U(e),H(r),S("")},label:p,hint:I||P.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:A||F,disabled:k}),
4
+ /* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;M();const r=URL.createObjectURL(e);j.current=r,U(e),H(r),A("")},label:p,hint:I||O.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:C||B,disabled:k}),
5
5
  /* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
6
- /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!A){C(!0),S("");try{await x(L),M(),U(null),H("")}catch(e){S(e instanceof Error?e.message:P.saveFailed(E,p))}finally{C(!1)}}},disabled:!L||k,loading:A,children:P.save(E,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!F){if(L)return M(),U(null),H(""),void S("");if(d){O(!0),S("");try{await f()}catch(e){S(e instanceof Error?e.message:P.removeFailed(E,p))}finally{O(!1)}}}},disabled:k,loading:F,children:L?P.discard:P.remove(E,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":P.previews(p),children:[
7
- /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:P.preview}),
8
- /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:B,alt:P.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:G,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
6
+ /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!C){F(!0),A("");try{await x(L),M(),U(null),H("")}catch(e){A(e instanceof Error?e.message:O.saveFailed(G,p))}finally{F(!1)}}},disabled:!L||k,loading:C,children:O.save(G,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!B){if(L)return M(),U(null),H(""),void A("");if(d){E(!0),A("");try{await f()}catch(e){A(e instanceof Error?e.message:O.removeFailed(G,p))}finally{E(!1)}}}},disabled:k,loading:B,children:L?O.discard:O.remove(G,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":O.previews(p),children:[
7
+ /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:O.preview}),
8
+ /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:O.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
9
9
  return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
10
10
  /* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
11
11
  /* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
@@ -1,11 +1,11 @@
1
- import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-232YPI2L.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-VLMBXPRM.js";import{TransferProgress as u}from"./chunk-FJVZ2W55.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-V4XR4MOS.js";import{Icon as p}from"./chunk-XZXFUZIK.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}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:F,label:$,hint:C,error:U,required:z,className:P,accept:I="image/*",maxSizeBytes:O,fit:H="cover",height:M,shape:q="rect",placeholder:B,cta:J,acceptHint:S,showFilename:V=!0,allowReplace:X=!0,allowRemove:D=!0,replaceLabel:K,removeLabel:W,busy:Z=!1,busyLabel:A,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:G=!1,kind:Q,onKindChange:T,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=M??(re?96:112),ne=J??te.cta,se=Q??(/video/.test(I)&&!/image/.test(I)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=Z||ce,be=ce&&!Z?Y??te.choosing:A??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=G||pe,Ne=!!w&&(t(w,I)||w===ke),we=B??r(I,te),Le=K??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):F?F(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Fe=m({accept:I,maxSizeBytes:O,acceptHint:S,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Fe,Ce=()=>{je||(R?ge():Fe.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Pe=G||!X&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"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:[X&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Ce(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{ImageFocusPoint as i}from"./chunk-232YPI2L.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-VLMBXPRM.js";import{TransferProgress as u}from"./chunk-FJVZ2W55.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-V4XR4MOS.js";import{Icon as p}from"./chunk-XZXFUZIK.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}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:F,label:$,hint:C,error:U,required:z,className:P,accept:I="image/*",maxSizeBytes:O,fit:H="cover",height:M,shape:q="rect",placeholder:B,cta:J,acceptHint:S,showFilename:V=!0,allowReplace:X=!0,allowRemove:D=!0,replaceLabel:K,removeLabel:W,busy:Z=!1,busyLabel:A,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:G=!1,kind:Q,onKindChange:T,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=M??(re?96:112),ne=J??te.cta,se=Q??(/video/.test(I)&&!/image/.test(I)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=Z||ce,be=ce&&!Z?Y??te.choosing:A??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=G||pe,Ne=!!w&&(t(w,I)||w===ke),we=B??r(I,te),Le=K??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):F?F(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Fe=m({accept:I,maxSizeBytes:O,acceptHint:S,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Fe,Ce=()=>{je||(R?ge():Fe.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Pe=G||!X&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"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:[X&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Ce(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),D&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ie=/* @__PURE__ */k("div",{...Fe.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",$e?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
- /* @__PURE__ */x(a,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:H,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
4
+ /* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:H,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
5
5
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
6
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),S&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:S})]}),He=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
7
7
  /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",$e?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
8
  /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):Oe})]}),Me=re?He:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,className:d($e,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):/* @__PURE__ */k(j,{children:[
9
9
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
10
- return k(i,{label:$,htmlFor:ve,hint:C,error:fe,required:z,className:P,children:[T&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>T(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Ie:Me,!R&&/* @__PURE__ */x("input",{...Fe.inputProps}),
10
+ return k(a,{label:$,htmlFor:ve,hint:C,error:fe,required:z,className:P,children:[T&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>T(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Ie:Me,!R&&/* @__PURE__ */x("input",{...Fe.inputProps}),
11
11
  /* @__PURE__ */x(h,{rejections:Fe.rejections})]})}export{w as MediaUploadField};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-XQNZJNEJ.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-KZRZYLN7.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};
@@ -0,0 +1,28 @@
1
+ import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-OLCRYT3N.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-T2TZBTSM.js";import{ImageLightbox as i}from"./chunk-436PJFHC.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-UP4HLGMZ.js";import{Breadcrumbs as d}from"./chunk-QMSINDXL.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-VQ4X3OBR.js";import{useMediaMoveItems as u}from"./chunk-NOGSS432.js";import{RenameField as m}from"./chunk-GEZM6ARD.js";import{NativeSelect as p}from"./chunk-TM4CRQ3W.js";import{MediaUploadGrid as h}from"./chunk-OG53D3R5.js";import{MediaUsedInList as f}from"./chunk-FQ4IRBMA.js";import{Segmented as g}from"./chunk-HNIIDDLJ.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-Y7KDCC6E.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-6FZ5JTBY.js";import{Banner as N}from"./chunk-N3R6N7LG.js";import{Input_default as C}from"./chunk-6RK6R3RY.js";import{DropdownMenu as I}from"./chunk-SFULX4E3.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-V4XR4MOS.js";import{setModalDragAside as z,modalIdHolding as T}from"./chunk-EIFNESXS.js";import{ColoredBadge as F}from"./chunk-CJHYOHMU.js";import{Button_default as L}from"./chunk-EVYD6UFQ.js";import{Icon as O}from"./chunk-XZXFUZIK.js";import{Tooltip as E}from"./chunk-SOZCWT6I.js";import{buttonClasses as M}from"./chunk-UQYNPYF4.js";import{usePlotWidth as R}from"./chunk-MAFUXCPZ.js";import{useShellStrings as A}from"./chunk-JSHMIMAJ.js";import{useRef as P,useMemo as U,useCallback as B,useState as K,useEffect as H}from"react";import{jsxs as J,Fragment as V,jsx as G}from"react/jsx-runtime";var Y="application/x-efficient-media-files",Z="application/x-efficient-media-folder",X="application/x-efficient-media-file";function Q(e){if(!e||!Array.from(e.types).includes(X))return null;try{const n=JSON.parse(e.getData(X));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var $={type:"all",use:"any",sort:"newest"},W={lock:/* @__PURE__ */G(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */G(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */G(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */G(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */G(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */G(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */G(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */G(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */G(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */G(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */G(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */G(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */G(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */G(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */G(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */G(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */G(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */G(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */G(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */G(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(O){const{mode:Q="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:ae,allFilesCount:re,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ne,onRename:Ce,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:ze,onEmptyTrash:Te,onReplace:Fe,onCropEdit:Le,onOpenInDesign:Oe,onChoose:Ee,onCancel:Me,pickNote:Re,onDragOut:Ae,className:Pe=""}=O,Ue=A().mediaLibrary,Be=A().media,Ke="pick"===Q,He=!Ke,Je=P(null),Ve=R(Je,"phone"===_?343:1200),Ge="phone"===_||"auto"===_&&Ve<640,Ye=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const r of e){const e=[...a,r];n.set(r.id,{node:r,path:e}),r.children&&l(r.children,e)}};return l(e,[]),n}(ae),[ae]),Ze=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Xe=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Ze.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Ze]),Qe=B(e=>{const n=[];for(let l=e?Ze.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Ze.get(l.parentId):void 0);return n},[Ze,le.length]),$e=B((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[We,qe]=K(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=B(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;H(()=>{if("files"===ee.place)en(["@files",...Qe(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const an="products"===ee.place,rn="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=an&&ee.nodeId?Ye.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=v(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=P(!0);H(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");H(()=>{he&&mn.setSelection(he)},[gn]);const vn=P(gn??""),kn=pn.join("\0");H(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Ke?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=K(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Ze.get(n.id)?.name:un.get(n.id)?.name)&&Ce?.(n,e)},Nn=async e=>{if(!Ne)return;const n=await Ne(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Cn=B(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=Ze.get(e.id);return n===e.id||n&&$e(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:s,label:Ue.allFiles,disabledReason:l(null)});const a=(e,r)=>{for(const i of Xe.get(e)??[])n.push({key:i.id,label:i.name,depth:r,disabledReason:l(i.id)}),a(i.id,r+1)};return a(null,1),n},[Xe,Ze,tn,$e,on,Ue]),In=B(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=K(null),jn={words:Ue,media:Be,denied:ve,moveTargets:Cn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ne&&He?e=>{Nn(e)}:void 0,rename:Ce&&He?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&He?Ie:void 0,trash:De&&He?De:void 0,deleteFolder:Se&&He?Se:void 0,folderNotEmpty:e=>!!Ze.get(e)?.notEmpty,replace:Fe&&He?Fe:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Ue.urlLabel,n)},openInDesign:Oe,restore:je,deleteForever:ze},zn=e=>c(e,jn),Tn=w(),Fn=(e,n)=>{Ke||(mn.isSelected(e)||mn.select(e),Tn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return an?{kind:"render",id:e}:rn?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Ln,On]=K(null),[En,Mn]=K(null),[Rn,An]=K(null);H(()=>{if(!En&&!Ln)return;const e=()=>{Mn(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[En,Ln]);const Pn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Ke)&&(!!Pn(e,Y)||!(!Pn(e,Z)||!Rn)&&(n!==Rn&&!(n&&$e(n,Rn)))),Bn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Ln!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),On(null),Pn(e,Y)){let l;try{l=JSON.parse(e.dataTransfer.getData(Y))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else Rn&&(Ie({kind:"folder",id:Rn},n),An(null))}}),Kn=e=>{const n=e=>Pn(e,Y)||Pn(e,Z)||Pn(e,"Files");return{onDragEnter:l=>{n(l)&&Mn(e)},onDragOver:l=>{n(l)&&En!==e&&Mn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Mn(n=>n===e?null:n)}}},Hn=(e,n,l)=>/* @__PURE__ */G(E,{side:"right",content:En===e?Ue.noDropProducts:sn(l),open:En===e||!En&&void 0,children:/* @__PURE__ */G("span",{children:n})}),Jn=e=>({onContextMenu:n=>{Tn.open(n,e)}}),Vn=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=We.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
2
+ return J("div",{role:"none",className:"contents",children:[
3
+ /* @__PURE__ */G(n,{label:Hn(i,e.name,t),level:a,icon:d&&o?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:an&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Kn(i),...He?Jn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */G(l,{children:Vn(d,a+1,t)})]},e.id)}),Gn=(e,a)=>(Xe.get(e)??[]).map(e=>{const r=Xe.get(e.id),i=We.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=zn({kind:"folder",id:e.id});/* @__PURE__ */
4
+ return J("div",{role:"none",className:"contents",children:[
5
+ /* @__PURE__ */G(n,{label:e.name,level:a,icon:r&&i?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:Ln===e.id?"into":void 0,dragging:Rn===e.id,draggable:He&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */G(m,{value:e.name,label:Ue.folderName,onDone:xn}):void 0,actions:He&&o.length?/* @__PURE__ */G(I,{align:"end","aria-label":Ue.folderActions,trigger:W.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Bn(e.id,e.id),...He?Jn({kind:"folder",id:e.id}):{},...He&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(Z,e.id),An(e.id)},onDragEnd:()=>{An(null),On(null)}}:{}}}),r&&i&&/* @__PURE__ */G(l,{children:Gn(e.id,a+1)})]},e.id)}),Yn=We.has("@files"),Zn=We.has("@products"),Xn=/* @__PURE__ */J(e,{"aria-label":Ue.folders,children:[ae&&/* @__PURE__ */J(V,{children:[
6
+ /* @__PURE__ */G(n,{label:Hn("@products",Ue.products),level:1,icon:W.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:ae.length?Zn:void 0,onToggle:()=>_e("@products"),selected:an&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Kn("@products")}}),Zn&&ae.length>0&&/* @__PURE__ */G(l,{children:Vn(ae,2)})]}),
7
+ /* @__PURE__ */G(n,{label:Ue.allFiles,level:1,icon:Yn?W.folderOpen:W.folder,count:re,countLabel:null!=re?Ue.fileCount(re):void 0,expanded:Xe.get(null)?.length?Yn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===Ln?"into":void 0,rowProps:{"data-media-row":"@files",...Bn("@files",null)}}),Yn&&(Xe.get(null)?.length??0)>0&&/* @__PURE__ */G(l,{children:Gn(null,2)}),He&&/* @__PURE__ */G(n,{label:Ue.trash,level:1,icon:W.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:rn,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(rn)return[{label:Ue.trash}];if(an){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=Qe(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=an?Ue.readOnly:ve.upload,Wn=!!xe&&!rn&&!$n,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Wn,onAccept:e=>xe?.(e,on)}),_n=an?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[He&&Ne&&!rn&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.folderPlus,onClick:()=>{Nn(on)},...el(_n),children:Ue.newFolder}),xe&&!rn&&/* @__PURE__ */G(L,{variant:"primary",size:"sm",leftIcon:W.upload,onClick:()=>qn.open(),...el($n),children:Ue.upload}),He&&rn&&Te&&te.length>0&&/* @__PURE__ */G(L,{variant:"danger",size:"sm",onClick:Te,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,a,r)=>/* @__PURE__ */G("div",{style:{width:Ge?void 0:r,flex:Ge?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */G(p,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),al=e=>n=>ce?.({...se,[e]:n}),rl=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */G("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",type:"search",leftIcon:W.search,placeholder:an?Ue.searchProducts:Ue.search,"aria-label":an?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],al("type"),130),ce&&!an&&!rn&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],al("use"),130),ce&&He&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],al("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */G(g,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:W.grid},{value:"list",label:Ue.list,icon:W.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */G(F,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=He&&tn&&!!Ie&&!ve.move,dl=!!Ae&&!rn,sl=P(""),cl=P(null),ul=P(Ae);ul.current=Ae;const ml=B(()=>{cl.current?.(),cl.current=null,z(sl.current,!1)},[]),pl=B(()=>{ml();const e=Je.current?.ownerDocument;if(sl.current=T(Je.current),!e||!sl.current)return;const n=Je.current.closest("[data-modal-panel]"),l=e=>{n?.contains(e.target)||z(sl.current,!0)},a=()=>{cl.current&&(ml(),ul.current?.("cancelled"))},r=["dragend","drop"],i=["pointermove","pointerdown","mousemove","mousedown"];for(const n of r)e.addEventListener(n,ml,!0);for(const n of i)e.addEventListener(n,a,!0);e.addEventListener("dragover",l,!0),cl.current=()=>{for(const n of r)e.removeEventListener(n,ml,!0);for(const n of i)e.removeEventListener(n,a,!0);e.removeEventListener("dragover",l,!0)}},[ml]);H(()=>ml,[ml]);const hl=(e,n)=>{const l=un.get(n);l&&fl(l)&&("start"===e?pl():ml(),Ae(e))},fl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),gl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):fl(e),...ol&&fl(e)?{dragAlso:{[X]:fl(e)}}:{}})),vl=Ge?Math.max(72,Math.floor((Ve-24-16-1)/3)):112,kl=P(null),yl=k({containerRef:kl,enabled:He&&!Ge&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),bl=e=>{if(Ke){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Ee?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},wl=te.length?null:oe?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.noMatches}):an?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):rn?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.trashEmpty}):!Wn||Ke?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.emptyFolder}):null,xl="list"===me&&te.length>0,Nl=wl??(xl?/* @__PURE__ */G("ul",{role:"listbox","aria-multiselectable":He||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */J("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>bl(e.id),onContextMenu:n=>Fn(e.id,n),draggable:!!fl(e)||void 0,onDragStart:fl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(X,fl(e)),hl("start",e.id)}:void 0,onDragEnd:fl(e)?n=>hl("none"===n.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
8
+ /* @__PURE__ */G("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
9
+ /* @__PURE__ */G("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
10
+ /* @__PURE__ */G("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */G("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */G(h,{items:gl,readOnly:!Wn||Ke,onFiles:Wn&&!Ke?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:vl,dragType:ol?Y:dl?X:void 0,onDragOutChange:dl?(e,n)=>hl(e,n):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:bl,onItemContextMenu:He?Fn:void 0,menuOnMedia:He})),Cl=u({count:pn.length,kind:In(pn),targets:Cn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Il=M({variant:"secondary",size:"sm"}),Dl=/* @__PURE__ */G(I,{align:"start",triggerClassName:Il,trigger:/* @__PURE__ */J(V,{children:[W.folder,Ue.moveTo]}),items:Cl,disabled:!!ve.move}),Sl=He&&pn.length>1&&!an?/* @__PURE__ */J("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
11
+ /* @__PURE__ */G(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */J(V,rn?{children:[je&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.undo,onClick:()=>je(pn),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */G(L,{variant:"secondary-danger",size:"sm",onClick:()=>ze(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Dl,Ce&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
12
+ /* @__PURE__ */G(L,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,jl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,a?/* @__PURE__ */G(m,{value:e.name,label:Ue.fileName,onDone:xn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),an?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const r=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
13
+ return J("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
14
+ /* @__PURE__ */G("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),an&&/* @__PURE__ */G(N,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
15
+ /* @__PURE__ */G(t,{size:"sm",columns:1,items:n}),!rn&&/* @__PURE__ */J("div",{className:"flex gap-2",children:[
16
+ /* @__PURE__ */G("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
17
+ /* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.copy,onClick:()=>jn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&He&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[Fe&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.swap,onClick:()=>Fe(e.id),...el(ve.replace),children:Ue.replace}),Le&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.crop,onClick:()=>Le(e.id),children:Ue.cropEdit}),Ie&&"submenu"===r?.type&&/* @__PURE__ */G(I,{align:"start",triggerClassName:Il,trigger:/* @__PURE__ */J(V,{children:[W.folder,Ue.moveTo]}),items:r.items,disabled:!!ve.move}),Ce&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */G(D,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:W.trash})]}),rn&&He&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */G(L,{variant:"primary",size:"sm",leftIcon:W.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */G(L,{variant:"danger",size:"sm",onClick:()=>ze([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),an&&Oe&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */G(f,{items:ge})]})},zl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,Tl=Ke?/* @__PURE__ */J("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
18
+ /* @__PURE__ */G("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
19
+ /* @__PURE__ */J("div",{className:"flex gap-2",children:[Me&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",onClick:Me,children:Ue.cancel}),
20
+ /* @__PURE__ */G(L,{variant:"primary",size:"sm",disabled:!hn,...el(zl),onClick:()=>{hn&&!zl&&Ee?.(hn)},children:Ue.chooseImage})]})]}):null,Fl=He&&!!hn,Ll=/* @__PURE__ */J("div",{className:"flex min-w-0 flex-col gap-3",children:[Re&&/* @__PURE__ */G(N,{tone:"neutral",children:Re}),
21
+ /* @__PURE__ */J("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
22
+ /* @__PURE__ */G(d,{items:Qn}),nl]}),rl,Sl,
23
+ /* @__PURE__ */J("div",{ref:kl,className:"relative",onPointerDown:yl.onPointerDown,onKeyDown:e=>{He&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
24
+ /* @__PURE__ */G(a,{rect:yl.rect})]}),Wn&&/* @__PURE__ */G("input",{...qn.inputProps}),
25
+ /* @__PURE__ */G(j,{rejections:qn.rejections})]});/* @__PURE__ */
26
+ return J("div",{ref:Je,"data-media-library":"","data-layout":Ge?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Pe}`.trim(),children:[/* @__PURE__ */J("div",Ge?{className:"flex flex-col gap-3 p-3",children:[Xn,Ll]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
27
+ /* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Xn}),
28
+ /* @__PURE__ */G("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Ll}),Fl&&/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:jl(hn)})]}),Tl,Ge&&/* @__PURE__ */G(o,{open:Fl,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&jl(hn)}),Tn.state&&/* @__PURE__ */G(x,{...Tn.props,items:zn(Tn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */G(i,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{Y as MEDIA_FILES_DRAG_TYPE,X as MEDIA_FILE_DRAG_TYPE,Z as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,Q as readMediaFileDrag};
@@ -0,0 +1 @@
1
+ import{useEffect as t,useSyncExternalStore as e}from"react";var a=/* @__PURE__ */new Set,d=/* @__PURE__ */new Set;function n(t,e){t&&a.has(t)!==e&&(e?a.add(t):a.delete(t),d.forEach(t=>t()))}function r(t){return t?.closest("[data-modal-panel]")?.getAttribute("data-modal-id")??""}function o(r){return t(()=>()=>n(r,!1),[r]),e(t=>(d.add(t),()=>{d.delete(t)}),()=>a.has(r),()=>!1)}export{r as modalIdHolding,n as setModalDragAside,o as useModalDragAside};
@@ -1,4 +1,4 @@
1
- import{Avatar as e}from"./chunk-WESNFWM4.js";import{StatCard as a,Card as t}from"./chunk-CEIIQRK5.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-VP2GI3UP.js";import{ColumnChart as l}from"./chunk-GC4N4UQM.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-JMGDGNM7.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{TH_ONE_LINE as n}from"./chunk-G67CJAQ2.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
1
+ import{StatCard as e,Card as a}from"./chunk-CEIIQRK5.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-VP2GI3UP.js";import{Avatar as s}from"./chunk-LDVDNAXP.js";import{ColumnChart as l}from"./chunk-GC4N4UQM.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-JMGDGNM7.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{TH_ONE_LINE as n}from"./chunk-G67CJAQ2.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
2
2
  return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
3
3
  /* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */m("div",{children:[
@@ -8,24 +8,24 @@ return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow
8
8
  /* @__PURE__ */o(c,{variant:"secondary",size:"sm",children:"Export"}),
9
9
  /* @__PURE__ */o(c,{size:"sm",children:"New report"})]})]}),
10
10
  /* @__PURE__ */m("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
11
- /* @__PURE__ */o(a,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
12
- /* @__PURE__ */o(a,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
13
- /* @__PURE__ */o(a,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
14
- /* @__PURE__ */o(a,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
11
+ /* @__PURE__ */o(e,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
12
+ /* @__PURE__ */o(e,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
13
+ /* @__PURE__ */o(e,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
14
+ /* @__PURE__ */o(e,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
15
15
  /* @__PURE__ */m("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
16
- /* @__PURE__ */o(t,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */o(l,{labels:p,height:200,series:[{key:"revenue",label:"Revenue",data:h}],formatValue:e=>`$${e}k`})}),
17
- /* @__PURE__ */o(t,{header:"Traffic sources",children:/* @__PURE__ */o(s,{variant:"ring",size:180,segments:g,centerLabel:"100%"})})]}),
18
- /* @__PURE__ */o(t,{header:"Recent orders",padded:!1,children:/* @__PURE__ */m("table",{className:"w-full text-sm",children:[
16
+ /* @__PURE__ */o(a,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */o(l,{labels:p,height:200,series:[{key:"revenue",label:"Revenue",data:h}],formatValue:e=>`$${e}k`})}),
17
+ /* @__PURE__ */o(a,{header:"Traffic sources",children:/* @__PURE__ */o(r,{variant:"ring",size:180,segments:g,centerLabel:"100%"})})]}),
18
+ /* @__PURE__ */o(a,{header:"Recent orders",padded:!1,children:/* @__PURE__ */m("table",{className:"w-full text-sm",children:[
19
19
  /* @__PURE__ */o("thead",{children:/* @__PURE__ */m("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
20
20
  /* @__PURE__ */o("th",{className:`${n} px-4 py-2 font-medium`,children:"Order"}),
21
21
  /* @__PURE__ */o("th",{className:`${n} px-4 py-2 font-medium`,children:"Customer"}),
22
22
  /* @__PURE__ */o("th",{className:`${n} px-4 py-2 font-medium`,children:"Total"}),
23
23
  /* @__PURE__ */o("th",{className:`${n} px-4 py-2 font-medium`,children:"Status"})]})}),
24
- /* @__PURE__ */o("tbody",{className:"divide-y divide-gray-100",children:x.map(a=>/* @__PURE__ */m("tr",{className:"text-gray-700",children:[
25
- /* @__PURE__ */o("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:a.id}),
24
+ /* @__PURE__ */o("tbody",{className:"divide-y divide-gray-100",children:x.map(e=>/* @__PURE__ */m("tr",{className:"text-gray-700",children:[
25
+ /* @__PURE__ */o("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
26
26
  /* @__PURE__ */o("td",{className:"px-4 py-2",children:/* @__PURE__ */m("span",{className:"flex items-center gap-2",children:[
27
- /* @__PURE__ */o(e,{size:"xs",name:a.customer}),a.customer]})}),
28
- /* @__PURE__ */o("td",{className:"px-4 py-2",children:a.total}),
29
- /* @__PURE__ */o("td",{className:"px-4 py-2",children:/* @__PURE__ */o(d,{status:a.status})})]},a.id))})]})}),
27
+ /* @__PURE__ */o(s,{size:"xs",name:e.customer}),e.customer]})}),
28
+ /* @__PURE__ */o("td",{className:"px-4 py-2",children:e.total}),
29
+ /* @__PURE__ */o("td",{className:"px-4 py-2",children:/* @__PURE__ */o(d,{status:e.status})})]},e.id))})]})}),
30
30
  /* @__PURE__ */m("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
31
- /* @__PURE__ */o("span",{className:"text-emerald-600",children:/* @__PURE__ */o(r,{data:h,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}export{v as DashboardTemplate};
31
+ /* @__PURE__ */o("span",{className:"text-emerald-600",children:/* @__PURE__ */o(t,{data:h,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}export{v as DashboardTemplate};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-XQNZJNEJ.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-KZRZYLN7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-XQNZJNEJ.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-MDVABA4H.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function N({app:s}){const i=x[s],[h,N]=l(!1),v=m(()=>N(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,A]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-KZRZYLN7.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-7NYCPO54.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function N({app:s}){const i=x[s],[h,N]=l(!1),v=m(()=>N(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,Z]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>N(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>N(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{N as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),Z]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{N as AboutApp,x as BUILTIN_APP_INFO};