efficient-shell 7.62.0 → 7.64.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 (72) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-F4MUAORU.js → Browser-DEK65GGL.js} +14 -14
  3. package/dist/Calculator-2TQXXQTL.js +29 -0
  4. package/dist/ConfirmDialog-BSUSUHKJ.js +1 -0
  5. package/dist/{CurrencyConverter-2KRM3NFL.js → CurrencyConverter-N237EF2N.js} +9 -9
  6. package/dist/{Documents-4O7TTUHG.js → Documents-T6L323BV.js} +26 -26
  7. package/dist/{Files-GXDMKGPZ.js → Files-HNE3DY3I.js} +70 -70
  8. package/dist/{Notepad-PGLADU6N.js → Notepad-TLPBE3NP.js} +16 -16
  9. package/dist/PdfViewer-NT3MMNPO.js +1 -0
  10. package/dist/{PomodoroTimer-WLVH3BFM.js → PomodoroTimer-DMP6EY5F.js} +52 -52
  11. package/dist/{Preview-SL4HBPBL.js → Preview-RKQVILVT.js} +57 -57
  12. package/dist/Sidebar-75YOMDJZ.js +44 -0
  13. package/dist/{Spreadsheet-MA5CAMIM.js → Spreadsheet-RN6ROHUK.js} +14 -14
  14. package/dist/{Stock-FCPI7TKU.js → Stock-MC3S66WG.js} +3 -3
  15. package/dist/{Weather-5VWETSF5.js → Weather-UKY7EJO2.js} +17 -17
  16. package/dist/{WorldClock-G7CBN3J2.js → WorldClock-R7MIP7F6.js} +6 -6
  17. package/dist/ai/index.js +21 -21
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/{chunk-O5MZAN43.js → chunk-2YLR3CWQ.js} +17 -17
  22. package/dist/{chunk-MHGVLZYL.js → chunk-35UBO4T7.js} +3 -3
  23. package/dist/chunk-3IML3Y3Y.js +1 -0
  24. package/dist/{chunk-4G4FU2ML.js → chunk-4A4GD2NL.js} +4 -4
  25. package/dist/{chunk-RWIFSTEK.js → chunk-4RUTVPTH.js} +1 -1
  26. package/dist/{chunk-N5REB25E.js → chunk-4TJ6N5QS.js} +1 -1
  27. package/dist/chunk-5BFEZCIV.js +1039 -0
  28. package/dist/{chunk-UYKGVCZO.js → chunk-7KBOLC6O.js} +1 -1
  29. package/dist/{chunk-UUDDYDSC.js → chunk-AAHMUDUP.js} +2 -2
  30. package/dist/{chunk-TJR6B3YD.js → chunk-BHKRSEVI.js} +1 -1
  31. package/dist/{chunk-BJ47M4AR.js → chunk-BJ4APV4M.js} +1 -1
  32. package/dist/{chunk-KYBZBZEP.js → chunk-BRK2GETX.js} +11 -11
  33. package/dist/{chunk-SMFD6EID.js → chunk-BVFQGLAJ.js} +2 -2
  34. package/dist/{chunk-CICDIRBN.js → chunk-GMZ2J6XQ.js} +1 -1
  35. package/dist/chunk-HQJSOBDE.js +15 -0
  36. package/dist/{chunk-XVHILN6Q.js → chunk-JQ2345TZ.js} +1 -1
  37. package/dist/{chunk-C6IR6W7P.js → chunk-KOBUXTHU.js} +20 -20
  38. package/dist/{chunk-DSSLOQDW.js → chunk-LHHIRTEG.js} +1 -1
  39. package/dist/{chunk-54ZASFCH.js → chunk-LPGG6DRT.js} +51 -51
  40. package/dist/{chunk-TFNELC3A.js → chunk-LW5XF5JD.js} +1 -1
  41. package/dist/{chunk-5THIN3JV.js → chunk-OF7EOZVS.js} +17 -17
  42. package/dist/chunk-QXAPPMUE.js +1 -0
  43. package/dist/{chunk-UCZFCKKS.js → chunk-R2FANVKE.js} +15 -15
  44. package/dist/{chunk-OKPYIQ2Q.js → chunk-R4XNK5UJ.js} +8 -8
  45. package/dist/{chunk-UNBLH4EQ.js → chunk-RFANAC7P.js} +15 -15
  46. package/dist/{chunk-JDS2IFBP.js → chunk-T5J7AFTD.js} +1 -1
  47. package/dist/{chunk-S2PS4IOT.js → chunk-TT6QOFWA.js} +1 -1
  48. package/dist/{chunk-RUBR4GCW.js → chunk-ZOJJB5BQ.js} +7 -7
  49. package/dist/file-intake/index.js +1 -1
  50. package/dist/i18n/index.d.ts +1 -1
  51. package/dist/{index-Ci1RMKEn.d.ts → index-D6mP2zYB.d.ts} +18 -6
  52. package/dist/index.d.ts +3 -3
  53. package/dist/index.js +224 -224
  54. package/dist/locales/zh-Hans.d.ts +1 -1
  55. package/dist/locales/zh-Hans.js +1 -1
  56. package/dist/map/index.js +8 -8
  57. package/dist/page-tabs/index.js +5 -5
  58. package/dist/pdf/index.js +1 -1
  59. package/dist/{strings-mUwozHxH.d.ts → strings-BYsxAKI5.d.ts} +6 -1
  60. package/dist/telemetry/index.js +1 -1
  61. package/dist/ui/index.d.ts +2 -2
  62. package/dist/ui/index.js +1 -1
  63. package/dist/ui.css +1 -1
  64. package/package.json +1 -1
  65. package/dist/Calculator-PWG4G3MY.js +0 -29
  66. package/dist/ConfirmDialog-IZ3NJINY.js +0 -1
  67. package/dist/PdfViewer-EVJRMYTK.js +0 -1
  68. package/dist/Sidebar-EJKBAFU4.js +0 -44
  69. package/dist/chunk-A2MMRPU4.js +0 -1040
  70. package/dist/chunk-I33KGECT.js +0 -5
  71. package/dist/chunk-W7W4JMOT.js +0 -1
  72. package/dist/chunk-YFK4COYT.js +0 -1
package/README.md CHANGED
@@ -1495,7 +1495,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1495
1495
  | `NotificationBell` | Taskbar bell — config via `<Layout notifications={…}>`. |
1496
1496
  | `BugReportDetail` | Used inside an entity-window registry entry; reads from `<BugReportConfigProvider>`. |
1497
1497
  | `StatusBadge` | Colored pill rendering a status string. Map status→semantic group via `<StatusBadgeProvider groups={{...}}>`. `label` overrides the derived text for a status that arrived from elsewhere; the color still comes from `status`. `emphasis` (`subtle` default / `solid`, the same two words `Banner` uses) is the volume: the quiet register is a transparent wash that composites over a raised panel and a hovered row, the loud one is a saturated fill for the detail header where the same fact is the headline. Color comes from the status tokens in `ui.css`, which carry both themes. |
1498
- | `SidebarLayout` | Two-pane layout with a drag-to-resize sidebar (`storageKey` persists the width). Pair with a `flushBody` window so the sidebar runs edge-to-edge. |
1498
+ | `SidebarLayout` | Two-pane layout with a drag-to-resize sidebar (`storageKey` persists the width). Pair with a `flushBody` window so the sidebar runs edge-to-edge. On a phone the sidebar folds into a section bar over the page (the active rows' names, plus `sidebarTop`) and a bottom sheet the name opens; choosing a row closes it, a row with `aria-expanded` or anything inside `[data-sheet-keep-open]` does not. |
1499
1499
  | `SidebarNavItem`, `SidebarGroupLabel` | Filter-sidebar button (optional `count` badge and `severity` marker dot) plus its group heading. Roll the severity up in the app; omitting it renders exactly as before it existed. An unrecognised `severity` renders a visible "unknown" marker and logs — it never silently disappears. `icon` is a 16 px glyph at the leading edge, decorative in the a11y tree and a step quieter than the words it introduces (gray-400 idle, blue-600 active); `trailing` is the right edge after the count, for what a count cannot say — a plan chip, an external-link mark, a sync state. `label` widened to `ReactNode` for a name that needs its own markup; only a string gets the truncation `title`, because a node has no text to read without walking it. The label truncates and the count keeps its edge however many slots are filled. |
1500
1500
  | `MetricBar` | Value + proportional bar with optional `warn` / `crit` threshold ticks — the CPU / memory / disk row. `value={null}` renders "no data" (dashed empty track), never a zero-width bar; with no thresholds the fill stays grey rather than claiming health. `max` must be a positive finite number — given `0`/`NaN` the row prints the value but draws no bar, rather than dividing by zero into a full one. |
1501
1501
  | `BudgetBar` | A run's wall clock, drawn as **budget consumed** — not work done, which nothing here knows. Three states a glance separates: within budget (a solid fill), past the deadline (a hatched band, never the shape of a finished bar; with a `grace` the track spans budget + grace so it is only full when the reaper is due), and **no estimate at all** (no bar — not a zero one, not an empty track). Keeps `MetricBar`'s rule that `elapsed={null}` is no reading and `elapsed={0}` is a measurement. `budgetState(elapsed, budget)` is the same verdict for a list to sort by. |
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-4G4FU2ML.js";import{WindowTitle as r}from"./chunk-54ZASFCH.js";import"./chunk-DSSLOQDW.js";import"./chunk-MHGVLZYL.js";import"./chunk-KYBZBZEP.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-YFK4COYT.js";import"./chunk-KNUR2UEG.js";import{confirm as a}from"./chunk-UNBLH4EQ.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import{Icon as n}from"./chunk-76DRQSJM.js";import"./chunk-W7W4JMOT.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import{useRef as s,useEffect as l,useState as i}from"react";import{jsxs as c,jsx as m,Fragment as d}from"react/jsx-runtime";var u="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="https://en.wikipedia.org/wiki/Main_Page",g=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&b.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var k=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return g;try{const e=localStorage.getItem(u);if(!e)return g;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return g}function w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const d=s(void 0);void 0===d.current&&(d.current=e()),l(()=>{null!=d.current&&t(d.current)},[]);const p=d.current?f(d.current.url):"",[g,b]=i(w),[k,y]=i(p||g),[j,C]=i(k),[z,L]=i([k]),[W,S]=i(0),[R,E]=i(0),[D,H]=i(x),[O,T]=i(!1),[U,I]=i(null),K=s(null),M=s(null);l(()=>{try{localStorage.setItem(u,JSON.stringify(D))}catch{}},[D]);const B=e=>{const t=f(e);t&&(y(t),C(t),L(e=>{const o=e.slice(0,W+1);return o.push(t),o}),S(e=>e+1),T(!1))},F=()=>{"undefined"!=typeof window&&window.open(k,"_blank","noopener,noreferrer")},G=()=>{const e=U?.trim();e?(H(t=>[...t,{label:e,url:k}]),I(null)):I(null)};l(()=>{if(null===U)return;K.current?.focus(),K.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||I(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const J=e=>{H(t=>t.filter((t,o)=>o!==e))},A=W>0,P=W<z.length-1,Q=D.some(e=>e.url===k),Y="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-4A4GD2NL.js";import{WindowTitle as r}from"./chunk-LPGG6DRT.js";import"./chunk-LHHIRTEG.js";import"./chunk-35UBO4T7.js";import"./chunk-BRK2GETX.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-QXAPPMUE.js";import"./chunk-KNUR2UEG.js";import{confirm as a}from"./chunk-RFANAC7P.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-3IML3Y3Y.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import{Icon as n}from"./chunk-76DRQSJM.js";import{useRef as s,useEffect as l,useState as i}from"react";import{jsxs as c,jsx as m,Fragment as d}from"react/jsx-runtime";var u="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="https://en.wikipedia.org/wiki/Main_Page",g=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&b.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var k=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return g;try{const e=localStorage.getItem(u);if(!e)return g;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return g}function w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const d=s(void 0);void 0===d.current&&(d.current=e()),l(()=>{null!=d.current&&t(d.current)},[]);const p=d.current?f(d.current.url):"",[g,b]=i(w),[k,y]=i(p||g),[j,C]=i(k),[z,R]=i([k]),[L,E]=i(0),[W,S]=i(0),[T,D]=i(x),[H,I]=i(!1),[U,G]=i(null),A=s(null),O=s(null);l(()=>{try{localStorage.setItem(u,JSON.stringify(T))}catch{}},[T]);const P=e=>{const t=f(e);t&&(y(t),C(t),R(e=>{const o=e.slice(0,L+1);return o.push(t),o}),E(e=>e+1),I(!1))},K=()=>{"undefined"!=typeof window&&window.open(k,"_blank","noopener,noreferrer")},M=()=>{const e=U?.trim();e?(D(t=>[...t,{label:e,url:k}]),G(null)):G(null)};l(()=>{if(null===U)return;A.current?.focus(),A.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const B=e=>{D(t=>t.filter((t,o)=>o!==e))},F=L>0,J=L<z.length-1,X=T.some(e=>e.url===k),q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return c("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */m(r,{title:`Browser - ${v(k)}`}),
4
4
  /* @__PURE__ */m(o,{app:"browser"}),
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
6
- /* @__PURE__ */m("button",{onClick:()=>{if(W>0){const e=W-1;S(e),y(z[e]),C(z[e]),T(!1)}},disabled:!A,className:Y,title:"Back",children:/* @__PURE__ */m(n,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */m("button",{onClick:()=>{if(W<z.length-1){const e=W+1;S(e),y(z[e]),C(z[e]),T(!1)}},disabled:!P,className:Y,title:"Forward",children:/* @__PURE__ */m(n,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */m("button",{onClick:()=>E(e=>e+1),className:Y,title:"Refresh",children:/* @__PURE__ */m(n,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */m("button",{onClick:()=>B(g),className:Y,title:"Home",children:/* @__PURE__ */m(n,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),B(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */m("button",{onClick:()=>{if(L>0){const e=L-1;E(e),y(z[e]),C(z[e]),I(!1)}},disabled:!F,className:q,title:"Back",children:/* @__PURE__ */m(n,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(L<z.length-1){const e=L+1;E(e),y(z[e]),C(z[e]),I(!1)}},disabled:!J,className:q,title:"Forward",children:/* @__PURE__ */m(n,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>S(e=>e+1),className:q,title:"Refresh",children:/* @__PURE__ */m(n,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>P(g),className:q,title:"Home",children:/* @__PURE__ */m(n,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),P(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */m("span",{className:"px-2 text-gray-400 text-xs",children:k.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */m("input",{type:"text",value:j,onChange:e=>C(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),k!==j&&/* @__PURE__ */m("button",{type:"button",onClick:()=>C(k),className:"px-2 text-2xs text-gray-400 hover:text-gray-700",title:"Reset to current URL",children:"×"})]})}),
13
- /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>Q?J(D.findIndex(e=>e.url===k)):void I(v(k)),className:Y+" "+(Q?"text-yellow-500":""),title:Q?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(n,{name:"star",className:"h-4 w-4",fill:Q?"currentColor":"none",strokeWidth:1.5})}),
14
- /* @__PURE__ */m("button",{onClick:F,className:Y,title:"Open in new tab",children:/* @__PURE__ */m(n,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
- /* @__PURE__ */m("button",{onClick:()=>T(e=>!e),className:Y,title:"Embedding help",children:/* @__PURE__ */m(n,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */c("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
13
+ /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>X?B(T.findIndex(e=>e.url===k)):void G(v(k)),className:q+" "+(X?"text-yellow-500":""),title:X?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(n,{name:"star",className:"h-4 w-4",fill:X?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:K,className:q,title:"Open in new tab",children:/* @__PURE__ */m(n,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>I(e=>!e),className:q,title:"Embedding help",children:/* @__PURE__ */m(n,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */c("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
16
16
  /* @__PURE__ */m("div",{className:"text-2xs font-semibold uppercase tracking-wide text-gray-500 mb-1",children:"Bookmark this page"}),
17
17
  /* @__PURE__ */m("div",{className:"text-2xs text-gray-400 truncate mb-2 font-mono",title:k,children:k}),
18
- /* @__PURE__ */m("input",{ref:K,type:"text",value:U,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&I(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
18
+ /* @__PURE__ */m("input",{ref:A,type:"text",value:U,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?M():"Escape"===e.key&&G(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
19
  /* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
20
- /* @__PURE__ */m("button",{onClick:()=>I(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */m("button",{onClick:G,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
- /* @__PURE__ */c("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===D.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),D.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>B(e.url),onContextMenu:async o=>{o.preventDefault();await a({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&J(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
20
+ /* @__PURE__ */m("button",{onClick:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:M,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
+ /* @__PURE__ */c("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===T.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>P(e.url),onContextMenu:async o=>{o.preventDefault();await a({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&B(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
23
23
  /* @__PURE__ */m("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
24
24
  /* @__PURE__ */m("div",{className:"flex-1"}),
25
25
  /* @__PURE__ */m("button",{onClick:()=>{b(k);try{localStorage.setItem(h,k)}catch{}},className:"px-2 py-0.5 text-2xs text-gray-500 hover:text-gray-800",title:"Set current page as homepage",children:"Set as home"})]}),
26
- /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:k,iframeKey:R,iframeRef:M,openExternal:F,showHelp:O,dismissHelp:()=>T(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:a,dismissHelp:s}){const[u,h]=i(!1);l(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return k.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!u?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
26
+ /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:k,iframeKey:W,iframeRef:O,openExternal:K,showHelp:H,dismissHelp:()=>I(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:a,dismissHelp:s}){const[u,h]=i(!1);l(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return k.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!u?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
27
27
  /* @__PURE__ */m(n,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
28
28
  /* @__PURE__ */c("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
29
29
  /* @__PURE__ */c("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-GMZ2J6XQ.js";import{useWidgetSettings as n}from"./chunk-LPGG6DRT.js";import"./chunk-LHHIRTEG.js";import"./chunk-35UBO4T7.js";import"./chunk-BRK2GETX.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-KNUR2UEG.js";import"./chunk-RFANAC7P.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-3IML3Y3Y.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import{Icon as r}from"./chunk-76DRQSJM.js";import{useState as l,useRef as c,useCallback as i,useEffect as a}from"react";import{jsxs as o,Fragment as s,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function d(){const[d,m]=l("0"),[k,b]=l(null),[p,g]=l(null),[y,N]=l(!1),[x,f]=l(""),[v,C]=l([]),[$,j]=l(!1),[E,w]=l(()=>e(h)),[T,R]=l(!1),[S,A]=l(E),L=c(null);n(i(()=>{A({...E}),R(!0)},[E]));const B=i(e=>{f(""),m(t=>y||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[y]),F=i(()=>{m("0"),b(null),g(null),N(!1)},[]),G=i((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),I=i(e=>{const t=parseFloat(d);if(null!==k&&p&&!y){const e=G(k,t,p);m(String(e)),b(e),C(n=>[`${k} ${p} ${t} = ${e}`,...n].slice(0,20))}else b(t);g(e),N(!0)},[d,k,p,y,G]),D=i(()=>{if(null===k||!p)return;const e=parseFloat(d),t=G(k,e,p),n=`${k} ${p} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),f(n),m(String(t)),b(null),g(null),N(!0)},[d,k,p,G]),J=i(()=>{m(e=>String(parseFloat(e)/100))},[]),W=i(()=>{m(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);a(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?B(e.key):"."===e.key?B("."):"+"===e.key?I("+"):"-"===e.key?I("-"):"*"===e.key?I("×"):"/"===e.key?(e.preventDefault(),I("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&L.current?.contains(e.target)&&e.preventDefault(),D()):"Escape"===e.key?F():"Backspace"===e.key?m(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&J())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[B,I,D,F,J]);const K="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",M=`${K} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,O=`${K} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,U=`${K} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,X=`${K} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return o(s,{children:[
3
+ /* @__PURE__ */o("div",{ref:L,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */o("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:v.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(x||p&&null!==k)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${k} ${p} ${y?"":d}`}),
6
+ /* @__PURE__ */o("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(d),j(!0),setTimeout(()=>j(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,$?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(d)})]})]}),
9
+ /* @__PURE__ */o("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:F,className:U,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:W,className:U,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:J,className:U,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>I("÷"),className:`${O} ${"÷"===p?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>B("7"),className:M,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>B("8"),className:M,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>B("9"),className:M,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>I("×"),className:`${O} ${"×"===p?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>B("4"),className:M,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>B("5"),className:M,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>B("6"),className:M,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>I("-"),className:`${O} ${"-"===p?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>B("1"),className:M,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>B("2"),className:M,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>B("3"),className:M,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>I("+"),className:`${O} ${"+"===p?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>B("0"),className:`${M} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>B("."),className:M,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:D,className:X,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:T,onClose:()=>R(!1),title:"Calculator Settings",appearance:S,onAppearanceChange:A,onSave:()=>{w(S),localStorage.setItem(h,JSON.stringify(S)),R(!1)}})]})}export{d as default};
@@ -0,0 +1 @@
1
+ export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-RFANAC7P.js";import"./chunk-UVBK6YSR.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-3IML3Y3Y.js";import"./chunk-C3QOHMR6.js";import"./chunk-76DRQSJM.js";
@@ -1,6 +1,6 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-CICDIRBN.js";import{useWidgetSettings as r}from"./chunk-54ZASFCH.js";import"./chunk-DSSLOQDW.js";import"./chunk-MHGVLZYL.js";import"./chunk-KYBZBZEP.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-KNUR2UEG.js";import"./chunk-UNBLH4EQ.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-76DRQSJM.js";import"./chunk-W7W4JMOT.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as n}from"./chunk-2J6F4EE7.js";import{useState as a,useCallback as s,useEffect as o}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",d="currency_appearance",h="currency_rates_cache";function g(e){try{const t=JSON.parse(localStorage.getItem(h)||"{}")[e];if(t&&Date.now()-t.timestamp<36e5)return t.rates}catch{}return null}function f(e,t){try{const r=JSON.parse(localStorage.getItem(h)||"{}");r[e]={rates:t,timestamp:Date.now()},localStorage.setItem(h,JSON.stringify(r))}catch{}}function y(){try{const e=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(e)&&e.length)return e.slice(0,4)}catch{}return u}var x={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function N(){const[u,h]=a(y),[N,b]=a(()=>e(d)),[S,k]=a({}),[v,D]=a(!1),[j,C]=a(!1),[B,U]=a([]),[J,I]=a(N),[L,R]=a("USD"),[A,O]=a("CNY");r(s(()=>{U([...u]),I({...N}),C(!0)},[u,N])),o(()=>{const e=[...new Set(u.map(([e])=>e))];let t=!0;return async function(){D(!0);const r={};for(const t of e){const e=g(t);if(e)r[t]=e;else try{const e=await fetch(`https://open.er-api.com/v6/latest/${t}`),n=await e.json();n.rates&&(r[t]=n.rates,f(t,n.rates))}catch{}}t&&(k(r),D(!1))}(),()=>{t=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-GMZ2J6XQ.js";import{useWidgetSettings as r}from"./chunk-LPGG6DRT.js";import"./chunk-LHHIRTEG.js";import"./chunk-35UBO4T7.js";import"./chunk-BRK2GETX.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-KNUR2UEG.js";import"./chunk-RFANAC7P.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-3IML3Y3Y.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as n}from"./chunk-2J6F4EE7.js";import"./chunk-76DRQSJM.js";import{useState as a,useCallback as s,useEffect as o}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",d="currency_appearance",h="currency_rates_cache";function g(e){try{const t=JSON.parse(localStorage.getItem(h)||"{}")[e];if(t&&Date.now()-t.timestamp<36e5)return t.rates}catch{}return null}function f(e,t){try{const r=JSON.parse(localStorage.getItem(h)||"{}");r[e]={rates:t,timestamp:Date.now()},localStorage.setItem(h,JSON.stringify(r))}catch{}}function y(){try{const e=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(e)&&e.length)return e.slice(0,4)}catch{}return u}var x={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function N(){const[u,h]=a(y),[N,b]=a(()=>e(d)),[k,v]=a({}),[S,D]=a(!1),[j,C]=a(!1),[R,U]=a([]),[J,B]=a(N),[I,A]=a("USD"),[G,L]=a("CNY");r(s(()=>{U([...u]),B({...N}),C(!0)},[u,N])),o(()=>{const e=[...new Set(u.map(([e])=>e))];let t=!0;return async function(){D(!0);const r={};for(const t of e){const e=g(t);if(e)r[t]=e;else try{const e=await fetch(`https://open.er-api.com/v6/latest/${t}`),n=await e.json();n.rates&&(r[t]=n.rates,f(t,n.rates))}catch{}}t&&(v(r),D(!1))}(),()=>{t=!1}},[u]);/* @__PURE__ */
2
2
  return c(i,{children:[
3
- /* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${N.activeOpacity/100})`,backdropFilter:N.activeBlur>0?`blur(${N.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[v&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([e,t],r)=>{const n=S[e]?.[t];/* @__PURE__ */
3
+ /* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${N.activeOpacity/100})`,backdropFilter:N.activeBlur>0?`blur(${N.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([e,t],r)=>{const n=k[e]?.[t];/* @__PURE__ */
4
4
  return c("button",{onClick:()=>{const e=u.map((e,t)=>t===r?[e[1],e[0]]:e);h(e),localStorage.setItem(p,JSON.stringify(e))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */l("span",{className:"text-base",children:x[e]||""}),
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const e=u.map((e,t)=>t===r?[e[1],e[0]]:e);h(e),l
9
9
  /* @__PURE__ */l("span",{className:"text-base",children:x[t]||""}),
10
10
  /* @__PURE__ */l("span",{className:"text-sm font-semibold text-gray-700",children:t})]}),
11
11
  /* @__PURE__ */l("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${e}-${t}-${r}`)})]})}),
12
- /* @__PURE__ */l(t,{open:j,onClose:()=>C(!1),title:"Currency Settings",appearance:J,onAppearanceChange:I,onSave:()=>{if(0===B.length)return;const e=B.slice(0,4);h(e),b(J),localStorage.setItem(p,JSON.stringify(e)),localStorage.setItem(d,JSON.stringify(J)),C(!1)},children:/* @__PURE__ */c("div",{children:[
12
+ /* @__PURE__ */l(t,{open:j,onClose:()=>C(!1),title:"Currency Settings",appearance:J,onAppearanceChange:B,onSave:()=>{if(0===R.length)return;const e=R.slice(0,4);h(e),b(J),localStorage.setItem(p,JSON.stringify(e)),localStorage.setItem(d,JSON.stringify(J)),C(!1)},children:/* @__PURE__ */c("div",{children:[
13
13
  /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",B.length,"/",4,")"]})]}),
15
- /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:B.map(([e,t],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",R.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:R.map(([e,t],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */c("span",{className:"text-sm",children:[x[e]||""," ",e," → ",x[t]||""," ",t]}),
17
- /* @__PURE__ */l("button",{onClick:()=>U(e=>e.filter((e,t)=>t!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),B.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */l("select",{value:L,onChange:e=>R(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(e=>/* @__PURE__ */l("option",{children:e},e))}),
17
+ /* @__PURE__ */l("button",{onClick:()=>U(e=>e.filter((e,t)=>t!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),R.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */l("select",{value:I,onChange:e=>A(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(e=>/* @__PURE__ */l("option",{children:e},e))}),
19
19
  /* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */l("select",{value:A,onChange:e=>O(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(e=>/* @__PURE__ */l("option",{children:e},e))}),
21
- /* @__PURE__ */l("button",{onClick:()=>{L!==A&&B.length<4&&U(e=>[...e,[L,A]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{N as default};
20
+ /* @__PURE__ */l("select",{value:G,onChange:e=>L(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(e=>/* @__PURE__ */l("option",{children:e},e))}),
21
+ /* @__PURE__ */l("button",{onClick:()=>{I!==G&&R.length<4&&U(e=>[...e,[I,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{N as default};
@@ -1,25 +1,25 @@
1
- import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-4G4FU2ML.js";import{WindowTitle as n}from"./chunk-54ZASFCH.js";import"./chunk-DSSLOQDW.js";import"./chunk-MHGVLZYL.js";import{toast_default as r}from"./chunk-BJ47M4AR.js";import"./chunk-KYBZBZEP.js";import"./chunk-5A7MWTXX.js";import{PopupMenu as o,PopupMenuLabel as l,PopupMenuItem as a,PopupMenuDivider as i}from"./chunk-YJIG2KT3.js";import"./chunk-YFK4COYT.js";import"./chunk-KNUR2UEG.js";import"./chunk-UNBLH4EQ.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import{Icon as s}from"./chunk-76DRQSJM.js";import"./chunk-W7W4JMOT.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as c}from"./chunk-2J6F4EE7.js";import{useState as d,useRef as m}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=d(x),[v,b]=d(!1),[k,w]=d(!1),[N,j]=d(!1),[C,D]=d(null),L=m(null),M=m(null),U=m(null),R=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),j(!0)},B=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{U.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),j(!0)},e.readAsDataURL(t)}},W=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",j(!0),D(null))},O=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();b(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),j(!1)}else if(g.has(n))try{const e=await(import(
1
+ import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-4A4GD2NL.js";import{WindowTitle as n}from"./chunk-LPGG6DRT.js";import"./chunk-LHHIRTEG.js";import"./chunk-35UBO4T7.js";import{toast_default as r}from"./chunk-BJ4APV4M.js";import"./chunk-BRK2GETX.js";import"./chunk-5A7MWTXX.js";import{PopupMenu as o,PopupMenuLabel as l,PopupMenuItem as a,PopupMenuDivider as i}from"./chunk-YJIG2KT3.js";import"./chunk-QXAPPMUE.js";import"./chunk-KNUR2UEG.js";import"./chunk-RFANAC7P.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-3IML3Y3Y.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as s}from"./chunk-2J6F4EE7.js";import{Icon as c}from"./chunk-76DRQSJM.js";import{useState as d,useRef as m}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=d(x),[v,b]=d(!1),[k,w]=d(!1),[N,j]=d(!1),[C,D]=d(null),L=m(null),M=m(null),R=m(null),U=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),j(!0)},B=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{R.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),j(!0)},e.readAsDataURL(t)}},T=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",j(!0),D(null))},A=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();b(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),j(!1)}else if(g.has(n))try{const e=await(import(
2
2
  /* @vite-ignore */
3
- "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),j(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{b(!1)}},T=f?.filename?(S=f.filename).length>24?`${S.slice(0,23)}…`:S:"Untitled";var S;/* @__PURE__ */
4
- return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),k||w(!0)},onDragLeave:e=>{e.currentTarget===e.target&&w(!1)},onDrop:e=>{e.preventDefault(),w(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?B(t):O(t[0]))},children:[
5
- /* @__PURE__ */u(n,{title:`${T}${N?" •":""} - Documents`}),
3
+ "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),j(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{b(!1)}},I=f?.filename?(O=f.filename).length>24?`${O.slice(0,23)}…`:O:"Untitled";var O;/* @__PURE__ */
4
+ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),k||w(!0)},onDragLeave:e=>{e.currentTarget===e.target&&w(!1)},onDrop:e=>{e.preventDefault(),w(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?B(t):A(t[0]))},children:[
5
+ /* @__PURE__ */u(n,{title:`${I}${N?" •":""} - Documents`}),
6
6
  /* @__PURE__ */u(t,{app:"documents"}),
7
7
  /* @__PURE__ */h("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
8
- /* @__PURE__ */u("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&O(t),L.current&&(L.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */u("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&A(t),L.current&&(L.current.value="")},className:"hidden"}),
9
9
  /* @__PURE__ */h("button",{onClick:()=>L.current?.click(),className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
10
- /* @__PURE__ */u(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
- /* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=U.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=U.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
10
+ /* @__PURE__ */u(c,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
+ /* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=R.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=R.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
12
12
  /* @__PURE__ */u("span",{className:"text-2xs text-gray-400 ml-1",children:"TXT · DOCX · Code"}),
13
13
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
14
14
  /* @__PURE__ */h("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,N?" •":""]}),
15
15
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
16
16
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
17
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
17
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
21
21
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
22
- /* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{R("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
22
+ /* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{U("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
23
23
  /* @__PURE__ */u("option",{value:"",disabled:!0,children:"Size"}),
24
24
  /* @__PURE__ */u("option",{value:"1",children:"XS"}),
25
25
  /* @__PURE__ */u("option",{value:"2",children:"S"}),
@@ -27,26 +27,26 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
27
27
  /* @__PURE__ */u("option",{value:"4",children:"L"}),
28
28
  /* @__PURE__ */u("option",{value:"5",children:"XL"}),
29
29
  /* @__PURE__ */u("option",{value:"6",children:"2XL"})]}),
30
- /* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>R("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
30
+ /* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>U("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
31
31
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
32
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
32
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
34
34
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
35
35
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
36
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
36
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
40
40
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
41
  /* @__PURE__ */u("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&B(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
42
42
  /* @__PURE__ */h("button",{onClick:()=>M.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
43
- /* @__PURE__ */u(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
- /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:v?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:U,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>j(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),B(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-white p-[1in] shadow text-sm leading-relaxed text-gray-800 outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),k&&/* @__PURE__ */u("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */h(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
43
+ /* @__PURE__ */u(c,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
+ /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:v?/* @__PURE__ */u(s,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>j(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),B(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-white p-[1in] shadow text-sm leading-relaxed text-gray-800 outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),k&&/* @__PURE__ */u("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */h(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
45
45
  /* @__PURE__ */u(l,{children:"Image width"}),
46
- /* @__PURE__ */u(a,{onClick:()=>W("25%"),children:"25%"}),
47
- /* @__PURE__ */u(a,{onClick:()=>W("50%"),children:"50%"}),
48
- /* @__PURE__ */u(a,{onClick:()=>W("75%"),children:"75%"}),
49
- /* @__PURE__ */u(a,{onClick:()=>W("100%"),children:"100%"}),
50
- /* @__PURE__ */u(a,{onClick:()=>W(null),children:"Original size"}),
46
+ /* @__PURE__ */u(a,{onClick:()=>T("25%"),children:"25%"}),
47
+ /* @__PURE__ */u(a,{onClick:()=>T("50%"),children:"50%"}),
48
+ /* @__PURE__ */u(a,{onClick:()=>T("75%"),children:"75%"}),
49
+ /* @__PURE__ */u(a,{onClick:()=>T("100%"),children:"100%"}),
50
+ /* @__PURE__ */u(a,{onClick:()=>T(null),children:"Original size"}),
51
51
  /* @__PURE__ */u(i,{}),
52
52
  /* @__PURE__ */u(a,{danger:!0,onClick:()=>{C?.el.remove(),j(!0),D(null)},children:"Remove image"})]})]})}export{f as default};