pi-roundtable-web 0.24.2 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +195 -16
  3. package/dist/account-zk4efb87.css +102 -0
  4. package/dist/chunk-account-hw49gd0d.js +1 -0
  5. package/dist/chunk-action-menu-rm5cyqkj.js +1 -0
  6. package/dist/chunk-agent-b017vswv.js +1 -0
  7. package/dist/chunk-arranged-rooms-q5v3dm1r.js +1 -0
  8. package/dist/chunk-character-creator-5dxcvd16.js +1 -0
  9. package/dist/chunk-codeeditor-pyt09fwg.js +2 -0
  10. package/dist/chunk-confirm-521yqmta.js +1 -0
  11. package/dist/chunk-connectors-hrm06nx8.js +1 -0
  12. package/dist/chunk-conversations-e26rrf01.js +1 -0
  13. package/dist/chunk-drag-v41gx2mc.js +1 -0
  14. package/dist/chunk-entry-jxxb3ath.js +1 -0
  15. package/dist/chunk-folder-list-b97xk12b.js +1 -0
  16. package/dist/chunk-folds-b8q7eags.js +1 -0
  17. package/dist/chunk-gate-8k61stsc.js +1 -0
  18. package/dist/chunk-group-scene-dx6wt19m.js +1 -0
  19. package/dist/chunk-group-table-e4jr8r3a.js +1 -0
  20. package/dist/chunk-host-state-g7e7c0k5.js +1 -0
  21. package/dist/chunk-host-ui-x7k6n07v.js +939 -0
  22. package/dist/chunk-index-014rjv9k.js +2 -0
  23. package/dist/chunk-index-2d0kg096.js +2 -0
  24. package/dist/chunk-index-2qd81wbx.js +2 -0
  25. package/dist/chunk-index-2stynxw6.css +1 -0
  26. package/dist/chunk-index-459drsft.js +2 -0
  27. package/dist/chunk-index-4mfj596y.js +2 -0
  28. package/dist/chunk-index-66nskrdj.js +47 -0
  29. package/dist/chunk-index-awx6nnta.js +2 -0
  30. package/dist/chunk-index-bbsytycb.js +2 -0
  31. package/dist/chunk-index-c07p8k0x.js +4 -0
  32. package/dist/chunk-index-cq1e9xdz.js +2 -0
  33. package/dist/chunk-index-d1prgfbp.js +2 -0
  34. package/dist/chunk-index-dhpt8qr9.js +2 -0
  35. package/dist/chunk-index-e5sd30xy.js +2 -0
  36. package/dist/chunk-index-g351921r.js +1 -0
  37. package/dist/chunk-index-hby0ap91.js +2 -0
  38. package/dist/chunk-index-hssjbr1k.js +2 -0
  39. package/dist/chunk-index-k2qq1gdj.js +2 -0
  40. package/dist/chunk-index-ke9ynm0n.js +2 -0
  41. package/dist/chunk-index-km40bhsz.js +2 -0
  42. package/dist/chunk-index-kpscvg85.js +2 -0
  43. package/dist/chunk-index-m0d100mg.js +2 -0
  44. package/dist/chunk-index-mb72snk9.js +2 -0
  45. package/dist/chunk-index-mjqqver5.js +4 -0
  46. package/dist/chunk-index-nqfkwkfp.js +2 -0
  47. package/dist/chunk-index-nwqk447w.js +2 -0
  48. package/dist/chunk-index-pcfhpm8v.js +302 -0
  49. package/dist/chunk-index-q8h8xzbm.js +2 -0
  50. package/dist/chunk-index-r5vszgfs.js +2 -0
  51. package/dist/{chunk-index-mpm90318.js → chunk-index-rhtvcbsq.js} +2 -2
  52. package/dist/chunk-index-rjv7vrwd.js +13 -0
  53. package/dist/chunk-index-v23m38p6.js +50 -0
  54. package/dist/chunk-index-va0g7d88.js +1 -0
  55. package/dist/{chunk-index-6t68gbex.js → chunk-index-wnjp6wv0.js} +2 -2
  56. package/dist/chunk-index-xgkd15n3.js +2 -0
  57. package/dist/chunk-index-y8rnq8zf.js +14 -0
  58. package/dist/chunk-index-z3k18atc.js +2 -0
  59. package/dist/chunk-lang-css-6bepqpnx.js +1 -0
  60. package/dist/{chunk-lang-dockerfile-ey0nvhhm.js → chunk-lang-dockerfile-hrav55t7.js} +1 -1
  61. package/dist/{chunk-lang-go-403qsw9f.js → chunk-lang-go-x9ahv6e5.js} +3 -3
  62. package/dist/chunk-lang-html-8jc72zt4.js +1 -0
  63. package/dist/chunk-lang-javascript-2p2qtbnf.js +1 -0
  64. package/dist/chunk-lang-json-hsemyd0r.js +1 -0
  65. package/dist/chunk-lang-markdown-zkwb4c9n.js +6 -0
  66. package/dist/{chunk-lang-python-9jk5a49y.js → chunk-lang-python-tewx7006.js} +2 -2
  67. package/dist/chunk-lang-rust-0ydx84s1.js +1 -0
  68. package/dist/{chunk-lang-shell-cgq6q0kj.js → chunk-lang-shell-gq1tmdz4.js} +1 -1
  69. package/dist/chunk-lang-sql-xt1qyycg.js +2 -0
  70. package/dist/{chunk-lang-toml-xh45nm68.js → chunk-lang-toml-0hamc5fc.js} +1 -1
  71. package/dist/chunk-lang-typescript-82xf7z2e.js +1 -0
  72. package/dist/{chunk-lang-xml-1mh879j9.js → chunk-lang-xml-wf6h5pt2.js} +1 -1
  73. package/dist/{chunk-lang-yaml-jac98srt.js → chunk-lang-yaml-7vk521h1.js} +1 -1
  74. package/dist/chunk-layout-actions-zh7bezk7.js +1 -0
  75. package/dist/chunk-menu-items-1n9qargb.js +2 -0
  76. package/dist/chunk-notes-t15bh04m.js +1 -0
  77. package/dist/chunk-notice-bell-w3y0h0sr.js +1 -0
  78. package/dist/chunk-notices-fa3g7qze.js +1 -0
  79. package/dist/chunk-onboarding-34v3nr17.js +1 -0
  80. package/dist/chunk-overview-km5vq375.js +1 -0
  81. package/dist/chunk-palette-a8txdgd0.js +1 -0
  82. package/dist/chunk-placement-items-wgaxsbvs.js +1 -0
  83. package/dist/chunk-profile-ypxdbsk1.js +1 -0
  84. package/dist/chunk-prompt-history-wm9dsy6s.js +1 -0
  85. package/dist/chunk-prompts-7mhhq7zs.js +1 -0
  86. package/dist/chunk-room-confirms-t11a1gsw.js +1 -0
  87. package/dist/chunk-room-menu-2tm2xtfx.js +1 -0
  88. package/dist/chunk-rooms-menu-button-wxnsxjwc.js +1 -0
  89. package/dist/chunk-schedules-2ft6xxyw.js +1 -0
  90. package/dist/chunk-seat-menu-d3npdtx1.js +1 -0
  91. package/dist/chunk-sheet-hosts-vngvp7wv.js +1 -0
  92. package/dist/chunk-skill-editor-65n2hsq4.js +8 -0
  93. package/dist/chunk-skills-shkdwes8.js +1 -0
  94. package/dist/chunk-switcher-list-g6hhmr1t.js +1 -0
  95. package/dist/chunk-table-1b6bsq2y.js +1 -0
  96. package/dist/chunk-table-seats-vy1qhdks.js +1 -0
  97. package/dist/chunk-table2d-n26b7gd0.js +1 -0
  98. package/dist/chunk-table3d-8aysyf56.js +4220 -0
  99. package/dist/chunk-transcript-355faceq.js +1 -0
  100. package/dist/chunk-where-j5qdt8a4.js +1 -0
  101. package/dist/chunk-workspace-vrbs6zx1.js +1 -0
  102. package/dist/chunk-zh-tw-zeg600bk.js +1 -0
  103. package/dist/index.html +1 -1
  104. package/dist/sw.js +1 -1
  105. package/package.json +5 -4
  106. package/src/api-types.ts +515 -6
  107. package/src/app/api-http.ts +66 -0
  108. package/src/app/app.ts +214 -33
  109. package/src/app/card-log.ts +6 -0
  110. package/src/app/desk.ts +47 -22
  111. package/src/app/files.ts +73 -7
  112. package/src/app/layout-routes.ts +239 -0
  113. package/src/app/layout.ts +133 -0
  114. package/src/app/presence.ts +2 -2
  115. package/src/app/prompt-routes.ts +167 -0
  116. package/src/app/protocol.ts +63 -1
  117. package/src/app/room-log.ts +148 -14
  118. package/src/app/rooms.ts +23 -0
  119. package/src/app/routes.ts +278 -156
  120. package/src/app/skill-doc-routes.ts +122 -0
  121. package/src/app/socket.ts +309 -77
  122. package/src/app/sockets.ts +108 -20
  123. package/src/app/surface.ts +72 -36
  124. package/src/app/team-routes.ts +457 -0
  125. package/src/app/threads.ts +14 -0
  126. package/src/app/uploads.ts +33 -7
  127. package/src/auth/authenticator.ts +71 -8
  128. package/src/auth/next.ts +52 -0
  129. package/src/auth/oidc-pages.ts +60 -0
  130. package/src/auth/oidc.ts +611 -0
  131. package/src/auth/sessions.ts +193 -0
  132. package/src/authz.ts +172 -0
  133. package/src/console-api.ts +122 -25
  134. package/src/console-server.ts +70 -6
  135. package/src/gate.ts +90 -0
  136. package/src/host/access.ts +161 -0
  137. package/src/host/cards.ts +99 -0
  138. package/src/host/context.ts +141 -0
  139. package/src/host/forms.ts +237 -0
  140. package/src/host/frames.ts +342 -0
  141. package/src/host/host-app.ts +176 -0
  142. package/src/host/host-context.ts +49 -0
  143. package/src/host/host-routes.ts +363 -0
  144. package/src/host/pages.ts +266 -0
  145. package/src/host/reads.ts +155 -0
  146. package/src/host/retention.ts +41 -0
  147. package/src/host/room-views.ts +137 -0
  148. package/src/host/rooms-service.ts +414 -0
  149. package/src/host/stored-json.ts +13 -0
  150. package/src/host/views.ts +103 -0
  151. package/src/i18n/zh-tw.ts +309 -10
  152. package/src/layout-order.ts +210 -0
  153. package/src/notices/api.ts +43 -0
  154. package/src/notices/mount.ts +292 -0
  155. package/src/notices/service.ts +294 -0
  156. package/src/notices/store.ts +298 -0
  157. package/src/notices/urls.ts +38 -0
  158. package/src/onboarding/api.ts +32 -0
  159. package/src/onboarding/service.ts +149 -0
  160. package/src/onboarding/steps.ts +75 -0
  161. package/src/onboarding/waivers.ts +40 -0
  162. package/src/options.ts +498 -34
  163. package/src/profile/api.ts +175 -0
  164. package/src/profile/links.ts +162 -0
  165. package/src/push/api.ts +189 -52
  166. package/src/push/dispatch.ts +156 -0
  167. package/src/push/drain.ts +139 -0
  168. package/src/push/mutes.ts +17 -0
  169. package/src/push/outbox.ts +218 -0
  170. package/src/push/prefs.ts +118 -0
  171. package/src/push/sender.ts +7 -2
  172. package/src/push/triggers.ts +56 -5
  173. package/src/push/vapid.ts +19 -0
  174. package/src/push/web-push-transport.ts +106 -0
  175. package/src/push-sender/index.ts +14 -0
  176. package/src/push-sender/run.ts +118 -0
  177. package/src/push-sender/session.ts +54 -0
  178. package/src/visitors.ts +94 -6
  179. package/src/web-app.ts +674 -0
  180. package/src/web-plugin.ts +293 -26
  181. package/dist/chunk-action-menu-7v5fce2v.js +0 -1
  182. package/dist/chunk-agent-2rw4ydw2.js +0 -1
  183. package/dist/chunk-agent-sheet-2q24dkkf.js +0 -3
  184. package/dist/chunk-character-creator-8q6ympxj.js +0 -1
  185. package/dist/chunk-codeeditor-fgmq298t.js +0 -2
  186. package/dist/chunk-connectors-mr53r7fh.js +0 -1
  187. package/dist/chunk-conversations-4vy2z6w9.js +0 -1
  188. package/dist/chunk-entry-jg1eem82.js +0 -1
  189. package/dist/chunk-group-scene-na95b1te.js +0 -1
  190. package/dist/chunk-index-11rjg8a8.js +0 -1
  191. package/dist/chunk-index-1y50d6sj.js +0 -2
  192. package/dist/chunk-index-5y2r0eaj.js +0 -47
  193. package/dist/chunk-index-7fphxxzd.js +0 -14
  194. package/dist/chunk-index-80f1zkp6.css +0 -1
  195. package/dist/chunk-index-87h45frg.js +0 -2
  196. package/dist/chunk-index-bnwmssyn.js +0 -2
  197. package/dist/chunk-index-ckgbszwt.js +0 -51
  198. package/dist/chunk-index-fmjjekhd.js +0 -2
  199. package/dist/chunk-index-t1m65yn6.js +0 -13
  200. package/dist/chunk-index-t711t17m.js +0 -2
  201. package/dist/chunk-index-txv7qvyy.js +0 -2
  202. package/dist/chunk-index-wr3dg24d.js +0 -2
  203. package/dist/chunk-index-yx683d5n.js +0 -2
  204. package/dist/chunk-lang-css-fkdg3x8x.js +0 -1
  205. package/dist/chunk-lang-html-v8h9g977.js +0 -1
  206. package/dist/chunk-lang-javascript-ykb2vhaa.js +0 -1
  207. package/dist/chunk-lang-json-2rze3rpy.js +0 -1
  208. package/dist/chunk-lang-markdown-6w2htnfc.js +0 -6
  209. package/dist/chunk-lang-rust-24fggcqx.js +0 -1
  210. package/dist/chunk-lang-sql-gjywb9ke.js +0 -2
  211. package/dist/chunk-lang-typescript-qh6rebyb.js +0 -1
  212. package/dist/chunk-menu-items-zjpyj51b.js +0 -2
  213. package/dist/chunk-notes-sjba7kw3.js +0 -1
  214. package/dist/chunk-overview-26r77kb6.js +0 -1
  215. package/dist/chunk-room-confirms-851184ep.js +0 -1
  216. package/dist/chunk-room-menu-8y9c026y.js +0 -1
  217. package/dist/chunk-skills-56s4hdbn.js +0 -1
  218. package/dist/chunk-table-qykpvp32.js +0 -1
  219. package/dist/chunk-table2d-k60ressj.js +0 -1
  220. package/dist/chunk-table3d-bv2ajk39.js +0 -4220
  221. package/dist/chunk-transcript-vekz1mh6.js +0 -1
  222. package/dist/chunk-workspace-hevefd0d.js +0 -1
  223. package/dist/chunk-zh-tw-5r2wjre0.js +0 -1
@@ -0,0 +1,939 @@
1
+ import{ee,X,a,D,ft,A,o,r,t,ve,c,p,e,n,s,x,Un,w,d,oe,f,u,m,v,h,_,P,Nt,mn,vt,k,Vi,Ne,Bn,Ht,jt,gn,ne,nn,ke,Gi,Ie}from"./chunk-index-v23m38p6.js";import{un,Ri}from"./chunk-index-dhpt8qr9.js";import{H}from"./chunk-index-e5sd30xy.js";import{De,Hi,ji,xi,Si,Ki}from"./chunk-index-ke9ynm0n.js";import{ue}from"./chunk-index-r5vszgfs.js";import"./chunk-index-awx6nnta.js";var Q=encodeURIComponent,Qe=new Set([c("This action takes no form."),c("The form has no such field."),c("This field is required."),c("Choose from the list."),c("This field takes one value."),c("This field is too long."),c("Give a web address."),c("The action could not be done.")]),me=(i)=>Qe.has(i)?t(i):i;function Te(i){let l=i.indexOf(":"),g=i.lastIndexOf(".");if(l<0||g<l+2||g===i.length-1)return;return{kind:i.slice(l+1,g),id:i.slice(g+1)}}var B={list:(i,l,g)=>{let b=new URLSearchParams;if(l)b.set("filter",l);if(g)b.set("cursor",g);let S=b.toString();return f(`host/${Q(i)}${S?`?${S}`:""}`)},open:(i,l)=>f(`host/${Q(i)}/${Q(l)}`),older:(i,l,g,b)=>f(`host/${Q(i)}/${Q(l)}/messages?before=${g}&limit=${b}`),act:(i,l,g)=>f(`host/${Q(i)}/${Q(l)}/act`,{method:"POST",body:JSON.stringify(g)}),page:(i,l)=>{let g=new URLSearchParams(l).toString();return f(`pages/${Q(i)}${g?`?${g}`:""}`)},pageAct:(i,l)=>f(`pages/${Q(i)}/act`,{method:"POST",body:JSON.stringify(l)})};function Je(i){if("room"in i){let g=i.message===void 0?"":`?message=${i.message}`;return`${x("room",i.room)}${g}`}let l=new URLSearchParams(i.query??{}).toString();return`${x("p",i.page)}${l?`?${l}`:""}`}function fe(i){Ri(new URL(Je(i),document.baseURI))}function Ye(i){let l={};for(let g of i)if(g.type==="multiselect")l[g.name]=[...Fe(g.initial)];else l[g.name]=Fe(g.initial)[0]??"";return l}var Fe=(i)=>i===void 0?[]:typeof i==="string"?[i]:[...i];function Xe(i,l){let g={};for(let b of i){let S=l[b.name];if(S===void 0||S===""||S.length===0)continue;g[b.name]=S}return g}function Ke(i){let{field:l,value:g}=i,[b,S]=r(""),E=l.search?l.options.filter((y)=>y.label.toLowerCase().includes(b.trim().toLowerCase())):l.options,R=l.search?e("input",{type:"search",value:b,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:l.label}),onChange:(y)=>S(y.target.value)}):null;if(l.type==="select")return n(p,{children:[R,n("select",{id:i.id,value:String(g),required:l.required===!0,"aria-describedby":i.described,...l.search?{size:6}:{},onChange:(y)=>i.onChange(y.target.value),children:[l.required?null:e("option",{value:"",children:t("None")}),E.map((y)=>e("option",{value:y.value,children:y.label},y.value))]})]});let N=new Set(Array.isArray(g)?g:[]);return n(p,{children:[R,e("fieldset",{"aria-describedby":i.described,children:E.map((y)=>n("label",{children:[e("input",{type:"checkbox",checked:N.has(y.value),onChange:(T)=>{let L=new Set(N);if(T.target.checked)L.add(y.value);else L.delete(y.value);i.onChange(l.options.filter((O)=>L.has(O.value)).map((O)=>O.value))}}),y.label]},y.value))})]})}function je(i){let{field:l,value:g}=i,b=D(),S="hint"in l?l.hint:void 0,E=i.error||S?`${b}-note`:void 0,R;if("options"in l)R=e(Ke,{field:l,id:b,value:g,described:E,onChange:i.onChange});else if(l.type==="textarea")R=e("textarea",{id:b,rows:5,value:String(g),maxLength:l.max??8000,required:l.required===!0,"aria-describedby":E,onChange:(N)=>i.onChange(N.target.value)});else R=e("input",{id:b,type:l.type==="url"?"url":"text",value:String(g),maxLength:l.max??500,required:l.required===!0,"aria-describedby":E,onChange:(N)=>i.onChange(N.target.value)});return n("div",{className:"host-field",children:[l.type==="multiselect"?e("span",{className:"field-label",children:l.label}):e("label",{htmlFor:b,children:l.label}),R,i.error||S?e("span",{id:`${b}-note`,className:i.error?"field-error":"hint",role:i.error?"alert":void 0,children:i.error??S}):null]})}function pe(i){let{spec:l}=i,[g,b]=r(()=>Ye(l.fields)),[S,E]=r(!1),[R,N]=r();return n("form",{className:"host-form",onSubmit:async(T)=>{if(T.preventDefault(),S)return;E(!0),N(void 0);try{N(await i.onSubmit(Xe(l.fields,g)))}catch(L){N({error:u(L)})}finally{E(!1)}},children:[l.fields.map((T)=>e(je,{field:T,value:g[T.name]??"",error:R?.field===T.name?R.error:void 0,onChange:(L)=>b((O)=>({...O,[T.name]:L}))},T.name)),R&&!l.fields.some((T)=>T.name===R.field)?e(h,{message:R.error}):null,n("div",{className:"actions",children:[i.onCancel?e("button",{type:"button",className:"secondary",disabled:S,onClick:i.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:S,children:l.submit})]})]})}function et(i){if(!i.ok)return{error:me(i.error),...i.field?{field:i.field}:{}};if(i.notice)m(i.notice);if(i.open)fe(i.open);return}function re(i){let[l,g]=r(),[b,S]=r(!1),E=async(N,y)=>et(await i.run(N,y)),R=async(N)=>{if(N.form||N.confirm){g(N);return}S(!0);try{let y=await E(N,{});if(y)m(y.error,"danger")}catch(y){m(u(y),"danger")}finally{S(!1)}};if(i.actions.length===0)return null;return n("div",{className:i.className??"host-actions",children:[i.actions.map((N)=>e("button",{type:"button",className:N.style==="danger"?"danger":N.style==="secondary"?"secondary":"",disabled:b,onClick:()=>R(N),children:N.label},N.id)),l?.form?e(ue,{open:!0,title:l.form.title,onClose:()=>g(void 0),children:e(pe,{spec:l.form,onCancel:()=>g(void 0),onSubmit:async(N)=>{let y=await E(l,N);if(!y)g(void 0);return y}})}):l?e(H,{open:!0,title:l.label,confirmLabel:l.label,tone:l.style==="danger"?"danger":"primary",onConfirm:async()=>{let N=await E(l,{});if(N)throw Error(N.error)},onClose:()=>g(void 0),children:e("p",{children:l.confirm})}):null]})}var Ve=/^file:([A-Za-z0-9_-]{1,64})$/;function Me(i){let l=URL.parse(i,document.baseURI);return l!==null&&l.origin===window.location.origin}function tt({id:i,alt:l}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(i)}`,alt:l,loading:"lazy",decoding:"async",onError:(g)=>{let b=document.createElement("span");b.textContent=l||t("Image"),g.currentTarget.replaceWith(b)}})}var j=ee(function({source:l}){return e("div",{className:"prose",children:e(Nt,{remarkPlugins:[vt],urlTransform:(g)=>Ve.test(g)?g:mn(g),components:{a:({href:g,children:b})=>g&&/^https?:\/\//.test(g)&&!Me(g)?e("a",{href:g,target:"_blank",rel:"noreferrer noopener",children:b}):g&&Me(g)?e("a",{href:g,children:b}):e("span",{children:b}),img:({src:g,alt:b})=>{let S=typeof g==="string"?Ve.exec(g):null;return S?.[1]?e(tt,{id:S[1],alt:b??""}):e("span",{children:b})},pre:Vi,table:({children:g})=>e("div",{className:"table-wrap",children:e("table",{children:g})})},children:l})})});function nt(i){switch(i??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var He=(i)=>(i.state??"open")==="open";function ie(i){let{card:l}=i,g=nt(l.state);return n("article",{className:"host-card","data-tone":l.tone??"note","data-state":l.state??"open",children:[n("header",{children:[e("h3",{children:l.title}),g?e(P,{tone:l.state==="working"?"busy":"plain",children:g}):null]}),l.body?e(j,{source:l.body}):null,l.links?.length?e("div",{className:"host-card-links",children:l.links.map((b)=>e("a",{href:b.url,...b.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:b.label},`${b.url}`))}):null,He(l)&&l.buttons?.length?e(re,{actions:l.buttons,run:i.run}):null]})}var Oe=!1;function q(){if(Oe||typeof document>"u")return;if(Oe=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let l=new CSSStyleSheet;l.replaceSync(`
2
+ .hpic {
3
+ flex: none;
4
+ display: inline-grid;
5
+ place-items: center;
6
+ overflow: hidden;
7
+ border-radius: var(--radius-full);
8
+ background: var(--surface-3);
9
+ color: #fff;
10
+ font-weight: var(--weight-bold);
11
+ line-height: 1;
12
+ user-select: none;
13
+ }
14
+
15
+ .hpic > img {
16
+ width: 100%;
17
+ height: 100%;
18
+ object-fit: cover;
19
+ }
20
+
21
+ .unread-mark {
22
+ display: inline-flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ min-width: 1.35rem;
26
+ height: 1.35rem;
27
+ padding: 0 0.4rem;
28
+ border-radius: var(--radius-full);
29
+ background: var(--accent);
30
+ color: var(--on-accent);
31
+ font-size: var(--text-xs);
32
+ font-weight: var(--weight-bold);
33
+ font-variant-numeric: tabular-nums;
34
+ }
35
+
36
+ .room-row-top .unread-mark {
37
+ margin-left: auto;
38
+ }
39
+
40
+ .room-row-top .unread-mark + .room-row-time {
41
+ margin-left: 0;
42
+ }
43
+
44
+ .switcher-name .unread-mark {
45
+ margin-left: auto;
46
+ }
47
+
48
+ .plain {
49
+ white-space: pre-wrap;
50
+ overflow-wrap: anywhere;
51
+ }
52
+
53
+ .label-chip {
54
+ padding: 0 var(--space-2);
55
+ border-radius: var(--radius-full);
56
+ background: var(--surface-3);
57
+ color: var(--muted);
58
+ font-size: var(--text-xs);
59
+ font-weight: var(--weight-medium);
60
+ }
61
+
62
+ .message[data-author="assistant"] .bubble {
63
+ border-color: transparent;
64
+ background: var(--accent-soft);
65
+ }
66
+
67
+ .message[data-author="member"]:not([data-mine]) .bubble {
68
+ background: var(--surface-2);
69
+ }
70
+
71
+ .message[data-highlight] .bubble {
72
+ animation: host-highlight 2.4s var(--ease-out) both;
73
+ }
74
+
75
+ @keyframes host-highlight {
76
+ 0%, 60% {
77
+ box-shadow: 0 0 0 3px var(--accent);
78
+ }
79
+ }
80
+
81
+ .message-edited,
82
+ .message-expired {
83
+ margin: var(--space-1) 0 0;
84
+ color: var(--muted);
85
+ font-size: var(--text-xs);
86
+ }
87
+
88
+ .host-notice {
89
+ display: flex;
90
+ align-items: flex-start;
91
+ gap: var(--space-2);
92
+ margin: var(--space-3) auto;
93
+ max-width: min(36rem, 92%);
94
+ padding: var(--space-2) var(--space-3);
95
+ border: 1px dashed var(--border-strong);
96
+ border-radius: var(--radius-lg);
97
+ background: var(--surface-2);
98
+ color: var(--muted);
99
+ font-size: var(--text-sm);
100
+ }
101
+
102
+ .host-notice[data-highlight] {
103
+ animation: host-highlight 2.4s var(--ease-out) both;
104
+ }
105
+
106
+ .host-notice > svg {
107
+ flex: none;
108
+ margin-top: 0.2rem;
109
+ }
110
+
111
+ .host-notice time {
112
+ margin-left: auto;
113
+ padding-left: var(--space-2);
114
+ font-size: var(--text-xs);
115
+ white-space: nowrap;
116
+ }
117
+
118
+ .new-divider {
119
+ display: flex;
120
+ align-items: center;
121
+ gap: var(--space-3);
122
+ margin: var(--space-3) 0 var(--space-1);
123
+ color: var(--accent);
124
+ font-size: var(--text-xs);
125
+ font-weight: var(--weight-bold);
126
+ }
127
+
128
+ .new-divider::before,
129
+ .new-divider::after {
130
+ content: "";
131
+ flex: 1;
132
+ height: 1px;
133
+ background: var(--accent);
134
+ opacity: 0.55;
135
+ }
136
+
137
+ .seen {
138
+ display: flex;
139
+ justify-content: flex-end;
140
+ flex-wrap: wrap;
141
+ gap: var(--space-2);
142
+ padding: 0 var(--space-1);
143
+ color: var(--muted);
144
+ font-size: var(--text-xs);
145
+ }
146
+
147
+ .seen-toggle {
148
+ display: inline-flex;
149
+ align-items: center;
150
+ gap: var(--space-1);
151
+ min-height: 0;
152
+ padding: 0 var(--space-1);
153
+ border: 0;
154
+ background: none;
155
+ color: inherit;
156
+ font: inherit;
157
+ cursor: pointer;
158
+ }
159
+
160
+ .seen-toggle .hpic + .hpic {
161
+ margin-left: -0.35rem;
162
+ box-shadow: 0 0 0 1.5px var(--bg);
163
+ }
164
+
165
+ .seen-names {
166
+ flex-basis: 100%;
167
+ text-align: right;
168
+ }
169
+
170
+ .host-head-fields {
171
+ display: flex;
172
+ flex-wrap: wrap;
173
+ gap: 0 var(--space-4);
174
+ margin: 0;
175
+ padding: var(--space-1) var(--space-4);
176
+ border-bottom: 1px solid var(--border);
177
+ background: var(--surface);
178
+ font-size: var(--text-xs);
179
+ }
180
+
181
+ .host-head-fields > div {
182
+ display: flex;
183
+ gap: var(--space-2);
184
+ min-width: 0;
185
+ }
186
+
187
+ .host-head-fields dt {
188
+ color: var(--muted);
189
+ }
190
+
191
+ .host-head-fields dd {
192
+ margin: 0;
193
+ min-width: 0;
194
+ overflow-wrap: anywhere;
195
+ }
196
+
197
+ .host-banner {
198
+ margin: 0;
199
+ padding: var(--space-1) var(--space-4);
200
+ border-bottom: 1px solid var(--border);
201
+ font-size: var(--text-sm);
202
+ }
203
+
204
+ .host-banner[data-tone="warn"] {
205
+ background: var(--warn-soft);
206
+ }
207
+
208
+ .host-banner[data-tone="risk"] {
209
+ background: var(--danger-soft);
210
+ color: var(--danger);
211
+ }
212
+
213
+ .host-actions {
214
+ display: flex;
215
+ flex-wrap: wrap;
216
+ gap: var(--space-2);
217
+ }
218
+
219
+ .host-actions.bar {
220
+ flex-wrap: nowrap;
221
+ padding: var(--space-2) var(--space-4);
222
+ border-bottom: 1px solid var(--border);
223
+ overflow-x: auto;
224
+ }
225
+
226
+ .host-actions.bar > button {
227
+ flex: none;
228
+ min-height: 2.25rem;
229
+ padding: 0 var(--space-3);
230
+ font-size: var(--text-sm);
231
+ }
232
+
233
+ .host-cards {
234
+ display: flex;
235
+ flex-direction: column;
236
+ border-top: 1px solid var(--border);
237
+ background: var(--surface-2);
238
+ }
239
+
240
+ .host-cards-toggle {
241
+ display: flex;
242
+ align-items: center;
243
+ gap: var(--space-2);
244
+ min-height: 2.5rem;
245
+ padding: 0 var(--space-4);
246
+ border: 0;
247
+ border-radius: 0;
248
+ background: none;
249
+ color: var(--text);
250
+ font: inherit;
251
+ font-size: var(--text-sm);
252
+ text-align: left;
253
+ overflow: hidden;
254
+ }
255
+
256
+ .host-cards-toggle > span {
257
+ min-width: 0;
258
+ overflow: hidden;
259
+ text-overflow: ellipsis;
260
+ white-space: nowrap;
261
+ }
262
+
263
+ .host-cards-toggle > svg {
264
+ flex: none;
265
+ transition: transform var(--dur-fast) var(--ease-out);
266
+ }
267
+
268
+ .host-cards[data-open] .host-cards-toggle > svg {
269
+ transform: rotate(90deg);
270
+ }
271
+
272
+ .host-cards-body {
273
+ display: flex;
274
+ flex-direction: column;
275
+ gap: var(--space-2);
276
+ max-height: min(16rem, 34vh);
277
+ padding: 0 var(--space-4) var(--space-3);
278
+ overflow-y: auto;
279
+ }
280
+
281
+ .host-card {
282
+ display: flex;
283
+ flex-direction: column;
284
+ gap: var(--space-2);
285
+ padding: var(--space-3);
286
+ border: 1px solid var(--border);
287
+ border-left-width: 4px;
288
+ border-radius: var(--radius-lg);
289
+ background: var(--surface);
290
+ }
291
+
292
+ .host-card[data-tone="ok"] {
293
+ border-left-color: var(--success);
294
+ }
295
+
296
+ .host-card[data-tone="warn"] {
297
+ border-left-color: var(--warn);
298
+ }
299
+
300
+ .host-card[data-tone="risk"] {
301
+ border-left-color: var(--danger);
302
+ }
303
+
304
+ .host-card[data-tone="note"] {
305
+ border-left-color: var(--accent);
306
+ }
307
+
308
+ .host-card[data-state="done"],
309
+ .host-card[data-state="superseded"],
310
+ .host-card[data-state="expired"] {
311
+ opacity: 0.7;
312
+ }
313
+
314
+ .host-card header {
315
+ display: flex;
316
+ align-items: center;
317
+ gap: var(--space-2);
318
+ }
319
+
320
+ .host-card h3 {
321
+ flex: 1;
322
+ margin: 0;
323
+ font-size: var(--text-md);
324
+ }
325
+
326
+ .host-card-links {
327
+ display: flex;
328
+ flex-wrap: wrap;
329
+ gap: var(--space-1) var(--space-4);
330
+ font-size: var(--text-sm);
331
+ }
332
+
333
+ .host-cards-older {
334
+ font-size: var(--text-sm);
335
+ color: var(--muted);
336
+ }
337
+
338
+ .host-cards-older > summary {
339
+ cursor: pointer;
340
+ }
341
+
342
+ .mode-switch {
343
+ display: flex;
344
+ margin: 0;
345
+ border: 0;
346
+ gap: var(--space-1);
347
+ padding: var(--space-2) var(--space-4) 0;
348
+ }
349
+
350
+ .mode-switch button {
351
+ min-height: 0;
352
+ padding: var(--space-1) var(--space-3);
353
+ border-radius: var(--radius-full);
354
+ font-size: var(--text-sm);
355
+ }
356
+
357
+ .host-form {
358
+ display: flex;
359
+ flex-direction: column;
360
+ gap: var(--space-3);
361
+ }
362
+
363
+ .host-field {
364
+ display: flex;
365
+ flex-direction: column;
366
+ gap: var(--space-1);
367
+ min-width: 0;
368
+ }
369
+
370
+ .host-field > label,
371
+ .host-field > legend {
372
+ font-size: var(--text-sm);
373
+ font-weight: var(--weight-medium);
374
+ }
375
+
376
+ .host-field .hint {
377
+ color: var(--muted);
378
+ font-size: var(--text-xs);
379
+ }
380
+
381
+ .host-field .field-error {
382
+ color: var(--danger);
383
+ font-size: var(--text-sm);
384
+ }
385
+
386
+ .host-field fieldset {
387
+ display: flex;
388
+ flex-direction: column;
389
+ gap: var(--space-1);
390
+ margin: 0;
391
+ padding: 0;
392
+ border: 0;
393
+ max-height: 14rem;
394
+ overflow-y: auto;
395
+ }
396
+
397
+ .host-field fieldset label {
398
+ display: flex;
399
+ align-items: center;
400
+ gap: var(--space-2);
401
+ min-height: var(--touch);
402
+ }
403
+
404
+ .host-field select[size] {
405
+ min-height: 9rem;
406
+ }
407
+
408
+ .host-list {
409
+ display: flex;
410
+ flex-direction: column;
411
+ gap: var(--space-2);
412
+ margin: 0;
413
+ padding: 0;
414
+ list-style: none;
415
+ }
416
+
417
+ .host-list > li {
418
+ display: flex;
419
+ align-items: center;
420
+ gap: var(--space-3);
421
+ padding: var(--space-3);
422
+ border: 1px solid var(--border);
423
+ border-radius: var(--radius-lg);
424
+ background: var(--surface);
425
+ }
426
+
427
+ .host-list-main {
428
+ display: flex;
429
+ flex: 1;
430
+ flex-direction: column;
431
+ min-width: 0;
432
+ }
433
+
434
+ .host-list-main > a,
435
+ .host-list-main > strong {
436
+ color: var(--text);
437
+ font-weight: var(--weight-medium);
438
+ text-decoration: none;
439
+ overflow-wrap: anywhere;
440
+ }
441
+
442
+ .host-list-main > span {
443
+ color: var(--muted);
444
+ font-size: var(--text-sm);
445
+ }
446
+
447
+ .attention-dot {
448
+ flex: none;
449
+ width: 0.6rem;
450
+ height: 0.6rem;
451
+ border-radius: var(--radius-full);
452
+ background: var(--danger);
453
+ }
454
+
455
+ .kind-filter {
456
+ width: 100%;
457
+ }
458
+
459
+ .kind-row-picture {
460
+ position: relative;
461
+ display: inline-flex;
462
+ }
463
+
464
+ .kind-row-picture .attention-dot {
465
+ position: absolute;
466
+ top: -1px;
467
+ right: -1px;
468
+ box-shadow: 0 0 0 2px var(--surface);
469
+ }
470
+ `),document.adoptedStyleSheets=[...document.adoptedStyleSheets,l];return}catch{}let i=document.createElement("style");i.textContent=`
471
+ .hpic {
472
+ flex: none;
473
+ display: inline-grid;
474
+ place-items: center;
475
+ overflow: hidden;
476
+ border-radius: var(--radius-full);
477
+ background: var(--surface-3);
478
+ color: #fff;
479
+ font-weight: var(--weight-bold);
480
+ line-height: 1;
481
+ user-select: none;
482
+ }
483
+
484
+ .hpic > img {
485
+ width: 100%;
486
+ height: 100%;
487
+ object-fit: cover;
488
+ }
489
+
490
+ .unread-mark {
491
+ display: inline-flex;
492
+ align-items: center;
493
+ justify-content: center;
494
+ min-width: 1.35rem;
495
+ height: 1.35rem;
496
+ padding: 0 0.4rem;
497
+ border-radius: var(--radius-full);
498
+ background: var(--accent);
499
+ color: var(--on-accent);
500
+ font-size: var(--text-xs);
501
+ font-weight: var(--weight-bold);
502
+ font-variant-numeric: tabular-nums;
503
+ }
504
+
505
+ .room-row-top .unread-mark {
506
+ margin-left: auto;
507
+ }
508
+
509
+ .room-row-top .unread-mark + .room-row-time {
510
+ margin-left: 0;
511
+ }
512
+
513
+ .switcher-name .unread-mark {
514
+ margin-left: auto;
515
+ }
516
+
517
+ .plain {
518
+ white-space: pre-wrap;
519
+ overflow-wrap: anywhere;
520
+ }
521
+
522
+ .label-chip {
523
+ padding: 0 var(--space-2);
524
+ border-radius: var(--radius-full);
525
+ background: var(--surface-3);
526
+ color: var(--muted);
527
+ font-size: var(--text-xs);
528
+ font-weight: var(--weight-medium);
529
+ }
530
+
531
+ .message[data-author="assistant"] .bubble {
532
+ border-color: transparent;
533
+ background: var(--accent-soft);
534
+ }
535
+
536
+ .message[data-author="member"]:not([data-mine]) .bubble {
537
+ background: var(--surface-2);
538
+ }
539
+
540
+ .message[data-highlight] .bubble {
541
+ animation: host-highlight 2.4s var(--ease-out) both;
542
+ }
543
+
544
+ @keyframes host-highlight {
545
+ 0%, 60% {
546
+ box-shadow: 0 0 0 3px var(--accent);
547
+ }
548
+ }
549
+
550
+ .message-edited,
551
+ .message-expired {
552
+ margin: var(--space-1) 0 0;
553
+ color: var(--muted);
554
+ font-size: var(--text-xs);
555
+ }
556
+
557
+ .host-notice {
558
+ display: flex;
559
+ align-items: flex-start;
560
+ gap: var(--space-2);
561
+ margin: var(--space-3) auto;
562
+ max-width: min(36rem, 92%);
563
+ padding: var(--space-2) var(--space-3);
564
+ border: 1px dashed var(--border-strong);
565
+ border-radius: var(--radius-lg);
566
+ background: var(--surface-2);
567
+ color: var(--muted);
568
+ font-size: var(--text-sm);
569
+ }
570
+
571
+ .host-notice[data-highlight] {
572
+ animation: host-highlight 2.4s var(--ease-out) both;
573
+ }
574
+
575
+ .host-notice > svg {
576
+ flex: none;
577
+ margin-top: 0.2rem;
578
+ }
579
+
580
+ .host-notice time {
581
+ margin-left: auto;
582
+ padding-left: var(--space-2);
583
+ font-size: var(--text-xs);
584
+ white-space: nowrap;
585
+ }
586
+
587
+ .new-divider {
588
+ display: flex;
589
+ align-items: center;
590
+ gap: var(--space-3);
591
+ margin: var(--space-3) 0 var(--space-1);
592
+ color: var(--accent);
593
+ font-size: var(--text-xs);
594
+ font-weight: var(--weight-bold);
595
+ }
596
+
597
+ .new-divider::before,
598
+ .new-divider::after {
599
+ content: "";
600
+ flex: 1;
601
+ height: 1px;
602
+ background: var(--accent);
603
+ opacity: 0.55;
604
+ }
605
+
606
+ .seen {
607
+ display: flex;
608
+ justify-content: flex-end;
609
+ flex-wrap: wrap;
610
+ gap: var(--space-2);
611
+ padding: 0 var(--space-1);
612
+ color: var(--muted);
613
+ font-size: var(--text-xs);
614
+ }
615
+
616
+ .seen-toggle {
617
+ display: inline-flex;
618
+ align-items: center;
619
+ gap: var(--space-1);
620
+ min-height: 0;
621
+ padding: 0 var(--space-1);
622
+ border: 0;
623
+ background: none;
624
+ color: inherit;
625
+ font: inherit;
626
+ cursor: pointer;
627
+ }
628
+
629
+ .seen-toggle .hpic + .hpic {
630
+ margin-left: -0.35rem;
631
+ box-shadow: 0 0 0 1.5px var(--bg);
632
+ }
633
+
634
+ .seen-names {
635
+ flex-basis: 100%;
636
+ text-align: right;
637
+ }
638
+
639
+ .host-head-fields {
640
+ display: flex;
641
+ flex-wrap: wrap;
642
+ gap: 0 var(--space-4);
643
+ margin: 0;
644
+ padding: var(--space-1) var(--space-4);
645
+ border-bottom: 1px solid var(--border);
646
+ background: var(--surface);
647
+ font-size: var(--text-xs);
648
+ }
649
+
650
+ .host-head-fields > div {
651
+ display: flex;
652
+ gap: var(--space-2);
653
+ min-width: 0;
654
+ }
655
+
656
+ .host-head-fields dt {
657
+ color: var(--muted);
658
+ }
659
+
660
+ .host-head-fields dd {
661
+ margin: 0;
662
+ min-width: 0;
663
+ overflow-wrap: anywhere;
664
+ }
665
+
666
+ .host-banner {
667
+ margin: 0;
668
+ padding: var(--space-1) var(--space-4);
669
+ border-bottom: 1px solid var(--border);
670
+ font-size: var(--text-sm);
671
+ }
672
+
673
+ .host-banner[data-tone="warn"] {
674
+ background: var(--warn-soft);
675
+ }
676
+
677
+ .host-banner[data-tone="risk"] {
678
+ background: var(--danger-soft);
679
+ color: var(--danger);
680
+ }
681
+
682
+ .host-actions {
683
+ display: flex;
684
+ flex-wrap: wrap;
685
+ gap: var(--space-2);
686
+ }
687
+
688
+ .host-actions.bar {
689
+ flex-wrap: nowrap;
690
+ padding: var(--space-2) var(--space-4);
691
+ border-bottom: 1px solid var(--border);
692
+ overflow-x: auto;
693
+ }
694
+
695
+ .host-actions.bar > button {
696
+ flex: none;
697
+ min-height: 2.25rem;
698
+ padding: 0 var(--space-3);
699
+ font-size: var(--text-sm);
700
+ }
701
+
702
+ .host-cards {
703
+ display: flex;
704
+ flex-direction: column;
705
+ border-top: 1px solid var(--border);
706
+ background: var(--surface-2);
707
+ }
708
+
709
+ .host-cards-toggle {
710
+ display: flex;
711
+ align-items: center;
712
+ gap: var(--space-2);
713
+ min-height: 2.5rem;
714
+ padding: 0 var(--space-4);
715
+ border: 0;
716
+ border-radius: 0;
717
+ background: none;
718
+ color: var(--text);
719
+ font: inherit;
720
+ font-size: var(--text-sm);
721
+ text-align: left;
722
+ overflow: hidden;
723
+ }
724
+
725
+ .host-cards-toggle > span {
726
+ min-width: 0;
727
+ overflow: hidden;
728
+ text-overflow: ellipsis;
729
+ white-space: nowrap;
730
+ }
731
+
732
+ .host-cards-toggle > svg {
733
+ flex: none;
734
+ transition: transform var(--dur-fast) var(--ease-out);
735
+ }
736
+
737
+ .host-cards[data-open] .host-cards-toggle > svg {
738
+ transform: rotate(90deg);
739
+ }
740
+
741
+ .host-cards-body {
742
+ display: flex;
743
+ flex-direction: column;
744
+ gap: var(--space-2);
745
+ max-height: min(16rem, 34vh);
746
+ padding: 0 var(--space-4) var(--space-3);
747
+ overflow-y: auto;
748
+ }
749
+
750
+ .host-card {
751
+ display: flex;
752
+ flex-direction: column;
753
+ gap: var(--space-2);
754
+ padding: var(--space-3);
755
+ border: 1px solid var(--border);
756
+ border-left-width: 4px;
757
+ border-radius: var(--radius-lg);
758
+ background: var(--surface);
759
+ }
760
+
761
+ .host-card[data-tone="ok"] {
762
+ border-left-color: var(--success);
763
+ }
764
+
765
+ .host-card[data-tone="warn"] {
766
+ border-left-color: var(--warn);
767
+ }
768
+
769
+ .host-card[data-tone="risk"] {
770
+ border-left-color: var(--danger);
771
+ }
772
+
773
+ .host-card[data-tone="note"] {
774
+ border-left-color: var(--accent);
775
+ }
776
+
777
+ .host-card[data-state="done"],
778
+ .host-card[data-state="superseded"],
779
+ .host-card[data-state="expired"] {
780
+ opacity: 0.7;
781
+ }
782
+
783
+ .host-card header {
784
+ display: flex;
785
+ align-items: center;
786
+ gap: var(--space-2);
787
+ }
788
+
789
+ .host-card h3 {
790
+ flex: 1;
791
+ margin: 0;
792
+ font-size: var(--text-md);
793
+ }
794
+
795
+ .host-card-links {
796
+ display: flex;
797
+ flex-wrap: wrap;
798
+ gap: var(--space-1) var(--space-4);
799
+ font-size: var(--text-sm);
800
+ }
801
+
802
+ .host-cards-older {
803
+ font-size: var(--text-sm);
804
+ color: var(--muted);
805
+ }
806
+
807
+ .host-cards-older > summary {
808
+ cursor: pointer;
809
+ }
810
+
811
+ .mode-switch {
812
+ display: flex;
813
+ margin: 0;
814
+ border: 0;
815
+ gap: var(--space-1);
816
+ padding: var(--space-2) var(--space-4) 0;
817
+ }
818
+
819
+ .mode-switch button {
820
+ min-height: 0;
821
+ padding: var(--space-1) var(--space-3);
822
+ border-radius: var(--radius-full);
823
+ font-size: var(--text-sm);
824
+ }
825
+
826
+ .host-form {
827
+ display: flex;
828
+ flex-direction: column;
829
+ gap: var(--space-3);
830
+ }
831
+
832
+ .host-field {
833
+ display: flex;
834
+ flex-direction: column;
835
+ gap: var(--space-1);
836
+ min-width: 0;
837
+ }
838
+
839
+ .host-field > label,
840
+ .host-field > legend {
841
+ font-size: var(--text-sm);
842
+ font-weight: var(--weight-medium);
843
+ }
844
+
845
+ .host-field .hint {
846
+ color: var(--muted);
847
+ font-size: var(--text-xs);
848
+ }
849
+
850
+ .host-field .field-error {
851
+ color: var(--danger);
852
+ font-size: var(--text-sm);
853
+ }
854
+
855
+ .host-field fieldset {
856
+ display: flex;
857
+ flex-direction: column;
858
+ gap: var(--space-1);
859
+ margin: 0;
860
+ padding: 0;
861
+ border: 0;
862
+ max-height: 14rem;
863
+ overflow-y: auto;
864
+ }
865
+
866
+ .host-field fieldset label {
867
+ display: flex;
868
+ align-items: center;
869
+ gap: var(--space-2);
870
+ min-height: var(--touch);
871
+ }
872
+
873
+ .host-field select[size] {
874
+ min-height: 9rem;
875
+ }
876
+
877
+ .host-list {
878
+ display: flex;
879
+ flex-direction: column;
880
+ gap: var(--space-2);
881
+ margin: 0;
882
+ padding: 0;
883
+ list-style: none;
884
+ }
885
+
886
+ .host-list > li {
887
+ display: flex;
888
+ align-items: center;
889
+ gap: var(--space-3);
890
+ padding: var(--space-3);
891
+ border: 1px solid var(--border);
892
+ border-radius: var(--radius-lg);
893
+ background: var(--surface);
894
+ }
895
+
896
+ .host-list-main {
897
+ display: flex;
898
+ flex: 1;
899
+ flex-direction: column;
900
+ min-width: 0;
901
+ }
902
+
903
+ .host-list-main > a,
904
+ .host-list-main > strong {
905
+ color: var(--text);
906
+ font-weight: var(--weight-medium);
907
+ text-decoration: none;
908
+ overflow-wrap: anywhere;
909
+ }
910
+
911
+ .host-list-main > span {
912
+ color: var(--muted);
913
+ font-size: var(--text-sm);
914
+ }
915
+
916
+ .attention-dot {
917
+ flex: none;
918
+ width: 0.6rem;
919
+ height: 0.6rem;
920
+ border-radius: var(--radius-full);
921
+ background: var(--danger);
922
+ }
923
+
924
+ .kind-filter {
925
+ width: 100%;
926
+ }
927
+
928
+ .kind-row-picture {
929
+ position: relative;
930
+ display: inline-flex;
931
+ }
932
+
933
+ .kind-row-picture .attention-dot {
934
+ position: absolute;
935
+ top: -1px;
936
+ right: -1px;
937
+ box-shadow: 0 0 0 2px var(--surface);
938
+ }
939
+ `,document.head.append(i)}q();function rt(){let[i,l]=r(()=>un().toString());return a(()=>{let g=()=>l(un().toString());return window.addEventListener("popstate",g),window.addEventListener("hashchange",g),()=>{window.removeEventListener("popstate",g),window.removeEventListener("hashchange",g)}},[]),i}function ot(i){if(!i.ok)return{error:me(i.error),...i.field?{field:i.field}:{}};if(i.notice)m(i.notice);if(i.open)fe(i.open);return}function st(i){let{section:l}=i;switch(l.kind){case"markdown":return e(j,{source:l.text});case"card":return e(ie,{card:l.card,run:i.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:l.form.title}),e(pe,{spec:l.form,onSubmit:(g)=>i.submit(l.action,g)})]});case"list":return n("section",{className:"stack",children:[l.title?e("h2",{className:"section-title",children:l.title}):null,l.rows.length===0?e(_,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:it(l.rows).map(([g,b])=>n("li",{children:[b.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[b.open?e("a",{href:b.open,...b.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:b.title}):e("strong",{children:b.title}),b.subtitle?e("span",{children:b.subtitle}):null]}),b.actions?.length?e(re,{actions:b.actions,run:i.run}):null]},g))})]})}}function at({routeKey:i}){let l=i??"",g=rt(),b=De((L)=>L.pages[l]??0),[S,E]=r(0),[R,N]=r({});a(()=>{let L=!0;return B.page(l,Object.fromEntries(new URLSearchParams(g))).then((O)=>L&&N({page:O}),(O)=>{if(!L)return;let F=O instanceof oe&&O.status===404;N((M)=>({...F||!M.page?{}:{page:M.page},error:u(O),gone:F}))}),()=>{L=!1}},[l,g,b,S]);let y=async(L,O)=>{let F=await B.pageAct(l,{action:L,input:O}),M=ot(F);if(!M)E((U)=>U+1);return M},T=async(L,O)=>{let F=await B.pageAct(l,{action:L.id,input:O});if(F.ok)E((M)=>M+1);return F};if(R.gone)return e("div",{className:"page",children:e(_,{children:t("This page is not available.")})});if(!R.page)return e("div",{className:"page",children:R.error?e(h,{message:R.error}):e(v,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:R.page.title})}),R.error?e(h,{message:R.error}):null,R.page.sections.map((L,O)=>e(st,{section:L,run:T,submit:y},O))]})}function it(i){let l=new Map;return i.map((g)=>{let b=l.get(g.title)??0;return l.set(g.title,b+1),[`${g.title}:${b}`,g]})}q();function lt(i){if(!i)return;if("file"in i)return`api/files/${encodeURIComponent(i.file)}`;if("principal"in i)return`api/people/${encodeURIComponent(i.principal)}/picture`;return}function dt(i){let l=i.trim().split(/\s+/).filter(Boolean),g=[...l[0]??"?"][0]??"?";if(/[\u3400-\u9fff]/.test(g))return g;let b=l.length>1?[...l.at(-1)??""][0]:void 0;return`${g}${b??""}`.toUpperCase()}function ct(i){let l=0;for(let g of i)l=(l*31+(g.codePointAt(0)??0))%360;return`hsl(${l} 42% 40%)`}function Y(i){let[l,g]=r(!1),b=i.size??32,S=l?void 0:lt(i.picture),E=i.picture&&"initials"in i.picture?i.picture:void 0,R=E?.initials??dt(i.name),N=E?.color??ct(i.name);return e("span",{className:"hpic",style:{width:b,height:b,fontSize:Math.round(b*0.4),...S?{}:{background:N}},children:S?e("img",{src:S,alt:"",loading:"lazy",decoding:"async",onError:()=>g(!0)}):e("span",{"aria-hidden":"true",children:R})})}var ut=/https?:\/\/[^\s<>"']+/g,mt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function pt(i){let l=i.replace(mt,""),g=URL.parse(l);return g&&(g.protocol==="https:"||g.protocol==="http:")?l:""}function Pe({text:i}){let l=[],g=0;for(let b of i.matchAll(ut)){let S=pt(b[0]);if(S==="")continue;let E=b.index;if(E>g)l.push(i.slice(g,E));l.push(e("a",{href:S,target:"_blank",rel:"noreferrer noopener",children:S},`${E}`)),g=E+S.length}if(g<i.length)l.push(i.slice(g));return e("span",{className:"plain",children:l})}var ze=ee(function(l){let{message:g}=l,b=g.authorKind??"external";if(b==="notice")return n("li",{className:"host-notice","data-mid":g.id,"data-highlight":l.highlighted||void 0,"data-enter":l.enter||void 0,children:[e(s,{name:"bell",size:14}),e(j,{source:g.text}),e("time",{dateTime:g.at,children:Bn(g.at,l.timeZone)})]});let S=b==="member"&&g.principalId!==void 0&&g.principalId===l.me;return n("li",{className:"message","data-mid":g.id,"data-author":b,"data-mine":S||void 0,"data-header":l.header||void 0,"data-enter":l.enter||void 0,"data-highlight":l.highlighted||void 0,children:[S?null:e("span",{className:"message-avatar",children:l.header?e(Y,{picture:g.picture,name:g.author}):null}),n("div",{className:"message-main",children:[l.header?n("div",{className:"message-meta",children:[e("strong",{children:g.author}),g.authorLabel?e("span",{className:"label-chip",children:g.authorLabel}):null,e("time",{dateTime:g.at,children:Bn(g.at,l.timeZone)})]}):null,n("div",{className:"bubble",children:[g.text?b==="assistant"?e(j,{source:g.text}):e(Pe,{text:g.text}):null,e(gn,{files:g.files}),g.expiredFiles?e("p",{className:"message-expired",children:ve(g.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),g.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});q();var gt=3;function ht({marks:i}){let[l,g]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":l,onClick:()=>g((b)=>!b),children:[i.slice(0,gt).map((b)=>e(Y,{picture:{principal:b.principal},name:b.name,size:16},b.principal)),e("span",{children:t("Seen by {count}",{count:i.length})})]}),l?e("span",{className:"seen-names",children:i.map((b)=>b.name).join(t(", "))}):null]})}function bt(i,l){let g=Ie(),b=d((S)=>S.connects);a(()=>{let S=l.current;if(!S)return;let E=0,R=0,N,y,T=()=>{if(y=void 0,document.visibilityState!=="visible")return;let F=S.getBoundingClientRect(),M=0;for(let J of S.querySelectorAll("[data-mid]")){let Z=J.getBoundingClientRect();if(Z.bottom>F.top&&Z.top<F.bottom-4)M=Math.max(M,Number(J.dataset.mid))}if(M<=E)return;let U=R+1000-Date.now();if(U>0){clearTimeout(N),N=setTimeout(L,U);return}if(g.send({type:"read",room:i,upTo:M}))E=M,R=Date.now()},L=()=>{if(y===void 0)y=requestAnimationFrame(T)};S.addEventListener("scroll",L,{passive:!0}),document.addEventListener("visibilitychange",L),window.addEventListener("resize",L);let O=new MutationObserver(L);return O.observe(S,{childList:!0,subtree:!0}),L(),()=>{if(S.removeEventListener("scroll",L),document.removeEventListener("visibilitychange",L),window.removeEventListener("resize",L),O.disconnect(),clearTimeout(N),y!==void 0)cancelAnimationFrame(y)}},[g,i,l,b])}function ge(i){let{roomKey:l}=i;bt(l,i.scroller);let g=d((y)=>y.principal?.id),b=d((y)=>y.rooms[l]?.messages),S=De((y)=>y.reads[l]??Hi),E=De((y)=>y.cursor[l]),R=o(void 0);if(R.current===void 0&&E!==void 0)R.current=E;let N=A(()=>{let T=(b??[]).filter((F)=>F.kind!=="system"),L=R.current===void 0?void 0:T.find((F)=>F.id>(R.current??0)&&(F.principalId===void 0||F.principalId!==g))?.id,O=new Map;for(let F of S){if(F.principal===g)continue;let M=T.findLast((U)=>U.id<=F.upTo);if(M)O.set(M.id,[...O.get(M.id)??[],F])}return{before:(F)=>F.id===L?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(F)=>{let M=O.get(F.id);return M?e(ht,{marks:M}):null},...i.host?{message:(F,M)=>F.kind==="system"&&F.authorKind===void 0?void 0:e(ze,{message:F,header:M.header,enter:M.enter,timeZone:M.timeZone,me:g,highlighted:i.highlight===F.id})}:{}}},[b,S,g,i.host,i.highlight]);return e(nn,{roomKey:l,enterAfter:i.enterAfter,quotable:i.quotable,decor:N})}q();var yt=20,wt=2600,$e;function xt(i,l,g){let b=d((N)=>N.connects),S=De((N)=>N.rooms[i]??0),[E,R]=r({view:void 0,error:void 0,gone:!1});return a(()=>{let N=!0;return B.open(l,g).then((y)=>{if(!N)return;w.dispatch({type:"history_loaded",room:i,messages:y.messages,more:y.more,older:!1}),Si(i,y.reads,y.cursor),Ki(i,y.cards),R({view:y,error:void 0,gone:!1})},(y)=>{if(!N)return;let T=y instanceof oe&&y.status===404;R((L)=>({view:T?void 0:L.view,error:u(y),gone:T}))}),()=>{N=!1}},[i,l,g,b,S]),E}function kt(i){let{header:l}=i;return n(p,{children:[l.banner?e("p",{className:"host-banner","data-tone":l.banner.tone,role:"status",children:l.banner.text}):null,l.fields.length?e("dl",{className:"host-head-fields",children:l.fields.map((g)=>n("div",{children:[e("dt",{children:g.label}),e("dd",{children:g.link?e("a",{href:g.link,...g.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:g.value}):g.value})]},`${g.label}:${g.value}`))}):null,e(re,{className:"host-actions bar",actions:l.actions,run:i.run})]})}function St(i){let l=De((T)=>T.cards[i.room]??ji),g=ke("(min-width: 720px) and (min-height: 760px)"),[b,S]=r();if(l.length===0)return null;let E=l.filter((T)=>He(T)||T.state==="working"),R=l.filter((T)=>!E.includes(T)),N=b??(g&&E.length>0),y=E[0];return n("div",{className:"host-cards","data-open":N||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":N,onClick:()=>S(!N),children:[e(s,{name:"chevron",size:14}),y?n("span",{children:[e("strong",{children:ve(E.length,"{count} card waiting","{count} cards waiting")}),`: ${y.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:R.length})})]}),N?n("div",{className:"host-cards-body",children:[E.map((T)=>e(ie,{card:T,run:i.run(T.id)},T.id)),R.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:R.length})}),R.map((T)=>e(ie,{card:T,run:i.run(T.id)},T.id))]}):null]}):null]})}function Rt({roomKey:i}){let l=Ie(),g=Te(i),b=g?.kind??"",S=g?.id??"",{view:E,error:R,gone:N}=xt(i,b,S),y=d((C)=>C.rooms[i]),T=d((C)=>C.limits),L=d((C)=>C.connects),O=d((C)=>C.connection==="open"),F=o(null),M=o(null),{away:U,onScroll:J,onGrow:Z,toEnd:te}=Gi(F),[le,V]=r(!1),[z,se]=r(),[be,_e]=r($e),[Be,Ce]=r(),ye=o(void 0),ae=o(void 0),G=E!==void 0;if(a(()=>{if(!g||N||!G)return;return l.send({type:"subscribe",room:i}),l.focus(i),()=>{l.focus(void 0),l.send({type:"unsubscribe",room:i})}},[l,i,L,N,G]),G&&ye.current===void 0)ye.current=y?.messages.at(-1)?.id??0;ft(()=>{if(G)te(!1)},[G]),ft(()=>{let C=F.current;if(C&&ae.current!==void 0)C.scrollTop+=C.scrollHeight-ae.current,ae.current=void 0},[y?.messages[0]?.id]),a(()=>{let C=M.current;if(!C||typeof ResizeObserver>"u")return;let I=new ResizeObserver(Z);return I.observe(C),()=>I.disconnect()},[Z]);let we=X(async()=>{let C=w.getState().rooms[i]?.messages[0];if(!C)return!1;let I=await B.older(b,S,C.id,Un);return w.dispatch({type:"history_loaded",room:i,messages:I.messages,more:I.more,older:!0}),Si(i,I.reads,void 0),I.more},[i,b,S]),de=o(void 0);a(()=>{let C=()=>{let I=Number(un().get("message"));de.current=Number.isSafeInteger(I)&&I>0?I:void 0};return C(),window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[]);let xe=y?.messages[0]?.id,Ae=y?.more===!0;a(()=>{let C=de.current,I=F.current;if(!G||C===void 0||!I)return;let K=I.querySelector(`[data-mid="${C}"]`);if(K){de.current=void 0,K.scrollIntoView({block:"center"}),Ce(C),requestAnimationFrame(()=>I.dispatchEvent(new Event("scroll"))),setTimeout(()=>Ce(void 0),wt);return}if(xe!==void 0&&C<xe&&Ae){let Le=0;(async()=>{if(Le+=1,!await we().catch(()=>!1)||Le>=yt)de.current=void 0})()}},[G,xe,Ae,y?.messages.length,we]);let Ee=(C,I={},K)=>B.act(b,S,{action:C.id,...K===void 0?{}:{card:K},input:I}),Ge=(C,I)=>Ee(C,I),Ze=(C)=>(I,K)=>Ee(I,K,C);if(N||!G&&!R&&!g)return e("section",{className:"room",children:n("div",{className:"page",children:[e(_,{children:t("This room is not available.")}),e("a",{className:"back",href:x("rooms"),children:t("Back to rooms")})]})});let W=E?.access.send??[],Se=be&&W.includes(be)?be:W.includes("turn")?"turn":W[0],ce=E?.header.title??i,We=y?.messages??[];return n("section",{className:"room",onDragOver:(C)=>{if(W.length&&C.dataTransfer.types.includes("Files"))C.preventDefault()},onDrop:(C)=>{if(!W.length||!C.dataTransfer.files.length)return;C.preventDefault(),se([...C.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:x("rooms"),"aria-label":t("Back to rooms"),children:e(s,{name:"back"})}),e(Y,{name:ce,size:40}),n("div",{className:"room-title",children:[e("h1",{children:ce}),e("span",{className:"room-status","data-working":y?.typing||void 0,children:y?.typing?t("Working…"):t("Host room")})]})]}),!O?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,E?e(kt,{header:E.header,run:Ge}):null,e("div",{className:"room-scroll",ref:F,onScroll:J,children:n("div",{className:"room-content",ref:M,children:[R?e(h,{message:R}):null,!G&&!R?e(v,{}):null,y?.more?e("button",{type:"button",className:"secondary older",disabled:le,onClick:async()=>{V(!0),ae.current=F.current?.scrollHeight;try{await we()}catch(C){ae.current=void 0,m(u(C),"danger")}finally{V(!1)}},children:le?t("Loading…"):t("Load earlier messages")}):null,G&&We.length===0?e(_,{children:t("No messages yet.")}):null,e(ge,{roomKey:i,enterAfter:ye.current,quotable:!1,scroller:F,host:!0,highlight:Be}),y?.typing?e(jt,{name:ce,progress:y.progress}):null]})}),U?n("button",{type:"button",className:"to-end",onClick:()=>te(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,E?e(St,{room:i,run:Ze}):null,E&&W.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,E&&W.length>0?n(p,{children:[W.length>1?e("fieldset",{className:"mode-switch","aria-label":t("Send as"),children:W.map((C)=>e("button",{type:"button",className:Se===C?"":"secondary","aria-pressed":Se===C,onClick:()=>{$e=C,_e(C)},children:C==="note"?t("Note"):t("Ask the agent")},C))}):null,e(Ht,{draftKey:i,name:ce,limits:T,stoppable:Boolean(y?.stoppable),onSend:(C,I)=>{l.say(i,C,I,Se),te(!0)},onStop:()=>l.send({type:"stop",room:i}),...z?{incoming:z,onIncomingTaken:()=>se(void 0)}:{}},i)]}):null]})}q();function he({room:i}){let l=De((g)=>g.unread[i]??0);if(l<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":ve(l,"{count} unread message","{count} unread messages"),children:l>99?"99+":l})}q();var Ct=6,At=250;function Re(i){let{kind:l}=i,{timeZone:g}=k(),{now:b}=ne(),S=d((V)=>V.connects),E=De((V)=>V.lists[l]??0),[R,N]=r(""),[y,T]=r(""),[L,O]=r(),[F,M]=r(),[U,J]=r(),[Z,te]=r(!1);a(()=>{let V=setTimeout(()=>T(R.trim()),At);return()=>clearTimeout(V)},[R]),a(()=>{let V=!0;return B.list(l,y||void 0).then((z)=>{if(!V)return;xi(Object.fromEntries(z.rooms.map((se)=>[se.key,se.unread??0]))),O(z.rooms),M(z.cursor),J(void 0)},(z)=>V&&J(u(z))),()=>{V=!1}},[l,y,S,E]);let le=async()=>{if(!F||Z)return;te(!0);try{let V=await B.list(l,y||void 0,F);xi(Object.fromEntries(V.rooms.map((z)=>[z.key,z.unread??0]))),O((z)=>[...z??[],...V.rooms]),M(V.cursor)}catch(V){J(u(V))}finally{te(!1)}};return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.label}),L&&(L.length>=Ct||y||R)?e("input",{type:"search",className:"kind-filter",value:R,placeholder:t("Search {name}",{name:i.label}),"aria-label":t("Search {name}",{name:i.label}),onChange:(V)=>N(V.target.value)}):null,U?e(h,{message:U}):null,!L&&!U?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,L&&L.length===0?e(_,{children:y?t("Nothing matches."):t("No rooms yet.")}):null,L&&L.length>0?e("ul",{className:"room-list",children:L.map((V)=>e("li",{children:n("a",{className:"room-row",href:x("room",V.key),"aria-current":V.key===i.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(Y,{picture:V.picture,name:V.title,size:44}),V.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null]}),n("span",{className:"room-row-main",children:[n("span",{className:"room-row-top",children:[e("strong",{children:V.title}),e(he,{room:V.key}),e("span",{className:"room-row-time",children:V.lastAt?Ne(V.lastAt,b,g):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:V.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},V.key))}):null,F?e("button",{type:"button",className:"secondary",disabled:Z,onClick:le,children:Z?t("Loading…"):t("Show more")}):null]})}function Ue(i){return i.kinds.map((l)=>e(Re,{kind:l.kind,label:l.label,active:i.active},l.kind))}function qe(){let i=(k().pages??[]).filter((l)=>l.place==="settings");if(i.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),i.map((l)=>n("a",{className:"menu-item menu-link",href:x("p",l.id),children:[e("span",{className:"menu-text",children:e("strong",{children:l.label})}),e(s,{name:"chevron",size:16})]},l.id))]})}export{Ue as HostKinds,at as HostPage,Rt as HostRoomPage,qe as HostSettingsPages,ge as ReadLog,he as UnreadMark};