efficient-shell 13.7.0 → 13.10.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 (73) hide show
  1. package/README.md +4 -2
  2. package/dist/{Browser-RDE3RBBK.js → Browser-RQMICFVJ.js} +14 -14
  3. package/dist/Files-MJBEQENM.js +141 -0
  4. package/dist/{Notepad-CFK5MJDE.js → Notepad-KE3Q7TEM.js} +8 -8
  5. package/dist/PomodoroTimer-2MFWO3KK.js +91 -0
  6. package/dist/{Preview-CBYMPKY2.js → Preview-J54KUTIR.js} +13 -13
  7. package/dist/Weather-377NKPA5.js +60 -0
  8. package/dist/WorldClock-M6AMXQY2.js +32 -0
  9. package/dist/ai/index.js +30 -30
  10. package/dist/apps/index.d.ts +7 -2
  11. package/dist/apps/index.js +1 -1
  12. package/dist/bin/browser-check.js +1 -1
  13. package/dist/bin/media-host-check.js +1 -1
  14. package/dist/bin/ui-check.js +1 -1
  15. package/dist/charts/SpecChart.js +1 -1
  16. package/dist/{chunk-GXVWI3U5.js → chunk-5CFERCYW.js} +1 -1
  17. package/dist/chunk-7APOZZ72.js +1 -0
  18. package/dist/{chunk-PDIGCTZD.js → chunk-BKZOTBDP.js} +19 -19
  19. package/dist/{chunk-4EFIUJ7X.js → chunk-CUNYWXUT.js} +1 -1
  20. package/dist/{chunk-ZJZHUPUH.js → chunk-F3G7S5HO.js} +23 -23
  21. package/dist/{chunk-4C7YUXDI.js → chunk-H7CIK74N.js} +10 -10
  22. package/dist/{chunk-AOZZ2LEL.js → chunk-HQSJSPQB.js} +1 -1
  23. package/dist/chunk-HYHZEQMG.js +1 -0
  24. package/dist/{chunk-RI5QSLX3.js → chunk-IOZSLFGR.js} +1 -1
  25. package/dist/chunk-KGRJSTPM.js +13 -0
  26. package/dist/{chunk-H22D2PYM.js → chunk-LOFFHXZ4.js} +9 -9
  27. package/dist/chunk-NHKT5IH6.js +1 -0
  28. package/dist/{chunk-E6PDAYBR.js → chunk-O5UD3ZWM.js} +4 -4
  29. package/dist/chunk-OAKXWYZD.js +2 -0
  30. package/dist/{chunk-S6UJKSF3.js → chunk-OJI4ROSD.js} +1 -1
  31. package/dist/{chunk-767USLF5.js → chunk-R3R6ZJNW.js} +6 -6
  32. package/dist/{chunk-3MIIXPV6.js → chunk-SC3AQXJY.js} +8 -8
  33. package/dist/{chunk-UD2C3PJE.js → chunk-VKRJVHYA.js} +1 -1
  34. package/dist/chunk-YJGA4LPG.js +2 -0
  35. package/dist/{chunk-ENCZRE3H.js → chunk-Z62HFEFS.js} +7 -7
  36. package/dist/{chunk-SQ4ZFG2B.js → chunk-ZAL72BPF.js} +1 -1
  37. package/dist/{chunk-77HMTXDR.js → chunk-ZJ34FNRC.js} +1 -1
  38. package/dist/data/Gantt.js +1 -1
  39. package/dist/format/index.d.ts +1 -1
  40. package/dist/format/index.js +1 -1
  41. package/dist/forms/BrandAssetEditor.js +1 -1
  42. package/dist/forms/Calendar.js +1 -1
  43. package/dist/forms/DatePicker.js +1 -1
  44. package/dist/forms/DateRangePicker.js +1 -1
  45. package/dist/forms/MediaLibrary.js +1 -1
  46. package/dist/icons/index.js +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +665 -665
  49. package/dist/shell/LanguageSelect.js +1 -1
  50. package/dist/shell/MilestoneTimeline.js +1 -1
  51. package/dist/shell/ProductionTimeline.js +1 -1
  52. package/dist/shell/SettingRow.js +1 -1
  53. package/dist/shell/TimeAgo.js +1 -1
  54. package/dist/shell/TimelineTrack.js +1 -1
  55. package/dist/shell/timelineDates.js +1 -1
  56. package/dist/telemetry/index.js +1 -1
  57. package/dist/ui/index.d.ts +1 -1
  58. package/dist/ui/index.js +1 -1
  59. package/dist/utils/date.d.ts +44 -5
  60. package/dist/utils/date.js +1 -1
  61. package/dist/utils/format.js +1 -1
  62. package/dist/version.js +1 -1
  63. package/package.json +1 -1
  64. package/dist/Files-SPICA5IO.js +0 -141
  65. package/dist/PomodoroTimer-57XARJRF.js +0 -91
  66. package/dist/Weather-Y4TMYOQB.js +0 -60
  67. package/dist/WorldClock-FY3UCIAW.js +0 -32
  68. package/dist/chunk-COHFFGFE.js +0 -2
  69. package/dist/chunk-FBDZGO3V.js +0 -1
  70. package/dist/chunk-I3MSKHJD.js +0 -2
  71. package/dist/chunk-WBAWJIVM.js +0 -13
  72. package/dist/chunk-XNGQHEGB.js +0 -1
  73. package/dist/chunk-ZPJTLNKU.js +0 -1
@@ -1,91 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-XOZ5VPXF.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,migratePomodoroTasksOnce as u,pomoSwitchMode as d,pomoPause as m,pomoStart as h,ALARM_OPTIONS as p,playAlarm as g,FOCUS_SOUND_OPTIONS as k,previewFocusSound as f}from"./chunk-COHFFGFE.js";import{PLACEHOLDER_INK as b}from"./chunk-AYZY3YNC.js";import{pad2 as x}from"./chunk-LF27WIN2.js";import{useWidgetSettings as v}from"./chunk-H4LUHKUJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DASRJ26L.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-GHLXZDLU.js";import"./chunk-KV6XCHAG.js";import"./chunk-B447IHIL.js";import"./chunk-EIFNESXS.js";import"./chunk-PR6FNBKR.js";import"./chunk-RIG5FEVS.js";import"./chunk-NDWX5Z4D.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-ZGIAMYTI.js";import"./chunk-5LHEPE4B.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as y}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as N}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TMSSR5UH.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-DEJIH3ZQ.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as C,useEffect as S,useMemo as w,useState as j,useRef as B,useCallback as M}from"react";import{jsxs as T,Fragment as I,jsx as P}from"react/jsx-runtime";var D="pomodoro_appearance",A="pomodoro_active_task_id",L={focus:"Pomodoro",short:"Short Break",long:"Long Break"},V={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var R=25,F=5,$=15,E=!1,W=!1,G=4,H=!0,U=!0,J="bell",O=100,Z=1,X="none",K=50,Q=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function Y(){const t=C(o,a,a),{prefs:g,save:f}=y(),b=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:Q(t.focusMinutes,1,120,R),shortBreakMinutes:Q(t.shortBreakMinutes,1,120,F),longBreakMinutes:Q(t.longBreakMinutes,1,120,$),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:E,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:W,longBreakInterval:Q(t.longBreakInterval,1,20,G),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:H,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:U,alarmSound:p.some(e=>e.id===t.alarmSound)?t.alarmSound:J,alarmVolume:Q(t.alarmVolume,0,100,O),alarmRepeat:Q(t.alarmRepeat,1,5,Z),focusSound:k.some(e=>e.id===t.focusSound)?t.focusSound:X,focusVolume:Q(t.focusVolume,0,100,K)}}(g.pomodoro_settings);S(()=>{n({focus:60*b.focusMinutes,short:60*b.shortBreakMinutes,long:60*b.longBreakMinutes})},[b.focusMinutes,b.shortBreakMinutes,b.longBreakMinutes]),S(()=>{r(b.alarmSound),s(b.alarmVolume,b.alarmRepeat)},[b.alarmSound,b.alarmVolume,b.alarmRepeat]),S(()=>{i({autoStartBreaks:b.autoStartBreaks,autoStartPomodoros:b.autoStartPomodoros,longBreakInterval:b.longBreakInterval})},[b.autoStartBreaks,b.autoStartPomodoros,b.longBreakInterval]),S(()=>{l(b.focusSound,b.focusVolume)},[b.focusSound,b.focusVolume]),S(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const Y=c(),z=Y.tasks,q=w(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),ee=function(e,t){return w(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(w(()=>z.filter(e=>!!e.dueDate&&(e.dueDate===q||e.dueDate<q&&!e.done)),[z,q]),b.checkToBottom),[te,oe]=j(()=>localStorage.getItem(A)),[ae,ne]=j(!1),[re,se]=j(null),ie=B(!1);S(()=>{ie.current||(ie.current=!0,u(z,Y.setAllTasks))},[]),S(()=>{try{te?localStorage.setItem(A,te):localStorage.removeItem(A)}catch{}},[te]),S(()=>{if(!re)return;const e=()=>se(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[re]);const le=B(t.streak);S(()=>{if(t.streak>le.current&&te){const e=z.find(e=>e.id===te);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=b.autoCheckTasks&&o>0&&t>=o;Y.updateTask(te,{completed:t,done:e.done||a})}}le.current=t.streak},[t.streak,te,b.autoCheckTasks,z,Y]);const ue=ee.reduce((e,t)=>e+(t.completed??0),0),de=ee.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),me=ee.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),he=t.running&&"focus"===t.mode?t.remaining:0,pe=me*b.focusMinutes*60+he,ge=new Date(Date.now()+1e3*pe).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ke=(pe/3600).toFixed(1),fe=te?z.find(e=>e.id===te)??null:null,be=x(Math.floor(t.remaining/60)),xe=x(t.remaining%60),[ve,ye]=j(()=>e(D)),[Ne,Ce]=j(!1),[Se,we]=j(ve),[je,Be]=j(b);v(M(()=>{we({...ve}),Be({...b}),Ce(!0)},[ve,b]));const Me="focus"!==t.mode,Te=V[t.mode],Ie=Me?(Pe=Te,De=ve.activeOpacity/100,`rgba(${parseInt(Pe.slice(1,3),16)}, ${parseInt(Pe.slice(3,5),16)}, ${parseInt(Pe.slice(5,7),16)}, ${De})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${ve.activeOpacity/100})`;var Pe,De;const Ae={primary:Me?"text-white":"text-gray-900",secondary:Me?"text-white/85":"text-gray-700",muted:Me?"text-white/65":"text-gray-500",tabActive:Me?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Me?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Me?"border-white/30":"border-gray-200",softDivider:Me?"border-white/20":"border-gray-200",iconBtn:Me?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Me?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Le=Me?Te:"#0f172a";/* @__PURE__ */
2
- return T(I,{children:[
3
- /* @__PURE__ */T("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Ae.primary}`,style:{backgroundColor:Ie,backdropFilter:ve.activeBlur>0?`blur(${ve.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */P("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */P("button",{onClick:()=>d(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Ae.tabActive:Ae.tabInactive}`,children:L[e]},e))}),
5
- /* @__PURE__ */T("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[be,":",xe]}),
6
- /* @__PURE__ */P("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */P("button",{onClick:()=>t.running?m():h(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:Le,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
7
- /* @__PURE__ */P("div",{className:"px-3 py-3 text-center",children:fe?/* @__PURE__ */T(I,{children:[
8
- /* @__PURE__ */T("div",{className:`text-xs leading-tight ${Ae.muted}`,children:["#",(fe.completed??0)+1]}),
9
- /* @__PURE__ */P("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Ae.primary}`,children:fe.name})]}):/* @__PURE__ */P("div",{className:`text-xs italic ${Ae.muted}`,children:"No task selected"})}),
10
- /* @__PURE__ */T("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
11
- /* @__PURE__ */P("h3",{className:`text-base font-bold tracking-tight ${Ae.primary}`,children:"Tasks"}),
12
- /* @__PURE__ */P("button",{className:`rounded p-1 transition-colors ${Ae.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */P(N,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
13
- /* @__PURE__ */P("div",{className:`border-t mx-3 mt-2 ${Ae.divider}`}),
14
- /* @__PURE__ */T("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[ee.map(e=>{const t=e.id===te;/* @__PURE__ */
15
- return T("div",{onClick:()=>oe(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
16
- /* @__PURE__ */P("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,Y.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */P("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Le},children:/* @__PURE__ */P("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */P("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */P("circle",{cx:"12",cy:"12",r:"10"})})}),
17
- /* @__PURE__ */P("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
18
- /* @__PURE__ */T("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
19
- /* @__PURE__ */P("span",{className:"font-bold text-gray-500",children:e.completed??0}),
20
- /* @__PURE__ */P("span",{className:"text-gray-400",children:" / "}),
21
- /* @__PURE__ */P("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
22
- /* @__PURE__ */T("div",{className:"relative",children:[
23
- /* @__PURE__ */P("button",{onClick:t=>{t.stopPropagation(),se(re===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */P(N,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),re===e.id&&/* @__PURE__ */P("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */P("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,Y.removeTask(o),te===o&&oe(null),se(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ae?/* @__PURE__ */P(ce,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=Y.addTask({name:o,estimated:t,completed:0,dueDate:q});te||oe(a),ne(!1)},onCancel:()=>ne(!1),accentColor:Le}):/* @__PURE__ */T("button",{onClick:()=>ne(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Ae.addTaskBtn}`,children:[
24
- /* @__PURE__ */P(N,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
25
- /* @__PURE__ */T("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Ae.softDivider}`,children:[
26
- /* @__PURE__ */T("span",{className:Ae.secondary,children:["Pomos: ",
27
- /* @__PURE__ */P("span",{className:`font-bold ${Ae.primary}`,children:ue}),
28
- /* @__PURE__ */P("span",{className:Ae.muted,children:" / "}),
29
- /* @__PURE__ */P("span",{className:`font-bold ${Ae.primary}`,children:de})]}),pe>0&&/* @__PURE__ */T("span",{className:Ae.secondary,children:["Finish At: ",
30
- /* @__PURE__ */P("span",{className:`font-bold ${Ae.primary}`,children:ge}),
31
- /* @__PURE__ */T("span",{className:Ae.muted,children:[" (",ke,"h)"]})]})]})]}),
32
- /* @__PURE__ */P(_,{open:Ne,onClose:()=>Ce(!1),onSave:()=>{ye(Se),localStorage.setItem(D,JSON.stringify(Se)),f({pomodoro_settings:je}),Ce(!1)},configAppearance:Se,setConfigAppearance:we,configPrefs:je,setConfigPrefs:Be})]})}function _({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
33
- return T(t,{open:e,onClose:o,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:a,children:[
34
- /* @__PURE__ */T(z,{icon:/* @__PURE__ */P(se,{}),label:"TIMER",children:[
35
- /* @__PURE__ */T("div",{children:[
36
- /* @__PURE__ */P("p",{className:"text-sm font-bold text-gray-800 mb-2",children:"Time (minutes)"}),
37
- /* @__PURE__ */T("div",{className:"grid grid-cols-3 gap-3",children:[
38
- /* @__PURE__ */P(te,{label:"Pomodoro",value:s.focusMinutes,onChange:e=>l("focusMinutes",e),max:120}),
39
- /* @__PURE__ */P(te,{label:"Short Break",value:s.shortBreakMinutes,onChange:e=>l("shortBreakMinutes",e),max:120}),
40
- /* @__PURE__ */P(te,{label:"Long Break",value:s.longBreakMinutes,onChange:e=>l("longBreakMinutes",e),max:120})]})]}),
41
- /* @__PURE__ */P(q,{label:"Auto Start Breaks",children:/* @__PURE__ */P(ne,{checked:s.autoStartBreaks,onChange:e=>l("autoStartBreaks",e)})}),
42
- /* @__PURE__ */P(q,{label:"Auto Start Pomodoros",children:/* @__PURE__ */P(ne,{checked:s.autoStartPomodoros,onChange:e=>l("autoStartPomodoros",e)})}),
43
- /* @__PURE__ */P(q,{label:"Long Break interval",children:/* @__PURE__ */P(oe,{value:s.longBreakInterval,onChange:e=>l("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
44
- /* @__PURE__ */T(z,{icon:/* @__PURE__ */P(ie,{}),label:"TASK",children:[
45
- /* @__PURE__ */P(q,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */P(ne,{checked:s.autoCheckTasks,onChange:e=>l("autoCheckTasks",e)})}),
46
- /* @__PURE__ */P(q,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */P(ne,{checked:s.checkToBottom,onChange:e=>l("checkToBottom",e)})})]}),
47
- /* @__PURE__ */T(z,{icon:/* @__PURE__ */P(le,{}),label:"SOUND",children:[
48
- /* @__PURE__ */P(q,{label:"Alarm Sound",children:/* @__PURE__ */T("div",{className:"flex items-center gap-2",children:[
49
- /* @__PURE__ */P(ae,{value:s.alarmSound,onChange:e=>l("alarmSound",e),options:p.map(e=>({id:e.id,label:e.label}))}),"off"!==s.alarmSound&&/* @__PURE__ */P("button",{type:"button",onClick:()=>g(s.alarmSound,{volume:s.alarmVolume,repeat:1}),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
50
- /* @__PURE__ */P(ee,{value:s.alarmVolume,onChange:e=>l("alarmVolume",e)}),
51
- /* @__PURE__ */P(q,{label:"repeat",children:/* @__PURE__ */P(oe,{value:s.alarmRepeat,onChange:e=>l("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
52
- /* @__PURE__ */P(q,{label:"Focus Sound",children:/* @__PURE__ */T("div",{className:"flex items-center gap-2",children:[
53
- /* @__PURE__ */P(ae,{value:s.focusSound,onChange:e=>l("focusSound",e),options:k}),"none"!==s.focusSound&&/* @__PURE__ */P("button",{type:"button",onClick:()=>f(s.focusSound,s.focusVolume),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
54
- /* @__PURE__ */P(ee,{value:s.focusVolume,onChange:e=>l("focusVolume",e)})]})]})}function z({icon:e,label:t,children:o}){/* @__PURE__ */
55
- return T("div",{className:"border-t border-gray-200 pt-3 first:border-0 first:pt-0",children:[
56
- /* @__PURE__ */T("div",{className:"flex items-center gap-2 mb-3 text-ink-faintest",children:[e,
57
- /* @__PURE__ */P("span",{className:"text-xs font-bold tracking-[0.15em]",children:t})]}),
58
- /* @__PURE__ */P("div",{className:"space-y-3",children:o})]})}function q({label:e,info:t,children:o}){/* @__PURE__ */
59
- return T("div",{className:"flex items-center justify-between gap-3",children:[
60
- /* @__PURE__ */T("div",{className:"flex items-center gap-2 min-w-0",children:[
61
- /* @__PURE__ */P("span",{className:"text-sm font-semibold text-gray-800",children:e}),t&&/* @__PURE__ */P(re,{title:t})]}),
62
- /* @__PURE__ */P("div",{className:"shrink-0",children:o})]})}function ee({value:e,onChange:t}){/* @__PURE__ */
63
- return T("div",{className:"flex items-center justify-end gap-3",children:[
64
- /* @__PURE__ */P("span",{className:"text-xs text-gray-400 w-7 text-right tabular-nums",children:e}),
65
- /* @__PURE__ */P("input",{type:"range",min:0,max:100,value:e,onChange:e=>t(parseInt(e.target.value,10)),className:"w-40 accent-blue-500"})]})}function te({label:e,value:t,onChange:o,min:a=1,max:n=99}){/* @__PURE__ */
66
- return T("label",{className:"flex flex-col",children:[
67
- /* @__PURE__ */P("span",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),
68
- /* @__PURE__ */P(oe,{value:t,onChange:o,min:a,max:n})]})}function oe({value:e,onChange:t,min:o=1,max:a=99,className:n=""}){/* @__PURE__ */
69
- return P("input",{type:"number",min:o,max:a,value:e,onChange:e=>t(Math.max(o,Math.min(a,parseInt(e.target.value,10)||o))),className:`bg-gray-100 border-0 rounded-md px-2 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 w-full ${n}`})}function ae({value:e,onChange:t,options:o}){/* @__PURE__ */
70
- return T("div",{className:"relative",children:[
71
- /* @__PURE__ */P("select",{value:e,onChange:e=>t(e.target.value),className:"appearance-none bg-gray-100 border-0 rounded-md pl-3 pr-8 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer",children:o.map(e=>/* @__PURE__ */P("option",{value:e.id,children:e.label},e.id))}),
72
- /* @__PURE__ */P(N,{name:"chevron-down",className:`absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 pointer-events-none ${b}`,strokeWidth:2.5})]})}function ne({checked:e,onChange:t}){/* @__PURE__ */
73
- return P("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e?"bg-emerald-500":"bg-gray-300"),children:/* @__PURE__ */P("span",{className:"absolute h-5 w-5 rounded-full bg-white shadow transition-transform "+(e?"translate-x-[22px]":"translate-x-0.5")})})}function re({title:e}){/* @__PURE__ */
74
- return P("span",{title:e,className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-gray-300 text-on-accent text-3xs font-bold cursor-help",children:"i"})}function se(){/* @__PURE__ */
75
- return T("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
76
- /* @__PURE__ */P("circle",{cx:"12",cy:"12",r:"9"}),
77
- /* @__PURE__ */P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7v5l3 2"})]})}function ie(){/* @__PURE__ */
78
- return T("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
79
- /* @__PURE__ */P("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),
80
- /* @__PURE__ */P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})}function le(){/* @__PURE__ */
81
- return T("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
82
- /* @__PURE__ */P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5L6 9H2v6h4l5 4V5z"}),
83
- /* @__PURE__ */P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function ce({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=j(""),[r,s]=j(1),i=()=>e(a,r);/* @__PURE__ */
84
- return T("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--elevation-panel)",children:[
85
- /* @__PURE__ */P("input",{autoFocus:!0,value:a,onChange:e=>n(e.target.value),placeholder:"What are you working on?",onKeyDown:e=>{"Enter"===e.key&&i(),"Escape"===e.key&&t()},className:"w-full text-base font-medium bg-transparent border-0 outline-none placeholder-gray-400"}),
86
- /* @__PURE__ */T("div",{className:"flex items-center justify-between mt-2",children:[
87
- /* @__PURE__ */P("span",{className:"text-xs font-semibold text-gray-500",children:"Est Pomodoros"}),
88
- /* @__PURE__ */P("input",{type:"number",min:1,max:20,value:r,onChange:e=>s(Math.max(1,Math.min(20,parseInt(e.target.value,10)||1))),className:"w-16 bg-gray-100 rounded px-2 py-1 text-sm text-right border-0 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),
89
- /* @__PURE__ */T("div",{className:"flex gap-2 mt-3 justify-end",children:[
90
- /* @__PURE__ */P("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
91
- /* @__PURE__ */P("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{Y as default};
@@ -1,60 +0,0 @@
1
- import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-XOZ5VPXF.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{useWidgetSettings as o}from"./chunk-H4LUHKUJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DASRJ26L.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-GHLXZDLU.js";import"./chunk-KV6XCHAG.js";import"./chunk-B447IHIL.js";import"./chunk-EIFNESXS.js";import"./chunk-PR6FNBKR.js";import"./chunk-RIG5FEVS.js";import"./chunk-NDWX5Z4D.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-ZGIAMYTI.js";import"./chunk-5LHEPE4B.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as l}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-DEJIH3ZQ.js";import"./chunk-C3QOHMR6.js";import{useState as d,useEffect as m,useCallback as h}from"react";import{jsx as p,jsxs as u,Fragment as f}from"react/jsx-runtime";var y="weather_city",g="weather_appearance",x={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function b(){const e="undefined"!=typeof localStorage?localStorage.getItem(y):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(y,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var w=r;function k(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${s(a)}:${s(r)}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${s(n)} ${i}`}catch{return""}}function v(){/* @__PURE__ */
2
- return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
3
- /* @__PURE__ */p("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */p("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */p("rect",{x:49,y:3,width:2,height:14,rx:1,fill:"rgba(255, 232, 130, 0.55)",transform:`rotate(${30*t} 50 50)`},t))})}),
4
- /* @__PURE__ */p("div",{className:"absolute top-1 right-1 w-10 h-10 rounded-full",style:{background:"radial-gradient(circle at 35% 35%, #fff8cc 0%, #ffd84a 55%, #ff9e2a 100%)",boxShadow:"0 0 18px 5px rgba(255, 200, 80, 0.55)",animation:"wx-sun-pulse 4.5s ease-in-out infinite"}})]})}function N(){const e=Array.from({length:16}).map((e,t)=>({left:(53*t+11)%95+"%",top:(37*t+9)%78+"%",size:1+13*t%3,delay:.41*t%4+"s",duration:2.5+7*t%5*.6+"s"}));/* @__PURE__ */
5
- return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
6
- /* @__PURE__ */p("div",{className:"absolute top-1 right-1",children:/* @__PURE__ */u("svg",{viewBox:"0 0 40 40",className:"w-9 h-9",style:{filter:"drop-shadow(0 0 6px rgba(255,250,220,0.4))"},children:[
7
- /* @__PURE__ */p("defs",{children:/* @__PURE__ */u("radialGradient",{id:"wx-moon-grad",cx:"35%",cy:"35%",children:[
8
- /* @__PURE__ */p("stop",{offset:"0",stopColor:"#fffae0"}),
9
- /* @__PURE__ */p("stop",{offset:"1",stopColor:"#d4c98a"})]})}),
10
- /* @__PURE__ */p("circle",{cx:20,cy:20,r:13,fill:"url(#wx-moon-grad)"}),
11
- /* @__PURE__ */p("circle",{cx:26,cy:16,r:11,fill:"rgba(15,23,42,1)"})]})}),e.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:e.top,width:e.size,height:e.size,animation:`wx-twinkle ${e.duration} ease-in-out ${e.delay} infinite`}},t)),
12
- /* @__PURE__ */p("div",{className:"absolute",style:{left:"15%",top:"20%",animation:"wx-shooting-star 12s ease-out infinite"},children:/* @__PURE__ */p("div",{className:"w-12 h-px",style:{background:"linear-gradient(to right, transparent, rgba(255,255,255,0.95))",boxShadow:"0 0 4px rgba(255,255,255,0.8)"}})})]})}function j({tone:e="light"}){const t="light"===e?"rgba(255,255,255,0.78)":"rgba(220,228,240,0.45)",a=({scale:e=1})=>/* @__PURE__ */u("svg",{viewBox:"0 0 120 50",className:"w-32 h-12",style:{transform:`scale(${e})`,filter:"blur(0.6px)"},children:[
13
- /* @__PURE__ */p("ellipse",{cx:28,cy:36,rx:18,ry:11,fill:t}),
14
- /* @__PURE__ */p("ellipse",{cx:50,cy:28,rx:22,ry:15,fill:t}),
15
- /* @__PURE__ */p("ellipse",{cx:75,cy:32,rx:20,ry:12,fill:t}),
16
- /* @__PURE__ */p("ellipse",{cx:95,cy:38,rx:15,ry:9,fill:t})]});/* @__PURE__ */
17
- return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
18
- /* @__PURE__ */p("div",{className:"absolute",style:{top:"8%",animation:"wx-drift-cloud 42s linear infinite"},children:/* @__PURE__ */p(a,{scale:.9})}),
19
- /* @__PURE__ */p("div",{className:"absolute",style:{top:"40%",animation:"wx-drift-cloud 60s linear -22s infinite",opacity:.85},children:/* @__PURE__ */p(a,{scale:1.25})}),
20
- /* @__PURE__ */p("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */p(a,{scale:.75})})]})}function D({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
21
- return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function S(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
22
- return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function I(){/* @__PURE__ */
23
- return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
24
- /* @__PURE__ */p(D,{heavy:!0}),
25
- /* @__PURE__ */p("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
26
- /* @__PURE__ */p("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */p("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */p("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function F(){/* @__PURE__ */
27
- return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */p("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function L({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */p(t?v:N,{}):2===e?/* @__PURE__ */u(f,{children:[/* @__PURE__ */p(t?v:N,{}),
28
- /* @__PURE__ */p(j,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */p(j,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */p(F,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */p(D,{}):[55,63,65,82].includes(e)?/* @__PURE__ */p(D,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */p(S,{}):[95,96,99].includes(e)?/* @__PURE__ */p(I,{}):null}function H(){const[r,s]=d(b),[v,N]=d(()=>n(g)),[j,D]=d(null),[S,I]=d(!0),[,F]=d(0);m(()=>{const e=setInterval(()=>F(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[H,T]=d(!1),[$,A]=d(r),[C,G]=d(v),{prefs:Z,save:X}=l(),M={...x,...Z.weather_prefs??{}},[O,J]=d(M);o(h(()=>{A(r),G({...v}),J({...M}),T(!0)},[r,v,M])),m(()=>{let t=!1;return I(!0),e(r).then(e=>{t||(D(e),I(!1))}),()=>{t=!0}},[r]);const U=e=>M.useFahrenheit?`${w(e)}°F`:`${e}°`;if(S&&!j)/* @__PURE__ */
29
- return p("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-on-accent/80 text-xs",style:{minHeight:110},children:/* @__PURE__ */p(c,{size:"sm",padding:"",label:"Loading"})});if(!j)/* @__PURE__ */
30
- return p("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[B,W,P]=t(j.code,j.isDay);/* @__PURE__ */
31
- return u(f,{children:[
32
- /* @__PURE__ */p("style",{children:"\n@keyframes wx-rain-a { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 0.95; } 100% { transform: translate(8px,140px); opacity: 0; } }\n@keyframes wx-rain-b { 0% { transform: translate(0,-20px); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translate(12px,140px); opacity: 0; } }\n@keyframes wx-rain-c { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5px,140px); opacity: 0; } }\n@keyframes wx-snow-a { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(10px,55px) rotate(180deg); } 100% { transform: translate(-4px,140px) rotate(360deg); opacity: 0; } }\n@keyframes wx-snow-b { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.85; } 50% { transform: translate(-12px,55px) rotate(-180deg); } 100% { transform: translate(6px,140px) rotate(-360deg); opacity: 0; } }\n@keyframes wx-snow-c { 0% { transform: translate(0,-12px); opacity: 0; } 10% { opacity: 0.7; } 100% { transform: translate(2px,140px); opacity: 0; } }\n@keyframes wx-drift-cloud { 0% { transform: translateX(-40%); } 100% { transform: translateX(140%); } }\n@keyframes wx-twinkle { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }\n@keyframes wx-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.15; } 89% { opacity: 0.85; } 90% { opacity: 0; } }\n@keyframes wx-bolt { 0%, 86%, 90%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: 0.85; } }\n@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.12); opacity: 0.95; } }\n@keyframes wx-sun-rays { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n@keyframes wx-fog-drift { 0% { transform: translateX(-25%); opacity: 0.3; } 50% { opacity: 0.65; } 100% { transform: translateX(25%); opacity: 0.3; } }\n@keyframes wx-shooting-star { 0%, 95% { opacity: 0; transform: translate(0,0) scale(0); } 96% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(40px,30px) scale(1); } }\n"}),
33
- /* @__PURE__ */p("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */u("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${P}`,style:{height:110},children:[
34
- /* @__PURE__ */p(L,{code:j.code,isDay:j.isDay}),
35
- /* @__PURE__ */u("div",{className:"relative z-10 px-3 py-3 flex flex-col h-full justify-between",children:[
36
- /* @__PURE__ */u("div",{className:"flex items-start justify-between gap-2",children:[
37
- /* @__PURE__ */u("div",{className:"min-w-0 flex-1",children:[
38
- /* @__PURE__ */p("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),M.showLocalTime&&/* @__PURE__ */p("div",{className:"text-2xs opacity-90 leading-tight tabular-nums drop-shadow-sm",children:k(j.timezone,M.use24Hour)})]}),
39
- /* @__PURE__ */p("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:U(j.temp)})]}),
40
- /* @__PURE__ */u("div",{className:"flex items-end justify-between gap-2",children:[
41
- /* @__PURE__ */u("div",{className:"flex items-center gap-2 min-w-0",children:[
42
- /* @__PURE__ */p("span",{className:"text-lg leading-none drop-shadow-sm",children:W}),
43
- /* @__PURE__ */p("span",{className:"text-2xs font-medium drop-shadow-sm truncate",children:B})]}),
44
- /* @__PURE__ */u("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",U(j.high)," L:",U(j.low)]})]})]})]})}),
45
- /* @__PURE__ */u(i,{open:H,onClose:()=>T(!1),title:"Weather Settings",appearance:C,onAppearanceChange:G,onSave:()=>{s($),N(C),X({weather_prefs:O}),localStorage.setItem(y,$),localStorage.setItem(g,JSON.stringify(C)),T(!1)},children:[
46
- /* @__PURE__ */p("div",{className:"space-y-3",children:/* @__PURE__ */u("div",{children:[
47
- /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
48
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 mb-2",children:[
49
- /* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
50
- /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>J(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
51
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 mb-2",children:[
52
- /* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
53
- /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>J(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
54
- /* @__PURE__ */u("label",{className:"flex items-center gap-2 cursor-pointer",children:[
55
- /* @__PURE__ */p("input",{type:"checkbox",checked:O.showLocalTime,onChange:e=>J(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
56
- /* @__PURE__ */p("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
57
- /* @__PURE__ */u("div",{children:[
58
- /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
59
- /* @__PURE__ */p("select",{value:$,onChange:e=>A(e.target.value),className:"w-full bg-surface-sunken border border-line rounded px-2 h-8 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */p("option",{value:e,children:e},e))}),
60
- /* @__PURE__ */p("p",{className:"mt-1 text-2xs text-ink-faintest",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{H as default};
@@ -1,32 +0,0 @@
1
- import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as n,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as s,WidgetSettingsModal as i}from"./chunk-XOZ5VPXF.js";import{useWidgetSettings as a}from"./chunk-H4LUHKUJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DASRJ26L.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-GHLXZDLU.js";import"./chunk-KV6XCHAG.js";import"./chunk-B447IHIL.js";import"./chunk-EIFNESXS.js";import"./chunk-PR6FNBKR.js";import"./chunk-RIG5FEVS.js";import"./chunk-NDWX5Z4D.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-ZGIAMYTI.js";import"./chunk-5LHEPE4B.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as o}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-DEJIH3ZQ.js";import"./chunk-C3QOHMR6.js";import{useState as m,useEffect as l,useCallback as h}from"react";import{jsxs as p,Fragment as u,jsx as d}from"react/jsx-runtime";var k="world_clock_appearance",g=["London","Shanghai","New York"];function j(){const{prefs:j,save:x}=c(),[b,f]=m(()=>s(k)),[y,N]=m(!1),[v,D]=m([]),[w,F]=m(b),S={useFahrenheit:!!j.weather_prefs?.useFahrenheit},[C,G]=m(S),[U,H]=m(()=>/* @__PURE__ */new Date);l(()=>{const e=setInterval(()=>H(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const Z=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),I=j.world_clocks,J=(()=>{if(!Array.isArray(I)||0===I.length)return g;const t=[];for(const n of I){const r=e[n]?n:Z[n];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[L,O]=m({}),[T,A]=m(!0);l(()=>{let e=!1;return A(!0),(async()=>{const n={};await Promise.all(J.map(async e=>{const r=await t(e);r&&(n[e]=r)})),e||(O(n),A(!1))})(),()=>{e=!0}},[J.join(",")]),a(h(()=>{D([...J]),F({...b}),G({...S}),N(!0)},[J.join(","),b,S.useFahrenheit]));const M=e=>S.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
2
- return p(u,{children:[
3
- /* @__PURE__ */d("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:"divide-y divide-gray-200",children:[T&&J.every(e=>!L[e])&&/* @__PURE__ */d(o,{size:"sm",padding:"py-6",label:"Loading"}),J.map(t=>{const r=L[t],s=e[t]?.tz??"UTC",{time:i,ampm:a}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=n.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${n.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(n.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(s,U);if(!r)/* @__PURE__ */
4
- return p("div",{className:"px-4 py-3",children:[
5
- /* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
6
- /* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
7
- /* @__PURE__ */p("span",{className:"tabular-nums text-sm font-medium text-ink-faint",children:[i,
8
- /* @__PURE__ */d("span",{className:"text-3xs ml-0.5 opacity-70",children:a})]})]}),
9
- /* @__PURE__ */d(o,{size:"sm",padding:"pt-1",label:"Loading weather"})]},t);const[c,m]=n(r.code,r.isDay);/* @__PURE__ */
10
- return p("div",{className:"px-4 py-3",children:[
11
- /* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
12
- /* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
13
- /* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:M(r.temp)})]}),
14
- /* @__PURE__ */p("div",{className:"flex items-center justify-between gap-2 mt-2 text-2xs",children:[
15
- /* @__PURE__ */p("div",{className:"flex items-center gap-2 min-w-0 text-ink-faint",children:[
16
- /* @__PURE__ */d("span",{className:"text-base leading-none shrink-0",children:m}),
17
- /* @__PURE__ */p("span",{className:"tabular-nums font-semibold text-gray-700 shrink-0",children:[i,
18
- /* @__PURE__ */d("span",{className:"text-3xs font-medium ml-0.5 opacity-70",children:a})]}),
19
- /* @__PURE__ */d("span",{className:"text-gray-300 shrink-0",children:"·"}),
20
- /* @__PURE__ */d("span",{className:"truncate",children:c})]}),
21
- /* @__PURE__ */p("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",M(r.high)," L:",M(r.low)]})]})]},t)})]})}),
22
- /* @__PURE__ */p(i,{open:y,onClose:()=>N(!1),title:"World Clock Settings",appearance:w,onAppearanceChange:F,onSave:()=>{0!==v.length&&(x({world_clocks:v,weather_prefs:{...j.weather_prefs??{},useFahrenheit:C.useFahrenheit}}),f(w),localStorage.setItem(k,JSON.stringify(w)),N(!1))},children:[
23
- /* @__PURE__ */p("div",{children:[
24
- /* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
25
- /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
26
- /* @__PURE__ */d("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
27
- /* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>G(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(C.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
28
- /* @__PURE__ */d("p",{className:"text-2xs text-ink-faintest mt-1",children:"Shared with the Weather widget."})]}),
29
- /* @__PURE__ */p("div",{children:[
30
- /* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
31
- /* @__PURE__ */d("div",{className:"grid grid-cols-2 gap-1 max-h-56 overflow-y-auto",children:Object.keys(e).map(e=>/* @__PURE__ */p("label",{className:"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2",children:[
32
- /* @__PURE__ */d("input",{type:"checkbox",checked:v.includes(e),onChange:()=>D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5"}),e]},e))})]})]})]})}export{j as default};
@@ -1,2 +0,0 @@
1
- import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-TMSSR5UH.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 t="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(t)}catch{}try{e.info(t)}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 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 V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,q=[],H=!1,J=null,L=/* @__PURE__ */new Set;function U(){for(const t of L)t()}function X(t){q=t,U()}function $(){const t=W;return t?J=t.list().then(e=>{W===t&&(q=e,H=!0,U())}).catch(()=>{W===t&&(H=!0,U())}).finally(()=>{J=null}):(q=[],H=!0,U(),Promise.resolve())}function z(t){W=t,q=[],H=!1,t?$():U()}function Q(t){return L.add(t),!W||H||J||$(),()=>{L.delete(t)}}function Y(){return q}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),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:K()}: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,Y,Y),i=o(t=>{const n=W;if(!n)return e.addTask(t);const o="tmp-"+E(),a=K(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return X([...q,r]),n.create({...t,name:t.name.trim()}).then(t=>X(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>X(q.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=W;if(!o)return e.updateTask(t,n);X(q.map(e=>e.id===t?{...e,...n,id:t,updatedAt:K()}:e)),o.update(t,n).catch(()=>{$()})},[e]),l=o(t=>{const n=W;if(!n)return e.removeTask(t);const o=q;X(q.filter(e=>e.id!==t)),n.remove(t).catch(()=>X(o))},[e]),s=o(t=>{if(!W)return e.toggleDone(t);const n=q.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{W||e.setAllTasks(t)},[e]);return null===W?e:{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(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),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(V),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,z as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -1 +0,0 @@
1
- var o={0:["Clear Sky","☀️","🌙","from-sky-400 to-blue-500","from-indigo-900 to-slate-950"],1:["Mainly Clear","🌤️","🌙","from-sky-400 to-blue-500","from-indigo-900 to-slate-950"],2:["Partly Cloudy","⛅","☁️","from-sky-400 to-blue-400","from-indigo-800 to-slate-900"],3:["Overcast","☁️","☁️","from-gray-400 to-gray-500","from-gray-700 to-slate-900"],45:["Foggy","🌫️","🌫️","from-gray-400 to-gray-500","from-gray-700 to-slate-800"],48:["Foggy","🌫️","🌫️","from-gray-400 to-gray-500","from-gray-700 to-slate-800"],51:["Light Drizzle","🌦️","🌧️","from-gray-400 to-blue-500","from-gray-700 to-indigo-900"],53:["Drizzle","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],55:["Heavy Drizzle","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],61:["Light Rain","🌦️","🌧️","from-gray-400 to-blue-500","from-gray-700 to-indigo-900"],63:["Rain","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],65:["Heavy Rain","🌧️","🌧️","from-gray-600 to-blue-700","from-gray-700 to-indigo-950"],71:["Light Snow","🌨️","🌨️","from-blue-200 to-blue-400","from-blue-800 to-slate-900"],73:["Snow","❄️","❄️","from-blue-300 to-blue-500","from-blue-800 to-slate-900"],75:["Heavy Snow","❄️","❄️","from-blue-400 to-blue-600","from-blue-800 to-slate-900"],80:["Rain Showers","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],82:["Heavy Showers","🌧️","🌧️","from-gray-600 to-blue-700","from-gray-700 to-indigo-950"],95:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-800","from-gray-800 to-indigo-950"],96:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-800","from-gray-800 to-indigo-950"],99:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-900","from-gray-800 to-indigo-950"]},t=(t,r=!0)=>{const a=o[t]||["Unknown","❓","❓","from-gray-400 to-gray-500","from-gray-700 to-slate-800"];return[a[0],r?a[1]:a[2],r?a[3]:a[4]]},r={Sydney:{lat:-33.8688,lon:151.2093,tz:"Australia/Sydney"},Melbourne:{lat:-37.8136,lon:144.9631,tz:"Australia/Melbourne"},Auckland:{lat:-36.8485,lon:174.7633,tz:"Pacific/Auckland"},Tokyo:{lat:35.6762,lon:139.6503,tz:"Asia/Tokyo"},Shanghai:{lat:31.2304,lon:121.4737,tz:"Asia/Shanghai"},"Hong Kong":{lat:22.3193,lon:114.1694,tz:"Asia/Hong_Kong"},Singapore:{lat:1.3521,lon:103.8198,tz:"Asia/Singapore"},Bangkok:{lat:13.7563,lon:100.5018,tz:"Asia/Bangkok"},Mumbai:{lat:19.076,lon:72.8777,tz:"Asia/Kolkata"},Dubai:{lat:25.2048,lon:55.2708,tz:"Asia/Dubai"},Berlin:{lat:52.52,lon:13.405,tz:"Europe/Berlin"},Paris:{lat:48.8566,lon:2.3522,tz:"Europe/Paris"},London:{lat:51.5074,lon:-.1278,tz:"Europe/London"},"New York":{lat:40.7128,lon:-74.006,tz:"America/New_York"},Miami:{lat:25.7617,lon:-80.1918,tz:"America/New_York"},Toronto:{lat:43.6532,lon:-79.3832,tz:"America/Toronto"},Chicago:{lat:41.8781,lon:-87.6298,tz:"America/Chicago"},"Los Angeles":{lat:34.0522,lon:-118.2437,tz:"America/Los_Angeles"}},a="weather_local_cache";function e(){try{return JSON.parse(localStorage.getItem(a)||"{}")}catch{return{}}}async function n(o,t=!1){const n=r[o];if(!n)return null;if(!t){const t=e()[o];if(t&&Date.now()-t.ts<18e5)return t.data}try{const t=await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${n.lat}&longitude=${n.lon}&current=temperature_2m,weather_code,is_day&daily=temperature_2m_max,temperature_2m_min&forecast_days=1&timezone=auto`),r=await t.json(),l={city:o,temp:Math.round(r.current.temperature_2m),code:r.current.weather_code,high:Math.round(r.daily.temperature_2m_max[0]),low:Math.round(r.daily.temperature_2m_min[0]),isDay:1===r.current.is_day,timezone:r.timezone||"UTC"},i=e();return i[o]={data:l,ts:Date.now()},function(o){try{localStorage.setItem(a,JSON.stringify(o))}catch{}}(i),l}catch{return null}}var l=o=>Math.round(9*o/5+32);export{r as AVAILABLE_CITIES,n as fetchCityWeather,t as getCondition,l as toFahrenheit};
@@ -1,2 +0,0 @@
1
- import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-ZJZHUPUH.js";import{toDayMs as i,fmtSliderDate as t}from"./chunk-GXVWI3U5.js";import{DAY_MS as a}from"./chunk-JRQMX4PK.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-DEJIH3ZQ.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const j=l(Date.now,null),M=[],x=[],C=o().timeline,H=r();for(const e of p){const n=i(e.date??null);null===n?x.push({key:e.key,label:e.label,kind:e.kind}):M.push({...e,ms:n})}M.sort((e,n)=>e.ms-n.ms);const D=i(g??null);let J,Z,w=!0;0===M.length?(Z=D??j??0,J=Z-30*a,w=null!==D||null!==j):(J=M[0].ms,Z=D??M[M.length-1].ms,Z-J<a&&(Z=J+a));const K=M.length>0?Math.max(0,Math.round((Z-J)/a)):0,L=u??(K>0?C.duration(K):void 0),N=[M.length>0?C.started(t(M[0].ms,H)):void 0,L,x.length>0?C.reached(M.length,p.length):void 0],O=M.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),U={};for(const e of M)e.phase&&(U[e.phase]=U[e.phase]||[]).push(e.ms);const I=Object.entries(U).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),P="rail"===v,Q=w&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:P?"spread":"compressed",labels:P?"none":"lanes",items:O,pending:x,phases:I,startMs:J,endMs:Z,todayMs:j??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:C.milestones(m)})});/* @__PURE__ */
2
- return h("div",P?{className:"shrink-0","data-timeline-variant":"rail",children:Q}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:N,children:Q})})}export{m as MilestoneTimeline};
@@ -1,13 +0,0 @@
1
- import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={document:".docx",spreadsheet:".sheet",deck:".slides"},f=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function h(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function m(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await m(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await m(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:h(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new f(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await m(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:h(e,t)}));if(!o.ok)throw await m(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:h(o,t)}));if(!i.ok)throw await m(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await m(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await m(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await m(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await m(e,"Empty trash")}}}var y=null;function g(e){y=e}function x(){return y??w()}function b(){return null!==y}var v=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function _(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return v[Math.abs(t)%v.length]}var k={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},E={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},C={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},N={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function j({className:e}){/* @__PURE__ */
2
- return o(t,{name:"folder",look:"solid",className:e})}function T(t,n){return n&&e[n]||(t?e[t]:void 0)}var I=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function S({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?N[l]:null,p=d?C[l]:null;if("folder"===e)/* @__PURE__ */
3
- return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(j,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=T(a,s),i=_(a||s||"page");/* @__PURE__ */
4
- return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):I})})}/* @__PURE__ */
5
- return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
6
- /* @__PURE__ */i("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${c??k[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
7
- /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
8
- /* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
9
- /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
10
- /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??k[e]??"text-gray-600"}`,children:p??E[e]??e.slice(0,3).toUpperCase()})]})}function L({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
- return o(j,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=T(e.entityId,e.label);/* @__PURE__ */
12
- return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${_(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?N[e.fileKind]:k[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function $(e){return"preview-file"===e.entityType&&e.fileKind?C[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":E[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var R=null,D=/* @__PURE__ */new Set;function P(e){R=e,D.forEach(e=>e())}function V(e){return D.add(e),()=>{D.delete(e)}}function F(){return R}var O="__REACT_OS_SHELL_FILES_VIEW__",A="react-os-shell:files-show-trash",M="react-os-shell:files-open-desktop-folder";function U(){"undefined"!=typeof window&&(window[O]="trash",window.dispatchEvent(new CustomEvent(A)))}function z(e){"undefined"!=typeof window&&(window[O]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(M,{detail:{folderId:e}})))}function W(){if("undefined"==typeof window)return null;const e=window[O];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function H(){const e=W();return"undefined"!=typeof window&&(window[O]=null),e}export{L as DesktopItemMiniIcon,u as FILES_OFFICE_EXTENSIONS,M as FILES_OPEN_DESKTOP_FOLDER_EVENT,A as FILES_SHOW_TRASH_EVENT,S as FileIconTile,f as FilesQuotaError,j as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,H as consumeFilesViewRequest,w as createFileServerStore,$ as desktopItemTypeLabel,F as getDesktopFoldersSnapshot,x as getFilesStore,b as hasHostFilesStore,W as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,P as publishDesktopFolders,z as requestFilesDesktopFolderView,U as requestFilesTrashView,g as setFilesStore,d as setSpreadsheetPreview,V as subscribeDesktopFolders};
@@ -1 +0,0 @@
1
- var r="13.7.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1 +0,0 @@
1
- import{EMPTY_VALUE as e}from"./chunk-36BRD5J3.js";import{fromDateKey as t,DAY_MS as r}from"./chunk-JRQMX4PK.js";import{pad2 as n}from"./chunk-LF27WIN2.js";var o=[{key:"DD/MM/YYYY",example:"24/04/2026"},{key:"MM/DD/YYYY",example:"04/24/2026"},{key:"YYYY-MM-DD",example:"2026-04-24"},{key:"DD-MM-YYYY",example:"24-04-2026"},{key:"MM-DD-YYYY",example:"04-24-2026"},{key:"DD.MM.YYYY",example:"24.04.2026"},{key:"YYYY.MM.DD",example:"2026.04.24"},{key:"YYYY/MM/DD",example:"2026/04/24"},{key:"DD/MM/YY",example:"24/04/26"},{key:"MM/DD/YY",example:"04/24/26"},{key:"DD/MMM/YYYY",example:"24/Apr/2026"},{key:"DD/MMM/YY",example:"24/Apr/26"},{key:"DD MMM YYYY",example:"24 Apr 2026"},{key:"MMM DD, YYYY",example:"Apr 24, 2026"},{key:"DD MMMM YYYY",example:"24 April 2026"},{key:"MMMM DD, YYYY",example:"April 24, 2026"}],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function Y(e){return a[parseInt(e,10)-1]??e}function m(e){return u[parseInt(e,10)-1]??e}function i(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}function c(e){localStorage.setItem("user_date_format",e)}var l="user_timezone",M="auto";function D(){if("undefined"!=typeof window)try{const e=localStorage.getItem(l);return e&&e!==M?e:void 0}catch{return}}function s(e){e&&e!==M?localStorage.setItem(l,e):localStorage.removeItem(l)}function f(e){e&&localStorage.setItem(l,e)}var y={dateStyle:"medium"},$=/* @__PURE__ */new Map;function d(e,t){const r=`${e}|${JSON.stringify(t)}`;let n=$.get(r);return n||(n=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),$.set(r,n)),n}var h=/* @__PURE__ */new Map;function g(e){const t=e??"";let r=h.get(t);if(void 0===r){try{r=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",calendar:"gregory",timeZone:e})}catch{r=null}h.set(t,r)}return r}var p=e=>null!==g(e);function w(e,t){const r=function(e){return g(e)??g(void 0)}(t).formatToParts(e),n=e=>r.find(t=>t.type===e)?.value??"";return{y:n("year"),m:n("month"),d:n("day"),hh:n("hour"),mm:n("minute")}}var k=/^(\d{4})-(\d{1,2})-(\d{1,2})$/;function S(e,t){if(!e)return null;const r=k.exec(e);if(r){const[e,t,o]=r.slice(1).map(Number);return t<1||t>12||o<1||o>31?null:{y:String(e),m:n(t),d:n(o)}}const o=new Date(e);return Number.isNaN(o.getTime())?null:w(o,t)}function N(t,r){const n=S(t,r?.timeZone||D());return n?r?.locale?d(r.locale,r.style??y).format(new Date(Date.UTC(Number(n.y),Number(n.m)-1,Number(n.d)))):function(e,t,r){switch(i()){case"MM/DD/YYYY":return`${t}/${r}/${e}`;case"YYYY-MM-DD":return`${e}-${t}-${r}`;case"DD-MM-YYYY":return`${r}-${t}-${e}`;case"MM-DD-YYYY":return`${t}-${r}-${e}`;case"DD.MM.YYYY":return`${r}.${t}.${e}`;case"YYYY.MM.DD":return`${e}.${t}.${r}`;case"YYYY/MM/DD":return`${e}/${t}/${r}`;case"DD/MM/YY":return`${r}/${t}/${e.slice(-2)}`;case"MM/DD/YY":return`${t}/${r}/${e.slice(-2)}`;case"DD/MMM/YYYY":return`${r}/${Y(t)}/${e}`;case"DD/MMM/YY":return`${r}/${Y(t)}/${e.slice(-2)}`;case"DD MMM YYYY":return`${r} ${Y(t)} ${e}`;case"MMM DD, YYYY":return`${Y(t)} ${r}, ${e}`;case"DD MMMM YYYY":return`${r} ${m(t)} ${e}`;case"MMMM DD, YYYY":return`${m(t)} ${r}, ${e}`;default:return`${r}/${t}/${e}`}}(n.y,n.m,n.d):e}function b(e){if(e)return p(e)?e:null;const t=D();return t&&p(t)?t:"undefined"==typeof window?null:void 0}function I(e,r){if(!e)return null;if(t(e))return e;if(k.test(e))return null;const n=b(r);if(null===n)return null;const o=S(e,n);return o?`${o.y}-${o.m}-${o.d}`:null}function v(e=/* @__PURE__ */new Date,t){return Number.isNaN(e.getTime())?null:I(e.toISOString(),t)}function x(e,t){const r=w(new Date(e),t);return Date.UTC(Number(r.y),Number(r.m)-1,Number(r.d),Number(r.hh),Number(r.mm))-6e4*Math.floor(e/6e4)}var T=(e,t)=>Number.isInteger(e)&&e>=0&&e<=t;function A(e,n){const o=t(e),a=n?.hour??12,u=n?.minute??0;if(!o||!T(a,23)||!T(u,59))return null;const Y=Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),a,u),m=b(n?.timeZone);if(null===m)return null;const i=Y-x(Y-r,m),c=Y-x(Y+r,m),l=e=>e+x(e,m)===Y,M=l(i)?i:l(c)?c:I(new Date(i).toISOString(),m)===e?i:c;return new Date(M).toISOString()}function J(t,r){if(!t||k.test(t))return e;const n=new Date(t);if(Number.isNaN(n.getTime()))return e;const o=r?.timeZone||D();if(r?.locale)return function(e,t,r){const n={hour:"numeric",minute:"2-digit"};try{return e.toLocaleTimeString(t,{...n,timeZone:r})}catch{return e.toLocaleTimeString(t,n)}}(n,r.locale,o);const{hh:a,mm:u}=w(n,o);return function(e,t){const r=Number(e);return`${r%12||12}:${t} ${r<12?"am":"pm"}`}(a,u)}function F(t,r){const n=J(t,r);return n===e?e:`${N(t,r)}, ${n}`}var C={months:u,monthsShort:a,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${u[t]} ${e}`,shortMonthYear:(e,t)=>`${a[t]} ${e}`,longDate:(e,t,r)=>`${r} ${u[t]} ${e}`},O=/* @__PURE__ */new Map;function Z(e){if(!e)return C;const t=O.get(e);if(t)return t;const r=t=>d(e,t),n=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),o=r({month:"long"}),a=r({month:"short"}),u=r({weekday:"long"}),Y=r({weekday:"short"}),m=r({month:"long",year:"numeric"}),i=r({month:"short",year:"numeric"}),c=r({day:"numeric",month:"long",year:"numeric"}),l=Array.from({length:12},(e,t)=>t),M=Array.from({length:7},(e,t)=>t),D={months:l.map(e=>o.format(n(2e3,e))),monthsShort:l.map(e=>a.format(n(2e3,e))),weekdays:M.map(e=>u.format(n(2e3,0,2+e))),weekdaysShort:M.map(e=>Y.format(n(2e3,0,2+e))),monthYear:(e,t)=>m.format(n(e,t)),shortMonthYear:(e,t)=>i.format(n(e,t)),longDate:(e,t,r)=>c.format(n(e,t,r))};return O.set(e,D),D}var U=/* @__PURE__ */new Map;function W(e){if(!e)return 0;let t=U.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),n="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===n?.firstDay&&(t=1)}catch{}U.set(e,t)}return t}export{o as DATE_FORMAT_OPTIONS,M as TZ_AUTO,Z as calendarNames,I as dayKeyInZone,W as firstDayOfWeek,N as formatDate,F as formatDateTime,J as formatTime,i as getUserDateFormat,D as getUserTimezone,A as instantOnDayKey,c as setUserDateFormat,s as setUserTimezone,f as syncTimezoneFromProfile,v as userToday};