efficient-shell 4.171.0 → 4.175.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 (64) hide show
  1. package/README.md +292 -8
  2. package/dist/{Browser-BW3EZ7B2.js → Browser-PZIVSYLM.js} +14 -14
  3. package/dist/{Calculator-VBK5NSMU.js → Calculator-6BJVESFN.js} +19 -19
  4. package/dist/ConfirmDialog-6PVUVYXZ.js +1 -0
  5. package/dist/{CurrencyConverter-IW6F7HW4.js → CurrencyConverter-4RZZ5STO.js} +6 -6
  6. package/dist/{Documents-VH3JXSSJ.js → Documents-ERSFDOCV.js} +3 -3
  7. package/dist/{Files-R4ZA5MXU.js → Files-3J2DW6ET.js} +23 -23
  8. package/dist/{Notepad-FOITSJJA.js → Notepad-MVMFJE2F.js} +9 -9
  9. package/dist/PdfViewer-RKRGO7Q2.js +1 -0
  10. package/dist/{PomodoroTimer-C4SVIFC6.js → PomodoroTimer-D6VQJICB.js} +25 -25
  11. package/dist/{Preview-5K6LK6WZ.js → Preview-VIHMVC7B.js} +16 -16
  12. package/dist/{Sidebar-FDFNRXJU.js → Sidebar-2BZJ2MEI.js} +20 -20
  13. package/dist/{Spreadsheet-CZC3QU2G.js → Spreadsheet-KTB6JLBV.js} +14 -14
  14. package/dist/{Stock-B4WWEBZH.js → Stock-KRPM6NSB.js} +3 -3
  15. package/dist/{Weather-TDB5AY23.js → Weather-HRH4JHTF.js} +15 -15
  16. package/dist/{WorldClock-HYHDVPBV.js → WorldClock-OUSV52XM.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/chunk-3YTHR7IC.js +1 -0
  20. package/dist/{chunk-NTCAZ6Y3.js → chunk-54OP3M3K.js} +1 -1
  21. package/dist/chunk-6BZCJQCT.js +1003 -0
  22. package/dist/chunk-7LAPNAKS.js +1 -0
  23. package/dist/{chunk-Y3UKUB7V.js → chunk-D3UQLWIZ.js} +15 -15
  24. package/dist/{chunk-HA2WG27U.js → chunk-E2D54MVV.js} +2 -2
  25. package/dist/{chunk-5G4QMZGJ.js → chunk-FEK5ELXS.js} +6 -6
  26. package/dist/{chunk-FWZUTHP5.js → chunk-GCO3A63X.js} +97 -97
  27. package/dist/{chunk-AUKURHBZ.js → chunk-JOOXVX4A.js} +1 -1
  28. package/dist/chunk-KDHXRJIX.js +2 -0
  29. package/dist/{chunk-HNXPIYRS.js → chunk-KG4NRNFS.js} +1 -1
  30. package/dist/{chunk-3U47BTEV.js → chunk-KS7OSQ3Y.js} +11 -11
  31. package/dist/{chunk-KSSAVLO7.js → chunk-L3U2R7DH.js} +1 -1
  32. package/dist/{chunk-FZRQBHTK.js → chunk-LCTSBQBJ.js} +1 -1
  33. package/dist/{chunk-5J2TKKGH.js → chunk-REXHKIIJ.js} +1 -1
  34. package/dist/{chunk-7YFAFXQG.js → chunk-RKR5V4QR.js} +8 -8
  35. package/dist/{chunk-2UIKLYAI.js → chunk-TMQEH7WA.js} +1 -1
  36. package/dist/{chunk-4P3IWZUC.js → chunk-VIIBZ6DE.js} +10 -10
  37. package/dist/{chunk-36QX6LOQ.js → chunk-VRLHUZSC.js} +1 -1
  38. package/dist/{chunk-S2AZZGFF.js → chunk-W32SKK3D.js} +1 -1
  39. package/dist/chunk-W33ZFDRR.js +1 -0
  40. package/dist/{chunk-ECFMRDUP.js → chunk-XJYXKO7K.js} +16 -16
  41. package/dist/{chunk-CRI4UFBU.js → chunk-YJRC6IKD.js} +3 -3
  42. package/dist/chunk-ZOPYAOUP.js +3 -0
  43. package/dist/file-intake/index.js +1 -1
  44. package/dist/format/index.d.ts +1 -1
  45. package/dist/format/index.js +1 -1
  46. package/dist/{index-Dq20bi8D.d.ts → index-DIaav9a1.d.ts} +205 -11
  47. package/dist/{index-DCUzlKPZ.d.ts → index-DpUDK9zG.d.ts} +5 -0
  48. package/dist/index.d.ts +14 -6
  49. package/dist/index.js +656 -650
  50. package/dist/map/index.js +3 -3
  51. package/dist/page-tabs/index.js +5 -5
  52. package/dist/pdf/index.js +1 -1
  53. package/dist/sounds-FO772MN2.js +1 -0
  54. package/dist/ui/index.d.ts +2 -2
  55. package/dist/ui/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/ConfirmDialog-YRCG3W2T.js +0 -1
  58. package/dist/PdfViewer-S2B2DZYB.js +0 -1
  59. package/dist/chunk-67ZUPDWG.js +0 -1
  60. package/dist/chunk-6KO2U66R.js +0 -3
  61. package/dist/chunk-BUTSU7FO.js +0 -1
  62. package/dist/chunk-GKLJ2SYS.js +0 -995
  63. package/dist/chunk-NCQLGQYR.js +0 -1
  64. package/dist/sounds-OMHXVVQ4.js +0 -1
package/README.md CHANGED
@@ -969,7 +969,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
969
969
  | `<ShellEntityFetcherProvider value={(endpoint, id) => …}>` | How the modal stack fetches entity data. |
970
970
  | `<BugReportConfigProvider value={{ submit, list?, resolve? }}>` | Wire the bug-report flow to your backend. |
971
971
  | `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. |
972
- | `<StatusBadgeProvider groups={{ status: 'success' \| ... }}>` | Status string → semantic group. |
972
+ | `<StatusBadgeProvider groups={{ status: 'success' \| ... }} labelFor?>` | Status string → semantic group. `labelFor(status)` gives every badge under it the host's words for a status (an interface in another language passes it once); a status it returns `undefined` for keeps the derived label, and a badge's own `label` still wins. `useStatusLabel()` says a status the same way outside a badge: a filter option, a search result's second line. |
973
973
  | `<PortalBrandingProvider load={...} fallback={...}>` | Loads public hostname-scoped Company Profile identity before authentication, applies its favicon and optional derived document title, and exposes it through `usePortalBranding()`. |
974
974
  | `setShellApiClient(axios)` | Module-level: register your axios instance once. |
975
975
  | `setShellAuthBridge({ user, logout })` | Module-level: register user identity / logout handler. |
@@ -1681,6 +1681,29 @@ const { language, languages, setLanguage } = useShellLanguage();
1681
1681
  - **`reload={false}`** leaves the switch to you: the choice is saved and
1682
1682
  `onChange` runs, and you re-render the provider with the new `language` and
1683
1683
  `strings`.
1684
+ - **The pickers.** `<LanguageSelect />` is the compact one, a globe and a
1685
+ dropdown for a sign-in screen's corner. `<LanguagePanel description? />` is
1686
+ the Settings section: a heading, what the choice changes, the languages as a
1687
+ radio list, and the note that choosing one reloads the page; pass it as a
1688
+ `SystemPreferences` section's `render`. Both list each language in its own
1689
+ words with its own `lang`, both call `setLanguage`, and both draw nothing
1690
+ while only one language is offered, so a host can mount them before its
1691
+ second language is ready. Their own words are the catalog's `language`
1692
+ section.
1693
+ - **Page tabs follow the language.** `PageTabsProvider` records the language
1694
+ with the tabs it saves. A title a page gave its tab is restored as saved,
1695
+ except after a language change, when the tab takes its route's title until
1696
+ its page mounts and titles it again.
1697
+
1698
+ **The windowed shell's lists, records and forms are in the catalog too.**
1699
+ `EntityList`'s row menu and its copy and export toasts (`entityList`),
1700
+ `ResizableTable`'s column chooser (`columns`), a record window with no record
1701
+ to draw (`record`), `ChangePasswordForm` (`password`), `PdfActionButton`
1702
+ (`pdfAction`), `UndoControls` (`undo`), the copy icon beside a record's number
1703
+ (`copy`), the plain "Loading..." line (`loading`) and `SoundsPanel`'s scheme
1704
+ and event names (`sounds`). Their own props — `submitLabel`, `doneLabel`, the
1705
+ PDF button's `label`, a list's `errorTitle` — still win, and the keys a sound
1706
+ scheme is stored under are identifiers, never translated.
1684
1707
 
1685
1708
  **What is not in the catalog, on purpose:** month and weekday names (the
1686
1709
  `locale` supplies them); file-format names in `BrandAssetEditor`'s default
@@ -1690,7 +1713,7 @@ tables read); the sample content of the starter templates (`DashboardTemplate`,
1690
1713
  `AuthScreen` and the rest are demos to copy, not components to configure); and
1691
1714
  console warnings, which are for developers.
1692
1715
 
1693
- **The full catalog** — 39 sections, 362 keys. A function's default is shown
1716
+ **The full catalog** — 56 sections, 525 keys. A function's default is shown
1694
1717
  with sample arguments.
1695
1718
 
1696
1719
  <details><summary><code>window</code> — 17 keys</summary>
@@ -1828,7 +1851,7 @@ with sample arguments.
1828
1851
 
1829
1852
  </details>
1830
1853
 
1831
- <details><summary><code>pageTabs</code> — 13 keys</summary>
1854
+ <details><summary><code>pageTabs</code> — 16 keys</summary>
1832
1855
 
1833
1856
  | Key | Type | English default |
1834
1857
  |---|---|---|
@@ -1839,6 +1862,9 @@ with sample arguments.
1839
1862
  | `closeRight` | `string` | `Close tabs to the right` |
1840
1863
  | `closeAll` | `string` | `Close all tabs` |
1841
1864
  | `unsaved` | `string` | `Unsaved changes` |
1865
+ | `copy` | `(text: string) => string` | `Copy {text}` |
1866
+ | `copied` | `string` | `Copied` |
1867
+ | `tabMenu` | `string` | `Window menu` |
1842
1868
  | `discardTitle` | `string` | `Discard unsaved changes?` |
1843
1869
  | `discardOne` | `string` | `This page has changes that have not been saved. Close it anyway?` |
1844
1870
  | `discardMany` | `string` | `pages have changes that have not been saved. Close them anyway?` |
@@ -1932,11 +1958,12 @@ with sample arguments.
1932
1958
 
1933
1959
  </details>
1934
1960
 
1935
- <details><summary><code>list</code> — 8 keys</summary>
1961
+ <details><summary><code>list</code> — 9 keys</summary>
1936
1962
 
1937
1963
  | Key | Type | English default |
1938
1964
  |---|---|---|
1939
1965
  | `selected` | `(count: number) => string` | `3 selected` |
1966
+ | `selectedNotShown` | `(count: number, notShown: number) => string` | `3 selected, 3 not shown` |
1940
1967
  | `allLoaded` | `(total: number, label: string) => string` | `All 3 {label} loaded` |
1941
1968
  | `count` | `(total: number, label: string) => string` | `3 {label}` |
1942
1969
  | `loadedOf` | `(loaded: number, total: number, label: string) => string` | `3 of 3 {label}` |
@@ -2016,13 +2043,15 @@ with sample arguments.
2016
2043
 
2017
2044
  </details>
2018
2045
 
2019
- <details><summary><code>copy</code> — 5 keys</summary>
2046
+ <details><summary><code>copy</code> — 7 keys</summary>
2020
2047
 
2021
2048
  | Key | Type | English default |
2022
2049
  |---|---|---|
2023
2050
  | `copy` | `string` | `Copy` |
2024
2051
  | `copyLabel` | `(label: string) => string` | `Copy {label}` |
2025
2052
  | `copied` | `string` | `Copied` |
2053
+ | `copyValue` | `(value: string) => string` | `Copy {value}` |
2054
+ | `copiedValue` | `string` | `Copied!` |
2026
2055
  | `copiedLabel` | `(label: string) => string` | `{label} copied` |
2027
2056
  | `failed` | `string` | `Could not copy to the clipboard` |
2028
2057
 
@@ -2139,6 +2168,60 @@ with sample arguments.
2139
2168
 
2140
2169
  </details>
2141
2170
 
2171
+ <details><summary><code>resizeHandle</code> — 2 keys</summary>
2172
+
2173
+ | Key | Type | English default |
2174
+ |---|---|---|
2175
+ | `label` | `string` | `Resize panel` |
2176
+ | `hint` | `string` | `Drag to resize · double-click to reset` |
2177
+
2178
+ </details>
2179
+
2180
+ <details><summary><code>number</code> — 2 keys</summary>
2181
+
2182
+ | Key | Type | English default |
2183
+ |---|---|---|
2184
+ | `increase` | `string` | `Increase` |
2185
+ | `decrease` | `string` | `Decrease` |
2186
+
2187
+ </details>
2188
+
2189
+ <details><summary><code>slider</code> — 1 keys</summary>
2190
+
2191
+ | Key | Type | English default |
2192
+ |---|---|---|
2193
+ | `value` | `(label: string) => string` | `{label} value` |
2194
+
2195
+ </details>
2196
+
2197
+ <details><summary><code>color</code> — 9 keys</summary>
2198
+
2199
+ | Key | Type | English default |
2200
+ |---|---|---|
2201
+ | `swatch` | `(label: string, value: string) => string` | `{label}: {value}` |
2202
+ | `none` | `string` | `None` |
2203
+ | `panel` | `(label: string) => string` | `{label} picker` |
2204
+ | `square` | `string` | `Saturation and brightness` |
2205
+ | `squareValue` | `(saturation: number, brightness: number) => string` | `Saturation 3%, brightness 3%` |
2206
+ | `hue` | `string` | `Hue` |
2207
+ | `hex` | `(label: string) => string` | `{label} hex code` |
2208
+ | `presets` | `string` | `Presets` |
2209
+ | `clear` | `string` | `No color` |
2210
+
2211
+ </details>
2212
+
2213
+ <details><summary><code>tree</code> — 5 keys</summary>
2214
+
2215
+ | Key | Type | English default |
2216
+ |---|---|---|
2217
+ | `empty` | `string` | `Nothing here yet` |
2218
+ | `dropHere` | `string` | `Drop here` |
2219
+ | `dragHint` | `string` | `Drag to move` |
2220
+ | `moveHint` | `string` | `Alt+Arrow Up or Alt+Arrow Down moves it` |
2221
+ | `insertHere` | `string` | `Insert here` |
2222
+
2223
+ </details>
2224
+
2142
2225
  <details><summary><code>layout</code> — 17 keys</summary>
2143
2226
 
2144
2227
  | Key | Type | English default |
@@ -2363,6 +2446,193 @@ with sample arguments.
2363
2446
 
2364
2447
  </details>
2365
2448
 
2449
+ <details><summary><code>map</code> — 14 keys</summary>
2450
+
2451
+ | Key | Type | English default |
2452
+ |---|---|---|
2453
+ | `failed` | `string` | `The map could not be drawn here. The list has everything it shows.` |
2454
+ | `approximate` | `(label: string) => string` | `{label}, approximate location` |
2455
+ | `approximateTitle` | `(label: string) => string` | `{label} (approximate)` |
2456
+ | `places` | `(count: number) => string` | `places` (`place` for one) |
2457
+ | `group` | `(count: number, noun: string) => string` | `3 {noun} here` |
2458
+ | `stops` | `(numbers: string) => string` | `Stops {numbers}` |
2459
+ | `closeBy` | `(count: number, noun: string) => string` | `3 more {noun} close by, drawn when the map is closer` |
2460
+ | `spread` | `string` | `Press to see them apart` |
2461
+ | `cycle` | `string` | `They stand on one spot: press for the next of them` |
2462
+ | `fullScreen` | `string` | `Full screen` |
2463
+ | `leaveFullScreen` | `string` | `Leave full screen` |
2464
+ | `chosen` | `(label: string) => string` | `{label}, chosen on the map` |
2465
+ | `closeCard` | `string` | `Close` |
2466
+ | `openRecord` | `string` | `Open` |
2467
+
2468
+ </details>
2469
+
2470
+ <details><summary><code>pdf</code> — 16 keys</summary>
2471
+
2472
+ | Key | Type | English default |
2473
+ |---|---|---|
2474
+ | `previousPage` | `string` | `Previous page` |
2475
+ | `nextPage` | `string` | `Next page` |
2476
+ | `pageOf` | `(page: number, total: number) => string` | `2 / 5` |
2477
+ | `zoomOut` | `string` | `Zoom out` |
2478
+ | `zoomIn` | `string` | `Zoom in` |
2479
+ | `zoom` | `string` | `Zoom` |
2480
+ | `fitWidth` | `string` | `Fit width` |
2481
+ | `fitPage` | `string` | `Fit page` |
2482
+ | `fit` | `string` | `Fit` |
2483
+ | `fitHint` | `string` | `Fit to the pane: follows its size until you zoom by hand` |
2484
+ | `print` | `string` | `Print` |
2485
+ | `download` | `string` | `Download` |
2486
+ | `email` | `string` | `Email` |
2487
+ | `loading` | `string` | `Loading PDF…` |
2488
+ | `loadFailed` | `string` | `Failed to load PDF` |
2489
+ | `allowPopups` | `string` | `Allow popups to print` |
2490
+
2491
+ </details>
2492
+
2493
+ <details><summary><code>loading</code> — 1 keys</summary>
2494
+
2495
+ | Key | Type | English default |
2496
+ |---|---|---|
2497
+ | `label` | `string` | `Loading...` |
2498
+
2499
+ </details>
2500
+
2501
+ <details><summary><code>language</code> — 3 keys</summary>
2502
+
2503
+ | Key | Type | English default |
2504
+ |---|---|---|
2505
+ | `title` | `string` | `Language` |
2506
+ | `description` | `string` | `The language of menus, labels and messages.` |
2507
+ | `reloadNote` | `string` | `The page reloads when you change the language.` |
2508
+
2509
+ </details>
2510
+
2511
+ <details><summary><code>entityList</code> — 15 keys</summary>
2512
+
2513
+ | Key | Type | English default |
2514
+ |---|---|---|
2515
+ | `open` | `string` | `Open` |
2516
+ | `copy` | `string` | `Copy` |
2517
+ | `copyColumn` | `(column: string) => string` | `Copy {column}` |
2518
+ | `copyRows` | `(count: number) => string` | `Copy 3 rows` (`Copy row` for one) |
2519
+ | `exportSelected` | `string` | `Export selected to CSV` |
2520
+ | `selectAll` | `string` | `Select all` |
2521
+ | `selectAllLoaded` | `(loaded: number) => string` | `Select all 3 loaded` |
2522
+ | `clearSelection` | `string` | `Clear selection` |
2523
+ | `refresh` | `string` | `Refresh` |
2524
+ | `copiedText` | `string` | `Text` |
2525
+ | `copiedRows` | `(count: number) => string` | `3 rows` (`Row` for one) |
2526
+ | `exported` | `(count: number) => string` | `Exported 3 rows.` (`Exported 1 row.` for one) |
2527
+ | `exportTruncated` | `(kept: number, asked: number) => string` | `Exported 5000 of 8000 rows. The server capped this export, so the file is incomplete.` |
2528
+ | `exportTruncatedUnknown` | `(asked: number) => string` | `Exported only some of the 8000 rows. The server capped this export, so the file is incomplete.` |
2529
+ | `exportFailed` | `string` | `CSV export failed.` |
2530
+
2531
+ </details>
2532
+
2533
+ <details><summary><code>columns</code> — 9 keys</summary>
2534
+
2535
+ | Key | Type | English default |
2536
+ |---|---|---|
2537
+ | `choose` | `string` | `Choose columns` |
2538
+ | `heading` | `string` | `Columns` |
2539
+ | `reset` | `string` | `Reset` |
2540
+ | `saveDefault` | `string` | `Save as default for all users` |
2541
+ | `savedDefault` | `string` | `Saved as default` |
2542
+ | `select` | `string` | `Select` |
2543
+ | `selectDone` | `string` | `Done` |
2544
+ | `showSelection` | `string` | `Show selection column` |
2545
+ | `hideSelection` | `string` | `Hide selection column` |
2546
+
2547
+ </details>
2548
+
2549
+ <details><summary><code>record</code> — 8 keys</summary>
2550
+
2551
+ | Key | Type | English default |
2552
+ |---|---|---|
2553
+ | `loading` | `string` | `Loading record…` |
2554
+ | `signInRequired` | `string` | `Sign in required` |
2555
+ | `signInBody` | `string` | `Your session may have expired. Sign in again to open this record.` |
2556
+ | `notFound` | `string` | `Record not found` |
2557
+ | `loadFailed` | `string` | `Couldn't load record` |
2558
+ | `checkConnection` | `string` | `Check your connection and try again.` |
2559
+ | `rejected` | `string` | `The server rejected this request.` |
2560
+ | `retry` | `string` | `Try again` |
2561
+
2562
+ </details>
2563
+
2564
+ <details><summary><code>password</code> — 11 keys</summary>
2565
+
2566
+ | Key | Type | English default |
2567
+ |---|---|---|
2568
+ | `current` | `string` | `Current Password` |
2569
+ | `newPassword` | `string` | `New Password` |
2570
+ | `confirm` | `string` | `Confirm Password` |
2571
+ | `submit` | `string` | `Change Password` |
2572
+ | `submitting` | `string` | `Changing...` |
2573
+ | `done` | `string` | `Done` |
2574
+ | `currentRequired` | `string` | `Current password is required.` |
2575
+ | `tooShort` | `(minLength: number) => string` | `New password must be at least 8 characters.` |
2576
+ | `mismatch` | `string` | `Passwords do not match.` |
2577
+ | `failed` | `string` | `Failed to change password.` |
2578
+ | `changed` | `string` | `Your password has been changed successfully.` |
2579
+
2580
+ </details>
2581
+
2582
+ <details><summary><code>pdfAction</code> — 10 keys</summary>
2583
+
2584
+ | Key | Type | English default |
2585
+ |---|---|---|
2586
+ | `label` | `string` | `PDF` |
2587
+ | `loading` | `string` | `Loading...` |
2588
+ | `preview` | `string` | `Preview` |
2589
+ | `download` | `string` | `Download` |
2590
+ | `email` | `string` | `Send by Email` |
2591
+ | `downloaded` | `(filename: string) => string` | `{filename} downloaded.` |
2592
+ | `tookTooLong` | `(filename: string) => string` | `{filename} took too long to load. Please try again.` |
2593
+ | `previewLoading` | `string` | `LOADING PDF` |
2594
+ | `previewTookTooLong` | `string` | `This document took too long to load. Close this window and try again.` |
2595
+ | `previewFailed` | `string` | `Failed to load PDF.` |
2596
+
2597
+ </details>
2598
+
2599
+ <details><summary><code>undo</code> — 6 keys</summary>
2600
+
2601
+ | Key | Type | English default |
2602
+ |---|---|---|
2603
+ | `undo` | `string` | `Undo` |
2604
+ | `redo` | `string` | `Redo` |
2605
+ | `undoStep` | `(label: string, keys: string) => string` | `Undo {label} ({keys})` |
2606
+ | `redoStep` | `(label: string, keys: string) => string` | `Redo {label} ({keys})` |
2607
+ | `nothingToUndo` | `string` | `Nothing to undo` |
2608
+ | `nothingToRedo` | `string` | `Nothing to redo` |
2609
+
2610
+ </details>
2611
+
2612
+ <details><summary><code>sounds</code> — 17 keys</summary>
2613
+
2614
+ | Key | Type | English default |
2615
+ |---|---|---|
2616
+ | `title` | `string` | `Sounds` |
2617
+ | `enable` | `string` | `Sound effects` |
2618
+ | `autosave` | `string` | `Changes are saved automatically` |
2619
+ | `choice` | `(event: string, pack: string) => string` | `{event} — {pack}` |
2620
+ | `packClassic` | `string` | `Classic` |
2621
+ | `packMinimal` | `string` | `Minimal` |
2622
+ | `packRetro` | `string` | `Retro` |
2623
+ | `packSoft` | `string` | `Soft` |
2624
+ | `packArcade` | `string` | `Arcade` |
2625
+ | `packSilent` | `string` | `Silent` |
2626
+ | `eventClick` | `string` | `Click` |
2627
+ | `eventSuccess` | `string` | `Success` |
2628
+ | `eventError` | `string` | `Error` |
2629
+ | `eventNotification` | `string` | `Notification` |
2630
+ | `eventStartup` | `string` | `Startup` |
2631
+ | `eventTimerDone` | `string` | `Timer` |
2632
+ | `eventLogout` | `string` | `Logout` |
2633
+
2634
+ </details>
2635
+
2366
2636
  ### Brand surfaces — `efficient-shell/brand.css`
2367
2637
 
2368
2638
  For output that is not a portal window — a report, a published artifact, a
@@ -2640,8 +2910,8 @@ missing or cannot be read. All of them are also exported from
2640
2910
  | `formatTime(value, options?)` | `9:30 am` — twelve-hour, small am/pm; a `locale` gives the locale's own clock. |
2641
2911
  | `getUserTimezone()`, `setUserTimezone(zone)`, `syncTimezoneFromProfile(zone)`, `TZ_AUTO` | The zone setting. `undefined` / `'auto'` follow the browser. Call `syncTimezoneFromProfile` when the signed-in user loads; a blank value changes nothing. |
2642
2912
  | `getUserDateFormat()`, `setUserDateFormat(key)`, `DATE_FORMAT_OPTIONS` | The format setting and the 16 formats a settings page offers. |
2643
- | `timeAgo(value, { precise? })` | `just now` under a minute, then `5m ago`, `3h ago`, `2d ago`; from seven days on the date (`formatDate`). A future time is `just now`. `precise` counts seconds (`12s ago`) for a status screen. Takes a string, a `Date` or epoch ms. |
2644
- | `<TimeAgo value precise? className? />` | `timeAgo` in a `<time>` whose hover (`title`) is the full `formatDateTime`. Use it wherever a relative time is shown. |
2913
+ | `timeAgo(value, { precise? })` | `just now` under a minute, then `5m ago`, `3h ago`, `2d ago`; from seven days on the date (`formatDate`). A future time is `just now`. `precise` counts seconds (`12s ago`) for a status screen. Takes a string, a `Date` or epoch ms. With `locale` (a BCP 47 tag) the words are `Intl.RelativeTimeFormat`'s in that language, and the fallback date is written in it too. |
2914
+ | `<TimeAgo value precise? locale? className? />` | `timeAgo` in a `<time>` whose hover (`title`) is the full `formatDateTime`. Use it wherever a relative time is shown. It follows `ShellStringsProvider`'s `locale`; pass `locale` to override. |
2645
2915
  | `setCurrencyFormats(catalog)` | Hand the kit the currency catalog (`/api/currencies/`: `{ AUD: { symbol: 'A$', decimals: 2 }, … }`) once a session starts. Until then amounts show their code. |
2646
2916
  | `formatMoney(amount, currency?, { whole? })` | `A$1,234.50`, `-€50.00`, `CHF 1,200.00`. The catalog's symbol — an unknown code prints as the code, never a guessed `$`. Minus first, commas, the catalog's decimals (2 by default); `whole` drops them (`A$3,841`) for a storefront card. No currency prints the bare figure. Takes a number or the API's string. |
2647
2917
  | `currencySymbol(code)`, `currencyDecimals(code)` | The two catalog lookups `formatMoney` uses. |
@@ -2713,6 +2983,11 @@ A host with its own switcher calls `applyIconSet(name)` or `setIconSet(name)`;
2713
2983
  `iconSets()` lists what is registered. Like `corners`, a call without the key
2714
2984
  leaves the choice alone.
2715
2985
 
2986
+ Customization offers the choice itself: an **Icons** row under Corners, one
2987
+ option per registered set by its `label`, with a strip of everyday icons
2988
+ drawn in the set that is active. It appears only when a host has registered
2989
+ more than one set, since one set is nothing to choose between.
2990
+
2716
2991
  **A product's own glyphs.** An editor's block types and settings rows are not
2717
2992
  in the catalogue. Register them and draw them by `glyph`, with no icon package
2718
2993
  imported:
@@ -2726,6 +3001,15 @@ They are found under any theme. `efficient-shell/icons/efficient` also exports
2726
3001
  each house glyph as a component (`TrashIcon`, `StylesIcon`, `PaddingTopIcon`,
2727
3002
  …, `size` 18 by default) for code that wants one drawing whatever the theme.
2728
3003
 
3004
+ **Adding or changing a house glyph.** `src/icons/efficient.json` is the source
3005
+ (one meaning, one SVG: a 24 by 24 viewBox, stroke 1.7 on `currentColor`,
3006
+ transparent background). Edit it, run `npm run icons`, and commit both files.
3007
+ Look before you keep a drawing: `node scripts/icons/glyph-sheet.mjs <new>
3008
+ <neighbours…>` writes a sheet that draws it at 16px, the size a settings row
3009
+ wears it, beside the glyphs it could be mistaken for.
3010
+ `tests/efficientGlyphs.test.tsx` holds the standard and every decision made
3011
+ about the set so far.
3012
+
2729
3013
  With no set registered, `<Icon>` draws nothing and warns once per meaning. The
2730
3014
  kit's own components (a window's close button, a filter chip) keep drawing
2731
3015
  through a built-in fallback, so a host that registers nothing sees no change.
@@ -2768,7 +3052,7 @@ itself where the kit has an answer:
2768
3052
  | `radius` | a literal corner radius: an arbitrary-value radius class (`rounded-[4px]`) or an inline `borderRadius` number or length (not `inherit`, `var(…)`, `50%` or `9999`) | a scale utility or a role token; the theme's Corners setting shapes them |
2769
3053
  | `kit` | an import of a second UI kit (`@headlessui`, `@radix-ui`, `@mui`, `antd`, `sonner`, …) | the kit's component |
2770
3054
  | `icon` | an import of an icon package (`@heroicons`, `lucide-react`, `@tabler/icons`, …) | `<Icon name>` from `efficient-shell/icons` |
2771
- | `kit-dep` | one of those packages declared in `package.json` (not `devDependencies`) | remove it |
3055
+ | `kit-dep` | one of those packages declared in `package.json` (not `devDependencies`, and not one the shell needs from an entry the repository imports: `@headlessui/react` and `@heroicons/react` for the root entry, an icon set's own package) | remove it |
2772
3056
 
2773
3057
  Known gaps: `rgb()` / `hsl()` colours, colours in `.ts` maps, and
2774
3058
  `createElement('button')` are not counted.
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-36QX6LOQ.js";import{WindowTitle as r}from"./chunk-FWZUTHP5.js";import"./chunk-DSSLOQDW.js";import"./chunk-6KO2U66R.js";import"./chunk-67ZUPDWG.js";import"./chunk-CRI4UFBU.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import{confirm as n}from"./chunk-ECFMRDUP.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.js";import"./chunk-YKZHOXI4.js";import{useRef as a,useEffect as i,useState as s}from"react";import{jsxs as l,jsx as c,Fragment as m}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",u="react-os-shell:browser-homepage",h="https://en.wikipedia.org/wiki/Main_Page",p=[{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 b(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 k=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function f(){if("undefined"==typeof window)return p;try{const e=localStorage.getItem(d);if(!e)return p;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return p}function x(){return"undefined"==typeof window?h:localStorage.getItem(u)||h}function w(){const m=a(void 0);void 0===m.current&&(m.current=e()),i(()=>{null!=m.current&&t(m.current)},[]);const h=m.current?b(m.current.url):"",[p,g]=s(x),[k,w]=s(h||p),[N,L]=s(k),[j,C]=s([k]),[z,M]=s(0),[W,H]=s(0),[R,S]=s(f),[B,D]=s(!1),[O,U]=s(null),A=a(null),E=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(R))}catch{}},[R]);const P=e=>{const t=b(e);t&&(w(t),L(t),C(e=>{const o=e.slice(0,z+1);return o.push(t),o}),M(e=>e+1),D(!1))},T=()=>{"undefined"!=typeof window&&window.open(k,"_blank","noopener,noreferrer")},F=()=>{const e=O?.trim();e?(S(t=>[...t,{label:e,url:k}]),U(null)):U(null)};i(()=>{if(null===O)return;A.current?.focus(),A.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||U(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==O]);const I=e=>{S(t=>t.filter((t,o)=>o!==e))},X=z>0,G=z<j.length-1,Q=R.some(e=>e.url===k),V="p-1.5 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-VRLHUZSC.js";import{WindowTitle as r}from"./chunk-GCO3A63X.js";import"./chunk-DSSLOQDW.js";import"./chunk-ZOPYAOUP.js";import"./chunk-7LAPNAKS.js";import"./chunk-YJRC6IKD.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import{confirm as n}from"./chunk-XJYXKO7K.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-3YTHR7IC.js";import"./chunk-YKZHOXI4.js";import{useRef as a,useEffect as i,useState as s}from"react";import{jsxs as l,jsx as c,Fragment as m}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",u="react-os-shell:browser-homepage",h="https://en.wikipedia.org/wiki/Main_Page",p=[{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 b(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 k=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function f(){if("undefined"==typeof window)return p;try{const e=localStorage.getItem(d);if(!e)return p;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return p}function x(){return"undefined"==typeof window?h:localStorage.getItem(u)||h}function w(){const m=a(void 0);void 0===m.current&&(m.current=e()),i(()=>{null!=m.current&&t(m.current)},[]);const h=m.current?b(m.current.url):"",[p,g]=s(x),[k,w]=s(h||p),[N,L]=s(k),[C,j]=s([k]),[z,M]=s(0),[H,S]=s(0),[R,W]=s(f),[A,O]=s(!1),[B,D]=s(null),E=a(null),P=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(R))}catch{}},[R]);const X=e=>{const t=b(e);t&&(w(t),L(t),j(e=>{const o=e.slice(0,z+1);return o.push(t),o}),M(e=>e+1),O(!1))},I=()=>{"undefined"!=typeof window&&window.open(k,"_blank","noopener,noreferrer")},T=()=>{const e=B?.trim();e?(W(t=>[...t,{label:e,url:k}]),D(null)):D(null)};i(()=>{if(null===B)return;E.current?.focus(),E.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||D(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==B]);const U=e=>{W(t=>t.filter((t,o)=>o!==e))},K=z>0,V=z<C.length-1,J=R.some(e=>e.url===k),Y="p-1.5 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return l("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */c(r,{title:`Browser - ${v(k)}`}),
4
4
  /* @__PURE__ */c(o,{app:"browser"}),
5
5
  /* @__PURE__ */l("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-gray-200 bg-gray-50 shrink-0",children:[
6
- /* @__PURE__ */c("button",{onClick:()=>{if(z>0){const e=z-1;M(e),w(j[e]),L(j[e]),D(!1)}},disabled:!X,className:V,title:"Back",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
7
- /* @__PURE__ */c("button",{onClick:()=>{if(z<j.length-1){const e=z+1;M(e),w(j[e]),L(j[e]),D(!1)}},disabled:!G,className:V,title:"Forward",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
8
- /* @__PURE__ */c("button",{onClick:()=>H(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992V4.356M2.985 19.644v-4.992h4.992M3.05 9.348a9 9 0 0114.85-3.36L21.015 9.348m0 5.304a9 9 0 01-14.85 3.36l-3.115-3.36"})})}),
9
- /* @__PURE__ */c("button",{onClick:()=>P(p),className:V,title:"Home",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0l8.954 8.955M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}),
10
- /* @__PURE__ */c("form",{onSubmit:e=>{e.preventDefault(),P(N)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */l("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__ */c("button",{onClick:()=>{if(z>0){const e=z-1;M(e),w(C[e]),L(C[e]),O(!1)}},disabled:!K,className:Y,title:"Back",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
7
+ /* @__PURE__ */c("button",{onClick:()=>{if(z<C.length-1){const e=z+1;M(e),w(C[e]),L(C[e]),O(!1)}},disabled:!V,className:Y,title:"Forward",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
8
+ /* @__PURE__ */c("button",{onClick:()=>S(e=>e+1),className:Y,title:"Refresh",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992V4.356M2.985 19.644v-4.992h4.992M3.05 9.348a9 9 0 0114.85-3.36L21.015 9.348m0 5.304a9 9 0 01-14.85 3.36l-3.115-3.36"})})}),
9
+ /* @__PURE__ */c("button",{onClick:()=>X(p),className:Y,title:"Home",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0l8.954 8.955M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}),
10
+ /* @__PURE__ */c("form",{onSubmit:e=>{e.preventDefault(),X(N)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */l("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__ */c("span",{className:"px-2 text-gray-400 text-xs",children:k.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */c("input",{type:"text",value:N,onChange:e=>L(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),k!==N&&/* @__PURE__ */c("button",{type:"button",onClick:()=>L(k),className:"px-1.5 text-[10px] text-gray-400 hover:text-gray-700",title:"Reset to current URL",children:"×"})]})}),
13
- /* @__PURE__ */c("button",{"data-bookmark-popover":!0,onClick:()=>Q?I(R.findIndex(e=>e.url===k)):void U(v(k)),className:V+" "+(Q?"text-yellow-500":""),title:Q?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:Q?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),
14
- /* @__PURE__ */c("button",{onClick:T,className:V,title:"Open in new tab",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-7.5-9L21 3m0 0v6m0-6L9.75 14.25"})})}),
15
- /* @__PURE__ */c("button",{onClick:()=>D(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})})]}),null!==O&&/* @__PURE__ */l("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
13
+ /* @__PURE__ */c("button",{"data-bookmark-popover":!0,onClick:()=>J?U(R.findIndex(e=>e.url===k)):void D(v(k)),className:Y+" "+(J?"text-yellow-500":""),title:J?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:J?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),
14
+ /* @__PURE__ */c("button",{onClick:I,className:Y,title:"Open in new tab",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-7.5-9L21 3m0 0v6m0-6L9.75 14.25"})})}),
15
+ /* @__PURE__ */c("button",{onClick:()=>O(e=>!e),className:Y,title:"Embedding help",children:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})})]}),null!==B&&/* @__PURE__ */l("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
16
16
  /* @__PURE__ */c("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-gray-500 mb-1",children:"Bookmark this page"}),
17
17
  /* @__PURE__ */c("div",{className:"text-[11px] text-gray-400 truncate mb-2 font-mono",title:k,children:k}),
18
- /* @__PURE__ */c("input",{ref:A,type:"text",value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?F():"Escape"===e.key&&U(null)},placeholder:"Name",className:"w-full text-sm px-2 py-1.5 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
18
+ /* @__PURE__ */c("input",{ref:E,type:"text",value:B,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key?T():"Escape"===e.key&&D(null)},placeholder:"Name",className:"w-full text-sm px-2 py-1.5 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
19
  /* @__PURE__ */l("div",{className:"flex justify-end gap-1 mt-2",children:[
20
- /* @__PURE__ */c("button",{onClick:()=>U(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */c("button",{onClick:F,disabled:!O.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
- /* @__PURE__ */l("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===R.length&&/* @__PURE__ */c("span",{className:"text-[11px] text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),R.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>P(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&I(t)},className:"flex items-center gap-1.5 px-2 py-0.5 rounded text-[12px] text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
20
+ /* @__PURE__ */c("button",{onClick:()=>D(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */c("button",{onClick:T,disabled:!B.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
+ /* @__PURE__ */l("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===R.length&&/* @__PURE__ */c("span",{className:"text-[11px] text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),R.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>X(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&U(t)},className:"flex items-center gap-1.5 px-2 py-0.5 rounded text-[12px] text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
23
23
  /* @__PURE__ */c("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
24
24
  /* @__PURE__ */c("div",{className:"flex-1"}),
25
25
  /* @__PURE__ */c("button",{onClick:()=>{g(k);try{localStorage.setItem(u,k)}catch{}},className:"px-2 py-0.5 text-[11px] text-gray-500 hover:text-gray-800",title:"Set current page as homepage",children:"Set as home"})]}),
26
- /* @__PURE__ */c("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */c(y,{url:k,iframeKey:W,iframeRef:E,openExternal:T,showHelp:B,dismissHelp:()=>D(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function y({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,u]=s(!1);i(()=>{u(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return k.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */c("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */l("div",{className:"max-w-md text-center",children:[
26
+ /* @__PURE__ */c("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */c(y,{url:k,iframeKey:H,iframeRef:P,openExternal:I,showHelp:A,dismissHelp:()=>O(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function y({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,u]=s(!1);i(()=>{u(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return k.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */c("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */l("div",{className:"max-w-md text-center",children:[
27
27
  /* @__PURE__ */c("svg",{className:"h-14 w-14 mx-auto text-gray-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728L5.636 5.636m12.728 12.728L21 21M5.636 5.636L3 3m9 9a9 9 0 110-18 9 9 0 010 18z"})}),
28
28
  /* @__PURE__ */l("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
29
29
  /* @__PURE__ */l("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -1,29 +1,29 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-2UIKLYAI.js";import{useWidgetSettings as n}from"./chunk-FWZUTHP5.js";import"./chunk-DSSLOQDW.js";import"./chunk-6KO2U66R.js";import"./chunk-CRI4UFBU.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import"./chunk-ECFMRDUP.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.js";import"./chunk-YKZHOXI4.js";import{useState as r,useRef as l,useCallback as o,useEffect as i}from"react";import{jsxs as a,Fragment as c,jsx as s}from"react/jsx-runtime";var u="calc_appearance";function d(){const[d,h]=r("0"),[m,k]=r(null),[b,p]=r(null),[g,v]=r(!1),[x,y]=r(""),[N,f]=r([]),[C,$]=r(!1),[j,w]=r(()=>e(u)),[E,L]=r(!1),[F,S]=r(j),T=l(null);n(o(()=>{S({...j}),L(!0)},[j]));const H=o(e=>{y(""),h(t=>g||"0"===t?(v(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[g]),O=o(()=>{h("0"),k(null),p(null),v(!1)},[]),U=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),W=o(e=>{const t=parseFloat(d);if(null!==m&&b&&!g){const e=U(m,t,b);h(String(e)),k(e),f(n=>[`${m} ${b} ${t} = ${e}`,...n].slice(0,20))}else k(t);p(e),v(!0)},[d,m,b,g,U]),A=o(()=>{if(null===m||!b)return;const e=parseFloat(d),t=U(m,e,b),n=`${m} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),h(String(t)),k(null),p(null),v(!0)},[d,m,b,U]),B=o(()=>{h(e=>String(parseFloat(e)/100))},[]),D=o(()=>{h(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);i(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?H(e.key):"."===e.key?H("."):"+"===e.key?W("+"):"-"===e.key?W("-"):"*"===e.key?W("×"):"/"===e.key?(e.preventDefault(),W("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&T.current?.contains(e.target)&&e.preventDefault(),A()):"Escape"===e.key?O():"Backspace"===e.key?h(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&B())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H,W,A,O,B]);const I="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",X=`${I} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,P=`${I} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,R=`${I} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,M=`${I} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-TMQEH7WA.js";import{useWidgetSettings as n}from"./chunk-GCO3A63X.js";import"./chunk-DSSLOQDW.js";import"./chunk-ZOPYAOUP.js";import"./chunk-YJRC6IKD.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import"./chunk-XJYXKO7K.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-3YTHR7IC.js";import"./chunk-YKZHOXI4.js";import{useState as r,useRef as l,useCallback as o,useEffect as i}from"react";import{jsxs as a,Fragment as c,jsx as s}from"react/jsx-runtime";var u="calc_appearance";function d(){const[d,h]=r("0"),[m,k]=r(null),[b,p]=r(null),[g,v]=r(!1),[x,y]=r(""),[f,N]=r([]),[C,$]=r(!1),[j,w]=r(()=>e(u)),[E,O]=r(!1),[T,S]=r(j),X=l(null);n(o(()=>{S({...j}),O(!0)},[j]));const A=o(e=>{y(""),h(t=>g||"0"===t?(v(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[g]),H=o(()=>{h("0"),k(null),p(null),v(!1)},[]),L=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),W=o(e=>{const t=parseFloat(d);if(null!==m&&b&&!g){const e=L(m,t,b);h(String(e)),k(e),N(n=>[`${m} ${b} ${t} = ${e}`,...n].slice(0,20))}else k(t);p(e),v(!0)},[d,m,b,g,L]),D=o(()=>{if(null===m||!b)return;const e=parseFloat(d),t=L(m,e,b),n=`${m} ${b} ${e} =`;N(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),h(String(t)),k(null),p(null),v(!0)},[d,m,b,L]),F=o(()=>{h(e=>String(parseFloat(e)/100))},[]),B=o(()=>{h(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);i(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?A(e.key):"."===e.key?A("."):"+"===e.key?W("+"):"-"===e.key?W("-"):"*"===e.key?W("×"):"/"===e.key?(e.preventDefault(),W("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&X.current?.contains(e.target)&&e.preventDefault(),D()):"Escape"===e.key?H():"Backspace"===e.key?h(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&F())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A,W,D,H,F]);const I="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",J=`${I} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,P=`${I} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Y=`${I} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,M=`${I} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
2
  return a(c,{children:[
3
- /* @__PURE__ */a("div",{ref:T,className:"flex flex-col h-full",style:{opacity:j.activeOpacity/100,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:[
3
+ /* @__PURE__ */a("div",{ref:X,className:"flex flex-col h-full",style:{opacity:j.activeOpacity/100,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:[
4
4
  /* @__PURE__ */a("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__ */s("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:N.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */s("div",{className:"text-[11px] text-slate-400 text-right font-mono truncate",children:e},t))}),(x||b&&null!==m)&&/* @__PURE__ */s("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${m} ${b} ${g?"":d}`}),
5
+ /* @__PURE__ */s("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:f.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */s("div",{className:"text-[11px] text-slate-400 text-right font-mono truncate",children:e},t))}),(x||b&&null!==m)&&/* @__PURE__ */s("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${m} ${b} ${g?"":d}`}),
6
6
  /* @__PURE__ */a("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */s("button",{onClick:()=>{navigator.clipboard.writeText(d),$(!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__ */s("svg",C?{className:"h-5 w-5 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}:{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),
8
8
  /* @__PURE__ */s("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(d)})]})]}),
9
9
  /* @__PURE__ */a("div",{className:"grid grid-cols-4 grid-rows-5 gap-1.5 flex-1 min-h-0 p-2",children:[
10
- /* @__PURE__ */s("button",{onClick:O,className:R,children:"AC"}),
11
- /* @__PURE__ */s("button",{onClick:D,className:R,children:"+/−"}),
12
- /* @__PURE__ */s("button",{onClick:B,className:R,children:"%"}),
10
+ /* @__PURE__ */s("button",{onClick:H,className:Y,children:"AC"}),
11
+ /* @__PURE__ */s("button",{onClick:B,className:Y,children:"+/−"}),
12
+ /* @__PURE__ */s("button",{onClick:F,className:Y,children:"%"}),
13
13
  /* @__PURE__ */s("button",{onClick:()=>W("÷"),className:`${P} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */s("button",{onClick:()=>H("7"),className:X,children:"7"}),
15
- /* @__PURE__ */s("button",{onClick:()=>H("8"),className:X,children:"8"}),
16
- /* @__PURE__ */s("button",{onClick:()=>H("9"),className:X,children:"9"}),
14
+ /* @__PURE__ */s("button",{onClick:()=>A("7"),className:J,children:"7"}),
15
+ /* @__PURE__ */s("button",{onClick:()=>A("8"),className:J,children:"8"}),
16
+ /* @__PURE__ */s("button",{onClick:()=>A("9"),className:J,children:"9"}),
17
17
  /* @__PURE__ */s("button",{onClick:()=>W("×"),className:`${P} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */s("button",{onClick:()=>H("4"),className:X,children:"4"}),
19
- /* @__PURE__ */s("button",{onClick:()=>H("5"),className:X,children:"5"}),
20
- /* @__PURE__ */s("button",{onClick:()=>H("6"),className:X,children:"6"}),
18
+ /* @__PURE__ */s("button",{onClick:()=>A("4"),className:J,children:"4"}),
19
+ /* @__PURE__ */s("button",{onClick:()=>A("5"),className:J,children:"5"}),
20
+ /* @__PURE__ */s("button",{onClick:()=>A("6"),className:J,children:"6"}),
21
21
  /* @__PURE__ */s("button",{onClick:()=>W("-"),className:`${P} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */s("button",{onClick:()=>H("1"),className:X,children:"1"}),
23
- /* @__PURE__ */s("button",{onClick:()=>H("2"),className:X,children:"2"}),
24
- /* @__PURE__ */s("button",{onClick:()=>H("3"),className:X,children:"3"}),
22
+ /* @__PURE__ */s("button",{onClick:()=>A("1"),className:J,children:"1"}),
23
+ /* @__PURE__ */s("button",{onClick:()=>A("2"),className:J,children:"2"}),
24
+ /* @__PURE__ */s("button",{onClick:()=>A("3"),className:J,children:"3"}),
25
25
  /* @__PURE__ */s("button",{onClick:()=>W("+"),className:`${P} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */s("button",{onClick:()=>H("0"),className:`${X} col-span-2`,children:"0"}),
27
- /* @__PURE__ */s("button",{onClick:()=>H("."),className:X,children:"."}),
28
- /* @__PURE__ */s("button",{onClick:A,className:M,children:"="})]})]}),
29
- /* @__PURE__ */s(t,{open:E,onClose:()=>L(!1),title:"Calculator Settings",appearance:F,onAppearanceChange:S,onSave:()=>{w(F),localStorage.setItem(u,JSON.stringify(F)),L(!1)}})]})}export{d as default};
26
+ /* @__PURE__ */s("button",{onClick:()=>A("0"),className:`${J} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */s("button",{onClick:()=>A("."),className:J,children:"."}),
28
+ /* @__PURE__ */s("button",{onClick:D,className:M,children:"="})]})]}),
29
+ /* @__PURE__ */s(t,{open:E,onClose:()=>O(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:S,onSave:()=>{w(T),localStorage.setItem(u,JSON.stringify(T)),O(!1)}})]})}export{d as default};
@@ -0,0 +1 @@
1
+ export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-XJYXKO7K.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-3YTHR7IC.js";
@@ -1,4 +1,4 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-2UIKLYAI.js";import{useWidgetSettings as r}from"./chunk-FWZUTHP5.js";import"./chunk-DSSLOQDW.js";import"./chunk-6KO2U66R.js";import"./chunk-CRI4UFBU.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import"./chunk-ECFMRDUP.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.js";import"./chunk-YKZHOXI4.js";import{useState as a,useCallback as n,useEffect as s}from"react";import{jsxs as c,Fragment as o,jsx as i}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],m=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],u="currency_pairs",p="currency_appearance",d="currency_rates_cache";function h(e){try{const t=JSON.parse(localStorage.getItem(d)||"{}")[e];if(t&&Date.now()-t.timestamp<36e5)return t.rates}catch{}return null}function g(e,t){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[e]={rates:t,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function x(){try{const e=JSON.parse(localStorage.getItem(u)||"");if(Array.isArray(e)&&e.length)return e.slice(0,4)}catch{}return m}var y={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[m,d]=a(x),[f,N]=a(()=>e(p)),[b,v]=a({}),[S,D]=a(!1),[k,C]=a(!1),[j,U]=a([]),[I,O]=a(f),[H,J]=a("USD"),[R,A]=a("CNY");r(n(()=>{U([...m]),O({...f}),C(!0)},[m,f])),s(()=>{const e=[...new Set(m.map(([e])=>e))];let t=!0;return async function(){D(!0);const r={};for(const t of e){const e=h(t);if(e)r[t]=e;else try{const e=await fetch(`https://open.er-api.com/v6/latest/${t}`),a=await e.json();a.rates&&(r[t]=a.rates,g(t,a.rates))}catch{}}t&&(v(r),D(!1))}(),()=>{t=!1}},[m]);/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-TMQEH7WA.js";import{useWidgetSettings as r}from"./chunk-GCO3A63X.js";import"./chunk-DSSLOQDW.js";import"./chunk-ZOPYAOUP.js";import"./chunk-YJRC6IKD.js";import"./chunk-5A7MWTXX.js";import"./chunk-EXXHI5DO.js";import"./chunk-PGVUO7GB.js";import"./chunk-HZZNJHRH.js";import"./chunk-D65T4H6J.js";import"./chunk-XJYXKO7K.js";import"./chunk-AFYQTVZO.js";import"./chunk-X4FJ54PP.js";import"./chunk-3YTHR7IC.js";import"./chunk-YKZHOXI4.js";import{useState as a,useCallback as n,useEffect as s}from"react";import{jsxs as c,Fragment as o,jsx as i}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],m=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],u="currency_pairs",p="currency_appearance",d="currency_rates_cache";function h(e){try{const t=JSON.parse(localStorage.getItem(d)||"{}")[e];if(t&&Date.now()-t.timestamp<36e5)return t.rates}catch{}return null}function g(e,t){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[e]={rates:t,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function x(){try{const e=JSON.parse(localStorage.getItem(u)||"");if(Array.isArray(e)&&e.length)return e.slice(0,4)}catch{}return m}var y={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[m,d]=a(x),[f,N]=a(()=>e(p)),[b,v]=a({}),[S,D]=a(!1),[k,C]=a(!1),[j,O]=a([]),[J,A]=a(f),[H,U]=a("USD"),[I,Y]=a("CNY");r(n(()=>{O([...m]),A({...f}),C(!0)},[m,f])),s(()=>{const e=[...new Set(m.map(([e])=>e))];let t=!0;return async function(){D(!0);const r={};for(const t of e){const e=h(t);if(e)r[t]=e;else try{const e=await fetch(`https://open.er-api.com/v6/latest/${t}`),a=await e.json();a.rates&&(r[t]=a.rates,g(t,a.rates))}catch{}}t&&(v(r),D(!1))}(),()=>{t=!1}},[m]);/* @__PURE__ */
2
2
  return c(o,{children:[
3
3
  /* @__PURE__ */i("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__ */c("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */i("div",{className:"text-xs text-gray-400 text-center py-4",children:"Loading rates..."}),m.map(([e,t],r)=>{const a=b[e]?.[t];/* @__PURE__ */
4
4
  return c("button",{onClick:()=>{const e=m.map((e,t)=>t===r?[e[1],e[0]]:e);d(e),localStorage.setItem(u,JSON.stringify(e))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const e=m.map((e,t)=>t===r?[e[1],e[0]]:e);d(e),l
9
9
  /* @__PURE__ */i("span",{className:"text-base",children:y[t]||""}),
10
10
  /* @__PURE__ */i("span",{className:"text-sm font-semibold text-gray-700",children:t})]}),
11
11
  /* @__PURE__ */i("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=a?a.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${e}-${t}-${r}`)})]})}),
12
- /* @__PURE__ */i(t,{open:k,onClose:()=>C(!1),title:"Currency Settings",appearance:I,onAppearanceChange:O,onSave:()=>{if(0===j.length)return;const e=j.slice(0,4);d(e),N(I),localStorage.setItem(u,JSON.stringify(e)),localStorage.setItem(p,JSON.stringify(I)),C(!1)},children:/* @__PURE__ */c("div",{children:[
12
+ /* @__PURE__ */i(t,{open:k,onClose:()=>C(!1),title:"Currency Settings",appearance:J,onAppearanceChange:A,onSave:()=>{if(0===j.length)return;const e=j.slice(0,4);d(e),N(J),localStorage.setItem(u,JSON.stringify(e)),localStorage.setItem(p,JSON.stringify(J)),C(!1)},children:/* @__PURE__ */c("div",{children:[
13
13
  /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Currency Pairs ",
14
14
  /* @__PURE__ */c("span",{className:"text-[11px] font-normal text-gray-400",children:["(",j.length,"/",4,")"]})]}),
15
15
  /* @__PURE__ */i("div",{className:"space-y-1 mb-2",children:j.map(([e,t],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */c("span",{className:"text-sm",children:[y[e]||""," ",e," → ",y[t]||""," ",t]}),
17
- /* @__PURE__ */i("button",{onClick:()=>U(e=>e.filter((e,t)=>t!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),j.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */i("select",{value:H,onChange:e=>J(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
17
+ /* @__PURE__ */i("button",{onClick:()=>O(e=>e.filter((e,t)=>t!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),j.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */i("select",{value:H,onChange:e=>U(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
19
19
  /* @__PURE__ */i("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */i("select",{value:R,onChange:e=>A(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
21
- /* @__PURE__ */i("button",{onClick:()=>{H!==R&&j.length<4&&U(e=>[...e,[H,R]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-[11px] text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */i("select",{value:I,onChange:e=>Y(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
21
+ /* @__PURE__ */i("button",{onClick:()=>{H!==I&&j.length<4&&O(e=>[...e,[H,I]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-[11px] text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};