efficient-shell 15.2.1 → 15.4.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 (66) hide show
  1. package/README.md +10 -0
  2. package/dist/{Browser-QK2CCZTR.js → Browser-NXQ4MAJT.js} +14 -14
  3. package/dist/{Calculator-DB4U2KXJ.js → Calculator-HHAC23S4.js} +22 -22
  4. package/dist/{CurrencyConverter-D5MWU2M2.js → CurrencyConverter-H34LZQBN.js} +8 -8
  5. package/dist/{Files-6WMIQAVD.js → Files-SEN6BFX5.js} +43 -43
  6. package/dist/{Notepad-FKSRP7R6.js → Notepad-4LKFIPTY.js} +9 -9
  7. package/dist/{PomodoroTimer-U62N64F6.js → PomodoroTimer-GZZD7LPW.js} +64 -64
  8. package/dist/{Preview-2GS2CWRA.js → Preview-PCIWBI7G.js} +25 -25
  9. package/dist/{Stock-DUXAE4DY.js → Stock-R5A7NOZT.js} +1 -1
  10. package/dist/{Weather-XXPZTLY7.js → Weather-U2LR5SRL.js} +15 -15
  11. package/dist/{WorldClock-6ANSNTXU.js → WorldClock-HGGHJ5SX.js} +6 -6
  12. package/dist/ai/index.js +8 -8
  13. package/dist/apps/index.js +1 -1
  14. package/dist/bin/browser-check.js +1 -1
  15. package/dist/bin/media-host-check.js +1 -1
  16. package/dist/bin/ui-check.js +1 -1
  17. package/dist/brand.css +1 -1
  18. package/dist/chunk-5VJVEKVM.js +1 -0
  19. package/dist/{chunk-XMBMI27I.js → chunk-A3RD7AQ2.js} +1 -1
  20. package/dist/{chunk-DN6NGGP5.js → chunk-B36ZROD7.js} +6 -6
  21. package/dist/{chunk-TTUUXGEW.js → chunk-CHWZGSYG.js} +1 -1
  22. package/dist/{chunk-WR3SULZW.js → chunk-DVKOVZJ2.js} +8 -8
  23. package/dist/{chunk-422SFOQU.js → chunk-E4WVF6AS.js} +24 -24
  24. package/dist/chunk-GML6FVPA.js +6 -0
  25. package/dist/{chunk-NZNPU2GD.js → chunk-HB2PSIVY.js} +1 -1
  26. package/dist/chunk-JJV7F66E.js +1 -0
  27. package/dist/{chunk-4KPOTWYF.js → chunk-KFVGNKKJ.js} +47 -47
  28. package/dist/{chunk-JA4I5BEB.js → chunk-KTI4ZJVX.js} +1 -1
  29. package/dist/{chunk-26ZOXLE6.js → chunk-L7EQ2DJV.js} +1 -1
  30. package/dist/{chunk-XSMVWJV3.js → chunk-MBWAXS6S.js} +1 -1
  31. package/dist/chunk-OHPDB4UN.js +14 -0
  32. package/dist/{chunk-GL3D5EOZ.js → chunk-PSJLYNBG.js} +3 -3
  33. package/dist/{chunk-EJ5NIA42.js → chunk-QLK2NCXK.js} +1 -1
  34. package/dist/chunk-W7HTHKN2.js +19 -0
  35. package/dist/{chunk-E43VGO66.js → chunk-ZVKUOJNS.js} +1 -1
  36. package/dist/data/statusColumn.js +1 -1
  37. package/dist/forms/LinkPicker.js +1 -1
  38. package/dist/forms/MediaLibrary.js +1 -1
  39. package/dist/forms/Select.d.ts +6 -5
  40. package/dist/forms/Select.js +1 -1
  41. package/dist/forms/TagInput.js +1 -1
  42. package/dist/icons/index.js +1 -1
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +101 -101
  45. package/dist/optionItems-Cxd85rTy.d.ts +26 -0
  46. package/dist/routine-index.json +1 -1
  47. package/dist/shell/LanguageSelect.js +1 -1
  48. package/dist/shell/SearchableSelect.d.ts +3 -9
  49. package/dist/shell/SearchableSelect.js +1 -1
  50. package/dist/telemetry/index.js +1 -1
  51. package/dist/templates/CheckoutTemplate.js +1 -1
  52. package/dist/templates/DataTablePage.js +1 -1
  53. package/dist/templates/FormLayoutPage.js +1 -1
  54. package/dist/tokens/spacing.d.ts +12 -2
  55. package/dist/tokens/spacing.js +1 -1
  56. package/dist/ui/index.d.ts +1 -0
  57. package/dist/ui/index.js +1 -1
  58. package/dist/ui.css +5 -2
  59. package/dist/value-index.json +1 -1
  60. package/dist/version.js +1 -1
  61. package/package.json +1 -1
  62. package/dist/chunk-2RLUG5ID.js +0 -1
  63. package/dist/chunk-C4TG6XS4.js +0 -19
  64. package/dist/chunk-K5YT5PMJ.js +0 -5
  65. package/dist/chunk-SH7PJC4P.js +0 -1
  66. package/dist/chunk-V4BA3FGC.js +0 -14
package/README.md CHANGED
@@ -1695,6 +1695,16 @@ Round 4:
1695
1695
  option checked), `disabled` options (greyed, skipped by the arrows, inert to
1696
1696
  a press), and `clearable={false}` to drop the "×". Groups, flattening and the
1697
1697
  check are shared with `Select`.
1698
+ - **`Select` and `SearchableSelect`: a group with no heading.** A group with
1699
+ `hideHeading: true` draws no heading words: the open list reads as one plain
1700
+ list, and one thin line (the menu's own `PopupMenuDivider`) sets the group
1701
+ off from what comes before it. A screen reader still hears the group's
1702
+ `label` (`role="group"`, `aria-label`). The line is no option and no key
1703
+ stop; a group with a heading gets none, since its heading divides already;
1704
+ an empty group draws nothing (a search that empties one drops it), and the
1705
+ line comes only below an option, so the list never starts or ends on a line. For a list of two kinds that need no word, such as
1706
+ the fonts a site added and then the standard ones. The native list (a
1707
+ `Select` on touch) cannot hide an `<optgroup>`'s label and shows it.
1698
1708
  - **`SearchableSelect` as a list filter, and with several values** (admin
1699
1709
  list pages). `filter` marks a field that filters a list ("All Suppliers").
1700
1710
  While it holds a value it is "on": the accent border and a light accent fill,
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-D7MRZZVV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-GL3D5EOZ.js";import{WindowTitle as n}from"./chunk-4KPOTWYF.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2RLUG5ID.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="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(p);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(d)||k}function N(){const h=a(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,N]=l(k||b),[C,R]=l(w),[P,W]=l([w]),[D,T]=l(0),[H,S]=l(0),[z,Z]=l(x),[U,L]=l(!1),[E,G]=l(null),F=a(null),Y=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(z))}catch{}},[z]);const A=e=>{const t=f(e);t&&(N(t),R(t),W(e=>{const o=e.slice(0,D+1);return o.push(t),o}),T(e=>e+1),L(!1))},J=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},M=()=>{const e=E?.trim();e?(Z(t=>[...t,{label:e,url:w}]),G(null)):G(null)};c(()=>{if(null===E)return;F.current?.focus(),F.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!==E]);const O=e=>{Z(t=>t.filter((t,o)=>o!==e))},Q=D>0,B=D<P.length-1,I=z.some(e=>e.url===w),K="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-D7MRZZVV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-PSJLYNBG.js";import{WindowTitle as n}from"./chunk-KFVGNKKJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-JJV7F66E.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="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(p);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(d)||k}function N(){const h=a(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,N]=l(k||b),[C,R]=l(w),[W,P]=l([w]),[D,S]=l(0),[T,H]=l(0),[z,J]=l(x),[Z,E]=l(!1),[U,F]=l(null),G=a(null),L=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(z))}catch{}},[z]);const M=e=>{const t=f(e);t&&(N(t),R(t),P(e=>{const o=e.slice(0,D+1);return o.push(t),o}),S(e=>e+1),E(!1))},V=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},Y=()=>{const e=U?.trim();e?(J(t=>[...t,{label:e,url:w}]),F(null)):F(null)};c(()=>{if(null===U)return;G.current?.focus(),G.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||F(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const A=e=>{J(t=>t.filter((t,o)=>o!==e))},K=D>0,B=D<W.length-1,O=z.some(e=>e.url===w),Q="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 - ${j(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;T(e),N(P[e]),R(P[e]),L(!1)}},disabled:!Q,className:K,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(D<P.length-1){const e=D+1;T(e),N(P[e]),R(P[e]),L(!1)}},disabled:!B,className:K,title:"Forward",children:/* @__PURE__ */u(i,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>S(e=>e+1),className:K,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>A(b),className:K,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),A(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(D>0){const e=D-1;S(e),N(W[e]),R(W[e]),E(!1)}},disabled:!K,className:Q,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(D<W.length-1){const e=D+1;S(e),N(W[e]),R(W[e]),E(!1)}},disabled:!B,className:Q,title:"Forward",children:/* @__PURE__ */u(i,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>H(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>M(b),className:Q,title:"Home",children:/* @__PURE__ */u(i,{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=>R(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(i,{name:"close"}),onClick:()=>R(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>I?O(z.findIndex(e=>e.url===w)):void G(j(w)),className:K+" "+(I?"text-yellow-500":""),title:I?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:I?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:J,className:K,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>L(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==E&&/* @__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:()=>O?A(z.findIndex(e=>e.url===w)):void F(j(w)),className:Q+" "+(O?"text-yellow-500":""),title:O?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:O?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:V,className:Q,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>E(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__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:E,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-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:G,type:"text",value:U,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key?Y():"Escape"===e.key&&F(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:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:M,disabled:!E.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===z.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),z.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>A(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"})&&O(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:()=>F(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:Y,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"})]})]}),
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===z.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),z.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"})&&A(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(d,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(v,{url:w,iframeKey:H,iframeRef:Y,openExternal:J,showHelp:U,dismissHelp:()=>L(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function v({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[a,p]=l(!1);c(()=>{p(!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)&&!a?/* @__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(v,{url:w,iframeKey:T,iframeRef:L,openExternal:V,showHelp:Z,dismissHelp:()=>E(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function v({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[a,p]=l(!1);c(()=>{p(!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)&&!a?/* @__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(i,{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:[j(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 t,WidgetSettingsModal as e}from"./chunk-NZNPU2GD.js";import{useWidgetSettings as n}from"./chunk-4KPOTWYF.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.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),[j,b]=c(null),[g,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,T]=c(!1),[P,$]=c(()=>t(h)),[D,F]=c(!1),[Z,E]=c(P),S=i(null);n(o(()=>{E({...P}),F(!0)},[P]));const A=o(t=>{y(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),H=o(()=>{k("0"),d(null),b(null),N(!1)},[]),R=o((t,e,n)=>{switch(n){case"+":return t+e;case"-":return t-e;case"×":return t*e;case"÷":return 0===e?0:t/e;default:return e}},[]),W=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=R(p,e,j);k(String(t)),d(t),f(n=>[`${p} ${j} ${e} = ${t}`,...n].slice(0,20))}else d(e);b(t),N(!0)},[m,p,j,g,R]),J=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=R(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),y(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,R]),U=o(()=>{k(t=>String(parseFloat(t)/100))},[]),G=o(()=>{k(t=>t.startsWith("-")?t.slice(1):"0"===t?t:"-"+t)},[]);s(()=>{const t=t=>{const e=t.target.tagName;"INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e&&(t.key>="0"&&t.key<="9"?A(t.key):"."===t.key?A("."):"+"===t.key?W("+"):"-"===t.key?W("-"):"*"===t.key?W("×"):"/"===t.key?(t.preventDefault(),W("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&S.current?.contains(t.target)&&t.preventDefault(),J()):"Escape"===t.key?H():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&U())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[A,W,J,H,U]);const B="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",Q=`${B} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Y=`${B} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,M=`${B} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,w=`${B} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-HB2PSIVY.js";import{useWidgetSettings as n}from"./chunk-KFVGNKKJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.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),[j,b]=c(null),[g,N]=c(!1),[y,C]=c(""),[x,f]=c([]),[v,T]=c(!1),[$,P]=c(()=>t(h)),[E,F]=c(!1),[D,S]=c($),Z=i(null);n(o(()=>{S({...$}),F(!0)},[$]));const A=o(t=>{C(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),H=o(()=>{k("0"),d(null),b(null),N(!1)},[]),J=o((t,e,n)=>{switch(n){case"+":return t+e;case"-":return t-e;case"×":return t*e;case"÷":return 0===e?0:t/e;default:return e}},[]),R=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=J(p,e,j);k(String(t)),d(t),f(n=>[`${p} ${j} ${e} = ${t}`,...n].slice(0,20))}else d(e);b(t),N(!0)},[m,p,j,g,J]),V=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=J(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),C(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,J]),W=o(()=>{k(t=>String(parseFloat(t)/100))},[]),B=o(()=>{k(t=>t.startsWith("-")?t.slice(1):"0"===t?t:"-"+t)},[]);s(()=>{const t=t=>{const e=t.target.tagName;"INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e&&(t.key>="0"&&t.key<="9"?A(t.key):"."===t.key?A("."):"+"===t.key?R("+"):"-"===t.key?R("-"):"*"===t.key?R("×"):"/"===t.key?(t.preventDefault(),R("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&Z.current?.contains(t.target)&&t.preventDefault(),V()):"Escape"===t.key?H():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&W())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[A,R,V,H,W]);const G="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",U=`${G} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,K=`${G} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,M=`${G} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,Q=`${G} 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:P.activeOpacity/100,backdropFilter:P.activeBlur>0?`blur(${P.activeBlur}px)`:void 0},children:[
3
+ /* @__PURE__ */l("div",{ref:Z,className:"flex flex-col h-full",style:{opacity:$.activeOpacity/100,backdropFilter:$.activeBlur>0?`blur(${$.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
- /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((t,e)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:t},e))}),(C||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${j} ${g?"":m}`}),
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((t,e)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:t},e))}),(y||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${j} ${g?"":m}`}),
6
6
  /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),T(!0),setTimeout(()=>T(!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:(t=>{const e=parseFloat(t);return isNaN(e)||t.endsWith(".")||t.endsWith(".0")||Math.abs(e)<1e15&&t.length<16?t:e.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
10
  /* @__PURE__ */u("button",{onClick:H,className:M,children:"AC"}),
11
- /* @__PURE__ */u("button",{onClick:G,className:M,children:"+/−"}),
12
- /* @__PURE__ */u("button",{onClick:U,className:M,children:"%"}),
13
- /* @__PURE__ */u("button",{onClick:()=>W("÷"),className:`${Y} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */u("button",{onClick:()=>A("7"),className:Q,children:"7"}),
15
- /* @__PURE__ */u("button",{onClick:()=>A("8"),className:Q,children:"8"}),
16
- /* @__PURE__ */u("button",{onClick:()=>A("9"),className:Q,children:"9"}),
17
- /* @__PURE__ */u("button",{onClick:()=>W("×"),className:`${Y} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */u("button",{onClick:()=>A("4"),className:Q,children:"4"}),
19
- /* @__PURE__ */u("button",{onClick:()=>A("5"),className:Q,children:"5"}),
20
- /* @__PURE__ */u("button",{onClick:()=>A("6"),className:Q,children:"6"}),
21
- /* @__PURE__ */u("button",{onClick:()=>W("-"),className:`${Y} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */u("button",{onClick:()=>A("1"),className:Q,children:"1"}),
23
- /* @__PURE__ */u("button",{onClick:()=>A("2"),className:Q,children:"2"}),
24
- /* @__PURE__ */u("button",{onClick:()=>A("3"),className:Q,children:"3"}),
25
- /* @__PURE__ */u("button",{onClick:()=>W("+"),className:`${Y} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */u("button",{onClick:()=>A("0"),className:`${Q} col-span-2`,children:"0"}),
27
- /* @__PURE__ */u("button",{onClick:()=>A("."),className:Q,children:"."}),
28
- /* @__PURE__ */u("button",{onClick:J,className:w,children:"="})]})]}),
29
- /* @__PURE__ */u(e,{open:D,onClose:()=>F(!1),title:"Calculator Settings",appearance:Z,onAppearanceChange:E,onSave:()=>{$(Z),localStorage.setItem(h,JSON.stringify(Z)),F(!1)}})]})}export{m as default};
11
+ /* @__PURE__ */u("button",{onClick:B,className:M,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:W,className:M,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${K} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>A("7"),className:U,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>A("8"),className:U,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>A("9"),className:U,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${K} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>A("4"),className:U,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>A("5"),className:U,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>A("6"),className:U,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${K} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>A("1"),className:U,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>A("2"),className:U,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>A("3"),className:U,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${K} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>A("0"),className:`${U} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>A("."),className:U,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:V,className:Q,children:"="})]})]}),
29
+ /* @__PURE__ */u(e,{open:E,onClose:()=>F(!1),title:"Calculator Settings",appearance:D,onAppearanceChange:S,onSave:()=>{P(D),localStorage.setItem(h,JSON.stringify(D)),F(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-NZNPU2GD.js";import{useWidgetSettings as r}from"./chunk-4KPOTWYF.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.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 j(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 g={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)),[D,y]=s({}),[b,S]=s(!1),[C,P]=s(!1),[v,U]=s([]),[J,R]=s(f),[H,A]=s("USD"),[B,T]=s("CNY");r(o(()=>{U([...u]),R({...f}),P(!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,j(e,n.rates))}catch{}}e&&(y(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-HB2PSIVY.js";import{useWidgetSettings as r}from"./chunk-KFVGNKKJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.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 j(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 g={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,D]=s({}),[b,S]=s(!1),[C,v]=s(!1),[P,J]=s([]),[U,R]=s(f),[H,A]=s("USD"),[B,Y]=s("CNY");r(o(()=>{J([...u]),R({...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,j(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
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:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=D[t]?.[e];/* @__PURE__ */
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:[b&&/* @__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:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */m("span",{className:"text-base",children:g[t]||""}),
@@ -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:g[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:()=>P(!1),title:"Currency Settings",appearance:J,onAppearanceChange:R,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),x(J),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(J)),P(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:U,onAppearanceChange:R,onSave:()=>{if(0===P.length)return;const t=P.slice(0,4);d(t),x(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),v(!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:["(",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:[
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",P.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:P.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:[g[t]||""," ",t," → ",g[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))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
17
+ /* @__PURE__ */m("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),P.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
18
  /* @__PURE__ */m("select",{value:H,onChange:t=>A(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
- /* @__PURE__ */m("select",{value:B,onChange:t=>T(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:()=>{H!==B&&v.length<4&&U(t=>[...t,[H,B]])},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};
20
+ /* @__PURE__ */m("select",{value:B,onChange:t=>Y(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:()=>{H!==B&&P.length<4&&J(t=>[...t,[H,B]])},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};