efficient-shell 13.13.0 → 13.15.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 (146) hide show
  1. package/README.md +12 -1
  2. package/dist/{Browser-H3A2AO7Q.js → Browser-KHMTFVKZ.js} +14 -14
  3. package/dist/Calculator-OKVS4UOJ.js +29 -0
  4. package/dist/CurrencyConverter-ZA2NGJWI.js +21 -0
  5. package/dist/{Files-YVC66K6X.js → Files-EN4DDZYV.js} +56 -56
  6. package/dist/Notepad-PHQNEUKW.js +24 -0
  7. package/dist/{PomodoroTimer-I575OSRR.js → PomodoroTimer-PW7BRZUJ.js} +48 -48
  8. package/dist/{Preview-UXATJW7C.js → Preview-OSQHIS3Z.js} +32 -32
  9. package/dist/Stock-2P4NWUNB.js +16 -0
  10. package/dist/{Weather-RPCD2UW3.js → Weather-7LIQ4POB.js} +21 -21
  11. package/dist/{WorldClock-AC3EUSVG.js → WorldClock-KHBYIJQZ.js} +4 -4
  12. package/dist/ai/index.js +47 -47
  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/charts/ChartFrame.js +1 -1
  19. package/dist/charts/SpecChart.js +1 -1
  20. package/dist/{chunk-6LDXTZGE.js → chunk-3OUG6QAD.js} +1 -1
  21. package/dist/{chunk-XRTH47EO.js → chunk-3QNZ7YGZ.js} +66 -66
  22. package/dist/chunk-42RCQEEJ.js +14 -0
  23. package/dist/{chunk-U7WDBCVV.js → chunk-4OBSVO6U.js} +1 -1
  24. package/dist/{chunk-3PLQKRD4.js → chunk-5HBAJ2UA.js} +14 -14
  25. package/dist/{chunk-EMRTVPQ5.js → chunk-6CDWPEND.js} +7 -7
  26. package/dist/{chunk-L3BECLHD.js → chunk-6LS6Q77E.js} +1 -1
  27. package/dist/{chunk-EHNQGKW4.js → chunk-7JG64RQW.js} +1 -1
  28. package/dist/{chunk-FT2YDMG7.js → chunk-A4WNUFLT.js} +1 -1
  29. package/dist/chunk-AOLJKOO6.js +28 -0
  30. package/dist/{chunk-NEHVW324.js → chunk-AWWNMSDN.js} +8 -8
  31. package/dist/chunk-BWJZTHZ6.js +1 -0
  32. package/dist/{chunk-2GMYO6ET.js → chunk-BWLC56GZ.js} +1 -1
  33. package/dist/chunk-CBUBDXJ2.js +1 -0
  34. package/dist/{chunk-S5N37QIV.js → chunk-CGKY4ZRA.js} +1 -1
  35. package/dist/{chunk-IG7JPSBG.js → chunk-D3T3JCUC.js} +1 -1
  36. package/dist/{chunk-B53VREFW.js → chunk-DVHRL3G6.js} +5 -5
  37. package/dist/chunk-EV5BEEVO.js +1 -0
  38. package/dist/chunk-F6UJLCMI.js +19 -0
  39. package/dist/chunk-FHNQC2MA.js +1 -0
  40. package/dist/{chunk-AHMYBYXJ.js → chunk-G4PPHQ23.js} +1 -1
  41. package/dist/chunk-G5UGCAWN.js +17 -0
  42. package/dist/{chunk-LURBH6G4.js → chunk-GKNF53YM.js} +1 -1
  43. package/dist/chunk-GSLZ46DJ.js +24 -0
  44. package/dist/{chunk-GITRDCHS.js → chunk-GURY4WS5.js} +1 -1
  45. package/dist/chunk-HNPJ3V3I.js +6 -0
  46. package/dist/{chunk-2QE6QD4Y.js → chunk-HVHIXX6O.js} +8 -8
  47. package/dist/{chunk-JPKNVTTK.js → chunk-I6JTDAOB.js} +1 -1
  48. package/dist/{chunk-YY7OFUT2.js → chunk-JFRBUVHX.js} +2 -2
  49. package/dist/chunk-KXPXLUNM.js +4 -0
  50. package/dist/chunk-LHHJHTWP.js +1 -0
  51. package/dist/{chunk-QQGNTDMO.js → chunk-LLYMOV4S.js} +1 -1
  52. package/dist/{chunk-AI4A7GYI.js → chunk-NISLELJF.js} +1 -1
  53. package/dist/{chunk-WIFK6TLB.js → chunk-NYKOATR5.js} +1 -1
  54. package/dist/chunk-O2PVZC5D.js +8 -0
  55. package/dist/{chunk-SR6DDTUN.js → chunk-QQK7HKNK.js} +1 -1
  56. package/dist/{chunk-RZJ63ZM4.js → chunk-QVQO3EFL.js} +9 -9
  57. package/dist/{chunk-6LYKIC7W.js → chunk-RZ3OQFOD.js} +6 -6
  58. package/dist/chunk-S25KELFW.js +11 -0
  59. package/dist/{chunk-JHGBFZHL.js → chunk-S6YEPA4I.js} +5 -5
  60. package/dist/{chunk-L3STE7JN.js → chunk-TTLVTJR6.js} +1 -1
  61. package/dist/{chunk-UKBXQXDZ.js → chunk-U6DRRCCG.js} +1 -1
  62. package/dist/{chunk-TNNH6F3V.js → chunk-UGEX7SVM.js} +7 -7
  63. package/dist/chunk-UVCMV2TL.js +1 -0
  64. package/dist/{chunk-PKXHAF43.js → chunk-WJ7U6TGK.js} +6 -6
  65. package/dist/{chunk-HK53EKZH.js → chunk-WLG7BE55.js} +1 -1
  66. package/dist/{chunk-WBXPA7TY.js → chunk-WP43XYL6.js} +1 -1
  67. package/dist/{chunk-JMGDGNM7.js → chunk-WU2ZA6J2.js} +1 -1
  68. package/dist/chunk-YDQBELHJ.js +6 -0
  69. package/dist/{chunk-YNVH2EIE.js → chunk-ZNKZ6J65.js} +3 -3
  70. package/dist/chunk-ZOCE74ED.js +2 -0
  71. package/dist/data/EntityList.js +1 -1
  72. package/dist/data/ResizableTable.js +1 -1
  73. package/dist/data/statusColumn.d.ts +30 -0
  74. package/dist/data/statusColumn.js +1 -0
  75. package/dist/data/useColumnConfig.js +1 -1
  76. package/dist/forms/BorderInput.js +1 -1
  77. package/dist/forms/BrandAssetEditor.js +1 -1
  78. package/dist/forms/ColorPicker.js +1 -1
  79. package/dist/forms/ComposerAttachments.js +1 -1
  80. package/dist/forms/FilePicker.js +1 -1
  81. package/dist/forms/IconPicker.js +1 -1
  82. package/dist/forms/MediaLibrary.js +1 -1
  83. package/dist/forms/MediaUploadField.js +1 -1
  84. package/dist/forms/MediaUploadGrid.js +1 -1
  85. package/dist/forms/MediaUsedInList.js +1 -1
  86. package/dist/forms/TagInput.js +1 -1
  87. package/dist/forms/WidthsBar.js +1 -1
  88. package/dist/icons/brands.node.js +1 -1
  89. package/dist/icons/efficient-glyphs.js +1 -1
  90. package/dist/icons/efficient-looks.js +1 -1
  91. package/dist/icons/efficient.js +1 -1
  92. package/dist/icons/looks/map.js +1 -1
  93. package/dist/icons/payment.js +1 -1
  94. package/dist/icons/sets.js +1 -1
  95. package/dist/index.d.ts +2 -1
  96. package/dist/index.js +517 -517
  97. package/dist/page-tabs/index.js +5 -5
  98. package/dist/shell/Card.js +1 -1
  99. package/dist/shell/ColoredBadge.js +1 -1
  100. package/dist/shell/ConfirmDialog.js +1 -1
  101. package/dist/shell/Dialog.d.ts +14 -4
  102. package/dist/shell/Dialog.js +1 -1
  103. package/dist/shell/Drawer.js +1 -1
  104. package/dist/shell/EditableGrid.js +1 -1
  105. package/dist/shell/ImageLightbox.js +1 -1
  106. package/dist/shell/Popover.js +1 -1
  107. package/dist/shell/SidebarLayout.js +1 -1
  108. package/dist/shell/StatusBadge.d.ts +7 -1
  109. package/dist/shell/StatusBadge.js +1 -1
  110. package/dist/shell/TransferProgress.js +1 -1
  111. package/dist/shell/Tree.js +1 -1
  112. package/dist/shell/discardGuard.js +1 -1
  113. package/dist/telemetry/index.js +1 -1
  114. package/dist/templates/AuthScreen.js +1 -1
  115. package/dist/templates/ChatTemplate.js +1 -1
  116. package/dist/templates/CheckoutTemplate.js +1 -1
  117. package/dist/templates/DashboardTemplate.js +1 -1
  118. package/dist/templates/DataTablePage.js +1 -1
  119. package/dist/templates/EmailTemplate.js +1 -1
  120. package/dist/templates/FormLayoutPage.js +1 -1
  121. package/dist/templates/GalleryTemplate.js +1 -1
  122. package/dist/ui/index.d.ts +2 -1
  123. package/dist/ui/index.js +1 -1
  124. package/dist/ui.css +4 -1
  125. package/dist/version.js +1 -1
  126. package/package.json +1 -1
  127. package/dist/Calculator-3PVLP3UK.js +0 -29
  128. package/dist/CurrencyConverter-JLRIAP2Z.js +0 -21
  129. package/dist/Notepad-BCND3SM3.js +0 -24
  130. package/dist/Stock-EPJQJ3XE.js +0 -16
  131. package/dist/chunk-4S3E3VJH.js +0 -11
  132. package/dist/chunk-64RHGJXK.js +0 -4
  133. package/dist/chunk-6AUQWWUA.js +0 -17
  134. package/dist/chunk-AEEK74UI.js +0 -6
  135. package/dist/chunk-FQD6P6EZ.js +0 -4
  136. package/dist/chunk-GYPYOBG5.js +0 -19
  137. package/dist/chunk-JGKDWDVM.js +0 -27
  138. package/dist/chunk-NJD7HVTP.js +0 -14
  139. package/dist/chunk-NMP74ZCB.js +0 -1
  140. package/dist/chunk-PR3VNBQY.js +0 -28
  141. package/dist/chunk-RIG5FEVS.js +0 -1
  142. package/dist/chunk-S5AGWCMT.js +0 -1
  143. package/dist/chunk-VP64XZR6.js +0 -1
  144. package/dist/chunk-XSHDPG45.js +0 -9
  145. /package/dist/{chunk-JR2HHKVP.js → chunk-HOHHRNCB.js} +0 -0
  146. /package/dist/{chunk-CLEMKDRO.js → chunk-VG6BT2UG.js} +0 -0
package/README.md CHANGED
@@ -955,6 +955,16 @@ opt-in: an item without them is the markup it always was. Menus stay glass.
955
955
  </ContextMenu>
956
956
  ```
957
957
 
958
+ ### Status columns — `statusColumn`, `statusLabel`
959
+
960
+ A list's Status column takes its width from the kit. Pass the column's whole status set, keyed by the stored value (`true` = the badge's own words, a string = the `label` the cell passes to `StatusBadge`), and spread the result into the column:
961
+
962
+ ```tsx
963
+ { key: 'status', label: 'Status', ...statusColumn<Row['status']>({ draft: true, posted: true, cancelled: true }) }
964
+ ```
965
+
966
+ It returns `{ defaultWidth, minWidth }` that fit the longest badge plus the badge and cell padding. `useColumnConfig` never shows a saved width below `minWidth`, so a layout a user saved narrower before opens wide enough. `statusLabel(status)` gives the words the badge derives, for use outside a render.
967
+
958
968
  ### Editor controls — `Slider`, `ColorPicker`, `ImageFocusPoint`, `LinkPicker`, `Tree`, `SortableList`, `IconRail`, `ResizeHandle`, `CornersInput`, `AlignmentGrid`, `IconPicker`, `WidthsBar`
959
969
 
960
970
  These were folded in from `efficient-easel` under harness UI-24, because the
@@ -2012,7 +2022,7 @@ needs `worker-src 'self'` and nothing from a CDN. pdf.js 6 compiles nothing
2012
2022
  with `eval`; a CSP without `'wasm-unsafe-eval'` makes it load the decoders'
2013
2023
  JavaScript fallbacks from `wasmUrl` instead of the WebAssembly ones.
2014
2024
 
2015
- `Dialog`'s `size="xl"` is the width for reading a page in. `size="2xl"` is the big chooser (the editors' media popup). `aside` keeps a dialog open with everything in it while its scrim and panel turn invisible and let the pointer through; the media popup sets it for the length of a drag out of it, then closes (dropped) or comes back (cancelled).
2025
+ `Dialog`'s `size="xl"` is the width for reading a page in. `size="2xl"` is the big chooser (the editors' media popup). `size="full"` is a chooser laid out like a window (the website editor's Add page window): the whole layer inside its gutter, the popup corner, no padding of its own, the title in a head bar with a line under it, a body that fills the rest and scrolls inside itself, and a footer bar. `headerActions` puts buttons beside the cross, at any size, in a grid column of their own so the title never runs under them; they come after the body in the DOM, with the cross. `aside` keeps a dialog open with everything in it while its scrim and panel turn invisible and let the pointer through; the media popup sets it for the length of a drag out of it, then closes (dropped) or comes back (cancelled).
2016
2026
 
2017
2027
  ### UI kit without the window manager — `efficient-shell/ui`
2018
2028
 
@@ -5274,6 +5284,7 @@ itself where the kit has an answer:
5274
5284
  | `chart-dep` | one of those chart libraries declared in `package.json`, whether or not anything imports it (not `devDependencies`) | remove it |
5275
5285
  | `ellipsis-label` | a button, link or menu label that ends in `…` or `...`: the text of `button`, `a`, `option`, `Button`, `IconButton`, `SplitButton`, `Link`, `NavLink`, `PopupMenuItem`, `PopupMenuLabel`, `DropdownMenuItem`, `MenuItem`, `ContextMenuItem` (through any spans inside), a `label` or `aria-label`, and a `label:` in an object. Each branch of a `?:` is read, and so is the English phrase handed to `say()` or `t()` (a key such as `team:menu.remove` has no dots of its own); no other call's result is. A `…` with no word of its own in the same string is a truncation's and is not counted. Not counted yet, by name in `ELLIPSIS_EXEMPT` until the sweep that clears each: `busy` (a listed first word such as Saving, Loading, and the Chinese busy forms), `placeholder` (`placeholder`, `searchPlaceholder`, `emptyOptionLabel`, `blankLabel`) and `prompt` (an `<option value="">` or `{ value: '', label }`) | the label without the dots, saying what it does ("Extend trial"). `…` means only "the words are cut" (owner ruling 2026-10-14) |
5276
5286
  | `colour` | a literal colour, in a script string (`.ts` and `.tsx`) or a stylesheet declaration (`.css`, `.scss`, which this kind alone reads): a hex; an `rgb()` / `rgba()` / `hsl()` / `hsla()` / `hwb()` / `oklch()` / `oklab()` / `lab()` / `lch()` with a number in it; a Tailwind palette class (a colour utility with a hue and a step, or `white` / `black`, under any variant and alpha); a `--color-<hue>-<step>` variable; a named colour as the value of a colour property; and a palette class in `@apply`. A `var()` fallback counts (a fallback is a second palette). Not counted: a role or token, `transparent`, `currentColor`, `url(#…)`, a `#` in a link or id, a comment, a `mask` declaration (its black is alpha) | a colour role: its utility (`text-ink`, `bg-surface`, `border-line`, `bg-accent-fill` …) or `var(--role)`; `COLOUR_ROLES` lists them. A merchant site reads the site theme. A colour a frame needs because the shell's stylesheet cannot reach it is an `allow` entry with its reason (owner ruling 2026-10-23) |
5287
+ | `dialog-frame` | a `className` on a shell `Dialog`, `PopupForm` or `ConfirmDialog` (bare or namespaced) that redraws its frame (a string or a template literal): a zero padding on any side, named or `[0]` / `[0px]`; a width or height cap taken off or set (`none`, `screen`, `full`, any arbitrary value); a height of `full`, `screen` or a viewport unit (`dvh`, `svh` …); an arbitrary width or height in viewport units, a percentage or a `calc()`; a minimum height of the screen. Not counted: a class held in a variable (`className={cls}`), and a `style` prop | a `Dialog` size: `size="full"` for a chooser laid out like a window, with `headerActions` beside the cross |
5277
5288
 
5278
5289
  Known gaps: `rgb()` / `hsl()` colours, colours in `.ts` maps, and
5279
5290
  `createElement('button')` are not counted.
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-PT4GMPUB.js";import"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-L3STE7JN.js";import{WindowTitle as n}from"./chunk-XRTH47EO.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-BG3C4ALM.js";import{confirm as s}from"./chunk-JGKDWDVM.js";import"./chunk-FQD6P6EZ.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-RIG5FEVS.js";import"./chunk-JR2HHKVP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-HK53EKZH.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-NMP74ZCB.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}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()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,S]=l(w),[R,D]=l([w]),[W,z]=l(0),[E,G]=l(0),[M,H]=l(x),[T,U]=l(!1),[L,F]=l(null),J=i(null),K=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(M))}catch{}},[M]);const O=e=>{const t=f(e);t&&(v(t),S(t),D(e=>{const o=e.slice(0,W+1);return o.push(t),o}),z(e=>e+1),U(!1))},P=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},I=()=>{const e=L?.trim();e?(H(t=>[...t,{label:e,url:w}]),F(null)):F(null)};c(()=>{if(null===L)return;J.current?.focus(),J.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!==L]);const Q=e=>{H(t=>t.filter((t,o)=>o!==e))},Z=W>0,A=W<R.length-1,V=M.some(e=>e.url===w),B="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-PT4GMPUB.js";import"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-TTLVTJR6.js";import{WindowTitle as n}from"./chunk-3QNZ7YGZ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import{confirm as s}from"./chunk-GSLZ46DJ.js";import"./chunk-HNPJ3V3I.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-ZOCE74ED.js";import"./chunk-HOHHRNCB.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CBUBDXJ2.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}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()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,S]=l(w),[W,R]=l([w]),[D,z]=l(0),[T,U]=l(0),[G,H]=l(x),[L,E]=l(!1),[J,M]=l(null),Z=i(null),O=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(G))}catch{}},[G]);const F=e=>{const t=f(e);t&&(v(t),S(t),R(e=>{const o=e.slice(0,D+1);return o.push(t),o}),z(e=>e+1),E(!1))},B=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},A=()=>{const e=J?.trim();e?(H(t=>[...t,{label:e,url:w}]),M(null)):M(null)};c(()=>{if(null===J)return;Z.current?.focus(),Z.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||M(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==J]);const I=e=>{H(t=>t.filter((t,o)=>o!==e))},P=D>0,Q=D<W.length-1,K=G.some(e=>e.url===w),V="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(W>0){const e=W-1;z(e),v(R[e]),S(R[e]),U(!1)}},disabled:!Z,className:B,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(W<R.length-1){const e=W+1;z(e),v(R[e]),S(R[e]),U(!1)}},disabled:!A,className:B,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>G(e=>e+1),className:B,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>O(b),className:B,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),O(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;z(e),v(W[e]),S(W[e]),E(!1)}},disabled:!P,className:V,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(D<W.length-1){const e=D+1;z(e),v(W[e]),S(W[e]),E(!1)}},disabled:!Q,className:V,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>U(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>F(b),className:V,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),F(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=>S(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:()=>S(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>V?Q(M.findIndex(e=>e.url===w)):void F(N(w)),className:B+" "+(V?"text-yellow-500":""),title:V?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:V?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:P,className:B,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>U(e=>!e),className:B,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==L&&/* @__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?I(G.findIndex(e=>e.url===w)):void M(N(w)),className:V+" "+(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:B,className:V,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>E(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__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:J,type:"text",value:L,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"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"}),
19
+ /* @__PURE__ */u("input",{ref:Z,type:"text",value:J,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key?A():"Escape"===e.key&&M(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:()=>F(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:I,disabled:!L.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===M.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),M.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>O(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"})&&Q(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:()=>M(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:A,disabled:!J.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===G.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),G.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>F(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"})&&I(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:E,iframeRef:K,openExternal:P,showHelp:T,dismissHelp:()=>U(!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]=l(!1);c(()=>{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:T,iframeRef:O,openExternal:B,showHelp:L,dismissHelp:()=>E(!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]=l(!1);c(()=>{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 ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-7JG64RQW.js";import{useWidgetSettings as n}from"./chunk-3QNZ7YGZ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import"./chunk-GSLZ46DJ.js";import"./chunk-HNPJ3V3I.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-ZOCE74ED.js";import"./chunk-HOHHRNCB.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.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),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[E,S]=c(()=>e(h)),[W,D]=c(!1),[T,G]=c(E),J=i(null);n(o(()=>{G({...E}),D(!0)},[E]));const Z=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),F=o(()=>{k("0"),d(null),g(null),N(!1)},[]),H=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}},[]),M=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=H(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,H]),Q=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=H(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,H]),U=o(()=>{k(e=>String(parseFloat(e)/100))},[]),w=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"?Z(e.key):"."===e.key?Z("."):"+"===e.key?M("+"):"-"===e.key?M("-"):"*"===e.key?M("×"):"/"===e.key?(e.preventDefault(),M("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&J.current?.contains(e.target)&&e.preventDefault(),Q()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&U())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Z,M,Q,F,U]);const A="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",O=`${A} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,R=`${A} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,B=`${A} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,L=`${A} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:J,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
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:C.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
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
+ /* @__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
+ /* @__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:F,className:B,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:w,className:B,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:U,className:B,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>M("÷"),className:`${R} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>Z("7"),className:O,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>Z("8"),className:O,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>Z("9"),className:O,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>M("×"),className:`${R} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>Z("4"),className:O,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>Z("5"),className:O,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>Z("6"),className:O,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>M("-"),className:`${R} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>Z("1"),className:O,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>Z("2"),className:O,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>Z("3"),className:O,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>M("+"),className:`${R} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>Z("0"),className:`${O} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>Z("."),className:O,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:Q,className:L,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:W,onClose:()=>D(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:G,onSave:()=>{S(T),localStorage.setItem(h,JSON.stringify(T)),D(!1)}})]})}export{m as default};
@@ -0,0 +1,21 @@
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-7JG64RQW.js";import{useWidgetSettings as r}from"./chunk-3QNZ7YGZ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import"./chunk-GSLZ46DJ.js";import"./chunk-HNPJ3V3I.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-ZOCE74ED.js";import"./chunk-HOHHRNCB.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.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 j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[G,H]=s(f),[O,R]=s("USD"),[A,B]=s("CNY");r(o(()=>{U([...u]),H({...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__ */
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:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
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
+ /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
+ /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
7
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
8
+ /* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
9
+ /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
10
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
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:G,onAppearanceChange:H,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(G),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(G)),v(!1)},children:/* @__PURE__ */i("div",{children:[
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:[
16
+ /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[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:O,onChange:t=>R(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
+ /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
+ /* @__PURE__ */m("select",{value:A,onChange:t=>B(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:()=>{O!==A&&J.length<4&&U(t=>[...t,[O,A]])},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};