efficient-shell 12.4.1 → 12.7.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 (59) hide show
  1. package/README.md +5 -5
  2. package/dist/{Browser-24JRQIPQ.js → Browser-AKBOECNB.js} +14 -14
  3. package/dist/{Calculator-AHBFZ4EN.js → Calculator-OJLVM42W.js} +22 -22
  4. package/dist/{CurrencyConverter-PZYRBADV.js → CurrencyConverter-UVOKFPMG.js} +7 -7
  5. package/dist/{Files-AZ4Q4LMK.js → Files-CRQDRSFS.js} +88 -88
  6. package/dist/{Notepad-UPHHH3YU.js → Notepad-P6JFXK3G.js} +9 -9
  7. package/dist/{PomodoroTimer-WGN2KNSB.js → PomodoroTimer-UOV4CCYH.js} +63 -63
  8. package/dist/{Preview-K4TNRLKM.js → Preview-XF5FKLVZ.js} +17 -17
  9. package/dist/{Stock-5GEEDQVT.js → Stock-6D4I2EWM.js} +3 -3
  10. package/dist/{Weather-WMQQXWHH.js → Weather-BCOAQJDT.js} +17 -17
  11. package/dist/{WorldClock-IK3WTHVW.js → WorldClock-WX3O3EDU.js} +5 -5
  12. package/dist/apps/index.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/{chunk-NIBE57KV.js → chunk-2HZQZTW5.js} +1 -1
  16. package/dist/{chunk-LCC3NXQX.js → chunk-34SPT4I6.js} +6 -6
  17. package/dist/chunk-6EHPEBGP.js +5 -0
  18. package/dist/chunk-AHJAJLSK.js +99 -0
  19. package/dist/{chunk-WUGQAZMC.js → chunk-EZPSNUYR.js} +4 -4
  20. package/dist/{chunk-VWQNCYGQ.js → chunk-MM5AFQ24.js} +8 -8
  21. package/dist/{chunk-ZB2H2JJ2.js → chunk-NC36LJCA.js} +4 -4
  22. package/dist/{chunk-CURXYF2R.js → chunk-PM4Y2FMQ.js} +3 -3
  23. package/dist/chunk-PWYLGTZS.js +1 -0
  24. package/dist/{chunk-EF3NPTHG.js → chunk-QNYZTD7V.js} +1 -1
  25. package/dist/{chunk-CAXOKGMB.js → chunk-SCU2CWNJ.js} +11 -11
  26. package/dist/chunk-SZT72QMD.js +28 -0
  27. package/dist/chunk-TX5FZBPQ.js +4 -0
  28. package/dist/chunk-UVGEOQI4.js +13 -0
  29. package/dist/{chunk-AAIUJJDQ.js → chunk-WVHGHMW3.js} +1 -1
  30. package/dist/{chunk-5HJIFCDQ.js → chunk-ZKQWS2ML.js} +3 -3
  31. package/dist/data/EntityList.d.ts +4 -0
  32. package/dist/data/EntityList.js +1 -1
  33. package/dist/data/ListFooter.d.ts +7 -12
  34. package/dist/data/ListFooter.js +1 -1
  35. package/dist/format/index.js +1 -1
  36. package/dist/forms/BrandAssetEditor.js +1 -1
  37. package/dist/forms/LinkPicker.js +1 -1
  38. package/dist/forms/MediaLibrary.js +1 -1
  39. package/dist/forms/MediaUploadField.js +1 -1
  40. package/dist/index.d.ts +28 -6
  41. package/dist/index.js +530 -531
  42. package/dist/page-tabs/index.js +5 -5
  43. package/dist/shell/ConfirmDialog.js +1 -1
  44. package/dist/shell/Dialog.js +1 -1
  45. package/dist/shell/Drawer.js +1 -1
  46. package/dist/shell/LanguageSelect.js +1 -1
  47. package/dist/shell/SettingRow.js +1 -1
  48. package/dist/shell/discardGuard.js +1 -1
  49. package/dist/telemetry/index.js +1 -1
  50. package/dist/ui/index.js +1 -1
  51. package/dist/version.js +1 -1
  52. package/package.json +4 -4
  53. package/dist/chunk-4H5NTMOF.js +0 -4
  54. package/dist/chunk-C4IJONGO.js +0 -1
  55. package/dist/chunk-I5CSYOOZ.js +0 -28
  56. package/dist/chunk-PMJMYH5O.js +0 -5
  57. package/dist/chunk-UWF45S5L.js +0 -99
  58. package/dist/chunk-VIOILTE4.js +0 -13
  59. /package/dist/{chunk-2762IAB7.js → chunk-7B5KFESH.js} +0 -0
package/README.md CHANGED
@@ -4,11 +4,11 @@ A desktop-style React UI shell — windows, taskbar, start menu, sticky notes, f
4
4
 
5
5
  > **Status:** v0.8.0 — the bundled Email + Calendar apps and their Node IMAP/SMTP/CalDAV bridge have been removed. Mail is now the consuming app's responsibility.
6
6
 
7
- ### → [Live demo](https://efficient-pty-ltd.github.io/efficient-shell/)
7
+ ### → [Live demo](https://eff-erp.github.io/efficient-shell/)
8
8
 
9
9
  A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky notes, the notepad, all wired to `localStorage` so the page survives a refresh. Source is in [`examples/demo/`](examples/demo/).
10
10
 
11
- [![efficient-shell demo](docs/hero.png)](https://efficient-pty-ltd.github.io/efficient-shell/)
11
+ [![efficient-shell demo](docs/hero.png)](https://eff-erp.github.io/efficient-shell/)
12
12
 
13
13
  <sub>The screenshot is auto-captured against the deployed demo by [`.github/workflows/screenshot.yml`](.github/workflows/screenshot.yml). Run it manually: `gh workflow run "Capture hero screenshot"` (or use the Actions tab).</sub>
14
14
 
@@ -24,7 +24,7 @@ A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky not
24
24
  - **Utilities:** Calculator, Notepad, Weather, CurrencyConverter, PomodoroTimer, WorldClock, TodoList
25
25
  - **Documents / Web:** Preview, Files, Browser
26
26
 
27
- Documents and Spreadsheets are in [`efficient-office`](https://github.com/Efficient-Pty-Ltd/efficient-office) since 12.0.0.
27
+ Documents and Spreadsheets are in [`efficient-office`](https://github.com/eff-erp/efficient-office) since 12.0.0.
28
28
 
29
29
  Most apps ship in the `bundledApps` registry; a few (WorldClock, Notepad) want consumer-supplied prefs wiring to persist content across reloads. The bundled `Customization` settings page is also exported separately for consumers to register at `/settings/customization`.
30
30
 
@@ -1721,7 +1721,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1721
1721
  | `<ShellLanguageProvider languages language strings? onChange? reload?>` | Which interface language is in force. Takes the tag `resolveShellLanguage` chose before mount and that language's shell catalog, mounts `ShellStringsProvider` with both, stamps `<html lang>`, and gives `useShellLanguage()` its `setLanguage`, which saves the choice and reloads. See [Choosing the language](#choosing-the-language--shelllanguageprovider). |
1722
1722
  | `<ShellEntityFetcherProvider value={(endpoint, id) => …}>` | How the modal stack fetches entity data. |
1723
1723
  | `<BugReportConfigProvider value={{ submit, list?, resolve? }}>` | Wire the bug-report flow to your backend. |
1724
- | `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. Desktop sticky notes are their own notes under `desktop_stickies` (saved through `saveStickies`, else the prefs adapter), never Notepad notes; `saveNotes` is deprecated and no longer called. |
1724
+ | `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. Desktop sticky notes are their own notes under `desktop_stickies` (saved through `saveStickies`, else the prefs adapter), never Notepad notes; `saveNotes` is deprecated and no longer called. `entityRefetchInterval` (`number \| false \| () => number \| false`, default 60 000 ms) sets the fallback poll of open entity windows and `entityRefetchOnWindowFocus` (`boolean \| () => boolean`, default `true`) their refetch on tab focus; a host with a realtime socket passes functions that answer `false` while it is connected. A minimized window never polls (restoring it refetches), and a permanent 4xx stops polling whatever the host says. |
1725
1725
  | `<StatusBadgeProvider groups={{ status: 'success' \| ... }} labelFor?>` | Status string → semantic group. `labelFor(status)` gives every badge under it the host's words for a status (an interface in another language passes it once); a status it returns `undefined` for keeps the derived label, and a badge's own `label` still wins. `useStatusLabel()` says a status the same way outside a badge: a filter option, a search result's second line. |
1726
1726
  | `<PortalBrandingProvider load={...} fallback={...}>` | Loads public hostname-scoped Company Profile identity before authentication, applies its favicon and optional derived document title, and exposes it through `usePortalBranding()`. |
1727
1727
  | `setShellApiClient(axios)` | Module-level: register your axios instance once. |
@@ -5081,7 +5081,7 @@ Most "desktop UI" demos on the web are toys with hardcoded windows and no escape
5081
5081
 
5082
5082
  ## Examples
5083
5083
 
5084
- - [`examples/demo`](examples/demo/) — small Vite app showcasing the shell + bundled apps with mock data. Live at [efficient-pty-ltd.github.io/efficient-shell](https://efficient-pty-ltd.github.io/efficient-shell/), deployed automatically by [`.github/workflows/pages.yml`](.github/workflows/pages.yml) on every push to `main`.
5084
+ - [`examples/demo`](examples/demo/) — small Vite app showcasing the shell + bundled apps with mock data. Live at [eff-erp.github.io/efficient-shell](https://eff-erp.github.io/efficient-shell/), deployed automatically by [`.github/workflows/pages.yml`](.github/workflows/pages.yml) on every push to `main`.
5085
5085
 
5086
5086
  ## Contributing
5087
5087
 
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-GZQD6IBV.js";import"./chunk-YZR4T5FZ.js";import"./chunk-EB2UE6ZR.js";import"./chunk-UGOJLNYR.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-5HJIFCDQ.js";import{WindowTitle as n}from"./chunk-UWF45S5L.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import{confirm as s}from"./chunk-CAXOKGMB.js";import"./chunk-PMJMYH5O.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-2762IAB7.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-C4IJONGO.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import{Icon as a}from"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=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&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["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 b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,z]=c([w]),[D,L]=c(0),[J,S]=c(0),[U,E]=c(x),[H,G]=c(!1),[M,T]=c(null),F=i(null),X=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(U))}catch{}},[U]);const B=e=>{const t=f(e);t&&(v(t),W(t),z(e=>{const o=e.slice(0,D+1);return o.push(t),o}),L(e=>e+1),G(!1))},O=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},Q=()=>{const e=M?.trim();e?(E(t=>[...t,{label:e,url:w}]),T(null)):T(null)};l(()=>{if(null===M)return;F.current?.focus(),F.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||T(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==M]);const Y=e=>{E(t=>t.filter((t,o)=>o!==e))},I=D>0,P=D<R.length-1,A=U.some(e=>e.url===w),Z="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-GZQD6IBV.js";import"./chunk-YZR4T5FZ.js";import"./chunk-EB2UE6ZR.js";import"./chunk-UGOJLNYR.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-ZKQWS2ML.js";import{WindowTitle as n}from"./chunk-AHJAJLSK.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import{confirm as s}from"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-PWYLGTZS.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import{Icon as a}from"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=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&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["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 b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,L]=c([w]),[S,z]=c(0),[E,D]=c(0),[J,H]=c(x),[U,G]=c(!1),[T,P]=c(null),B=i(null),F=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(J))}catch{}},[J]);const M=e=>{const t=f(e);t&&(v(t),W(t),L(e=>{const o=e.slice(0,S+1);return o.push(t),o}),z(e=>e+1),G(!1))},Q=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},X=()=>{const e=T?.trim();e?(H(t=>[...t,{label:e,url:w}]),P(null)):P(null)};l(()=>{if(null===T)return;B.current?.focus(),B.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||P(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==T]);const Y=e=>{H(t=>t.filter((t,o)=>o!==e))},Z=S>0,A=S<R.length-1,K=J.some(e=>e.url===w),I="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(D>0){const e=D-1;L(e),v(R[e]),W(R[e]),G(!1)}},disabled:!I,className:Z,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(D<R.length-1){const e=D+1;L(e),v(R[e]),W(R[e]),G(!1)}},disabled:!P,className:Z,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>S(e=>e+1),className:Z,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>B(b),className:Z,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),B(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("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__ */u("button",{onClick:()=>{if(S>0){const e=S-1;z(e),v(R[e]),W(R[e]),G(!1)}},disabled:!Z,className:I,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(S<R.length-1){const e=S+1;z(e),v(R[e]),W(R[e]),G(!1)}},disabled:!A,className:I,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>D(e=>e+1),className:I,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>M(b),className:I,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),M(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("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__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(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…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>A?Y(U.findIndex(e=>e.url===w)):void T(N(w)),className:Z+" "+(A?"text-yellow-500":""),title:A?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:A?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:O,className:Z,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>G(e=>!e),className:Z,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==M&&/* @__PURE__ */m("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:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>K?Y(J.findIndex(e=>e.url===w)):void P(N(w)),className:I+" "+(K?"text-yellow-500":""),title:K?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:K?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:Q,className:I,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>G(e=>!e),className:I,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==T&&/* @__PURE__ */m("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:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:F,type:"text",value:M,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key?Q():"Escape"===e.key&&T(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:B,type:"text",value:T,onChange:e=>P(e.target.value),onKeyDown:e=>{"Enter"===e.key?X():"Escape"===e.key&&P(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>T(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:Q,disabled:!M.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("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===U.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),U.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>B(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&Y(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>P(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:X,disabled:!T.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("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===J.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),J.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>M(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&Y(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("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)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:J,iframeRef:X,openExternal:O,showHelp:H,dismissHelp:()=>G(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:E,iframeRef:F,openExternal:Q,showHelp:U,dismissHelp:()=>G(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -1,29 +1,29 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-NIBE57KV.js";import{useWidgetSettings as n}from"./chunk-UWF45S5L.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import"./chunk-CAXOKGMB.js";import"./chunk-PMJMYH5O.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-2762IAB7.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,$]=c(!1),[E,J]=c(()=>e(h)),[W,D]=c(!1),[T,F]=c(E),S=i(null);n(o(()=>{F({...E}),D(!0)},[E]));const X=o(e=>{y(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),B=o(()=>{k("0"),d(null),g(null),N(!1)},[]),M=o((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}},[]),U=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=M(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,M]),w=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=M(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,M]),A=o(()=>{k(e=>String(parseFloat(e)/100))},[]),G=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?X(e.key):"."===e.key?X("."):"+"===e.key?U("+"):"-"===e.key?U("-"):"*"===e.key?U("×"):"/"===e.key?(e.preventDefault(),U("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&S.current?.contains(e.target)&&e.preventDefault(),w()):"Escape"===e.key?B():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[X,U,w,B,A]);const L="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",H=`${L} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Q=`${L} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,R=`${L} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,P=`${L} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-2HZQZTW5.js";import{useWidgetSettings as n}from"./chunk-AHJAJLSK.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,$]=c(!1),[E,J]=c(()=>e(h)),[W,S]=c(!1),[T,D]=c(E),F=i(null);n(o(()=>{D({...E}),S(!0)},[E]));const H=o(e=>{y(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),U=o(()=>{k("0"),d(null),g(null),N(!1)},[]),X=o((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}},[]),w=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=X(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,X]),A=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=X(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,X]),B=o(()=>{k(e=>String(parseFloat(e)/100))},[]),G=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?H(e.key):"."===e.key?H("."):"+"===e.key?w("+"):"-"===e.key?w("-"):"*"===e.key?w("×"):"/"===e.key?(e.preventDefault(),w("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&F.current?.contains(e.target)&&e.preventDefault(),A()):"Escape"===e.key?U():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&B())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H,w,A,U,B]);const L="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",Q=`${L} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,M=`${L} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,P=`${L} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,R=`${L} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
2
  return l(a,{children:[
3
- /* @__PURE__ */l("div",{ref:S,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
3
+ /* @__PURE__ */l("div",{ref:F,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
4
  /* @__PURE__ */l("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
5
  /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(C||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${b} ${j?"":m}`}),
6
6
  /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!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,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
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)})(m)})]})]}),
9
9
  /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
- /* @__PURE__ */u("button",{onClick:B,className:R,children:"AC"}),
11
- /* @__PURE__ */u("button",{onClick:G,className:R,children:"+/−"}),
12
- /* @__PURE__ */u("button",{onClick:A,className:R,children:"%"}),
13
- /* @__PURE__ */u("button",{onClick:()=>U("÷"),className:`${Q} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */u("button",{onClick:()=>X("7"),className:H,children:"7"}),
15
- /* @__PURE__ */u("button",{onClick:()=>X("8"),className:H,children:"8"}),
16
- /* @__PURE__ */u("button",{onClick:()=>X("9"),className:H,children:"9"}),
17
- /* @__PURE__ */u("button",{onClick:()=>U("×"),className:`${Q} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */u("button",{onClick:()=>X("4"),className:H,children:"4"}),
19
- /* @__PURE__ */u("button",{onClick:()=>X("5"),className:H,children:"5"}),
20
- /* @__PURE__ */u("button",{onClick:()=>X("6"),className:H,children:"6"}),
21
- /* @__PURE__ */u("button",{onClick:()=>U("-"),className:`${Q} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */u("button",{onClick:()=>X("1"),className:H,children:"1"}),
23
- /* @__PURE__ */u("button",{onClick:()=>X("2"),className:H,children:"2"}),
24
- /* @__PURE__ */u("button",{onClick:()=>X("3"),className:H,children:"3"}),
25
- /* @__PURE__ */u("button",{onClick:()=>U("+"),className:`${Q} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */u("button",{onClick:()=>X("0"),className:`${H} col-span-2`,children:"0"}),
27
- /* @__PURE__ */u("button",{onClick:()=>X("."),className:H,children:"."}),
28
- /* @__PURE__ */u("button",{onClick:w,className:P,children:"="})]})]}),
29
- /* @__PURE__ */u(t,{open:W,onClose:()=>D(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:F,onSave:()=>{J(T),localStorage.setItem(h,JSON.stringify(T)),D(!1)}})]})}export{m as default};
10
+ /* @__PURE__ */u("button",{onClick:U,className:P,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:G,className:P,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:B,className:P,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>w("÷"),className:`${M} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>H("7"),className:Q,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>H("8"),className:Q,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>H("9"),className:Q,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>w("×"),className:`${M} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>H("4"),className:Q,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>H("5"),className:Q,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>H("6"),className:Q,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>w("-"),className:`${M} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>H("1"),className:Q,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>H("2"),className:Q,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>H("3"),className:Q,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>w("+"),className:`${M} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>H("0"),className:`${Q} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>H("."),className:Q,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:A,className:R,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:W,onClose:()=>S(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:D,onSave:()=>{J(T),localStorage.setItem(h,JSON.stringify(T)),S(!1)}})]})}export{m as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-NIBE57KV.js";import{useWidgetSettings as r}from"./chunk-UWF45S5L.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import"./chunk-CAXOKGMB.js";import"./chunk-PMJMYH5O.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-2762IAB7.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["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",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[B,A]=s(f),[G,H]=s("USD"),[R,L]=s("CNY");r(o(()=>{U([...u]),A({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-2HZQZTW5.js";import{useWidgetSettings as r}from"./chunk-AHJAJLSK.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-HE767CVB.js";import"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-N7JX27JE.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-5JUG74UR.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JPNAEN53.js";import"./chunk-IFQXTIMY.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UJJXWLHE.js";import"./chunk-XWFLIGDQ.js";import"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["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",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,J]=s(!1),[v,U]=s([]),[H,B]=s(f),[A,G]=s("USD"),[R,L]=s("CNY");r(o(()=>{U([...u]),B({...f}),J(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
3
  /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},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:[
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:j[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:B,onAppearanceChange:A,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(B),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(B)),v(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>J(!1),title:"Currency Settings",appearance:H,onAppearanceChange:B,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),x(H),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(H)),J(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
- /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */i("span",{className:"text-sm",children:[j[t]||""," ",t," → ",j[e]||""," ",e]}),
17
- /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:G,onChange:t=>H(t.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:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
17
+ /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:A,onChange:t=>G(t.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:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
20
  /* @__PURE__ */m("select",{value:R,onChange:t=>L(t.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:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{G!==R&&J.length<4&&U(t=>[...t,[G,R]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
21
+ /* @__PURE__ */m("button",{onClick:()=>{A!==R&&v.length<4&&U(t=>[...t,[A,R]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};