efficient-shell 12.23.0 → 12.25.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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-G3NJJDFN.js → Browser-XIJNQPN5.js} +16 -16
  3. package/dist/Calculator-LSDVIJVQ.js +29 -0
  4. package/dist/CurrencyConverter-G5IYUCN7.js +21 -0
  5. package/dist/Files-3USUXZM2.js +141 -0
  6. package/dist/Notepad-MXANPUG3.js +24 -0
  7. package/dist/PomodoroTimer-SFTPXEDV.js +91 -0
  8. package/dist/{Preview-DRNDT6WX.js → Preview-UVQVZYR7.js} +18 -18
  9. package/dist/{Stock-JY3PJI2M.js → Stock-YCPMLYPR.js} +3 -3
  10. package/dist/{Weather-POQXLYFA.js → Weather-TLFNIPDG.js} +13 -13
  11. package/dist/{WorldClock-FUJOPJ5G.js → WorldClock-66IRFS2W.js} +6 -6
  12. package/dist/ai/index.d.ts +15 -4
  13. package/dist/ai/index.js +115 -111
  14. package/dist/ai.css +1 -1
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-F4XGUOVL.js → chunk-4BKJ6A5H.js} +4 -4
  20. package/dist/{chunk-RKXCB5ZJ.js → chunk-7MJYT6IW.js} +1 -1
  21. package/dist/chunk-7NYCPO54.js +1 -0
  22. package/dist/{chunk-QJWQ6OMF.js → chunk-AQCUGTOR.js} +6 -6
  23. package/dist/{chunk-T2OSPUS6.js → chunk-BZHP645G.js} +3 -3
  24. package/dist/{chunk-OGWQABFP.js → chunk-CALBDO7B.js} +1 -1
  25. package/dist/chunk-EC3P3W7Z.js +28 -0
  26. package/dist/chunk-EIFNESXS.js +1 -0
  27. package/dist/{chunk-2NZ7CVMW.js → chunk-GBTL3G36.js} +14 -14
  28. package/dist/{chunk-ZLKEPDJE.js → chunk-H6WXTJOT.js} +1 -1
  29. package/dist/{chunk-ZNLCITYY.js → chunk-JVOH7776.js} +2 -2
  30. package/dist/chunk-KZRZYLN7.js +99 -0
  31. package/dist/chunk-LDVDNAXP.js +4 -0
  32. package/dist/{chunk-MFSDS6CN.js → chunk-NPTF6MP4.js} +1 -1
  33. package/dist/{chunk-WLX24TG6.js → chunk-TUPPFC74.js} +4 -4
  34. package/dist/{chunk-HOEHV2J5.js → chunk-WVMCKM5Z.js} +1 -1
  35. package/dist/format/index.js +1 -1
  36. package/dist/forms/BrandAssetEditor.js +1 -1
  37. package/dist/forms/LinkPicker.js +1 -1
  38. package/dist/forms/MediaLibrary.d.ts +4 -3
  39. package/dist/forms/MediaLibrary.js +1 -1
  40. package/dist/forms/MediaUploadField.js +1 -1
  41. package/dist/icons/index.js +1 -1
  42. package/dist/index.js +98 -98
  43. package/dist/shell/Avatar.d.ts +3 -1
  44. package/dist/shell/Avatar.js +1 -1
  45. package/dist/shell/Dialog.d.ts +5 -0
  46. package/dist/shell/LanguageSelect.js +1 -1
  47. package/dist/shell/SettingRow.js +1 -1
  48. package/dist/telemetry/index.js +1 -1
  49. package/dist/templates/ChatTemplate.js +1 -1
  50. package/dist/templates/DashboardTemplate.js +1 -1
  51. package/dist/templates/EmailTemplate.js +1 -1
  52. package/dist/ui/index.js +1 -1
  53. package/dist/version.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/Calculator-OUPD7SZV.js +0 -29
  56. package/dist/CurrencyConverter-CNGYEKE3.js +0 -21
  57. package/dist/Files-A5MD7QNE.js +0 -141
  58. package/dist/Notepad-CUWBPETD.js +0 -24
  59. package/dist/PomodoroTimer-I53C5QYM.js +0 -91
  60. package/dist/chunk-EEGTFJUQ.js +0 -28
  61. package/dist/chunk-MDVABA4H.js +0 -1
  62. package/dist/chunk-WESNFWM4.js +0 -4
  63. package/dist/chunk-XQNZJNEJ.js +0 -99
package/README.md CHANGED
@@ -1685,7 +1685,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1685
1685
  | `ImageLightbox`, `ZoomableImage`, `LIGHTBOX_PICTURE_FIT` | The full-screen viewer for a GALLERY (harness PAT-7; a single stored document opens in the Preview window instead, UI-18). `images` (`{ url, caption?, kind? }`), `startIndex`, `onClose`, `onIndexChange`, `onOpenFile`. A picture zooms with the wheel, a pinch and a double-click and pans with a drag (`ZoomableImage`); a video gets the player; any other file a card whose "Open file" links to it, or calls `onOpenFile` (a host that can show it in the Preview window). A `1 / 5` counter and Close top right, Previous / Next that wrap, caption and "Open original" below; ArrowLeft / ArrowRight step, and Escape closes through the shell's Escape seam, so the window behind stays open. A modal dialog with a focus trap and a scroll lock, portalled to `<body>` on the overlay layer; a click on the backdrop closes, a click on the picture does not. `LIGHTBOX_PICTURE_FIT` is the class string that fits the picture between the edge controls (the bars and the side arrows); a host that draws its own viewer round `ZoomableImage` uses it with `object-contain` instead of keeping a copy. Words: the `lightbox` section. |
1686
1686
  | `MediaUsedInList` | "Used in 7 places": a row per place that still uses a file — the host's kind word as a badge ("Page", "Email") and the place's name. A row with `onOpen` is a link-look button; a row without one is plain text, never a button that goes nowhere. It fetches nothing; the host hands over the rows. `heading` and `emptyText` replace the catalog's `media.usedIn` / `media.notUsed`. |
1687
1687
  | `mediaMoveItems`, `useMediaMoveItems` | The "Move to" list as `DropdownMenu` entries, so a bulk bar's "Move to" button and any menu that takes the same entries draw one definition. `{ count, kind, targets, onPick }`: it leads with "Move 3 images to" (`media.moveTo`), runs of targets that share a `group` get a label and a line, `depth` indents a nested folder, and a target with `disabledReason` stays in the list, off, with the reason under it. No targets says `media.moveNowhere`. The hook reads the words from the catalog; the plain function takes them as its second argument. `mediaMoveSubmenu(options)` is the same list as ONE "Move to ▸" row (a `type: 'submenu'` entry) for a menu that holds other things; `head: false` drops the "Move 3 images to" line (a folder moving). |
1688
- | `MediaLibrary`, `mediaLibraryMenu` | THE media library (harness UI-21): the Media Library window (`mode="manage"`) and the website editor's and email designer's image picker (`mode="pick"`) are this one part. Presentational: it never fetches; the host is the port (`MediaLibraryProps`). It hands over `location` (`{ place: 'files', folderId }`, `{ place: 'products', nodeId }`, `{ place: 'trash' }`) with `onLocationChange`, `folders` (`{ id, name, parentId, count, notEmpty }`, any depth), `products` (brand > design > finish, `sharedFrom` on a shared brand), `files` (what the open place holds, filtered by the host: `name`, `url`, `thumbUrl`, `usedCount`, `email`, `private`, `trashedDaysAgo`, and the detail rows), `usedIn` rows for the one chosen file, the counts, and the callbacks: `onUpload(files, folderId)`, `onNewFolder(parentId)` (return the new id and its name field opens, selected), `onRename`, `onMove`, `onTrash` (files), `onDeleteFolder(folderId)`, `onRestore`, `onDeleteForever`, `onEmptyTrash`, `onReplace`, `onCropEdit`, `onOpenInDesign`, `onChoose`, `onCancel`. A callback left out takes its action away (Replace before it exists); `denied: { action: reason }` keeps an action, off, with the reason. The tree: Products (read-only, lock, "Read-only" badge; hover, the details panel and the empty state say "Read-only. Edit these pictures in Products > Design > Media.", plus "Edited at HQ (<tenant>)." under a shared brand), All files, Trash (not in the picker). The toolbar: `Breadcrumbs`, search (`query`), Media type / Use / Sort (`filters` + `onFiltersChange`), the host's own `extraFilters`, Grid / List (`view` + `onViewChange`), New folder and Upload (off in Products with their reasons). The grid is `MediaUploadGrid` with `useGridSelection` and `useMarquee` (Ctrl/Cmd+A, Escape), marks "Used N", "Email", "Private", "N days ago"; a double click opens `ImageLightbox` (in the picker it chooses). ONE menu definition, `mediaLibraryMenu(target, context)`, feeds both a folder's ⋯ `DropdownMenu` and every right-click `ContextMenu` (a folder, 1 or N files, a file in Trash, a Products folder, a render), "Move to ▸" a submenu in both. A folder has no Trash: its danger row is "Delete folder" (the backend deletes only an empty folder), off with "Only an empty folder can be deleted." while the host sets `notEmpty`; pressing it calls `onDeleteFolder`, and the host asks through the shell destructive confirm (the part does not). With N files chosen, Rename, Replace and Copy URL are off. Drag: files onto a folder move there, a folder onto a folder nests, files from the computer upload into the open folder; Products takes nothing, and its `Tooltip` says why (`MEDIA_FILES_DRAG_TYPE`, `MEDIA_FOLDER_DRAG_TYPE`). The details panel: picture, `DescriptionList`, Copy URL, Replace / Crop & edit / Move to / Rename / Trash (Restore / Delete forever in Trash; a render: read-only `Banner` and Open in Design), `MediaUsedInList`. Two or more chosen: a bulk bar. The picker: a footer "1 selected · <name>", Cancel / Choose image; a `private` file (or one with `pickDisabledReason`) cannot be chosen. With `onDragOut` (opt-in, harness UI-20 media popup) a choosable file can be dragged OUT onto an editor's canvas, from the picker and while managing (not from Trash; in All files the same tile drag still moves to a folder, carrying both payloads through `MediaUploadGrid`'s `dragAlso`): it carries `{ id, url, kind, name }` under `MEDIA_FILE_DRAG_TYPE` (read it with `readMediaFileDrag(e.dataTransfer)`, which answers null for anything else), with `effectAllowed: 'link'`, and `onDragOut` hears `start`, then `dropped` or `cancelled`. Under 640 px of its own width (or `layout="phone"`): the tree over the toolbar, three tiles a row, and the details in a bottom sheet (`Drawer side="bottom"`). Words: the `mediaLibrary` section. |
1688
+ | `MediaLibrary`, `mediaLibraryMenu` | THE media library (harness UI-21): the Media Library window (`mode="manage"`) and the website editor's and email designer's image picker (`mode="pick"`) are this one part. Presentational: it never fetches; the host is the port (`MediaLibraryProps`). It hands over `location` (`{ place: 'files', folderId }`, `{ place: 'products', nodeId }`, `{ place: 'trash' }`) with `onLocationChange`, `folders` (`{ id, name, parentId, count, notEmpty }`, any depth), `products` (brand > design > finish, `sharedFrom` on a shared brand), `files` (what the open place holds, filtered by the host: `name`, `url`, `thumbUrl`, `usedCount`, `email`, `private`, `trashedDaysAgo`, and the detail rows), `usedIn` rows for the one chosen file, the counts, and the callbacks: `onUpload(files, folderId)`, `onNewFolder(parentId)` (return the new id and its name field opens, selected), `onRename`, `onMove`, `onTrash` (files), `onDeleteFolder(folderId)`, `onRestore`, `onDeleteForever`, `onEmptyTrash`, `onReplace`, `onCropEdit`, `onOpenInDesign`, `onChoose`, `onCancel`. A callback left out takes its action away (Replace before it exists); `denied: { action: reason }` keeps an action, off, with the reason. The tree: Products (read-only, lock, "Read-only" badge; hover, the details panel and the empty state say "Read-only. Edit these pictures in Products > Design > Media.", plus "Edited at HQ (<tenant>)." under a shared brand), All files, Trash (not in the picker). The toolbar: `Breadcrumbs`, search (`query`), Media type / Use / Sort (`filters` + `onFiltersChange`), the host's own `extraFilters`, Grid / List (`view` + `onViewChange`), New folder and Upload (off in Products with their reasons). The grid is `MediaUploadGrid` with `useGridSelection` and `useMarquee` (Ctrl/Cmd+A, Escape), marks "Used N", "Email", "Private", "N days ago"; a double click opens `ImageLightbox` (in the picker it chooses). ONE menu definition, `mediaLibraryMenu(target, context)`, feeds both a folder's ⋯ `DropdownMenu` and every right-click `ContextMenu` (a folder, 1 or N files, a file in Trash, a Products folder, a render), "Move to ▸" a submenu in both. A folder has no Trash: its danger row is "Delete folder" (the backend deletes only an empty folder), off with "Only an empty folder can be deleted." while the host sets `notEmpty`; pressing it calls `onDeleteFolder`, and the host asks through the shell destructive confirm (the part does not). With N files chosen, Rename, Replace and Copy URL are off. Drag: files onto a folder move there, a folder onto a folder nests, files from the computer upload into the open folder; Products takes nothing, and its `Tooltip` says why (`MEDIA_FILES_DRAG_TYPE`, `MEDIA_FOLDER_DRAG_TYPE`). The details panel: picture, `DescriptionList`, Copy URL, Replace / Crop & edit / Move to / Rename / Trash (Restore / Delete forever in Trash; a render: read-only `Banner` and Open in Design), `MediaUsedInList`. Two or more chosen: a bulk bar. The picker: a footer "1 selected · <name>", Cancel / Choose image; a `private` file (or one with `pickDisabledReason`) cannot be chosen. With `onDragOut` (opt-in, harness UI-20 media popup) a choosable file can be dragged OUT onto an editor's canvas, from the picker and while managing (not from Trash; in All files the same tile drag still moves to a folder, carrying both payloads through `MediaUploadGrid`'s `dragAlso`): it carries `{ id, url, kind, name }` under `MEDIA_FILE_DRAG_TYPE` (read it with `readMediaFileDrag(e.dataTransfer)`, which answers null for anything else), with `effectAllowed: 'link'`, and `onDragOut` hears `start`, then `dropped` or `cancelled`. In a shell window the window steps aside for the drag by itself (invisible, click-through, still mounted, so the canvas under it takes the drop) and comes back when the drag ends; the host adds no style. Under 640 px of its own width (or `layout="phone"`): the tree over the toolbar, three tiles a row, and the details in a bottom sheet (`Drawer side="bottom"`). Words: the `mediaLibrary` section. |
1689
1689
  | `StartMenu` / `Desktop` / `WindowManagerProvider` | Used internally by `Layout`; rarely instantiated directly. |
1690
1690
  | `Modal`, `ModalActions`, `CopyButton`, `CancelButton` | Window primitive supporting standard / compact / widget styles. Every window frame is a non-modal `role="dialog"` (no `aria-modal`: a window stands beside other windows, with no scrim and no focus trap), named by the title it draws through `aria-labelledby`; a widget, a phone frame and the Home tab draw no title, so their title text is the `aria-label`. A test finds an open window with `getByRole('dialog', { name: 'Its title' })`, and a modal popup over it with `[role="dialog"][aria-modal="true"]`. |
1691
1691
  | `splitTitle(title)` | Splits a window or page title for the Sidebar layout's tab: `{ text, copy, accessories, badges, actions }` — the title's words for the tab (a badge's own text is not among them), the `CopyButton`'s text (a routed page tab's copy icon; window tabs draw none), and every badge and control (any component, `button`, `a`, `select`, …) in title order, split into `badges` (`StatusBadge`, `ColoredBadge`, or a component with `titleRole = 'badge'`) for the record bar and `actions` (everything else) for the active window tab. Inline SVG is dropped. A badge drawn as a styled `<span>` counts as words, so draw badges with `StatusBadge` / `ColoredBadge`. |
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-6RK6R3RY.js";import"./chunk-SFULX4E3.js";import"./chunk-FTMCNC66.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-ZNLCITYY.js";import{WindowTitle as n}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import{confirm as s}from"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-MDVABA4H.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,S]=c([w]),[D,z]=c(0),[M,J]=c(0),[L,E]=c(x),[H,T]=c(!1),[U,A]=c(null),X=i(null),F=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(L))}catch{}},[L]);const G=e=>{const t=f(e);t&&(v(t),W(t),S(e=>{const o=e.slice(0,D+1);return o.push(t),o}),z(e=>e+1),T(!1))},Y=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},I=()=>{const e=U?.trim();e?(E(t=>[...t,{label:e,url:w}]),A(null)):A(null)};l(()=>{if(null===U)return;X.current?.focus(),X.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||A(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const K=e=>{E(t=>t.filter((t,o)=>o!==e))},O=D>0,Z=D<R.length-1,B=L.some(e=>e.url===w),Q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-6RK6R3RY.js";import"./chunk-SFULX4E3.js";import"./chunk-FTMCNC66.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-JVOH7776.js";import{WindowTitle as n}from"./chunk-KZRZYLN7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import{confirm as s}from"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-EIFNESXS.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-7NYCPO54.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,R]=l(w),[W,S]=l([w]),[z,D]=l(0),[M,E]=l(0),[L,H]=l(x),[J,T]=l(!1),[U,F]=l(null),O=i(null),X=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(L))}catch{}},[L]);const A=e=>{const t=f(e);t&&(v(t),R(t),S(e=>{const o=e.slice(0,z+1);return o.push(t),o}),D(e=>e+1),T(!1))},G=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},K=()=>{const e=U?.trim();e?(H(t=>[...t,{label:e,url:w}]),F(null)):F(null)};c(()=>{if(null===U)return;O.current?.focus(),O.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||F(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const Y=e=>{H(t=>t.filter((t,o)=>o!==e))},I=z>0,Z=z<W.length-1,B=L.some(e=>e.url===w),P="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(D>0){const e=D-1;z(e),v(R[e]),W(R[e]),T(!1)}},disabled:!O,className:Q,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(D<R.length-1){const e=D+1;z(e),v(R[e]),W(R[e]),T(!1)}},disabled:!Z,className:Q,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>J(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>G(b),className:Q,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),G(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(z>0){const e=z-1;D(e),v(W[e]),R(W[e]),T(!1)}},disabled:!I,className:P,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(z<W.length-1){const e=z+1;D(e),v(W[e]),R(W[e]),T(!1)}},disabled:!Z,className:P,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>E(e=>e+1),className:P,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>A(b),className:P,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),A(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
- /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
- /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?K(L.findIndex(e=>e.url===w)):void A(N(w)),className:Q+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:Y,className:Q,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>T(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
12
+ /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
+ /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>R(w)}})})]})}),
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?Y(L.findIndex(e=>e.url===w)):void F(N(w)),className:P+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:G,className:P,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>T(e=>!e),className:P,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:X,type:"text",value:U,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&A(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:O,type:"text",value:U,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key?K():"Escape"===e.key&&F(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>A(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:I,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===L.length&&/* @__PURE__ */u("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__ */m("button",{onClick:()=>G(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&K(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>F(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:K,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===L.length&&/* @__PURE__ */u("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__ */m("button",{onClick:()=>A(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&Y(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:M,iframeRef:F,openExternal:Y,showHelp:H,dismissHelp:()=>T(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:M,iframeRef:X,openExternal:G,showHelp:J,dismissHelp:()=>T(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=l(!1);c(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-H6WXTJOT.js";import{useWidgetSettings as n}from"./chunk-KZRZYLN7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-EIFNESXS.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as r}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[E,T]=c(()=>e(h)),[J,S]=c(!1),[W,D]=c(E),M=i(null);n(o(()=>{D({...E}),S(!0)},[E]));const F=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),X=o(()=>{k("0"),d(null),g(null),N(!1)},[]),A=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),w=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=A(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,A]),H=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=A(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,A]),U=o(()=>{k(e=>String(parseFloat(e)/100))},[]),Z=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"?F(e.key):"."===e.key?F("."):"+"===e.key?w("+"):"-"===e.key?w("-"):"*"===e.key?w("×"):"/"===e.key?(e.preventDefault(),w("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&M.current?.contains(e.target)&&e.preventDefault(),H()):"Escape"===e.key?X():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&U())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[F,w,H,X,U]);const G="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",K=`${G} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,L=`${G} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,O=`${G} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,R=`${G} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:M,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:C.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:X,className:O,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:Z,className:O,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:U,className:O,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>w("÷"),className:`${L} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>F("7"),className:K,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>F("8"),className:K,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>F("9"),className:K,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>w("×"),className:`${L} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>F("4"),className:K,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>F("5"),className:K,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>F("6"),className:K,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>w("-"),className:`${L} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>F("1"),className:K,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>F("2"),className:K,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>F("3"),className:K,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>w("+"),className:`${L} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>F("0"),className:`${K} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>F("."),className:K,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:H,className:R,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:J,onClose:()=>S(!1),title:"Calculator Settings",appearance:W,onAppearanceChange:D,onSave:()=>{T(W),localStorage.setItem(h,JSON.stringify(W)),S(!1)}})]})}export{m as default};
@@ -0,0 +1,21 @@
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-H6WXTJOT.js";import{useWidgetSettings as r}from"./chunk-KZRZYLN7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-EIFNESXS.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[M,A]=s(f),[H,R]=s("USD"),[B,G]=s("CNY");r(o(()=>{U([...u]),A({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
+ return i(a,{children:[
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
+ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
+ /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
+ /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
7
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
8
+ /* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
9
+ /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
10
+ /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
+ /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:M,onAppearanceChange:A,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(M),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(M)),v(!1)},children:/* @__PURE__ */i("div",{children:[
13
+ /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
+ /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
17
+ /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:H,onChange:t=>R(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
+ /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
+ /* @__PURE__ */m("select",{value:B,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:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{H!==B&&J.length<4&&U(t=>[...t,[H,B]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -0,0 +1,141 @@
1
+ import{openPreviewFile as e}from"./chunk-34TQBJ7I.js";import{SidebarLayout as t}from"./chunk-JGRDG7CB.js";import"./chunk-QWK6DRSN.js";import"./chunk-OOWPLQD5.js";import{SearchableSelect as n}from"./chunk-ZQ24H5UO.js";import{Breadcrumbs as a}from"./chunk-QMSINDXL.js";import{Select_default as r}from"./chunk-TM4CRQ3W.js";import"./chunk-EO5RLFRX.js";import"./chunk-GLRRX4AL.js";import"./chunk-2NMW66P5.js";import{useContextMenu as i,ContextMenu as s}from"./chunk-6FZ5JTBY.js";import{Input_default as l}from"./chunk-6RK6R3RY.js";import{DropdownMenu as o}from"./chunk-SFULX4E3.js";import"./chunk-FTMCNC66.js";import{IconButton_default as c}from"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{formatBytes as d}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as m,subscribeFilesChoice as h,getFilesChoice as u,holdFilesChoice as f,answerFilesChoice as p,choiceTakes as g}from"./chunk-7LTU5TJD.js";import{AboutApp as k}from"./chunk-JVOH7776.js";import{getFilesStore as w,peekFilesViewRequest as y,consumeFilesViewRequest as v,FILES_SHOW_TRASH_EVENT as b,FILES_OPEN_DESKTOP_FOLDER_EVENT as x,subscribeDesktopFolders as N,getDesktopFoldersSnapshot as C,hasHostFilesStore as S,FolderGlyph as j,DesktopItemMiniIcon as D,desktopItemTypeLabel as M,FilesQuotaError as T,FILES_OFFICE_EXTENSIONS as $}from"./chunk-QG37GJP2.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as L,WindowTitle as R}from"./chunk-KZRZYLN7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import{confirm as A,prompt as F}from"./chunk-HMT3MES3.js";import{Dialog as E}from"./chunk-D2WJAF62.js";import"./chunk-EIFNESXS.js";import{ItemCount as W}from"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-7NYCPO54.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as O}from"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as z}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as P}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as K}from"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as I}from"./chunk-3YBXA72C.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as U,useRef as J,useEffect as Y,useCallback as G,useSyncExternalStore as B,useMemo as X}from"react";import{jsxs as H,jsx as Q,Fragment as V}from"react/jsx-runtime";var Z={doc:"document",docx:"document",odt:"document",rtf:"document",txt:"document",md:"document",xls:"spreadsheet",xlsx:"spreadsheet",ods:"spreadsheet",csv:"spreadsheet",sheet:"spreadsheet",ppt:"slides",pptx:"slides",odp:"slides",key:"slides",slides:"slides",pdf:"pdf",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",heic:"image",tif:"image",tiff:"image",mp4:"video",mov:"video",webm:"video",avi:"video",mkv:"video",mp3:"audio",wav:"audio",m4a:"audio",ogg:"audio",flac:"audio",zip:"archive",rar:"archive","7z":"archive",gz:"archive",tar:"archive",dxf:"drawing",dwg:"drawing",stp:"drawing",step:"drawing",stl:"drawing",obj:"drawing",iges:"drawing",igs:"drawing","3mf":"drawing",glb:"drawing",gltf:"drawing"};function q(e){const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toLowerCase():""}function _(e){if("folder"===e.kind)return"folder";if("document"===e.officeKind)return"document";if("spreadsheet"===e.officeKind)return"spreadsheet";if("deck"===e.officeKind)return"slides";const t=e.contentType??"";return"application/pdf"===t?"pdf":t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":Z[q(e.name)]??"other"}var ee={folder:"Folder",document:"Document",spreadsheet:"Spreadsheet",slides:"Slides",pdf:"PDF",image:"Image",video:"Video",audio:"Audio",archive:"Archive",drawing:"Drawing",other:"File"},te={folder:{name:"folder",tone:"muted"},document:{name:"document",tone:"accent"},spreadsheet:{name:"table",tone:"success"},slides:{name:"presentation-chart-bar",tone:"warning"},pdf:{name:"document",tone:"danger"},image:{name:"image",tone:"muted"},video:{name:"play",tone:"muted"},audio:{name:"speaker-wave",tone:"muted"},archive:{name:"archive-box",tone:"muted"},drawing:{name:"cube-transparent",tone:"muted"},other:{name:"page",tone:"muted"}};function ne(e){const t=e.officeKind?$[e.officeKind]:"";return t&&e.name.toLowerCase().endsWith(t)&&e.name.length>t.length?e.name.slice(0,-t.length):e.name}function ae(e){return"folder"===e.kind||e.officeKind&&e.size<=2?"—":d(e.size)}function re(e,t=/* @__PURE__ */new Date){if(!e)return"—";const n=new Date(e);return isNaN(n.getTime())?"—":n.toDateString()===t.toDateString()?n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):n.getFullYear()===t.getFullYear()?n.toLocaleDateString(void 0,{day:"numeric",month:"short"}):n.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function ie(e){return"owner"===(e.role??"owner")?"me":e.owner?.name??"—"}var se=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function le(e,t){const n="asc"===t.dir?1:-1;return[...e].sort((e,a)=>e.kind!==a.kind?"folder"===e.kind?-1:1:n*((e,n)=>{switch(t.key){case"owner":return se.compare(ie(e),ie(n));case"size":return e.size-n.size;case"modified":return(Date.parse(e.modifiedAt)||0)-(Date.parse(n.modifiedAt)||0);default:return se.compare(ne(e),ne(n))}})(e,a)||se.compare(e.name,a.name))}var oe=["folder","document","spreadsheet","slides","pdf","image","video"],ce={today:"Today",week:"Last 7 days",month:"Last 30 days",year:"This year"};function de(e,t,n=/* @__PURE__ */new Date){const a=t.modified?function(e,t){const n=new Date(t);return n.setHours(0,0,0,0),"week"===e&&n.setDate(n.getDate()-6),"month"===e&&n.setDate(n.getDate()-29),"year"===e&&n.setMonth(0,1),n.getTime()}(t.modified,n):null;return e.filter(e=>{if(t.type&&_(e)!==t.type)return!1;if(t.person){const n="owner"===(e.role??"owner");if("me"===t.person?!n:n||e.owner?.id!==t.person)return!1}return null===a||(Date.parse(e.modifiedAt)||0)>=a})}var me=[{value:"viewer",label:"Viewer"},{value:"editor",label:"Editor"}];function he({store:e,entry:t,onClose:a,onChanged:i}){const[s,l]=U(null),[o,d]=U(""),[m,h]=U([]),[u,f]=U(!1),[p,g]=U(""),[k,w]=U("viewer"),[y,v]=U(!1),b=J(/* @__PURE__ */new Map),x=t?.id??null;if(Y(()=>{if(l(null),g(""),d(""),!x||!e.shares)return;let t=!0;return e.shares(x).then(e=>{t&&l(e)}).catch(e=>{t&&(I.error(e.message),l([]))}),()=>{t=!1}},[x,e]),Y(()=>{if(!e.searchPeople||!x)return;let t=!0;f(!0);const n=setTimeout(()=>{e.searchPeople(o).then(e=>{if(t){for(const t of e)b.current.set(t.id,t);h(e)}}).catch(()=>{t&&h([])}).finally(()=>{t&&f(!1)})},250);return()=>{t=!1,clearTimeout(n)}},[o,x,e]),!t)return null;const N=new Set((s??[]).map(e=>e.person.id)),C=m.filter(e=>!N.has(e.id)).map(e=>({value:e.id,label:e.name})),S=async n=>{v(!0);try{await n(),l(await e.shares(t.id)),i()}catch(e){I.error(e.message)}finally{v(!1)}};/* @__PURE__ */
2
+ return H(E,{open:!0,onClose:a,size:"md",title:`Share “${t.name}”`,description:"folder"===t.kind?"Everything inside this folder is shared too. Editors’ uploads count toward your quota.":"Viewers can open and download it. Editors can also replace, rename and delete it.",footer:/* @__PURE__ */Q(O,{variant:"secondary",onClick:a,children:"Done"}),children:[
3
+ /* @__PURE__ */H("div",{className:"flex items-center gap-2",children:[
4
+ /* @__PURE__ */Q("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */Q(n,{value:p,onChange:g,onSearchChange:d,loading:u&&0===m.length,options:C,placeholder:"Search colleagues by name","aria-label":"Colleague to share with"})}),
5
+ /* @__PURE__ */Q("div",{className:"w-28 shrink-0",children:/* @__PURE__ */Q(r,{value:k,onChange:e=>w(e),options:me,"aria-label":"Access"})}),
6
+ /* @__PURE__ */Q(O,{variant:"primary",onClick:()=>{if(!p||!e.share)return;const n=b.current.get(p);S(async()=>{await e.share(t.id,p,k),g(""),d(""),n&&I.success(`Shared with ${n.name}`)})},disabled:!p||y,children:"Add"})]}),
7
+ /* @__PURE__ */Q("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */Q(P,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */H("ul",{className:"divide-y divide-line-subtle text-sm",children:[
8
+ /* @__PURE__ */H("li",{className:"flex items-center gap-2 h-10",children:[
9
+ /* @__PURE__ */Q("span",{className:"flex-1 truncate",children:"You"}),
10
+ /* @__PURE__ */Q("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */H("li",{className:"flex items-center gap-2 h-10",children:[
11
+ /* @__PURE__ */Q("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
12
+ /* @__PURE__ */Q("div",{className:"w-28 shrink-0",children:/* @__PURE__ */Q(r,{value:n.role,onChange:a=>S(()=>e.share(t.id,n.person.id,a)),options:me,"aria-label":`Access for ${n.person.name}`,disabled:y})}),
13
+ /* @__PURE__ */Q(c,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:y,onClick:()=>S(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4",strokeWidth:1.8})})]},n.person.id))]})]})}function ue({store:e,items:t,from:n,onClose:a,onMove:r}){const[i,s]=U(n??null),[l,o]=U(null),[d,m]=U(!1);Y(()=>{t&&s(n??null)},[t,n]),Y(()=>{if(!t)return;let n=!0;return m(!0),e.list(i).then(e=>{n&&o(e)}).catch(()=>{n&&o(null)}).finally(()=>{n&&m(!1)}),()=>{n=!1}},[e,i,t]);const h=new Set((t??[]).map(e=>e.id)),u=(l?.entries??[]).filter(e=>"folder"===e.kind&&!h.has(e.id)),f=(l?.folder.path??[]).filter(e=>null!==e.id),p=f.length>1?f[f.length-2].id:null,g=l?.folder,k="viewer"!==(g?.role??"owner"),w=void 0!==n&&i===n,y=t?.length??0,v=1===y?`"${t[0].name}"`:`${y} items`;/* @__PURE__ */
14
+ return H(E,{open:!!t,onClose:a,title:`Move ${v}`,size:"sm",footer:/* @__PURE__ */H(V,{children:[
15
+ /* @__PURE__ */Q(O,{variant:"secondary",onClick:a,children:"Cancel"}),
16
+ /* @__PURE__ */Q(O,{variant:"primary",onClick:()=>r(i),disabled:d||!k||w,children:"Move here"})]}),children:[
17
+ /* @__PURE__ */H("div",{className:"flex items-center gap-1 mb-2 min-h-8",children:[null!==i&&/* @__PURE__ */Q(c,{"aria-label":"Back",size:"sm",onClick:()=>s(p),children:/* @__PURE__ */Q(z,{name:"arrow-left",className:"h-4 w-4"})}),
18
+ /* @__PURE__ */Q("span",{className:"text-sm font-medium text-ink-strong truncate",children:null===i?"My files":g?.name??""})]}),
19
+ /* @__PURE__ */Q("div",{className:"border border-line rounded-(--radius-control) h-64 overflow-auto",children:d?/* @__PURE__ */Q(P,{size:"sm",padding:"p-6",label:"Loading"}):0===u.length?/* @__PURE__ */Q("div",{className:"p-6 text-center text-sm text-ink-faintest",children:"No folders here."}):/* @__PURE__ */Q("ul",{children:u.map(e=>/* @__PURE__ */Q("li",{children:/* @__PURE__ */H("button",{type:"button",onClick:()=>s(e.id),className:"flex w-full items-center gap-2 px-3 h-9 text-left text-sm hover:bg-row-hover",children:[
20
+ /* @__PURE__ */Q(z,{name:"folder",look:"solid",tone:"muted",className:"h-4 w-4 shrink-0"}),
21
+ /* @__PURE__ */Q("span",{className:"truncate flex-1",children:e.name}),
22
+ /* @__PURE__ */Q(z,{name:"chevron-right",tone:"muted",className:"h-4 w-4 shrink-0"})]})},e.id))})}),!k&&/* @__PURE__ */Q("p",{className:"mt-2 text-xs text-ink-faint",children:"You can view this folder but not move things into it."})]})}function fe({store:e,entry:t,selectedCount:n,onClose:a}){const[r,i]=U(null),[s,l]=U(null);Y(()=>{if(i(null),l(null),!t)return;let n=!0;return e.info?.(t.id).then(e=>{n&&i(e)}).catch(()=>{}),e.shares?.(t.id).then(e=>{n&&l(e)}).catch(()=>{}),()=>{n=!1}},[e,t]);const o=t?_(t):null,d=o?te[o]:null,m=r?.path.slice(0,-1).map(e=>e.name||"My files").join(" / "),h=(e,t)=>t?/* @__PURE__ */H("div",{className:"py-2",children:[
23
+ /* @__PURE__ */Q("dt",{className:"text-2xs text-ink-faint",children:e}),
24
+ /* @__PURE__ */Q("dd",{className:"text-sm text-ink break-words",children:t})]}):null;/* @__PURE__ */
25
+ return H("aside",{className:"w-72 shrink-0 border-l border-line flex flex-col min-h-0 bg-surface","aria-label":"Details",children:[
26
+ /* @__PURE__ */H("div",{className:"flex items-center gap-2 px-3 h-12 shrink-0",children:[d&&/* @__PURE__ */Q(z,{name:d.name,tone:d.tone,className:"h-5 w-5 shrink-0"}),
27
+ /* @__PURE__ */Q("span",{className:"flex-1 truncate text-sm font-medium text-ink-strong",children:t?ne(t):n>1?`${n} items selected`:"Details"}),
28
+ /* @__PURE__ */Q(c,{"aria-label":"Close details",size:"sm",onClick:a,children:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4"})})]}),
29
+ /* @__PURE__ */Q("div",{className:"flex-1 overflow-auto px-4 pb-4",children:t?/* @__PURE__ */H(V,{children:[
30
+ /* @__PURE__ */Q("div",{className:"h-32 rounded-(--radius-control) bg-surface-sunken flex items-center justify-center mb-3",children:d&&/* @__PURE__ */Q(z,{name:d.name,tone:d.tone,className:"h-12 w-12"})}),s&&/* @__PURE__ */H("div",{className:"mb-3",children:[
31
+ /* @__PURE__ */Q("div",{className:"text-xs font-medium text-ink-strong mb-1",children:"Who has access"}),0===s.length?/* @__PURE__ */H("p",{className:"text-sm text-ink-faint",children:["Only ","owner"!==t.role&&t.role?t.owner?.name??"its owner":"you"]}):/* @__PURE__ */Q("ul",{className:"text-sm text-ink",children:s.map(e=>/* @__PURE__ */H("li",{className:"flex justify-between py-0.5",children:[
32
+ /* @__PURE__ */Q("span",{className:"truncate",children:e.person.name}),
33
+ /* @__PURE__ */Q("span",{className:"text-ink-faint text-xs",children:"editor"===e.role?"Editor":"Viewer"})]},e.person.id))})]}),
34
+ /* @__PURE__ */H("dl",{className:"border-t border-line pt-2",children:[h("Type",o?ee[o]:null),"file"===t.kind&&h("Size",ae(t)),h("Location",m),h("Owner","me"===ie(t)?"me":ie(t)),h("Modified",t.modifiedAt?`${re(t.modifiedAt)}${t.modifiedBy?` by ${t.modifiedBy.name}`:""}`:null),h("Created",r?.createdAt?re(r.createdAt):null)]})]}):/* @__PURE__ */Q("p",{className:"pt-6 text-center text-sm text-ink-faintest",children:n>1?"Select one item to see its details.":"Select a file or folder to see its details."})})]})}var pe=e=>"recent"===e||"starred"===e||"shared"===e||"search"===e,ge="files.layout",ke={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"},we=[{kind:"document",label:"Document"},{kind:"spreadsheet",label:"Spreadsheet"},{kind:"deck",label:"Slides"}],ye="application/x-efficient-files";function ve(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function be(){try{return"grid"===localStorage.getItem(ge)?"grid":"list"}catch{return"list"}}function xe(e){const t=e??"/",n=t.split("/").filter(Boolean);let a=m()??[];for(const e of n){const t=a.find(t=>"folder"===t.kind&&t.name===e);a=t?.children??[]}return{folder:{id:e,name:n[n.length-1]??"",role:"owner",path:[{id:null,name:""},...n.map((e,t)=>({id:"/"+n.slice(0,t+1).join("/"),name:e}))]},entries:a.map(e=>({id:("/"===t?"":t)+"/"+e.name,name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}}function Ne(e,t){return`Not enough space for “${e}” (${d(t.attempted)}). You've used ${d(t.used)} of ${d(t.limit)}. Empty Trash or ask an administrator for more space.`}var Ce=(e,t)=>e instanceof Error&&e.message||t;function Se(e){const t=[];for(const n of e)("divider"!==n.type||0!==t.length&&"divider"!==t[t.length-1].type)&&t.push(n);for(;t.length&&"divider"===t[t.length-1].type;)t.pop();return t}function je({entry:e,className:t="h-5 w-5"}){const{name:n,tone:a}=te[_(e)];/* @__PURE__ */
35
+ return Q(z,{name:n,tone:a,look:"folder"===e.kind?"solid":void 0,className:`${t} shrink-0`})}function De({entry:e,read:t}){const[n,a]=U(null),r="image"===_(e)&&e.size<=5242880;return Y(()=>{if(!r||!t||"function"!=typeof URL.createObjectURL)return;let n=!0,i=null;return t(e.id).then(e=>{n&&(i=URL.createObjectURL(e),a(i))}).catch(()=>{}),()=>{n=!1,i&&URL.revokeObjectURL(i)}},[e.id,e.modifiedAt,r,t]),n?/* @__PURE__ */Q("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */Q(je,{entry:e,className:"h-10 w-10"})}function Me(){const n=w(),r=n.title??"Files",E=null!==m(),Z=!E&&!!n.shares&&!!n.sharedWithMe,[_,me]=U(null),[Me,Te]=U(null),[$e,Le]=U([]),[Re,Ae]=U(()=>/* @__PURE__ */new Set),Fe=J(null),[Ee,We]=U(!0),[Oe,ze]=U(!1),[Pe,Ke]=U(null),[Ie,Ue]=U(!1),[Je,Ye]=U(null),[Ge,Be]=U(null),[Xe,He]=U(null),[Qe,Ve]=U(be),[Ze,qe]=U(!1),[_e,et]=U(""),[tt,nt]=U(""),[at,rt]=U({}),[it,st]=U({key:"name",dir:"asc"}),[lt,ot]=U(()=>{const e=y();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"}),ct=J("files"),dt=J(lt);dt.current=lt,Y(()=>{v()},[]);const[mt,ht]=U([]),ut=e=>{Ve(e);try{localStorage.setItem(ge,e)}catch{}},ft=G(e=>{ot(e),rt({}),st("recent"===e?{key:"modified",dir:"desc"}:{key:"name",dir:"asc"}),"search"!==e&&(et(""),nt(""))},[]);Y(()=>{const e=()=>{v(),ft("trash")},t=e=>{v();const t=e.detail?.folderId;t&&ft({desktopFolderId:t})};return window.addEventListener(b,e),window.addEventListener(x,t),()=>{window.removeEventListener(b,e),window.removeEventListener(x,t)}},[ft]);const pt=B(N,C,C),gt="object"==typeof lt?lt.desktopFolderId:null,kt=gt?pt?.folders.find(e=>e.id===gt)??null:null,wt=gt&&pt?.itemsByFolder[gt]||[];Y(()=>{gt&&pt&&!pt.folders.some(e=>e.id===gt)&&ft("files")},[gt,pt,ft]);const yt=J(0),vt=J(null),bt=J(null),{openPage:xt,openEntity:Nt}=L(),Ct=i(),St=i(),jt=i(),Dt=B(h,u,u);Y(()=>f(),[]),Y(()=>{!Dt||"trash"!==lt&&"object"!=typeof lt||ft("files")},[Dt,lt,ft]);const Mt=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>xt(e)}):"page"===t.entityType?xt(t.entityId):Nt(t.entityType,t.entityId,null,t.label)},Tt=G(async()=>{if(!E)try{Ke(await n.quota())}catch{}},[n,E]),$t=G(async(e,t)=>{We(!0);try{await e(),ze(!1)}catch(e){e instanceof TypeError?ze(!0):I.error(Ce(e,t))}finally{We(!1)}},[]),Lt=G(async e=>{if(E)return Te(xe(e)),ze(!1),void We(!1);await $t(async()=>{Te(await n.list(e))},"Failed to list"),Tt()},[n,Tt,E,$t]),Rt=G(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=E?xe(_):await n.list(_).catch(()=>null);return Le((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void We(!1)}const a={recent:()=>n.recent?.()??Promise.resolve([]),starred:()=>n.starred?.()??Promise.resolve([]),shared:()=>n.sharedWithMe?.()??Promise.resolve([]),search:()=>n.search?.(t)??Promise.resolve([])}[e];await $t(async()=>{Le(await a())},"Failed to list files")},[n,E,_,$t]),At=G(async()=>{if(E)return ht([]),void We(!1);await $t(async()=>{ht(await n.trash())},"Failed to list trash"),Tt()},[n,Tt,E,$t]),Ft=()=>{"files"===lt?Lt(_):pe(lt)?Rt(lt,tt):"trash"===lt&&At()};Y(()=>{Ae(/* @__PURE__ */new Set),Fe.current=null,Ft()},[_,lt,tt]),Y(()=>{const e=_e.trim();if(!e)return;const t=setTimeout(()=>{e===tt&&"search"===dt.current||("search"!==dt.current&&(ct.current=dt.current),ot("search"),rt({}),nt(e))},300);return()=>clearTimeout(t)},[_e]);const Et=()=>{et(""),"search"===dt.current&&ft(ct.current)},Wt=e=>{ft("files"),me(e)},Ot=async(e,t)=>{try{await e()}catch(e){I.error(Ce(e,t))}Ft()},zt=e=>Ot(async()=>{await n.restore(e.id),I.success(`Restored "${e.name}"`)},"Restore failed"),Pt=async e=>{await A({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Ot(()=>n.purge(e.id),"Delete failed")},Kt=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){I.error(Ce(e,"Download failed"))}},It="files"===lt?Me?.folder??null:null,Ut=It?.role??"owner",Jt="owner"!==Ut,Yt="files"===lt?_:null,Gt=!E&&("files"!==lt||"viewer"!==Ut),Bt=!E&&"files"===lt&&"viewer"!==Ut,Xt=async(e,{withFolders:t=!1}={})=>{let a=0;for(const r of Array.from(e)){const e=r.webkitRelativePath??"",i=t?e.split("/").slice(0,-1).join("/"):"";try{await n.upload(Yt,r,i?{folderPath:i}:void 0),a++}catch(e){e instanceof T?I.error(Ne(r.name,e)):I.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&I.success(`Uploaded ${a} files`),"files"===lt?Lt(_):Wt(null)},Ht=async e=>{const t=ne(e),a=await F({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?I.error("Names cannot contain slashes"):Ot(()=>n.rename(e.id,function(e,t){const n=e.officeKind?$[e.officeKind]:"";return n&&!t.toLowerCase().endsWith(n)?t+n:t}(e,a)),"Rename failed"))},Qt=async e=>{if(0===e.length)return;const t=1===e.length?e[0]:null,a=e.some(e=>"owner"!==(e.role??"owner")),r=t?(t.owner??Me?.folder.owner)?.name??"its owner":"their owners";await A({title:t?`Move ${t.kind} to trash`:`Move ${e.length} items to trash`,message:(t?`"${ne(t)}"${"folder"===t.kind?" and everything inside":""}`:`${e.length} items`)+" will move to "+(a?`${r}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Move to trash",variant:"danger"})&&(await Ot(async()=>{for(const t of e)await n.remove(t.id)},"Delete failed"),I.success(t?`"${ne(t)}" moved to trash`:`${e.length} items moved to trash`))},Vt=(e,t)=>Ot(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Zt=async(e,t)=>{He(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Ot(async()=>{for(const e of a)await n.move(e.id,t)},"Move failed"),I.success(1===a.length?`Moved "${ne(a[0])}"`:`Moved ${a.length} items`))},qt=()=>{yt.current=0,Ue(!1),Ye(null)};Y(()=>{const e=()=>qt();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]);const _t="files"===lt?Me?.entries??[]:pe(lt)?$e:[],en=X(()=>le(de(_t,at),it),[_t,at,it]),tn=X(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Re].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?Ut:"owner"),sn=e=>!E&&"viewer"!==rn(e),ln=e=>Z&&"owner"===rn(e),on=e=>!!n.move&&sn(e),cn=(e,t)=>{if(Dt){const t=tn.get(e);if(t&&"file"===t.kind&&!mn(t))return;return void Ae(/* @__PURE__ */new Set([e]))}if(t.shiftKey&&Fe.current){const t=en.map(e=>e.id),n=t.indexOf(Fe.current),a=t.indexOf(e);if(n>=0&&a>=0)return void Ae(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Fe.current=e,t.metaKey||t.ctrlKey?Ae(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):Ae(/* @__PURE__ */new Set([e]))},dn=()=>{Ae(/* @__PURE__ */new Set),Fe.current=null},mn=e=>!!Dt&&"file"===e.kind&&g(Dt.request,e.name),hn=e=>Dt&&"file"===e.kind&&!mn(e)?"text-ink-faintest":"",un=e=>{if(!Dt||!mn(e))return;const t="files"===lt?Me?.folder:null,n=t?["owner"===t.role?"My files":"Shared with me",...t.path.filter(e=>null!==e.id).map(e=>e.name)].join(" › "):"shared"===lt?"Shared with me":"My files";p(Dt.id,{entry:e,folderId:"files"===lt?_:null,location:n})},fn=Dt&&an&&mn(an)?an:null,pn=t=>{"folder"===t.kind?Wt(t.id):Dt?un(t):(async t=>{if(E)return;if(n.open?.(t))return;const a=ke[q(t.name)];a?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:a,load:()=>n.read(t.id),onStaged:e=>xt(e)}):Kt(t)})(t)},gn=e=>{if(0===e.length)return[];const t=1===e.length?e[0]:null;if(Dt)return t&&("folder"===t.kind||mn(t))?[{key:"open",label:"Open",icon:/* @__PURE__ */Q(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const a=t&&"file"===t.kind&&n.openLabel?.(t)||"Open",r=e.every(e=>"file"===e.kind),i=e.every(sn);if(E)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */Q(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const s=e.some(e=>!e.starred);return Se([...t?[{key:"open",label:a,icon:/* @__PURE__ */Q(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */Q(z,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Kt)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */Q(z,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Ht(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */Q(z,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Ot(async()=>{for(const t of e)await n.copy(t.id);I.success(1===e.length?`Copied "${ne(e[0])}"`:`Copied ${e.length} files`)},"Copy failed"))(e)}]:[],{type:"divider",key:"d2"},...t&&ln(t)?[{key:"share",label:"Share",icon:/* @__PURE__ */Q(z,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Be(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */Q(z,{name:"forward",className:"h-4 w-4"}),onSelect:()=>He(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */Q(z,{name:"star",className:"h-4 w-4"}),onSelect:()=>Vt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */Q(z,{name:"info",className:"h-4 w-4"}),onSelect:()=>{Ae(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */Q(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Qt(e)}]:[]])},kn=(e,t)=>{const n=Re.has(t.id)?nn:[t];Ct.open(e,n)&&!Re.has(t.id)&&(Ae(/* @__PURE__ */new Set([t.id])),Fe.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Re.has(e.id)?nn:[e];t.dataTransfer.setData(ye,JSON.stringify(n.map(e=>e.id))),t.dataTransfer.effectAllowed="move"}}:{},yn=e=>"folder"===e.kind&&sn(e)&&n.move?{onDragOver:t=>{t.dataTransfer.types.includes(ye)&&(t.preventDefault(),t.stopPropagation(),Je!==e.id&&Ye(e.id))},onDragLeave:()=>{Je===e.id&&Ye(null)},onDrop:t=>{if(!t.dataTransfer.types.includes(ye))return;t.preventDefault(),t.stopPropagation(),Ye(null);const n=JSON.parse(t.dataTransfer.getData(ye)||"[]").map(e=>tn.get(e)).filter(t=>!!t&&t.id!==e.id);Zt(n,e.id)}}:{};if(Oe)/* @__PURE__ */
36
+ return H("div",{className:"flex flex-col h-full bg-surface",children:[
37
+ /* @__PURE__ */Q(R,{title:`${r} - offline`}),
38
+ /* @__PURE__ */Q("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */H("div",{className:"max-w-md",children:[
39
+ /* @__PURE__ */Q(z,{name:"close-circle",tone:"muted",className:"h-12 w-12 mx-auto mb-3",strokeWidth:1.4}),S()?/* @__PURE__ */H(V,{children:[
40
+ /* @__PURE__ */Q("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
41
+ /* @__PURE__ */Q("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */H(V,{children:[
42
+ /* @__PURE__ */Q("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
43
+ /* @__PURE__ */H("p",{className:"text-sm text-ink-faint mb-3",children:["No response from the file server. Make sure the server is running — see ",
44
+ /* @__PURE__ */Q("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
45
+ /* @__PURE__ */Q(O,{variant:"primary",onClick:Ft,children:"Retry"})]})})]});const vn=Pe&&Pe.limit>0?Math.min(100,Math.round(Pe.used/Pe.limit*100)):0,bn=vn>90?"bg-danger":vn>75?"bg-warning":"bg-accent-fill",xn=[Jt?{label:"Shared with me",onClick:()=>ft("shared")}:{label:"My files",onClick:()=>Wt(null)},...(It?.path??[]).filter(e=>null!==e.id).map(e=>({label:e.name,onClick:()=>Wt(e.id)}))],Nn="recent"===lt?"Recent":"starred"===lt?"Starred":"shared"===lt?"Shared with me":"search"===lt?`Results for “${tt}”`:"trash"===lt?"Trash":kt?kt.name:null,Cn=Dt?`${r} - Choosing`:Nn?`${r} - ${"search"===lt?"Search":Nn}`:It&&null!==It.id?`${r} - ${It.name}`:r,Sn=e=>"flex w-full items-center gap-3 rounded-full px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-accent-tint font-medium text-accent-text":"text-ink hover:bg-row-hover"),jn=Se([{key:"folder",label:"New folder",icon:/* @__PURE__ */Q(z,{name:"folder-plus",className:"h-4 w-4"}),onSelect:async()=>{const e=await F({title:"New folder",placeholder:"Folder name",defaultValue:"Untitled folder",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?I.error("Folder names cannot contain slashes"):(await Ot(()=>n.createFolder(Yt,e),"Create folder failed"),"files"!==lt&&Wt(null)))}},{type:"divider",key:"d1"},{key:"upload",label:"File upload",icon:/* @__PURE__ */Q(z,{name:"upload",className:"h-4 w-4"}),onSelect:()=>vt.current?.click()},...n.folderUpload?[{key:"upload-folder",label:"Folder upload",icon:/* @__PURE__ */Q(z,{name:"cloud-arrow-up",className:"h-4 w-4"}),onSelect:()=>bt.current?.click()}]:[],{type:"divider",key:"d2"},...n.createOfficeFile?we.filter(e=>!n.officeKinds||n.officeKinds.includes(e.kind)).map(e=>{const t=te["deck"===e.kind?"slides":e.kind];return{key:e.kind,label:e.label,icon:/* @__PURE__ */Q(z,{name:t.name,tone:t.tone,className:"h-4 w-4"}),onSelect:()=>{Promise.resolve(n.createOfficeFile(e.kind,Yt)).catch(e=>I.error(Ce(e,"Could not create it")))}}}):[]]),Dn=/* @__PURE__ */H("div",{className:"flex h-full flex-col",children:[
46
+ /* @__PURE__ */Q("div",{className:"p-3 pb-2",children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */H(V,{children:[
47
+ /* @__PURE__ */Q(z,{name:"add",className:"h-5 w-5"}),
48
+ /* @__PURE__ */Q("span",{children:"New"})]}),items:jn,align:"start","aria-label":"New",disabled:!Gt,triggerClassName:"inline-flex items-center gap-2 h-11 pl-4 pr-5 rounded-2xl bg-surface-raised border border-line shadow-sm text-sm font-medium text-ink-strong hover:bg-row-hover disabled:opacity-50 rosh-focus-ring focus-visible:ring-2"})}),
49
+ /* @__PURE__ */H("nav",{className:"px-2 flex-1 overflow-auto","aria-label":"Locations",children:[
50
+ /* @__PURE__ */H("button",{onClick:()=>Wt(null),className:Sn("files"===lt&&!Jt),children:[
51
+ /* @__PURE__ */Q(z,{name:"home",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"My files"]}),n.recent&&!E&&/* @__PURE__ */H("button",{onClick:()=>ft("recent"),className:Sn("recent"===lt),children:[
52
+ /* @__PURE__ */Q(z,{name:"clock",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Recent"]}),n.starred&&!E&&/* @__PURE__ */H("button",{onClick:()=>ft("starred"),className:Sn("starred"===lt),children:[
53
+ /* @__PURE__ */Q(z,{name:"star",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Starred"]}),Z&&/* @__PURE__ */H("button",{onClick:()=>ft("shared"),className:Sn("shared"===lt||"files"===lt&&Jt),children:[
54
+ /* @__PURE__ */Q(z,{name:"team",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Shared with me"]}),!E&&/* @__PURE__ */H("button",{onClick:()=>ft("trash"),className:Sn("trash"===lt),children:[
55
+ /* @__PURE__ */Q(z,{name:"trash",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Trash"]}),pt&&pt.folders.length>0&&/* @__PURE__ */H(V,{children:[
56
+ /* @__PURE__ */Q("div",{className:"px-3 pt-4 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),pt.folders.map(e=>/* @__PURE__ */H("button",{onClick:()=>ft({desktopFolderId:e.id}),className:Sn(gt===e.id),children:[
57
+ /* @__PURE__ */Q(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
58
+ /* @__PURE__ */Q("span",{className:"truncate",children:e.name}),
59
+ /* @__PURE__ */Q(W,{count:e.itemCount,active:gt===e.id,className:"ml-auto"})]},e.id))]})]}),Pe&&/* @__PURE__ */H("div",{className:"px-5 py-3 shrink-0",title:`${d(Pe.used)} of ${d(Pe.limit)} used`,children:[
60
+ /* @__PURE__ */Q("div",{className:"h-1 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */Q("div",{className:`h-full ${bn} transition-all`,style:{width:`${vn}%`}})}),
61
+ /* @__PURE__ */H("div",{className:"mt-2 text-2xs text-ink-faint tabular-nums",children:[d(Pe.used)," of ",d(Pe.limit)," used"]})]})]}),Mn=(e,t)=>/* @__PURE__ */H("span",{className:"inline-flex items-center gap-1",children:[e,
62
+ /* @__PURE__ */Q(z,{name:"chevron-down",className:"h-3.5 w-3.5"}),t?"":null]}),Tn=e=>"inline-flex items-center h-7 px-3 rounded-(--radius-control) border text-xs whitespace-nowrap rosh-focus-ring focus-visible:ring-2 "+(e?"border-accent-border bg-accent-tint text-accent-text":"border-line-strong text-ink-muted hover:bg-row-hover"),$n=pe(lt)||"files"===lt,Ln=function(e){const t=/* @__PURE__ */new Map;for(const n of e)"owner"!==(n.role??"owner")&&n.owner&&t.set(n.owner.id,n.owner.name);return[...t].map(([e,t])=>({id:e,name:t})).sort((e,t)=>se.compare(e.name,t.name))}(_t),Rn=$n&&_t.length>0?/* @__PURE__ */H("div",{className:"flex items-center gap-2 shrink-0",children:[
63
+ /* @__PURE__ */Q(o,{trigger:Mn(at.type?ee[at.type]:"Type",!!at.type),"aria-label":"Type",triggerClassName:Tn(!!at.type),items:[...oe.map(e=>({type:"radio",key:e,label:ee[e],checked:at.type===e,onSelect:()=>rt(t=>({...t,type:t.type===e?null:e}))})),...at.type?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,type:null}))}]:[]]}),Z&&/* @__PURE__ */Q(o,{trigger:Mn(at.person?"me"===at.person?"Owned by me":Ln.find(e=>e.id===at.person)?.name??"People":"People",!!at.person),"aria-label":"People",triggerClassName:Tn(!!at.person),items:[{type:"radio",key:"me",label:"Owned by me",checked:"me"===at.person,onSelect:()=>rt(e=>({...e,person:"me"===e.person?null:"me"}))},...Ln.map(e=>({type:"radio",key:e.id,label:e.name,checked:at.person===e.id,onSelect:()=>rt(t=>({...t,person:t.person===e.id?null:e.id}))})),...at.person?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,person:null}))}]:[]]}),
64
+ /* @__PURE__ */Q(o,{trigger:Mn(at.modified?ce[at.modified]:"Modified",!!at.modified),"aria-label":"Modified",triggerClassName:Tn(!!at.modified),items:[...Object.keys(ce).map(e=>({type:"radio",key:e,label:ce[e],checked:at.modified===e,onSelect:()=>rt(t=>({...t,modified:t.modified===e?null:e}))})),...at.modified?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,modified:null}))}]:[]]})]}):null,An=$n&&nn.length>0&&!Dt?/* @__PURE__ */H("div",{className:"flex items-center gap-0.5 h-10 px-2 rounded-full bg-surface-sunken",role:"toolbar","aria-label":"Selection",children:[
65
+ /* @__PURE__ */Q(c,{"aria-label":"Clear selection",size:"sm",onClick:dn,children:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4"})}),
66
+ /* @__PURE__ */H("span",{className:"text-sm text-ink mr-2 whitespace-nowrap",children:[nn.length," selected"]}),an&&ln(an)&&/* @__PURE__ */Q(c,{"aria-label":"Share",size:"sm",onClick:()=>Be(an),children:/* @__PURE__ */Q(z,{name:"add-person",className:"h-4 w-4"})}),!E&&nn.every(e=>"file"===e.kind)&&/* @__PURE__ */Q(c,{"aria-label":"Download",size:"sm",onClick:()=>nn.forEach(Kt),children:/* @__PURE__ */Q(z,{name:"download",className:"h-4 w-4"})}),nn.every(on)&&/* @__PURE__ */Q(c,{"aria-label":"Move",size:"sm",onClick:()=>He(nn),children:/* @__PURE__ */Q(z,{name:"forward",className:"h-4 w-4"})}),!E&&nn.every(sn)&&/* @__PURE__ */Q(c,{"aria-label":"Move to trash",size:"sm",onClick:()=>Qt(nn),children:/* @__PURE__ */Q(z,{name:"trash",className:"h-4 w-4"})}),
67
+ /* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(nn)})]}):null,Fn=/* @__PURE__ */Q("div",{className:"flex items-center gap-2 px-4 pb-2 min-h-12 shrink-0",children:An??/* @__PURE__ */H(V,{children:[
68
+ /* @__PURE__ */H("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:["files"===lt?/* @__PURE__ */Q("div",{className:"min-w-0 text-base [&_*]:text-base",children:/* @__PURE__ */Q(a,{items:xn,maxItems:5})}):"trash"===lt?/* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong",children:"Trash"}):"object"==typeof lt?/* @__PURE__ */H(V,{children:[
69
+ /* @__PURE__ */Q(j,{className:"h-4 w-4 text-amber-500 shrink-0"}),
70
+ /* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong truncate",children:kt?.name??"Desktop folder"}),
71
+ /* @__PURE__ */Q("span",{className:"text-2xs text-ink-faintest whitespace-nowrap",children:"Desktop shortcuts"})]}):/* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong truncate",children:Nn}),"files"===lt&&Jt&&"viewer"===Ut&&/* @__PURE__ */H("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs text-ink-faint whitespace-nowrap",children:[
72
+ /* @__PURE__ */Q(z,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),"files"===lt&&Jt&&It?.owner&&/* @__PURE__ */H("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",It.owner.name]})]}),Rn,"trash"===lt&&/* @__PURE__ */Q(O,{variant:"secondary-danger",size:"sm",onClick:async()=>{if(0===mt.length)return;await A({title:"Empty trash",message:`${mt.length} item${1===mt.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"})&&Ot(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===mt.length,children:"Empty trash"})]})}),En=(e,t)=>Dt?null:/* @__PURE__ */H("div",{className:"flex items-center justify-end "+(t?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:[ln(e)&&/* @__PURE__ */Q(c,{"aria-label":"Share",size:"sm",onClick:t=>{t.stopPropagation(),Be(e)},children:/* @__PURE__ */Q(z,{name:"add-person",className:"h-4 w-4"})}),!E&&"file"===e.kind&&/* @__PURE__ */Q(c,{"aria-label":"Download",size:"sm",onClick:t=>{t.stopPropagation(),Kt(e)},children:/* @__PURE__ */Q(z,{name:"download",className:"h-4 w-4"})}),n.setStarred&&!E&&/* @__PURE__ */Q(c,{"aria-label":e.starred?"Remove from starred":"Add to starred","aria-pressed":!!e.starred,size:"sm",onClick:t=>{t.stopPropagation(),Vt([e],!e.starred)},children:/* @__PURE__ */Q(z,{name:"star",look:e.starred?"solid":void 0,tone:e.starred?"warning":void 0,className:"h-4 w-4"})}),
73
+ /* @__PURE__ */Q("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(Re.has(e.id)&&nn.length>1?nn:[e])})})]}),Wn=e=>/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
74
+ /* @__PURE__ */Q(je,{entry:e}),
75
+ /* @__PURE__ */Q("span",{className:"truncate",title:e.name,children:ne(e)}),!!e.shareCount&&/* @__PURE__ */Q("span",{className:"shrink-0",role:"img","aria-label":"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),title:"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),children:/* @__PURE__ */Q(z,{name:"team",tone:"muted",className:"h-3.5 w-3.5"})}),e.starred&&/* @__PURE__ */Q("span",{className:"shrink-0",role:"img","aria-label":"Starred",title:"Starred",children:/* @__PURE__ */Q(z,{name:"star",look:"solid",tone:"warning",className:"h-3.5 w-3.5"})})]}),On=(e,t,n)=>{const a=it.key===e;/* @__PURE__ */
76
+ return Q("th",{className:`${K} font-medium px-3 h-9 ${n}`,"aria-sort":a?"asc"===it.dir?"ascending":"descending":void 0,children:/* @__PURE__ */H("button",{type:"button",className:"inline-flex items-center gap-1 rounded hover:text-ink "+(a?"text-ink":""),onClick:()=>st(t=>({key:e,dir:t.key===e&&"asc"===t.dir?"desc":"asc"})),children:[t,a&&("asc"===it.dir?/* @__PURE__ */Q(z,{name:"arrow-up",className:"h-3 w-3"}):/* @__PURE__ */Q(z,{name:"arrow-down",className:"h-3 w-3"}))]})})},zn="recent"===lt?"Files you and your colleagues change show here.":"starred"===lt?"Star the files and folders you want to find quickly.":"shared"===lt?"Nothing has been shared with you yet. Files and folders colleagues share with you show here.":"search"===lt?`Nothing matches “${tt}”.`:null,Pn=0===en.length?Ee?/* @__PURE__ */Q(P,{size:"sm",padding:"p-6",label:"Loading"}):/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:_t.length>0?"Nothing matches these filters.":zn??/* @__PURE__ */H(V,{children:["This folder is empty.",Bt&&/* @__PURE__ */H(V,{children:[" Drop files here or choose ",
77
+ /* @__PURE__ */Q("span",{className:"font-medium",children:"New"}),"."]})]})}):"grid"===Qe?/* @__PURE__ */Q("div",{className:"px-4 pb-4",children:["folder","file"].map(e=>{const t=en.filter(t=>t.kind===e);return 0===t.length?null:/* @__PURE__ */H("section",{className:"mb-4",children:[
78
+ /* @__PURE__ */Q("h3",{className:"text-xs font-medium text-ink-faint mb-2",children:"folder"===e?"Folders":"Files"}),
79
+ /* @__PURE__ */Q("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.map(t=>{const a=Re.has(t.id);/* @__PURE__ */
80
+ return H("div",{role:"button",tabIndex:0,"aria-pressed":a,"aria-label":ne(t),onClick:e=>cn(t.id,e),onDoubleClick:()=>pn(t),onContextMenu:e=>kn(e,t),...wn(t),...yn(t),className:"group rounded-xl border cursor-default select-none outline-none focus-visible:ring-2 focus-visible:ring-accent-border "+(a||Je===t.id?"border-accent-border bg-accent-tint":"border-line bg-surface-sunken hover:bg-row-hover"),children:[
81
+ /* @__PURE__ */H("div",{className:"flex items-center gap-2 pl-3 pr-1 h-11",children:[
82
+ /* @__PURE__ */Q(je,{entry:t,className:"h-4 w-4"}),
83
+ /* @__PURE__ */Q("span",{className:"flex-1 truncate text-sm",title:t.name,children:ne(t)}),
84
+ /* @__PURE__ */Q("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(a&&nn.length>1?nn:[t])})})]}),"file"===e&&/* @__PURE__ */H(V,{children:[
85
+ /* @__PURE__ */Q("div",{className:"mx-2 h-28 rounded-lg bg-surface flex items-center justify-center overflow-hidden",children:/* @__PURE__ */Q(De,{entry:t,read:E?void 0:n.read})}),
86
+ /* @__PURE__ */H("div",{className:"px-3 py-2 text-2xs text-ink-faint truncate",children:["me"===ie(t)?"You":ie(t)," · ",re(t.modifiedAt)]})]})]},t.id)})})]},e)})}):/* @__PURE__ */H("table",{className:"w-full text-sm table-fixed",children:[
87
+ /* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[On("name","Name","text-left"),Z&&On("owner","Owner","text-left w-32"),On("modified","Modified","text-left w-28"),On("size","Size","text-right w-20"),
88
+ /* @__PURE__ */Q("th",{className:`${K} w-32`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
89
+ /* @__PURE__ */Q("tbody",{children:en.map(e=>{const t=Re.has(e.id);/* @__PURE__ */
90
+ return H("tr",{"aria-selected":t,onClick:t=>cn(e.id,t),onDoubleClick:()=>pn(e),onContextMenu:t=>kn(t,e),...wn(e),...yn(e),className:`group cursor-default select-none border-b border-line-subtle ${hn(e)} ${t||Je===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
91
+ /* @__PURE__ */Q("td",{className:"px-3 h-11",children:Wn(e)}),Z&&/* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint truncate",children:ie(e)}),
92
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:ve(e.modifiedAt),children:re(e.modifiedAt)}),
93
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint whitespace-nowrap",children:Dt&&"file"===e.kind&&!mn(e)&&Dt.request.otherLabel?Dt.request.otherLabel:ae(e)}),
94
+ /* @__PURE__ */Q("td",{className:"px-2 h-11",children:En(e,t)})]},e.id)})})]}),Kn=Ee&&0===mt.length?/* @__PURE__ */Q(P,{size:"sm",padding:"p-6",label:"Loading"}):0===mt.length?/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty. What you delete stays here for 30 days."}):/* @__PURE__ */H("table",{className:"w-full text-sm table-fixed",children:[
95
+ /* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[
96
+ /* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
97
+ /* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-48`,children:"Original location"}),
98
+ /* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Deleted"}),
99
+ /* @__PURE__ */Q("th",{className:`${K} text-right font-medium px-3 h-9 w-24`,children:"Size"}),
100
+ /* @__PURE__ */Q("th",{className:`${K} w-28`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
101
+ /* @__PURE__ */Q("tbody",{children:mt.map(e=>/* @__PURE__ */H("tr",{className:"group border-b border-line-subtle hover:bg-row-hover",onContextMenu:t=>St.open(t,e),children:[
102
+ /* @__PURE__ */Q("td",{className:"px-3 h-11",children:/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
103
+ /* @__PURE__ */Q(je,{entry:e}),
104
+ /* @__PURE__ */Q("span",{className:"truncate",title:e.name,children:e.name})]})}),
105
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint text-xs truncate",title:e.originalPath,children:e.originalPath||"—"}),
106
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:e.deletedAt?ve(e.deletedAt):void 0,children:e.deletedAt?re(e.deletedAt):"—"}),
107
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":d(e.size)}),
108
+ /* @__PURE__ */Q("td",{className:"px-2 h-11",children:/* @__PURE__ */H("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
109
+ /* @__PURE__ */Q(c,{"aria-label":"Restore",size:"sm",onClick:()=>zt(e),children:/* @__PURE__ */Q(z,{name:"revert",className:"h-4 w-4"})}),
110
+ /* @__PURE__ */Q(c,{"aria-label":"Delete forever",size:"sm",variant:"ghost-danger",onClick:()=>Pt(e),children:/* @__PURE__ */Q(z,{name:"trash",className:"h-4 w-4"})})]})})]},e.id))})]}),In=0===wt.length?/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */H("table",{className:"w-full text-sm table-fixed",children:[
111
+ /* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[
112
+ /* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
113
+ /* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Type"}),
114
+ /* @__PURE__ */Q("th",{className:`${K} w-32`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
115
+ /* @__PURE__ */Q("tbody",{children:wt.map(e=>/* @__PURE__ */H("tr",{onDoubleClick:()=>Mt(e),onContextMenu:t=>jt.open(t,e),className:"group cursor-default border-b border-line-subtle hover:bg-row-hover",children:[
116
+ /* @__PURE__ */Q("td",{className:"px-3 h-11",children:/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
117
+ /* @__PURE__ */Q(D,{item:e}),
118
+ /* @__PURE__ */Q("span",{className:"truncate",title:e.label,children:e.label})]})}),
119
+ /* @__PURE__ */Q("td",{className:"px-3 h-11 text-xs text-ink-faint",children:M(e)}),
120
+ /* @__PURE__ */Q("td",{className:"px-2 h-11",children:/* @__PURE__ */H("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
121
+ /* @__PURE__ */Q(c,{"aria-label":"Open",size:"sm",onClick:()=>Mt(e),children:/* @__PURE__ */Q(z,{name:"external",className:"h-4 w-4"})}),
122
+ /* @__PURE__ */Q(c,{"aria-label":"Move to desktop",size:"sm",onClick:()=>pt?.moveToDesktop([e]),children:/* @__PURE__ */Q(z,{name:"desktop",className:"h-4 w-4"})}),
123
+ /* @__PURE__ */Q(c,{"aria-label":"Remove",size:"sm",variant:"ghost-danger",onClick:()=>pt?.removeShortcuts([e]),children:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4"})})]})})]},`${e.entityType}|${e.entityId}`))})]});/* @__PURE__ */
124
+ return H("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Bt&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),yt.current++,Ie||Ue(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{yt.current>0&&yt.current--,0===yt.current&&Ue(!1)},onDrop:e=>{e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),qt(),Bt&&e.dataTransfer.files?.length&&Xt(e.dataTransfer.files))},children:[
125
+ /* @__PURE__ */Q(R,{title:Cn}),
126
+ /* @__PURE__ */Q(k,{app:"files"}),
127
+ /* @__PURE__ */Q("input",{ref:vt,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Xt(e.target.files),vt.current&&(vt.current.value="")}}),
128
+ /* @__PURE__ */Q("input",{ref:e=>{bt.current=e,e?.setAttribute("webkitdirectory","")},type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Xt(e.target.files,{withFolders:!0}),bt.current&&(bt.current.value="")}}),
129
+ /* @__PURE__ */Q("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */Q(t,{sidebar:Dn,storageKey:"files.sidebarWidth",defaultWidth:220,minWidth:170,maxWidth:320,children:/* @__PURE__ */H("div",{className:"flex h-full min-w-0",children:[
130
+ /* @__PURE__ */H("div",{className:"flex flex-1 min-w-0 flex-col",children:[Dt&&/* @__PURE__ */H("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-line bg-accent-tint text-accent-text text-sm shrink-0",role:"status",children:[
131
+ /* @__PURE__ */Q(z,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
132
+ /* @__PURE__ */Q("span",{className:"flex-1 min-w-0 truncate",children:Dt.request.title}),
133
+ /* @__PURE__ */Q(O,{variant:"secondary",size:"sm",onClick:()=>p(Dt.id,null),children:"Cancel"}),
134
+ /* @__PURE__ */Q(O,{variant:"primary",size:"sm",disabled:!fn,onClick:()=>{fn&&un(fn)},children:"Open"})]}),
135
+ /* @__PURE__ */H("div",{className:"flex items-center gap-1 px-4 py-2 shrink-0",children:[
136
+ /* @__PURE__ */Q("div",{className:"flex-1 min-w-48 max-w-2xl",role:"search",children:/* @__PURE__ */Q(l,{type:"text",enterKeyHint:"search",value:_e,onChange:e=>{et(e.target.value),e.target.value.trim()||Et()},onKeyDown:e=>{"Escape"===e.key&&_e&&(e.stopPropagation(),Et())},placeholder:`Search in ${r}`,"aria-label":`Search in ${r}`,leftIcon:/* @__PURE__ */Q(z,{name:"search",className:"h-4 w-4"}),endAction:_e?{label:"Clear search",icon:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4"}),onClick:Et}:void 0})}),
137
+ /* @__PURE__ */Q("div",{className:"flex-1"}),"object"!=typeof lt&&"trash"!==lt&&/* @__PURE__ */H(V,{children:[
138
+ /* @__PURE__ */Q(c,{"aria-label":"List view","aria-pressed":"list"===Qe,onClick:()=>ut("list"),children:/* @__PURE__ */Q(z,{name:"list",className:"h-4 w-4"})}),
139
+ /* @__PURE__ */Q(c,{"aria-label":"Grid view","aria-pressed":"grid"===Qe,onClick:()=>ut("grid"),children:/* @__PURE__ */Q(z,{name:"grid",className:"h-4 w-4"})})]}),
140
+ /* @__PURE__ */Q(c,{"aria-label":"Details","aria-pressed":Ze,onClick:()=>qe(e=>!e),children:/* @__PURE__ */Q(z,{name:"info",className:"h-4 w-4"})})]}),Fn,
141
+ /* @__PURE__ */Q("div",{className:"flex-1 overflow-auto outline-none",tabIndex:-1,onKeyDown:e=>{e.target instanceof HTMLInputElement||(Dt?"Enter"===e.key&&fn&&(e.preventDefault(),un(fn)):("Delete"===e.key||"Backspace"===e.key)&&nn.length&&nn.every(sn)?(e.preventDefault(),Qt(nn)):"Enter"===e.key&&an?(e.preventDefault(),pn(an)):(e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&en.length&&(e.preventDefault(),Ae(new Set(en.map(e=>e.id)))))},onClick:e=>{e.target===e.currentTarget&&dn()},children:"object"==typeof lt?In:"trash"===lt?Kn:Pn})]}),Ze&&$n&&/* @__PURE__ */Q(fe,{store:n,entry:an,selectedCount:nn.length,onClose:()=>qe(!1)})]})})}),Ct.state&&/* @__PURE__ */Q(s,{...Ct.props,items:gn(Ct.state.data),"aria-label":"File actions"}),St.state&&/* @__PURE__ */Q(s,{...St.props,"aria-label":"Trash actions",items:[{key:"restore",label:"Restore",icon:/* @__PURE__ */Q(z,{name:"revert",className:"h-4 w-4"}),onSelect:()=>zt(St.state.data)},{type:"divider",key:"d"},{key:"purge",label:"Delete forever",danger:!0,icon:/* @__PURE__ */Q(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Pt(St.state.data)}]}),jt.state&&/* @__PURE__ */Q(s,{...jt.props,"aria-label":"Shortcut actions",items:[{key:"open",label:"Open",icon:/* @__PURE__ */Q(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>Mt(jt.state.data)},{key:"desktop",label:"Move to desktop",icon:/* @__PURE__ */Q(z,{name:"desktop",className:"h-4 w-4"}),onSelect:()=>pt?.moveToDesktop([jt.state.data])},{type:"divider",key:"d"},{key:"remove",label:"Remove",danger:!0,icon:/* @__PURE__ */Q(z,{name:"close",className:"h-4 w-4"}),onSelect:()=>pt?.removeShortcuts([jt.state.data])}]}),Z&&/* @__PURE__ */Q(he,{store:n,entry:Ge,onClose:()=>Be(null),onChanged:Ft}),n.move&&/* @__PURE__ */Q(ue,{store:n,items:Xe,from:"files"===lt?_:void 0,onClose:()=>He(null),onMove:e=>Xe&&Zt(Xe,e)}),Ie&&/* @__PURE__ */Q("div",{className:"absolute inset-0 bg-accent-tint border-4 border-dashed border-accent-border pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */Q("div",{className:"px-4 py-2 rounded-md bg-accent-fill text-on-accent text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{Me as default,Ne as quotaExceededMessage};
@@ -0,0 +1,24 @@
1
+ import{getNumberingConfigs as e}from"./chunk-CALBDO7B.js";import{SidebarLayout as t}from"./chunk-JGRDG7CB.js";import"./chunk-QWK6DRSN.js";import"./chunk-OOWPLQD5.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-JVOH7776.js";import{useWindowManager as o,client_default as i}from"./chunk-KZRZYLN7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-EIFNESXS.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-7NYCPO54.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as l}from"./chunk-3YBXA72C.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=c(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[v]);const T=j.notepad_notes||[],[_,C]=d(null),[W,D]=d(""),[S,J]=d(""),[X,M]=d("yellow"),[O,$]=d(!1),[G,U]=d(!1),E=a(null),I=a();p(()=>{if(!_&&T.length>0){const e=T[0];C(e.id),D(e.title),J(e.content),M(e.color)}},[T.length]);const K=m(e=>{N({notepad_notes:e})},[N]),Z=m(()=>{if(!_||!O)return;const e=T.map(e=>e.id===_?{...e,title:W,content:S,color:X,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);K(e),$(!1)},[_,O,W,S,X,T,K]);p(()=>{if(O)return I.current&&clearTimeout(I.current),I.current=setTimeout(Z,800),()=>{I.current&&clearTimeout(I.current)}},[O,Z]),p(()=>()=>{O&&Z()},[]);const A=e=>{O&&Z(),C(e.id),D(e.title),J(e.content),M(e.color),$(!1),U(!1)},B=e=>{const t=S.slice(0,e),r=S.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=S.slice(e+r[0].length);J(t+n+o),$(!0)},F=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):l.error(`${n} not found`)}catch{l.error(`Failed to look up ${n}`)}},H="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",R=/* @__PURE__ */h(g,{children:[
2
+ /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{O&&Z();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];K(t),C(e.id),D(""),J(""),M("yellow"),$(!1),U(!0),setTimeout(()=>E.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
3
+ /* @__PURE__ */x(s,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
+ /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===T.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):T.map(e=>{const t=(n=e.color,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
5
+ return h("button",{onClick:()=>A(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(_===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
6
+ /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
9
+ /* @__PURE__ */x("p",{className:"text-xs text-ink-faintest mt-0.5 truncate ml-5",children:e.content.replace(/\[[ xX]?\]/g,"").slice(0,60)||"Empty note"}),
10
+ /* @__PURE__ */x("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
+ return h("div",{className:"h-full",children:[
12
+ /* @__PURE__ */x(n,{app:"notepad"}),
13
+ /* @__PURE__ */x(t,{sidebar:R,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
+ /* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
+ /* @__PURE__ */x("input",{value:W,onChange:e=>{D(e.target.value),$(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{M(e.key),$(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${X===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
+ /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(K(t),_===e){const e=t[0];e?A(e):(C(null),D(""),J(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(s,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),G?/* @__PURE__ */x("textarea",{ref:E,value:S,onChange:e=>{J(e.target.value),$(!0)},onBlur:()=>{U(!1),O&&Z()},placeholder:H,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{U(!0),setTimeout(()=>E.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:S?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=c.exec(e));){const e=l[1],t=l[2];if(w.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>F(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(l=b.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=a+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>B(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(s,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
+ return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:H})}),
19
+ /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
20
+ /* @__PURE__ */x("span",{children:"[] checkbox"}),
21
+ /* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
22
+ /* @__PURE__ */x("span",{className:"ml-auto",children:G?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
23
+ /* @__PURE__ */x(s,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
24
+ /* @__PURE__ */x("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};