efficient-shell 10.0.0 → 10.1.1

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 (218) hide show
  1. package/README.md +2 -2
  2. package/dist/{Browser-RFLTFP7Y.js → Browser-Q34VNUTL.js} +13 -13
  3. package/dist/{Calculator-DV2R65OS.js → Calculator-63XNC3BA.js} +12 -12
  4. package/dist/{CurrencyConverter-ELSCNMUT.js → CurrencyConverter-Q4HYAY4N.js} +9 -9
  5. package/dist/{Documents-HKTTXLSR.js → Documents-KLVVF4KK.js} +24 -24
  6. package/dist/{Files-ZSYGKZOV.js → Files-AOIBTQTE.js} +40 -40
  7. package/dist/Notepad-SOUIZDKN.js +24 -0
  8. package/dist/PdfViewer-WNKGFJD6.js +1 -0
  9. package/dist/{PomodoroTimer-XHNZGBDR.js → PomodoroTimer-X5Y3LA3V.js} +25 -25
  10. package/dist/{Preview-PLCASIZA.js → Preview-3FZTC25R.js} +25 -25
  11. package/dist/Sidebar-4OI4LP6G.js +44 -0
  12. package/dist/{Spreadsheet-Y7TJIBI5.js → Spreadsheet-RBEVCQIV.js} +13 -13
  13. package/dist/{Stock-KLYWTMMD.js → Stock-KESFJPYD.js} +4 -4
  14. package/dist/{Weather-CT2IZHEW.js → Weather-BYGZVNNK.js} +19 -19
  15. package/dist/{WorldClock-EJCUVIUW.js → WorldClock-P4JVDPGE.js} +6 -6
  16. package/dist/ai/index.js +38 -38
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChordChart.js +1 -1
  25. package/dist/charts/ColumnChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/RadarChart.js +1 -1
  29. package/dist/charts/RangeChart.js +1 -1
  30. package/dist/charts/SankeyChart.js +1 -1
  31. package/dist/charts/ScatterChart.js +1 -1
  32. package/dist/charts/SpecChart.js +1 -1
  33. package/dist/charts/SunburstChart.js +1 -1
  34. package/dist/charts/TimeSeriesChart.js +1 -1
  35. package/dist/charts/TreemapChart.js +1 -1
  36. package/dist/charts/WaterfallChart.js +1 -1
  37. package/dist/{chunk-PUIQFTCO.js → chunk-2OJ3HGFY.js} +5 -5
  38. package/dist/{chunk-PKIDVVAE.js → chunk-2SLQD57V.js} +5 -5
  39. package/dist/{chunk-NDEIZUMG.js → chunk-3V6ZERBS.js} +1 -1
  40. package/dist/{chunk-BXEKX4TB.js → chunk-3V74SUZO.js} +16 -16
  41. package/dist/{chunk-DL6QIWVR.js → chunk-42XMT5JN.js} +1 -1
  42. package/dist/{chunk-IQWIYZB5.js → chunk-45XXERGA.js} +2 -2
  43. package/dist/{chunk-B7KD3DGY.js → chunk-4UEXVRBC.js} +1 -1
  44. package/dist/{chunk-FRINAJU7.js → chunk-4UX6ET7G.js} +1 -1
  45. package/dist/{chunk-BFVL2VTS.js → chunk-4VDGVF5T.js} +1 -1
  46. package/dist/chunk-4X6GIVTI.js +29 -0
  47. package/dist/{chunk-D2WGDTWN.js → chunk-5EX6XXUX.js} +1 -1
  48. package/dist/{chunk-PA37I5ZX.js → chunk-5VDT4762.js} +2 -2
  49. package/dist/{chunk-EGAV5LSX.js → chunk-5VSP3TYU.js} +1 -1
  50. package/dist/{chunk-66JYKX4T.js → chunk-6FPDOEOX.js} +1 -1
  51. package/dist/{chunk-3AZBI76O.js → chunk-7ILNRFEV.js} +1 -1
  52. package/dist/{chunk-GQK3U2IO.js → chunk-7TONF2PM.js} +1 -1
  53. package/dist/{chunk-LKW3YAZN.js → chunk-A3VJ4PRU.js} +6 -6
  54. package/dist/chunk-ACVKU6YW.js +7 -0
  55. package/dist/{chunk-ELUTQZGP.js → chunk-AEQFFD5I.js} +1 -1
  56. package/dist/{chunk-QRJRGP2K.js → chunk-AGLBDT7X.js} +8 -8
  57. package/dist/chunk-AXL7VTNM.js +11 -0
  58. package/dist/{chunk-7BDZZANS.js → chunk-B7HW6XZD.js} +1 -1
  59. package/dist/{chunk-XILZGSMX.js → chunk-BDFZNLFQ.js} +1 -1
  60. package/dist/{chunk-C6MV6IAX.js → chunk-BMXMSAQE.js} +8 -8
  61. package/dist/{chunk-PUCPFBYO.js → chunk-BNQRPLBW.js} +1 -1
  62. package/dist/{chunk-XS4HFUTW.js → chunk-BZPPDYEE.js} +1 -1
  63. package/dist/{chunk-DPDRFLBY.js → chunk-CLQFP42I.js} +3 -3
  64. package/dist/{chunk-HKAQXFUR.js → chunk-CMHLXELO.js} +3 -3
  65. package/dist/{chunk-UZ43AT4O.js → chunk-CUA6CREW.js} +8 -8
  66. package/dist/{chunk-RYS3URDC.js → chunk-DY2M6BIG.js} +10 -10
  67. package/dist/{chunk-EGEWU776.js → chunk-E3RHEEA6.js} +1 -1
  68. package/dist/{chunk-WFANOFHG.js → chunk-F7A6K3D5.js} +5 -5
  69. package/dist/{chunk-QTQQKQGQ.js → chunk-FFASZGNZ.js} +3 -3
  70. package/dist/{chunk-MPALY3CL.js → chunk-FMC2XNSP.js} +6 -6
  71. package/dist/{chunk-D7X2HMMA.js → chunk-FS2KWQJW.js} +10 -10
  72. package/dist/{chunk-AJ3R5QPD.js → chunk-GGIFS34Z.js} +5 -5
  73. package/dist/{chunk-4E4GWE4L.js → chunk-GVY2X4CC.js} +16 -16
  74. package/dist/{chunk-HJPCHES5.js → chunk-GZYTCHPX.js} +4 -4
  75. package/dist/chunk-IFANUMK3.js +4 -0
  76. package/dist/{chunk-ZREDCRTL.js → chunk-J7CIBRDS.js} +1 -1
  77. package/dist/{chunk-ZOBLEXIU.js → chunk-JJYAYMY7.js} +1 -1
  78. package/dist/{chunk-ZPCADTM5.js → chunk-JRBQLRAZ.js} +1 -1
  79. package/dist/{chunk-YFUMK2E7.js → chunk-JZK3UDOT.js} +1 -1
  80. package/dist/{chunk-O33CUGOI.js → chunk-K64JRGNE.js} +5 -5
  81. package/dist/{chunk-IU5KBQEQ.js → chunk-K7PCBUDC.js} +6 -6
  82. package/dist/{chunk-VG5NGCMQ.js → chunk-KFRU53WD.js} +6 -6
  83. package/dist/{chunk-FSPFV4MI.js → chunk-KKSVRIMP.js} +2 -4
  84. package/dist/{chunk-T5V2GJ4D.js → chunk-KZQAGXME.js} +4 -4
  85. package/dist/{chunk-FTWWJHFX.js → chunk-LOYCPZUB.js} +1 -1
  86. package/dist/{chunk-GBLMVFDW.js → chunk-LPDI5NL6.js} +1 -1
  87. package/dist/{chunk-FPGRKHUW.js → chunk-MH6DI6YY.js} +11 -11
  88. package/dist/{chunk-GQMS5657.js → chunk-MLKY5ESV.js} +1 -1
  89. package/dist/{chunk-TGLHJS3M.js → chunk-MUMQ6PW7.js} +1 -1
  90. package/dist/chunk-N6TK43YN.js +100 -0
  91. package/dist/chunk-N6VP75F5.js +3 -0
  92. package/dist/{chunk-KAVFW5CU.js → chunk-NNOA7AVG.js} +5 -5
  93. package/dist/{chunk-6YQPLI5M.js → chunk-NQJKANUP.js} +11 -11
  94. package/dist/{chunk-UTQG344L.js → chunk-NW7Z3G7P.js} +11 -11
  95. package/dist/{chunk-LR77AS3N.js → chunk-O6ABVKHU.js} +4 -4
  96. package/dist/{chunk-25STFYV3.js → chunk-OPB3I4JH.js} +4 -4
  97. package/dist/{chunk-RBD7SB6M.js → chunk-P5YFQ4IQ.js} +1 -1
  98. package/dist/{chunk-JHZV4TN6.js → chunk-PF5CKD4C.js} +2 -2
  99. package/dist/{chunk-NDKQDIWN.js → chunk-Q4LBBFLO.js} +5 -5
  100. package/dist/{chunk-X6TJR6M2.js → chunk-Q5YM65DZ.js} +8 -8
  101. package/dist/{chunk-XOKANFQD.js → chunk-QASKQDUR.js} +16 -16
  102. package/dist/{chunk-5F7HMNCX.js → chunk-QODTON7V.js} +1 -1
  103. package/dist/{chunk-7KDGW6BR.js → chunk-QXRRAADR.js} +1 -1
  104. package/dist/chunk-QZ3MO3HB.js +1 -0
  105. package/dist/{chunk-VSAI5TH7.js → chunk-R4Q5653D.js} +20 -20
  106. package/dist/{chunk-DXHLUB36.js → chunk-RKFEJ5CX.js} +1 -1
  107. package/dist/{chunk-GKZUAT3K.js → chunk-RSIGTZMU.js} +1 -1
  108. package/dist/{chunk-GNU3U2TP.js → chunk-RZR3OAKV.js} +1 -1
  109. package/dist/chunk-SDI2UGAG.js +1 -0
  110. package/dist/chunk-SKY2NBTQ.js +6 -0
  111. package/dist/{chunk-MKEYXKZA.js → chunk-TDLU6GF5.js} +4 -4
  112. package/dist/chunk-UP442DPT.js +9 -0
  113. package/dist/{chunk-OUKDGO4N.js → chunk-V4RYE6KA.js} +8 -8
  114. package/dist/{chunk-E7WY4GZ3.js → chunk-VMDBVXDJ.js} +1 -1
  115. package/dist/{chunk-F24QTMTY.js → chunk-VP63OOO4.js} +3 -3
  116. package/dist/{chunk-GRBBQ3VF.js → chunk-WKSNTMEJ.js} +1 -1
  117. package/dist/{chunk-DVOQCAC2.js → chunk-WMQ2URP4.js} +1 -1
  118. package/dist/{chunk-ED3QFXBC.js → chunk-WP4CIYJ7.js} +1 -1
  119. package/dist/{chunk-UFXE363L.js → chunk-X6YT3I5F.js} +1 -1
  120. package/dist/{chunk-SGTZJMZ6.js → chunk-XABYSSXW.js} +1 -1
  121. package/dist/{chunk-GSBIJLTD.js → chunk-XAROKI7X.js} +1 -1
  122. package/dist/{chunk-ZMVCN4OA.js → chunk-XHMIJ7S3.js} +7 -7
  123. package/dist/{chunk-Q7HN6T3H.js → chunk-XNKIDGZW.js} +1 -1
  124. package/dist/{chunk-6I6VSUKY.js → chunk-Y23TGQFN.js} +4 -4
  125. package/dist/chunk-ZLHPCPXS.js +19 -0
  126. package/dist/{chunk-LPUGK2MC.js → chunk-ZN2BFSQR.js} +2 -2
  127. package/dist/{chunk-TXMAWCR7.js → chunk-ZRZ5LOW3.js} +1 -1
  128. package/dist/data/ListLoadError.js +1 -1
  129. package/dist/format/index.js +1 -1
  130. package/dist/forms/BorderInput.js +1 -1
  131. package/dist/forms/BrandAssetEditor.js +1 -1
  132. package/dist/forms/Calendar.js +1 -1
  133. package/dist/forms/ColorPicker.js +1 -1
  134. package/dist/forms/ComposerAttachments.js +1 -1
  135. package/dist/forms/CornersInput.js +1 -1
  136. package/dist/forms/DatePicker.js +1 -1
  137. package/dist/forms/DateRangePicker.js +1 -1
  138. package/dist/forms/DisplayChips.js +1 -1
  139. package/dist/forms/FilePicker.js +1 -1
  140. package/dist/forms/IconPicker.js +1 -1
  141. package/dist/forms/InputNumber.js +1 -1
  142. package/dist/forms/LinkPicker.js +1 -1
  143. package/dist/forms/MediaLibrary.js +1 -1
  144. package/dist/forms/MediaUploadField.js +1 -1
  145. package/dist/forms/MediaUploadGrid.js +1 -1
  146. package/dist/forms/MediaUsedInList.js +1 -1
  147. package/dist/forms/PositionInput.js +1 -1
  148. package/dist/forms/Select.js +1 -1
  149. package/dist/forms/SidesInput.js +1 -1
  150. package/dist/forms/Slider.js +1 -1
  151. package/dist/forms/Snippet.js +1 -1
  152. package/dist/forms/SplitButton.js +1 -1
  153. package/dist/forms/TagInput.js +1 -1
  154. package/dist/forms/TextToolbar.js +1 -1
  155. package/dist/forms/WidthsBar.js +1 -1
  156. package/dist/forms/mediaLibraryMenu.js +1 -1
  157. package/dist/forms/textAlign.js +1 -1
  158. package/dist/hooks/useTheme.d.ts +1 -1
  159. package/dist/icons/index.js +1 -1
  160. package/dist/index.d.ts +9 -2
  161. package/dist/index.js +129 -130
  162. package/dist/map/index.js +3 -3
  163. package/dist/markdown/index.js +1 -1
  164. package/dist/page-tabs/index.js +5 -5
  165. package/dist/pdf/index.js +1 -1
  166. package/dist/shell/AppUpdateBanner.js +1 -1
  167. package/dist/shell/Banner.js +1 -1
  168. package/dist/shell/Breadcrumbs.js +1 -1
  169. package/dist/shell/ColoredBadge.js +1 -1
  170. package/dist/shell/ConfirmDialog.js +1 -1
  171. package/dist/shell/ContextMenu.js +1 -1
  172. package/dist/shell/Dialog.js +1 -1
  173. package/dist/shell/Drawer.js +1 -1
  174. package/dist/shell/DropdownMenu.js +1 -1
  175. package/dist/shell/EmptyState.js +1 -1
  176. package/dist/shell/HelpCenter.js +1 -1
  177. package/dist/shell/ImageLightbox.js +1 -1
  178. package/dist/shell/LanguageSelect.js +1 -1
  179. package/dist/shell/Markdown.js +1 -1
  180. package/dist/shell/PageHeader.js +1 -1
  181. package/dist/shell/PopupMenu.js +1 -1
  182. package/dist/shell/ProductionTimeline.js +1 -1
  183. package/dist/shell/Result.js +1 -1
  184. package/dist/shell/SearchableSelect.js +1 -1
  185. package/dist/shell/SettingReset.js +1 -1
  186. package/dist/shell/SettingRow.js +1 -1
  187. package/dist/shell/SidebarLayout.js +1 -1
  188. package/dist/shell/SidebarNav.js +1 -1
  189. package/dist/shell/SortableList.js +1 -1
  190. package/dist/shell/StepChain.js +1 -1
  191. package/dist/shell/Stepper.js +1 -1
  192. package/dist/shell/TopNav.js +1 -1
  193. package/dist/shell/Tree.js +1 -1
  194. package/dist/telemetry/index.js +1 -1
  195. package/dist/templates/ChatTemplate.js +1 -1
  196. package/dist/templates/CheckoutTemplate.js +1 -1
  197. package/dist/templates/DashboardTemplate.js +1 -1
  198. package/dist/templates/DataTablePage.js +1 -1
  199. package/dist/templates/EmailTemplate.js +1 -1
  200. package/dist/templates/ErrorBoundary.d.ts +1 -1
  201. package/dist/templates/FormLayoutPage.js +1 -1
  202. package/dist/ui/index.js +1 -1
  203. package/dist/version.js +1 -1
  204. package/package.json +1 -1
  205. package/dist/Notepad-63Q3JSCV.js +0 -25
  206. package/dist/PdfViewer-DFBPEUY5.js +0 -1
  207. package/dist/Sidebar-QFT5WPK4.js +0 -44
  208. package/dist/chunk-4AJRHTTB.js +0 -1
  209. package/dist/chunk-5CH2RGL6.js +0 -29
  210. package/dist/chunk-7YU27U3Y.js +0 -19
  211. package/dist/chunk-AEJNFA2K.js +0 -6
  212. package/dist/chunk-IEAFSVXC.js +0 -1
  213. package/dist/chunk-POCQ7ZL4.js +0 -3
  214. package/dist/chunk-PVR4KU7H.js +0 -7
  215. package/dist/chunk-R2QDO7NY.js +0 -4
  216. package/dist/chunk-RBXSU25O.js +0 -9
  217. package/dist/chunk-XSJJPACH.js +0 -11
  218. package/dist/chunk-ZBTDMQUI.js +0 -100
package/README.md CHANGED
@@ -1642,7 +1642,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1642
1642
  | `DropdownMenu` | A button and the menu it opens, right under it: actions, links (`href`, drawn by `linkAs`), radios, labels and dividers, with shared dismissal and the menu-button keyboard. `align` lines it up with the trigger's left or right edge; `side="top"` suits a trigger in a bottom action bar. See [Dropdown menus](#dropdown-menus). |
1643
1643
  | `SplitButton` | A main action and its own menu as one control ("Publish ▾"): a `Button` half and a chevron half that opens a `DropdownMenu` of `items`. Two tab stops, one shape. The chevron's name `menuLabel` is required and shows in a `Tooltip`. The main half can be off with a `disabledReason` while the chevron still opens the menu. See [Split buttons](#split-buttons). |
1644
1644
  | `Popover` | A button and the panel it opens, right under it, placed by `DropdownMenu`'s rule (left edges together, or right with `align="end"`, flipping and shifting to stay on screen and in its window, never wider than a phone allows): a non-modal `role="dialog"` named by `title` or `aria-label`, for check boxes, a date, a short form. A kit popup opened inside it (a `DatePicker`'s calendar, a `Select`'s list) does not close it. Focus moves in as it opens; Tab reads it as if it sat right after its trigger; Escape closes it and gives focus back. See [Popovers](#popovers). |
1645
- | `Dialog`, `Drawer` | A modal sheet that is not a shell window — centred (`Dialog`) or pinned to an edge (`Drawer`, `side` right / left / bottom) — for a till, a routed page or a form: trapped focus, a locked page, Escape and a backdrop click to close (`blocking` turns both off), a close cross when there is no `footer`. A `Dialog` is never taller than the screen less its gutter: a longer form — on a phone, most of them — scrolls inside the panel, footer included, and a footer wider than the panel wraps. `title` names it; `description` is a line under the title that DESCRIBES it to a screen reader — without one the body does, which suits a confirm whose body is the question and not a form, whose every label would be read out. `role="alertdialog"` (Dialog) for a confirmation that interrupts. A heading or note that lives in the body — a form that loads the record its heading names — names and describes it through `aria-labelledby` / `aria-describedby`. Two open at once — the second inside the first, or beside it on `<body>` where a host portals its dialogs — each hold focus, and only the one in front moves Tab (`useFocusTrap` keeps a stack). |
1645
+ | `Dialog`, `Drawer` | A modal sheet that is not a shell window — centred (`Dialog`) or pinned to an edge (`Drawer`, `side` right / left / bottom) — for a till, a routed page or a form: trapped focus, a locked page, Escape and a backdrop click to close (`blocking` turns both off), a close cross when there is no `footer`. A `Dialog` is never taller than the screen less its gutter: a longer form — on a phone, most of them — scrolls inside the panel, footer included, and a footer wider than the panel wraps. `title` names it; `description` is a line under the title that DESCRIBES it to a screen reader — without one the body does, which suits a confirm whose body is the question and not a form, whose every label would be read out. `role="alertdialog"` (Dialog) for a confirmation that interrupts. A heading or note that lives in the body — a form that loads the record its heading names — names and describes it through `aria-labelledby` / `aria-describedby`. Two open at once — the second inside the first, or beside it on `<body>` where a host portals its dialogs — each hold focus, and only the one in front moves Tab (`useFocusTrap` keeps a stack). Opened over a shell window, a key pressed in it is its own: the window behind does not take ⌘⏎ (submit), ⌘S (save), ⌥⇧D (duplicate), ⌥⇧E (edit) or J / K from it, nor Escape. Its root layer carries `data-overlay-layer`, which is how the window tells. |
1646
1646
  | `ConfirmProvider`, `confirm` | Imperative `confirm({ title, body })` returning a Promise<boolean>. |
1647
1647
  | `GlobalSearch` | Cmd-K command palette. Pass `providers: SearchProvider[]` to add results; a provider is called `(query, { signal })` and the `signal` aborts when a newer query, closing the palette or unmount supersedes the call, so pass it to the request. Only the latest query's response is shown, whether or not a provider honours the signal. A result whose `entity_type` is `__page__` opens a page; an `entity_id` of `/path?search=text` (URL-encoded) opens that page's list with its search box filled in. Portalled to `<body>` on the overlay layer (`Z_LAYERS.overlay`), so it covers every window, pinned or not; opening it closes any open popup (`dismissPopups`). Results are grouped under a header per `result.type` (with a count), in the order each type first appears in the merged responses — providers answer best match first, so the group holding an exact match leads. ↑/↓ run through every row across groups, Tab / Shift+Tab jump to the first row of the next / previous group, Enter opens; the input is an ARIA combobox over a listbox with `role="group"` sections. With fewer than two characters typed it shows an empty state instead: **Recent** (the last 8 results picked, most recent first, deduplicated by `entity_type` + `entity_id`), **Favorites** and **Actions** — each section only when it has rows. `recent` + `onRecord` and `favorites` are props, so a routed app that passes none gets no Recent / Favorites (`pushRecentSearch(recent, picked)` keeps the list for it); `Layout` passes them from the user's preferences (`search_recent`, `favorite_documents`). Picking a result or a Recent row calls `onRecord(result)` then `onSelect(result)`; picking a Favorite or an Action does not record. **While searching**, the previous answer's rows stay drawn (with a spinner in the input row) until the next one lands; "Searching…" shows only when there is nothing to draw yet. **Failures are not "no results"**: an aborted call is silent, but a provider that rejects marks the search failed — every provider down shows `strings.search.searchFailed` instead of "No results", some down shows the rows that arrived plus a one-line `partialFailure` warning. **"See all"**: a provider may answer `SearchResult[]` or a `SearchResponse` (`{ results, truncatedTypes? }`); a group whose type is in `truncatedTypes` counts as "5+", and when `SearchConfig.listRoutes` maps its type to a `SearchListRoute` (`{ path, label }`, label the plural the consumer names its list by, e.g. `customers`) it ends in a "See all {label}" row that calls `onSelect` with a `__page__` result for `${path}?search=${encodeURIComponent(query)}` (so the page must read `usePageSearch()`); it is never recorded in Recent, and a group that is not truncated gets neither the "+" nor the row. `SearchConfig.quickActions` (`{ label, icon?, keywords?, onSelect }[]`) are the Actions: always in the empty state, and in a typed search an "Actions" group at the end for those whose label or keywords contain the query. **A result's kind and its words are separate**: `result.type` is the heading the reader sees, and an optional `result.typeKey` (`sales_order`) is the identity results group by and `typeIcons`, `listRoutes` and `truncatedTypes` are keyed by. Without `typeKey` the heading is the key, as before; a host with a translated interface sets it, because the same kind arrives under a different heading in each language. `SearchConfig.typeLabels` maps a type key to today's words, so a group's heading and the badge on a Recent row saved in another language read in the language the page is in. **⌘K / Ctrl+K is shared with the page.** A press that something nearer the user already handled (`preventDefault()`) is left alone, so an embed with its own ⌘K search keeps it. `SearchConfig.hotkey: false` (also a `GlobalSearch` prop) turns the key off altogether for a page whose handler does not claim it; the overlay still opens from a button that calls `openGlobalSearch()`, and Escape still closes it. |
1648
1648
  | `ShortcutHelp` | The keyboard cheatsheet shown on `?`. |
@@ -1701,7 +1701,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1701
1701
  | `<ShellLanguageProvider languages language strings? onChange? reload?>` | Which interface language is in force. Takes the tag `resolveShellLanguage` chose before mount and that language's shell catalog, mounts `ShellStringsProvider` with both, stamps `<html lang>`, and gives `useShellLanguage()` its `setLanguage`, which saves the choice and reloads. See [Choosing the language](#choosing-the-language--shelllanguageprovider). |
1702
1702
  | `<ShellEntityFetcherProvider value={(endpoint, id) => …}>` | How the modal stack fetches entity data. |
1703
1703
  | `<BugReportConfigProvider value={{ submit, list?, resolve? }}>` | Wire the bug-report flow to your backend. |
1704
- | `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. |
1704
+ | `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. Desktop sticky notes are their own notes under `desktop_stickies` (saved through `saveStickies`, else the prefs adapter), never Notepad notes; `saveNotes` is deprecated and no longer called. |
1705
1705
  | `<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. |
1706
1706
  | `<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()`. |
1707
1707
  | `setShellApiClient(axios)` | Module-level: register your axios instance once. |
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-HKAQXFUR.js";import{WindowTitle as r}from"./chunk-ZBTDMQUI.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EGEWU776.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NDEIZUMG.js";import{confirm as n}from"./chunk-4E4GWE4L.js";import"./chunk-R2QDO7NY.js";import"./chunk-KC3EX26K.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UGTRSRIW.js";import"./chunk-DXHLUB36.js";import"./chunk-CDAJKLGL.js";import"./chunk-IEAFSVXC.js";import"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="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"}],k=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 g(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&&k.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=a(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?g(u.current.url):"",[b,k]=l(w),[f,y]=l(p||b),[j,C]=l(f),[R,W]=l([f]),[E,z]=l(0),[D,U]=l(0),[H,L]=l(x),[M,S]=l(!1),[T,G]=l(null),A=a(null),F=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const X=e=>{const t=g(e);t&&(y(t),C(t),W(e=>{const o=e.slice(0,E+1);return o.push(t),o}),z(e=>e+1),S(!1))},I=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},J=()=>{const e=T?.trim();e?(L(t=>[...t,{label:e,url:f}]),G(null)):G(null)};i(()=>{if(null===T)return;A.current?.focus(),A.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==T]);const P=e=>{L(t=>t.filter((t,o)=>o!==e))},K=E>0,Z=E<R.length-1,O=H.some(e=>e.url===f),Q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-CMHLXELO.js";import{WindowTitle as r}from"./chunk-N6TK43YN.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import{confirm as n}from"./chunk-GVY2X4CC.js";import"./chunk-IFANUMK3.js";import"./chunk-GMRZX2ET.js";import"./chunk-SDI2UGAG.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-QZ3MO3HB.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="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"}],k=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 g(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&&k.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=a(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?g(u.current.url):"",[b,k]=l(w),[f,y]=l(p||b),[j,C]=l(f),[R,E]=l([f]),[W,z]=l(0),[D,H]=l(0),[L,M]=l(x),[S,U]=l(!1),[G,T]=l(null),K=a(null),A=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(L))}catch{}},[L]);const X=e=>{const t=g(e);t&&(y(t),C(t),E(e=>{const o=e.slice(0,W+1);return o.push(t),o}),z(e=>e+1),U(!1))},I=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},J=()=>{const e=G?.trim();e?(M(t=>[...t,{label:e,url:f}]),T(null)):T(null)};i(()=>{if(null===G)return;K.current?.focus(),K.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||T(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==G]);const O=e=>{M(t=>t.filter((t,o)=>o!==e))},P=W>0,Z=W<R.length-1,F=L.some(e=>e.url===f),B="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return c("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */m(r,{title:`Browser - ${v(f)}`}),
4
4
  /* @__PURE__ */m(o,{app:"browser"}),
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */m("button",{onClick:()=>{if(E>0){const e=E-1;z(e),y(R[e]),C(R[e]),S(!1)}},disabled:!K,className:Q,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */m("button",{onClick:()=>{if(E<R.length-1){const e=E+1;z(e),y(R[e]),C(R[e]),S(!1)}},disabled:!Z,className:Q,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */m("button",{onClick:()=>U(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */m("button",{onClick:()=>X(b),className:Q,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
6
+ /* @__PURE__ */m("button",{onClick:()=>{if(W>0){const e=W-1;z(e),y(R[e]),C(R[e]),U(!1)}},disabled:!P,className:B,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(W<R.length-1){const e=W+1;z(e),y(R[e]),C(R[e]),U(!1)}},disabled:!Z,className:B,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>H(e=>e+1),className:B,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>X(b),className:B,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
10
  /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),X(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */m("span",{className:"px-2 text-gray-400 text-xs",children:f.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */m("input",{type:"text",value:j,onChange:e=>C(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),f!==j&&/* @__PURE__ */m("button",{type:"button",onClick:()=>C(f),className:"px-2 text-2xs text-ink-faintest hover:text-ink",title:"Reset to current URL",children:"×"})]})}),
13
- /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>O?P(H.findIndex(e=>e.url===f)):void G(v(f)),className:Q+" "+(O?"text-yellow-500":""),title:O?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:O?"currentColor":"none",strokeWidth:1.5})}),
14
- /* @__PURE__ */m("button",{onClick:I,className:Q,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
- /* @__PURE__ */m("button",{onClick:()=>S(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==T&&/* @__PURE__ */c("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
13
+ /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>F?O(L.findIndex(e=>e.url===f)):void T(v(f)),className:B+" "+(F?"text-yellow-500":""),title:F?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:F?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:I,className:B,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>U(e=>!e),className:B,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==G&&/* @__PURE__ */c("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
16
16
  /* @__PURE__ */m("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
17
17
  /* @__PURE__ */m("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:f,children:f}),
18
- /* @__PURE__ */m("input",{ref:A,type:"text",value:T,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?J():"Escape"===e.key&&G(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
18
+ /* @__PURE__ */m("input",{ref:K,type:"text",value:G,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key?J():"Escape"===e.key&&T(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
19
  /* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
20
- /* @__PURE__ */m("button",{onClick:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */m("button",{onClick:J,disabled:!T.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
- /* @__PURE__ */c("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===H.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),H.map((e,t)=>/* @__PURE__ */c("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"})&&P(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:[
20
+ /* @__PURE__ */m("button",{onClick:()=>T(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:J,disabled:!G.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
22
+ /* @__PURE__ */c("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===L.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),L.map((e,t)=>/* @__PURE__ */c("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"})&&O(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
23
23
  /* @__PURE__ */m("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
24
24
  /* @__PURE__ */m("div",{className:"flex-1"}),
25
25
  /* @__PURE__ */m("button",{onClick:()=>{k(f);try{localStorage.setItem(h,f)}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"})]}),
26
- /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:D,iframeRef:F,openExternal:I,showHelp:M,dismissHelp:()=>S(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
26
+ /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:D,iframeRef:A,openExternal:I,showHelp:S,dismissHelp:()=>U(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
27
27
  /* @__PURE__ */m(s,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
28
28
  /* @__PURE__ */c("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
29
29
  /* @__PURE__ */c("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -1,29 +1,29 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-ED3QFXBC.js";import{useWidgetSettings as n}from"./chunk-ZBTDMQUI.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EGEWU776.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NDEIZUMG.js";import"./chunk-4E4GWE4L.js";import"./chunk-R2QDO7NY.js";import"./chunk-KC3EX26K.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UGTRSRIW.js";import"./chunk-DXHLUB36.js";import"./chunk-CDAJKLGL.js";import"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,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),[N,j]=c(!1),[y,x]=c(""),[f,C]=c([]),[v,$]=c(!1),[E,D]=c(()=>e(h)),[T,W]=c(!1),[M,R]=c(E),U=i(null);n(l(()=>{R({...E}),W(!0)},[E]));const w=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),F=l(()=>{k("0"),d(null),g(null),j(!1)},[]),G=l((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}},[]),A=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=G(p,t,b);k(String(e)),d(e),C(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,G]),H=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=G(p,e,b),n=`${p} ${b} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,G]),J=l(()=>{k(e=>String(parseFloat(e)/100))},[]),L=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?w(e.key):"."===e.key?w("."):"+"===e.key?A("+"):"-"===e.key?A("-"):"*"===e.key?A("×"):"/"===e.key?(e.preventDefault(),A("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&U.current?.contains(e.target)&&e.preventDefault(),H()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&J())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w,A,H,F,J]);const S="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",X=`${S} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Z=`${S} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,B=`${S} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,Q=`${S} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-WP4CIYJ7.js";import{useWidgetSettings as n}from"./chunk-N6TK43YN.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-GVY2X4CC.js";import"./chunk-IFANUMK3.js";import"./chunk-GMRZX2ET.js";import"./chunk-SDI2UGAG.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,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),[N,j]=c(!1),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[E,D]=c(()=>e(h)),[R,M]=c(!1),[T,W]=c(E),A=i(null);n(l(()=>{W({...E}),M(!0)},[E]));const w=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),S=l(()=>{k("0"),d(null),g(null),j(!1)},[]),G=l((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}},[]),J=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=G(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,G]),U=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=G(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,G]),F=l(()=>{k(e=>String(parseFloat(e)/100))},[]),H=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?w(e.key):"."===e.key?w("."):"+"===e.key?J("+"):"-"===e.key?J("-"):"*"===e.key?J("×"):"/"===e.key?(e.preventDefault(),J("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&A.current?.contains(e.target)&&e.preventDefault(),U()):"Escape"===e.key?S():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&F())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w,J,U,S,F]);const K="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",X=`${K} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Z=`${K} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,I=`${K} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,L=`${K} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
2
  return s(a,{children:[
3
- /* @__PURE__ */s("div",{ref:U,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
3
+ /* @__PURE__ */s("div",{ref:A,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
4
  /* @__PURE__ */s("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:f.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} ${N?"":m}`}),
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} ${N?"":m}`}),
6
6
  /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
8
  /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
9
  /* @__PURE__ */s("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:L,className:B,children:"+/−"}),
12
- /* @__PURE__ */u("button",{onClick:J,className:B,children:"%"}),
13
- /* @__PURE__ */u("button",{onClick:()=>A("÷"),className:`${Z} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
10
+ /* @__PURE__ */u("button",{onClick:S,className:I,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:H,className:I,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:F,className:I,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>J("÷"),className:`${Z} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
14
  /* @__PURE__ */u("button",{onClick:()=>w("7"),className:X,children:"7"}),
15
15
  /* @__PURE__ */u("button",{onClick:()=>w("8"),className:X,children:"8"}),
16
16
  /* @__PURE__ */u("button",{onClick:()=>w("9"),className:X,children:"9"}),
17
- /* @__PURE__ */u("button",{onClick:()=>A("×"),className:`${Z} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>J("×"),className:`${Z} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
18
  /* @__PURE__ */u("button",{onClick:()=>w("4"),className:X,children:"4"}),
19
19
  /* @__PURE__ */u("button",{onClick:()=>w("5"),className:X,children:"5"}),
20
20
  /* @__PURE__ */u("button",{onClick:()=>w("6"),className:X,children:"6"}),
21
- /* @__PURE__ */u("button",{onClick:()=>A("-"),className:`${Z} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>J("-"),className:`${Z} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
22
  /* @__PURE__ */u("button",{onClick:()=>w("1"),className:X,children:"1"}),
23
23
  /* @__PURE__ */u("button",{onClick:()=>w("2"),className:X,children:"2"}),
24
24
  /* @__PURE__ */u("button",{onClick:()=>w("3"),className:X,children:"3"}),
25
- /* @__PURE__ */u("button",{onClick:()=>A("+"),className:`${Z} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>J("+"),className:`${Z} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>w("0"),className:`${X} col-span-2`,children:"0"}),
27
27
  /* @__PURE__ */u("button",{onClick:()=>w("."),className:X,children:"."}),
28
- /* @__PURE__ */u("button",{onClick:H,className:Q,children:"="})]})]}),
29
- /* @__PURE__ */u(t,{open:T,onClose:()=>W(!1),title:"Calculator Settings",appearance:M,onAppearanceChange:R,onSave:()=>{D(M),localStorage.setItem(h,JSON.stringify(M)),W(!1)}})]})}export{m as default};
28
+ /* @__PURE__ */u("button",{onClick:U,className:L,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:R,onClose:()=>M(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:W,onSave:()=>{D(T),localStorage.setItem(h,JSON.stringify(T)),M(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-ED3QFXBC.js";import{useWidgetSettings as r}from"./chunk-ZBTDMQUI.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EGEWU776.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NDEIZUMG.js";import"./chunk-4E4GWE4L.js";import"./chunk-R2QDO7NY.js";import"./chunk-KC3EX26K.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UGTRSRIW.js";import"./chunk-DXHLUB36.js";import"./chunk-CDAJKLGL.js";import"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as a}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,x]=s(()=>t(h)),[y,D]=s({}),[b,S]=s(!1),[v,C]=s(!1),[U,R]=s([]),[J,G]=s(j),[H,M]=s("USD"),[A,B]=s("CNY");r(o(()=>{R([...u]),G({...j}),C(!0)},[u,j])),a(()=>{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=g(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,k(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-WP4CIYJ7.js";import{useWidgetSettings as r}from"./chunk-N6TK43YN.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-GVY2X4CC.js";import"./chunk-IFANUMK3.js";import"./chunk-GMRZX2ET.js";import"./chunk-SDI2UGAG.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as a}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[R,U]=s([]),[J,A]=s(j),[M,G]=s("USD"),[H,I]=s("CNY");r(o(()=>{U([...u]),A({...j}),v(!0)},[u,j])),a(()=>{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=g(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,k(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return c(i,{children:[
3
- /* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return c("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */l("span",{className:"text-base",children:f[t]||""}),
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */l("span",{className:"text-base",children:f[e]||""}),
10
10
  /* @__PURE__ */l("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */l("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */l(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:J,onAppearanceChange:G,onSave:()=>{if(0===U.length)return;const t=U.slice(0,4);d(t),x(J),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(J)),C(!1)},children:/* @__PURE__ */c("div",{children:[
12
+ /* @__PURE__ */l(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:J,onAppearanceChange:A,onSave:()=>{if(0===R.length)return;const t=R.slice(0,4);d(t),x(J),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(J)),v(!1)},children:/* @__PURE__ */c("div",{children:[
13
13
  /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */c("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",U.length,"/",4,")"]})]}),
15
- /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */c("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",R.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:R.map(([t,e],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:[f[t]||""," ",t," → ",f[e]||""," ",e]}),
17
- /* @__PURE__ */l("button",{onClick:()=>R(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),U.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */l("select",{value:H,onChange:t=>M(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
17
+ /* @__PURE__ */l("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),R.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */l("select",{value:M,onChange:t=>G(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
19
19
  /* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */l("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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
21
- /* @__PURE__ */l("button",{onClick:()=>{H!==A&&U.length<4&&R(t=>[...t,[H,A]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
20
+ /* @__PURE__ */l("select",{value:H,onChange:t=>I(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
21
+ /* @__PURE__ */l("button",{onClick:()=>{M!==H&&R.length<4&&U(t=>[...t,[M,H]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
@@ -1,25 +1,25 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-HKAQXFUR.js";import{WindowTitle as n}from"./chunk-ZBTDMQUI.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EGEWU776.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NDEIZUMG.js";import"./chunk-4E4GWE4L.js";import"./chunk-R2QDO7NY.js";import"./chunk-KC3EX26K.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-OQW42DOR.js";import"./chunk-UGTRSRIW.js";import"./chunk-DXHLUB36.js";import"./chunk-CDAJKLGL.js";import"./chunk-IEAFSVXC.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=m(x),[k,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[D,C]=m(null),M=d(null),L=d(null),U=d(null),R=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),N(!0)},W=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{U.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},T=e=>{D&&(D.el.removeAttribute("width"),D.el.removeAttribute("height"),D.el.style.width=e??"",D.el.style.height=e?"auto":"",N(!0),C(null))},A=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
1
+ import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-CMHLXELO.js";import{WindowTitle as n}from"./chunk-N6TK43YN.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-GVY2X4CC.js";import"./chunk-IFANUMK3.js";import"./chunk-GMRZX2ET.js";import"./chunk-SDI2UGAG.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-OQW42DOR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-QZ3MO3HB.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=m(x),[k,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[C,D]=m(null),M=d(null),L=d(null),R=d(null),U=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),N(!0)},W=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{R.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},A=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",N(!0),D(null))},T=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
2
2
  /* @vite-ignore */
3
- "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},E=f?.filename?(B=f.filename).length>24?`${B.slice(0,23)}…`:B:"Untitled";var B;/* @__PURE__ */
4
- return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):A(t[0]))},children:[
3
+ "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},E=f?.filename?(O=f.filename).length>24?`${O.slice(0,23)}…`:O:"Untitled";var O;/* @__PURE__ */
4
+ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):T(t[0]))},children:[
5
5
  /* @__PURE__ */u(n,{title:`${E}${w?" •":""} - Documents`}),
6
6
  /* @__PURE__ */u(t,{app:"documents"}),
7
7
  /* @__PURE__ */h("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
8
- /* @__PURE__ */u("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&A(t),M.current&&(M.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */u("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&T(t),M.current&&(M.current.value="")},className:"hidden"}),
9
9
  /* @__PURE__ */h("button",{onClick:()=>M.current?.click(),className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
10
10
  /* @__PURE__ */u(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
- /* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=U.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=U.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
11
+ /* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=R.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=R.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
12
12
  /* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest ml-1",children:"TXT · DOCX · Code"}),
13
13
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
14
14
  /* @__PURE__ */h("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,w?" •":""]}),
15
15
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
16
16
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
17
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
17
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
21
21
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
22
- /* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{R("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
22
+ /* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{U("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
23
23
  /* @__PURE__ */u("option",{value:"",disabled:!0,children:"Size"}),
24
24
  /* @__PURE__ */u("option",{value:"1",children:"XS"}),
25
25
  /* @__PURE__ */u("option",{value:"2",children:"S"}),
@@ -27,26 +27,26 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
27
27
  /* @__PURE__ */u("option",{value:"4",children:"L"}),
28
28
  /* @__PURE__ */u("option",{value:"5",children:"XL"}),
29
29
  /* @__PURE__ */u("option",{value:"6",children:"2XL"})]}),
30
- /* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>R("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
30
+ /* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>U("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
31
31
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
32
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
32
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
34
34
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
35
35
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
36
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
- /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>R("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
36
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
40
40
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
41
  /* @__PURE__ */u("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),L.current&&(L.current.value="")}}),
42
42
  /* @__PURE__ */h("button",{onClick:()=>L.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
43
43
  /* @__PURE__ */u(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
- /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:U,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),C({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-surface p-[1in] shadow text-sm leading-relaxed text-ink-strong outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-ink-strong bg-surface outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),D&&/* @__PURE__ */h(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(null),children:[
44
+ /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-surface p-[1in] shadow text-sm leading-relaxed text-ink-strong outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-ink-strong bg-surface outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */h(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
45
45
  /* @__PURE__ */u(i,{children:"Image width"}),
46
- /* @__PURE__ */u(l,{onClick:()=>T("25%"),children:"25%"}),
47
- /* @__PURE__ */u(l,{onClick:()=>T("50%"),children:"50%"}),
48
- /* @__PURE__ */u(l,{onClick:()=>T("75%"),children:"75%"}),
49
- /* @__PURE__ */u(l,{onClick:()=>T("100%"),children:"100%"}),
50
- /* @__PURE__ */u(l,{onClick:()=>T(null),children:"Original size"}),
46
+ /* @__PURE__ */u(l,{onClick:()=>A("25%"),children:"25%"}),
47
+ /* @__PURE__ */u(l,{onClick:()=>A("50%"),children:"50%"}),
48
+ /* @__PURE__ */u(l,{onClick:()=>A("75%"),children:"75%"}),
49
+ /* @__PURE__ */u(l,{onClick:()=>A("100%"),children:"100%"}),
50
+ /* @__PURE__ */u(l,{onClick:()=>A(null),children:"Original size"}),
51
51
  /* @__PURE__ */u(a,{}),
52
- /* @__PURE__ */u(l,{danger:!0,onClick:()=>{D?.el.remove(),N(!0),C(null)},children:"Remove image"})]})]})}export{f as default};
52
+ /* @__PURE__ */u(l,{danger:!0,onClick:()=>{C?.el.remove(),N(!0),D(null)},children:"Remove image"})]})]})}export{f as default};