efficient-shell 4.155.1 → 4.156.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 (53) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-HNSQP7PK.js → Browser-UT55GS2Q.js} +14 -14
  3. package/dist/{Calculator-PWWTNCT7.js → Calculator-5DF4PSEG.js} +23 -23
  4. package/dist/ConfirmDialog-7Q2OOU4W.js +1 -0
  5. package/dist/{CurrencyConverter-OH4WAA74.js → CurrencyConverter-BEI6UUDD.js} +5 -5
  6. package/dist/{Documents-HG6NJCIB.js → Documents-CFKC6E56.js} +5 -5
  7. package/dist/{Files-22E36TVC.js → Files-A5PJMN3R.js} +82 -82
  8. package/dist/Notepad-LLYR2OFZ.js +25 -0
  9. package/dist/PdfViewer-VIT7Y55M.js +1 -0
  10. package/dist/{PomodoroTimer-BXJZKA4W.js → PomodoroTimer-3BDFGHC6.js} +26 -26
  11. package/dist/{Preview-6X5QAHHR.js → Preview-YH5VHR7Q.js} +6 -6
  12. package/dist/{Sidebar-44I3DD2U.js → Sidebar-H6R3AK5G.js} +24 -24
  13. package/dist/{Spreadsheet-K6QSHFVS.js → Spreadsheet-2ZQYF6H3.js} +14 -14
  14. package/dist/{Stock-HGSIZXAT.js → Stock-PEZB3WXV.js} +3 -3
  15. package/dist/{Weather-3VS65TQO.js → Weather-6EJFJQIX.js} +19 -19
  16. package/dist/{WorldClock-NI5OTEBV.js → WorldClock-5BMGEL2A.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-NSXQF4YC.js → chunk-26RS37FG.js} +1 -1
  20. package/dist/{chunk-RGFEKAPC.js → chunk-36QR65KW.js} +2 -2
  21. package/dist/{chunk-VGTI3BJ4.js → chunk-B2TBCVHH.js} +1 -1
  22. package/dist/{chunk-AC54EYVA.js → chunk-DRN636EP.js} +1 -1
  23. package/dist/{chunk-O35K6ZWH.js → chunk-ELCH5NDO.js} +3 -3
  24. package/dist/{chunk-4DT7B7GZ.js → chunk-FHIF6IUV.js} +1 -1
  25. package/dist/{chunk-ZVAQKPRB.js → chunk-HF4IZFFX.js} +11 -11
  26. package/dist/chunk-KAESEFKM.js +1 -0
  27. package/dist/{chunk-MXLPLKRG.js → chunk-KASHUEJV.js} +4 -4
  28. package/dist/{chunk-C47EJ4MB.js → chunk-KOUCDWJR.js} +1 -1
  29. package/dist/{chunk-JHXGBYJO.js → chunk-LGDG4YMF.js} +6 -6
  30. package/dist/{chunk-ZYUWLZUG.js → chunk-PDTZTADH.js} +15 -15
  31. package/dist/{chunk-V73HRX73.js → chunk-SYMCTL7Q.js} +471 -474
  32. package/dist/{chunk-ZTXFXS6V.js → chunk-T6MKFQRH.js} +6 -6
  33. package/dist/{chunk-TULPGC2I.js → chunk-UPI2GKKD.js} +9 -9
  34. package/dist/chunk-VVI77XNV.js +1 -0
  35. package/dist/{chunk-DRRIYS3R.js → chunk-XC64WV33.js} +60 -60
  36. package/dist/{chunk-ZP2V72LB.js → chunk-XN76YBX3.js} +8 -8
  37. package/dist/{chunk-JLSOLX5J.js → chunk-ZJ66QFOH.js} +1 -1
  38. package/dist/chunk-ZQMUHLYL.js +1 -0
  39. package/dist/file-intake/index.js +1 -1
  40. package/dist/{index-ak9Cps7c.d.ts → index-C-inEe7F.d.ts} +5 -43
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +645 -645
  43. package/dist/map/index.js +1 -1
  44. package/dist/page-tabs/index.js +5 -5
  45. package/dist/pdf/index.js +1 -1
  46. package/dist/ui/index.d.ts +1 -1
  47. package/dist/ui/index.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/ConfirmDialog-UVIZK7EY.js +0 -1
  50. package/dist/Notepad-YHSWKS4C.js +0 -25
  51. package/dist/PdfViewer-W65LHKXZ.js +0 -1
  52. package/dist/chunk-FEWQDVQJ.js +0 -1
  53. package/dist/chunk-YIXQGB75.js +0 -1
@@ -1,4 +1,4 @@
1
- import{useShellStrings as e}from"./chunk-FEWQDVQJ.js";import{Fragment as i}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";var n=/* @__PURE__ */t("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})}),l="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function s({items:s,separator:r,maxItems:c=0,className:m}){const o=e().breadcrumbs;if(0===s.length)return null;const h=r??n,d=[],u=s.length-1;if(c>0&&s.length>c&&c>=2){const e=Math.max(1,c-1);d.push({kind:"item",item:s[0],isLast:!1}),d.push({kind:"ellipsis"});for(let i=s.length-e;i<=u;i++)d.push({kind:"item",item:s[i],isLast:i===u})}else s.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
1
+ import{useShellStrings as e}from"./chunk-VVI77XNV.js";import{Fragment as i}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";var n=/* @__PURE__ */t("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})}),l="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function s({items:s,separator:r,maxItems:c=0,className:m}){const o=e().breadcrumbs;if(0===s.length)return null;const h=r??n,d=[],u=s.length-1;if(c>0&&s.length>c&&c>=2){const e=Math.max(1,c-1);d.push({kind:"item",item:s[0],isLast:!1}),d.push({kind:"ellipsis"});for(let i=s.length-e;i<=u;i++)d.push({kind:"item",item:s[i],isLast:i===u})}else s.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
2
  return t("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */t("ol",{className:"flex items-center gap-1.5 text-sm",children:d.map((e,n)=>/* @__PURE__ */a(i,{children:[n>0&&/* @__PURE__ */t("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
3
  /* @__PURE__ */t("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */t("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
4
  /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:l,children:[e.item.icon,
@@ -1,2 +1,2 @@
1
- import{toast_default as t}from"./chunk-VGTI3BJ4.js";import{useShellPrefs as e}from"./chunk-ZTXFXS6V.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),V()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&V())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function V(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var R="pomodoro_tasks",j="pomodoro_tasks_migrated";function J(){return Math.random().toString(36).slice(2,11)}function W(){/* @__PURE__ */
2
- return(new Date).toISOString()}var X=null,q=[],E=!1,L=null,Z=/* @__PURE__ */new Set;function $(){for(const t of Z)t()}function z(t){q=t,$()}function H(){const t=X;return t?L=t.list().then(e=>{X===t&&(q=e,E=!0,$())}).catch(()=>{X===t&&(E=!0,$())}).finally(()=>{L=null}):(q=[],E=!0,$(),Promise.resolve())}function K(t){X=t,q=[],E=!1,t?H():$()}function Q(t){return Z.add(t),!X||E||L||H(),()=>{Z.delete(t)}}function U(){return q}function Y(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=J(),n=W(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:W()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(Q,U,U),i=o(e=>{const n=X;if(!n)return t.addTask(e);const o="tmp-"+J(),a=W(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>z(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=X;if(!o)return t.updateTask(e,n);z(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:W()}:t)),o.update(e,n).catch(()=>{H()})},[t]),l=o(e=>{const n=X;if(!n)return t.removeTask(e);const o=q;z(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>z(o))},[t]),s=o(e=>{if(!X)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{X||t.setAllTasks(e)},[t]);return null===X?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(R);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(R),void localStorage.setItem(j,"1");const a=W(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||J(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(R),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,K as setShellTodoProvider,S as subscribePomo,Y as useTodoTasks};
1
+ import{toast_default as t}from"./chunk-B2TBCVHH.js";import{useShellPrefs as e}from"./chunk-T6MKFQRH.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function V(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",H="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function W(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var q=null,E=[],J=!1,K=null,L=/* @__PURE__ */new Set;function Q(){for(const t of L)t()}function $(t){E=t,Q()}function z(){const t=q;return t?K=t.list().then(e=>{q===t&&(E=e,J=!0,Q())}).catch(()=>{q===t&&(J=!0,Q())}).finally(()=>{K=null}):(E=[],J=!0,Q(),Promise.resolve())}function U(t){q=t,E=[],J=!1,t?z():Q()}function X(t){return L.add(t),!q||J||K||z(),()=>{L.delete(t)}}function Y(){return E}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=W(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:W()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(X,Y,Y),i=o(e=>{const n=q;if(!n)return t.addTask(e);const o="tmp-"+j(),a=W(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...E,r]),n.create({...e,name:e.name.trim()}).then(t=>$(E.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(E.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=q;if(!o)return t.updateTask(e,n);$(E.map(t=>t.id===e?{...t,...n,id:e,updatedAt:W()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=q;if(!n)return t.removeTask(e);const o=E;$(E.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!q)return t.toggleDone(e);const n=E.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{q||t.setAllTasks(e)},[t]);return null===q?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(H))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(H,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(H,"1");const a=W(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(H,"1")}catch{try{localStorage.setItem(H,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,V as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,U as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -1 +1 @@
1
- import{currentShellStrings as t}from"./chunk-FEWQDVQJ.js";var e="http://www.w3.org/2000/svg",n={},o=/* @__PURE__ */new Map;function s(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var r={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function i(t,n){const o=document.createElementNS(e,"svg");o.setAttribute("class",n),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(e,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",r[t]),o.appendChild(s),o}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function c(t,e,r){const c={...n,...r},l=c.placement??"top",d=c.sticky??!1,u=`${l}|${t}|${e}`;if(c.dedupe){const t=o.get(u);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==t&&!1!==c.sound&&import("./sounds-OMHXVVQ4.js").then(e=>{"success"===t?e.playSuccess():"error"===t?e.playError():e.playNotification()}).catch(()=>{});const m="bottom"===l?s("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none"):s("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none"),p="bottom"===l?"translateY(10px)":"translateY(-10px)",f=a("pointer-events-auto cursor-pointer rosh-toast");f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,f.setAttribute("role","error"===t?"alert":"status"),f.setAttribute("aria-atomic","true"),f.appendChild(i(t,`h-4 w-4 rosh-tone-${t}${"loading"===t?" animate-spin":""}`));const h=document.createElement("span");let y;h.textContent=e,f.appendChild(h),m.appendChild(f),requestAnimationFrame(()=>{f.style.opacity="1",f.style.transform="translateY(0) scale(1)"});let v=!1;const g=()=>{v||(v=!0,y&&clearTimeout(y),o.delete(u),f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,setTimeout(()=>f.remove(),300))},b=c.duration??("info"===t?4500:3e3),x=()=>{y&&clearTimeout(y),d||(y=setTimeout(g,b))};return x(),f.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),f.addEventListener("mouseleave",()=>{v||x()}),f.addEventListener("click",g),o.set(u,{el:f,restart:x,dismiss:g}),{dismiss:g}}var l={success:(t,e)=>c("success",t,e),error:(t,e)=>c("error",t,e),warning:(t,e)=>c("warning",t,e),info:(t,e)=>c("info",t,e),notify:(e,o)=>function(e,o){!1!==(o?.sound??n.sound)&&import("./sounds-OMHXVVQ4.js").then(t=>t.playNotification()).catch(()=>{});const r=s("notif-container","fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none"),c=a("pointer-events-auto cursor-pointer rosh-notif");c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)";const l=a("rosh-notif-badge");l.appendChild(i("bell","h-5 w-5"));const d=a("rosh-notif-body");d.append(a("rosh-notif-title",t().toast.notification),a("notif-msg rosh-notif-msg",e));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",c.append(l,d,u);const m=()=>{c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>c.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),c.addEventListener("click",m),r.appendChild(c),requestAnimationFrame(()=>{c.style.opacity="1",c.style.transform="translateX(0) scale(1)"}),setTimeout(m,o?.duration??1e4)}(e,o),promise:(t,e,n)=>{const o=c("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),c("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),c("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{n={...t}}};export{l as toast_default};
1
+ import{currentShellStrings as t}from"./chunk-VVI77XNV.js";var e="http://www.w3.org/2000/svg",n={},o=/* @__PURE__ */new Map;function s(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var r={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function i(t,n){const o=document.createElementNS(e,"svg");o.setAttribute("class",n),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(e,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",r[t]),o.appendChild(s),o}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function c(t,e,r){const c={...n,...r},l=c.placement??"top",d=c.sticky??!1,u=`${l}|${t}|${e}`;if(c.dedupe){const t=o.get(u);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==t&&!1!==c.sound&&import("./sounds-OMHXVVQ4.js").then(e=>{"success"===t?e.playSuccess():"error"===t?e.playError():e.playNotification()}).catch(()=>{});const m="bottom"===l?s("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none"):s("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none"),p="bottom"===l?"translateY(10px)":"translateY(-10px)",f=a("pointer-events-auto cursor-pointer rosh-toast");f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,f.setAttribute("role","error"===t?"alert":"status"),f.setAttribute("aria-atomic","true"),f.appendChild(i(t,`h-4 w-4 rosh-tone-${t}${"loading"===t?" animate-spin":""}`));const h=document.createElement("span");let y;h.textContent=e,f.appendChild(h),m.appendChild(f),requestAnimationFrame(()=>{f.style.opacity="1",f.style.transform="translateY(0) scale(1)"});let v=!1;const g=()=>{v||(v=!0,y&&clearTimeout(y),o.delete(u),f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,setTimeout(()=>f.remove(),300))},b=c.duration??("info"===t?4500:3e3),x=()=>{y&&clearTimeout(y),d||(y=setTimeout(g,b))};return x(),f.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),f.addEventListener("mouseleave",()=>{v||x()}),f.addEventListener("click",g),o.set(u,{el:f,restart:x,dismiss:g}),{dismiss:g}}var l={success:(t,e)=>c("success",t,e),error:(t,e)=>c("error",t,e),warning:(t,e)=>c("warning",t,e),info:(t,e)=>c("info",t,e),notify:(e,o)=>function(e,o){!1!==(o?.sound??n.sound)&&import("./sounds-OMHXVVQ4.js").then(t=>t.playNotification()).catch(()=>{});const r=s("notif-container","fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none"),c=a("pointer-events-auto cursor-pointer rosh-notif");c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)";const l=a("rosh-notif-badge");l.appendChild(i("bell","h-5 w-5"));const d=a("rosh-notif-body");d.append(a("rosh-notif-title",t().toast.notification),a("notif-msg rosh-notif-msg",e));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",c.append(l,d,u);const m=()=>{c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>c.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),c.addEventListener("click",m),r.appendChild(c),requestAnimationFrame(()=>{c.style.opacity="1",c.style.transform="translateX(0) scale(1)"}),setTimeout(m,o?.duration??1e4)}(e,o),promise:(t,e,n)=>{const o=c("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),c("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),c("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{n={...t}}};export{l as toast_default};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-DRRIYS3R.js";import{keepsNativeMenu as a}from"./chunk-J7LKJIZC.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-XC64WV33.js";import{keepsNativeMenu as a}from"./chunk-J7LKJIZC.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,12 +1,12 @@
1
- import{glassStyle as e}from"./chunk-J7LKJIZC.js";import{useDismissPopupsOnOpen as r,Z_LAYERS as t}from"./chunk-OSJ3ADF2.js";import{useShellStrings as a}from"./chunk-FEWQDVQJ.js";import{useState as n,useEffect as l,useRef as o,useCallback as s}from"react";import{jsx as i,jsxs as d}from"react/jsx-runtime";import{createPortal as c}from"react-dom";var m={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function h(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function p(e,r,t){return!1===e?"framed":null==e||null==r?"plate-light":r?"light"===t?"plate-dark":"bare":"dark"===t?"plate-light":"bare"}var u={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function g(e,r,t){return"bare"===e?{}:"framed"===e?{borderRadius:r}:{borderRadius:r,padding:t}}function x({src:e,fallbackSrc:r,fallbackHasAlpha:t=null,fallbackIsLight:a=null,fallbackAdaptive:o,alt:s,slot:d="compact",surface:c="light",size:x,width:b,height:f,decorative:y=!1,fallbackMode:v="monogram",adaptive:k=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:L=4,treatmentRadius:j=8,className:E="",style:C}){const[_,A]=n(e||r||"");l(()=>{A(e||r||"")},[e,r]);const D=Boolean(r&&_===r&&_!==e),$=(D?o??k:k)?p(D?t:w,D?a:N,c):"bare",K=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==x&&null==b&&null==f?m[d]:"","dark"===c?"text-white":"text-gray-700",u[$],E].filter(Boolean).join(" "),B={...g($,j,L),...null==x?{width:b,height:f}:{width:x,height:x},...C};return _?/* @__PURE__ */i("span",{className:K,"data-brand-treatment":$,style:B,children:/* @__PURE__ */i("img",{src:_,alt:y?"":s,"data-brand-slot":d,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>A(e=>r&&e!==r?r:"")})}):"none"===v?null:/* @__PURE__ */i("span",{"data-brand-fallback":!0,"data-brand-slot":d,"aria-label":y?void 0:s,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${K} rounded-md bg-gray-100 font-semibold`,style:B,children:y?null:h(s)})}var b="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z",f="react-os-shell:open-global-search";function y(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(f))}function v({providers:m,typeIcons:h,placeholder:p,onSelect:u}={}){const g=a().search,x=p??g.placeholder,[y,v]=n(!1),[k,w]=n(""),[N,L]=n([]),[j,E]=n(!1),[C,_]=n(0),A=o(null),D=o();l(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),v(e=>!e)),"Escape"===e.key&&y&&v(!1)},r=()=>v(!0);return window.addEventListener("keydown",e),window.addEventListener(f,r),()=>{window.removeEventListener("keydown",e),window.removeEventListener(f,r)}},[y]),r(y),l(()=>{y?setTimeout(()=>A.current?.focus(),50):(w(""),L([]))},[y]),l(()=>{if(D.current&&clearTimeout(D.current),k.length<2)L([]);else{if(m&&0!==m.length)return D.current=setTimeout(async()=>{E(!0);try{const e=await Promise.all(m.map(e=>e(k).catch(()=>[])));L(e.flat()),_(0)}catch{L([])}E(!1)},250),()=>{D.current&&clearTimeout(D.current)};L([])}},[k,m]);const $=s(e=>{v(!1),u?.(e)},[u]);return y?c(
1
+ import{glassStyle as e}from"./chunk-J7LKJIZC.js";import{useDismissPopupsOnOpen as r,Z_LAYERS as t}from"./chunk-OSJ3ADF2.js";import{useShellStrings as a}from"./chunk-VVI77XNV.js";import{useState as n,useEffect as l,useRef as o,useCallback as s}from"react";import{jsx as i,jsxs as d}from"react/jsx-runtime";import{createPortal as c}from"react-dom";var m={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function h(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function p(e,r,t){return!1===e?"framed":null==e||null==r?"plate-light":r?"light"===t?"plate-dark":"bare":"dark"===t?"plate-light":"bare"}var u={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function g(e,r,t){return"bare"===e?{}:"framed"===e?{borderRadius:r}:{borderRadius:r,padding:t}}function x({src:e,fallbackSrc:r,fallbackHasAlpha:t=null,fallbackIsLight:a=null,fallbackAdaptive:o,alt:s,slot:d="compact",surface:c="light",size:x,width:b,height:f,decorative:y=!1,fallbackMode:v="monogram",adaptive:k=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:L=4,treatmentRadius:j=8,className:C="",style:E}){const[_,A]=n(e||r||"");l(()=>{A(e||r||"")},[e,r]);const $=Boolean(r&&_===r&&_!==e),D=($?o??k:k)?p($?t:w,$?a:N,c):"bare",K=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==x&&null==b&&null==f?m[d]:"","dark"===c?"text-white":"text-gray-700",u[D],C].filter(Boolean).join(" "),B={...g(D,j,L),...null==x?{width:b,height:f}:{width:x,height:x},...E};return _?/* @__PURE__ */i("span",{className:K,"data-brand-treatment":D,style:B,children:/* @__PURE__ */i("img",{src:_,alt:y?"":s,"data-brand-slot":d,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>A(e=>r&&e!==r?r:"")})}):"none"===v?null:/* @__PURE__ */i("span",{"data-brand-fallback":!0,"data-brand-slot":d,"aria-label":y?void 0:s,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${K} rounded-md bg-gray-100 font-semibold`,style:B,children:y?null:h(s)})}var b="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z",f="react-os-shell:open-global-search";function y(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(f))}function v({providers:m,typeIcons:h,placeholder:p,onSelect:u}={}){const g=a().search,x=p??g.placeholder,[y,v]=n(!1),[k,w]=n(""),[N,L]=n([]),[j,C]=n(!1),[E,_]=n(0),A=o(null),$=o();l(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),v(e=>!e)),"Escape"===e.key&&y&&v(!1)},r=()=>v(!0);return window.addEventListener("keydown",e),window.addEventListener(f,r),()=>{window.removeEventListener("keydown",e),window.removeEventListener(f,r)}},[y]),r(y),l(()=>{y?setTimeout(()=>A.current?.focus(),50):(w(""),L([]))},[y]),l(()=>{if($.current&&clearTimeout($.current),k.length<2)L([]);else{if(m&&0!==m.length)return $.current=setTimeout(async()=>{C(!0);try{const e=await Promise.all(m.map(e=>e(k).catch(()=>[])));L(e.flat()),_(0)}catch{L([])}C(!1)},250),()=>{$.current&&clearTimeout($.current)};L([])}},[k,m]);const D=s(e=>{v(!1),u?.(e)},[u]);return y?c(
2
2
  /* @__PURE__ */d("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:t.overlay},onClick:()=>v(!1),children:[
3
3
  /* @__PURE__ */i("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
4
4
  /* @__PURE__ */d("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:e(),children:[
5
5
  /* @__PURE__ */d("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
6
6
  /* @__PURE__ */i("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */i("path",{strokeLinecap:"round",strokeLinejoin:"round",d:b})}),
7
- /* @__PURE__ */i("input",{ref:A,type:"text",value:k,onChange:e=>w(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),_(e=>Math.min(e+1,N.length-1))):"ArrowUp"===e.key?(e.preventDefault(),_(e=>Math.max(e-1,0))):"Enter"===e.key&&N[C]&&$(N[C])},placeholder:x,className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),
7
+ /* @__PURE__ */i("input",{ref:A,type:"text",value:k,onChange:e=>w(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),_(e=>Math.min(e+1,N.length-1))):"ArrowUp"===e.key?(e.preventDefault(),_(e=>Math.max(e-1,0))):"Enter"===e.key&&N[E]&&D(N[E])},placeholder:x,className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),
8
8
  /* @__PURE__ */i("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:g.escBadge})]}),
9
- /* @__PURE__ */d("div",{className:"max-h-[50vh] overflow-y-auto",children:[j&&/* @__PURE__ */i("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:g.searching}),!j&&k.length>=2&&0===N.length&&/* @__PURE__ */i("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:g.noResults}),!j&&N.length>0&&/* @__PURE__ */i("ul",{className:"py-2",children:N.map((e,r)=>/* @__PURE__ */i("li",{children:/* @__PURE__ */d("button",{className:"flex items-center gap-3 w-full px-4 py-2.5 text-left transition-colors "+(r===C?"bg-blue-50":"hover:bg-gray-50"),onClick:()=>$(e),onMouseEnter:()=>_(r),children:[
9
+ /* @__PURE__ */d("div",{className:"max-h-[50vh] overflow-y-auto",children:[j&&/* @__PURE__ */i("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:g.searching}),!j&&k.length>=2&&0===N.length&&/* @__PURE__ */i("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:g.noResults}),!j&&N.length>0&&/* @__PURE__ */i("ul",{className:"py-2",children:N.map((e,r)=>/* @__PURE__ */i("li",{children:/* @__PURE__ */d("button",{className:"flex items-center gap-3 w-full px-4 py-2.5 text-left transition-colors "+(r===E?"bg-blue-50":"hover:bg-gray-50"),onClick:()=>D(e),onMouseEnter:()=>_(r),children:[
10
10
  /* @__PURE__ */i("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */i("path",{strokeLinecap:"round",strokeLinejoin:"round",d:h?.[e.type]||b})}),
11
11
  /* @__PURE__ */d("div",{className:"flex-1 min-w-0",children:[
12
12
  /* @__PURE__ */i("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.label}),e.sub&&/* @__PURE__ */i("p",{className:"text-xs text-gray-400 truncate",children:e.sub})]}),
@@ -1 +1 @@
1
- import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-FEWQDVQJ.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c({onAccept:e,accept:a,maxSizeBytes:c,maxFiles:u,multiple:f=!0,currentCount:p=0,acceptHint:m,disabled:d=!1}){const h=t().files,g=r(null),[y,x]=n(!1),[v,D]=n([]),L=r(0),b="string"==typeof m?m:"",A=s(t=>{if(d||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of f?r:r.slice(0,1))o(e,a)?null!=c&&e.size>c?s.push({file:e,reason:"size",message:h.tooLarge(e.name,l(e.size,h),l(c,h))}):f&&null!=u&&p+n.length>=u?s.push({file:e,reason:"count",message:h.tooMany(e.name,u)}):n.push(e):s.push({file:e,reason:"type",message:h.notAccepted(e.name,b)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,b,c,u,p,e,h]),j=s(()=>{d||g.current?.click()},[d]),k=s(()=>D([]),[]);return{inputRef:g,inputProps:{ref:g,type:"file",accept:a||void 0,multiple:f,disabled:d,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,x(!1),A(e.dataTransfer.files))}},pasteProps:d?{}:{onPaste:e=>{const t=function(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:y,rejections:v,clearRejections:k}}function u({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{u as FileIntakeAlert,o as acceptsFile,l as humanSize,c as useFileIntake};
1
+ import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-VVI77XNV.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c({onAccept:e,accept:a,maxSizeBytes:c,maxFiles:u,multiple:f=!0,currentCount:p=0,acceptHint:m,disabled:d=!1}){const h=t().files,g=r(null),[y,x]=n(!1),[v,D]=n([]),L=r(0),b="string"==typeof m?m:"",A=s(t=>{if(d||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of f?r:r.slice(0,1))o(e,a)?null!=c&&e.size>c?s.push({file:e,reason:"size",message:h.tooLarge(e.name,l(e.size,h),l(c,h))}):f&&null!=u&&p+n.length>=u?s.push({file:e,reason:"count",message:h.tooMany(e.name,u)}):n.push(e):s.push({file:e,reason:"type",message:h.notAccepted(e.name,b)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,b,c,u,p,e,h]),j=s(()=>{d||g.current?.click()},[d]),k=s(()=>D([]),[]);return{inputRef:g,inputProps:{ref:g,type:"file",accept:a||void 0,multiple:f,disabled:d,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,x(!1),A(e.dataTransfer.files))}},pasteProps:d?{}:{onPaste:e=>{const t=function(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:y,rejections:v,clearRejections:k}}function u({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{u as FileIntakeAlert,o as acceptsFile,l as humanSize,c as useFileIntake};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-VGTI3BJ4.js";import{useShellStrings as t}from"./chunk-FEWQDVQJ.js";import{createContext as n,useContext as r,useRef as a,useState as o,useEffect as i}from"react";import*as s from"pdfjs-dist";import{createPortal as l}from"react-dom";import{jsx as c,jsxs as d}from"react/jsx-runtime";function u(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=n(null);function m({children:e}){const t=r(h);return t?l(e,t):
2
- /* @__PURE__ */c("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${s.version}/build/pdf.worker.min.mjs`);var p={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},f=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=p[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw u(n,t,a);return a}};function g(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:f}}var w=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function y({url:n,filename:r,fit:l="width",onDownload:u,onEmail:h,workerSrc:p,wasmUrl:f}){const y=t().pdf,b=a(null),x=a(null),k=a(null),[C,L]=o(null),[N,M]=o(1),[j,E]=o(0),[z,A]=o(1),[_,D]=o(!0),[P,W]=o(!0),S=a(y.loadFailed);S.current=y.loadFailed,i(()=>{let t=!1;return W(!0),M(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),W(!1))}).catch(()=>{t||(e.error(S.current),W(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!_||!k.current)return;const e=()=>{const e=k.current;e&&C.getPage(N).then(t=>{if(!k.current)return;const n=t.getViewport({scale:1}),r=v(l,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});A(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(k.current),()=>t.disconnect()},[C,N,_,l]),i(()=>{if(!C||!b.current)return;let e=!1,t=null,n=null;return C.getPage(N).then(r=>{if(e||!b.current)return;const a=r.getViewport({scale:z}),o=b.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const l=x.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new s.TextLayer({textContentSource:r.streamTextContent(),container:l,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",l.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[C,N,z]),i(()=>{const e=()=>x.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===l?y.fitPage:y.fitWidth,V="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-B2TBCVHH.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{createContext as n,useContext as r,useRef as a,useState as o,useEffect as i}from"react";import*as s from"pdfjs-dist";import{createPortal as l}from"react-dom";import{jsx as c,jsxs as d}from"react/jsx-runtime";function u(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=n(null);function m({children:e}){const t=r(h);return t?l(e,t):
2
+ /* @__PURE__ */c("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${s.version}/build/pdf.worker.min.mjs`);var p={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},f=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=p[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw u(n,t,a);return a}};function g(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:f}}var w=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function y({url:n,filename:r,fit:l="width",onDownload:u,onEmail:h,workerSrc:p,wasmUrl:f}){const y=t().pdf,b=a(null),x=a(null),k=a(null),[C,L]=o(null),[N,M]=o(1),[j,E]=o(0),[z,A]=o(1),[_,P]=o(!0),[V,D]=o(!0),W=a(y.loadFailed);W.current=y.loadFailed,i(()=>{let t=!1;return D(!0),M(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),D(!1))}).catch(()=>{t||(e.error(W.current),D(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!_||!k.current)return;const e=()=>{const e=k.current;e&&C.getPage(N).then(t=>{if(!k.current)return;const n=t.getViewport({scale:1}),r=v(l,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});A(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(k.current),()=>t.disconnect()},[C,N,_,l]),i(()=>{if(!C||!b.current)return;let e=!1,t=null,n=null;return C.getPage(N).then(r=>{if(e||!b.current)return;const a=r.getViewport({scale:z}),o=b.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const l=x.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new s.TextLayer({textContentSource:r.streamTextContent(),container:l,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",l.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[C,N,z]),i(()=>{const e=()=>x.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const H="page"===l?y.fitPage:y.fitWidth,S="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return d("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */d(m,{children:[
5
5
  /* @__PURE__ */c("button",{type:"button","aria-label":y.previousPage,onClick:()=>M(e=>Math.max(1,e-1)),disabled:N<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
6
6
  /* @__PURE__ */c("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(N,j)}),
7
7
  /* @__PURE__ */c("button",{type:"button","aria-label":y.nextPage,onClick:()=>M(e=>Math.min(j,e+1)),disabled:N>=j,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
8
8
  /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{D(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:V,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */d("select",{value:_?"fit":w.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(D(!1),A(Number(t)/100)):D(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":y.zoom,title:y.zoom,children:[
11
- /* @__PURE__ */c("option",{value:"fit",children:T}),!_&&!w.includes(Math.round(100*z))&&/* @__PURE__ */d("option",{value:"custom",children:[Math.round(100*z),"%"]}),w.map(e=>/* @__PURE__ */d("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{D(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:V,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */c("button",{type:"button",onClick:()=>D(!0),"aria-pressed":_,className:V+(_?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
9
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{P(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:S,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */d("select",{value:_?"fit":w.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(P(!1),A(Number(t)/100)):P(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":y.zoom,title:y.zoom,children:[
11
+ /* @__PURE__ */c("option",{value:"fit",children:H}),!_&&!w.includes(Math.round(100*z))&&/* @__PURE__ */d("option",{value:"custom",children:[Math.round(100*z),"%"]}),w.map(e=>/* @__PURE__ */d("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{P(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:S,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */c("button",{type:"button",onClick:()=>P(!0),"aria-pressed":_,className:S+(_?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
14
14
  /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */d("button",{type:"button",onClick:()=>{if(!C)return;const t=window.open("","_blank");if(!t)return void e.error(y.allowPopups);const n=[];for(let e=1;e<=j;e++)n.push(C.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=r,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:V,children:[
15
+ /* @__PURE__ */d("button",{type:"button",onClick:()=>{if(!C)return;const t=window.open("","_blank");if(!t)return void e.error(y.allowPopups);const n=[];for(let e=1;e<=j;e++)n.push(C.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=r,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:S,children:[
16
16
  /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0l.229 2.523a1.125 1.125 0 01-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0021 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 00-1.913-.247M6.34 18H5.25A2.25 2.25 0 013 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 011.913-.247m10.5 0a48.536 48.536 0 00-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5zm-3 0h.008v.008H15V10.5z"})}),y.print]}),
17
- /* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:V,children:[
18
- /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),y.download]}),h&&/* @__PURE__ */d("button",{type:"button",onClick:h,className:V,children:[
17
+ /* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:S,children:[
18
+ /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),y.download]}),h&&/* @__PURE__ */d("button",{type:"button",onClick:h,className:S,children:[
19
19
  /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})}),y.email]})]}),
20
- /* @__PURE__ */c("div",{ref:k,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!C)return;if(e.ctrlKey||e.metaKey)return;const t=k.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&N<j?(e.preventDefault(),M(e=>Math.min(j,e+1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=0)})):e.deltaY<0&&n&&N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)}))},onKeyDown:e=>{if(!C)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?N<j&&(e.preventDefault(),M(e=>Math.min(j,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(j)))},children:P?/* @__PURE__ */c("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:y.loading}):/* @__PURE__ */d("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */c("div",{ref:k,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!C)return;if(e.ctrlKey||e.metaKey)return;const t=k.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&N<j?(e.preventDefault(),M(e=>Math.min(j,e+1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=0)})):e.deltaY<0&&n&&N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)}))},onKeyDown:e=>{if(!C)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?N<j&&(e.preventDefault(),M(e=>Math.min(j,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(j)))},children:V?/* @__PURE__ */c("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:y.loading}):/* @__PURE__ */d("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */c("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */d("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */c("canvas",{ref:b,className:"block rounded"}),
@@ -0,0 +1 @@
1
+ import{client_default as a}from"./chunk-XC64WV33.js";var e=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),t="uploaded:wallpaper";function r(a,e){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===t?e||"":a}var p=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=e=>{const t=new FormData;return t.append("wallpaper",e),a.post("/auth/me/wallpaper/",t).then(a=>a.data)},l=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function s(a){const e=a?.response?.status,t=a?.response?.data,r=Array.isArray(t?.wallpaper)?t.wallpaper[0]:void 0;return r||(413===e?"That picture is too large to use as a wallpaper.":415===e?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{t as WALLPAPER_PREF_TOKEN,l as deleteWallpaper,e as getNumberingConfigs,p as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,s as wallpaperUploadError};
@@ -1,4 +1,4 @@
1
- import{useBrowserState as e}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-FEWQDVQJ.js";import{useRef as t,useCallback as o,useEffect as n}from"react";import{jsxs as i,jsx as l,Fragment as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(Math.max(e,r),t);function d({sidebar:d,sidebarTop:c,sidebarBottom:u,children:m,side:h="left",storageKey:v,defaultWidth:w=256,minWidth:f=180,maxWidth:p=480,className:b="",sidebarClassName:y=("right"===h?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:g="bg-white"}){const N="right"===h,x=r().sidebar,[z,E]=e(()=>{if(v){let e=null;try{e=window.localStorage.getItem(v)}catch{}const r=e?parseInt(e,10):NaN;if(!Number.isNaN(r))return a(r,f,p)}return a(w,f,p)},a(w,f,p)),k=t(null),L=o(e=>{const r=k.current;if(!r)return;const t=(e.clientX-r.startX)*(N?-1:1);E(a(r.startWidth+t,f,p))},[f,p,N]),W=o(()=>{k.current=null,window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",W),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[L]),$=o(e=>{e.preventDefault(),k.current={startX:e.clientX,startWidth:z},window.addEventListener("pointermove",L),window.addEventListener("pointerup",W),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[z,L,W]);n(()=>{if(!v)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(v,String(Math.round(z)))}catch{}},200);return()=>window.clearTimeout(e)},[z,v]),n(()=>()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",W)},[L,W]);const D=N?"left-0":"right-0",S=null!=c||null!=u,T=/* @__PURE__ */i("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:z},children:[
2
- /* @__PURE__ */i("div",{className:`flex h-full flex-col ${S?"overflow-hidden":"overflow-y-auto"} ${y}`,children:[null!=c&&/* @__PURE__ */l("div",{className:"shrink-0 px-2 pt-3 pb-2",children:c}),S?/* @__PURE__ */l("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d}):d,null!=u&&/* @__PURE__ */l("div",{className:"mt-auto shrink-0 border-t border-gray-200 px-2 py-3",children:u})]}),
3
- /* @__PURE__ */l("div",{onPointerDown:$,onDoubleClick:()=>E(a(w,f,p)),title:x.resize,className:`group/resize absolute inset-y-0 ${D} z-10 w-2 cursor-col-resize`,children:/* @__PURE__ */l("div",{className:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})]}),X=/* @__PURE__ */l("div",{className:`flex min-w-0 flex-1 flex-col ${g}`,children:m});/* @__PURE__ */
4
- return l("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */i(s,N?{children:[X,T]}:{children:[T,X]})})}export{d as SidebarLayout};
1
+ import{useShellStrings as e}from"./chunk-VVI77XNV.js";import{useBrowserState as r}from"./chunk-D65T4H6J.js";import{useRef as t,useCallback as o,useEffect as n}from"react";import{jsxs as i,jsx as l,Fragment as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(Math.max(e,r),t);function d({sidebar:d,sidebarTop:c,sidebarBottom:u,children:m,side:h="left",storageKey:v,defaultWidth:w=256,minWidth:f=180,maxWidth:p=480,className:b="",sidebarClassName:y=("right"===h?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:g="bg-white"}){const N="right"===h,x=e().sidebar,[z,k]=r(()=>{if(v){let e=null;try{e=window.localStorage.getItem(v)}catch{}const r=e?parseInt(e,10):NaN;if(!Number.isNaN(r))return a(r,f,p)}return a(w,f,p)},a(w,f,p)),E=t(null),L=o(e=>{const r=E.current;if(!r)return;const t=(e.clientX-r.startX)*(N?-1:1);k(a(r.startWidth+t,f,p))},[f,p,N]),$=o(()=>{E.current=null,window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",$),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[L]),W=o(e=>{e.preventDefault(),E.current={startX:e.clientX,startWidth:z},window.addEventListener("pointermove",L),window.addEventListener("pointerup",$),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[z,L,$]);n(()=>{if(!v)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(v,String(Math.round(z)))}catch{}},200);return()=>window.clearTimeout(e)},[z,v]),n(()=>()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",$)},[L,$]);const X=N?"left-0":"right-0",D=null!=c||null!=u,I=/* @__PURE__ */i("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:z},children:[
2
+ /* @__PURE__ */i("div",{className:`flex h-full flex-col ${D?"overflow-hidden":"overflow-y-auto"} ${y}`,children:[null!=c&&/* @__PURE__ */l("div",{className:"shrink-0 px-2 pt-3 pb-2",children:c}),D?/* @__PURE__ */l("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d}):d,null!=u&&/* @__PURE__ */l("div",{className:"mt-auto shrink-0 border-t border-gray-200 px-2 py-3",children:u})]}),
3
+ /* @__PURE__ */l("div",{onPointerDown:W,onDoubleClick:()=>k(a(w,f,p)),title:x.resize,className:`group/resize absolute inset-y-0 ${X} z-10 w-2 cursor-col-resize`,children:/* @__PURE__ */l("div",{className:`absolute inset-y-0 ${X} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})]}),S=/* @__PURE__ */l("div",{className:`flex min-w-0 flex-1 flex-col ${g}`,children:m});/* @__PURE__ */
4
+ return l("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */i(s,N?{children:[S,I]}:{children:[I,S]})})}export{d as SidebarLayout};
@@ -1,4 +1,4 @@
1
- import{VERSION as e}from"./chunk-YIXQGB75.js";import{useWindowMenuItem as t,Modal as r}from"./chunk-DRRIYS3R.js";import{navIcons as o}from"./chunk-6UXY7MPY.js";import{useState as n,useCallback as s,isValidElement as i,cloneElement as a}from"react";import{jsx as l,jsxs as d}from"react/jsx-runtime";var c={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:"Multi-sheet spreadsheet editor with CSV / TSV import and export."},notepad:{name:"Notepad",version:"1.0.0",route:"/notepad",description:"Color-coded notes with checklists, desktop stickies and entity autolinking."},documents:{name:"Documents",version:"1.1.0",route:"/documents",description:"Letter-page editor for Word documents and plain-text files — images, lists, alignment."},preview:{name:"Preview",version:"1.4.1",route:"/preview",description:"Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar."},files:{name:"Files",version:"1.1.0",route:"/files",description:"Personal file manager with folders, uploads, quota, trash and desktop shortcut folders."},browser:{name:"Browser",version:"1.0.1",route:"/browser",description:"Minimal web browser with bookmarks, history and navigation bar."}},m=/* @__PURE__ */l("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})}),p=/* @__PURE__ */l("svg",{className:"h-9 w-9",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})});function h({app:h}){const u=c[h],[x,f]=n(!1),g=s(()=>f(!0),[]);if(t(`About ${u.name}`,g,m),!x)return null;const v=o[u.route],w=i(v)?a(v,{className:"h-9 w-9"}):p;/* @__PURE__ */
1
+ import{VERSION as e}from"./chunk-ZQMUHLYL.js";import{useWindowMenuItem as t,Modal as r}from"./chunk-XC64WV33.js";import{navIcons as o}from"./chunk-6UXY7MPY.js";import{useState as n,useCallback as s,isValidElement as i,cloneElement as a}from"react";import{jsx as l,jsxs as d}from"react/jsx-runtime";var c={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:"Multi-sheet spreadsheet editor with CSV / TSV import and export."},notepad:{name:"Notepad",version:"1.0.0",route:"/notepad",description:"Color-coded notes with checklists, desktop stickies and entity autolinking."},documents:{name:"Documents",version:"1.1.0",route:"/documents",description:"Letter-page editor for Word documents and plain-text files — images, lists, alignment."},preview:{name:"Preview",version:"1.4.1",route:"/preview",description:"Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar."},files:{name:"Files",version:"1.1.0",route:"/files",description:"Personal file manager with folders, uploads, quota, trash and desktop shortcut folders."},browser:{name:"Browser",version:"1.0.1",route:"/browser",description:"Minimal web browser with bookmarks, history and navigation bar."}},m=/* @__PURE__ */l("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})}),p=/* @__PURE__ */l("svg",{className:"h-9 w-9",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})});function h({app:h}){const u=c[h],[x,f]=n(!1),g=s(()=>f(!0),[]);if(t(`About ${u.name}`,g,m),!x)return null;const v=o[u.route],w=i(v)?a(v,{className:"h-9 w-9"}):p;/* @__PURE__ */
2
2
  return l(r,{open:!0,onClose:()=>f(!1),title:`About ${u.name}`,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */d("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */l("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:w}),
4
4
  /* @__PURE__ */l("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:u.name}),
@@ -1,5 +1,5 @@
1
- import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-J7LKJIZC.js";import{useShellStrings as t}from"./chunk-FEWQDVQJ.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
- return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},D=N?m.find(e=>e.key===N.key):void 0,I=D?m.indexOf(D):-1,L=e=>e.some(e=>!e.pinned),A=e=>()=>{C(null),e()};/* @__PURE__ */
1
+ import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-J7LKJIZC.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
+ return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},I=N?m.find(e=>e.key===N.key):void 0,D=I?m.indexOf(I):-1,L=e=>e.some(e=>!e.pinned),A=e=>()=>{C(null),e()};/* @__PURE__ */
3
3
  return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
4
4
  /* @__PURE__ */s("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
5
5
  /* @__PURE__ */s("div",{role:"tablist","aria-label":x,onKeyDown:e=>{const r=m.findIndex(r=>document.getElementById(h(r.key,"tab"))===e.target);if(!(r<0)){if("ArrowRight"===e.key)z(r+1);else if("ArrowLeft"===e.key)z(r-1);else if("Home"===e.key)z(0);else if("End"===e.key)z(m.length-1);else{if("Delete"!==e.key||m[r].pinned)return;f(m[r].key)}e.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:m.map((e,r)=>{const n=e.key===u,t=!!e.dirty,l=e.icon,i=n?k??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",g=r>0&&!n&&m[r-1].key!==u,x={type:"button",role:"tab",id:h(e.key,"tab"),"aria-selected":n,"aria-controls":y?.(e.key)?h(e.key,"panel"):void 0,tabIndex:e.key===j?0:-1,title:e.title,onClick:()=>p(e.key)},b={onContextMenu:r=>((e,r)=>{e.preventDefault(),C({x:e.clientX,y:e.clientY,key:r.key})})(r,e),onAuxClick:r=>((e,r)=>{1!==e.button||r.pinned||(e.preventDefault(),f(r.key))})(r,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=l&&
@@ -10,9 +10,9 @@ return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gra
10
10
  /* @__PURE__ */o("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pl-3 pr-1 text-left ${d} ${n?"@max-[5rem]:pl-2.5":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-1.5"}`,children:[v,
11
11
  /* @__PURE__ */s("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(l?n?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:e.title})]}),
12
12
  /* @__PURE__ */o("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(n?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[t&&/* @__PURE__ */s("span",{role:"img","aria-label":w.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
13
- /* @__PURE__ */s("button",{type:"button",tabIndex:-1,"aria-label":w.closeTab?.(e.title)??`${w.close} ${e.title}`,onClick:()=>f(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(t?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */s(c,{})})]})]})]},e.key)})}),v&&/* @__PURE__ */s("div",{className:"flex shrink-0 items-center gap-2 self-center",children:v}),N&&D&&/* @__PURE__ */o(e,{portal:!0,style:{left:N.x,top:N.y},onClose:()=>C(null),children:[
14
- /* @__PURE__ */s(r,{disabled:D.pinned,onClick:A(()=>f(D.key)),children:w.close}),
13
+ /* @__PURE__ */s("button",{type:"button",tabIndex:-1,"aria-label":w.closeTab?.(e.title)??`${w.close} ${e.title}`,onClick:()=>f(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(t?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */s(c,{})})]})]})]},e.key)})}),v&&/* @__PURE__ */s("div",{className:"flex shrink-0 items-center gap-2 self-center",children:v}),N&&I&&/* @__PURE__ */o(e,{portal:!0,style:{left:N.x,top:N.y},onClose:()=>C(null),children:[
14
+ /* @__PURE__ */s(r,{disabled:I.pinned,onClick:A(()=>f(I.key)),children:w.close}),
15
15
  /* @__PURE__ */s(n,{}),
16
- /* @__PURE__ */s(r,{disabled:!L(m.filter(e=>e.key!==D.key)),onClick:A(()=>g("others",D.key)),children:w.closeOthers}),
17
- /* @__PURE__ */s(r,{disabled:!L(m.slice(I+1)),onClick:A(()=>g("right",D.key)),children:w.closeRight}),
16
+ /* @__PURE__ */s(r,{disabled:!L(m.filter(e=>e.key!==I.key)),onClick:A(()=>g("others",I.key)),children:w.closeOthers}),
17
+ /* @__PURE__ */s(r,{disabled:!L(m.slice(D+1)),onClick:A(()=>g("right",I.key)),children:w.closeRight}),
18
18
  /* @__PURE__ */s(r,{disabled:!L(m),onClick:A(()=>g("all",null)),children:w.closeAll})]})]})}export{m as TabStrip};
@@ -1,20 +1,20 @@
1
- import{useDismissPopupsOnOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-OSJ3ADF2.js";import{useShellStrings as r,splitAround as o}from"./chunk-FEWQDVQJ.js";import{createContext as l,useEffect as i,useRef as a,useId as s,useContext as c,useState as d,useCallback as u}from"react";import{jsxs as m,jsx as f,Fragment as h}from"react/jsx-runtime";var b=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function g(e){return Array.from(e.querySelectorAll(b)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var p=[];function v(e){const t=p.findIndex(t=>t!==e&&e.contains(t));-1===t?p.push(e):p.splice(t,0,e)}function x(e){const t=p.lastIndexOf(e);-1!==t&&p.splice(t,1)}var y=/* @__PURE__ */new WeakSet;function w(e){return g(e)}function N(e,t){i(()=>{if(!t)return;const n=e.current;return n?(y.add(n),v(n),()=>{x(n),y.delete(n)}):void 0},[e,t])}function k(e,t){const n=p.lastIndexOf(t),r=n>0?p[n-1]:-1===n?p[p.length-1]??null:null,o=g(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!y.has(r)?o[0]??null:null)}function C(e,t,n){i(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??g(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(p[p.length-1]!==r)return;const t=g(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return v(r),document.addEventListener("keydown",i,!0),()=>{x(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var L=0,E=null;function P(e){i(()=>{if(!e)return;const t=document.body;if(0===L){E={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return L+=1,()=>{0===(L-=1)&&E&&(t.style.overflow=E.overflow,t.style.paddingRight=E.paddingRight,E=null)}},[e])}var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function D({open:o,onClose:l,title:c,description:d,role:u="dialog",children:h,footer:b,blocking:g=!1,size:p="md",initialFocus:v,"aria-label":x,"aria-labelledby":y,"aria-describedby":w,className:N=""}){const k=a(null),L=s(),E=s(),D=!g&&!b,F=s(),W=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0))},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
1
+ import{useDismissPopupsOnOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-OSJ3ADF2.js";import{useShellStrings as r,splitAround as o}from"./chunk-VVI77XNV.js";import{createContext as l,useEffect as i,useRef as a,useId as s,useContext as c,useState as d,useCallback as u}from"react";import{jsxs as m,jsx as f,Fragment as h}from"react/jsx-runtime";var b=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function g(e){return Array.from(e.querySelectorAll(b)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var p=[];function v(e){const t=p.findIndex(t=>t!==e&&e.contains(t));-1===t?p.push(e):p.splice(t,0,e)}function x(e){const t=p.lastIndexOf(e);-1!==t&&p.splice(t,1)}var y=/* @__PURE__ */new WeakSet;function w(e){return g(e)}function N(e,t){i(()=>{if(!t)return;const n=e.current;return n?(y.add(n),v(n),()=>{x(n),y.delete(n)}):void 0},[e,t])}function k(e,t){const n=p.lastIndexOf(t),r=n>0?p[n-1]:-1===n?p[p.length-1]??null:null,o=g(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!y.has(r)?o[0]??null:null)}function C(e,t,n){i(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??g(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(p[p.length-1]!==r)return;const t=g(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return v(r),document.addEventListener("keydown",i,!0),()=>{x(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var L=0,E=null;function P(e){i(()=>{if(!e)return;const t=document.body;if(0===L){E={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return L+=1,()=>{0===(L-=1)&&E&&(t.style.overflow=E.overflow,t.style.paddingRight=E.paddingRight,E=null)}},[e])}var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function D({open:o,onClose:l,title:c,description:d,role:u="dialog",children:h,footer:b,blocking:g=!1,size:p="md",initialFocus:v,"aria-label":x,"aria-labelledby":y,"aria-describedby":w,className:N=""}){const k=a(null),L=s(),E=s(),D=!g&&!b,F=s(),I=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0))},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
2
2
  /* @__PURE__ */f("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?F:y,"aria-label":c||y?void 0:x,"aria-describedby":w??(d?E:h?L:void 0),className:`relative max-h-full w-full ${j[p]} overflow-y-auto overscroll-contain rounded-lg bg-white p-6 shadow-xl ${N}`.trim(),children:[c&&/* @__PURE__ */f("h2",{id:F,className:(D?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":D?"pr-8":"")+" text-sm text-gray-500").trim(),children:d}),h&&/* @__PURE__ */f("div",{id:L,className:"mt-2 text-sm text-gray-600",children:h}),b&&/* @__PURE__ */f("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:b}),D&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":W.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var F=l(()=>Promise.resolve(!1)),W=()=>c(F),O=()=>Promise.resolve(!1),T=e=>O(e),I=()=>Promise.resolve(!1),M=e=>I(e),$=()=>Promise.resolve(null),A=e=>$(e),R={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},z="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function K(){/* @__PURE__ */
3
+ /* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?F:y,"aria-label":c||y?void 0:x,"aria-describedby":w??(d?E:h?L:void 0),className:`relative max-h-full w-full ${j[p]} overflow-y-auto overscroll-contain rounded-lg bg-white p-6 shadow-xl ${N}`.trim(),children:[c&&/* @__PURE__ */f("h2",{id:F,className:(D?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":D?"pr-8":"")+" text-sm text-gray-500").trim(),children:d}),h&&/* @__PURE__ */f("div",{id:L,className:"mt-2 text-sm text-gray-600",children:h}),b&&/* @__PURE__ */f("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:b}),D&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":I.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var F=l(()=>Promise.resolve(!1)),I=()=>c(F),O=()=>Promise.resolve(!1),T=e=>O(e),W=()=>Promise.resolve(!1),M=e=>W(e),$=()=>Promise.resolve(null),A=e=>$(e),R={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},z="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function K(){/* @__PURE__ */
4
4
  return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}function S(){/* @__PURE__ */
5
- return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function B({children:e}){const[t,n]=d(!1),[l,s]=d({message:""}),[c,b]=d(0),g=a(),p=a(null),v=a(0),x=a([]),y=a(null),w=a(null),N=u(e=>{p.current=e.id,g.current=e.resolve,b(e.id),s(e.options),n(!0)},[]),k=u(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):x.current.push(n)})},[N]),[C,L]=d(!1),[E,P]=d({message:""}),[j,W]=d(""),T=a(),M=u(e=>(P(e),W(""),L(!0),new Promise(e=>{T.current=e})),[]),[A,B]=d(!1),[J,Q]=d({}),[V,_]=d(""),q=a(),G=u(e=>{const t="string"==typeof e?{message:e}:e;return Q(t),_(t.defaultValue??""),B(!0),new Promise(e=>{q.current=e})},[]);i(()=>{O=k,I=M,$=G},[k,M,G]);const H=(e,t)=>{if(p.current!==e)return;const r=g.current,o=x.current.shift();o?N(o):(p.current=null,g.current=void 0,n(!1)),r?.(t)},U=e=>{L(!1),W(""),T.current?.(e)},X=e=>{if(e){const e=V.trim();if(!e&&!J.allowEmpty)return B(!1),void q.current?.(null);B(!1),q.current?.(e)}else B(!1),q.current?.(null)},Y=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Z=R[Y],ee=R["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=r().dialog,[oe,le]=o(re.typeToConfirm);/* @__PURE__ */
5
+ return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function V({children:e}){const[t,n]=d(!1),[l,s]=d({message:""}),[c,b]=d(0),g=a(),p=a(null),v=a(0),x=a([]),y=a(null),w=a(null),N=u(e=>{p.current=e.id,g.current=e.resolve,b(e.id),s(e.options),n(!0)},[]),k=u(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):x.current.push(n)})},[N]),[C,L]=d(!1),[E,P]=d({message:""}),[j,I]=d(""),T=a(),M=u(e=>(P(e),I(""),L(!0),new Promise(e=>{T.current=e})),[]),[A,V]=d(!1),[B,_]=d({}),[q,G]=d(""),H=a(),J=u(e=>{const t="string"==typeof e?{message:e}:e;return _(t),G(t.defaultValue??""),V(!0),new Promise(e=>{H.current=e})},[]);i(()=>{O=k,W=M,$=J},[k,M,J]);const U=(e,t)=>{if(p.current!==e)return;const r=g.current,o=x.current.shift();o?N(o):(p.current=null,g.current=void 0,n(!1)),r?.(t)},X=e=>{L(!1),I(""),T.current?.(e)},Q=e=>{if(e){const e=q.trim();if(!e&&!B.allowEmpty)return V(!1),void H.current?.(null);V(!1),H.current?.(e)}else V(!1),H.current?.(null)},Y=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Z=R[Y],ee=R["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=r().dialog,[oe,le]=o(re.typeToConfirm);/* @__PURE__ */
6
6
  return m(F.Provider,{value:k,children:[e,
7
- /* @__PURE__ */f(D,{open:t,onClose:()=>H(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
8
- /* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>H(c,!1),className:z,children:l.cancelLabel||re.cancel}),
9
- /* @__PURE__ */f("button",{type:"button",onClick:()=>H(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Z.button}`,children:l.confirmLabel||re.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
7
+ /* @__PURE__ */f(D,{open:t,onClose:()=>U(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
8
+ /* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>U(c,!1),className:z,children:l.cancelLabel||re.cancel}),
9
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>U(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Z.button}`,children:l.confirmLabel||re.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
10
10
  /* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${Z.icon}`,children:/* @__PURE__ */f(K,{})}),
11
11
  /* @__PURE__ */m("div",{className:"flex-1",children:[
12
12
  /* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900",children:l.title||re.confirmTitle}),
13
13
  /* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:l.message})]})]})}),
14
- /* @__PURE__ */m(D,{open:C,onClose:()=>U(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
15
- /* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>U(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
16
- /* @__PURE__ */f("button",{type:"button",onClick:()=>U(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
17
- /* @__PURE__ */f("button",{type:"button",onClick:()=>U(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */f(S,{})}),
14
+ /* @__PURE__ */m(D,{open:C,onClose:()=>X(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
15
+ /* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>X(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
16
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>X(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
17
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>X(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */f(S,{})}),
18
18
  /* @__PURE__ */m("div",{className:"flex gap-4",children:[
19
19
  /* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */f(K,{})}),
20
20
  /* @__PURE__ */m("div",{className:"flex-1",children:[
@@ -22,8 +22,8 @@ return m(F.Provider,{value:k,children:[e,
22
22
  /* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */m(h,{children:[
23
23
  /* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
24
24
  /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),le]}),
25
- /* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>W(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&U(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
26
- /* @__PURE__ */m(D,{open:A,onClose:()=>X(!1),title:J.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
27
- /* @__PURE__ */f("button",{type:"button",onClick:()=>X(!1),className:z,children:J.cancelLabel||re.cancel}),
28
- /* @__PURE__ */f("button",{type:"button",onClick:()=>X(!0),disabled:!J.allowEmpty&&!V.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:J.confirmLabel||re.ok})]}),children:[J.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:J.message}),
29
- /* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:V,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key?X(!0):"Escape"===e.key&&X(!1)},onFocus:e=>e.target.select(),placeholder:J.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{B as ConfirmProvider,D as Dialog,T as confirm,M as confirmDestructive,w as focusableIn,A as prompt,k as stopAfter,W as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};
25
+ /* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&X(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
26
+ /* @__PURE__ */m(D,{open:A,onClose:()=>Q(!1),title:B.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
27
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!1),className:z,children:B.cancelLabel||re.cancel}),
28
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!0),disabled:!B.allowEmpty&&!q.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:B.confirmLabel||re.ok})]}),children:[B.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:B.message}),
29
+ /* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:q,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?Q(!0):"Escape"===e.key&&Q(!1)},onFocus:e=>e.target.select(),placeholder:B.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{V as ConfirmProvider,D as Dialog,T as confirm,M as confirmDestructive,w as focusableIn,A as prompt,k as stopAfter,I as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};