efficient-shell 10.22.0 → 10.24.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 (290) hide show
  1. package/README.md +16 -4
  2. package/dist/{Browser-XQ5GO3LJ.js → Browser-KUFFOGYK.js} +14 -14
  3. package/dist/Calculator-LENRW34X.js +29 -0
  4. package/dist/CurrencyConverter-7UMHQS2V.js +21 -0
  5. package/dist/{Documents-7GOEAIJ6.js → Documents-ODZ4AAOY.js} +20 -20
  6. package/dist/{Files-MMVUWO5F.js → Files-BRGTTI2J.js} +46 -46
  7. package/dist/Notepad-RMRDEGGU.js +24 -0
  8. package/dist/PomodoroTimer-4566W4F7.js +91 -0
  9. package/dist/{Preview-DEK7WTAU.js → Preview-7POJP7PB.js} +33 -33
  10. package/dist/Sidebar-TU4QCKYJ.js +44 -0
  11. package/dist/Spreadsheet-7T4VT5IO.js +37 -0
  12. package/dist/{Stock-XHMTFEOL.js → Stock-H73C4R3N.js} +4 -4
  13. package/dist/{Weather-X5WAHYQ3.js → Weather-WF56QCBI.js} +20 -20
  14. package/dist/{WorldClock-ARU7PMVZ.js → WorldClock-5QJNZYYS.js} +6 -6
  15. package/dist/ai/index.js +91 -91
  16. package/dist/api/shellHttp.d.ts +52 -0
  17. package/dist/api/shellHttp.js +1 -0
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/media-host-check.js +1 -1
  20. package/dist/bin/ui-check.js +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/ChartTooltip.js +1 -1
  24. package/dist/charts/ChordChart.js +1 -1
  25. package/dist/charts/ColumnChart.js +1 -1
  26. package/dist/charts/FunnelChart.js +1 -1
  27. package/dist/charts/HeatmapChart.js +1 -1
  28. package/dist/charts/HistogramChart.js +1 -1
  29. package/dist/charts/PieChart.js +1 -1
  30. package/dist/charts/RadarChart.js +1 -1
  31. package/dist/charts/RadialBarChart.js +1 -1
  32. package/dist/charts/RangeChart.js +1 -1
  33. package/dist/charts/SankeyChart.js +1 -1
  34. package/dist/charts/ScatterChart.js +1 -1
  35. package/dist/charts/SpecChart.js +1 -1
  36. package/dist/charts/SunburstChart.js +1 -1
  37. package/dist/charts/TimeSeriesChart.js +1 -1
  38. package/dist/charts/TreemapChart.js +1 -1
  39. package/dist/charts/WaterfallChart.js +1 -1
  40. package/dist/chunk-2QY5BJLA.js +2 -0
  41. package/dist/{chunk-3PO4D32J.js → chunk-36PJGT4W.js} +1 -1
  42. package/dist/{chunk-AGPPZHAH.js → chunk-36VIGB6J.js} +1 -1
  43. package/dist/{chunk-C4CAPG3D.js → chunk-3BFZVVAT.js} +1 -1
  44. package/dist/chunk-3C5NKOVF.js +1 -0
  45. package/dist/chunk-3FBDLIQW.js +99 -0
  46. package/dist/chunk-4BCFBF3C.js +9 -0
  47. package/dist/chunk-4EBJO7ER.js +15 -0
  48. package/dist/chunk-4LXCCZDM.js +1 -0
  49. package/dist/{chunk-YICFH5KO.js → chunk-4P3324KU.js} +1 -1
  50. package/dist/chunk-4P57TIFK.js +2 -0
  51. package/dist/{chunk-QDJQ43N4.js → chunk-4RGMRXYH.js} +1 -1
  52. package/dist/{chunk-6V4INP7J.js → chunk-4TYIYL56.js} +4 -4
  53. package/dist/{chunk-P22NWAFW.js → chunk-55AEZX6K.js} +1 -1
  54. package/dist/chunk-5DIGYJHD.js +1 -0
  55. package/dist/{chunk-BB6A5MGA.js → chunk-5FYDNH4Y.js} +1 -1
  56. package/dist/{chunk-U2RFKQVA.js → chunk-5H4SWQGM.js} +1 -1
  57. package/dist/{chunk-KABWJIY4.js → chunk-5PP435FL.js} +1 -1
  58. package/dist/{chunk-BWTK3NUD.js → chunk-6IOFNPR6.js} +4 -4
  59. package/dist/{chunk-OBNA7GF5.js → chunk-6M5O2P64.js} +9 -9
  60. package/dist/{chunk-P3LKCOB4.js → chunk-7FW2BQTV.js} +2 -2
  61. package/dist/{chunk-SRYX6AQ6.js → chunk-7JVGF555.js} +1 -1
  62. package/dist/{chunk-ARSOETMP.js → chunk-7KWYVQMX.js} +1 -1
  63. package/dist/chunk-7LU3H72S.js +7 -0
  64. package/dist/chunk-7RP7QTRF.js +12 -0
  65. package/dist/{chunk-AKBGUMLI.js → chunk-A6FR2D46.js} +5 -5
  66. package/dist/{chunk-RAMJFT3D.js → chunk-AFG34RBV.js} +5 -5
  67. package/dist/{chunk-5JCHYQYI.js → chunk-ALTBTO3Z.js} +3 -3
  68. package/dist/chunk-ATMJ5ZPK.js +1 -0
  69. package/dist/{chunk-PWUPLXSS.js → chunk-BBXFIBXB.js} +1 -1
  70. package/dist/{chunk-EE56C2JH.js → chunk-BMXTPJ7T.js} +5 -5
  71. package/dist/{chunk-O64PY7ZJ.js → chunk-BUO7XCYR.js} +11 -11
  72. package/dist/{chunk-LJHVEISA.js → chunk-CH3JQUDW.js} +6 -6
  73. package/dist/{chunk-DLOJSJWL.js → chunk-CIHR5ZKF.js} +1 -1
  74. package/dist/{chunk-E5H5OU3A.js → chunk-COF33H6J.js} +5 -5
  75. package/dist/{chunk-GGRD2JLB.js → chunk-CQEVJG43.js} +1 -1
  76. package/dist/{chunk-WHISJI5L.js → chunk-CX4XR4HO.js} +1 -1
  77. package/dist/{chunk-XDCHB6JA.js → chunk-DGWS4GTI.js} +1 -1
  78. package/dist/{chunk-RXO2LNIB.js → chunk-DIEH76MB.js} +1 -1
  79. package/dist/{chunk-PJBZ5B54.js → chunk-DOF56HTO.js} +5 -5
  80. package/dist/{chunk-CGP2QCIA.js → chunk-DRUQH4ZE.js} +2 -2
  81. package/dist/{chunk-KGVNRLWT.js → chunk-DVYIBJ3S.js} +2 -2
  82. package/dist/{chunk-5DIBDRB6.js → chunk-DWAA4YZV.js} +3 -3
  83. package/dist/{chunk-4BPIGS2D.js → chunk-DZOJQURG.js} +6 -6
  84. package/dist/{chunk-7SMDYBQX.js → chunk-E3EJWNNK.js} +8 -8
  85. package/dist/chunk-E6FDUFPH.js +1 -0
  86. package/dist/chunk-EH2BNSG3.js +13 -0
  87. package/dist/chunk-EOVXFXVV.js +2 -0
  88. package/dist/chunk-EXLHFM3V.js +6 -0
  89. package/dist/chunk-F3ZOO23R.js +1 -0
  90. package/dist/{chunk-L67WTASI.js → chunk-FUDUQ44A.js} +1 -1
  91. package/dist/{chunk-N2RIQ2OU.js → chunk-FZM3ZPW3.js} +1 -1
  92. package/dist/{chunk-VQIG5N6D.js → chunk-G66SG6JN.js} +9 -9
  93. package/dist/{chunk-GCC2OZDG.js → chunk-GC3DA6D6.js} +1 -1
  94. package/dist/{chunk-QA3EAJ5H.js → chunk-GOXQJCXG.js} +17 -17
  95. package/dist/{chunk-XAPHUSOR.js → chunk-H475WZPF.js} +16 -16
  96. package/dist/{chunk-53DO72B2.js → chunk-H5NIW2KS.js} +1 -1
  97. package/dist/chunk-HNVSVTNC.js +16 -0
  98. package/dist/{chunk-ET4726WV.js → chunk-IHNOWRTP.js} +2 -2
  99. package/dist/{chunk-QZMGWRZ4.js → chunk-IPO4LHSB.js} +6 -6
  100. package/dist/{chunk-E5QPXEKN.js → chunk-JFBL4PR3.js} +1 -1
  101. package/dist/chunk-JPOYR5AO.js +7 -0
  102. package/dist/{chunk-BJRJODRZ.js → chunk-LCSMBVMU.js} +1 -1
  103. package/dist/{chunk-WVCX2Y3S.js → chunk-LE5LWALR.js} +1 -1
  104. package/dist/chunk-LNXBTK7Q.js +1 -0
  105. package/dist/{chunk-HC2AM2DT.js → chunk-MCAPJSB6.js} +1 -1
  106. package/dist/{chunk-REWKL7MX.js → chunk-MDYJVXWD.js} +2 -2
  107. package/dist/chunk-MHPFBVDD.js +8 -0
  108. package/dist/{chunk-NS2HY4NL.js → chunk-N5KO2IHG.js} +4 -4
  109. package/dist/{chunk-22LRMKLV.js → chunk-NJN5IKWO.js} +6 -6
  110. package/dist/{chunk-HWKAFISI.js → chunk-NRALUW6P.js} +7 -7
  111. package/dist/{chunk-SETRKP7W.js → chunk-NWC6YCIJ.js} +10 -10
  112. package/dist/{chunk-WE3HINW3.js → chunk-NZ34BQKH.js} +1 -1
  113. package/dist/{chunk-H2C5SZKO.js → chunk-NZ7BFYCM.js} +1 -1
  114. package/dist/chunk-O3MBPAWZ.js +2 -0
  115. package/dist/{chunk-6XYGA252.js → chunk-O7RR2ZZ2.js} +6 -6
  116. package/dist/{chunk-SAGI7AWC.js → chunk-OKHKY3ZZ.js} +1 -1
  117. package/dist/{chunk-KLAKLVKE.js → chunk-OTITQ3IH.js} +12 -12
  118. package/dist/{chunk-WSMRVWWK.js → chunk-P7H2DXJB.js} +10 -10
  119. package/dist/chunk-PSR6SXCC.js +14 -0
  120. package/dist/{chunk-AFBBNGVO.js → chunk-PVDZG2U2.js} +7 -7
  121. package/dist/{chunk-Q5WPHBDB.js → chunk-QGWKM7C3.js} +5 -5
  122. package/dist/{chunk-GEDS6QO7.js → chunk-QRU55BUS.js} +2 -2
  123. package/dist/{chunk-A46WK67X.js → chunk-QWCEKHAP.js} +4 -4
  124. package/dist/{chunk-DOWE3ZQR.js → chunk-RDKIYORS.js} +1 -1
  125. package/dist/{chunk-D6ZXMKW2.js → chunk-RSOBUPLK.js} +1 -1
  126. package/dist/{chunk-F3ZH6UCW.js → chunk-RZQGPWSN.js} +1 -1
  127. package/dist/{chunk-NWUAATIX.js → chunk-S4FPYCUU.js} +3 -3
  128. package/dist/chunk-S5DYR75A.js +29 -0
  129. package/dist/chunk-STKJA4PV.js +1 -0
  130. package/dist/{chunk-OAVU46YG.js → chunk-TDAI4J27.js} +4 -4
  131. package/dist/{chunk-WJ6ZJVAX.js → chunk-TE6R53YD.js} +1 -1
  132. package/dist/{chunk-GIK62TW6.js → chunk-TFSLPAGB.js} +3 -3
  133. package/dist/chunk-TNJ2VCH4.js +8 -0
  134. package/dist/{chunk-7XNDWW3Y.js → chunk-U44DVPGB.js} +1 -1
  135. package/dist/{chunk-ZTV2BA3P.js → chunk-U6LKNGC6.js} +1 -1
  136. package/dist/chunk-UKBXQXDZ.js +1 -0
  137. package/dist/chunk-ULJQYXHB.js +1 -0
  138. package/dist/{chunk-CIYMGVZC.js → chunk-UNQ54QOF.js} +1 -1
  139. package/dist/chunk-UPXDDO3U.js +1 -0
  140. package/dist/{chunk-C2ZUYCIM.js → chunk-USVL5SLG.js} +1 -1
  141. package/dist/chunk-USWA6YNZ.js +3 -0
  142. package/dist/{chunk-CIXGYZCF.js → chunk-V2J2AHDW.js} +4 -4
  143. package/dist/chunk-VX4COEWP.js +4 -0
  144. package/dist/{chunk-VXQQQDJ3.js → chunk-VX6TKEEK.js} +1 -1
  145. package/dist/{chunk-NTVOQHRS.js → chunk-WDQEUNGE.js} +1 -1
  146. package/dist/{chunk-GLE4F5FT.js → chunk-WGLHB6WE.js} +1 -1
  147. package/dist/{chunk-MW3FT4WI.js → chunk-WL4U4MTQ.js} +3 -3
  148. package/dist/{chunk-NPGFCIHB.js → chunk-WLYYC3AP.js} +1 -1
  149. package/dist/{chunk-GCP3LGRG.js → chunk-WOAMPTZI.js} +14 -14
  150. package/dist/{chunk-FHYETY4V.js → chunk-XBHXGBJR.js} +1 -1
  151. package/dist/{chunk-VKP2WRJJ.js → chunk-XCAUDTCC.js} +8 -8
  152. package/dist/chunk-XFH64VIG.js +19 -0
  153. package/dist/chunk-XXL5RLNM.js +22 -0
  154. package/dist/{chunk-6CICYVCK.js → chunk-YQOVUH5W.js} +8 -8
  155. package/dist/{chunk-WUMPTKOG.js → chunk-Z3SLQKE6.js} +1 -1
  156. package/dist/{chunk-4UHAQMOT.js → chunk-Z44JWU75.js} +2 -2
  157. package/dist/{chunk-UXPKCDEF.js → chunk-Z6GQFTLJ.js} +1 -1
  158. package/dist/{chunk-TBQLPMW5.js → chunk-ZRLWE3JM.js} +1 -1
  159. package/dist/data/DataTable.js +1 -1
  160. package/dist/data/EntityList.d.ts +125 -0
  161. package/dist/data/EntityList.js +2 -0
  162. package/dist/data/ListLoadError.js +1 -1
  163. package/dist/data/ResizableTable.d.ts +31 -0
  164. package/dist/data/ResizableTable.js +2 -0
  165. package/dist/data/useColumnConfig.d.ts +68 -0
  166. package/dist/data/useColumnConfig.js +2 -0
  167. package/dist/data/useSort.d.ts +55 -0
  168. package/dist/data/useSort.js +2 -0
  169. package/dist/data/useTableNav.d.ts +28 -0
  170. package/dist/data/useTableNav.js +2 -0
  171. package/dist/format/index.d.ts +1 -1
  172. package/dist/format/index.js +1 -1
  173. package/dist/forms/AlignmentGrid.js +1 -1
  174. package/dist/forms/BorderInput.js +1 -1
  175. package/dist/forms/BrandAssetEditor.js +1 -1
  176. package/dist/forms/Button.js +1 -1
  177. package/dist/forms/ColorPicker.js +1 -1
  178. package/dist/forms/ComposerAttachments.js +1 -1
  179. package/dist/forms/CornersInput.js +1 -1
  180. package/dist/forms/DateRangePicker.js +1 -1
  181. package/dist/forms/DisplayChips.js +1 -1
  182. package/dist/forms/FilePicker.js +1 -1
  183. package/dist/forms/IconButton.js +1 -1
  184. package/dist/forms/IconPicker.js +1 -1
  185. package/dist/forms/InputNumber.js +1 -1
  186. package/dist/forms/LinkPicker.js +1 -1
  187. package/dist/forms/MediaLibrary.js +1 -1
  188. package/dist/forms/MediaUploadField.js +1 -1
  189. package/dist/forms/MediaUploadGrid.js +1 -1
  190. package/dist/forms/MediaUsedInList.js +1 -1
  191. package/dist/forms/NumericKeypad.js +1 -1
  192. package/dist/forms/PictureTiles.js +1 -1
  193. package/dist/forms/PositionInput.js +1 -1
  194. package/dist/forms/Segmented.js +1 -1
  195. package/dist/forms/Select.js +1 -1
  196. package/dist/forms/SidesInput.js +1 -1
  197. package/dist/forms/Slider.js +1 -1
  198. package/dist/forms/Snippet.js +1 -1
  199. package/dist/forms/SplitButton.js +1 -1
  200. package/dist/forms/TagInput.js +1 -1
  201. package/dist/forms/TextToolbar.js +1 -1
  202. package/dist/forms/WidthsBar.js +1 -1
  203. package/dist/hooks/useRootIsDark.d.ts +3 -0
  204. package/dist/hooks/useRootIsDark.js +1 -1
  205. package/dist/icons/efficient-glyphs.js +1 -1
  206. package/dist/icons/efficient-looks.js +1 -1
  207. package/dist/icons/efficient.js +1 -1
  208. package/dist/icons/index.js +1 -1
  209. package/dist/icons/looks/map.js +1 -1
  210. package/dist/icons/payment.js +1 -1
  211. package/dist/icons/sets.js +1 -1
  212. package/dist/index.d.ts +13 -317
  213. package/dist/index.js +667 -694
  214. package/dist/map/index.js +3 -3
  215. package/dist/page-tabs/index.js +5 -5
  216. package/dist/shell/AppUpdateBanner.js +1 -1
  217. package/dist/shell/ColoredBadge.js +1 -1
  218. package/dist/shell/ContextMenu.js +1 -1
  219. package/dist/shell/DropdownMenu.js +1 -1
  220. package/dist/shell/EditableGrid.js +1 -1
  221. package/dist/shell/FloatingBar.js +1 -1
  222. package/dist/shell/GlobalSearch.js +1 -1
  223. package/dist/shell/HelpCenter.js +1 -1
  224. package/dist/shell/IconRail.js +1 -1
  225. package/dist/shell/ImageLightbox.js +1 -1
  226. package/dist/shell/ItemCount.js +1 -1
  227. package/dist/shell/LanguageSelect.js +1 -1
  228. package/dist/shell/Markdown.js +1 -1
  229. package/dist/shell/PopupMenu.js +1 -1
  230. package/dist/shell/ResizeHandle.js +1 -1
  231. package/dist/shell/SearchableSelect.js +1 -1
  232. package/dist/shell/SettingReset.js +1 -1
  233. package/dist/shell/SettingRow.js +1 -1
  234. package/dist/shell/SidebarLayout.js +1 -1
  235. package/dist/shell/SidebarNav.js +1 -1
  236. package/dist/shell/SortableList.js +1 -1
  237. package/dist/shell/StatusBadge.js +1 -1
  238. package/dist/shell/Tabs.js +1 -1
  239. package/dist/shell/Tooltip.js +1 -1
  240. package/dist/shell/TopNav.js +1 -1
  241. package/dist/shell/TransferProgress.js +1 -1
  242. package/dist/shell/Tree.js +1 -1
  243. package/dist/telemetry/index.js +1 -1
  244. package/dist/templates/AuthScreen.js +1 -1
  245. package/dist/templates/ChatTemplate.js +1 -1
  246. package/dist/templates/CheckoutTemplate.js +1 -1
  247. package/dist/templates/DashboardTemplate.js +1 -1
  248. package/dist/templates/DataTablePage.js +1 -1
  249. package/dist/templates/EmailTemplate.js +1 -1
  250. package/dist/templates/ErrorBoundary.js +1 -1
  251. package/dist/templates/FormLayoutPage.js +1 -1
  252. package/dist/templates/GalleryTemplate.js +1 -1
  253. package/dist/theme/index.d.ts +2 -0
  254. package/dist/theme/index.js +2 -0
  255. package/dist/ui/index.d.ts +6 -0
  256. package/dist/ui/index.js +1 -1
  257. package/dist/utils/glass.js +1 -1
  258. package/dist/utils/rootTheme.d.ts +13 -1
  259. package/dist/utils/rootTheme.js +1 -1
  260. package/dist/version.js +1 -1
  261. package/package.json +6 -1
  262. package/dist/Calculator-X62IAKQY.js +0 -29
  263. package/dist/CurrencyConverter-PSOBQ6K2.js +0 -21
  264. package/dist/Notepad-FAQBAF36.js +0 -24
  265. package/dist/PomodoroTimer-ZLS6XCTN.js +0 -91
  266. package/dist/Sidebar-JF2KEJT2.js +0 -44
  267. package/dist/Spreadsheet-6C7Q6OQA.js +0 -37
  268. package/dist/chunk-4DO47TT5.js +0 -1
  269. package/dist/chunk-5532S4RN.js +0 -4
  270. package/dist/chunk-5R4X7MFQ.js +0 -1
  271. package/dist/chunk-5XKCOKYJ.js +0 -1
  272. package/dist/chunk-CY5N5OA3.js +0 -2
  273. package/dist/chunk-F7U5MVNH.js +0 -2
  274. package/dist/chunk-FX4KK5GE.js +0 -3
  275. package/dist/chunk-GCMCXRIN.js +0 -19
  276. package/dist/chunk-H43BVPNN.js +0 -7
  277. package/dist/chunk-IWOVB4WI.js +0 -9
  278. package/dist/chunk-LIULEXWE.js +0 -14
  279. package/dist/chunk-LQVW3SW4.js +0 -6
  280. package/dist/chunk-NGRTW6Y7.js +0 -2
  281. package/dist/chunk-PBFFKRQF.js +0 -12
  282. package/dist/chunk-QFJIMX4A.js +0 -15
  283. package/dist/chunk-QIMFBARF.js +0 -8
  284. package/dist/chunk-RRGMXY46.js +0 -29
  285. package/dist/chunk-TLJWBRLI.js +0 -8
  286. package/dist/chunk-URQWWOHM.js +0 -7
  287. package/dist/chunk-WBJ6KNUF.js +0 -1
  288. package/dist/chunk-WEPQU5W6.js +0 -22
  289. package/dist/chunk-ZT45XXIB.js +0 -100
  290. /package/dist/{chunk-CSA6CGXS.js → chunk-RKLZDVAO.js} +0 -0
package/README.md CHANGED
@@ -1889,11 +1889,22 @@ draws its own controls it restyles them. `<html class="rosh-host-elements">`
1889
1889
  turns those three off. The kit's own controls stay dark through their
1890
1890
  remapped utility classes.
1891
1891
 
1892
+ **The list comes too.** `EntityList` over `ResizableTable` is the admin
1893
+ portals' list: drag a heading to reorder, drag its edge to resize, Reset and
1894
+ the column picker in the footer, the row menu, keyboard navigation. It and its
1895
+ hooks (`useSort`, `useColumnConfig`, `useTableNav`) are in the kit. Column
1896
+ layouts and sort persist through `<ShellPrefsProvider>` when you mount one, and
1897
+ in this browser's `localStorage` otherwise. The admin-saved defaults
1898
+ (`GET /auth/default-columns/{tableId}/`) are read once per table through the
1899
+ client you pass `setShellApiClient`, and not at all without one. Paging is
1900
+ yours: `useInfiniteScroll` is react-query and stays on the root, so a kit host
1901
+ feeds `items`, `totalCount` and `sentinelRef` from its own query.
1902
+
1892
1903
  What you do not get: `Modal` and the window manager, `Layout`, `Desktop`,
1893
1904
  `StartMenu`, `GlobalSearch`, the settings panels, the bundled apps, and the
1894
- components that reach an optional peer for their own reasons (`EntityList`,
1895
- `ResizableTable` and the react-query data hooks, `FilterBar`, `UndoControls`,
1896
- `BulkImportGrid`, `ConfirmProvider`/`confirm`).
1905
+ components that reach an optional peer for their own reasons
1906
+ (`useInfiniteScroll` and the other react-query data hooks, `FilterBar`,
1907
+ `UndoControls`, `BulkImportGrid`, `ConfirmProvider`/`confirm`).
1897
1908
 
1898
1909
  **Stylesheets: import exactly one.** `ui.css` is the kit; `styles.css` is the
1899
1910
  umbrella over the kit *plus* the window/taskbar/desktop rules. Taking both
@@ -4480,7 +4491,8 @@ read a stored focus on a server.
4480
4491
  | `useDebouncedValue(value, delay = 300)` | The value, changed only after `delay` ms with no new change — feed it to a search query, not the raw one. |
4481
4492
  | `parseHexColor(text)` | `#rrggbb`, lower case, from three or six hex digits with or without `#` (any case, spaces round it allowed); `null` when it is not a colour. Also on `efficient-shell/format`, so a published page keeps one hex check. |
4482
4493
  | `rootIsDark({ doc?, whenUnset? })`, `ROOT_THEME_ATTRIBUTES` | Is the page dark? Reads `<html>` the way ui.css does: `data-theme="dark"` or a `dark` class. On `efficient-shell/format` (no React): it reads `<html>` only when called, and never throws. `doc` reads another document (an iframe's). `whenUnset` is the answer when `<html>` names no theme: `false` by default; a host that is dark unless `data-theme` says `light` passes `true`. `ROOT_THEME_ATTRIBUTES` (`data-theme`, `class`) is the `attributeFilter` for a `MutationObserver`. |
4483
- | `useRootIsDark({ doc?, whenUnset? })` | The same answer as a hook on `efficient-shell/ui`: re-renders when the page changes theme. On the server it answers `whenUnset`, so a dark-by-default host hydrates dark. |
4494
+ | `useRootIsDark({ doc?, whenUnset? })` | The same answer as a hook on `efficient-shell/ui`: re-renders when the page changes theme. On the server it answers `whenUnset`, so a dark-by-default host hydrates dark. Also on `efficient-shell/theme`, alone (React only), for a published page whose render side may not take the kit. |
4495
+ | `watchRootTheme(onChange, { doc? })` | The one watcher behind the hook, on `efficient-shell/format` (no React): calls `onChange` when `<html>` changes `data-theme` or `class`, and returns the stop function. Where there is no document (a server) it watches nothing. For code that keeps its own state (a map's tile style); a component uses the hook. |
4484
4496
 
4485
4497
  ### Image copies — `efficient-shell/image-copies`
4486
4498
 
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-ET4726WV.js";import{WindowTitle as r}from"./chunk-ZT45XXIB.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import{confirm as n}from"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-KC3EX26K.js";import"./chunk-P22NWAFW.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UGTRSRIW.js";import"./chunk-SAGI7AWC.js";import"./chunk-CDAJKLGL.js";import"./chunk-4DO47TT5.js";import"./chunk-KLAKLVKE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-N2RIQ2OU.js";import"./chunk-NGRTW6Y7.js";import"./chunk-UQYNPYF4.js";import"./chunk-WJ6ZJVAX.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-GLE4F5FT.js";import"./chunk-22LRMKLV.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-BB6A5MGA.js";import"./chunk-5R4X7MFQ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.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",k=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=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&&b.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 k;try{const e=localStorage.getItem(d);if(!e)return k;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return k}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):"",[k,b]=l(w),[f,y]=l(p||k),[j,C]=l(f),[W,z]=l([f]),[R,L]=l(0),[E,S]=l(0),[T,D]=l(x),[U,A]=l(!1),[G,H]=l(null),K=a(null),M=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(T))}catch{}},[T]);const J=e=>{const t=g(e);t&&(y(t),C(t),z(e=>{const o=e.slice(0,R+1);return o.push(t),o}),L(e=>e+1),A(!1))},B=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},O=()=>{const e=G?.trim();e?(D(t=>[...t,{label:e,url:f}]),H(null)):H(null)};i(()=>{if(null===G)return;K.current?.focus(),K.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||H(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==G]);const P=e=>{D(t=>t.filter((t,o)=>o!==e))},Q=R>0,X=R<W.length-1,F=T.some(e=>e.url===f),I="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-IHNOWRTP.js";import{WindowTitle as r}from"./chunk-3FBDLIQW.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import{confirm as n}from"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-CDAJKLGL.js";import"./chunk-O3MBPAWZ.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-5DIGYJHD.js";import"./chunk-FZM3ZPW3.js";import"./chunk-OTITQ3IH.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.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",k=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=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&&b.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 k;try{const e=localStorage.getItem(d);if(!e)return k;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return k}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):"",[k,b]=l(w),[f,y]=l(p||k),[j,C]=l(f),[W,z]=l([f]),[D,E]=l(0),[L,R]=l(0),[H,S]=l(x),[T,O]=l(!1),[U,K]=l(null),J=a(null),P=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const Z=e=>{const t=g(e);t&&(y(t),C(t),z(e=>{const o=e.slice(0,D+1);return o.push(t),o}),E(e=>e+1),O(!1))},B=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},G=()=>{const e=U?.trim();e?(S(t=>[...t,{label:e,url:f}]),K(null)):K(null)};i(()=>{if(null===U)return;J.current?.focus(),J.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||K(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const I=e=>{S(t=>t.filter((t,o)=>o!==e))},M=D>0,Q=D<W.length-1,X=H.some(e=>e.url===f),A="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(R>0){const e=R-1;L(e),y(W[e]),C(W[e]),A(!1)}},disabled:!Q,className:I,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */m("button",{onClick:()=>{if(R<W.length-1){const e=R+1;L(e),y(W[e]),C(W[e]),A(!1)}},disabled:!X,className:I,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */m("button",{onClick:()=>S(e=>e+1),className:I,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */m("button",{onClick:()=>J(k),className:I,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),J(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:[
6
+ /* @__PURE__ */m("button",{onClick:()=>{if(D>0){const e=D-1;E(e),y(W[e]),C(W[e]),O(!1)}},disabled:!M,className:A,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(D<W.length-1){const e=D+1;E(e),y(W[e]),C(W[e]),O(!1)}},disabled:!Q,className:A,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>R(e=>e+1),className:A,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>Z(k),className:A,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),Z(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:()=>F?P(T.findIndex(e=>e.url===f)):void H(v(f)),className:I+" "+(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:B,className:I,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
- /* @__PURE__ */m("button",{onClick:()=>A(e=>!e),className:I,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:[
13
+ /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>X?I(H.findIndex(e=>e.url===f)):void K(v(f)),className:A+" "+(X?"text-yellow-500":""),title:X?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:X?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:B,className:A,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>O(e=>!e),className:A,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__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:K,type:"text",value:G,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?O():"Escape"===e.key&&H(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:J,type:"text",value:U,onChange:e=>K(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&K(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:()=>H(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */m("button",{onClick:O,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===T.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>J(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:()=>K(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:G,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
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:()=>Z(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-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:()=>{b(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:E,iframeRef:M,openExternal:B,showHelp:U,dismissHelp:()=>A(!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:L,iframeRef:P,openExternal:B,showHelp:T,dismissHelp:()=>O(!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 ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-RSOBUPLK.js";import{useWidgetSettings as n}from"./chunk-3FBDLIQW.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-CDAJKLGL.js";import"./chunk-O3MBPAWZ.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-OTITQ3IH.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as r}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,x]=c(""),[f,v]=c([]),[C,$]=c(!1),[E,W]=c(()=>e(h)),[T,D]=c(!1),[B,Z]=c(E),K=i(null);n(o(()=>{Z({...E}),D(!0)},[E]));const L=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),S=o(()=>{k("0"),d(null),g(null),N(!1)},[]),w=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}},[]),A=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=w(p,t,b);k(String(e)),d(e),v(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,w]),F=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=w(p,e,b),n=`${p} ${b} ${e} =`;v(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,w]),J=o(()=>{k(e=>String(parseFloat(e)/100))},[]),O=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?L(e.key):"."===e.key?L("."):"+"===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&&K.current?.contains(e.target)&&e.preventDefault(),F()):"Escape"===e.key?S():"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)},[L,A,F,S,J]);const Q="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",U=`${Q} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,X=`${Q} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,H=`${Q} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,M=`${Q} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:K,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children: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} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,C?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:S,className:H,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:O,className:H,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:J,className:H,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>A("÷"),className:`${X} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>L("7"),className:U,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>L("8"),className:U,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>L("9"),className:U,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>A("×"),className:`${X} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>L("4"),className:U,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>L("5"),className:U,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>L("6"),className:U,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>A("-"),className:`${X} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>L("1"),className:U,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>L("2"),className:U,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>L("3"),className:U,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>A("+"),className:`${X} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>L("0"),className:`${U} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>L("."),className:U,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:F,className:M,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:T,onClose:()=>D(!1),title:"Calculator Settings",appearance:B,onAppearanceChange:Z,onSave:()=>{W(B),localStorage.setItem(h,JSON.stringify(B)),D(!1)}})]})}export{m as default};
@@ -0,0 +1,21 @@
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-RSOBUPLK.js";import{useWidgetSettings as r}from"./chunk-3FBDLIQW.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-CDAJKLGL.js";import"./chunk-O3MBPAWZ.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-OTITQ3IH.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[v,C]=s(!1),[U,B]=s([]),[J,O]=s(f),[W,A]=s("USD"),[K,L]=s("CNY");r(o(()=>{B([...u]),O({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
+ return i(a,{children:[
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
+ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
+ /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
+ /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
7
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
8
+ /* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
9
+ /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
10
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
+ /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
+ /* @__PURE__ */m(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:J,onAppearanceChange:O,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__ */i("div",{children:[
13
+ /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",U.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
+ /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
17
+ /* @__PURE__ */m("button",{onClick:()=>B(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),U.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:W,onChange:t=>A(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
+ /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
+ /* @__PURE__ */m("select",{value:K,onChange:t=>L(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{W!==K&&U.length<4&&B(t=>[...t,[W,K]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -1,25 +1,25 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-ET4726WV.js";import{WindowTitle as n}from"./chunk-ZT45XXIB.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-KC3EX26K.js";import"./chunk-P22NWAFW.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import{toast_default as r}from"./chunk-7ELJQL7J.js";import"./chunk-UGTRSRIW.js";import"./chunk-SAGI7AWC.js";import"./chunk-CDAJKLGL.js";import"./chunk-4DO47TT5.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-KLAKLVKE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-N2RIQ2OU.js";import"./chunk-NGRTW6Y7.js";import"./chunk-UQYNPYF4.js";import"./chunk-WJ6ZJVAX.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-GLE4F5FT.js";import"./chunk-22LRMKLV.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-BB6A5MGA.js";import"./chunk-5R4X7MFQ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as h}from"react";import{jsxs as u,jsx as d}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),L=h(null),M=h(null),U=h(null),W=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),N(!0)},R=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=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",N(!0),D(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-IHNOWRTP.js";import{WindowTitle as n}from"./chunk-3FBDLIQW.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-CDAJKLGL.js";import"./chunk-O3MBPAWZ.js";import{toast_default as r}from"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-5DIGYJHD.js";import"./chunk-FZM3ZPW3.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-OTITQ3IH.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as h}from"react";import{jsxs as u,jsx as d}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,k]=m(x),[y,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[D,C]=m(null),L=h(null),M=h(null),W=h(null),U=(e,t)=>{W.current?.focus(),document.execCommand(e,!1,t),N(!0)},R=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{W.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))},B=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>");k({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)}},B=f?.filename?(E=f.filename).length>24?`${E.slice(0,23)}…`:E:"Untitled";var E;/* @__PURE__ */
4
- return u("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/"))?R(t):A(t[0]))},children:[
5
- /* @__PURE__ */d(n,{title:`${B}${w?" •":""} - Documents`}),
3
+ "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});k({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)}},O=f?.filename?(A=f.filename).length>24?`${A.slice(0,23)}…`:A:"Untitled";var A;/* @__PURE__ */
4
+ return u("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/"))?R(t):B(t[0]))},children:[
5
+ /* @__PURE__ */d(n,{title:`${O}${w?" •":""} - Documents`}),
6
6
  /* @__PURE__ */d(t,{app:"documents"}),
7
7
  /* @__PURE__ */u("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__ */d("input",{ref:L,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),L.current&&(L.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */d("input",{ref:L,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&&B(t),L.current&&(L.current.value="")},className:"hidden"}),
9
9
  /* @__PURE__ */u("button",{onClick:()=>L.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__ */d(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
- /* @__PURE__ */d("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__ */d("button",{onClick:()=>{if(!f)return;const t=W.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=W.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__ */d("span",{className:"text-2xs text-ink-faintest ml-1",children:"TXT · DOCX · Code"}),
13
13
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
14
14
  /* @__PURE__ */u("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,w?" •":""]}),
15
15
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
16
16
  /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
17
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("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__ */d("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__ */d("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__ */d("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__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
22
- /* @__PURE__ */u("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{W("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__ */u("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__ */d("option",{value:"",disabled:!0,children:"Size"}),
24
24
  /* @__PURE__ */d("option",{value:"1",children:"XS"}),
25
25
  /* @__PURE__ */d("option",{value:"2",children:"S"}),
@@ -27,21 +27,21 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
27
27
  /* @__PURE__ */d("option",{value:"4",children:"L"}),
28
28
  /* @__PURE__ */d("option",{value:"5",children:"XL"}),
29
29
  /* @__PURE__ */d("option",{value:"6",children:"2XL"})]}),
30
- /* @__PURE__ */d("input",{type:"color",defaultValue:"#000000",onChange:e=>W("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
30
+ /* @__PURE__ */d("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__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
32
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("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__ */d("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__ */d("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__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
35
35
  /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
36
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
36
+ /* @__PURE__ */d("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__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
+ /* @__PURE__ */d("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__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
+ /* @__PURE__ */d("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__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
+ /* @__PURE__ */d("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__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
40
40
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
41
  /* @__PURE__ */d("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&R(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
42
42
  /* @__PURE__ */u("button",{onClick:()=>M.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__ */d(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
- /* @__PURE__ */d("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */d(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */d("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */d("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(),R(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__ */d("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__ */d("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__ */u(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
44
+ /* @__PURE__ */d("div",{className:"flex-1 min-h-0 overflow-hidden",children:y?/* @__PURE__ */d(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */d("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */d("div",{ref:W,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(),R(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__ */d("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__ */d("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__ */u(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(null),children:[
45
45
  /* @__PURE__ */d(i,{children:"Image width"}),
46
46
  /* @__PURE__ */d(l,{onClick:()=>T("25%"),children:"25%"}),
47
47
  /* @__PURE__ */d(l,{onClick:()=>T("50%"),children:"50%"}),
@@ -49,4 +49,4 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
49
49
  /* @__PURE__ */d(l,{onClick:()=>T("100%"),children:"100%"}),
50
50
  /* @__PURE__ */d(l,{onClick:()=>T(null),children:"Original size"}),
51
51
  /* @__PURE__ */d(a,{}),
52
- /* @__PURE__ */d(l,{danger:!0,onClick:()=>{C?.el.remove(),N(!0),D(null)},children:"Remove image"})]})]})}export{f as default};
52
+ /* @__PURE__ */d(l,{danger:!0,onClick:()=>{D?.el.remove(),N(!0),C(null)},children:"Remove image"})]})]})}export{f as default};