pi-roundtable-web 0.29.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/chunk-account-66e6ezdq.js +1 -0
- package/dist/{chunk-action-menu-q5y7xpry.js → chunk-action-menu-ap5xn7bf.js} +1 -1
- package/dist/{chunk-agent-x74xezyt.js → chunk-agent-sapt5qhn.js} +1 -1
- package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
- package/dist/chunk-attachments-p5v9gqyt.js +102 -0
- package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
- package/dist/chunk-character-creator-m7tw20ef.js +225 -0
- package/dist/{chunk-codeeditor-239ss6a2.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
- package/dist/chunk-confirm-0cajsfhk.js +1 -0
- package/dist/chunk-connectors-tw0tbm21.js +37 -0
- package/dist/chunk-conversations-wkm23m5r.js +1 -0
- package/dist/{chunk-council-sheet-a5e6tspr.js → chunk-council-sheet-mz7s23nq.js} +2 -2
- package/dist/chunk-council-view-zgvzxtgn.js +1 -0
- package/dist/{chunk-drag-7873fvzw.js → chunk-drag-d1bpy8w6.js} +1 -1
- package/dist/{chunk-entry-5zmjxadx.js → chunk-entry-7zr5b1fp.js} +1 -1
- package/dist/{chunk-folder-list-h9hmbm8e.js → chunk-folder-list-bs4eh3g9.js} +1 -1
- package/dist/chunk-folds-eez1q41c.js +1 -0
- package/dist/{chunk-gate-fa6za28z.js → chunk-gate-dt91egcd.js} +1 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
- package/dist/chunk-host-picture-4rtswxwa.js +1 -0
- package/dist/chunk-host-state-1vxzmmq6.js +1 -0
- package/dist/chunk-host-ui-x38bf0et.js +1 -0
- package/dist/{chunk-index-4re5prfp.js → chunk-index-0h99xcs3.js} +2 -2
- package/dist/{chunk-index-5ssncptg.js → chunk-index-1kb8tv4v.js} +2 -2
- package/dist/chunk-index-24cggw6k.js +50 -0
- package/dist/chunk-index-2g8xtwqg.js +2 -0
- package/dist/chunk-index-3n38xe7m.js +2 -0
- package/dist/{chunk-index-en5dm1zv.js → chunk-index-3tksdmx7.js} +2 -2
- package/dist/{chunk-index-rr73h4kc.js → chunk-index-4a1tdadd.js} +3 -3
- package/dist/{chunk-index-f4gqzfkv.js → chunk-index-53fwc7sc.js} +2 -2
- package/dist/chunk-index-55ps4x5n.js +2 -0
- package/dist/{chunk-index-4krm48hm.js → chunk-index-5j1v2q7w.js} +1 -1
- package/dist/chunk-index-5w6tb7p0.js +2 -0
- package/dist/{chunk-index-y6p8j3zv.js → chunk-index-6btdp13p.js} +1 -1
- package/dist/chunk-index-6m7dwsmv.js +1 -0
- package/dist/{chunk-index-7c9fn21n.js → chunk-index-6rdywten.js} +2 -2
- package/dist/{chunk-index-gj3n4dh5.js → chunk-index-6s2pqwna.js} +2 -2
- package/dist/{chunk-index-r0hk9kyd.js → chunk-index-7mrkq793.js} +2 -2
- package/dist/chunk-index-7xcbpeqz.js +2 -0
- package/dist/chunk-index-88wh5eyj.js +2 -0
- package/dist/{chunk-index-ntt3em2k.js → chunk-index-8pbwr3rs.js} +1 -1
- package/dist/{chunk-index-bjeg3e2j.js → chunk-index-8wpvj7k5.js} +2 -2
- package/dist/chunk-index-97dcp1vh.js +1 -0
- package/dist/chunk-index-a7e6rhxy.js +2 -0
- package/dist/{chunk-index-4eag6s50.js → chunk-index-bxf8eq1s.js} +2 -2
- package/dist/chunk-index-c8gm1crh.js +120 -0
- package/dist/{chunk-index-4jnn2g09.js → chunk-index-ce7hsda9.js} +2 -2
- package/dist/chunk-index-cfesmk1f.js +2 -0
- package/dist/{chunk-index-zdzzf3fp.js → chunk-index-cmzvq3nf.js} +1 -1
- package/dist/{chunk-index-35zqk1zr.js → chunk-index-d4mx2vvf.js} +2 -2
- package/dist/chunk-index-d74tpnkd.js +2 -0
- package/dist/chunk-index-d941ae7c.js +2 -0
- package/dist/{chunk-index-rtz4936v.js → chunk-index-dr0jr7d3.js} +3 -3
- package/dist/{chunk-index-pcbkp62w.js → chunk-index-en728705.js} +2 -2
- package/dist/chunk-index-fb3kzyyp.js +2 -0
- package/dist/{chunk-index-a8c0ap8g.js → chunk-index-ffnd0jcj.js} +2 -2
- package/dist/chunk-index-fn6305vn.js +3 -0
- package/dist/{chunk-index-evhaaqzk.js → chunk-index-gdh7wsd5.js} +11 -11
- package/dist/{chunk-index-3tjmyd1h.js → chunk-index-m76gdwnk.js} +1 -1
- package/dist/chunk-index-mr391t49.js +2 -0
- package/dist/chunk-index-n3khm9fq.js +2 -0
- package/dist/{chunk-index-93f3e06v.js → chunk-index-nn4w6a04.js} +2 -2
- package/dist/{chunk-index-hef4gwtb.js → chunk-index-nr275sa7.js} +2 -2
- package/dist/{chunk-index-cttrqfm8.js → chunk-index-prq011b6.js} +1 -1
- package/dist/{chunk-index-h2a42p6s.js → chunk-index-q4k9vk04.js} +17 -1
- package/dist/chunk-index-rgdaec7y.js +2 -0
- package/dist/chunk-index-rjs1can6.js +2 -0
- package/dist/chunk-index-s4a8e4qm.js +2 -0
- package/dist/{chunk-index-q33ppq0j.js → chunk-index-sz381vda.js} +3 -3
- package/dist/{chunk-index-1652v386.css → chunk-index-t7csmbpy.css} +1 -1
- package/dist/{chunk-index-amspdq2j.js → chunk-index-v9jqyr1f.js} +1 -1
- package/dist/{chunk-index-e46652wf.js → chunk-index-vpq2cj14.js} +1 -1
- package/dist/chunk-index-vsaggfns.js +2 -0
- package/dist/{chunk-index-7k5895sn.js → chunk-index-w17wgjby.js} +3 -3
- package/dist/{chunk-index-teyx2hz7.js → chunk-index-wgrx2ybn.js} +2 -2
- package/dist/chunk-index-wsv46y9p.js +2 -0
- package/dist/{chunk-index-v6h43553.js → chunk-index-xbj816p0.js} +2 -2
- package/dist/{chunk-index-aycxt14t.js → chunk-index-yr758n6t.js} +2 -2
- package/dist/{chunk-index-pfs6rm6w.js → chunk-index-ysv36nbk.js} +2 -2
- package/dist/{chunk-index-haac6nbt.js → chunk-index-ze9p4npm.js} +2 -2
- package/dist/chunk-index-zfdvyrjt.js +2 -0
- package/dist/chunk-lang-css-3h22se37.js +1 -0
- package/dist/{chunk-lang-dockerfile-2p7e3ssz.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
- package/dist/{chunk-lang-go-zxp9k517.js → chunk-lang-go-qzgv1161.js} +2 -2
- package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
- package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
- package/dist/{chunk-lang-json-zmym50rg.js → chunk-lang-json-99v80v88.js} +1 -1
- package/dist/{chunk-lang-markdown-ww2kcs85.js → chunk-lang-markdown-gn8he877.js} +4 -4
- package/dist/{chunk-lang-python-ng1zdtd4.js → chunk-lang-python-prsw4p4k.js} +2 -2
- package/dist/{chunk-lang-rust-6ynhxjdd.js → chunk-lang-rust-g6xqta16.js} +1 -1
- package/dist/{chunk-lang-shell-39t9bz2s.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
- package/dist/{chunk-lang-sql-w875ejpg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
- package/dist/{chunk-lang-toml-b8ckgkg5.js → chunk-lang-toml-160prtq4.js} +1 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
- package/dist/{chunk-lang-xml-bz91cjp1.js → chunk-lang-xml-9htkz2dd.js} +1 -1
- package/dist/{chunk-lang-yaml-g9zy0tdv.js → chunk-lang-yaml-08749wd5.js} +1 -1
- package/dist/chunk-layout-actions-tdx896xf.js +1 -0
- package/dist/chunk-menu-items-trhybv1g.js +1 -0
- package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
- package/dist/chunk-note-row-28e5x7n8.js +233 -0
- package/dist/chunk-notes-5nkayhw8.js +1 -0
- package/dist/chunk-notice-bell-xz8a04am.js +1 -0
- package/dist/{chunk-notices-mtn7pg1z.js → chunk-notices-d0cwvk27.js} +1 -1
- package/dist/{chunk-onboarding-f3hhxgg4.js → chunk-onboarding-zs4rtea9.js} +1 -1
- package/dist/{chunk-overview-qmepntrr.js → chunk-overview-9sb3ywa8.js} +1 -1
- package/dist/{chunk-palette-edkn1ypq.js → chunk-palette-5sfhrv4x.js} +1 -1
- package/dist/chunk-placement-items-e2neja55.js +1 -0
- package/dist/{chunk-profile-pwfq0wns.js → chunk-profile-jffhtpqf.js} +1 -1
- package/dist/{chunk-prompt-history-xp9hmeqt.js → chunk-prompt-history-1jz2gk3v.js} +1 -1
- package/dist/{chunk-prompts-a56qvytg.js → chunk-prompts-0t30ttd0.js} +1 -1
- package/dist/chunk-room-confirms-6595921h.js +1 -0
- package/dist/{chunk-room-menu-1m2c2ekt.js → chunk-room-menu-hwkjyxwe.js} +1 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
- package/dist/{chunk-schedules-kwnw7p8v.js → chunk-schedules-e12y8fw2.js} +1 -1
- package/dist/{chunk-seat-menu-m2n9nvv0.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
- package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
- package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
- package/dist/chunk-skill-editor-98492yrt.js +8 -0
- package/dist/chunk-skills-mfv8ppfh.js +1 -0
- package/dist/chunk-start-over-line-m526193z.js +16 -0
- package/dist/{chunk-switcher-list-ehsn2wsk.js → chunk-switcher-list-5ngjar24.js} +1 -1
- package/dist/{chunk-tab-dot-gkpe06q8.js → chunk-tab-dot-tzjkahj5.js} +1 -1
- package/dist/{chunk-table-av3kh3tt.js → chunk-table-xbtbex2z.js} +1 -1
- package/dist/{chunk-table2d-5x3jptp9.js → chunk-table2d-61bvrykm.js} +1 -1
- package/dist/{chunk-table3d-rsvajx7r.js → chunk-table3d-5a7vbgyj.js} +24 -24
- package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
- package/dist/{chunk-thread-cards-grzszfha.js → chunk-thread-cards-n0n603vf.js} +1 -1
- package/dist/chunk-thread-list-7bkdn51x.js +227 -0
- package/dist/{chunk-transcript-t5szb8r0.js → chunk-transcript-8ztrkt6g.js} +1 -1
- package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
- package/dist/chunk-waiting-s273kcgz.js +1 -0
- package/dist/chunk-where-jr791gzj.js +1 -0
- package/dist/chunk-workspace-dw71mshw.js +586 -0
- package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +12 -0
- package/src/app/app.ts +7 -0
- package/src/app/card-log.ts +10 -2
- package/src/app/protocol.ts +18 -0
- package/src/app/queued-delivery.ts +107 -0
- package/src/app/queued-frames.ts +115 -0
- package/src/app/room-log.ts +39 -7
- package/src/app/routes.ts +97 -5
- package/src/app/socket.ts +12 -2
- package/src/app/surface.ts +37 -6
- package/src/app/zip.ts +124 -0
- package/src/auth/sessions.ts +9 -1
- package/src/host/cards.ts +10 -3
- package/src/host/stored-json.ts +23 -0
- package/src/i18n/zh-tw.ts +14 -0
- package/src/notices/mount.ts +1 -0
- package/src/notices/store.ts +9 -1
- package/src/web-plugin.ts +4 -1
- package/dist/chunk-account-9616x405.js +0 -1
- package/dist/chunk-arranged-rooms-9prq46vh.js +0 -1
- package/dist/chunk-bulk-actions-5dc4m9ad.js +0 -1
- package/dist/chunk-character-creator-wf02eg0h.js +0 -1
- package/dist/chunk-confirm-bhrx9195.js +0 -1
- package/dist/chunk-connectors-k77pd9by.js +0 -37
- package/dist/chunk-conversations-ftcpaqw1.js +0 -1
- package/dist/chunk-council-view-6593rqbr.js +0 -1
- package/dist/chunk-folds-vxq86t1s.js +0 -1
- package/dist/chunk-host-icons-y6frbzqt.js +0 -1
- package/dist/chunk-host-picture-fqg55rbr.js +0 -1
- package/dist/chunk-host-state-65tdhkyq.js +0 -1
- package/dist/chunk-host-ui-233kz7qp.js +0 -1
- package/dist/chunk-index-2c00zf3z.js +0 -2
- package/dist/chunk-index-2dhrqvba.js +0 -2
- package/dist/chunk-index-2s4bkrz3.js +0 -2
- package/dist/chunk-index-2ypaqwjy.js +0 -2
- package/dist/chunk-index-39qq37j5.js +0 -2
- package/dist/chunk-index-57teqgct.js +0 -2
- package/dist/chunk-index-9m9v1p7s.js +0 -2
- package/dist/chunk-index-a8nqn3y0.js +0 -3
- package/dist/chunk-index-am7ghh75.js +0 -120
- package/dist/chunk-index-amxa2bn3.js +0 -2
- package/dist/chunk-index-dajanzxc.js +0 -1
- package/dist/chunk-index-e2eeckhh.js +0 -2
- package/dist/chunk-index-ek98d2rn.js +0 -2
- package/dist/chunk-index-gp4chnp3.js +0 -2
- package/dist/chunk-index-mg96sqpk.js +0 -2
- package/dist/chunk-index-nsya88fn.js +0 -1
- package/dist/chunk-index-smz90j6p.js +0 -2
- package/dist/chunk-index-vzqwn3wp.js +0 -2
- package/dist/chunk-index-wt2asefx.js +0 -50
- package/dist/chunk-index-x4tq9btg.js +0 -2
- package/dist/chunk-index-yvcdg5hh.js +0 -2
- package/dist/chunk-index-zeqfnkty.js +0 -2
- package/dist/chunk-index-zpwb8mkk.js +0 -2
- package/dist/chunk-lang-css-avzhvm72.js +0 -1
- package/dist/chunk-lang-html-red02gep.js +0 -1
- package/dist/chunk-lang-javascript-n33kmjcx.js +0 -1
- package/dist/chunk-lang-typescript-qf8acbb2.js +0 -1
- package/dist/chunk-layout-actions-fyzzzeyp.js +0 -1
- package/dist/chunk-menu-items-yvnk3vds.js +0 -1
- package/dist/chunk-mode-toggle-ccv271hm.js +0 -1
- package/dist/chunk-note-row-314py1pp.js +0 -204
- package/dist/chunk-notes-4rnrddzw.js +0 -1
- package/dist/chunk-notice-bell-z9wgamnz.js +0 -1
- package/dist/chunk-placement-items-trsa5t23.js +0 -1
- package/dist/chunk-room-confirms-gqpkz4h0.js +0 -1
- package/dist/chunk-rooms-menu-button-tcvda1gq.js +0 -1
- package/dist/chunk-sheet-hosts-pr8xktyq.js +0 -29
- package/dist/chunk-shortcut-help-sbvrds1m.js +0 -26
- package/dist/chunk-shortcuts-8705p7q3.js +0 -1
- package/dist/chunk-skill-editor-7xy09sq1.js +0 -8
- package/dist/chunk-skills-cnc25x7q.js +0 -1
- package/dist/chunk-start-over-line-97zdd9pb.js +0 -16
- package/dist/chunk-thread-actions-7xtkegwm.js +0 -1
- package/dist/chunk-thread-list-9bjjac3j.js +0 -217
- package/dist/chunk-waiting-chip-d8b6a0p8.js +0 -28
- package/dist/chunk-waiting-ts3kxjvv.js +0 -1
- package/dist/chunk-where-3d3ncsa5.js +0 -1
- package/dist/chunk-workspace-ct6hvn0z.js +0 -578
- package/dist/chunk-zh-tw-v9v1eerm.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E,o,a,r,t,g,e,n,s,
|
|
1
|
+
import{E,o,a,r,t,g,e,n,s,S,l,v,m,Zn,pr}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import"./chunk-index-0q15ysrb.js";import{Xn,cn}from"./chunk-index-8wpvj7k5.js";import{pe}from"./chunk-index-vpq2cj14.js";import"./chunk-index-cmzvq3nf.js";var z=90000,C=2000,V=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),H=()=>/iPhone|iPad/.test(navigator.userAgent);function R({step:i,view:w,refresh:p}){let[c,u]=r(),[d,h]=r(i.done?"arrived":"idle"),[k,b]=r(),[T,y]=r(!1),[I,O]=r(!1),N=a(void 0);o(()=>(Zn().then(u,()=>u("unsupported")),()=>clearTimeout(N.current)),[]),o(()=>{if(i.done)h("arrived")},[i.done]);let L=E((f)=>{let A=async()=>{if((await p())?.steps.find((F)=>F.id===i.id)?.done){h("arrived");return}if(Date.now()-f>z){h("late");return}N.current=setTimeout(A,C)};N.current=setTimeout(A,C)},[p,i.id]),M=async()=>{y(!0),b(void 0),h("sending");try{await pe.pushTest(),h("waiting"),L(Date.now())}catch(f){h("idle"),b(l(f))}finally{y(!1)}},_=async()=>{y(!0),b(void 0);try{await pr(),u(await Zn()),await p()}catch(f){b(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):l(f)),u(await Zn().catch(()=>"unsupported"))}finally{y(!1)}},P=c==="unsupported"&&H()&&!V();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:Xn(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:cn(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="on"||P===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:P?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):V()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":c==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),c==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):c==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):c==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:T||c===void 0,onClick:_,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),d==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(g,{children:[e("button",{type:"button",className:"secondary",disabled:T||c!=="on"||d==="waiting",onClick:M,children:d==="waiting"?t("Waiting for it…"):t("Send a test notification")}),d==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),k?e(m,{message:k}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>O(!0),children:t(i.waiver.label)}),e(D,{open:I,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>O(!1),onConfirm:async()=>{await pe.waive(i.id),await p()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,w.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:w.push.devices})}):null]})}function j(){let[i,w]=r(),[p,c]=r(),u=E(async()=>{try{let d=await pe.onboarding();return w(d),d}catch(d){c(l(d));return}},[]);if(o(()=>{u()},[u]),p&&!i)return e(m,{message:p});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((d)=>d.builtin==="push"?e(R,{step:d,view:i,refresh:u},d.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:Xn(d)}),d.done||d.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",d.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:S(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:cn(d)})]},d.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{j as OnboardingPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,t,u,g,e,n,
|
|
1
|
+
import{r,t,u,g,e,n,S,y,l,v,m,k,Q,_,we,oe,Pe,tr,gn,wi,te}from"./chunk-index-24cggw6k.js";import{xe}from"./chunk-index-55ps4x5n.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";function f(a){let{cleanup:i}=_(),[c,p]=r(),[d,o]=r(!1),[h,s]=r();if(!i)return null;let b=()=>{if(!d)p(void 0),s(void 0)};return n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>p("start-over"),children:t("Start over")}),a.deletable?e("button",{type:"button",className:"danger",onClick:()=>p("delete"),children:t("Delete")}):null,n(H,{open:c!==void 0,title:c==="delete"?t("Permanently delete {name}?",{name:a.title}):t("Start over {name}?",{name:a.title}),onClose:b,children:[e("p",{children:c==="delete"?t("The live conversation and all archives will be permanently deleted. Memory and schedules are preserved."):t("The current conversation will be archived; the next message starts a new one. Long-term memory is preserved. Active turns finish first.")}),h?e(m,{message:h}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:d,onClick:b,children:t("Cancel")}),e("button",{type:"button",className:c==="delete"?"danger":"",disabled:d,onClick:async()=>{if(!c)return;o(!0),s(void 0);try{if(c==="delete")await y.deleteConversation(a.channel);else await y.startOver(a.channel);p(void 0),a.refresh()}catch(I){s(l(I))}finally{o(!1)}},children:d?c==="delete"?t("Deleting…"):a.busy?t("Waiting for this turn…"):t("Starting over…"):c==="delete"?t("Delete permanently"):t("Start over")})]})]})]})}function q(){let a=_(),{now:i}=te(),[c,p]=r(0),d=()=>p((s)=>s+1),{data:o,error:h}=xe(()=>y.overview(),`overview:${c}`);if(!o)return h?e(m,{message:h}):e(v,{});return n(g,{children:[h?e(m,{message:h}):null,n("section",{className:"stack",children:[e("h2",{children:t("Bot server")}),e("p",{className:"hint",children:t("Knight and group status; starting over archives the conversation and preserves memory.")}),o.agents.length+o.groups.length===0?e(k,{children:t("No knights.")}):null,o.agents.map((s)=>e(A,{agent:s,groups:o.groups,agents:o.agents,guildId:o.guildId,now:i,refresh:d},s.name)),o.groups.map((s)=>e(C,{group:s,guildId:o.guildId,now:i,timeZone:a.timeZone,refresh:d},s.name))]}),n("section",{className:"stack",children:[e("h2",{children:t("My workspaces")}),e("p",{className:"hint",children:t("Direct messages and channels where you mention a knight. Start over archives; delete removes every archive permanently.")}),o.workspaces?.length?o.workspaces.map((s)=>e(N,{conversation:s,schedules:s.schedules,now:i,refresh:d},s.key)):e(k,{children:t("No workspaces.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Outside AI client conversations")}),e("p",{className:"hint",children:t("Conversations opened through remote MCP; after deletion the session ID cannot be resumed.")}),o.outside?.length?o.outside.map((s)=>e(N,{conversation:s,now:i,refresh:d},s.key)):e(k,{children:t("No outside AI client conversations.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Party channels")}),e("p",{className:"hint",children:t("Starting over stops the container and archives role conversations; each speaker's memory is preserved.")}),o.party?.length?o.party.map((s)=>e(x,{party:s,now:i,refresh:d},s.key)):e(k,{children:t("No party channels.")})]})]})}function w({busy:a}){return e(Q,{tone:a?"busy":"plain",children:a===0?t("idle"):a===1?t("Working"):t("Working, {count} waiting",{count:a-1})})}function C(a){let{group:i,now:c,timeZone:p}=a;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[i.channelId?e("a",{href:wi(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):e("strong",{children:i.displayName}),e(Q,{children:t("Group")}),e(w,{busy:i.busy})]}),e("p",{children:t("Members: {members} | Host: {host}",{members:i.members.join(", "),host:i.host})}),n("p",{className:"hint",children:[t("Last active")," ",we(i.lastActive,c,p)]}),i.room||i.channelId?e(f,{channel:i.room??`discord:${i.channelId}`,title:i.displayName,busy:i.busy>0,refresh:a.refresh}):null]})}function A(a){let{agent:i}=a,{timeZone:c,panes:p}=_(),d=a.groups.find((s)=>s.channelId===i.workingIn),o=a.agents.find((s)=>s.channelId===i.workingIn),h=!i.workingIn?void 0:i.workingIn===i.channelId?t("Working in own channel"):d?t("Working in group {name}",{name:d.displayName}):o?t("Replying in {name}'s channel",{name:o.displayName}):t("Replying in another channel");return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.channelId?e("a",{href:wi(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):i.displayName}),e(Q,{children:"agent"}),i.workingIn?e(w,{busy:1+i.waiting}):i.waiting>0?e(Q,{tone:"busy",children:t("{count} waiting",{count:i.waiting})}):e(Q,{children:t("idle")})]}),h?e("p",{children:h}):null,n("dl",{className:"facts",children:[n("div",{children:[e("dt",{children:t("Model")}),n("dd",{children:[i.model," · thinking ",i.thinking]})]}),n("div",{children:[e("dt",{children:t("Context")}),e("dd",{children:i.context?i.context.tokens===null?t("Just compacted (limit {limit})",{limit:tr(i.context.contextWindow)}):`${tr(i.context.tokens)} / ${tr(i.context.contextWindow)} (${Math.round(i.context.tokens/i.context.contextWindow*100)}%)`:"—"})]}),n("div",{children:[e("dt",{children:t("Schedules")}),e("dd",{children:i.schedules})]}),n("div",{children:[e("dt",{children:t("Last active")}),e("dd",{children:we(i.lastActive,a.now,c)})]})]}),i.room||i.channelId?e(f,{channel:i.room??`discord:${i.channelId}`,title:i.displayName,busy:!!i.workingIn||i.waiting>0,refresh:a.refresh}):null,i.channelId&&p.includes("conversations")?e("a",{href:S("conversations",`discord:${i.channelId}`),children:t("transcript")}):null]})}function N({conversation:a,schedules:i,now:c,refresh:p}){let{timeZone:d,panes:o}=_(),{title:h,detail:s}=a.kind==="outside"?{title:a.firstMessage||t("(No messages)"),detail:a.id}:gn(a.channel,a.id);return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel&&a.channel.kind!=="gone"?e("a",{href:wi(a.id,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:h}):h}),e(w,{busy:a.busy})]}),s?e("p",{className:"hint",children:s}):null,e("p",{children:a.liveBytes>0?t("Conversation {size} · Archives {count}",{size:Pe(a.liveBytes),count:a.archives}):t("No live conversation · Archives {count}",{count:a.archives})}),a.startedAt?n("p",{children:[t("Started")," ",oe(a.startedAt,d)]}):null,n("p",{className:"hint",children:[i!==void 0?`${t("Schedules")} ${i} · `:"",t("Last active")," ",we(a.lastActive,c,d)]}),e(f,{channel:a.key,title:h,busy:a.busy>0,deletable:!0,refresh:p}),o.includes("conversations")?e("a",{href:S("conversations",a.key),children:t("transcript")}):null]})}function x({party:a,now:i,refresh:c}){let{timeZone:p}=_(),{title:d,detail:o}=gn(a.channel,a.channelId),h={running:u("Container running"),stopped:u("Container stopped"),missing:u("No container yet"),unknown:u("Container status unknown")};return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel.kind!=="gone"?e("a",{href:wi(a.channelId,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:d}):d}),e(Q,{children:a.profile}),e(Q,{children:t(h[a.container])}),e(w,{busy:a.busy})]}),o?e("p",{className:"hint",children:o}):null,e("p",{children:t("Enabled by {name} at {time}",{name:a.enabledBy,time:oe(a.enabledAt,p)})}),n("p",{className:"hint",children:[t("Last active")," ",we(a.lastActive,i,p)]}),e(f,{channel:a.key,title:d,busy:a.busy>0,refresh:c})]})}export{q as OverviewPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o,C,a,r,t,e,n,s,
|
|
1
|
+
import{o,C,a,r,t,e,n,s,S,X,d,ot,he}from"./chunk-index-24cggw6k.js";import{Oi}from"./chunk-index-6s2pqwna.js";import{R}from"./chunk-index-cmzvq3nf.js";function T(m){let[f,v]=r(""),[p,h]=r(0),g=a(null),b=d((l)=>l.order.flatMap((i)=>{let c=l.rooms[i]?.view;return c?[{key:i,name:c.displayName,agent:c.name,character:c.character,kind:c.kind}]:[]})),u=C(()=>[...b.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Knight"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>X("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>X(i.pane)}))].flatMap((i)=>{let c=Oi(f,i.label);return c===void 0?[]:[{target:i,score:c}]}).sort((i,c)=>c.score-i.score).map((i)=>i.target).slice(0,12),[b,m.pages,f]);o(()=>h(0),[f]),o(()=>{if(m.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[m.open]);let y=(l)=>{if(!l)return;m.onClose(),l.go()};return e(R,{open:m.open,title:t("Find a room"),onClose:m.onClose,variant:"palette",children:n("div",{className:"palette-box",children:[n("div",{className:"palette-input",children:[e(s,{name:"search",size:18}),e("input",{ref:g,value:f,placeholder:t("Find a room or page"),"aria-label":t("Find a room or page"),role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":u[p]?`palette-${p}`:void 0,onChange:(l)=>v(l.target.value),onKeyDown:(l)=>{if(ot(l.nativeEvent))return;if(l.key==="ArrowDown")l.preventDefault(),h((i)=>Math.min(u.length-1,i+1));else if(l.key==="ArrowUp")l.preventDefault(),h((i)=>Math.max(0,i-1));else if(l.key==="Enter")l.preventDefault(),y(u[p])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[u.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,u.map((l,i)=>e("li",{"data-active":i===p||void 0,children:n("a",{href:l.room?S("room",l.id):S(l.id),onClick:(c)=>{c.preventDefault(),y(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(he,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{T as Palette};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mo,Ma}from"./chunk-index-nn4w6a04.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{Ma as folderMenu,mo as placementItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E,o,a,r,t,u,g,e,n,s,y,l,v,m,
|
|
1
|
+
import{E,o,a,r,t,u,g,e,n,s,y,l,v,m,Q,mr}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import"./chunk-index-0q15ysrb.js";import{pe}from"./chunk-index-vpq2cj14.js";import"./chunk-index-cmzvq3nf.js";var T=3000;function B({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(s,{name:"shield",size:14})," ",t(F[i.tier])]}):null]})]})}function R({link:i,labels:P,changed:d}){let[c,p]=r(),[f,N]=r(!1),[C,V]=r(),[w,k]=r(!1),L=i.pending!==void 0||c!==void 0,q=a(void 0);o(()=>{if(!L||i.linked)return;return q.current=setInterval(()=>{pe.links().then((b)=>{let I=b.links.find((A)=>A.provider===i.provider);if(I)d(I)},()=>{return})},T),()=>clearInterval(q.current)},[L,i.linked,i.provider,d]);let S=async(b)=>{N(!0),V(void 0);try{await b()}catch(I){V(l(I))}finally{N(!1)}},h=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(Q,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(Q,{children:t("Recommended")}):null]}),C?e(m,{message:C}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>k(!0),children:t("Unlink")}),e(D,{open:w,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>k(!1),onConfirm:async()=>{d(await pe.unlink(i.provider)),p(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):L?n("div",{className:"stack",children:[c?n(g,{children:[e("p",{children:c.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:c.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(c.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(s,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>S(async()=>{d(await pe.cancelLink(i.provider)),p(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:f,onClick:()=>S(async()=>{let b=c?.request??i.pending?.request;if(!b)return;d(await pe.confirmLink(i.provider,b)),p(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[h?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((b)=>P[b]??b).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:f||h,onClick:()=>S(async()=>{p(await pe.issueLink(i.provider)),d((await pe.links()).links.find((b)=>b.provider===i.provider)??i)}),children:t("Link")})})]})]})}function O(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[P,d]=r(),[c,p]=r({start:"22:00",end:"07:00"}),[f,N]=r(!1),[C,V]=r(!1),[w,k]=r(),[L,q]=r();o(()=>{pe.pushPrefs().then((h)=>{if(d(h.quiet),h.quiet)p(h.quiet);N(!0)},()=>N(!0))},[]);let S=async(h)=>{V(!0),q(void 0),k(void 0);try{await h()}catch(b){q(l(b))}finally{V(!1)}};if(!f)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:c.start,onChange:(h)=>p({...c,start:h.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:c.end,onChange:(h)=>p({...c,end:h.target.value})})]}),e("span",{className:"meta",children:i})]}),L?e(m,{message:L}):null,w?e("p",{className:"meta",children:w}):null,n("div",{className:"actions",children:[P?e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>S(async()=>{await pe.setPushPrefs(null),d(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>S(async()=>{await pe.pushTest(),k(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:C||c.start===c.end,onClick:()=>S(async()=>{let h=await pe.setPushPrefs({...c,timeZone:i});d(h.quiet)}),children:t("Save")})]})]})}function z({profile:i,changed:P}){let[d,c]=r();if(i.sources.length===0)return null;let p=async(f)=>{c(void 0);try{P(await pe.chooseSource(f))}catch(N){c(l(N))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>p(null)}),t("Automatic")]}),i.sources.map((f)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===f.provider,onChange:()=>p(f.provider)}),t(f.label)]},f.provider))]}),d?e(m,{message:d}):null]})}function H(){let[i,P]=r(),[d,c]=r(),[p,f]=r(),[N,C]=r();o(()=>{y.session().then(P,(w)=>C(l(w))),pe.profile().then(c,()=>{return}),pe.links().then(f,()=>{return})},[]);let V=E((w)=>{f((k)=>k?{links:k.links.map((L)=>L.provider===w.provider?w:L)}:k),pe.profile().then(c,()=>{return})},[]);if(N)return e(m,{message:N});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),d?e(B,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(mr,{auth:i.auth})]}),p&&p.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:p.links.map((w)=>e(R,{link:w,labels:Object.fromEntries(p.links.map((k)=>[k.provider,k.label])),changed:V},w.provider))})]}):null,d?e(z,{profile:d,changed:c}):null,i.push?e(O,{}):null]})}var F={owner:u("Owner"),admin:u("Admin"),member:u("Member")};export{H as ProfilePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o,r,t,e,n,l,v,m,k,
|
|
1
|
+
import{o,r,t,e,n,l,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";function T(a){let{open:c,load:y}=a,{timeZone:N}=_(),[i,p]=r(),[d,g]=r(),[h,b]=r();o(()=>{if(!c)return;let s=!0;return p(void 0),g(void 0),b(void 0),y().then((f)=>s&&p(f),(f)=>s&&g(l(f))),()=>{s=!1}},[c]);let u=i?.find((s)=>s.id===h);return e(R,{open:c,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[d?e(m,{message:d}):null,!i&&!d?e(v,{}):null,i?.length===0?e(k,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((s)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":s.id===h,onClick:()=>b(s.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:s.by}),e("span",{className:"meta",children:oe(s.at,N)})]}),s.revert?e(Q,{children:t("Back to the file version")}):null]})},s.id))}):null,u?n("section",{className:"stack","aria-label":t("This change"),children:[e(gt,{label:t("This change"),before:u.previous,after:u.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>a.onUse(u.text),children:t("Use this text")})})]}):null]})})}export{T as HistorySheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,
|
|
1
|
+
import{p,T,x,E,o,L,r,t,u,g,e,n,s,fe,l,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";var M={"Shared prompt":u("Shared prompt"),"Guest prompt":u("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":u("The base every knight's prompt starts with, the main knight's included."),"Used instead of the shared prompt when the person speaking is not the owner.":u("Used instead of the shared prompt when the person speaking is not the owner.")},N=(c)=>t(M[c]??c);var O=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((c)=>({default:c.HistorySheet}))),Z=x(()=>(p("0cajsfhk"),import("./chunk-confirm-0cajsfhk.js")).then((c)=>({default:c.Confirm})));function pe(){let{timeZone:c}=_(),[S,i]=r(),[h,w]=r(),[b,C]=r(),P=E(()=>{de.prompts().then((d)=>i(d.documents),(d)=>w(l(d)))},[]);return o(P,[P]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the main knight and the other knights start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),h?e(m,{message:h}):null,!S&&!h?e(v,{}):null,S?.length===0?e(k,{children:t("No prompts to edit.")}):null,S?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:N(d.label)}),d.differs?e(Q,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(Q,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:N(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:oe(d.override.at,c)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>C(d.id),children:t("Edit")})})]},d.id)),b?e(q,{id:b,onClose:()=>{C(void 0),P()}}):null]})}function q({id:c,onClose:S}){let[i,h]=r(),[w,b]=r(""),[C,P]=r(),[d,B]=r(!1),[H,V]=r(!1),[F,D]=r(!1),[z,A]=r(!1),I=L();o(()=>{let a=!0;return de.prompt(c).then((y)=>{if(!a)return;h(y),b(y.text)},(y)=>a&&P(l(y))),()=>{a=!1}},[c]);let U=async()=>{if(!i)return;V(!0);try{let a=await de.savePrompt(c,{text:w,base:i.text});h(a),b(a.text),B(!1),f(t("Saved."))}catch(a){if(a instanceof fe&&a.status===409){let{current:y}=a.body;h(y),f(a.message,"danger")}else f(l(a),"danger")}finally{V(!1)}},G=i!==void 0&&w!==i.text;return n(R,{open:!0,title:i?N(i.label):t("Main prompts"),size:"full",onClose:S,children:[C?e(m,{message:C}):null,!i&&!C?e(v,{}):null,i?.broken?e(m,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(Q,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(gt,{label:t("Prompt"),before:i.text,after:w}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:H,onClick:()=>B(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:H,onClick:U,children:H?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:I,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>D(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:I,className:"prompt-full",value:w,maxLength:i.maxChars,onChange:(a)=>b(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>A(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!G||!w.trim(),onClick:()=>B(!0),children:t("Review changes")})]})]}),F?e(T,{fallback:null,children:e(O,{open:F,title:t("History of {name}",{name:N(i.label)}),load:async()=>(await de.promptHistory(c)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{b(a),B(!1),D(!1)},onClose:()=>D(!1)})}):null,z?e(T,{fallback:null,children:e(Z,{open:z,title:t("Revert {name} to the file version?",{name:N(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await de.revertPrompt(c,{base:i.text});h(a),b(a.text),B(!1),f(t("Back to the file version."))}catch(a){if(!(a instanceof fe&&a.status===409))throw a;let{current:y}=a.body;h(y),f(a.message,"danger")}},onClose:()=>A(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{pe as PromptsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-s4a8e4qm.js";import"./chunk-index-6btdp13p.js";import"./chunk-index-cmzvq3nf.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-wgrx2ybn.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{Pr as RoomConfirmHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,r,t,g,e,n,s,
|
|
1
|
+
import{p,r,t,g,e,n,s,S,d,_,Ye,Nt,ke,kt}from"./chunk-index-24cggw6k.js";import{ze}from"./chunk-index-3n38xe7m.js";import"./chunk-index-5j1v2q7w.js";import{Qt}from"./chunk-index-m76gdwnk.js";import{R}from"./chunk-index-cmzvq3nf.js";import{nn}from"./chunk-index-en728705.js";var h="room-menu-yolo",N="room-menu-long",b="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,f=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),u=d((o)=>o.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},k=async(o)=>{m(!0),await Nt(a.room,{longRunning:o}),m(!1)};return e(R,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:S("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:b,children:[e("span",{className:"menu-icon",children:e(s,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(Qt,{id:b,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await nn(a.room,!o),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:h,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(s,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(Qt,{id:h,checked:c.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),Nt(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(s,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(Qt,{id:N,checked:c.longRunning,label:t("Long-running mode"),onChange:k,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(s,{name:"chevron",size:16})]})}):null,a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent,{skills:!0})},children:[e("span",{className:"menu-icon",children:e(s,{name:"skills"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Skills")}),e("span",{className:"meta",children:t("Choose the skills this knight carries.")})]}),e(s,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),kt({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(s,{name:"chevron",size:16})]})}):null,a.readOnly||!f?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(p("tdx896xf"),import("./chunk-layout-actions-tdx896xf.js")).then((o)=>o.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:u?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),ze({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),ke({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,e,s,d}from"./chunk-index-24cggw6k.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-3n38xe7m.js";import{ci}from"./chunk-index-fb3kzyyp.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-yr758n6t.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>ci(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,t,u,e,n,s,
|
|
1
|
+
import{r,t,u,e,n,s,S,y,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{xe}from"./chunk-index-55ps4x5n.js";import"./chunk-index-cmzvq3nf.js";var h={mon:u("Mon"),tue:u("Tue"),wed:u("Wed"),thu:u("Thu"),fri:u("Fri"),sat:u("Sat"),sun:u("Sun")};function w(c){if(typeof c!=="object"||c===null)return"";let o=c,i=typeof o.time==="string"?o.time:"";switch(o.kind){case"once":return t("Once on {date} at {time}",{date:String(o.date??""),time:i});case"every":return Number(o.everyDays)===1?t("Every day at {time}",{time:i}):t("Every {count} days at {time}",{count:Number(o.everyDays),time:i});case"weekly":{let l=Array.isArray(o.weekdays)?o.weekdays.map((d)=>t(h[String(d)]??String(d))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:i})}default:return""}}function V(){let{timeZone:c}=_(),[o,i]=r(0),[l,d]=r(),{data:p,error:g}=xe(()=>y.schedules(),`schedules:${o}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),g?e(m,{message:g}):null,!p&&!g?e(v,{}):null,p&&p.schedules.length===0?e(k,{children:t("Nothing is scheduled. Ask a knight to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:p?.schedules.map((a)=>n("li",{className:"card schedule",children:[n("div",{className:"schedule-main",children:[n("div",{className:"card-head",children:[e("strong",{children:a.title}),a.lastStatus?e(Q,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[w(a.recurrence)," ·"," ",t("next {when}",{when:oe(a.nextRun,c)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:S("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>d(a),children:e(s,{name:"trash"})})]},a.id))}),e(D,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>d(void 0),onConfirm:async()=>{if(!l)return;await y.cancelSchedule(l.id),i((a)=>a+1),f(t("Schedule cancelled."))},children:e("p",{children:t("“{title}” will not run again. Runs that already happened stay in the conversation.",{title:l?.title??""})})})]})}export{V as SchedulesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bn}from"./chunk-index-24cggw6k.js";function M(t,l,d,g){let r,a=-1,i=!1,f=(e)=>e instanceof Element?e.closest("button, [data-seat]")??t:t,o=()=>{r?.cancel(),r=void 0,a=-1},p=(e)=>{if(i=!1,e.pointerType==="mouse"||!e.isPrimary)return;o();let n=l(e.target,e.clientX,e.clientY);if(!n)return;let u=f(e.target);a=e.pointerId,r=new bn((s)=>{if(i=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);d({...n,at:s,via:"hold",source:u})},g),r.begin(e.clientX,e.clientY)},m=(e)=>{if(e.pointerId===a&&r&&!i){if(!r.move(e.clientX,e.clientY))o()}},c=(e)=>{if(e.pointerId===a)o()},E=(e)=>{let n=l(e.target,e.clientX,e.clientY);if(!n)return;if(e.preventDefault(),i)return;o(),d({...n,at:{x:e.clientX,y:e.clientY},via:"contextmenu",source:f(e.target)})},v=(e)=>{if(i=!1,e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let n=l(e.target,-1,-1);if(!n)return;e.preventDefault();let u=f(e.target),s=u.getBoundingClientRect();d({...n,at:{x:s.left+Math.min(s.width/2,48),y:s.top+24},via:"key",source:u})},L=(e)=>{if(!i)return;i=!1,e.preventDefault(),e.stopPropagation()};return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",m),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",c),t.addEventListener("contextmenu",E),t.addEventListener("keydown",v),t.addEventListener("click",L,!0),()=>{o(),t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",m),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",E),t.removeEventListener("keydown",v),t.removeEventListener("click",L,!0)}}export{M as attachSeatMenu};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{p,T,x,E,o,L,C,a,r,t,u,g,e,n,s,X,d,fe,y,l,f,v,m,k,_,we,vn,Hr,fs,ke,Ti,ms,he,wn,te,De,Fn}from"./chunk-index-24cggw6k.js";import{Zo}from"./chunk-index-7xcbpeqz.js";import{D}from"./chunk-index-6btdp13p.js";import{vo,js,Ks,xo,ea}from"./chunk-index-n3khm9fq.js";import{Ms,po,Rs}from"./chunk-index-mr391t49.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-5j1v2q7w.js";import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-nn4w6a04.js";import{Yn}from"./chunk-index-fn6305vn.js";import{Pn}from"./chunk-index-7mrkq793.js";import{fn,ji,Ur,Ki}from"./chunk-index-a7e6rhxy.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{Ft}from"./chunk-index-3tksdmx7.js";import{Qt}from"./chunk-index-m76gdwnk.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import{R}from"./chunk-index-cmzvq3nf.js";import"./chunk-index-wsv46y9p.js";import{nn}from"./chunk-index-en728705.js";import"./chunk-index-5w6tb7p0.js";import{re,Ne}from"./chunk-index-wgrx2ybn.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";import{Y}from"./chunk-index-d941ae7c.js";var Ke=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((i)=>({default:i.HistorySheet}))),Qe=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ue=["default","off","minimal","low","medium","high","xhigh"],Ae={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},q="default",Ee=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),qe=u("Automatic"),pe=(i)=>i==="auto"?t(qe):t(Ae[i]??i),Se=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??q,thinking:i.thinking??q});function Ce(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??q)?{model:h.model}:{},...h.thinking!==(i.thinking??q)?{thinking:h.thinking}:{}}}function xe(){let i=fs(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)vn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:vn,children:e(Ze,{name:c.name,opened:c.id},c.name)})}function Ze({name:i,opened:h}){let[c,N]=r(),[w,b]=r([]),[I,B]=r(),[M,z]=r(),[G,Q]=r(!1),[S,A]=r(!1),[V,W]=r(!1),[K,Z]=r(!1),se=Fn(c?.room??""),ee=a(null),ne=c!==void 0,J=d((F)=>c?F.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[ie,U]=r(!1),le=d((F)=>c?F.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),oe=L(),ae=L(),O=L();o(()=>{if(!ne||!Hr()?.look)return;ee.current?.scrollIntoView({block:"start"}),ee.current?.focus({preventScroll:!0})},[ne,h]);let P=a({});P.current={profile:c,draft:M},o(()=>{let F=!0;return Promise.all([y.agent(i),y.models()]).then(([ce,_e])=>{if(!F)return;let{profile:ye,draft:ue}=P.current,je=ye&&ue&&Object.keys(Ce(ye,ue)).length>0;N(ce),b(_e.models),z(je?ue:Se(ce))},(ce)=>F&&B(l(ce))),()=>{F=!1}},[i,h]);let j=C(()=>c&&M?Ce(c,M):{},[c,M]);if(I)return e(m,{message:I});if(!c||!M)return e(v,{});let ve=Object.keys(j).length>0,Be=Array.from(new Set([q,...w,M.model])),We=Ee(c),be=async()=>{Q(!0);try{let F=await y.updateAgent(i,j);N(F),z(Se(F)),A(!1),f(t("Saved."))}catch(F){f(l(F),"danger")}finally{Q(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:c.character,name:c.name,size:72,state:se,label:c.displayName}),n("div",{children:[e("h3",{children:c.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:c.effective.model,thinking:pe(c.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,children:[e("span",{className:"menu-icon",children:e(s,{name:J?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(Qt,{id:O,checked:!J,label:t("Notifications"),busy:ie,onChange:async(F)=>{U(!0),await nn(c.room,!F),U(!1)}})]})})}),S?e(et,{profile:c,draft:M,saving:G,onBack:()=>A(!1),onSave:be}):n("form",{className:"stack form",onSubmit:(F)=>{if(F.preventDefault(),!ve)return;if(j.prompt!==void 0)A(!0);else be()},children:[n("label",{htmlFor:ae,children:[t("Name"),e("input",{id:ae,value:M.displayName,onChange:(F)=>z({...M,displayName:F.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:oe,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Z(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>W(!0),children:[e(Je,{}),t("Full screen")]})]})]}),e("textarea",{id:oe,rows:8,value:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})]}),e(Ft,{label:t("Model"),value:M.model,onChange:(F)=>z({...M,model:F}),options:Be.map((F)=>({value:F,label:F===q?We:F}))}),e(Ft,{label:t("Thinking level"),value:M.thinking,onChange:(F)=>z({...M,thinking:F}),options:Ue.map((F)=>({value:F,label:t(Ae[F])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ve||G,children:G?t("Saving…"):j.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Xe,{name:i,opened:h}),n("section",{className:"card stack",ref:ee,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(T,{fallback:e(v,{}),children:e(Qe,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.character,onSaved:(F)=>N(F)})})]}),le?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{vn(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.displayName})})})]}),K?e(T,{fallback:null,children:e(Ke,{open:K,title:t("History of the prompt"),load:async()=>(await de.agentPromptHistory(i)).versions.map((F)=>({id:F.id,text:F.text,previous:F.previous,by:F.by,at:F.at})),onUse:(F)=>{z({...M,prompt:F}),Z(!1)},onClose:()=>Z(!1)})}):null,e(R,{open:V,title:t("Prompt"),size:"full",onClose:()=>W(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})})]})}function Xe({name:i,opened:h}){let[c,N]=r(),[w,b]=r(),[I,B]=r(),M=L(),z=a(null),G=c!==void 0;if(o(()=>{if(!G||!Hr()?.skills)return;z.current?.scrollIntoView({block:"start"}),z.current?.focus({preventScroll:!0})},[G,h]),o(()=>{let A=!0;return re.skills(i).then((V)=>A&&N(V),(V)=>{if(A&&!(V instanceof fe&&V.status===404))B(l(V))}),()=>{A=!1}},[i,h]),I)return e(m,{message:I});if(!c)return null;let Q=()=>re.skills(i).then(N,(A)=>{f(l(A),"danger")}),S=async(A,V)=>{b(A);try{N(await re.setSkills(i,V?{add:[A]}:{remove:[A]}))}catch(W){f(l(W),"danger")}finally{b(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:z,tabIndex:-1,children:[e("h3",{children:t("Skills ({count})",{count:c.skills.filter((A)=>A.carried).length})}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:c.skills.map((A,V)=>{let W=`${M}-${V}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:W,children:[n("span",{className:"menu-text",children:[e("strong",{children:A.name}),e("span",{className:"meta",children:A.missing?t("Its file cannot be read."):A.builtin?t("Built in: every knight carries it."):A.description??""})]}),e(Qt,{id:W,checked:A.carried,label:A.name,busy:w===A.name,disabled:A.builtin,onChange:(K)=>S(A.name,K)})]})},A.name)})}),e(Ye,{name:i,view:c,onApplied:Q})]})}function Ye({name:i,view:h,onApplied:c}){let[N,w]=r(),[b,I]=r(),B=L();if(o(()=>{let S=!0;return de.skillGroups().then((A)=>S&&w(A.groups),()=>{return}),()=>{S=!1}},[]),!N?.length)return null;let M=new Set(h.skills.filter((S)=>S.carried).map((S)=>S.name)),z=new Set(h.skills.filter((S)=>S.builtin).map((S)=>S.name)),G=(S)=>S.skills.filter((A)=>!M.has(A)),Q=(S)=>S.skills.filter((A)=>M.has(A)&&!z.has(A));return n("div",{className:"stack skill-apply",children:[e("h4",{children:t("Skill groups")}),e("p",{className:"meta",children:t("Switching a group on switches on its skills this knight lacks; switching it off switches off its skills, built-in ones excepted.")}),e("ul",{className:"menu",children:N.map((S,A)=>{let V=G(S),W=V.length===0;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:`${B}-group-${A}`,children:[n("span",{className:"menu-text",children:[e("strong",{children:S.name}),e("span",{className:"meta",children:W?t("Carries all of it."):t("Lacks {count}: {skills}",{count:V.length,skills:V.join(", ")})})]}),e(Qt,{id:`${B}-group-${A}`,checked:W,label:t("Skill group {name}",{name:S.name}),disabled:W&&Q(S).length===0,onChange:(K)=>I({group:S,on:K})})]})},S.name)})}),e(D,{open:b!==void 0,title:b?.on?t("Switch this skill group on?"):t("Switch this skill group off?"),confirmLabel:b?.on?t("Switch on"):t("Switch off"),tone:b?.on?"primary":"danger",onClose:()=>I(void 0),onConfirm:async()=>{if(!b)return;let{added:S,removed:A}=await de.applySkillGroup(b.group.name,i,b.on);f(S.length?t("Switched on: {skills}",{skills:S.join(", ")}):A.length?t("Switched off: {skills}",{skills:A.join(", ")}):t("Nothing changed for {name}.",{name:b.group.name})),c()},children:e("p",{children:b?b.on?t("{agent} will also carry: {skills}.",{agent:i,skills:G(b.group).join(", ")}):t("{agent} will no longer carry: {skills}.",{agent:i,skills:Q(b.group).join(", ")}):null})})]})}var Je=()=>e("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e("path",{d:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"})});function et(i){let{profile:h,draft:c}=i,N=a(null);o(()=>N.current?.focus(),[]);let w=[];if(c.displayName!==h.displayName)w.push({label:t("Name"),before:h.displayName,after:c.displayName});let b=(I)=>I===q?Ee(h):I;if(c.model!==(h.model??q))w.push({label:t("Model"),before:b(h.model??q),after:b(c.model)});if(c.thinking!==(h.thinking??q))w.push({label:t("Thinking level"),before:pe(h.thinking??q),after:pe(c.thinking)});return n("section",{ref:N,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),w.length?e("ul",{className:"review-fields",children:w.map((I)=>n("li",{children:[e("strong",{children:I.label}),e("span",{className:"review-before",children:I.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:I.after})]},I.label))}):null,e(gt,{label:t("Prompt"),before:h.prompt,after:c.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}var tt=300000;function Me(){let i=Ks(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return e(R,{open:i!==void 0,title:t("Archived conversation"),size:"wide",onClose:js,children:e(nt,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function nt(i){Y("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),c=De(),[N,w]=r(),[b,I]=r(!1),[B,M]=r(),[z,G]=r(!1),{room:Q,until:S}=i;o(()=>{let V=!0;return vo.page(Q,S).then((W)=>{if(!V)return;w(W.messages),I(W.more)},(W)=>{if(V)M(l(W))}),()=>{V=!1}},[Q,S]);let A=async()=>{let V=N?.[0];if(!V||z)return;G(!0);try{let W=await vo.page(Q,S,V.id);w((K)=>[...W.messages,...K??[]]),I(W.more)}catch(W){M(l(W))}G(!1)};if(B)return e(m,{message:B});if(!N)return e(v,{});if(N.length===0)return e(k,{children:t("The archived conversation has no messages.")});return n("div",{className:"archived-log",children:[b?e("button",{type:"button",className:"secondary older",disabled:z,onClick:A,children:z?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:N.map((V,W)=>{let K=N[W-1],Z=!K||K.kind!==V.kind||K.author!==V.author||Date.parse(V.at)-Date.parse(K.at)>tt;return e(wn,{message:V,character:V.agent?c[V.agent]:void 0,header:Z,enter:!1,unread:!1,timeZone:h,quotable:!1},V.id)})})]})}function ot(i){let{message:h}=i,[c,N]=r(h.text),w=a(null);o(()=>{w.current?.focus(),w.current?.setSelectionRange(c.length,c.length)},[c.length]);let b=c.trim(),I=b===""&&h.files.length===0;return n("form",{className:"stack",onSubmit:(M)=>{if(M.preventDefault(),I)return;if(b!==h.text)Ms(h,b);i.onClose()},children:[e("div",{className:"field",children:e("textarea",{ref:w,className:"queued-edit-text",rows:6,value:c,"aria-label":t("Edit"),onChange:(M)=>N(M.target.value)})}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:I,children:t("Save")})]})]})}function Le(){let i=Rs(),h=a(void 0);if(i)h.current=i;let c=h.current;if(!c)return null;return e(H,{open:i!==void 0,title:t("Edit"),onClose:po,children:e(ot,{message:c,onClose:po},c.id)})}var at=`
|
|
2
|
+
.sheet:has(.select-text) {
|
|
3
|
+
-webkit-user-select: none;
|
|
4
|
+
user-select: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.select-text {
|
|
8
|
+
flex: 1;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: var(--space-3);
|
|
11
|
+
overflow-wrap: anywhere;
|
|
12
|
+
white-space: pre-wrap;
|
|
13
|
+
border: 1px solid var(--border);
|
|
14
|
+
border-radius: var(--radius-md);
|
|
15
|
+
background: var(--surface-2);
|
|
16
|
+
font: inherit;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
-webkit-touch-callout: default;
|
|
19
|
+
-webkit-user-select: text;
|
|
20
|
+
user-select: text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.select-text-actions {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: flex-end;
|
|
26
|
+
gap: var(--space-2);
|
|
27
|
+
margin-top: var(--space-3);
|
|
28
|
+
}
|
|
29
|
+
`;function Te(){let i=ea(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return Y("select-text",at),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:xo,children:[e("p",{className:"hint",children:h.author}),e("pre",{className:"select-text",children:h.text}),n("div",{className:"select-text-actions",children:[e("button",{type:"button",className:"secondary",onClick:xo,children:t("Close")}),e("button",{type:"button",onClick:()=>Yn(h.text),children:t("Copy all")})]})]})}function st(i){let h=i.filter((w)=>w.parent!==void 0),c=i.filter((w)=>w.parent===void 0),N=new Set(c.map((w)=>w.name));return[...c.flatMap((w)=>[w,...h.filter((b)=>b.parent===w.name)]),...h.filter((w)=>!N.has(w.parent??""))]}function He(){let[i,h]=r(),[c,N]=r(),[w,b]=r(),[I,B]=r(),M=E(async()=>{try{h((await re.archive()).entries),N(void 0)}catch(G){N(l(G))}},[]);o(()=>{M()},[M]);let z=async(G)=>{b(G.name);try{if(G.kind==="agent")await re.restoreAgent(G.name);else await re.restoreGroup(G.name);await Ne(),f(t("Restored {name}.",{name:G.displayName})),await M()}catch(Q){f(l(Q),"danger")}finally{b(void 0)}};if(c&&!i)return e(m,{message:c});if(!i)return e(v,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:st(i).map((G)=>n("li",{className:"menu-item","data-helper":G.parent??void 0,style:G.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(s,{name:G.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:G.displayName}),n("span",{className:"meta",children:[G.parent?t("Temp knight of {name}",{name:G.parent}):G.kind==="agent"?t("Knight"):t("Group")," ","· ",G.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:w===G.name,onClick:()=>z(G),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:w===G.name,onClick:()=>B(G),children:t("Delete")})]},`${G.kind}:${G.name}`))}),e(D,{open:I!==void 0,title:t("Delete {name}?",{name:I?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>B(void 0),onConfirm:async()=>{if(!I)return;if(I.kind==="agent")await re.deleteAgent(I.name);else await re.deleteGroup(I.name);await Ne(),f(t("Deleted {name}.",{name:I.displayName})),await M()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:I?.displayName??""})})})]})}var Ie=/^[a-z0-9-]{1,32}$/,Pe=2,$e=8,me="\x00";function rt(){let i=d((h)=>h.order.flatMap((c)=>{let N=h.rooms[c]?.view;return N?.kind==="agent"&&!N.helper?[`${N.name}${me}${N.displayName}`]:[]}).join(`${me}${me}`));return C(()=>i===""?[]:i.split(`${me}${me}`).map((h)=>{let[c="",N=""]=h.split(me);return{name:c,displayName:N}}),[i])}function Fe(i){let h=rt(),[c,N]=r(),[w,b]=r(),[I,B]=r(""),[M,z]=r(""),[G,Q]=r(!1),[S,A]=r([]),[V,W]=r(""),[K,Z]=r(!1),[se,ee]=r(i.name===void 0),ne=L(),J=L();o(()=>{let O=i.name;if(O===void 0)return;let P=!0;return re.group(O).then((j)=>{if(!P)return;N(j),B(j.displayName),A(j.members),W(j.host),ee(!0)},(j)=>P&&b(l(j))),()=>{P=!1}},[i.name]);let ie=(O)=>h.find((P)=>P.name===O)?.displayName??O,U=S.includes(V)?V:S[0]??"",le=c===void 0?!0:I.trim()!==c.displayName||S.join(",")!==c.members.join(",")||U!==c.host,oe=I.trim()!==""&&S.length>=Pe&&S.length<=$e&&(c!==void 0||Ie.test(M));if(w&&!se)return e(m,{message:w});if(!se)return e(v,{});let ae=async()=>{Z(!0),b(void 0);try{if(c){await re.updateGroup(c.name,{...I.trim()!==c.displayName?{displayName:I.trim()}:{},...S.join(",")!==c.members.join(",")?{members:S}:{},...U!==c.host?{host:U}:{}}),await Ne(),f(t("Saved.")),i.onDone();return}let O=await re.createGroup({name:M,displayName:I.trim(),members:S,host:U});await Ne(),f(t("Made {name}.",{name:O.displayName})),i.onDone(),X("room",O.room)}catch(O){b(l(O))}finally{Z(!1)}};return n("form",{className:"stack form",onSubmit:(O)=>{if(O.preventDefault(),oe&&le&&!K)ae()},children:[n("label",{htmlFor:ne,children:[t("Name"),e("input",{id:ne,value:I,autoComplete:"off",onChange:(O)=>{if(B(O.target.value),!c&&!G)z(O.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:J,children:[t("Permanent name"),e("input",{id:J,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!Ie.test(M),onChange:(O)=>{Q(!0),z(O.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 8 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((O)=>{let P=S.includes(O.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:P,disabled:!P&&S.length>=$e,onChange:()=>A(P?S.filter((j)=>j!==O.name):[...S,O.name])}),e("span",{className:"menu-text",children:e("strong",{children:O.displayName})})]})},O.name)})})]}),S.length>=Pe?e(Ft,{label:t("Host"),value:U,onChange:W,options:S.map((O)=>({value:O,label:ie(O)}))}):null,w?e(m,{message:w}):null,n("div",{className:"actions",children:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!oe||!le||K,children:K?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var it=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ge=/^[a-z0-9-]{1,32}$/,ge="default";function lt(i){let h=[];for(let c of i){let N=c.indexOf("/"),w=N>0?c.slice(0,N):"",b=h.find((I)=>I.provider===w&&w!=="");if(b)b.models.push(c);else h.push({provider:w,models:[c]})}return h}var mt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Ve({onDone:i}){let[h,c]=r(""),[N,w]=r(""),[b,I]=r(!1),[B,M]=r(""),[z,G]=r(ge),[Q,S]=r(""),[A,V]=r(),[W,K]=r(!1),[Z,se]=r([]),[ee,ne]=r(),[J,ie]=r(!1),U=[L(),L(),L(),L(),L()];o(()=>{let P=!0;return y.models().then((j)=>P&&se(j.models),()=>{return}),()=>{P=!1}},[]);let le=C(()=>Pn({name:N,displayName:h,prompt:B}),[N,h,B]),oe=A?.spec??le,ae=Ge.test(N)&&h.trim()!==""&&B.trim()!=="";if(W)return e(T,{fallback:e(v,{}),children:e(it,{name:N||"new",displayName:h,prompt:B,character:oe,onPick:(P,j)=>{V({input:P,spec:j}),K(!1)},onCancel:()=>K(!1)})});let O=async()=>{ie(!0),ne(void 0);try{let P={name:N,displayName:h.trim(),prompt:B,...z!==ge?{model:z}:{},...Q.trim()?{task:Q.trim()}:{},...A?{character:A.input}:{}},j=await re.createAgent(P);await Ne(),f(t("Made {name}.",{name:j.displayName})),i(),X("room",j.room)}catch(P){ne(P instanceof fe&&P.field?`${P.field}: ${l(P)}`:l(P))}finally{ie(!1)}};return n("form",{className:"stack form",onSubmit:(P)=>{if(P.preventDefault(),ae&&!J)O()},children:[n("label",{htmlFor:U[0],children:[t("Name"),e("input",{id:U[0],value:h,autoComplete:"off",onChange:(P)=>{if(c(P.target.value),!b)w(mt(P.target.value))}})]}),n("label",{htmlFor:U[1],children:[t("Permanent name"),e("input",{id:U[1],value:N,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":N!==""&&!Ge.test(N),onChange:(P)=>{I(!0),w(P.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:U[2],children:[t("Prompt"),e("textarea",{id:U[2],rows:6,value:B,onChange:(P)=>M(P.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:U[4],children:[t("Model"),n(Re,{id:U[4],value:z,onChange:(P)=>G(P.target.value),children:[e("option",{value:ge,children:t("Default model")}),lt(Z).map((P)=>P.provider===""?P.models.map((j)=>e("option",{value:j,children:j},j)):e("optgroup",{label:P.provider,children:P.models.map((j)=>e("option",{value:j,children:j},j))},P.provider))]})]}),n("label",{htmlFor:U[3],children:[t("Opening task"),e("textarea",{id:U[3],rows:3,value:Q,onChange:(P)=>S(P.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(he,{spec:oe,name:N||"new",size:72,label:h}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:A?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>K(!0),children:t("Choose a look")})]})]}),ee?e(m,{message:ee}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ae||J,children:J?t("Making…"):t("Make knight")})})]})}var ct=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Oe(){let i=ms(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)Ti()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:ct(c),size:"wide",onClose:Ti,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Ve,{onDone:Ti}):c.kind==="archive"?e(He,{}):e(Fe,{...c.name===void 0?{}:{name:c.name},onDone:Ti})},c.id)})}function ze(){let i=Ur(),h=a(!1);if(i)h.current=!0;return h.current?e(ut,{open:i}):null}function ut({open:i}){let h=_(),{now:c}=te(),N=d((b)=>fn(b).map(({id:I,card:B})=>{let M=b.rooms[B.room]?.view,z=M?.parent?b.rooms[M.parent]?.view:void 0;return{id:I,room:z?`${z.displayName} › ${M?.displayName??""}`:M?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),w=N.length===0;return o(()=>{if(i&&w)ji()},[i,w]),e(R,{open:i&&!w,title:t("Cards waiting"),onClose:ji,children:e("ul",{className:"waiting-list",children:N.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>Ki(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${we(b.at,c,h.timeZone)}`:""]})]})},b.id))})})}var dt=x(()=>(p("434sqnxc"),import("./chunk-shortcut-help-434sqnxc.js")));function pt(){let i=Zo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(T,{fallback:null,children:e(dt,{open:i})})}function Do(){return n(g,{children:[e(Pr,{}),e(Le,{}),e(xe,{}),e(Oe,{}),e(Me,{}),e(Te,{}),e(ze,{}),e(pt,{})]})}export{Do as SheetHosts};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{t,e,n}from"./chunk-index-24cggw6k.js";import{li,Yo}from"./chunk-index-7xcbpeqz.js";import{R}from"./chunk-index-cmzvq3nf.js";import{Y}from"./chunk-index-d941ae7c.js";var o=`
|
|
2
|
+
.shortcut-list {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: var(--space-3) var(--space-4);
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.shortcut-list dt {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: var(--space-1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.shortcut-list dd {
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.shortcut-list kbd {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
min-width: 1.6rem;
|
|
23
|
+
text-align: center;
|
|
24
|
+
font-size: var(--text-sm);
|
|
25
|
+
}
|
|
26
|
+
`;function r(){let a=Yo(),s=a?"⌥":"Alt",l=a?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[l,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["↑"],label:t("Edit your latest message that is still waiting, from an empty message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:a}){return Y("shortcut-help",o),e(R,{open:a,title:t("Keyboard shortcuts"),onClose:li,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((l)=>e("kbd",{children:l},l))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Un,S,X,Ae,O,ot,wt}from"./chunk-index-24cggw6k.js";import{Ar}from"./chunk-index-97dcp1vh.js";import{_o}from"./chunk-index-nr275sa7.js";import{Ci,Ei}from"./chunk-index-mr391t49.js";import{Go,li,Wo}from"./chunk-index-7xcbpeqz.js";import{st}from"./chunk-index-6rdywten.js";function y(e,t){let{collapsed:n,expanded:r,current:s}=t,o=st(e,t.at),a=[],d=(i,c)=>{a.push({key:i,shown:c});let f=o.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:c});for(let l of f.closed)a.push({key:l,shown:c&&(r.has(l)||l===s)})};for(let i of o.home)d(i,!0);for(let i of o.pinned)d(i,!0);for(let i of o.folders){let c=!n.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)d(f,c)}let u=o.folders.length>0?o.rest:[...o.restAgents,...o.restGroups];for(let i of u)d(i,!0);let{orphans:m}=o;for(let i of m.open)a.push({key:i,shown:!0});for(let i of m.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function h(e,t,n,r){let s=n===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((o)=>o.key===t),s<0)return}for(let o=s+n;o>=0&&o<e.length;o+=n){let a=e[o];if(a&&r(a))return a.key}return}var k=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function g(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return k.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function w(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:o,selectionEnd:a}=e;if(o===null||a===null||o!==a)return!1;return t?o===0:o===e.value.length}if((e.textContent??"")==="")return!0;let n=window.getSelection();if(!n||n.rangeCount===0||!n.isCollapsed)return!1;let r=n.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function E(){let e=Un();if(e.pane!=="room"||e.key===void 0)return;return(O.getState().rooms[e.key]?.messages??[]).findLast(Ci)}var x=(e)=>e instanceof HTMLTextAreaElement&&e.closest(".composer")!==null&&e.value===""&&!e.readOnly;function T(e){if(e.defaultPrevented||ot(e))return;let{key:t}=e;if(t==="Escape")return e.altKey||e.ctrlKey||e.metaKey?void 0:"escape";if(e.altKey&&!e.ctrlKey&&!e.metaKey){if(t!=="ArrowUp"&&t!=="ArrowDown")return;let n=t==="ArrowUp",r=g(e.target);if(r&&!w(r,n))return;if(e.shiftKey)return n?"previous-unread":"next-unread";return n?"previous":"next"}if(t==="ArrowUp"&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.repeat)return x(e.target)&&E()?"edit-queued":void 0;if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return g(e.target)?void 0:"help";return}function K(){let e=new Set;for(let t of document.querySelectorAll("details.thread-closed[open] [data-thread]"))if(t.dataset.thread)e.add(t.dataset.thread);return e}var p=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function b(e,t=12){let n=S("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===n);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>b(e,t-1))}function H(e,t){let n=O.getState(),r=Un(),s=r.pane==="room"?r.key:void 0,o=y(n,{at:(u)=>Ae(n,u),collapsed:Ar(),expanded:K(),current:s});if(r.pane==="room"&&!o.some((u)=>u.key===s))return;let d=h(o,s,e,t?(u)=>_o(u.key)>0:(u)=>u.shown);if(d===void 0)return;X("room",d),b(d)}function L(e){if(document.querySelector(".action-popover")){e.preventDefault(),wt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&k.has(t.type))e.preventDefault(),t.blur()}function A(e,t){switch(e){case"escape":L(t);break;case"help":if(t.preventDefault(),Wo())li();else if(!p())Go();break;case"edit-queued":{if(p())break;let n=E();if(!n)break;t.preventDefault(),Ei(n);break}default:if(p())break;t.preventDefault(),H(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function G(){let e=(t)=>{let n=T(t);if(n)A(n,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{G as startShortcuts};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{p,T,x,o,L,r,t,g,e,n,s,fe,l,f,v,m}from"./chunk-index-24cggw6k.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";var B=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((d)=>({default:d.HistorySheet}))),O=`---
|
|
2
|
+
name: my-skill
|
|
3
|
+
description: "Use when "
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# My skill
|
|
7
|
+
|
|
8
|
+
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":O),[y,z]=r(),[A,k]=r(!1),[S,N]=r(!1),[U,D]=r(!1),[H,C]=r(!1),E=L();o(()=>{if(!u)return;let a=!0;return de.skillDocument(u).then((c)=>{if(!a)return;w(c),b(c.text)},(c)=>a&&z(l(c))),()=>{a=!1}},[u]);let F=i?.text??"",V=h!==F,I=u!==void 0&&!i&&!y,K=async()=>{N(!0);try{if(i){let a=await de.saveSkillDocument(i.name,{text:h,baseHash:i.hash});w(a),b(a.text),k(!1),D(!1),f(t("Saved.")),d.onSaved()}else await de.createSkillDocument({text:h}),f(t("Skill created.")),d.onSaved(),d.onClose()}catch(a){if(a instanceof fe&&a.status===409){let{current:c}=a.body;w(c),D(!0)}else f(l(a),"danger")}finally{N(!1)}};return n(R,{open:!0,title:u??t("New skill"),size:"full",onClose:d.onClose,children:[y?e(m,{message:y}):null,I?e(v,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!I&&!y&&(!i||i.writable)?n("div",{className:"stack",children:[A?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),U?e(m,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(gt,{label:"SKILL.md",before:F,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:S,onClick:()=>k(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:S,onClick:K,children:S?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:E,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>C(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:E,className:"prompt-full",spellCheck:!1,value:h,onChange:(a)=>b(a.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!V||!h.trim(),onClick:()=>k(!0),children:t("Review changes")})})]}),H&&i?e(T,{fallback:null,children:e(B,{open:H,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await de.skillHistory(i.name);return a.map((c,M)=>({id:c.id,text:c.text,previous:a[M+1]?.text??"",by:c.by,at:c.at}))},onUse:(a)=>{b(a),k(!1),C(!1)},onClose:()=>C(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Br,T,x,o,r,t,g,e,n,s,y,l,f,v,m,k,Q,Yt,Et}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{ln}from"./chunk-index-2g8xtwqg.js";import{de}from"./chunk-index-prq011b6.js";import{xe}from"./chunk-index-55ps4x5n.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";function F({source:a}){return e("div",{className:"prose document",children:e(Yt,{remarkPlugins:[Et],components:{a:({href:i,children:d})=>i&&/^https?:\/\//.test(i)?e("a",{href:i,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:i})=>e("span",{children:i}),pre:({children:i})=>e("div",{className:"code-block",children:e("pre",{children:i})}),table:({children:i})=>e("div",{className:"table-wrap",children:e("table",{children:i})})},children:a})})}function B(a){let{data:i,error:d,reload:c}=ln(()=>de.skillGroups()),[w,u]=r(),[N,E]=r(),h=()=>{c(),a.onChanged()};return n("section",{className:"stack","aria-label":t("Skill groups"),children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skill groups")}),n("button",{type:"button",className:"secondary",onClick:()=>u({group:void 0}),children:[e(s,{name:"plus",size:16}),t("New group")]})]}),e("p",{className:"hint",children:t("A group lists skills to switch on for a knight in one step, from the knight's sheet. Knights carry the skills, not the group.")}),d?e(m,{message:d}):null,!i&&!d?e(v,{}):null,i?.groups.length===0?e(k,{children:t("No skill groups.")}):null,i?.groups.map((b)=>n("article",{className:"card skill-group",children:[n("div",{className:"card-head",children:[e("strong",{children:b.name}),e("button",{type:"button",className:"secondary",onClick:()=>u({group:b}),children:t("Edit")}),e("button",{type:"button",className:"secondary",onClick:()=>E(b),children:t("Delete")})]}),e("p",{children:b.description}),n("p",{className:"hint",children:[t("Skills"),": ",b.skills.join(", ")||t("None")]})]},b.name)),e(H,{open:w!==void 0,title:w?.group?t("Edit {name}",{name:w.group.name}):t("New skill group"),onClose:()=>u(void 0),children:w?e(A,{group:w.group,catalog:a.catalog,onCancel:()=>u(void 0),onDone:()=>{u(void 0),h()}},w.group?.name??""):null}),e(D,{open:N!==void 0,title:t("Delete this skill group?"),confirmLabel:t("Delete group"),tone:"danger",onClose:()=>E(void 0),onConfirm:async()=>{if(!N)return;await de.deleteSkillGroup(N.name),f(t("Deleted {name}.",{name:N.name})),h()},children:e("p",{children:t("{name} will be deleted. Its skills stay, and so does every knight that carries them.",{name:N?.name??""})})})]})}function A(a){let[i,d]=r(a.group?.name??""),[c,w]=r(a.group?.description??""),[u,N]=r(a.group?.skills??[]),[E,h]=r(),[b,V]=r(!1);return n("form",{className:"stack",onSubmit:async(C)=>{C.preventDefault(),V(!0),h(void 0);try{let G=a.group?.name;await de.saveSkillGroup(i.trim(),{description:c,skills:[...a.catalog.map((L)=>L.name).filter((L)=>u.includes(L)),...u.filter((L)=>!a.catalog.some((z)=>z.name===L))],...G?{from:G}:{}}),f(t("Saved {name}.",{name:i.trim()})),a.onDone()}catch(G){h(l(G))}finally{V(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:i,maxLength:64,placeholder:"coding",required:!0,onChange:(C)=>d(C.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and single hyphens, up to 64.")})]}),n("label",{children:[t("Description"),e("textarea",{value:c,maxLength:1000,rows:2,required:!0,onChange:(C)=>w(C.target.value)})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Skills")}),e("ul",{className:"menu",children:a.catalog.map((C)=>{let G=u.includes(C.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:G,onChange:()=>N(G?u.filter((L)=>L!==C.name):[...u,C.name])}),n("span",{className:"menu-text",children:[e("strong",{children:C.name}),C.description?e("span",{className:"meta",children:C.description}):null]})]})},C.name)})})]}),E?e(m,{message:E}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:b,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:b,children:t("Save group")})]})]})}var I=x(()=>(p("98492yrt"),import("./chunk-skill-editor-98492yrt.js")).then((a)=>({default:a.SkillEditor})));function ye(){let[a,i]=r(0),{data:d,error:c}=xe(()=>y.skills(),`skills:${a}`),[w,u]=r(),[N,E]=r(),[h,b]=r();o(()=>{y.session().then(u,()=>{return})},[]);let V=w?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),V?n("button",{type:"button",className:"secondary",onClick:()=>E({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:V?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),c?e(m,{message:c}):null,!d&&!c?e(v,{}):null,d?.length===0?e(k,{children:t("No skills.")}):null,d?.map((S)=>e(R,{skill:S,onEdit:V&&S.source.kind==="written"?()=>E({name:S.name}):void 0,onDelete:V&&S.source.kind==="written"?()=>b(S):void 0},`${S.name}:${a}`)),V?e(B,{catalog:d??[],onChanged:()=>i((S)=>S+1)}):null,N?e(T,{fallback:null,children:e(I,{name:N.name,onSaved:()=>i((S)=>S+1),onClose:()=>E(void 0)},N.name??"")}):null,e(D,{open:h!==void 0,title:t("Delete this skill?"),confirmLabel:t("Delete skill"),tone:"danger",onClose:()=>b(void 0),onConfirm:async()=>{if(!h)return;await de.deleteSkillDocument(h.name),i((S)=>S+1),f(t("Deleted {name}.",{name:h.name}))},children:h?e(M,{skill:h}):null})]})}function M({skill:a}){return n(g,{children:[e("p",{children:a.carriers.length?t("{name} will be deleted and taken from the knights that carry it: {carriers}.",{name:a.name,carriers:a.carriers.join(", ")}):t("{name} will be deleted. No knight carries it.",{name:a.name})}),a.groups.length?e("p",{children:t("It also leaves the skill groups {groups}.",{groups:a.groups.join(", ")})}):null,e("p",{children:t("This cannot be undone.")})]})}function O(a){switch(a.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:a.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${a.repo}:${a.path}`});default:return}}function R({skill:a,onEdit:i,onDelete:d}){let[c,w]=r(!1),[u,N]=r(),[E,h]=r(),b=a.source.kind==="builtin"?t("Built-in"):a.source.kind==="written"?t("Knight-written"):a.source.kind==="package"?a.source.package:`${a.source.repo}:${a.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(Q,{children:b}),a.missing?e(Q,{tone:"warn",children:t("File missing")}):n(g,{children:[i?e("button",{type:"button",className:"secondary",onClick:i,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(w(!0),!u)h(void 0),y.skill(a.name).then(N).catch((V)=>h(l(V)))},children:"SKILL.md"})]}),d?e("button",{type:"button",className:"secondary",onClick:d,children:t("Delete")}):null]}),e("p",{children:a.missing??a.description}),a.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(s,{name:"lock",size:14}),e("span",{children:O(a.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",a.source.kind==="builtin"?t("All knights"):a.carriers.join(", ")||t("None")]}),a.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",a.groups.join(", ")]}):null,e(H,{open:c,title:a.name,size:"wide",onClose:()=>w(!1),children:E?e(m,{message:E}):!u?e(v,{}):e(K,{title:a.name,detail:u})})]})}function K({title:a,detail:i}){let d=i.metadata.filter((c)=>!(c.key==="name"&&c.value===a));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((c)=>n(Br,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(F,{source:i.body})]})}export{ye as SkillsPage};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{t,g,e,n,s,d}from"./chunk-index-24cggw6k.js";import{Hs}from"./chunk-index-n3khm9fq.js";import{Y}from"./chunk-index-d941ae7c.js";var l=`
|
|
2
|
+
.line.start-over {
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
margin-top: var(--space-4);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.line.start-over .link-button {
|
|
8
|
+
min-height: 1.75rem;
|
|
9
|
+
font-size: inherit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.start-over-empty {
|
|
13
|
+
margin-top: var(--space-6);
|
|
14
|
+
font-size: var(--text-sm);
|
|
15
|
+
}
|
|
16
|
+
`;function p(a){Y("start-over",l);let{message:o}=a,i=d((m)=>{let r=m.rooms[o.room];return r?.messages.at(-1)?.id===o.id&&r.pending.length===0&&r.live.length===0});return n(g,{children:[n("li",{className:"line start-over","data-enter":a.enter||void 0,children:[e(s,{name:"reset",size:14}),e("span",{children:t("Conversation started over")}),e("button",{type:"button",className:"link-button",onClick:()=>Hs(o.room,o.id),children:t("View the archived conversation")})]}),i?e("li",{className:"line start-over-empty",children:e("span",{children:t("No messages yet. Say hello.")})}):null]})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C,a,r,t,
|
|
1
|
+
import{C,a,r,t,G,g,e,n,s,S,X,Ke,Ae,d,ot,jt,xn,Je,Ue,Kt}from"./chunk-index-24cggw6k.js";import{yi}from"./chunk-index-d74tpnkd.js";import{mi,gi}from"./chunk-index-sz381vda.js";import{Oi}from"./chunk-index-6s2pqwna.js";import{Zt}from"./chunk-index-bxf8eq1s.js";import{ca}from"./chunk-index-6rdywten.js";mi();function v(){let l=d((c)=>JSON.stringify(ca(c,(o)=>Ae(c,o),(o)=>Ke(c,o)>0,!0).map((o)=>({id:o.id,...o.title===void 0?{}:{title:o.title},entries:o.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:Ke(c,u)>0}))})))),m=yi(),p=a(l);if(!m)p.current=l;let f=p.current;return C(()=>JSON.parse(f),[f])}function b(l){let{key:m,name:p}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>Ke(i,m)),o=f?.view,u=Je(o?.character),w=Zt(()=>jt(m,l.onLeave),l.liftable&&!o?.home?gi(m):void 0);if(!o)return null;return e("li",{...l.liftable&&!o.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...w,href:S("room",m),"aria-current":m===l.current?"page":void 0,style:u,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(m)},children:[n("span",{className:"switcher-picture",children:[e(Ue,{view:o,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(Kt,{room:m}),c?e("span",{className:"badge badge-warn",children:G(c,"{count} card waiting","{count} cards waiting")}):null,o.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,p]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Oi(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),o=(i)=>l.close(i===l.current?void 0:()=>X("room",i)),u=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=c.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:m,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>p(i.target.value),onKeyDown:(i)=>{let h=c.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!ot(i.nativeEvent))o(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>xn(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let h=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):w||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:o,onLeave:l.close,liftable:!h&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O,
|
|
1
|
+
import{O,vs,Gn}from"./chunk-index-24cggw6k.js";import{ko,To}from"./chunk-index-nr275sa7.js";import{Gi,jo}from"./chunk-index-d4mx2vvf.js";import"./chunk-index-vpq2cj14.js";var c=64;async function m(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function g(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let b=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!b||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=b,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function T(){let s=()=>Gi().badge+To(),a=()=>vs(s());g({count:()=>Gn(O.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};O.subscribe(t),jo(t),ko(t)},render:m}),a()}export{T as startPageTabDot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_e,o,r,t,e,n,s,X,d,rt}from"./chunk-index-24cggw6k.js";import{qi,Nn,ui,Ho,di,fi,Ln,Bi,Fi,Qr}from"./chunk-index-c8gm1crh.js";import"./chunk-index-ze9p4npm.js";import"./chunk-index-ce7hsda9.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-cmzvq3nf.js";import{Cs,Ai,Es}from"./chunk-index-wsv46y9p.js";qi();function v(){return Ho((_e(rt)?.kinds??[]).map((a)=>a.kind)),null}function N({focus:a}){let[l,b]=r(),u=di(void 0),i=Nn(),p=i.loaded&&u.length===0;return o(()=>{if(a&&i.loaded)X("table",void 0,{replace:!0})},[a,i.loaded]),n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[l?.kind==="webgl"?e("button",{type:"button",className:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>l.focus(null),children:e(s,{name:"reset"})}):null,e("button",{type:"button",className:"secondary",onClick:()=>X("rooms"),children:t("All rooms")})]})]}),n("div",{className:"table-frame",children:[p?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e(Ln,{onHandle:b,onSeat:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)},onFocus:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)}}),e(v,{})]})]})}function C({named:a}){let l=Ai(),b=Cs(),u=d((y)=>y.listed),i=Es(l,b,a),p=fi(),{ask:m,sheet:c}=Fi(i),f=a===void 0||l.some(k(a));o(()=>{if(a!==void 0&&u&&!f)X("table",void 0,{replace:!0})},[a,u,f]);let h=e("div",{className:"room-title",children:e("h1",{children:t("Round table")})}),g=n("div",{className:"table-empty-state",children:[e("strong",{children:i?t("The council is empty"):t("No council yet")}),e("p",{className:"meta",children:i?t("Every member of this council is gone. Edit who sits."):t("A council is a group of up to {max} knights who answer in turn.",{max:8})}),p.length>0?e("button",{type:"button",onClick:m,children:i?t("Edit this council"):t("Pick who sits")}):null]});if(i)return n("section",{className:"room council-page",children:[e(Qr,{roomKey:i.key,lead:h,empty:g}),c]});return n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[h,p.length>0?e("div",{className:"table-tools",children:e(Bi,{council:void 0,onOpen:m})}):null]}),e("div",{className:"table-frame",children:g}),c]})}var k=(a)=>(l)=>l.key===a||l.name===a;function F({focus:a}){return ui()?e(N,{focus:a}):e(C,{named:a})}export{F as TablePage};
|