pi-roundtable-web 0.26.0 → 0.26.2
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.
- package/CHANGELOG.md +50 -0
- package/README.md +32 -12
- package/dist/chunk-account-nhpd9j90.js +1 -0
- package/dist/chunk-action-menu-ec9jqtxq.js +1 -0
- package/dist/chunk-agent-d1xfrawq.js +1 -0
- package/dist/chunk-arranged-rooms-bga8yk2v.js +1 -0
- package/dist/chunk-character-creator-k67f77w5.js +1 -0
- package/dist/chunk-codeeditor-jm2sm333.js +2 -0
- package/dist/chunk-confirm-wc5xraev.js +1 -0
- package/dist/chunk-connectors-mhnw6d79.js +1 -0
- package/dist/chunk-conversations-yjyq4g1y.js +1 -0
- package/dist/{chunk-drag-v41gx2mc.js → chunk-drag-nyq52ck7.js} +1 -1
- package/dist/chunk-entry-red1597w.js +1 -0
- package/dist/chunk-folder-list-x56y26yq.js +1 -0
- package/dist/chunk-folds-3p7s2nvx.js +1 -0
- package/dist/{chunk-gate-8k61stsc.js → chunk-gate-h41bv4y9.js} +1 -1
- package/dist/chunk-group-scene-7eb6jyev.js +1 -0
- package/dist/chunk-group-table-rca48kt0.js +1 -0
- package/dist/chunk-host-icons-x318gjqp.js +1 -0
- package/dist/chunk-host-picture-xswcakgy.js +1 -0
- package/dist/chunk-host-state-bpahvk54.js +1 -0
- package/dist/chunk-host-ui-tsbwwk38.js +1 -0
- package/dist/{chunk-index-hby0ap91.js → chunk-index-029209sy.js} +2 -2
- package/dist/chunk-index-066vzexw.js +2 -0
- package/dist/chunk-index-0h4h76kw.js +2 -0
- package/dist/chunk-index-0n6ja7my.js +1 -0
- package/dist/chunk-index-0q15ysrb.js +1 -0
- package/dist/chunk-index-0xj30mzw.js +13 -0
- package/dist/{chunk-index-rhtvcbsq.js → chunk-index-1f0j335v.js} +2 -2
- package/dist/chunk-index-2f5nfekb.js +8 -0
- package/dist/chunk-index-31ays46f.js +2 -0
- package/dist/chunk-index-43k1rjmx.js +2 -0
- package/dist/chunk-index-4gk88a0x.js +4 -0
- package/dist/chunk-index-4jf4jvfd.css +1 -0
- package/dist/chunk-index-4mf29sbx.js +2 -0
- package/dist/chunk-index-51n20yhb.js +2 -0
- package/dist/{chunk-index-014rjv9k.js → chunk-index-6tpr6r6d.js} +2 -2
- package/dist/{chunk-index-e5sd30xy.js → chunk-index-7bbqtdce.js} +2 -2
- package/dist/chunk-index-84v7j6vh.js +50 -0
- package/dist/chunk-index-8f9jer8r.js +2 -0
- package/dist/chunk-index-91z3g774.js +1 -0
- package/dist/{chunk-index-dhpt8qr9.js → chunk-index-934zgd18.js} +2 -2
- package/dist/{chunk-index-awx6nnta.js → chunk-index-9nents16.js} +2 -2
- package/dist/chunk-index-9w0sar6s.js +2 -0
- package/dist/chunk-index-a768zmp6.js +2 -0
- package/dist/{chunk-index-nqfkwkfp.js → chunk-index-b7jjca66.js} +2 -2
- package/dist/chunk-index-c5x70d9g.js +2 -0
- package/dist/chunk-index-cmxs5y22.js +42 -0
- package/dist/chunk-index-cwc1vvpw.js +2 -0
- package/dist/chunk-index-d85x96q0.js +2 -0
- package/dist/chunk-index-datrrs6b.js +2 -0
- package/dist/chunk-index-dep2e3f3.js +2 -0
- package/dist/chunk-index-dtste2ed.js +2 -0
- package/dist/chunk-index-ewj52be9.js +2 -0
- package/dist/{chunk-index-pcfhpm8v.js → chunk-index-f3b5nch2.js} +142 -18
- package/dist/{chunk-index-km40bhsz.js → chunk-index-frwa2fmc.js} +2 -2
- package/dist/chunk-index-grkczq2c.js +2 -0
- package/dist/chunk-index-gzvkpe3e.js +2 -0
- package/dist/chunk-index-kfv996qe.js +920 -0
- package/dist/chunk-index-kw85ajap.js +138 -0
- package/dist/chunk-index-satam151.js +2 -0
- package/dist/{chunk-index-y8rnq8zf.js → chunk-index-smw1n2pt.js} +5 -5
- package/dist/chunk-index-th43f690.js +2 -0
- package/dist/chunk-index-ths2hxpe.js +1 -0
- package/dist/{chunk-index-wnjp6wv0.js → chunk-index-tmx30r1w.js} +2 -2
- package/dist/{chunk-index-hssjbr1k.js → chunk-index-y00wke93.js} +2 -2
- package/dist/chunk-index-y4sqmenv.js +2 -0
- package/dist/{chunk-index-66nskrdj.js → chunk-index-yrhbhmxz.js} +2 -2
- package/dist/chunk-index-zd76pr2k.js +2 -0
- package/dist/chunk-lang-css-fa7c0zfj.js +1 -0
- package/dist/{chunk-lang-dockerfile-hrav55t7.js → chunk-lang-dockerfile-46rk929v.js} +1 -1
- package/dist/{chunk-lang-go-x9ahv6e5.js → chunk-lang-go-qb0qdpg7.js} +3 -3
- package/dist/chunk-lang-html-47mf2y0v.js +1 -0
- package/dist/chunk-lang-javascript-d32qrvxz.js +1 -0
- package/dist/{chunk-lang-json-hsemyd0r.js → chunk-lang-json-1q4fp694.js} +1 -1
- package/dist/{chunk-lang-markdown-zkwb4c9n.js → chunk-lang-markdown-5w7t28wa.js} +4 -4
- package/dist/{chunk-lang-python-tewx7006.js → chunk-lang-python-3dq0p4rf.js} +2 -2
- package/dist/{chunk-lang-rust-0ydx84s1.js → chunk-lang-rust-70pa0agr.js} +1 -1
- package/dist/{chunk-lang-shell-gq1tmdz4.js → chunk-lang-shell-4pxt7hf4.js} +1 -1
- package/dist/{chunk-lang-sql-xt1qyycg.js → chunk-lang-sql-kgcbh2a9.js} +2 -2
- package/dist/{chunk-lang-toml-0hamc5fc.js → chunk-lang-toml-99t95pab.js} +1 -1
- package/dist/chunk-lang-typescript-4k1d8z7s.js +1 -0
- package/dist/{chunk-lang-xml-wf6h5pt2.js → chunk-lang-xml-mnbv9yfa.js} +1 -1
- package/dist/{chunk-lang-yaml-7vk521h1.js → chunk-lang-yaml-2by9g1dy.js} +1 -1
- package/dist/chunk-layout-actions-cgghzj1w.js +1 -0
- package/dist/chunk-menu-items-24cfwawa.js +2 -0
- package/dist/chunk-mode-toggle-v4baz3r1.js +1 -0
- package/dist/chunk-note-row-72n6cqyk.js +75 -0
- package/dist/chunk-notes-83s3tsey.js +1 -0
- package/dist/chunk-notice-bell-a4ty5h1p.js +1 -0
- package/dist/chunk-notices-evny44be.js +1 -0
- package/dist/chunk-onboarding-q1avjbrx.js +1 -0
- package/dist/chunk-overview-42h45ehd.js +1 -0
- package/dist/chunk-palette-e44qepmh.js +1 -0
- package/dist/chunk-placement-items-v466t0sv.js +1 -0
- package/dist/chunk-profile-bqcgkgk4.js +1 -0
- package/dist/chunk-prompt-history-hgbtcn4b.js +1 -0
- package/dist/chunk-prompts-czs8y6r1.js +1 -0
- package/dist/chunk-room-confirms-h8cdj3ng.js +1 -0
- package/dist/chunk-room-menu-7s0feajw.js +1 -0
- package/dist/chunk-rooms-menu-button-gawqvpsr.js +1 -0
- package/dist/{chunk-schedules-2ft6xxyw.js → chunk-schedules-zba7krac.js} +1 -1
- package/dist/{chunk-seat-menu-d3npdtx1.js → chunk-seat-menu-ca5p4e9q.js} +1 -1
- package/dist/chunk-sheet-hosts-ssbz6hf2.js +1 -0
- package/dist/chunk-skill-editor-n0y9pd90.js +8 -0
- package/dist/chunk-skills-ea4vb2s4.js +1 -0
- package/dist/chunk-switcher-list-pj5csqr9.js +1 -0
- package/dist/chunk-tab-dot-4tkpxqeh.js +1 -0
- package/dist/chunk-table-j8nmtdnn.js +1 -0
- package/dist/chunk-table-seats-qeytqe0m.js +1 -0
- package/dist/chunk-table2d-18y029k9.js +1 -0
- package/dist/chunk-table3d-q2s31ae0.js +4220 -0
- package/dist/chunk-thread-actions-w3eadnh7.js +1 -0
- package/dist/chunk-thread-cards-fbpky3c9.js +1 -0
- package/dist/chunk-thread-list-pghe84be.js +1 -0
- package/dist/chunk-transcript-eqzxgqys.js +1 -0
- package/dist/chunk-where-ygyr4jdj.js +1 -0
- package/dist/chunk-workspace-h0p32ygy.js +578 -0
- package/dist/chunk-zh-tw-k6xx1hp2.js +1 -0
- package/dist/index.html +1 -2
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +63 -3
- package/src/app/api-http.ts +1 -1
- package/src/app/app.ts +5 -0
- package/src/app/room-log.ts +16 -4
- package/src/app/rooms.ts +39 -0
- package/src/app/routes.ts +96 -2
- package/src/app/socket.ts +45 -9
- package/src/app/surface-threads.ts +1 -1
- package/src/app/surface.ts +2 -1
- package/src/app/threads.ts +51 -2
- package/src/auth/authenticator.ts +18 -5
- package/src/auth/login-page.ts +4 -2
- package/src/auth/oidc-pages.ts +2 -0
- package/src/auth/oidc.ts +39 -1
- package/src/auth/sessions.ts +10 -3
- package/src/authz.ts +2 -1
- package/src/console-server.ts +32 -6
- package/src/host/cards.ts +18 -5
- package/src/host/context.ts +72 -25
- package/src/host/forms.ts +3 -0
- package/src/host/frames.ts +8 -1
- package/src/host/host-app.ts +6 -4
- package/src/host/host-routes.ts +36 -3
- package/src/host/room-views.ts +6 -6
- package/src/host/rooms-service.ts +16 -1
- package/src/host/views.ts +3 -0
- package/src/i18n/zh-tw.ts +103 -79
- package/src/index.ts +15 -1
- package/src/options.ts +37 -1
- package/src/page-presentation.ts +47 -2
- package/src/pwa.ts +32 -4
- package/src/web-app.ts +47 -3
- package/src/web-plugin.ts +32 -10
- package/dist/chunk-account-hw49gd0d.js +0 -1
- package/dist/chunk-action-menu-rm5cyqkj.js +0 -1
- package/dist/chunk-agent-b017vswv.js +0 -1
- package/dist/chunk-arranged-rooms-q5v3dm1r.js +0 -1
- package/dist/chunk-character-creator-5dxcvd16.js +0 -1
- package/dist/chunk-codeeditor-pyt09fwg.js +0 -2
- package/dist/chunk-confirm-521yqmta.js +0 -1
- package/dist/chunk-connectors-hrm06nx8.js +0 -1
- package/dist/chunk-conversations-e26rrf01.js +0 -1
- package/dist/chunk-entry-jxxb3ath.js +0 -1
- package/dist/chunk-folder-list-b97xk12b.js +0 -1
- package/dist/chunk-folds-b8q7eags.js +0 -1
- package/dist/chunk-group-scene-dx6wt19m.js +0 -1
- package/dist/chunk-group-table-e4jr8r3a.js +0 -1
- package/dist/chunk-host-state-g7e7c0k5.js +0 -1
- package/dist/chunk-host-ui-x7k6n07v.js +0 -939
- package/dist/chunk-index-2d0kg096.js +0 -2
- package/dist/chunk-index-2qd81wbx.js +0 -2
- package/dist/chunk-index-2stynxw6.css +0 -1
- package/dist/chunk-index-459drsft.js +0 -2
- package/dist/chunk-index-4mfj596y.js +0 -2
- package/dist/chunk-index-bbsytycb.js +0 -2
- package/dist/chunk-index-c07p8k0x.js +0 -4
- package/dist/chunk-index-cq1e9xdz.js +0 -2
- package/dist/chunk-index-d1prgfbp.js +0 -2
- package/dist/chunk-index-g351921r.js +0 -1
- package/dist/chunk-index-k2qq1gdj.js +0 -2
- package/dist/chunk-index-ke9ynm0n.js +0 -2
- package/dist/chunk-index-kpscvg85.js +0 -2
- package/dist/chunk-index-m0d100mg.js +0 -2
- package/dist/chunk-index-mb72snk9.js +0 -2
- package/dist/chunk-index-mjqqver5.js +0 -4
- package/dist/chunk-index-nwqk447w.js +0 -2
- package/dist/chunk-index-q8h8xzbm.js +0 -2
- package/dist/chunk-index-r5vszgfs.js +0 -2
- package/dist/chunk-index-rjv7vrwd.js +0 -13
- package/dist/chunk-index-v23m38p6.js +0 -50
- package/dist/chunk-index-va0g7d88.js +0 -1
- package/dist/chunk-index-xgkd15n3.js +0 -2
- package/dist/chunk-index-z3k18atc.js +0 -2
- package/dist/chunk-lang-css-6bepqpnx.js +0 -1
- package/dist/chunk-lang-html-8jc72zt4.js +0 -1
- package/dist/chunk-lang-javascript-2p2qtbnf.js +0 -1
- package/dist/chunk-lang-typescript-82xf7z2e.js +0 -1
- package/dist/chunk-layout-actions-zh7bezk7.js +0 -1
- package/dist/chunk-menu-items-1n9qargb.js +0 -2
- package/dist/chunk-notes-t15bh04m.js +0 -1
- package/dist/chunk-notice-bell-w3y0h0sr.js +0 -1
- package/dist/chunk-notices-fa3g7qze.js +0 -1
- package/dist/chunk-onboarding-34v3nr17.js +0 -1
- package/dist/chunk-overview-km5vq375.js +0 -1
- package/dist/chunk-palette-a8txdgd0.js +0 -1
- package/dist/chunk-placement-items-wgaxsbvs.js +0 -1
- package/dist/chunk-profile-ypxdbsk1.js +0 -1
- package/dist/chunk-prompt-history-wm9dsy6s.js +0 -1
- package/dist/chunk-prompts-7mhhq7zs.js +0 -1
- package/dist/chunk-room-confirms-t11a1gsw.js +0 -1
- package/dist/chunk-room-menu-2tm2xtfx.js +0 -1
- package/dist/chunk-rooms-menu-button-wxnsxjwc.js +0 -1
- package/dist/chunk-sheet-hosts-vngvp7wv.js +0 -1
- package/dist/chunk-skill-editor-65n2hsq4.js +0 -8
- package/dist/chunk-skills-shkdwes8.js +0 -1
- package/dist/chunk-switcher-list-g6hhmr1t.js +0 -1
- package/dist/chunk-table-1b6bsq2y.js +0 -1
- package/dist/chunk-table-seats-vy1qhdks.js +0 -1
- package/dist/chunk-table2d-n26b7gd0.js +0 -1
- package/dist/chunk-table3d-8aysyf56.js +0 -4220
- package/dist/chunk-transcript-355faceq.js +0 -1
- package/dist/chunk-where-j5qdt8a4.js +0 -1
- package/dist/chunk-workspace-vrbs6zx1.js +0 -1
- package/dist/chunk-zh-tw-zeg600bk.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,56 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.26.2] - 2026-10-30
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Opening a room from a seat of the round table is a dive: the view zooms toward the seat that was tapped, creeping at first and then rushing in (`cubic-bezier(0.7, 0, 0.84, 0)`, about 380 ms), and the room settles in already at full size, with no blank frame. A mouse click, a tap and a key press on a seat all do it, and the camera of the 3D table dives into a seat from the whole ring the same way. It uses transform and opacity only, a second tap during the zoom is dropped, Back or leaving the table mid-zoom gives the view back and opens nothing, and `prefers-reduced-motion: reduce` switches at once. The code is part of the round table's lazy chunk, not the first load.
|
|
13
|
+
- Dispatch threads in the room list are cards: the title, the room's knight, an in-progress or finished badge, the time and the unread count, with a going-on thread tinted and a finished one at rest. Swiping a finished card to the right clears it (the card slides out, the list closes the gap, and a notice offers Undo for five seconds); a going-on card gives a little and springs back. Holding a card or right-clicking it, or the menu button on a finished one, opens a menu with "Clear this thread" and "Clear all finished"; Delete on a focused finished card clears it, and "Clear finished" in the header of the finished threads clears them all, asking first with the count when there are more than five. Reduced motion skips the slide. The undo is two new owner routes, `POST api/rooms/<thread>/undismiss` and `POST api/rooms/<room>/undismiss-threads` (body `{ "threads": [<keys>] }`, at most 100 keys under that room), which put dismissed threads back on the list for every owner.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- The page's word for an agent is now "Knight" in every look: lists, sheets, menus, the table, notifications and the server's refusals. The main agent is the "main knight". The model picker's "Follow the assistant" row is "Default model", and the sheet shows the model it resolves to when it knows it. Agents over MCP outside Discord are "Outside AI clients", and the agent server is the "Bot server". Text only: identifiers, API fields and configuration keys are unchanged.
|
|
18
|
+
|
|
19
|
+
## [0.26.1] - 2026-10-30
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- `HostCard.keep`: a card the host still wants (a ticket's pinned card while the ticket is open) survives its kind's `retention.textDays` sweep for as long as `card` or `updateCard` passes `keep: true`; `updateCard` without it makes the card ordinary again. Adds the migration `web-host-cards-keep` (a `keep` column).
|
|
24
|
+
- `WebApp.rooms.context(room, { limit?, messageChars? })`: a host room's recent messages as the channel-context block `CHANNEL_CONTEXT.read` gives a turn, for a host that starts a turn from a room's `send` hook and has no addressing message. It marks nothing handed over, so a retry reads the same.
|
|
25
|
+
- `auth.onSessionVerified(principalId)` for `oidc`: called when a request or an open socket proves a live session, at most once per session every five minutes, so a host can count a person who only has the app open as present. It is not awaited; an error it throws is logged and never fails the request.
|
|
26
|
+
- Typing `@AI` as the first word of the box works as the toggle, in a host room that offers both ways and in an agent or group room that offers the `@AI` switch for notes. The word counts in any case when a space, a colon, a comma or the end of the text follows it. While it is there the switch shows on and locked, and it returns to the person's own setting when the token is deleted; the page sends the message with an explicit `mode: "turn"` and cuts the leading token (and the space, colon or comma after it) from the text. Only typing counts: `@AI` later in the text, inside an address such as `a@ai.com` or a word such as `@AIX`, in pasted or dropped text, in a restored draft or in a quote is plain text and the message goes as the switch says. This is the page's shorthand only; the server never reads a message's text for it, so a `note` frame whose text starts with `@AI` stays a note, and only an explicit `mode: "turn"` from a viewer who may send turns starts one. `Composer.onSend` gets a third argument, whether the person addressed the agent, and `Composer` takes `onAddressed`; `ModeToggle` takes `locked`. Rooms without the switch are unchanged.
|
|
27
|
+
- Internal notes in an agent or group room: an agent or group room that more than one person reads (the host has more than one owner) gets an `@AI` switch on the composer, on by default. Off, the message is an internal note: it is stored in the room's log with its author, shown live to every other owner and in the history with the author's name and picture and an "Internal note" marker (zh-TW has its own wording), and never given to the agent: no turn runs, it is not in the agent's session, and it is not in any channel context. The server says which rooms take notes: `RoomView.notes` is `true` on the agent and group rooms of a host with more than one owner, absent otherwise, so the page does not guess. A note is a `send` frame with `mode: "note"` (the frame the host rooms already use); a stored note carries `RoomMessage.note: true` (additive column `web_room_messages.note`, migration `web-room-messages-note`). A host with one owner behaves exactly as before: no switch, no new field in the room list or the history, and a `note` frame is still refused as `bad_frame`. The fixture takes `FIXTURE_OWNERS=2` to try it with Ada and Bob.
|
|
28
|
+
- The package entry exports the host-facing API: `WEB_APP` and the types `WebApp`, `HostRoomKind`, `HostPage`, `HostCard`, `Viewer`, `OpenTarget`, `ActionResult`, `LinkProver`, `OnboardingStep` and `Notices`, so a host plugin no longer mirrors them.
|
|
29
|
+
- The `description` option, and `<meta name="description">`, `og:title`, `og:description` and `og:image` on the page, so a search result and a link preview have a title, a line and the mark. Without `description` a line is derived from `title`.
|
|
30
|
+
- `<mount>/icons/mark.svg`, the round-table mark.
|
|
31
|
+
- The tab shows a small red dot on its icon, top-right with a white ring, while anything waits (cards waiting, notices, unread messages), and the title leads with `(N) `. The dotted icon is drawn in the browser from the page's own icon, so a host's `icons.dir` keeps its look; Safari ignores a changed tab icon, so there the title's count is the signal. It is a lazy chunk that loads after the first paint. Unread messages now count in the title too, not only cards.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- README and the `Notices.raise` doc: a notice's `tag` is the dedupe key, the push tag and the acknowledgement key, visible to the people the notice is for; put no private id in it.
|
|
36
|
+
- A host may name the `table` pane for a member or an admin (`panes: { owner, admin?, member }`, with that tier's `rooms` pane too; the default lists still leave it out). Their table seats the host rooms their kinds let them list, newest first, not agents: the agent rooms stay the owners'. A seat is lit by its room's own `activity` and cards, which reach a socket only for a room the person may read now, and a tap opens the room's page, where the kind's `access` decides what they may write and press. There is no dialogue box, seat menu or "Who's at the table" sheet for them, and no new route. `overview`, `workspace`, `skills` and `connectors` stay owners-only. The owners' table is unchanged.
|
|
37
|
+
- Following a host room now also sends the follower the room's `activity` frame when a turn is already running, so a seat does not wait for the next change to show it.
|
|
38
|
+
- `HostRoomKind.buttons` may return a promise, for a host whose rights source is async.
|
|
39
|
+
- README: `WebApp.rooms`, `.notices`, `.pages`, `.onboarding` and `.push` throw until the plugin started; `notices.onAck` is available only after start.
|
|
40
|
+
- An ordinary folder is a light section header (chevron, name, count, ⋯), left-aligned like the Home and Pinned labels, not the boxed grey card, which stays for the archive. A folded folder shows a small overlapping stack of the pictures of its first four rooms and, when it holds more, how many more (`+2`).
|
|
41
|
+
- An owner can take a finished dispatch thread off the room list: a remove button on each finished row, and "Clear all" in the fold of a room's finished threads. The thread leaves the list for every owner and every open page at once; it is hidden, not deleted, and stays readable by its address and through the links in its room. An open thread cannot be removed (409). The mark is the new column `web_threads.dismissed_at` (migration `web-threads-dismissed`, additive). Routes: `POST api/rooms/<thread>/dismiss`, `POST api/rooms/<room>/dismiss-threads`, and `GET api/rooms/<thread>` for the view of a thread the list does not carry (owners only, like the rest of `api/rooms`).
|
|
42
|
+
- `HostPage.icon` and `HostRoomKind.icon`: an optional name from the console's own icon set (`HOST_ICONS`, type `HostIconName`, exported): `chat`, `link`, `activity`, `users`, `megaphone`, `qr`, `settings`, `bell`, `file`, `list`, `shield`, `lock`, `sparkle`. A page's icon shows in the navigation (the list icon stays the default), a kind's beside its section in the room list. A name outside the set is dropped and the default shows. `ConfigView.pages[].icon` and `.kinds[].icon` carry it. The new glyphs load only when a page names one.
|
|
43
|
+
- A host room where a viewer may send both a note and a turn shows one `@AI` toggle over the composer's bar instead of the two chips "Note" and "Ask the agent": off sends a note for the room's people only, on sends a turn the agent answers, and the box's hint follows ("Write an internal note…" / "Ask AI…", never naming the room as a recipient, in every shipped locale). The toggle stands in the composer's column (it sat at the pane's edge on a wide screen) and is at least 44 px high. A room open to one way only shows that way's hint and no toggle. `Composer` takes `placeholder` and `above`, and `ModeToggle` is a piece of its own, for any room that offers the choice.
|
|
44
|
+
- `HostRoomKind.sendWording`: a kind may word the toggle (`turn.label`) and each way's hint (`note.placeholder`, `turn.placeholder`); text only, a label cut to 40 characters and a placeholder to 100. `HostRoomView.wording` carries it.
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Without a session only the icons the page, the manifest and the sign-in pages link answer (`192.png`, `512.png`, `maskable-512.png`, `apple-180.png`, `badge-96.png`, `mark.svg`, `mark-maskable.svg`); another file a host keeps in `icons.dir` stays behind the sign-in.
|
|
49
|
+
- In an agent or group room that more than one owner reads, every owner message was drawn as the viewer's own (right-aligned, accent bubble), so Bob saw Ada's messages as his. A message is the viewer's own only when its author's principal (`RoomMessage.principalId`, which the server already stores and sends on owner messages) is the viewer's; another owner's message is drawn as someone else's, with that person's name and picture, as in host rooms. A message stored without a principal is the viewer's only where one owner reads the room; where several do, it is drawn as an owner nobody can name, never as the viewer's. A room one owner reads draws exactly as before.
|
|
50
|
+
- A folder's header no longer turns into an unreadable light fill with white text when the pointer rests on it (on a phone the highlight stuck after a tap), and its title is left-aligned, not centered. The base rule `button:hover:not(:disabled)` out-specified the header's own style; its hover, press and keyboard focus now tint the label and keep its text colour in every look and scheme.
|
|
51
|
+
- A row of the room list that is held and dragged on an iPhone now lifts and reorders. iOS Safari lets a page stop a finger's scroll only if a non-passive `touchmove` listener existed when the finger went down; the lift added its own after the hold, so the first move scrolled the page and the browser cancelled the drag. While a row that can be lifted is on the page, a no-op non-passive `touchmove` listener is now held.
|
|
52
|
+
- The plain room list (no pin and no folder yet) keeps Agents and Groups by latest activity, as the arranged list and the drawer do. Before, it kept the order the server listed them in, so a room you had just talked to did not move up, even after a reload.
|
|
53
|
+
- Under path routing the manifest and the home-screen icon links come after the page's base, so a page opened at a room's URL (`<mount>/room/<key>`) still finds them.
|
|
54
|
+
- The page now has a tab icon: the round-table mark, linked as `rel="icon"` on the app, the sign-in page and the sign-in flow's pages, so a browser no longer asks the site root for `/favicon.ico` and gets a 404. A host's own `icons.dir` is kept (add a `mark.svg` to it to replace the SVG too).
|
|
55
|
+
- The manifest and the icons answer without a session in `oidc` and `password` mode, so the sign-in page and a link preview have an icon. They were redirected to the sign-in. Nothing else below the mount is open.
|
|
56
|
+
- The served page carries the host's `title` in `<title>` from the first byte; it said `Console` until the script ran.
|
|
57
|
+
|
|
8
58
|
## [0.26.0] - 2026-10-30
|
|
9
59
|
|
|
10
60
|
The core peer range is now `>=0.26.0 <0.27.0`.
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ The plugin is a chat surface of its own (`app`), so a team of agents can live in
|
|
|
11
11
|
- **Cards.** Approvals, questions, questionnaires and the card at a turn's time limit appear in the room, and any owner's device can answer them.
|
|
12
12
|
- **Modes.** Yolo mode approves the held actions a rule allows without asking; long-running mode lets a turn go past its time limit. Each is a switch per room, and a banner shows while one is on.
|
|
13
13
|
- **An app.** A web app manifest, a service worker and Web Push make it installable and let a card wake the phone.
|
|
14
|
-
- **Files.** The owner browses the
|
|
14
|
+
- **Files.** The owner browses the knights' workspace, reads files with syntax highlighting, and edits, creates, renames and deletes them (to a restorable trash), with a check on every save that a knight did not change the file meanwhile.
|
|
15
15
|
- **Looks.** Agents are drawn as characters; the page has a Modern and a Camelot look, light and dark, and a round table that seats the whole team.
|
|
16
16
|
|
|
17
17
|
Who may enter is the host's `access` configuration plus an authentication mode you choose: `none`, `password` or `verifier` (see [Authentication](#authentication)), and the plugin refuses to start without one.
|
|
@@ -109,7 +109,7 @@ The page is built for a phone first: a bottom tab bar under 720 px, a side rail
|
|
|
109
109
|
| **Rooms** | Home first, then the pinned rooms, the owners' folders and the rest by latest activity, each with its dispatch threads, with badges for working, a card waiting, yolo and long-running (see [Pins and folders](#pins-and-folders)). |
|
|
110
110
|
| **A room** | Each message with its author's picture and name, Markdown (raw HTML is shown as text), files, and a live progress strip with the streamed text and tool chips. A sticky composer with upload and Stop. The header menu holds the mode switches, Profile and Start over. |
|
|
111
111
|
| **Cards** | Inline in the room: an approval with the call's details and a copy button; a question with options, an "Other" field and Cancel; a questionnaire; and the card at a turn's time limit. Answered cards show the answer given. |
|
|
112
|
-
| **
|
|
112
|
+
| **Knight sheet** | Display name, prompt (with its History), model and thinking level, the skills it carries, Notifications, the character creator (see [Characters in the page](#characters-in-the-page)) and Archive. See [Making and arranging agents](#making-and-arranging-agents). |
|
|
113
113
|
| **Schedules** | Every schedule of the team, labelled by room or channel, with a confirmed cancel. |
|
|
114
114
|
| **Table** | The round table (see [The round table](#the-round-table)). |
|
|
115
115
|
| **Files** | The agents' workspace: a tree, highlighted files and an editor (see [The files pane](#the-files-pane)). |
|
|
@@ -149,12 +149,14 @@ The app hosts the core's dispatch threads (`ChatSurface.threads`). A background
|
|
|
149
149
|
|
|
150
150
|
A thread's room is read only: a `send` to it is refused with `read_only`, and it has no modes. Its cards are the dispatch's own, such as a coding job's approvals, and any owner answers them there as in any room. Agents post in it under their own names. A closed thread stays readable (the list keeps the 30 newest closed ones), and the host closes the threads a restart left open, with a restart notice. `GET api/rooms` lists a thread with `parent` and, once closed, `closed: true`; opening and closing one sends `changed`.
|
|
151
151
|
|
|
152
|
+
Each thread is a card in that list: its title, its room's knight, a badge (in progress or finished), the time of its last post and its unread count. A going-on thread wears its knight's tint and a finished one rests. An owner clears a finished thread off the list by swiping its card to the right (the card slides out, the list closes the gap, and a notice offers Undo for five seconds), by pressing the menu button on the card, by holding it or right-clicking it (**Clear this thread**, **Clear all finished**), or with Delete on a focused card; **Clear finished** in the header of the finished threads does the same for all of them, after a question with the count when there are more than five. A going-on thread does not swipe: the card gives a little and springs back. Clearing hides a thread and does not delete it: it leaves the list for every owner and every open page at once, and stays readable by its address and through the links in its room. The routes are `POST api/rooms/<thread>/dismiss` (409 while the thread is open), `POST api/rooms/<room>/dismiss-threads` (every finished thread of the room), their undos `POST api/rooms/<thread>/undismiss` and `POST api/rooms/<room>/undismiss-threads` (body `{ "threads": [<keys>] }`, at most 100, those that hang under the room), and `GET api/rooms/<thread>` for the view of a thread the list does not carry. All of them are the owners' like the rest of `api/rooms`.
|
|
153
|
+
|
|
152
154
|
|
|
153
155
|
### Making and arranging agents
|
|
154
156
|
|
|
155
157
|
An owner changes the team from the app. Everything goes through the agent server's own operations (`AgentTeam`), the ones the `agent_create`, `archive` and `group_*` tools use, so an agent made here is the one an agent would make, and an archived one is the one the `archive` tool leaves.
|
|
156
158
|
|
|
157
|
-
- **New
|
|
159
|
+
- **New knight.** The **+** button of the room list and of the drawer opens a menu with New knight, New group and Archived. New knight asks for a name, the permanent name (lowercase letters, digits and dashes, which names the room and cannot be changed; it follows the name until typed by hand), the prompt, a model, an optional opening task and a look. The look is the one its role suggests until the creator picks another. On success the new agent's room opens. A bad or taken name, an unusable model, a bad look and an unknown skill are refused with the bot server's words before anything is made.
|
|
158
160
|
- **Archive and restore.** Archive is in the agent sheet and in the ⋯ menu and long-press menu of a room (the coordinator's room has none). It asks first, naming the agent or group. An archived agent stops answering, its schedules are cancelled and it leaves its groups; its history is kept. **Archived** in the **+** menu lists what is archived with Restore and Delete. Restoring an agent does not put it back in its groups; restoring a group needs all its members active, otherwise it is refused and stays archived.
|
|
159
161
|
- **Delete.** Only an archived agent or group can be deleted, from the archive, after a question that names it. Deleting frees the name, removes the agent's group cursors and detaches its skills, and clears what this app kept of the room (its messages, its cards, its mute and its modes). A Discord channel, if the agent had one, stays under Archive with its history, since Discord is never asked to delete a channel.
|
|
160
162
|
- **Skills.** The agent sheet lists the host's skills (the Skills pane's catalog when the host supplies it, else the skills addon's own) with a switch each, applied as it is flipped and from the agent's next turn. Built-in skills are carried by every agent and stay on. A host without the skills addon shows nothing.
|
|
@@ -178,7 +180,7 @@ The owners arrange the room list together: one layout for the whole app, kept on
|
|
|
178
180
|
| Where | What it does |
|
|
179
181
|
|---|---|
|
|
180
182
|
| A room's menu (long press, right click, or the Menu key; the **⋯** beside a row in arrange mode; or the **⋯** in the room's header) | **Pin** or **Unpin**, **Move to folder…** (a sheet with the folders, Ungrouped and **New folder…**), and **Move up** or **Move down** within the pinned list or the folder. |
|
|
181
|
-
| A folder's header | Fold or unfold it (kept per device in `localStorage`, `roundtable-console:folders-collapsed`; the folder that holds the open room shows open, and a folded folder still shows its rooms' waiting cards and working dots). Its **⋯** (or a long press, right click or the Menu key) offers **Rename**, **Mute the whole folder** or **Unmute the whole folder**, **Move up**, **Move down** and **Delete folder** (after a question; its rooms move to Ungrouped, no room is deleted). A bell-slash shows when every room in it is muted, a fainter one when some are. |
|
|
183
|
+
| A folder's header | A light section header (chevron, name, count, ⋯). Fold or unfold it (kept per device in `localStorage`, `roundtable-console:folders-collapsed`; the folder that holds the open room shows open, and a folded folder still shows a small stack of its rooms' pictures, then how many more, and its rooms' waiting cards and working dots). Its **⋯** (or a long press, right click or the Menu key) offers **Rename**, **Mute the whole folder** or **Unmute the whole folder**, **Move up**, **Move down** and **Delete folder** (after a question; its rooms move to Ungrouped, no room is deleted). A bell-slash shows when every room in it is muted, a fainter one when some are. |
|
|
182
184
|
| The list's **⋯** | **Add a folder**, and **Arrange**, which shows a **⋯** beside every row and a bar to add a folder until **Done**. |
|
|
183
185
|
| A room row or a folder header, held or dragged | A finger that rests on a row lifts it (a short vibration where the phone has one); dragging then reorders it within its list, moves it into another folder, the pinned list or Ungrouped, and a folded folder opens after the finger rests on it. A held folder header moves the whole folder among the folders. The rows make room as you drag, the list scrolls near its edges, the place it lands is outlined, and Escape or a drop outside every list puts everything back. Letting go without moving opens the row's menu as before. A mouse lifts a row once it moves with the button down. A touch within 32 px of a screen edge never lifts a row (the system keeps that edge), so the menu is the way there. While a row is lifted the lists keep their order, so a message that arrives does not move rows under the finger, and the pinned list and empty folders show as places to drop even when they hold nothing yet. On Android the browser's own long press (its `contextmenu`, at about 400 ms) counts as the hold. Ungrouped is ordered by activity, so a row dragged within it goes back; pin it or put it in a folder to place it. The lift code is a chunk of its own that loads on the first press. |
|
|
184
186
|
|
|
@@ -222,6 +224,10 @@ Every agent is drawn as its composed character (`pi-roundtable/characters`). The
|
|
|
222
224
|
|
|
223
225
|
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each active agent whose room is not muted (the coordinator first) and one low lip at the near edge for you, under torches, banners and a stained-glass window, around a glowing rune circle. The hall is drawn in the characters' own flat, outlined style (a stepped tone gradient and a dark line round every shape, no photographic textures). Dark is the hall at night, light the same hall by day; the Modern and Camelot looks change the banners and the trim, not the hall. Each agent stands behind its podium as a waist-up standee: the character without its frame, cut out with a thin light rim, a dark line and a visible board thickness, turning to the camera within limits. A seat's state comes from the same rules as the room list (`sleepy` sits as `idle`): a thinking seat shows a "…" badge and bobs, a seat with a card waiting a gold "!", a speaking seat has a light on its podium and the concept art's three gold emphasis strokes beside its head; a change of face redraws that one picture once it has stood for 300 ms. More than twelve agents show twelve and a "+N" podium that opens the list.
|
|
224
226
|
|
|
227
|
+
If the host has kinds of room the owner may list (for example a support desk's ticket rooms), the owners' table seats those host rooms too, after the agents and newest first, by the same lists and `access` as the member table below; a tap on such a seat opens the room's own page. A host with no host room kinds seats agents only.
|
|
228
|
+
|
|
229
|
+
This section describes the owners' table. A member or an admin is served the table only when the host names it for their tier, and theirs seats host rooms instead of agents: see [What each tier is served](#what-each-tier-is-served).
|
|
230
|
+
|
|
225
231
|
- **Cameras.** The overview stands behind your podium, raised. A drag or swipe turns it round the ring and snaps to a podium; the wheel or a pinch moves in on the podium across the ring and back out. A close-up of a speaker stands low inside the ring, tilted a little, with thin speed lines flashing for 400 ms on a new speaker. A turn follows the ring the shorter way and takes 450 to 650 ms. A swipe never starts within 32 px of the screen's edge. Under `prefers-reduced-motion` the camera cuts, with no speed lines, bob or flicker.
|
|
226
232
|
- **Talking in the scene.** A tap on a podium (or on its name, a button over the plate) turns the camera to that agent and slides up a dialogue box on the agent's own room: a nameplate tab in the agent's color with its picture, the line being said (Markdown, typed out while it streams, a tap shows it whole), the cards waiting for an answer, and the room's own message box, with its unsent text kept per room. **Log** opens the room's whole message list as a sheet over the scene. The address is `#/table/<agent>` (the agent's name or the key of its room): Back returns to the whole ring, a link opens the scene at that agent, and an address that names nobody seated goes back to `#/table`.
|
|
227
233
|
- **Names.** A seat's name is a button laid over its podium's nameplate, at least 12 px on the screen at any distance, in a font stack that carries Chinese (`system-ui`, PingFang TC, Noto Sans TC, Microsoft JhengHei); the podium's own plate is lettered the same way. The seat's full name and state are its accessible name. Where the names stand over each other (many seats on a phone) the agents are also listed as buttons under the scene.
|
|
@@ -260,7 +266,7 @@ There is no autocomplete and no auto-closing of brackets, which fight phone keyb
|
|
|
260
266
|
**Saving.** A file is read with its SHA-256 hash, and a save carries it back as `baseHash`.
|
|
261
267
|
The server reads the file again and compares just before it replaces it, and a mismatch answers `409` with the file as it is now and writes nothing; so does a file that was deleted meanwhile.
|
|
262
268
|
The page then opens a dialog: Copy my text, Reload (discard my edits), and Save mine anyway, which asks a second time and then writes with the hash the conflict named.
|
|
263
|
-
While a file is open the page looks at it again on focus and every 5 seconds; in read mode it reloads silently, and in edit mode a banner says a
|
|
269
|
+
While a file is open the page looks at it again on focus and every 5 seconds; in read mode it reloads silently, and in edit mode a banner says a knight is changing the file.
|
|
264
270
|
A save writes a temporary file beside the original, with the original's mode, flushes it, checks again that the directory is still the one inside the root and the file is still a regular file, and renames it over the original.
|
|
265
271
|
It keeps the file's line separator (`\r\n` or `\n`), a leading byte order mark and whether the file ends with a newline.
|
|
266
272
|
A save gives the file a new inode and the server's user as its owner, so a hard link to the old file keeps the old text.
|
|
@@ -316,8 +322,9 @@ A member's socket receives nothing from an agent room, neither as it happens nor
|
|
|
316
322
|
|
|
317
323
|
### What each tier is served
|
|
318
324
|
|
|
319
|
-
`panes` takes a list for the owners and, with `admission: "access"`, `{ owner, admin?, member }` to choose per tier. The default gives a member `rooms` (the host's own rooms only), `conversations`, `notes`, `schedules` and `profile`, of those the host serves; an admin's list is the member's unless given. A member is never served `overview`, `
|
|
325
|
+
`panes` takes a list for the owners and, with `admission: "access"`, `{ owner, admin?, member }` to choose per tier. The default gives a member `rooms` (the host's own rooms only), `conversations`, `notes`, `schedules` and `profile`, of those the host serves; an admin's list is the member's unless given. A member is never served `overview`, `workspace`, `skills` or `connectors`, and naming one for them stops the start. `table` is the one pane whose name a host may give a member or an admin (it needs that tier's `rooms` pane, and the owners' list must have it too): the default lists leave it out, so it is served only where the host names it.
|
|
320
326
|
|
|
327
|
+
- **The round table for members and admins**: the agent rooms are the owners', so a member's or an admin's table seats none of them. It seats the host rooms of every kind they may list (`GET api/host/<kind>`, the same lists and the same kind `access` as their room list, so a room the kind does not give them is no seat), newest first, in the same ring and the same looks. No new route is added: the table asks only for those lists. A seat is lit from its room's own frames, which the page follows by `subscribe` for the seats the scene draws (at most twelve), and a follow is answered only for a room the person may read now: `activity` (thinking, working, a turn already running when they follow) and the cards are addressed to the room's readers, as they are in the room, and a room they may not read sends nothing, however they ask. A room that asks for something in the kind's list (`attention`) sits as waiting. A tap on a seat opens that room's own page, where what the person may write (a note, a turn to the agent, or nothing) and press is decided by the kind's `access` as everywhere else, so the table has no dialogue box, no seat menu and no **Who's at the table** sheet for them (those mute and arrange agent rooms, which are the owners'), and an address `#/table/<seat>` goes back to the whole ring. The "+N" podium opens the room list. The table sends the person nothing of the overview, the files pane, the skills or the presence of the team, and the owners' view is unchanged.
|
|
321
328
|
- **Conversations**: a member lists and reads only the private conversations the registry records as theirs, found by the registry; `exclude(key, record)` is asked on every list and every transcript read.
|
|
322
329
|
- **Notes**: their own only. Asking for another person's is `403`. The pane is left out, with a warning, when the host keeps no memory (`MEMORY`); naming it with none is an error.
|
|
323
330
|
- **Schedules**: their own, whichever of the 0.8 and the current id the schedule names them by; an owner sees every schedule.
|
|
@@ -337,7 +344,9 @@ The app is a progressive web app, installable on a phone, tablet or desktop and
|
|
|
337
344
|
|
|
338
345
|
- `<mount>/manifest.webmanifest` is generated for the mount: its `id`, `start_url` and `scope` are all `<mount>/`, `display` is `standalone`, the name is `title`, and the theme and splash colors follow `appearance.look`. The page links it with `crossorigin="use-credentials"`, so a proxy such as Cloudflare Access that sets a cookie sees it.
|
|
339
346
|
- `<mount>/sw.js` is the service worker, served `no-cache` and scoped to the mount. It precaches the page's hashed assets and `index.html`, serves assets cache-first and navigations network-first with the cached shell as the offline fallback. It never touches `api/`, `auth/`, `login`, `files/` or `avatars/`, and returns a redirect (a proxy's login) as it came. It caches the shell only, never data, so a shared device keeps nothing after you log out. The round table's 3D scene and the files pane's editor and languages are fetched the first time they are needed and are not precached.
|
|
340
|
-
- `<mount>/icons/` serves `192.png`, `512.png`, `maskable-512.png`, `apple-180.png` and `badge-96.png
|
|
347
|
+
- `<mount>/icons/` serves `192.png`, `512.png`, `maskable-512.png`, `apple-180.png` and `badge-96.png`, and `mark.svg`, the round-table mark. The package ships a set; `icons.dir` replaces it with a directory that has the same five PNG names, and `mark.svg` too if it should be the tab icon.
|
|
348
|
+
- The tab icon is the round-table mark by default. The page, the sign-in page and the pages of the sign-in flow link `<mount>/icons/mark.svg` (when the icon directory has it) and `<mount>/icons/192.png` as `rel="icon"`, so the browser does not ask the site root for `/favicon.ico`. The page also carries `og:title`, `og:description` and `og:image` (`<origin><mount>/icons/512.png`) for link previews.
|
|
349
|
+
- The manifest and the icons answer without a session, in every `auth` mode: they are the same for everyone, and a sign-in page and a link preview need them before anyone has signed in. Nothing else below the mount does.
|
|
341
350
|
|
|
342
351
|
To install: open the page over HTTPS in Chrome, Edge or Safari and use the browser's Install option, or press **Install the app** in Settings where the browser offers it.
|
|
343
352
|
On iPhone and iPad use Share, then Add to Home Screen, and open the app from the home screen: iOS allows notifications only to an installed app.
|
|
@@ -379,6 +388,8 @@ Setup:
|
|
|
379
388
|
|
|
380
389
|
A notice is something that waits on one person, such as a customer's message or a card to approve. A host raises one with `Notices.raise({ tag, people, title, open, urgency?, via? })` and takes it back with `Notices.resolve(tag)`; `renotify` adds people to an open one. `open` names exactly where a tap goes: `{ room, message? }` (the room, scrolled to that message) or `{ page, query? }`. A notice appears in the bell, with a count on the app icon where the device allows it, and is pushed according to its `urgency`: a normal one waits in the bell during the person's quiet hours, an urgent one rings and stays on screen until dealt with. `via` narrows a notice to named transports (see `push.transports`).
|
|
381
390
|
|
|
391
|
+
The `tag` is the notice's dedupe key, the tag of its push and the key of its acknowledgement, so it is not secret from the people the notice is for: their browser sees it. Do not put an id that those people should not see in it (a customer's or a group's id); use a hash or a counter of your own instead.
|
|
392
|
+
|
|
382
393
|
Tapping a notification or a bell row opens exactly that room or page, whether the app is open (its window comes forward and goes there) or closed (a new window opens at the address; a signed-out person signs in and lands there). A device reports when a notice arrived and when it was opened, which is how the app knows a test notification reached the device.
|
|
383
394
|
|
|
384
395
|
The profile page (`profile`) shows the person's name, picture and tier, the accounts they linked and the ones they can link or unlink, **Shown as** (which linked account names them in the app, or Automatic), and their own quiet hours with a test notification. An account that the host's configuration links cannot be unlinked there.
|
|
@@ -498,7 +509,9 @@ A verifier may vouch for members as well as owners, through a proxy that lets th
|
|
|
498
509
|
4. The session slides: it ends after `sessionDays` (30) without a visit, and a visit moves the limit at most once an hour. Nothing the provider said is trusted again; the tier is read from `IDENTITY` on every request. Disabling the principal refuses the next request and closes the socket.
|
|
499
510
|
5. Log out deletes the row, so the old cookie is refused afterwards, clears the cookie and, with `endSession`, also signs out at the provider. A person who just logged out is asked, not signed in silently again.
|
|
500
511
|
|
|
501
|
-
`reauthHours` makes the provider vouch again: past it, the next page load does a silent round trip that refreshes the stored facts and roles, a provider that wants the person sends them through a normal sign-in, and a request to the API
|
|
512
|
+
`reauthHours` makes the provider vouch again: past it, the next page load does a silent round trip that refreshes the stored facts and roles, a provider that wants the person sends them through a normal sign-in, and a request to the API on such a session is answered `401` until then. An open socket checks the same limit at its periodic recheck and is closed as signed out, so its page shows sign-in again. `storeClaims` keeps the named `id_token` claims with the session, replaced at each sign-in, for a sender that needs, say, a mailbox address.
|
|
513
|
+
|
|
514
|
+
`onSessionVerified(principalId)` is called when a request or an open socket proves a live session, at most once per session every five minutes. A session past `reauthHours` is not live for this, on either path. Use it to count who is present: a host that keeps a linked chat account only while its web person is active can note the person there, even when they only have the app open and call nothing of the host's. It is not awaited, and an error it throws is logged and never fails the request.
|
|
502
515
|
|
|
503
516
|
### Upgrading from 0.8
|
|
504
517
|
|
|
@@ -676,7 +689,8 @@ Every option is checked when the plugin is created, so a bad setting stops the h
|
|
|
676
689
|
| `push` | on, with an `https` origin | Web Push; its keys are in the table below, and [Notifications](#notifications) describes the whole. |
|
|
677
690
|
| `icons` | the package's own | `{ dir }`: a directory of the five install icons, see [Install on a device](#install-on-a-device). |
|
|
678
691
|
| `appearance` | `{ look: "modern" }` | `{ look }`: `modern` or `camelot`. The page's default look and the manifest's splash colors; the owner can switch it in the app. |
|
|
679
|
-
| `title` | `Roundtable` | The page's heading, title and the installed app's name. |
|
|
692
|
+
| `title` | `Roundtable` | The page's heading, `<title>` (set in the served HTML, so a tab and a search result have it before the script runs), `og:title` and the installed app's name. |
|
|
693
|
+
| `description` | a line derived from `title` | The page's `<meta name="description">` and `og:description`, for search results and link previews. |
|
|
680
694
|
| `presentation` | English | `{ locale, messages }`: locale controls dates and document language, and `zh-TW` also selects the [built-in Traditional Chinese wording](#presentation-and-built-in-zh-tw); English source strings are dictionary keys for labels, descriptions, confirmations, and API errors. |
|
|
681
695
|
| `features` | none | Trusted host integrations, or a factory receiving public plugin setup context; see [Host feature ports](#host-feature-ports). |
|
|
682
696
|
| `relayNotes` | the remote MCP note | Text that an outside agent's relayed message begins with, taken off before the owner's words are shown. Set it to the same value as the `relayNote` of [pi-roundtable-mcp][mcp] when you changed that one. |
|
|
@@ -705,6 +719,7 @@ The `auth` keys:
|
|
|
705
719
|
| `auth.endSession` | `false` | `oidc` only: whether Log out also signs out at the provider. |
|
|
706
720
|
| `auth.reauthHours` | never | `oidc` only: ask the provider again after this many hours of one session. |
|
|
707
721
|
| `auth.storeClaims` | none | `oidc` only: `id_token` claims kept with the session. |
|
|
722
|
+
| `auth.onSessionVerified` | none | `oidc` only: `(principalId) => void`, called when a request or socket proves a live session (once per session per five minutes). |
|
|
708
723
|
|
|
709
724
|
The `push` keys:
|
|
710
725
|
|
|
@@ -832,14 +847,19 @@ app.registerRoomKind({ kind: "inbox", label: "Support inbox", list, access, head
|
|
|
832
847
|
app.registerPage({ id: "mailboxes", label: "Mailboxes", place: "settings", visible, view, act });
|
|
833
848
|
```
|
|
834
849
|
|
|
850
|
+
The host-facing types are exported from the package entry: `WEB_APP`, `WebApp`, `HostRoomKind`, `HostPage`, `HostCard`, `Viewer`, `OpenTarget`, `ActionResult`, `LinkProver`, `OnboardingStep` and `Notices`. Keep the `WebApp` object and read `app.rooms`, `.notices`, `.pages`, `.onboarding` and `.push` when you use them: they throw until the web plugin has started, so copying one in `setup` crashes the boot (`registerRoomKind` and `registerPage` work in `setup`). `notices.onAck` can be attached only after start.
|
|
851
|
+
|
|
835
852
|
A room's key is `<surface>:<kind>.<id>`, with an id of 8 to 64 letters, digits, `-` or `_`. The kind name is lower case and none of `agent`, `group`, `thread` or `home`. Everything is checked when the web service starts.
|
|
836
853
|
|
|
837
854
|
- **Access is the host's, asked every time.** `access(viewer, id)` answers `{ read, send, act }` for each read, frame, send, card answer, upload and file; `undefined` makes the room, its messages and its files a `404` for that person. `send` is `note` (a message for the room's people), `turn` (a message the room's agent answers), both, or neither; `act` lets them press buttons and run actions. `list(viewer, { filter, cursor })` returns the rooms the person may open, and `undefined` hides the kind. `changed(room)` and `accessChanged(principalId)` on `app.rooms` tell the app a header, a list or a person's access may differ.
|
|
838
855
|
- **Who wrote what.** A host posts with `app.rooms.post(room, { author: { kind, name, label?, principalId?, picture? }, text, files?, reference? })`. The author kinds are `external` (someone outside, shown with the host's label such as "Customer"; plain text with links), `member`, `assistant` (an agent partner; Markdown, raw HTML shown as text) and `notice` (a line of the room's own, such as "Assigned to Mel"; Markdown). `reference` is the host's own id, unique per room, and `byReference` finds it again; `edit` and `remove` change a message. An import may give an earlier `at`, kept within retention.
|
|
839
|
-
- **
|
|
856
|
+
- **Recent messages.** `app.rooms.context(room, { limit?, messageChars? })` gives the room's recent messages as the same block `CHANNEL_CONTEXT.read` gives a turn (`{ messages, text }`): what was said since the assistant last posted, the newest `limit` of it (default 15, at most 100), an outsider's words marked `external`, notices left out; `undefined` when there is nothing, and a room that is not one of a registered kind throws. Use it when a turn starts from a room's `send` hook, where no message addressed the assistant. It marks nothing handed over, so a retry of the turn reads the same messages.
|
|
857
|
+
- **Cards.** `app.rooms.card(room, { title, body, tone?, state?, links?, buttons? })` puts a card in the room; `updateCard` replaces it by id. A button calls the kind's `act(viewer, id, { action, card }, input)`; a button may carry a `form` (text, textarea, url, select with `initial` and `search`, multiselect), and its input is checked against the form on the server before `act` runs. `act` answers `{ ok: true, notice?, open?, url? }` or `{ ok: false, error, field? }`; `open` is a room (with a message) or a page (with a query). Buttons show only while the card's `state` is `open`, and `buttons(viewer, id, card)` (sync or async, so it can ask the host's own rights source) may narrow which ones a person sees. A card's `links` are `https` or a path of this origin. Approval and question cards of the room's agent follow the agent's own prompt scope, never `access` or `buttons`.
|
|
858
|
+
- **Writing.** Where a viewer may send both a `note` and a `turn`, the room shows one `@AI` toggle over the composer's bar: off sends a note (for the room's people only), on sends a turn (the agent answers). The box's hint follows the toggle, "Write an internal note…" or "Ask AI…" (the box never names the room as a recipient), and a room remembers the way the person last wrote in. A viewer who may send one way only has no toggle and the hint of that way. A kind words it with `sendWording: { note?: { placeholder }, turn?: { label, placeholder } }`; `turn.label` replaces `@AI` on the toggle. Only text is taken: a label is cut to 40 characters and a placeholder to 100, and a value that is not text is dropped. Typing `@AI` as the first word of the box (any case, followed by a space, a colon, a comma or the end of the text) does the same as turning the toggle on: the toggle shows on, and locked, while the box starts with it and returns to the person's own setting when the token is deleted, and the page sends the message as an explicit `mode: "turn"` with that leading token (and the space, colon or comma after it) cut from the text. Only typing counts: `@AI` later in the text, inside an address such as `a@ai.com` or a longer word, in pasted or dropped text, in a restored draft or in a quote is plain text and the message stays as the toggle says. The same holds in an agent or group room that offers the switch for notes. It is the page's shorthand only: the server never reads a message's text for it, so a `note` frame whose text starts with `@AI` stays a note, and only a frame with an explicit `mode: "turn"` from a viewer who may send turns starts one. A room without the toggle takes `@AI` as plain text.
|
|
859
|
+
- **Icons.** A page or a kind may give `icon`, one of `HOST_ICONS` (type `HostIconName`, both exported by the package): `chat`, `link`, `activity`, `users`, `megaphone`, `qr`, `settings`, `bell`, `file`, `list`, `shield`, `lock` and `sparkle`. A page's icon shows in the navigation (without one, a list); a kind's shows beside its section in the room list (without one, none). A name outside the list shows the default. The glyphs the first page does not draw load only when a page names one, so the first load does not grow.
|
|
840
860
|
- **Links and pictures.** `app.rooms.link(room, messageId?)` gives the same-origin address that opens a room and highlights a message (`<mount>/room/<key>?message=<id>` with `routing: "path"`, `<mount>/#/room/<key>?message=<id>` with hash routing). `` in a card, a page or an assistant or notice message shows an image the host saved with `saveFile` (rooms) or `app.pages.saveAsset` (pages): PNG, JPEG or WebP whose bytes prove it, served only to those who may see the room or page. Anything else is shown as text.
|
|
841
861
|
- **Pages.** A page is at `<mount>/p/<id>` and is built from sections: Markdown, a list of rows (each may open a link and carry buttons), a form with an action, and a card. `place` is `main` (the navigation), `settings` (the Settings pane) or `hidden`. `visible(viewer)` is asked on every fetch and action; a page that is not visible is a `404`. `app.pages.changed(id?)` sends the viewers who may see it a `page_changed` frame and their page fetches the view again.
|
|
842
|
-
- **Retention.** A kind's `retention: { textDays, fileDays }` deletes its messages, author names, host cards and files that old, counted from each message's `at
|
|
862
|
+
- **Retention.** A kind's `retention: { textDays, fileDays }` deletes its messages, author names, host cards and files that old, counted from each message's `at` (a card's from when it was first posted). Without it nothing is deleted. A card the host still wants, such as a ticket's pinned card while the ticket is open, carries `keep: true` in `card` and `updateCard`: the sweep skips it for as long as the host passes `keep: true`, and `updateCard` without it makes the card an ordinary one again.
|
|
843
863
|
- **Read marks.** The page tells the app how far a person has read (the newest message in view, at most once a second, never while the page is hidden). The app keeps one cursor per person and room, for host rooms and agent rooms alike (among owners), and computes each room's `unread` from it; the list and the drawer show the count, an attention dot where the host sets `attention`, and the room opens with a "new messages" divider where the person stopped. Under each message the people who have read up to it are named: "Seen by 2", with their pictures; a person's own mark is not shown to them.
|
|
844
864
|
- **The page is lazy.** The room, the lists and the pages load as separate chunks when first opened, so the app's first load is the same size as before.
|
|
845
865
|
|
|
@@ -850,7 +870,7 @@ The `rooms` pane's page and any client of your own talk to the host in this prot
|
|
|
850
870
|
- Page to server: `hello {visible, focus?}`, `visibility`, `focus {room?}`, `send {id, room, text, uploads?}`, `stop {room}`, `approval {prompt, approved}`, `answer {prompt, answer}`, `answers {prompt, answers, note?}`, `cancel {prompt}`; for a host room also `subscribe {room}`, `unsubscribe {room}`, `act {id, room, action, card?, input?}` and `read {room, upTo}`.
|
|
851
871
|
- Server to page: `ready {protocol, principal, name, uploads: {perMessage, maxBytes}}` (then every open card), `accepted`, `refused {id?, prompt?, code}` (`id` names a refused `send`, `prompt` a refused answer to a card), `message`, `progress` (only for the focused room), `activity {room, typing, stoppable, phase?, agent?, outcome?}` (`phase` is `working` during a tool call and `thinking` otherwise; `agent` names the member speaking in a group round; `outcome` is `done` or `failed` and comes only on the frame where `typing` turns false), `presence {agents: {<name>: {busy}}}` (after `ready` and when it changes; `busy` includes work in Discord channels), `edited` (a stored message changed its text, such as a thread's start line once the thread exists), `prompt`, `prompt_closed {prompt, outcome, note?, by?, answer?, closedAt?}`, `mode`, `auto_approved`, `changed`.
|
|
852
872
|
- REST under `<mount>/api/`: `session`, `rooms`, `rooms/<key>/messages?before=&limit=` (`{messages, more, cards}`: the cards of the room that opened within the page's span, from the first message's time on, or from the beginning when `more` is false, and before the first message of the next page), `PUT rooms/<key>/mode`, `PUT rooms/<key>/mute` (body `{muted: boolean}`; the room's push is off for every owner while true; a waiting card still pushes), `PUT rooms/<key>/pin` (body `{pinned: boolean, before?: key | null}`) and `PUT rooms/<key>/folder` (body `{folder: id | null, before?: key | null}`; `before` is the room it goes before, none or an unknown room for the end; `400` for Home and a dispatch thread, `404` for an unknown room or folder), `POST folders` (body `{name}`, `201`), `PATCH folders/<id>` (body `{name?, before?: id | null}`), `DELETE folders/<id>`, `PUT folders/<id>/mute` (body `{muted: boolean}`; answers `{muted, rooms}`), all of which answer with the whole layout `{pins, folders}` (except the mute), and `GET rooms` answering `{rooms, pins, folders}`, `POST rooms/<key>/start-over`, `POST uploads`, `DELETE uploads/<id>`, `files/<id>`, `schedules` (`GET`, and `DELETE schedules/<id>`), `agents/<name>` (`GET`, `PATCH`), `GET agents/<name>/prompt-history` (`{versions}`, newest first), `GET prompts` (`{documents}`), `GET` and `PUT prompts/<id>` (body `{text, base}`; `409 {error, conflict, current}` when `base` is not the text in force), `POST prompts/<id>/revert` (body `{base}`; the same `409`), `GET prompts/<id>/history`, `GET` and `PUT skill-docs/<name>` (body `{text, baseHash}`; `409` with `current`), `POST skill-docs` (body `{text}`; `201`), `GET skill-docs/<name>/history`, `PUT agents/<name>/character` (body `{character}`, at most 4 KiB; `400 {error, field}` for a look that is not a character), `POST agents` (body `{name, displayName, prompt, model?, thinking?, task?, character?, skills?}`; `201` with the profile; `400` for what the agent server refuses, `{error, field}` for a look), `POST agents/<name>/archive`, `POST agents/<name>/restore` (the profile), `DELETE agents/<name>` (an archived agent only; `400` for an active one), `GET` and `PUT agents/<name>/skills` (`{skills: [{name, description?, source, builtin, carried, missing?}]}`; the body of `PUT` is `{add?, remove?}`, one change that an unknown or built-in name refuses whole; `404` when the host has no skills), `POST groups` (body `{name, displayName, members, host?}`; `201`), `GET`, `PATCH` (`{displayName?, members?, host?}`) and `DELETE groups/<name>`, `POST groups/<name>/archive` and `POST groups/<name>/restore`, `GET archive` (`{entries}`: the archived agents and groups), `models`, `workspace` (the [files pane](#the-files-pane)'s calls), and for push `GET push/key`, `GET`, `POST` and `DELETE push/subscriptions` and `DELETE push/subscriptions/<id>`. The agents' pictures are at `<mount>/avatars/<hash>.png`.
|
|
853
|
-
- Beside the API: `<mount>/manifest.webmanifest`, `<mount>/sw.js`, `<mount>/icons/<name>.png
|
|
873
|
+
- Beside the API: `<mount>/manifest.webmanifest`, `<mount>/sw.js`, `<mount>/icons/<name>.png` (and `mark.svg`), `<mount>/theme-init.js`, and in password mode `<mount>/login`, `POST <mount>/auth/login` and `POST <mount>/auth/logout`.
|
|
854
874
|
|
|
855
875
|
A room key from a page must be one of the app's rooms whose agent or group exists; every other key, Discord's included, is refused. Every write needs an owner, whose tier is read again, and REST writes also need the console's `Origin`. A card can be answered by any owner, except a card that is the speaker's alone, which only the speaker's principal answers. After `cardGraceSeconds` (default 120) a turn goes on without the answer and the card stays open for a day; an answer then starts a new turn in the room. The types are in `src/api-types.ts`.
|
|
856
876
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,Q,w,e,S}from"./chunk-index-84v7j6vh.js";var a={profile:w(()=>(f("bqcgkgk4"),import("./chunk-profile-bqcgkgk4.js")).then((o)=>({default:o.ProfilePage}))),notices:w(()=>(f("evny44be"),import("./chunk-notices-evny44be.js")).then((o)=>({default:o.NoticesPage}))),onboarding:w(()=>(f("q1avjbrx"),import("./chunk-onboarding-q1avjbrx.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(Q,{fallback:e(S,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,Fe,a,r,g,e,n,s,un,ks}from"./chunk-index-84v7j6vh.js";import{D}from"./chunk-index-9nents16.js";var L=()=>typeof matchMedia==="function"&&matchMedia("(max-width: 719px)").matches,k={rtMenu:!0},x=()=>Boolean(window.history.state?.rtMenu),w=8,M=(t)=>t?.isConnected?t:null;function y(t){return t.items.map((u)=>n("button",{type:"button",role:u.checked===void 0?"menuitem":"menuitemcheckbox",...u.checked===void 0?{}:{"aria-checked":u.checked},className:"menu-item menu-link","data-tone":u.tone,onClick:()=>t.onChoose(u),children:[u.icon?e("span",{className:"menu-icon","data-tone":u.tone,children:e(s,{name:u.icon,size:18})}):null,e("span",{className:"menu-text",children:e("strong",{children:u.label})}),u.checked?e(s,{name:"check",size:18,className:"menu-check"}):null]},u.id))}function H({menu:t}){let u=a(void 0);if(t)u.current=t;let c=u.current,m=a(!1),p=a(void 0),h=t?.serial;return o(()=>{if(h===void 0)return;return window.history.pushState(k,"",window.location.href),m.current=!0,()=>{if(m.current)m.current=!1,window.history.back()}},[h]),o(()=>{let f=()=>{if(!m.current||x())return;m.current=!1,un();let E=p.current;p.current=void 0,E?.()};return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]),e(D,{open:t!==void 0,title:c?.title??"",onClose:un,restoreFocus:()=>M(c?.source??null),children:c?e("div",{className:"menu action-items",role:"menu","aria-label":c.title,children:e(y,{items:c.items,onChoose:(f)=>{if(!m.current){un(),f.run();return}p.current=f.run,window.history.back()}})}):null})}function T({menu:t}){let u=a(null),[c,m]=r(t.at),{source:p}=t,h=(i)=>{M(p)?.focus(),un(),i?.()},f=a(h);f.current=h,Fe(()=>{let i=u.current;if(!i)return;let d=i.getBoundingClientRect();m({x:Math.max(w,Math.min(t.at.x,window.innerWidth-d.width-w)),y:Math.max(w,Math.min(t.at.y,window.innerHeight-d.height-w))}),i.querySelector('[role^="menuitem"]')?.focus()},[t.serial]),o(()=>{let i=(l)=>{if(l.target instanceof Node&&u.current?.contains(l.target))return;un()},d=()=>un();return document.addEventListener("pointerdown",i,!0),document.addEventListener("wheel",i,{capture:!0,passive:!0}),document.addEventListener("touchmove",i,{capture:!0,passive:!0}),window.addEventListener("resize",d),()=>{document.removeEventListener("pointerdown",i,!0),document.removeEventListener("wheel",i,!0),document.removeEventListener("touchmove",i,!0),window.removeEventListener("resize",d)}},[]);let E=(i)=>{let d=[...u.current?.querySelectorAll('[role^="menuitem"]')??[]],l=d.indexOf(document.activeElement),v=(b)=>{i.preventDefault(),d[(b+d.length)%d.length]?.focus()};switch(i.key){case"Escape":i.preventDefault(),i.stopPropagation(),f.current();return;case"ArrowDown":return v(l+1);case"ArrowUp":return v(l<0?-1:l-1);case"Tab":return v(i.shiftKey?l<0?-1:l-1:l+1);case"Home":return v(0);case"End":return v(-1)}};return e("div",{ref:u,className:"action-popover",role:"menu","aria-label":t.title,tabIndex:-1,style:{left:`${c.x}px`,top:`${c.y}px`},onKeyDown:E,children:e(y,{items:t.items,onChoose:(i)=>h(i.run)})})}function O(){let t=ks(),u=a(void 0);if(t&&u.current?.serial!==t.serial)u.current={serial:t.serial,sheet:L()};let c=Boolean(t&&u.current?.sheet);return n(g,{children:[e(H,{menu:c?t:void 0}),t&&!c?e(T,{menu:t},t.serial):null]})}export{O as ActionMenuHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,e,K,u,S,et}from"./chunk-index-84v7j6vh.js";function c({name:r}){let m=u((i)=>i.listed),t=u((i)=>Object.values(i.rooms).find((n)=>n.view?.kind==="agent"&&n.view.name===r)?.view?.key,r);return o(()=>{if(t)K("room",t,{replace:!0}),et(r);else if(m)K("rooms",void 0,{replace:!0})},[t,m,r]),e("div",{className:"page",children:e(S,{})})}export{c as AgentPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,Q,w,J,N,a,t,g,e,n,s,Ve,u,k,_,fe,Zt,hn,te,Ii,ai,vr,Wt,li,xr}from"./chunk-index-84v7j6vh.js";import{Ce}from"./chunk-index-51n20yhb.js";import{jn}from"./chunk-index-gzvkpe3e.js";import{Fn}from"./chunk-index-066vzexw.js";import{Yn,Hn}from"./chunk-index-f3b5nch2.js";import{Dt}from"./chunk-index-a768zmp6.js";import{At}from"./chunk-index-43k1rjmx.js";Yn();var M=w(()=>(f("x56y26yq"),import("./chunk-folder-list-x56y26yq.js")).then((o)=>({default:o.FolderList}))),O=J(function(l){let{view:r}=l,p=Dt(()=>Zt(r.key),r.home?void 0:Hn(r.key));return e(vr,{...l,press:p,item:{...r.home?{}:{"data-drop-item":"","data-key":r.key},...l.arranging?{"data-arranging":""}:{}},after:l.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(d)=>{let c=d.currentTarget;Zt(r.key).then((i)=>{if(!i)return;let y=c.getBoundingClientRect();fe({...i,at:{x:y.left,y:y.bottom},via:"key",source:c})},()=>{return})},children:e(s,{name:"more",size:18})}):null})});function P(o){let{now:l}=te(),{timeZone:r}=_(),p=Wt(o.rooms);return e("ul",{className:"room-list",children:p.map(({key:d,...c})=>{let i=o.threads[d];return e(O,{...c,active:d===o.active,now:l,timeZone:r,arranging:o.arranging,...i?{threads:e(li,{open:i.open,closed:i.closed,active:o.active,parent:d})}:{}},d)})})}function v(o){let r=Wt(o.rooms).length===0;if(r&&o.zone?.kind!=="pinned")return null;return n("section",{className:"stack",...r?{"data-empty":""}:{},...o.zone?{"data-drop-zone":o.zone.kind,"data-zone-id":o.zone.id}:{},children:[e("h2",{className:"section-title",children:o.title}),r?null:e(P,{rooms:o.rooms,threads:o.threads,active:o.active,arranging:o.arranging})]})}function re(o){let l=Boolean(_().kinds?.length),r=u((m)=>JSON.stringify({listed:m.listed,...At(m,(F)=>Ve(m,F))})),p=jn(),d=a(r);if(!p)d.current=r;let c=d.current,{listed:i,...y}=N(()=>JSON.parse(c),[c]),{home:S,pinned:A,folders:R,restAgents:T,restGroups:D,rest:C,threads:L,orphans:h}=y,z=Ii(),K=S.length+A.length+C.length===0&&R.every((m)=>m.rooms.length===0)&&h.open.length+h.closed.length===0,b={threads:L,active:o.active,arranging:z};return n("div",{className:"page","data-column":o.active?"":void 0,"data-drop-root":"",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Rooms")}),n("div",{className:"actions",children:[n("button",{type:"button",className:"header-button search-button",onClick:o.onSearch,children:[e(s,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),i?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(m)=>Fn(m.currentTarget),children:e(s,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(m)=>hn(m.currentTarget),children:e(s,{name:"plus"})})]})]}),z?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>Ce({kind:"new"}),children:[e(s,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>ai(!1),children:t("Done")})]}):null,i&&K&&!l?e(k,{children:t("No rooms yet. Rooms appear when the team has a knight.")}):null,!i?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,e(v,{title:t("Home"),rooms:S,...b}),e(v,{title:t("Pinned"),rooms:A,zone:{kind:"pinned",id:"pinned"},...b}),R.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(Q,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(M,{folders:R,active:o.active,listed:i,rooms:(m)=>e(P,{rooms:m,threads:L,active:o.active,arranging:z})})})}):null,R.length>0?e(v,{title:t("Ungrouped"),rooms:C,zone:{kind:"rest",id:"rest"},...b}):n(g,{children:[e(v,{title:t("Knights"),rooms:T,zone:{kind:"rest",id:"rest-agents"},...b}),e(v,{title:t("Groups"),rooms:D,zone:{kind:"rest",id:"rest-groups"},...b})]}),h.open.length+h.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(li,{open:h.open,closed:h.closed,active:o.active})]}):null,e(xr,{active:o.active})]})}export{re as ArrangedRoomsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Be,Yt,F,ci,On}from"./chunk-index-yrhbhmxz.js";import{J,fr,o,A,N,a,r,t,c,g,e,n,ni,le,O,d,p,pn,he,Ze,Me}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import{D}from"./chunk-index-9nents16.js";var ue={"hat.none":"No hat","hat.goggcap":"Leather cap","hat.tallcap":"Burgundian felt cap","hat.softcap":"Soft cap","hat.hardhat":"Iron skullcap","hat.fcap":"Hunter's cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Biretta","hat.beret":"Chaperon","hat.goggles":"Pointed cap","hat.tricorn":"Pilgrim hat","hat.sailor":"Straw hat","hat.kettle":"Kettle hat","hat.cavalier":"Feathered hat","hat.toque":"Linen cook's cap","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Chart","prop.flask":"Alchemist's phial","prop.telescope":"Astrolabe","prop.wrench":"Dividers","outfit.surplice":"Surplice","outfit.overalls":"Work jerkin","outfit.armor":"Mail hauberk","outfit.apron":"Smith's apron","outfit.chef":"Cook's tunic","outfit.coat":"Doublet","outfit.vest":"Pourpoint","outfit.sailor":"Mariner's tunic","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},Y=(i)=>i.charAt(0).toUpperCase()+i.slice(1);function S(i,l){let m=`character.${i}.${l}`,h=t(m);if(h!==m)return h;if(i==="class")return F.classes[l]?.label??Y(l);return ue[`${i}.${l}`]??Y(l)}function Z(i){let l=`character.jobs.${i}`,m=t(l);return m!==l?m:F.classes[i]?.jobs??""}var z=[{field:"hat",title:c("Hat"),ids:F.hats},{field:"outfit",title:c("Outfit"),ids:F.outfits},{field:"prop",title:c("Prop"),ids:F.props},{field:"hair",title:c("Hair"),ids:F.hair},{field:"beard",title:c("Beard"),ids:["none",...F.beards]},{field:"accessory",title:c("Accessory"),ids:["none",...F.accessories]}],fe=new Set(["class","colors","palette","build","skin","hairColor",...z.map((i)=>i.field)]),re=Object.keys(F.palettes),ee={idle:c("Idle"),thinking:c("Thinking"),working:c("Working"),waiting:c("Waiting for you"),done:c("Done"),error:c("Error"),sleepy:c("Sleepy")},me={slim:c("Slim"),regular:c("Regular"),stout:c("Stout")};function W(i){return{class:i.class,outfit:i.outfit,hat:i.hat,prop:i.prop,hair:i.hair,beard:i.beard,accessory:i.accessory,build:i.build,skin:i.skin,hairColor:i.hairColor,colors:{...i.colors}}}var te=(i)=>JSON.stringify(W(i)),k=(i)=>i[Math.floor(Math.random()*i.length)];function be(){return{class:k(Be),outfit:k(F.outfits),hat:k(F.hats),prop:k(F.props),hair:k(F.hair),beard:k(["none",...F.beards]),accessory:k(["none",...F.accessories]),build:k(["slim","regular","stout"]),skin:k([0,1,2,3,4,5]),hairColor:k(F.hairColors),palette:k(re)}}var ie=J(function(l){return n("button",{type:"button",className:"creator-tile","aria-pressed":l.pressed,title:l.hint?`${l.label} — ${l.hint}`:l.label,onClick:l.onPick,...l.data,children:[e(he,{spec:l.spec,size:l.size,live:!1}),e("span",{children:l.label})]})});function ge(i,l,m){let h=JSON.stringify({...i,[l]:0});return N(()=>m.map((u)=>({...i,[l]:u})),[h,l,m])}function pe(){let i=a(null),[l,m]=r();return o(()=>{let h=i.current;if(!h)return;let u=()=>{let v=h.scrollLeft>1,L=h.scrollLeft+h.clientWidth<h.scrollWidth-1;m(v&&L?"both":L?"end":v?"start":void 0)};u(),h.addEventListener("scroll",u,{passive:!0});let b=typeof ResizeObserver>"u"?void 0:new ResizeObserver(u);return b?.observe(h),()=>{h.removeEventListener("scroll",u),b?.disconnect()}},[]),[i,l]}function ye(i){let{part:l}=i,m=ge(i.shown,l.field,l.ids),[h,u]=pe();return e("div",{className:"creator-strip",ref:h,"data-more":u,children:l.ids.map((b,v)=>e(ie,{data:{[`data-${l.field}`]:b},spec:m[v],size:44,label:S(l.field,b),pressed:i.draft[l.field]===b,onPick:()=>i.onPick(b)},b))})}function M(i){return e("button",{type:"button",className:"creator-swatch","aria-pressed":i.pressed,"aria-label":i.label,title:i.label,style:{background:i.background},onClick:i.onPick,...i.data})}function P(i){return n("div",{className:"creator-field","data-field":i.field,children:[i.title?e("h3",{children:i.title}):null,i.children,i.error?e("p",{className:"field-error",role:"alert",children:i.error}):null]})}function Oe(i){let[l,m]=r(i.character),h=fr(l),[u,b]=r({}),[v,L]=r(!1),[R,ne]=r("idle"),[U,T]=r(),[I,_]=r(),G=Me("(max-width: 719px)"),V=a(null),B=A(),oe=Ze(l),se=pn(),w=te(l)!==te(i.character);o(()=>m(i.character),[i.character]),o(()=>{if(!w||i.onPick)return;let s=(y)=>y.preventDefault(),f=(y)=>{if(y.button!==0||y.metaKey||y.ctrlKey||y.shiftKey||y.altKey)return;let E=y.target instanceof Element?y.target.closest("a"):null;if(!E||E.target||E.hasAttribute("download"))return;if(V.current?.contains(E))return;y.preventDefault(),y.stopPropagation(),T({kind:"link",anchor:E})},K=ni((y)=>T({kind:"navigate",proceed:y}));return window.addEventListener("beforeunload",s),document.addEventListener("click",f,!0),()=>{K(),window.removeEventListener("beforeunload",s),document.removeEventListener("click",f,!0)}},[w,i.onPick]);let C=(s)=>{b({}),m((f)=>ci(s,f))},ce=async()=>{if(i.onPick){i.onPick(W(l),l);return}L(!0),b({});try{let s=await O.setCharacter(i.name,W(l));i.onSaved?.(s),p(t("Saved."))}catch(s){let f=s instanceof le&&s.field?s.field.split(".")[0]:void 0,K=f&&fe.has(f)?f:"*";b({[K]:d(s)})}finally{L(!1)}},de=async()=>{let s=U;if(m(i.character),b({}),s?.kind==="link")setTimeout(()=>s.anchor.click(),0);else if(s?.kind==="navigate")s.proceed()},q=e(P,{field:"class",title:t("Class"),error:u.class,children:e("div",{className:"creator-grid",children:Be.map((s)=>e(ke,{id:s,base:h,pressed:l.class===s,onPick:()=>C({class:s,colors:l.colors})},s))})}),x=n(P,{field:"colors",title:t("Colors"),error:u.colors??u.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),re.map((s)=>{let f=F.palettes[s];return e(M,{data:{"data-palette":s},label:S("palette",s),pressed:l.palette===s,background:`linear-gradient(135deg, ${f.primary} 52%, ${f.trim} 52%)`,onPick:()=>C({palette:s})},s)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((s)=>n("label",{children:[e("span",{children:s==="primary"?t("Primary (the accent)"):s==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:l.colors[s],onChange:(f)=>C({colors:{[s]:f.target.value}})})]},s))})]}),Q=z.map((s)=>e(P,{field:s.field,title:t(s.title),error:u[s.field],children:e(ye,{part:s,draft:l,shown:h,onPick:(f)=>C({[s.field]:f})})},s.field)),X=n(g,{children:[e(P,{field:"build",title:t("Build"),error:u.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((s)=>n("label",{"data-checked":l.build===s,children:[e("input",{type:"radio",name:`${B}-build`,checked:l.build===s,onChange:()=>C({build:s})}),ae(s)]},s))]})}),e(P,{field:"skin",title:t("Skin tone"),error:u.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),(se??F.skins).map((s,f)=>e(M,{data:{"data-skin":String(f)},label:t("Skin tone {n}",{n:f+1}),pressed:l.skin===f,background:s,onPick:()=>C({skin:f})},f))]})}),e(P,{field:"hairColor",title:t("Hair color"),error:u.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),F.hairColors.map((s,f)=>e(M,{data:{"data-hair-color":s},label:t("Hair color {n}",{n:f+1}),pressed:l.hairColor===s,background:s,onPick:()=>C({hairColor:s})},s)),e("input",{type:"color","aria-label":t("Hair color"),value:l.hairColor,onChange:(s)=>C({hairColor:s.target.value})})]})})]}),H=[{id:"class",title:t("Class"),summary:S("class",l.class),error:u.class,node:q},{id:"colors",title:t("Colors"),summary:l.palette?S("palette",l.palette):l.colors.primary,error:u.colors??u.palette,node:x},...z.map((s,f)=>({id:s.field,title:t(s.title),summary:S(s.field,l[s.field]),error:u[s.field],node:Q[f]})),{id:"body",title:t("Body"),summary:ae(l.build),error:u.build??u.skin??u.hairColor,node:X}];return n("form",{ref:V,className:"creator",style:oe,"aria-labelledby":B,onSubmit:(s)=>{if(s.preventDefault(),(w||i.onPick)&&!v)ce()},children:[e("h2",{id:B,className:"visually-hidden",children:t("Character of {name}",{name:i.displayName})}),n("div",{className:"creator-preview",children:[e(he,{spec:l,name:i.name,state:R,size:176,label:t("{name}, {state}",{name:i.displayName,state:t(ee[R])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>ne((s)=>Yt[(Yt.indexOf(s)+1)%Yt.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(ee[R])})]}),n("div",{className:"creator-body",children:[u["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:u["*"]}):null,G?e("ul",{className:"creator-sections",children:H.map((s)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>_(s.id),children:[e("strong",{children:s.title}),e("span",{className:"meta",children:s.summary}),s.error?e("span",{className:"field-error",role:"alert",children:s.error}):null]})},s.id))}):n(g,{children:[q,x,Q,X]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{b({}),m(On({name:i.name,displayName:i.displayName,prompt:i.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>C(be()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(i.onCancel)i.onCancel();else if(w)T({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!w&&!i.onPick||v,children:v?t("Saving…"):i.onPick?t("Use this look"):t("Save")})]})]}),e(D,{open:G&&I!==void 0,title:H.find((s)=>s.id===I)?.title??"",onClose:()=>_(void 0),children:e("div",{className:"stack",children:H.find((s)=>s.id===I)?.node})}),e(j,{open:U!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>T(void 0),onConfirm:de,children:e("p",{children:t("The new look for {name} has not been saved.",{name:i.displayName})})})]})}var ae=(i)=>t(me[i]);function ke(i){let l=i.base.colors,m=N(()=>ci({class:i.id,colors:l}),[i.id,l]);return e(ie,{data:{"data-class":i.id},spec:m,size:56,label:S("class",i.id),hint:Z(i.id),pressed:i.pressed,onPick:i.onPick})}export{Oe as CharacterCreator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{U,pe,fi,Dr,hi,lt,me,l,v,_e,Ne,Lt,Le,q,se,oe,I,Ot,yt,Xe,ge,E,ee,Te,y,wt,Ur,Vr,qr,pi,Dn,Br,Fr,Gr,Zr,T,i,C,je,It,qn,Zi,bn,vn,Hr,jr,ut}from"./chunk-index-0xj30mzw.js";import{f}from"./chunk-index-84v7j6vh.js";var nn=(e)=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Ce(e.state,n.from);return r.line?rn(e):r.block?ln(e):!1};function be(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);if(!o)return!1;return r(n.update(o)),!0}}var rn=be(an,0);var on=be(Ye,0);var ln=be((e,t)=>Ye(e,t,cn(t)),0);function Ce(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}var G=50;function sn(e,{open:t,close:n},r,o){let s=e.sliceDoc(r-G,r),c=e.sliceDoc(o,o+G),a=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(c)[0].length,d=s.length-a;if(s.slice(d-t.length,d)==t&&c.slice(u,u+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:o+u,margin:u&&1}};let h,m;if(o-r<=2*G)h=m=e.sliceDoc(r,o);else h=e.sliceDoc(r,r+G),m=e.sliceDoc(o-G,o);let p=/^\s*/.exec(h)[0].length,D=/\s*$/.exec(m)[0].length,M=m.length-D-n.length;if(h.slice(p,p+t.length)==t&&m.slice(M,M+n.length)==n)return{open:{pos:r+p+t.length,margin:/\s/.test(h.charAt(p+t.length))?1:0},close:{pos:o-D-n.length,margin:/\s/.test(m.charAt(M-1))?1:0}};return null}function cn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);if(o.from>r.from&&o.from==n.to)o=n.to==r.to+1?r:e.doc.lineAt(n.to-1);let s=t.length-1;if(s>=0&&t[s].to>r.from)t[s].to=o.to;else t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}function Ye(e,t,n=t.selection.ranges){let r=n.map((s)=>Ce(t,s.from).block);if(!r.every((s)=>s))return null;let o=n.map((s,c)=>sn(t,r[c],s.from,s.to));if(e!=2&&!o.every((s)=>s))return{changes:t.changes(n.map((s,c)=>{if(o[c])return[];return[{from:s.from,insert:r[c].open+" "},{from:s.to,insert:" "+r[c].close}]}))};else if(e!=1&&o.some((s)=>s)){let s=[];for(let c=0,a;c<o.length;c++)if(a=o[c]){let u=r[c],{open:d,close:h}=a;s.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:s}}return null}function an(e,t,n=t.selection.ranges){let r=[],o=-1;e:for(let{from:s,to:c}of n){let a=r.length,u=1e9,d;for(let h=s;h<=c;){let m=t.doc.lineAt(h);if(d==null){if(d=Ce(t,m.from).line,!d)continue e}if(m.from>o&&(s==c||c>m.from)){o=m.from;let p=/^\s*/.exec(m.text)[0].length,D=p==m.length,M=m.text.slice(p,p+d.length)==d?p:-1;if(p<m.text.length&&p<u)u=p;r.push({line:m,comment:M,token:d,indent:p,empty:D,single:!1})}h=m.to+1}if(u<1e9){for(let h=a;h<r.length;h++)if(r[h].indent<r[h].line.text.length)r[h].indent=u}if(r.length==a+1)r[a].single=!0}if(e!=2&&r.some((s)=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:u,indent:d,empty:h,single:m}of r)if(m||!h)s.push({from:a.from+d,insert:u+" "});let c=t.changes(s);return{changes:c,selection:t.selection.map(c,1)}}else if(e!=1&&r.some((s)=>s.comment>=0)){let s=[];for(let{line:c,comment:a,token:u}of r)if(a>=0){let d=c.from+a,h=d+u.length;if(c.text[h-c.from]==" ")h++;s.push({from:d,to:h})}return{changes:s}}return null}var Se=Le.define(),un=Le.define(),hn=v.define(),Ze=v.define({combine(e){return Ot(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,o)=>t(r,o)||n(r,o)})}}),et=_e.define({create(){return B.empty},update(e,t){let n=t.state.facet(Ze),r=t.annotation(Se);if(r){let u=x.fromTransaction(t,r.selection),d=r.side,h=d==0?e.undone:e.done;if(u)h=Q(h,h.length,n.minDepth,u);else h=rt(h,t.startState.selection);return new B(d==0?r.rest:h,d==0?h:r.rest)}let o=t.annotation(un);if(o=="full"||o=="before")e=e.isolate();if(t.annotation(se.addToHistory)===!1)return!t.changes.empty?e.addMapping(t.changes.desc):e;let s=x.fromTransaction(t),c=t.annotation(se.time),a=t.annotation(se.userEvent);if(s)e=e.addChanges(s,c,a,n,t);else if(t.selection)e=e.addSelection(t.startState.selection,c,a,n.newGroupDelay);if(o=="full"||o=="after")e=e.isolate();return e},toJSON(e){return{done:e.done.map((t)=>t.toJSON()),undone:e.undone.map((t)=>t.toJSON())}},fromJSON(e){return new B(e.done.map(x.fromJSON),e.undone.map(x.fromJSON))}});function tt(e={}){return[et,Ze.of(e),y.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?X:t.inputType=="historyRedo"?z:null;if(!r)return!1;return t.preventDefault(),r(n)}})]}function j(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(et,!1);if(!o)return!1;let s=o.pop(e,n,t);if(!s)return!1;return r(s),!0}}var X=j(0,!1),z=j(1,!1),fn=j(0,!0),dn=j(1,!0);class x{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new x(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((r)=>r.toJSON())}}static fromJSON(e){return new x(e.changes&&me.fromJSON(e.changes),[],e.mapped&<.fromJSON(e.mapped),e.startSelection&&l.fromJSON(e.startSelection),e.selectionsAfter.map(l.fromJSON))}static fromTransaction(e,t){let n=k;for(let r of e.startState.facet(hn)){let o=r(e);if(o.length)n=n.concat(o)}if(!n.length&&e.changes.empty)return null;return new x(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,k)}static selection(e){return new x(void 0,k,void 0,void 0,e)}}function Q(e,t,n,r){let o=t+1>n+20?t-n-1:0,s=e.slice(o,t);return s.push(r),s}function mn(e,t){let n=[],r=!1;return e.iterChangedRanges((o,s)=>n.push(o,s)),t.iterChangedRanges((o,s,c,a)=>{for(let u=0;u<n.length;){let d=n[u++],h=n[u++];if(a>=d&&c<=h)r=!0}}),r}function pn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function nt(e,t){return!e.length?t:!t.length?e:e.concat(t)}var k=[],gn=200;function rt(e,t){if(!e.length)return[x.selection([t])];else{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gn));if(r.length&&r[r.length-1].eq(t))return e;return r.push(t),Q(e,e.length-1,1e9,n.setSelAfter(r))}}function yn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function xe(e,t){if(!e.length)return e;let n=e.length,r=k;while(n){let o=xn(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let s=e.slice(0,n);return s[n-1]=o,s}else t=o.mapped,n--,r=o.selectionsAfter}return r.length?[x.selection(r)]:k}function xn(e,t,n){let r=nt(e.selectionsAfter.length?e.selectionsAfter.map((a)=>a.map(t)):k,n);if(!e.changes)return x.selection(r);let o=e.changes.map(t),s=t.mapDesc(e.changes,!0),c=e.mapped?e.mapped.composeDesc(s):s;return new x(o,q.mapEffects(e.effects,t),c,e.startSelection.map(s),r)}var Sn=/^(input\.type|delete)($|\.)/;class B{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new B(this.done,this.undone):this}addChanges(e,t,n,r,o){let s=this.done,c=s[s.length-1];if(c&&c.changes&&!c.changes.empty&&e.changes&&(!n||Sn.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,mn(c.changes,e.changes))||n=="input.type.compose"))s=Q(s,s.length-1,r.minDepth,new x(e.changes.compose(c.changes),nt(q.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,k));else s=Q(s,s.length,r.minDepth,e);return new B(s,k,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:k;if(o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&pn(o[o.length-1],e))return this;return new B(rt(this.done,e),this.undone,t,n)}addMapping(e){return new B(xe(this.done,e),xe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):t.selection);if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Se.of({side:e,rest:yn(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});else if(!o.changes)return null;else{let c=r.length==1?k:r.slice(0,r.length-1);if(o.mapped)c=xe(c,o.mapped);return t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Se.of({side:e,rest:c,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}}}B.empty=new B(k,k);var ot=[{key:"Mod-z",run:X,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:z,preventDefault:!0},{linux:"Ctrl-Shift-z",run:z,preventDefault:!0},{key:"Mod-u",run:fn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:dn,preventDefault:!0}];function F(e,t){return l.create(e.ranges.map(t),e.mainIndex)}function A(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function L({state:e,dispatch:t},n){let r=F(e.selection,n);if(r.eq(e.selection,!0))return!1;return t(A(e,r)),!0}function Y(e,t){return l.cursor(t?e.to:e.from)}function it(e,t){return L(e,(n)=>n.empty?e.moveByChar(n,t):Y(n,t))}function g(e){return e.textDirectionAt(e.state.selection.main.head)==ee.LTR}var st=(e)=>it(e,!g(e)),ct=(e)=>it(e,g(e));function at(e,t){return L(e,(n)=>n.empty?e.moveByGroup(n,t):Y(n,t))}var kn=(e)=>at(e,!g(e)),Cn=(e)=>at(e,g(e));var no=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Mn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Z(e,t,n){let r=C(e).resolveInner(t.head),o=n?T.closedBy:T.openedBy;for(let u=t.head;;){let d=n?r.childAfter(u):r.childBefore(u);if(!d)break;if(Mn(e,d,o))r=d;else u=n?d.to:d.from}let s=r.type.prop(o),c,a;if(s&&(c=n?ut(e,r.from,1):ut(e,r.to,-1))&&c.matched)a=n?c.end.to:c.end.from;else a=n?r.to:r.from;return l.cursor(a,n?-1:1)}var An=(e)=>L(e,(t)=>Z(e.state,t,!g(e))),Ln=(e)=>L(e,(t)=>Z(e.state,t,g(e)));function ht(e,t){return L(e,(n)=>{if(!n.empty)return Y(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}var ft=(e)=>ht(e,!1),dt=(e)=>ht(e,!0);function mt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,o;if(t){for(let s of e.state.facet(y.scrollMargins)){let c=s(e);if(c===null||c===void 0?void 0:c.top)n=Math.max(c===null||c===void 0?void 0:c.top,n);if(c===null||c===void 0?void 0:c.bottom)r=Math.max(c===null||c===void 0?void 0:c.bottom,r)}o=e.scrollDOM.clientHeight-n-r}else o=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,o-5)}}function pt(e,t){let n=mt(e),{state:r}=e,o=F(r.selection,(c)=>c.empty?e.moveVertically(c,t,n.height):Y(c,t));if(o.eq(r.selection))return!1;let s;if(n.selfScroll){let c=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),u=a.top+n.marginTop,d=a.bottom-n.marginBottom;if(c&&c.top>u&&c.bottom<d)s=y.scrollIntoView(o.main.head,{y:"start",yMargin:c.top-u})}return e.dispatch(A(r,o),{effects:s}),!0}var Ge=(e)=>pt(e,!1),ke=(e)=>pt(e,!0);function w(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from))o=e.moveToLineBoundary(t,n,!1);if(!n&&o.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;if(s&&t.head!=r.from+s)o=l.cursor(r.from+s)}return o}var Bn=(e)=>L(e,(t)=>w(e,t,!0)),En=(e)=>L(e,(t)=>w(e,t,!1)),Tn=(e)=>L(e,(t)=>w(e,t,!g(e))),wn=(e)=>L(e,(t)=>w(e,t,g(e))),Wn=(e)=>L(e,(t)=>e.moveToLineBoundary(t,!1,!1)),Rn=(e)=>L(e,(t)=>e.moveToLineBoundary(t,!0,!1));function On(e,t,n){let r=!1,o=F(e.selection,(s)=>{let c=ut(e,s.head,-1)||ut(e,s.head,1)||s.head>0&&ut(e,s.head-1,1)||s.head<e.doc.length&&ut(e,s.head+1,-1);if(!c||!c.end)return s;r=!0;let a=c.start.from==s.head?c.end.to:c.end.from;return n?l.range(s.anchor,a):l.cursor(a)});if(!r)return!1;return t(A(e,o)),!0}var Fn=({state:e,dispatch:t})=>On(e,t,!1);function b(e,t,n){let r=F(e.state.selection,(o)=>{if(o.undirectional&&o.head>=o.anchor!=t)o=l.range(o.head,o.anchor);let s=n(o);return l.range(o.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});if(r.eq(e.state.selection))return!1;return e.dispatch(A(e.state,r)),!0}function gt(e,t){return b(e,t,(n)=>e.moveByChar(n,t))}var xt=(e)=>gt(e,!g(e)),St=(e)=>gt(e,g(e));function kt(e,t){return b(e,t,(n)=>e.moveByGroup(n,t))}var In=(e)=>kt(e,!g(e)),Pn=(e)=>kt(e,g(e));var Nn=(e)=>{let t=!g(e);return b(e,t,(n)=>Z(e.state,n,t))},Vn=(e)=>{let t=g(e);return b(e,t,(n)=>Z(e.state,n,t))};function vt(e,t){return b(e,t,(n)=>e.moveVertically(n,t))}var bt=(e)=>vt(e,!1),Ct=(e)=>vt(e,!0);function Mt(e,t){return b(e,t,(n)=>e.moveVertically(n,t,mt(e).height))}var Ue=(e)=>Mt(e,!1),ze=(e)=>Mt(e,!0),Gn=(e)=>b(e,!0,(t)=>w(e,t,!0)),Un=(e)=>b(e,!1,(t)=>w(e,t,!1)),zn=(e)=>{let t=!g(e);return b(e,t,(n)=>w(e,n,t))},_n=(e)=>{let t=g(e);return b(e,t,(n)=>w(e,n,t))},Jn=(e)=>b(e,!1,(t)=>l.cursor(e.lineBlockAt(t.head).from)),$n=(e)=>b(e,!0,(t)=>l.cursor(e.lineBlockAt(t.head).to)),Je=({state:e,dispatch:t})=>(t(A(e,{anchor:0})),!0),$e=({state:e,dispatch:t})=>(t(A(e,{anchor:e.doc.length})),!0),Ke=({state:e,dispatch:t})=>(t(A(e,{anchor:e.selection.main.anchor,head:0})),!0),He=({state:e,dispatch:t})=>(t(A(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Kn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Hn=({state:e,dispatch:t})=>{let n=te(e).map(({from:r,to:o})=>l.undirectionalRange(r,Math.min(o+1,e.doc.length)));return t(e.update({selection:l.create(n),userEvent:"select"})),!0},Qn=({state:e,dispatch:t})=>{let n=F(e.selection,(r)=>{let o=C(e),s=o.resolveStack(r.from,1);if(r.empty){let c=o.resolveStack(r.from,-1);if(c.node.from>=s.node.from&&c.node.to<=s.node.to)s=c}for(let c=s;c;c=c.next){let{node:a}=c;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&c.next)return l.undirectionalRange(a.from,a.to)}return r});if(n.eq(e.selection))return!1;return t(A(e,n)),!0};function At(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let s of n.selection.ranges){let c=n.doc.lineAt(s.head);if(t?c.to<e.state.doc.length:c.from>0)for(let a=s;;){let u=e.moveVertically(a,t);if(u.head<c.from||u.head>c.to){if(!o.some((d)=>d.head==u.head))o.push(u);break}else if(u.head==a.head)break;else a=u}}if(o.length==r.ranges.length)return!1;return e.dispatch(A(n,l.create(o,o.length-1))),!0}var jn=(e)=>At(e,!1),Xn=(e)=>At(e,!0),Yn=({state:e,dispatch:t})=>{let n=e.selection,r=null;if(n.ranges.length>1)r=l.create([n.main]);else if(!n.main.empty)r=l.create([l.cursor(n.main.head)]);if(!r)return!1;return t(A(e,r)),!0};function _(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange((s)=>{let{from:c,to:a}=s;if(c==a){let u=t(s);if(u<c)n="delete.backward",u=H(e,u,!1);else if(u>c)n="delete.forward",u=H(e,u,!0);c=Math.min(c,u),a=Math.max(a,u)}else c=H(e,c,!1),a=H(e,a,!0);return c==a?{range:s}:{changes:{from:c,to:a},range:l.cursor(c,c<s.head?-1:1)}});if(o.changes.empty)return!1;return e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?y.announce.of(r.phrase("Selection deleted")):void 0})),!0}function H(e,t,n){if(e instanceof y)for(let r of e.state.facet(y.atomicRanges).map((o)=>o(e)))r.between(t,t,(o,s)=>{if(o<t&&s>t)t=n?s:o});return t}var Bt=(e,t,n)=>_(e,(r)=>{let o=r.from,{state:s}=e,c=s.doc.lineAt(o),a,u;if(n&&!t&&o>c.from&&o<c.from+200&&!/[^ \t]/.test(a=c.text.slice(0,o-c.from))){if(a[a.length-1]=="\t")return o-1;let d=Xe(a,s.tabSize),h=d%It(s)||It(s);for(let m=0;m<h&&a[a.length-1-m]==" ";m++)o--;u=o}else if(u=pe(c.text,o-c.from,t,t)+c.from,u==o&&c.number!=(t?s.doc.lines:1))u+=t?1:-1;else if(!t&&/[\ufe00-\ufe0f]/.test(c.text.slice(u-c.from,o-c.from)))u=pe(c.text,u-c.from,!1,!1)+c.from;return u}),ve=(e)=>Bt(e,!1,!0);var Dt=(e)=>Bt(e,!0,!1),Et=(e,t)=>_(e,(n)=>{let r=n.head,{state:o}=e,s=o.doc.lineAt(r),c=o.charCategorizer(r);for(let a=null;;){if(r==(t?s.to:s.from)){if(r==n.head&&s.number!=(t?o.doc.lines:1))r+=t?1:-1;break}let u=pe(s.text,r-s.from,t)+s.from,d=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),h=c(d);if(a!=null&&h!=a)break;if(d!=" "||r!=n.head)a=h;r=u}return r}),Tt=(e)=>Et(e,!1),Zn=(e)=>Et(e,!0);var er=(e)=>_(e,(t)=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var tr=(e)=>_(e,(t)=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),nr=(e)=>_(e,(t)=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var rr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>({changes:{from:r.from,to:r.to,insert:U.of(["",""])},range:l.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},or=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let o=r.from,s=e.doc.lineAt(o),c=o==s.from?o-1:pe(s.text,o-s.from,!1)+s.from,a=o==s.to?o+1:pe(s.text,o-s.from,!0)+s.from;return{changes:{from:c,to:a,insert:e.doc.slice(o,a).append(e.doc.slice(c,o))},range:l.cursor(a)}});if(n.changes.empty)return!1;return t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0};function te(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from)s=e.doc.lineAt(r.to-1);if(n>=o.number){let c=t[t.length-1];c.to=s.to,c.ranges.push(r)}else t.push({from:o.from,to:s.to,ranges:[r]});n=s.number+1}return t}function Wt(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let s of te(e)){if(n?s.to==e.doc.length:s.from==0)continue;let c=e.doc.lineAt(n?s.to+1:s.from-1),a=c.length+1;if(n){r.push({from:s.to,to:c.to},{from:s.from,insert:c.text+e.lineBreak});for(let u of s.ranges)o.push(l.range(Math.min(e.doc.length,u.anchor+a),Math.min(e.doc.length,u.head+a)))}else{r.push({from:c.from,to:s.from},{from:s.to,insert:e.lineBreak+c.text});for(let u of s.ranges)o.push(l.range(u.anchor-a,u.head-a))}}if(!r.length)return!1;return t(e.update({changes:r,scrollIntoView:!0,selection:l.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0}var lr=({state:e,dispatch:t})=>Wt(e,t,!1),ir=({state:e,dispatch:t})=>Wt(e,t,!0);function Rt(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of te(e))if(n)r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak});else r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let o=e.changes(r);return t(e.update({changes:o,selection:e.selection.map(o,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var sr=({state:e,dispatch:t})=>Rt(e,t,!1),cr=({state:e,dispatch:t})=>Rt(e,t,!0),ar=(e)=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(te(t).map(({from:o,to:s})=>{if(o>0)o--;else if(s<t.doc.length)s++;return{from:o,to:s}})),r=F(t.selection,(o)=>{let s=void 0;if(e.lineWrapping){let c=e.lineBlockAt(o.head),a=e.coordsAtPos(o.head,o.assoc||1);if(a)s=c.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2}return e.moveVertically(o,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ur(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=C(e).resolveInner(t),r=n.childBefore(t),o=n.childAfter(t),s;if(r&&o&&r.to<=t&&o.from>=t&&(s=r.type.prop(T.closedBy))&&s.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from)))return{from:r.to,to:o.from};return null}var Qe=Ft(!1),hr=Ft(!0);function Ft(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange((o)=>{let{from:s,to:c}=o,a=t.doc.lineAt(s),u=!e&&s==c&&ur(t,s);if(e)s=c=(c<=a.to?a:t.doc.lineAt(c)).to;let d=new bn(t,{simulateBreak:s,simulateDoubleBreak:!!u}),h=Zi(d,s);if(h==null)h=Xe(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize);while(c<a.to&&/\s/.test(a.text[c-a.from]))c++;if(u)({from:s,to:c}=u);else if(s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s)))s=a.from;let m=["",qn(t,h)];if(u)m.push(qn(t,d.lineIndent(a.from,-1)));return{changes:{from:s,to:c,insert:U.of(m)},range:l.cursor(s+1+m[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Me(e,t){let n=-1;return e.changeByRange((r)=>{let o=[];for(let c=r.from;c<=r.to;){let a=e.doc.lineAt(c);if(a.number>n&&(r.empty||r.to>a.from))t(a,o,r),n=a.number;c=a.to+1}let s=e.changes(o);return{changes:o,range:l.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}var fr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new bn(e,{overrideIndentation:(s)=>{let c=n[s];return c==null?-1:c}}),o=Me(e,(s,c,a)=>{let u=Zi(r,s.from);if(u==null)return;if(!/\S/.test(s.text))u=0;let d=/^\s*/.exec(s.text)[0],h=qn(e,u);if(d!=h||a.from<s.from+d.length)n[s.from]=u,c.push({from:s.from,to:s.from+d.length,insert:h})});if(!o.changes.empty)t(e.update(o,{userEvent:"indent"}));return!0},ne=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Me(e,(n,r)=>{r.push({from:n.from,insert:e.facet(je)})}),{userEvent:"input.indent"})),!0},Pt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Me(e,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let s=Xe(o,e.tabSize),c=0,a=qn(e,Math.max(0,s-It(e)));while(c<o.length&&c<a.length&&o.charCodeAt(c)==a.charCodeAt(c))c++;r.push({from:n.from+c,to:n.from+o.length,insert:a.slice(c)})}),{userEvent:"delete.dedent"})),!0},dr=(e)=>(e.setTabFocusMode(),!0);var mr=[{key:"Ctrl-b",run:st,shift:xt,preventDefault:!0},{key:"Ctrl-f",run:ct,shift:St},{key:"Ctrl-p",run:ft,shift:bt},{key:"Ctrl-n",run:dt,shift:Ct},{key:"Ctrl-a",run:Wn,shift:Jn},{key:"Ctrl-e",run:Rn,shift:$n},{key:"Ctrl-d",run:Dt},{key:"Ctrl-h",run:ve},{key:"Ctrl-k",run:er},{key:"Ctrl-Alt-h",run:Tt},{key:"Ctrl-o",run:rr},{key:"Ctrl-t",run:or},{key:"Ctrl-v",run:ke}],pr=[{key:"ArrowLeft",run:st,shift:xt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:kn,shift:In,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Tn,shift:zn,preventDefault:!0},{key:"ArrowRight",run:ct,shift:St,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Cn,shift:Pn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:wn,shift:_n,preventDefault:!0},{key:"ArrowUp",run:ft,shift:bt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Je,shift:Ke},{mac:"Ctrl-ArrowUp",run:Ge,shift:Ue},{key:"ArrowDown",run:dt,shift:Ct,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$e,shift:He},{mac:"Ctrl-ArrowDown",run:ke,shift:ze},{key:"PageUp",run:Ge,shift:Ue},{key:"PageDown",run:ke,shift:ze},{key:"Home",run:En,shift:Un,preventDefault:!0},{key:"Mod-Home",run:Je,shift:Ke},{key:"End",run:Bn,shift:Gn,preventDefault:!0},{key:"Mod-End",run:$e,shift:He},{key:"Enter",run:Qe,shift:Qe},{key:"Mod-a",run:Kn},{key:"Backspace",run:ve,shift:ve,preventDefault:!0},{key:"Delete",run:Dt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Tt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Zn,preventDefault:!0},{mac:"Mod-Backspace",run:tr,preventDefault:!0},{mac:"Mod-Delete",run:nr,preventDefault:!0}].concat(mr.map((e)=>({mac:e.key,run:e.run,shift:e.shift}))),Nt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:An,shift:Nn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Ln,shift:Vn},{key:"Alt-ArrowUp",run:lr},{key:"Shift-Alt-ArrowUp",run:sr},{key:"Alt-ArrowDown",run:ir},{key:"Shift-Alt-ArrowDown",run:cr},{key:"Mod-Alt-ArrowUp",run:jn},{key:"Mod-Alt-ArrowDown",run:Xn},{key:"Escape",run:Yn},{key:"Mod-Enter",run:hr},{key:"Alt-l",mac:"Ctrl-l",run:Hn},{key:"Mod-i",run:Qn,preventDefault:!0},{key:"Mod-[",run:Pt},{key:"Mod-]",run:ne},{key:"Mod-Alt-\\",run:fr},{key:"Shift-Mod-k",run:ar},{key:"Shift-Mod-\\",run:Fn},{key:"Mod-/",run:nn},{key:"Alt-A",mac:"Ctrl-A",run:on},{key:"Ctrl-m",mac:"Shift-Alt-m",run:dr}].concat(pr),qt={key:"Tab",run:ne,shift:Pt};var Vt=typeof String.prototype.normalize=="function"?(e)=>e.normalize("NFKD"):(e)=>e;class R{constructor(e,t,n=0,r=e.length,o,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?(c)=>o(Vt(c)):Vt,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return fi(this.buffer,this.bufferPos)}next(){while(this.matches.length)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Dr(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=hi(e);let r=this.normalize(t);if(r.length)for(let o=0,s=n,c=!0;;o++){let a=r.charCodeAt(o),u=this.match(a,s,c,this.bufferPos+this.bufferStart,o==r.length-1);if(u)return this.value=u,this;if(o==r.length-1)break;if(c&&o<t.length&&t.charCodeAt(o)==a)s++;else c=!1}}}match(e,t,n,r,o){let s=null;for(let c=0;c<this.matches.length;){let a=this.matches[c],u=!1;if(this.query.charCodeAt(a.index)==e)if(a.index==this.query.length-1)s={from:a.from,to:r,precise:o&&a.precise};else a.index++,u=!0;if(u)c++;else this.matches.splice(c,1)}if(this.query.charCodeAt(0)==e)if(this.query.length==1)s={from:t,to:r,precise:n&&o};else this.matches.push({from:t,index:1,precise:n});if(s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart))s=null;return s}}if(typeof Symbol<"u")R.prototype[Symbol.iterator]=function(){return this};var zt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ee="gm"+(/x/.unicode==null?"":"u");class we{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=zt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new We(e,t,n,r,o);this.re=new RegExp(t,Ee+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.iter=e.iter();let s=e.lineAt(r);this.curLineStart=s.from,this.matchPos=ce(e,r),this.getLine(this.curLineStart)}getLine(e){if(this.iter.next(e),this.iter.lineBreak)this.curLine="";else{if(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next()}}nextLine(){if(this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to)this.curLine="";else this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=ce(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length)this.nextLine();if((n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}var Ae=new WeakMap;class V{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Ae.get(e);if(!r||r.from>=n||r.to<=t){let c=new V(t,e.sliceString(t,n));return Ae.set(e,c),c}if(r.from==t&&r.to==n)return r;let{text:o,from:s}=r;if(s>t)o=e.sliceString(t,s)+o,s=t;if(r.to<n)o+=e.sliceString(r.to,n);return Ae.set(e,new V(s,o)),new V(t,o.slice(t-s,n-s))}}class We{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=zt,this.matchPos=ce(e,r),this.re=new RegExp(t,Ee+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.flat=V.get(e,r,this.chunkEnd(r+5000))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e)this.re.lastIndex=e+1,t=this.re.exec(this.flat.text);if(t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this.matchPos=ce(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=V.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}if(typeof Symbol<"u")we.prototype[Symbol.iterator]=We.prototype[Symbol.iterator]=function(){return this};function gr(e){try{return new RegExp(e,Ee),!0}catch(t){return!1}}function ce(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;while(t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344)t++;return t}var yr=(e)=>{let t=Fr(e,"cm-goto-line");if(t){let c=t.dom.querySelector("input[type=text]");if(c)c.select();return!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:o,result:s}=Br(e,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return s.then((c)=>{let a=c&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(c.elements.line.value);if(!a){e.dispatch({effects:o});return}let u=n.doc.lineAt(n.selection.main.head),[,d,h,m,p]=a,D=m?+m.slice(1):0,M=h?+h:u.number;if(h&&p){let ye=M/100;if(d)ye=ye*(d=="-"?-1:1)+u.number/n.doc.lines;M=Math.round(n.doc.lines*ye)}else if(h&&d)M=M*(d=="-"?-1:1)+u.number;let qe=n.doc.line(Math.max(1,Math.min(n.doc.lines,M))),Ve=l.cursor(qe.from+Math.max(0,Math.min(D,qe.length)));e.dispatch({effects:[o,y.scrollIntoView(Ve.from,{y:"center"})],selection:Ve})}),!0},xr={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_t=v.define({combine(e){return Ot(e,xr,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jt(e){let t=[Cr,br];if(e)t.push(_t.of(e));return t}var Sr=E.mark({class:"cm-selectionMatch"}),kr=E.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gt(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=oe.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=oe.Word)}function vr(e,t,n,r){return e(t.sliceDoc(n,n+1))==oe.Word&&e(t.sliceDoc(r-1,r))==oe.Word}var br=Te.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){if(e.selectionSet||e.docChanged||e.viewportChanged)this.decorations=this.getDeco(e.view)}getDeco(e){let t=e.state.facet(_t),{state:n}=e,r=n.selection;if(r.ranges.length>1)return E.none;let o=r.main,s,c=null;if(o.empty){if(!t.highlightWordAroundCursor)return E.none;let u=n.wordAt(o.head);if(!u)return E.none;c=n.charCategorizer(o.head),s=n.sliceDoc(u.from,u.to)}else{let u=o.to-o.from;if(u<t.minSelectionLength||u>200)return E.none;if(t.wholeWords){if(s=n.sliceDoc(o.from,o.to),c=n.charCategorizer(o.head),!(Gt(c,n,o.from,o.to)&&vr(c,n,o.from,o.to)))return E.none}else if(s=n.sliceDoc(o.from,o.to),!s)return E.none}let a=[];for(let u of e.visibleRanges){let d=new R(n.doc,s,u.from,u.to);while(!d.next().done){let{from:h,to:m}=d.value;if(!c||Gt(c,n,h,m)){if(o.empty&&h<=o.from&&m>=o.to)a.push(kr.range(h,m));else if(h>=o.to||m<=o.from)a.push(Sr.range(h,m));if(a.length>t.maxMatches)return E.none}}}return E.set(a)}},{decorations:(e)=>e.decorations}),Cr=y.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Mr=({state:e,dispatch:t})=>{let{selection:n}=e,r=l.create(n.ranges.map((o)=>e.wordAt(o.head)||l.cursor(o.head)),n.mainIndex);if(r.eq(n))return!1;return t(e.update({selection:r})),!0};function Ar(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),s=o&&o.from==n.from&&o.to==n.to;for(let c=!1,a=new R(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(c)return null;a=new R(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),c=!0}else{if(c&&r.some((u)=>u.from==a.value.from))continue;if(s){let u=e.wordAt(a.value.from);if(!u||u.from!=a.value.from||u.to!=a.value.to)continue}return a.value}}var Lr=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((s)=>s.from===s.to))return Mr({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((s)=>e.sliceDoc(s.from,s.to)!=r))return!1;let o=Ar(e,r);if(!o)return!1;return t(e.update({selection:e.selection.addRange(l.range(o.from,o.to),!1),effects:y.scrollIntoView(o.to)})),!0},O=v.define({combine(e){return Ot(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:(t)=>new Zt(t),scrollToMatch:(t)=>y.scrollIntoView(t)})}});function $t(e){return e?[O.of(e),De]:De}class Re{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||gr(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
2
|
+
`:n=="r"?"\r":n=="t"?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ht(this):new Kt(this)}getCursor(e,t=0,n){let r=e.doc?e:I.create({doc:e});if(n==null)n=r.doc.length;return this.regexp?N(this,r,t,n):P(this,r,t,n)}}class Oe{constructor(e){this.spec=e}}function Er(e,t,n){return(r,o,s,c)=>{if(n&&!n(r,o,s,c))return!1;let a=r>=c&&o<=c+s.length?s.slice(r-c,o-c):t.doc.sliceString(r,o);return e(a,t,r,o)}}function P(e,t,n,r){let o;if(e.wholeWord)o=Tr(t.doc,t.charCategorizer(t.selection.main.head));if(e.test)o=Er(e.test,t,o);return new R(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:(s)=>s.toLowerCase(),o)}function Tr(e,t){return(n,r,o,s)=>{if(s>n||s+o.length<r)s=Math.max(0,n-2),o=e.sliceString(s,Math.min(e.length,r+2));return(t(ae(o,n-s))!=oe.Word||t(ue(o,n-s))!=oe.Word)&&(t(ue(o,r-s))!=oe.Word||t(ae(o,r-s))!=oe.Word)}}class Kt extends Oe{constructor(e){super(e)}nextMatch(e,t,n){let r=P(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let o=Math.min(e.doc.length,t+this.spec.unquoted.length);r=P(this.spec,e,0,o).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let o=Math.max(t,r-1e4-this.spec.unquoted.length),s=P(this.spec,e,o,r),c=null;while(!s.nextOverlapping().done)c=s.value;if(c)return c;if(o==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);if(!r)r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length);return r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=P(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=P(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));while(!o.next().done)r(o.value.from,o.value.to)}}function wr(e,t,n){return(r,o,s)=>(!n||n(r,o,s))&&e(s[0],t,r,o)}function N(e,t,n,r){let o;if(e.wholeWord)o=Wr(t.charCategorizer(t.selection.main.head));if(e.test)o=wr(e.test,t,o);return new we(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function ae(e,t){return e.slice(pe(e,t,!1),t)}function ue(e,t){return e.slice(t,pe(e,t))}function Wr(e){return(t,n,r)=>!r[0].length||(e(ae(r.input,r.index))!=oe.Word||e(ue(r.input,r.index))!=oe.Word)&&(e(ue(r.input,r.index+r[0].length))!=oe.Word||e(ae(r.input,r.index+r[0].length))!=oe.Word)}class Ht extends Oe{nextMatch(e,t,n){let r=N(this.spec,e,n,e.doc.length).next();if(r.done)r=N(this.spec,e,0,t).next();return r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-r*1e4),s=N(this.spec,e,o,n),c=null;while(!s.next().done)c=s.value;if(c&&(o==t||c.from>o+10))return c;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let o=+n.slice(0,r);if(o>0&&o<e.match.length)return e.match[o]+n.slice(r)}return t})}matchAll(e,t){let n=N(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=N(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));while(!o.next().done)r(o.value.from,o.value.to)}}var J=q.define(),Fe=q.define(),W=_e.define({create(e){return new ie(Be(e).create(),null)},update(e,t){for(let n of t.effects)if(n.is(J))e=new ie(n.value.create(),e.panel);else if(n.is(Fe))e=new ie(e.query,n.value?Ie:null);return e},provide:(e)=>Dn.from(e,(t)=>t.panel)});class ie{constructor(e,t){this.query=e,this.panel=t}}var Rr=E.mark({class:"cm-searchMatch"}),Or=E.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ir=Te.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(W))}update(e){let t=e.state.field(W);if(t!=e.startState.field(W)||e.docChanged||e.selectionSet||e.viewportChanged)this.decorations=this.highlight(t)}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return E.none;let{view:n}=this,r=new yt;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:a,to:u}=s[o];while(o<c-1&&u>s[o+1].from-500)u=s[++o].to;e.highlight(n.state,a,u,(d,h)=>{let m=n.state.selection.ranges.some((p)=>p.from==d&&p.to==h);r.add(d,h,m?Or:Rr)})}return r.finish()}},{decorations:(e)=>e.decorations});function K(e){return(t)=>{let n=t.state.field(W,!1);return n&&n.query.spec.valid?e(t,n):de(t)}}var he=K((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=l.single(r.from,r.to),s=e.state.facet(O);return e.dispatch({selection:o,effects:[Pe(e,r),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),jt(e),!0}),fe=K((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let s=l.single(o.from,o.to),c=e.state.facet(O);return e.dispatch({selection:s,effects:[Pe(e,o),c.scrollToMatch(s.main,e)],userEvent:"select.search"}),jt(e),!0}),Pr=K((e,{query:t})=>{let n=t.matchAll(e.state,1000);if(!n||!n.length)return!1;return e.dispatch({selection:l.create(n.map((r)=>l.range(r.from,r.to))),userEvent:"select.search.matches"}),!0}),Nr=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,s=[],c=0;for(let a=new R(e.doc,e.sliceDoc(r,o));!a.next().done;){if(s.length>1000)return!1;if(a.value.from==r)c=s.length;s.push(l.range(a.value.from,a.value.to))}return t(e.update({selection:l.create(s,c),userEvent:"select.search.matches"})),!0},Ut=K((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,r,r);if(!s)return!1;let c=s,a=[],u,d,h=[];if(!c.precise)c=t.nextMatch(n,c.from,c.to);else if(c.from==r&&c.to==o)d=n.toText(t.getReplacement(c)),a.push({from:c.from,to:c.to,insert:d}),c=t.nextMatch(n,c.from,c.to),h.push(y.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."));let m=e.state.changes(a);if(c)u=l.single(c.from,c.to).map(m),h.push(Pe(e,c)),h.push(n.facet(O).scrollToMatch(u.main,e));return e.dispatch({changes:m,selection:u,effects:h,userEvent:"input.replace"}),!0}),zr=K((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let o of t.matchAll(e.state,1e9)){let{from:s,to:c,precise:a}=o;if(a)n.push({from:s,to:c,insert:t.getReplacement(o)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:y.announce.of(r),userEvent:"input.replace.all"}),!0});function Ie(e){return e.state.facet(O).createPanel(e)}function Be(e,t){var n,r,o,s,c;let a=e.selection.main,u=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!u)return t;let d=e.facet(O);return new Re({search:((n=t===null||t===void 0?void 0:t.literal)!==null&&n!==void 0?n:d.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=t===null||t===void 0?void 0:t.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(o=t===null||t===void 0?void 0:t.literal)!==null&&o!==void 0?o:d.literal,regexp:(s=t===null||t===void 0?void 0:t.regexp)!==null&&s!==void 0?s:d.regexp,wholeWord:(c=t===null||t===void 0?void 0:t.wholeWord)!==null&&c!==void 0?c:d.wholeWord})}function Qt(e){let t=pi(e,Ie);return t&&t.dom.querySelector("[main-field]")}function jt(e){let t=Qt(e);if(t&&t==e.root.activeElement)t.select()}var de=(e)=>{let t=e.state.field(W,!1);if(t&&t.panel){let n=Qt(e);if(n&&n!=e.root.activeElement){let r=Be(e.state,t.query.spec);if(r.valid)e.dispatch({effects:J.of(r)});n.focus(),n.select()}}else e.dispatch({effects:[Fe.of(!0),t?J.of(Be(e.state,t.query.spec)):q.appendConfig.of(De)]});return!0},Xt=(e)=>{let t=e.state.field(W,!1);if(!t||!t.panel)return!1;let n=pi(e,Ie);if(n&&n.dom.contains(e.root.activeElement))e.focus();return e.dispatch({effects:Fe.of(!1)}),!0},Yt=[{key:"Mod-f",run:de,scope:"editor search-panel"},{key:"F3",run:he,shift:fe,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:he,shift:fe,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Xt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Nr},{key:"Mod-Alt-g",run:yr},{key:"Mod-d",run:Lr,preventDefault:!0}];class Zt{constructor(e){this.view=e;let t=this.query=e.state.field(W).query.spec;this.commit=this.commit.bind(this),this.searchField=ge("input",{value:t.search,placeholder:S(e,"Find"),"aria-label":S(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ge("input",{value:t.replace,placeholder:S(e,"Replace"),"aria-label":S(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ge("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ge("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ge("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,o,s){return ge("button",{class:"cm-button",name:r,onclick:o,type:"button"},s)}this.dom=ge("div",{onkeydown:(r)=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>he(e),[S(e,"next")]),n("prev",()=>fe(e),[S(e,"previous")]),n("select",()=>Pr(e),[S(e,"all")]),ge("label",null,[this.caseField,S(e,"match case")]),ge("label",null,[this.reField,S(e,"regexp")]),ge("label",null,[this.wordField,S(e,"by word")]),...e.state.readOnly?[]:[ge("br"),this.replaceField,n("replace",()=>Ut(e),[S(e,"replace")]),n("replaceAll",()=>zr(e),[S(e,"replace all")])],ge("button",{name:"close",onclick:()=>Xt(e),"aria-label":S(e,"close"),type:"button"},["×"])])}commit(){let e=new Re({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});if(!e.eq(this.query))this.query=e,this.view.dispatch({effects:J.of(e)})}keydown(e){if(Ur(this.view,e,"search-panel"))e.preventDefault();else if(e.keyCode==13&&e.target==this.searchField)e.preventDefault(),(e.shiftKey?fe:he)(this.view);else if(e.keyCode==13&&e.target==this.replaceField)e.preventDefault(),Ut(this.view)}update(e){for(let t of e.transactions)for(let n of t.effects)if(n.is(J)&&!n.value.eq(this.query))this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(O).top}}function S(e,t){return e.state.phrase(t)}var re=30,le=/[\s\.,:;?!]/;function Pe(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,s=Math.max(r.from,t-re),c=Math.min(o,n+re),a=e.state.sliceDoc(s,c);if(s!=r.from){for(let u=0;u<re;u++)if(!le.test(a[u+1])&&le.test(a[u])){a=a.slice(u);break}}if(c!=o){for(let u=a.length-1;u>a.length-re;u--)if(!le.test(a[u-1])&&le.test(a[u])){a=a.slice(0,u);break}}return y.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}var _r=y.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),De=[W,Ne.low(Ir),_r];var Jr=y.theme({"&":{color:"var(--code-fg)",backgroundColor:"var(--code-bg)",height:"100%",fontSize:"var(--code-size, 13px)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:"var(--font-mono)",lineHeight:"1.55",overflow:"auto"},".cm-content":{caretColor:"var(--code-fg)",padding:"0.5rem 0"},".cm-line":{padding:"0 0.75rem"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--code-fg)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--code-selection)"},".cm-activeLine":{backgroundColor:"var(--code-active-line)"},".cm-gutters":{backgroundColor:"var(--code-gutter-bg)",color:"var(--code-gutter)",border:"none",borderRight:"1px solid var(--border)"},".cm-activeLineGutter":{backgroundColor:"var(--code-active-line)",color:"var(--code-fg)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5rem 0 0.5rem",minWidth:"2.25rem"},".cm-matchingBracket, .cm-nonmatchingBracket":{backgroundColor:"var(--code-selection)",outline:"1px solid var(--border-strong)"},".cm-searchMatch":{backgroundColor:"var(--warn-soft)",outline:"1px solid var(--warn)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)",outline:"1px solid var(--accent)"},".cm-panels":{backgroundColor:"var(--surface-2)",color:"var(--text)",borderColor:"var(--border)",fontFamily:"var(--font)"},".cm-panels-top":{borderBottom:"1px solid var(--border)"},".cm-panel.cm-search":{padding:"0.5rem 2rem 0.5rem 0.5rem"},".cm-panel.cm-search input, .cm-panel.cm-search button, .cm-panel.cm-search label":{fontSize:"0.875rem"},".cm-panel.cm-search input[type=text]":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--control-border)",borderRadius:"var(--radius-sm)",padding:"0.25rem 0.5rem"},".cm-panel.cm-search button":{backgroundColor:"var(--surface-3)",color:"var(--text)",border:"1px solid var(--border-strong)",borderRadius:"var(--radius-sm)",backgroundImage:"none",padding:"0.25rem 0.625rem"},".cm-panel.cm-search [name=close]":{color:"var(--muted)"}}),$r=vn.define([{tag:[i.keyword,i.modifier,i.operatorKeyword,i.controlKeyword],color:"var(--code-keyword)"},{tag:[i.string,i.regexp,i.special(i.string),i.inserted],color:"var(--code-string)"},{tag:[i.number,i.bool,i.null,i.atom,i.literal],color:"var(--code-number)"},{tag:[i.comment,i.lineComment,i.blockComment,i.docComment],color:"var(--code-comment)",fontStyle:"italic"},{tag:[i.typeName,i.className,i.namespace,i.tagName,i.standard(i.tagName)],color:"var(--code-type)"},{tag:[i.function(i.variableName),i.function(i.propertyName),i.definition(i.variableName),i.labelName],color:"var(--code-function)"},{tag:[i.meta,i.processingInstruction,i.annotation,i.attributeName,i.propertyName,i.heading],color:"var(--code-meta)"},{tag:i.heading,fontWeight:"bold"},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:i.link,color:"var(--code-function)",textDecoration:"underline"},{tag:i.url,color:"var(--code-function)"},{tag:i.invalid,color:"var(--danger)"},{tag:i.deleted,color:"var(--danger)"}]),en=[Jr,Hr($r)];var Kr={typescript:()=>(f("4k1d8z7s"),import("./chunk-lang-typescript-4k1d8z7s.js")),javascript:()=>(f("d32qrvxz"),import("./chunk-lang-javascript-d32qrvxz.js")),json:()=>(f("1q4fp694"),import("./chunk-lang-json-1q4fp694.js")),markdown:()=>(f("5w7t28wa"),import("./chunk-lang-markdown-5w7t28wa.js")),css:()=>(f("fa7c0zfj"),import("./chunk-lang-css-fa7c0zfj.js")),html:()=>(f("47mf2y0v"),import("./chunk-lang-html-47mf2y0v.js")),python:()=>(f("3dq0p4rf"),import("./chunk-lang-python-3dq0p4rf.js")),yaml:()=>(f("2by9g1dy"),import("./chunk-lang-yaml-2by9g1dy.js")),go:()=>(f("qb0qdpg7"),import("./chunk-lang-go-qb0qdpg7.js")),rust:()=>(f("70pa0agr"),import("./chunk-lang-rust-70pa0agr.js")),sql:()=>(f("kgcbh2a9"),import("./chunk-lang-sql-kgcbh2a9.js")),xml:()=>(f("mnbv9yfa"),import("./chunk-lang-xml-mnbv9yfa.js")),shell:()=>(f("4pxt7hf4"),import("./chunk-lang-shell-4pxt7hf4.js")),toml:()=>(f("99t95pab"),import("./chunk-lang-toml-99t95pab.js")),dockerfile:()=>(f("46rk929v"),import("./chunk-lang-dockerfile-46rk929v.js"))};async function tn(e){if(e==="plain")return;try{return(await Kr[e]()).language()}catch(t){console.warn("a language for the editor failed to load",t);return}}function Qr(e){if(typeof e.attachShadow!=="function"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in Document.prototype))return{parent:e,root:void 0};let t=e.shadowRoot??e.attachShadow({mode:"open"}),n=new CSSStyleSheet;return n.replaceSync(":host{display:flex;flex-direction:column;min-height:0}.cm-editor{flex:1;min-height:0}"),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],{parent:t,root:t}}async function vo(e){let t=new Lt,n=new Lt,r=new Lt,o=await tn(e.language),s=(m)=>[I.readOnly.of(!m),y.editable.of(m)],c={editable:e.editable,wrap:e.wrap,language:o??[]},a,u=(m)=>[Gr(),qr(),Zr(),tt(),Vr(),jr(),Jt(),$t({top:!0}),je.of(" "),I.phrases.of(e.phrases),en,wt.of([{key:"Mod-s",preventDefault:!0,run:()=>(e.onSave(),!0)},{key:"Escape",run:()=>(e.onEscape(),!0)},qt,...Yt,...ot,...Nt]),I.lineSeparator.of(m),t.of(s(c.editable)),n.of(c.wrap?y.lineWrapping:[]),r.of(c.language),y.updateListener.of((p)=>{if(p.docChanged)e.onChange()})],d=Qr(e.parent),h=new y({parent:d.parent,root:d.root,state:I.create({doc:e.text,extensions:u(e.eol)})});return a=h.state.doc,{text:()=>h.state.doc.sliceString(0,void 0,h.state.lineBreak),dirty:()=>a===void 0||!h.state.doc.eq(a),snapshot:()=>h.state.doc,markSaved:(m)=>{a=m??h.state.doc},replace:(m,p)=>{let D=h.scrollDOM.scrollTop;h.setState(I.create({doc:m,extensions:u(p)})),a=h.state.doc,h.scrollDOM.scrollTop=D},setEditable:(m)=>{c.editable=m,h.dispatch({effects:t.reconfigure(s(m))})},setWrap:(m)=>{c.wrap=m,h.dispatch({effects:n.reconfigure(m?y.lineWrapping:[])})},setLanguage:async(m)=>{c.language=await tn(m)??[],h.dispatch({effects:r.reconfigure(c.language)})},undo:()=>{X(h)},redo:()=>{z(h)},find:()=>{de(h)},tab:()=>{ne(h)},focus:()=>h.focus(),scrollTop:()=>h.scrollDOM.scrollTop,scrollTo:(m)=>{h.scrollDOM.scrollTop=m},destroy:()=>h.destroy()}}export{vo as createEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j}from"./chunk-index-7bbqtdce.js";import"./chunk-index-9nents16.js";export{j as Confirm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,g,e,n,O,S,m,k,P,_}from"./chunk-index-84v7j6vh.js";import{ye}from"./chunk-index-th43f690.js";function p(){let{connectorAdminUrl:o}=_(),{data:r,error:s}=ye(()=>O.connectors(),"connectors");return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Connectors")}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the knights.")})]}),o?e("a",{href:o,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),s?e(m,{message:s}):null,!r&&!s?e(S,{}):null,r?n(g,{children:[e("h3",{children:t("Upstream gateways")}),r.gateways.length===0?e(k,{children:t("No gateways.")}):null,r.gateways.map((a)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(P,{children:a.enabled?t("Enabled"):t("Disabled")}),e(P,{tone:a.reachable?"plain":"warn",children:a.reachable?t("Reachable"):t("Unreachable")}),e(P,{children:t("{count} tools",{count:a.tools})})]})},a.name)),e("h3",{children:t("Virtual servers")}),r.servers.length===0?e(k,{children:t("No virtual servers.")}):null,r.servers.map((a)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(P,{children:t("{count} tools",{count:a.tools.length})})]}),n("p",{children:[t("Used by"),": ",a.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:a.tools.map((l)=>e("li",{children:l},l))})]})]},a.name))]}):null]})}export{p as ConnectorsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,c,g,e,n,x,O,S,m,k,P,_,Pe,ie,Qe,on,si,te}from"./chunk-index-84v7j6vh.js";import{ye}from"./chunk-index-th43f690.js";var u=[{kind:"owner",title:c("Owner channels"),note:c("Direct messages and channels where the owner talks to a knight.")},{kind:"agent",title:c("Bot server channels"),note:c("The bot server's one-to-one channels.")},{kind:"group",title:c("Group channels"),note:c("The bot server's group channels.")},{kind:"outside",title:c("Outside AI clients"),note:c("Conversations an outside AI client holds over MCP.")},{kind:"plugin",title:c("Plugin conversations"),note:c("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function A(){let{timeZone:o}=_(),{now:i}=te(),{data:a,error:s}=ye(()=>O.conversations(),"conversations"),d=a?.conversations;if(!d)return s?e(m,{message:s}):e(S,{});return n(g,{children:[s?e(m,{message:s}):null,u.map((r)=>{let h=d.filter((l)=>l.kind===r.kind);return n("section",{className:"stack",children:[e("h2",{children:t(r.title)}),e("p",{className:"hint",children:t(r.note)}),h.length===0?e(k,{children:t("None stored.")}):null,h.map((l)=>e(v,{item:l,now:i,timeZone:o},l.key))]},r.kind)})]})}function v(o){let{item:i}=o,a=on(i.channel,i.id),s=si(i);return n("a",{className:"card card-link",href:x("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:s}),i.busy>0?e(P,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(P,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${ie(i.startedAt,o.timeZone)} · `:a.detail?`${a.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",Pe(i.lastActive,o.now,o.timeZone)," ·"," ",Qe(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{A as ConversationsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Or}from"./chunk-index-84v7j6vh.js";import{rr}from"./chunk-index-gzvkpe3e.js";import{Ls,zs,$r,Nr,Is,Ds}from"./chunk-index-9w0sar6s.js";var ne=Or,re=(a)=>{for(let n=a;n;n=n.parentElement){let{overflowY:l}=getComputedStyle(n);if((l==="auto"||l==="scroll")&&n.scrollHeight>n.clientHeight)return n}return document.scrollingElement??document.documentElement};function se(a){let{item:n,root:l,key:u,mode:C}=a,c=re(l),O=c===document.scrollingElement||c===document.documentElement,k=()=>O?0:c.getBoundingClientRect().top,X=()=>O?window.innerHeight:c.clientHeight,x=(e)=>e-k()+c.scrollTop,p=(e)=>{let t=e.getBoundingClientRect();return{top:x(t.top),height:t.height}},y=document.createElement("div");y.className="drop-line",y.setAttribute("aria-hidden","true");let z=[],P=[],g=[],h=[],R=[],B={top:0,bottom:0},D=()=>{let e=[...l.querySelectorAll("[data-drop-item], [data-folder-block]")].map((t)=>[t,t.style.transform]);for(let[t]of e)t.style.removeProperty("transform");try{j()}finally{for(let[t,r]of e)if(r)t.style.transform=r}},j=()=>{if(C==="room"){P=[...l.querySelectorAll("[data-drop-zone]")],z=P.map((t)=>{let{top:r,height:H}=p(t);return{id:t.dataset.zoneId??"",kind:t.dataset.dropZone,...t.dataset.folder?{folder:t.dataset.folder}:{},top:r,bottom:r+H,items:t.dataset.collapsed===void 0?[...t.querySelectorAll("[data-drop-item]")].map((o)=>({key:o.dataset.key??"",...p(o)})):[]}});return}g=[...l.querySelectorAll(":scope > [data-folder-block]")],h=g.map((t)=>({key:t.dataset.key??"",...p(t)})),R=g.map((t)=>({key:t.dataset.key??"",...p(t.querySelector("[data-folder-head]")??t)}));let e=p(l);B={top:e.top,bottom:e.top+e.height}};rr(!0);let G=n.getBoundingClientRect().top;n.setAttribute("data-lifted",""),l.setAttribute("data-reordering","");let F=n.getBoundingClientRect().top-G;if(F)c.scrollTop+=F;D();let J=x(a.y),I={x:0,y:a.y},Z=!1,f=0,w,d,q={type:"cancel"};try{n.setPointerCapture(a.pointerId)}catch{}let _=()=>{f=0;let e=x(I.y),t=e-J;if(Math.abs(t)>ne)Z=!0;n.style.transform=`translate3d(0, ${t}px, 0)`;let r;if(C==="room"){let o=Ls(z,u,e);q=o?{type:"room",drop:o}:{type:"cancel"};let M=o?z.indexOf(o.zone):-1;r=P[M];let E=r?.contains(n)??!1,s=o?o.zone.items:[],m=E?[...r.querySelectorAll("[data-drop-item]")]:[],v=s.findIndex((i)=>i.key===u),W=o?Nr(s.map((i)=>i.key),u,o.before):0,ee=s.length>1?Math.max(0,(s[1]?.top??0)-(s[0]?.top??0)-(s[0]?.height??0)):0,U=E&&v>=0?$r(s,v,W,ee):[];for(let i of document.querySelectorAll("[data-drop-item]:not([data-lifted])"))i.style.removeProperty("transform");if(m.forEach((i,A)=>{if(U[A])i.style.transform=`translate3d(0, ${U[A]}px, 0)`}),r&&o&&!E){let i=o.before===null?void 0:o.zone.items.find((oe)=>oe.key===o.before),A=p(r).top,te=i?i.top-A:o.zone.items.length?p(r).height:0;y.style.top=`${te}px`,r.append(y)}else y.remove();if(o?.zone.kind==="folder"&&o.zone.items.length===0&&r?.dataset.collapsed!==void 0){if(d?.zone!==o.zone.id){if(d)clearTimeout(d.timer);let i=o.zone.folder??"";d={zone:o.zone.id,timer:setTimeout(()=>{a.open(i),requestAnimationFrame(()=>requestAnimationFrame(()=>{D(),L()}))},Ds)}}}else if(d)clearTimeout(d.timer),d=void 0}else{let o=zs(R,B,u,e);q=o?{type:"folder",before:o.before}:{type:"cancel"};let M=h.findIndex((m)=>m.key===u),E=o?Nr(h.map((m)=>m.key),u,o.before):M,s=$r(h,M,E,12);g.forEach((m,v)=>{if(m!==n)m.style.transform=s[v]?`translate3d(0, ${s[v]}px, 0)`:""})}if(r!==w)w?.removeAttribute("data-drop-target"),r?.setAttribute("data-drop-target",""),w=r;let H=Is(I.y,k(),k()+X());if(H)c.scrollTop+=H,L()},L=()=>{if(!f)f=requestAnimationFrame(_)},b=(e)=>{Q(),a.done(e)},S=(e)=>e.pointerId===a.pointerId,K=(e)=>{if(!S(e))return;e.stopPropagation(),e.preventDefault(),I={x:e.clientX,y:e.clientY},L()},N=(e)=>{if(!S(e))return;if(e.stopPropagation(),f)cancelAnimationFrame(f),_();b(Z?q:{type:"tap"})},V=(e)=>{if(S(e))b({type:"cancel"})},Y=(e)=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation(),b({type:"cancel"})},T=(e)=>e.preventDefault();function Q(){if(rr(!1),window.removeEventListener("pointermove",K,!0),window.removeEventListener("pointerup",N,!0),window.removeEventListener("pointercancel",V,!0),window.removeEventListener("keydown",Y,!0),window.removeEventListener("touchmove",T,!0),window.removeEventListener("contextmenu",T,!0),f)cancelAnimationFrame(f);if(d)clearTimeout(d.timer);w?.removeAttribute("data-drop-target"),y.remove(),n.removeAttribute("data-lifted"),n.style.removeProperty("transform"),l.removeAttribute("data-reordering");for(let e of l.querySelectorAll("[data-drop-item], [data-folder-block]"))e.style.removeProperty("transform");try{n.releasePointerCapture(a.pointerId)}catch{}}return window.addEventListener("pointermove",K,!0),window.addEventListener("pointerup",N,!0),window.addEventListener("pointercancel",V,!0),window.addEventListener("keydown",Y,!0),window.addEventListener("touchmove",T,{capture:!0,passive:!1}),window.addEventListener("contextmenu",T,!0),L(),()=>b({type:"cancel"})}export{se as lift};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Mt,qt}from"./chunk-index-31ays46f.js";import{f}from"./chunk-index-84v7j6vh.js";function H(){try{let c=document.createElement("canvas");return!!(c.getContext("webgl2")||c.getContext("webgl"))}catch{return!1}}function x(c,n){return[c,n.includes("?")?n.slice(n.indexOf("?")):""].some((r)=>{let d=new URLSearchParams(r).get("nogl");return d!==null&&d!=="0"&&d!=="false"})}async function I(c,n,T){let r=n.variant==="compact",d=n.labels??qt,l=new Map,E=(e)=>{l.clear();for(let t of e)l.set(t.id,{...t})};E(n.seats);let m={t:n.theme,s:n.scheme},a=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=r?"compact":"full";let g=document.createElement("div");g.className="rt-table-stage",o.appendChild(g);let i=null,y=!1,A=()=>!r&&(Boolean(n.listBelow)||y);c.appendChild(o);let u=new Map,p=()=>{if(!A()){i?.remove(),i=null,u.clear(),delete o.dataset.list;return}if(!i)i=document.createElement("ul"),i.className="rt-table-list",i.setAttribute("aria-label",d.table),o.appendChild(i),o.dataset.list="";for(let e of[...u.keys()])if(!l.has(e))u.delete(e);for(let e of l.values()){let t=u.get(e.id);if(!t){t=document.createElement("button"),t.type="button",t.dataset.seat=e.id;let s=e.id;t.addEventListener("click",(S)=>{let b=l.get(s);if(b)n.onSeatClick({id:b.id,name:b.name,at:Mt(S,S.currentTarget)})}),u.set(e.id,t)}t.textContent=d.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}i.replaceChildren(...[...l.values()].map((e)=>{let t=document.createElement("li"),s=u.get(e.id);if(s)t.appendChild(s);return t}))};p();let w=(e)=>{y=!e,p(),n.onNames?.(e)},v=async()=>{let{createTable2D:e}=await (f("18y029k9"),import("./chunk-table2d-18y029k9.js"));a=e(g,{...n,theme:m.t,scheme:m.s,seats:[...l.values()]}),w(!0)},C=async()=>{let{createTable3D:e}=await (f("q2s31ae0"),import("./chunk-table3d-q2s31ae0.js"));a=e(g,{...n,theme:m.t,scheme:m.s,seats:[...l.values()],onNames:w},()=>{a?.dispose(),v()})};if(r||T==="svg"||T!=="webgl"&&(x(location.search,location.hash)||!H()))await v();else try{await C()}catch{await v()}let L,M=n.onSeatMenu;if(M&&!r){let{attachSeatMenu:e}=await (f("ca5p4e9q"),import("./chunk-seat-menu-ca5p4e9q.js"));L=e(o,(t,s,S)=>{let b=t instanceof Element?t.closest("[data-seat]")?.dataset.seat:void 0,h=l.get(b??a?.seatAt?.(s,S)??"");return h?{id:h.id,name:h.name}:void 0},M)}return{get kind(){return a.kind},setTheme(e,t){m={t:e,s:t},a.setTheme(e,t)},setSeats(e){E(e),p(),a.setSeats(e)},setState(e,t){let s=l.get(e);if(s)s.state=t;p(),a.setState(e,t)},setAvatar(e,t){let s=l.get(e);if(s)s.avatarSvg=t;return a.setAvatar(e,t)},setReducedMotion:(e)=>a.setReducedMotion(e),resetCamera:()=>a.resetCamera(),focus:(e,t)=>a.focus(e,t),focused:()=>a.focused(),seatAt:(e,t)=>a.seatAt?.(e,t)??null,getStats:()=>a.getStats(),dispose(){L?.(),a?.dispose(),o.remove()}}}export{I as mountRoundTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,o,A,t,ne,g,e,n,s,mt,u,fe,We,$n,Nn}from"./chunk-index-84v7j6vh.js";import{Ji,er,tr,nr}from"./chunk-index-ths2hxpe.js";import{Dt}from"./chunk-index-a768zmp6.js";import{di}from"./chunk-index-43k1rjmx.js";var v=()=>(f("cgghzj1w"),import("./chunk-layout-actions-cgghzj1w.js")),k=(a)=>(f("v466t0sv"),import("./chunk-placement-items-v466t0sv.js")).then((r)=>r.folderMenu(a)),F=(a)=>({mode:"folder",key:a,item:(r)=>r.closest("[data-folder-block]"),root:(r)=>r.closest("[data-folder-block]")?.parentElement??null,onDrop:(r)=>{if(r.type==="folder")v().then((i)=>i.placeFolderBefore(a,r.before))},open:tr});function b(a){let{id:r,name:i}=a,d=Ji().has(r),l=a.holdsActive||!d,m=A(),h=Dt(()=>k(r),F(r)),N=(c)=>{k(r).then((p)=>{if(!p)return;let y=c.getBoundingClientRect();fe({...p,at:{x:y.left,y:y.bottom},via:"key",source:c})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":l?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...h,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":l,"aria-controls":m,"aria-label":l?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>er(r),children:[e(s,{name:"chevron",size:16,className:"folder-chevron","data-open":l||void 0}),e("strong",{children:i}),e("span",{className:"meta",children:ne(a.count,"{count} room","{count} rooms")}),l?null:a.stack]}),a.muted==="none"?null:e(s,{name:"bell-off",size:14,className:"muted-mark","data-partial":a.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":a.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),l?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(c)=>N(c.currentTarget),children:e(s,{name:"more",size:18})})]}),e("div",{id:m,className:"folder-body",hidden:!l,children:l?a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.children:null})]})}var R=4;function S(a){let r=a.rooms.slice(0,R),i=u((l)=>r.map((m)=>l.rooms[m]?.view),r.join(",")),d=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[i.map((l)=>l?e("span",{className:"folder-stack-item",children:e(We,{view:l,size:28})},l.key):null),d>0?n("span",{className:"folder-stack-more",children:["+",d]}):null]})}function M(a){let r=u((i)=>({waiting:a.rooms.reduce((d,l)=>d+mt(i,l),0),typing:a.rooms.some((d)=>i.rooms[d]?.typing)}),a.rooms.join(","));return n(g,{children:[r.typing?e($n,{}):null,r.waiting?e(Nn,{count:r.waiting}):null]})}function w(a){return u((r)=>di(a,(i)=>r.rooms[i]?.view?.muted===!0),a.join(","))}function Q(a){let r=a.folders.map((i)=>i.id).join(",");return o(()=>{if(a.listed)nr(r?r.split(","):[])},[a.listed,r]),e(g,{children:a.folders.map((i)=>e(C,{folder:i,...a},i.id))})}function C(a){let{folder:r}=a,i=w(r.rooms);return e(b,{id:r.id,name:r.name,count:r.rooms.length,holdsActive:a.active!==void 0&&r.rooms.includes(a.active),muted:i,summary:e(M,{rooms:r.rooms}),stack:e(S,{rooms:r.rooms}),children:a.rooms(r.rooms)})}export{Q as FolderList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ji,er,tr,nr}from"./chunk-index-ths2hxpe.js";export{tr as expandFolder,nr as pruneCollapsed,er as toggleCollapsed,Ji as useCollapsed};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,e,n,s,x}from"./chunk-index-
|
|
1
|
+
import{t,e,n,s,x}from"./chunk-index-84v7j6vh.js";import{Sn,Kt}from"./chunk-index-y00wke93.js";function l({steps:p}){return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),e("p",{className:"meta",children:t("These steps come first. The rest of the app opens when they are done.")}),e("ul",{className:"menu",children:p.map((a)=>e("li",{children:n("a",{className:"menu-item menu-link",href:x(a.open.page),children:[n("span",{className:"menu-text",children:[e("strong",{children:Sn(a)}),Kt(a)?e("span",{className:"meta",children:Kt(a)}):null]}),e(s,{name:"chevron",size:16})]})},a.id))})]})}export{l as GatePage};
|