pi-roundtable-web 0.26.3 → 0.27.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 (210) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +18 -11
  3. package/dist/chunk-account-1ecx5kt7.js +1 -0
  4. package/dist/chunk-action-menu-zh2n0ahf.js +1 -0
  5. package/dist/chunk-agent-ynm2tcbx.js +1 -0
  6. package/dist/chunk-arranged-rooms-qnz8vese.js +1 -0
  7. package/dist/chunk-bulk-actions-pr0mw0kc.js +1 -0
  8. package/dist/chunk-character-creator-caj4pmg4.js +1 -0
  9. package/dist/{chunk-codeeditor-6xavqntt.js → chunk-codeeditor-dga6s78p.js} +2 -2
  10. package/dist/chunk-confirm-g76v5d9r.js +1 -0
  11. package/dist/{chunk-connectors-7xqsg5q5.js → chunk-connectors-j79ze3j1.js} +1 -1
  12. package/dist/{chunk-conversations-zc4mv6vj.js → chunk-conversations-2farn72g.js} +1 -1
  13. package/dist/chunk-council-sheet-s9sz1bzf.js +2 -0
  14. package/dist/{chunk-drag-0mefcvp3.js → chunk-drag-45e8222r.js} +1 -1
  15. package/dist/chunk-entry-q11n47h9.js +1 -0
  16. package/dist/chunk-folder-list-4gcj7g7h.js +1 -0
  17. package/dist/chunk-folds-ten4ykfw.js +1 -0
  18. package/dist/{chunk-gate-86r8a2vf.js → chunk-gate-kcv1a4t0.js} +1 -1
  19. package/dist/chunk-group-scene-12ghcvzd.js +1 -0
  20. package/dist/chunk-group-table-t458kdgn.js +1 -0
  21. package/dist/chunk-host-icons-h1k9k96a.js +1 -0
  22. package/dist/chunk-host-picture-3p0wzn3v.js +1 -0
  23. package/dist/chunk-host-state-7mdve7cb.js +1 -0
  24. package/dist/chunk-host-ui-bdgwa6sf.js +1 -0
  25. package/dist/chunk-index-02vfshtt.js +2 -0
  26. package/dist/chunk-index-0a81da8z.js +2 -0
  27. package/dist/{chunk-index-8eexybcx.js → chunk-index-0w4bfjb5.js} +2 -2
  28. package/dist/{chunk-index-1fn8q4ps.js → chunk-index-12zyshae.js} +2 -2
  29. package/dist/chunk-index-18pgxxw3.js +2 -0
  30. package/dist/chunk-index-2e4am3hw.js +50 -0
  31. package/dist/{chunk-index-agrvqf5b.js → chunk-index-2fdns8tn.js} +2 -2
  32. package/dist/{chunk-index-84wbc80d.js → chunk-index-2t30xwed.js} +2 -2
  33. package/dist/{chunk-index-jq970hsd.js → chunk-index-31x6krbs.js} +3 -3
  34. package/dist/{chunk-index-eh0wb6g0.js → chunk-index-3d8s3565.js} +2 -2
  35. package/dist/chunk-index-5bfqek1d.js +2 -0
  36. package/dist/chunk-index-64rsz6pf.js +2 -0
  37. package/dist/chunk-index-6bkcq9ka.js +2 -0
  38. package/dist/{chunk-index-47yspxa4.js → chunk-index-8d81qy69.js} +1 -1
  39. package/dist/chunk-index-92zgb7my.js +2 -0
  40. package/dist/chunk-index-aamhjg5n.js +2 -0
  41. package/dist/{chunk-index-r1v895tj.js → chunk-index-ac1ktr56.js} +2 -2
  42. package/dist/{chunk-index-hc0dgmrs.js → chunk-index-ak6ecqy3.js} +2 -2
  43. package/dist/{chunk-index-eyc2rkq5.js → chunk-index-b73y2gc0.js} +2 -2
  44. package/dist/chunk-index-b8cpvr7y.js +2 -0
  45. package/dist/{chunk-index-3aa5czxj.js → chunk-index-bhqczxr3.js} +2 -2
  46. package/dist/{chunk-index-6c8mewwy.js → chunk-index-cbqhzf40.js} +12 -12
  47. package/dist/chunk-index-cdctnw71.js +2 -0
  48. package/dist/chunk-index-dj0tbfyb.js +2 -0
  49. package/dist/chunk-index-dnjftvtq.js +2 -0
  50. package/dist/chunk-index-e2dqjde8.js +1 -0
  51. package/dist/{chunk-index-tsxsy4qs.js → chunk-index-ebg48jgy.js} +2 -2
  52. package/dist/{chunk-index-rcxz5w5d.js → chunk-index-ek5mek4j.js} +3 -3
  53. package/dist/chunk-index-f6q0stqx.js +2 -0
  54. package/dist/{chunk-index-67p2sc14.js → chunk-index-ffbrm6tr.js} +3 -3
  55. package/dist/chunk-index-g1awv7rk.js +2 -0
  56. package/dist/chunk-index-g3wrs02w.js +1 -0
  57. package/dist/chunk-index-j0m16cj1.js +2 -0
  58. package/dist/chunk-index-j4kk1m59.js +2 -0
  59. package/dist/chunk-index-j4x9dq30.css +1 -0
  60. package/dist/{chunk-index-3wbyq10m.js → chunk-index-jgzygbt8.js} +1 -1
  61. package/dist/chunk-index-kb3w11mn.js +7 -0
  62. package/dist/{chunk-index-raf772z6.js → chunk-index-kbrg32sx.js} +2 -2
  63. package/dist/chunk-index-msqhgvfx.js +2 -0
  64. package/dist/chunk-index-pefwfm26.js +2 -0
  65. package/dist/chunk-index-pyfx77cj.js +2 -0
  66. package/dist/{chunk-index-30vw4nhh.js → chunk-index-q7g62sgm.js} +3 -3
  67. package/dist/chunk-index-qfgkfq86.js +2 -0
  68. package/dist/chunk-index-rh0x9rzf.js +2 -0
  69. package/dist/{chunk-index-m65cv329.js → chunk-index-sm7m4fej.js} +2 -2
  70. package/dist/chunk-index-sv9qpmhv.js +1 -0
  71. package/dist/chunk-index-t998yg8y.js +2 -0
  72. package/dist/{chunk-index-e90kztkx.js → chunk-index-tk4se135.js} +3 -3
  73. package/dist/chunk-index-v6smgw77.js +2 -0
  74. package/dist/chunk-index-w42rcbx1.js +2 -0
  75. package/dist/chunk-index-x4enmj72.js +2 -0
  76. package/dist/chunk-index-xq84gg8w.js +2 -0
  77. package/dist/{chunk-index-gt42wjby.js → chunk-index-xxeb2xp0.js} +3 -3
  78. package/dist/{chunk-index-hczrjnky.js → chunk-index-zyvwhxga.js} +1 -1
  79. package/dist/chunk-lang-css-y9133ktr.js +1 -0
  80. package/dist/{chunk-lang-dockerfile-tjxsnhr9.js → chunk-lang-dockerfile-cnwqn660.js} +1 -1
  81. package/dist/{chunk-lang-go-drmfa25k.js → chunk-lang-go-yy6kgsxv.js} +2 -2
  82. package/dist/chunk-lang-html-r2xmryek.js +1 -0
  83. package/dist/chunk-lang-javascript-1r6wd177.js +1 -0
  84. package/dist/{chunk-lang-json-790swysy.js → chunk-lang-json-dx56g11y.js} +1 -1
  85. package/dist/{chunk-lang-markdown-483dkxcq.js → chunk-lang-markdown-fpcf2dfq.js} +5 -5
  86. package/dist/{chunk-lang-python-v9s40bzj.js → chunk-lang-python-zzp95955.js} +2 -2
  87. package/dist/{chunk-lang-rust-z4gry1bf.js → chunk-lang-rust-214fh7sp.js} +1 -1
  88. package/dist/{chunk-lang-shell-egsvk8rj.js → chunk-lang-shell-1rpgtepw.js} +1 -1
  89. package/dist/{chunk-lang-sql-75j3denr.js → chunk-lang-sql-vvp46hpj.js} +2 -2
  90. package/dist/{chunk-lang-toml-7dbjvhex.js → chunk-lang-toml-tbj7467c.js} +1 -1
  91. package/dist/chunk-lang-typescript-y5w4tt4g.js +1 -0
  92. package/dist/{chunk-lang-xml-jg1sv4h2.js → chunk-lang-xml-tbcqmedk.js} +1 -1
  93. package/dist/{chunk-lang-yaml-g3v7s5je.js → chunk-lang-yaml-jh56t3sv.js} +1 -1
  94. package/dist/chunk-layout-actions-y73mpsh1.js +1 -0
  95. package/dist/chunk-menu-items-bza16bw6.js +2 -0
  96. package/dist/chunk-mode-toggle-nj9gnt3b.js +1 -0
  97. package/dist/chunk-note-row-6fmhrdng.js +75 -0
  98. package/dist/chunk-notes-wv0e6ssf.js +1 -0
  99. package/dist/{chunk-notice-bell-jehad6sx.js → chunk-notice-bell-9z27epd2.js} +1 -1
  100. package/dist/{chunk-notices-prqkv7ge.js → chunk-notices-fte9f196.js} +1 -1
  101. package/dist/chunk-onboarding-c5twahc3.js +1 -0
  102. package/dist/{chunk-overview-2j1s6kqg.js → chunk-overview-k4ccprax.js} +1 -1
  103. package/dist/{chunk-palette-4qt6ewem.js → chunk-palette-9rbp2fab.js} +1 -1
  104. package/dist/chunk-placement-items-me598wsb.js +1 -0
  105. package/dist/{chunk-profile-pfzyc04p.js → chunk-profile-s7r7fcvz.js} +1 -1
  106. package/dist/{chunk-prompt-history-2bcp2rky.js → chunk-prompt-history-hf296e7v.js} +1 -1
  107. package/dist/chunk-prompts-c8s0nhkm.js +1 -0
  108. package/dist/chunk-room-confirms-ga2sbvhc.js +1 -0
  109. package/dist/chunk-room-menu-7h4jym2b.js +1 -0
  110. package/dist/chunk-rooms-menu-button-pgtaanb6.js +1 -0
  111. package/dist/{chunk-schedules-64h9gfwn.js → chunk-schedules-mbnwcxpc.js} +1 -1
  112. package/dist/{chunk-seat-menu-vrpc40v9.js → chunk-seat-menu-r0k0eawr.js} +1 -1
  113. package/dist/chunk-sheet-hosts-a5dfevy9.js +1 -0
  114. package/dist/{chunk-shortcut-help-bdbkdcs9.js → chunk-shortcut-help-a6pkjcq7.js} +2 -2
  115. package/dist/{chunk-shortcuts-qft33r8t.js → chunk-shortcuts-cgt87jkz.js} +1 -1
  116. package/dist/chunk-skill-editor-67yk4x7t.js +8 -0
  117. package/dist/chunk-skills-rewemey4.js +1 -0
  118. package/dist/chunk-switcher-list-t8rbay2y.js +1 -0
  119. package/dist/{chunk-tab-dot-1p68ybf8.js → chunk-tab-dot-vr11dfrw.js} +1 -1
  120. package/dist/chunk-table-52nh0azk.js +1 -0
  121. package/dist/chunk-table2d-g57vr6h0.js +1 -0
  122. package/dist/chunk-table3d-rp0w6kt4.js +4220 -0
  123. package/dist/chunk-thread-actions-qcxt1y1g.js +1 -0
  124. package/dist/{chunk-thread-cards-t794fp4d.js → chunk-thread-cards-c2mrp2gj.js} +1 -1
  125. package/dist/chunk-thread-list-0071q455.js +217 -0
  126. package/dist/{chunk-transcript-km4e3aey.js → chunk-transcript-789yqysq.js} +1 -1
  127. package/dist/chunk-where-hmwmme9e.js +1 -0
  128. package/dist/{chunk-workspace-d064v56e.js → chunk-workspace-wr1qrtsh.js} +2 -2
  129. package/dist/chunk-zh-tw-z5p5mpph.js +1 -0
  130. package/dist/index.html +1 -1
  131. package/dist/sw.js +1 -1
  132. package/package.json +3 -3
  133. package/src/api-types.ts +51 -0
  134. package/src/app/app.ts +38 -4
  135. package/src/app/helper-routes.ts +106 -0
  136. package/src/app/rooms.ts +18 -3
  137. package/src/app/routes.ts +20 -0
  138. package/src/app/surface.ts +18 -1
  139. package/src/app/team-routes.ts +21 -1
  140. package/src/i18n/zh-tw.ts +46 -9
  141. package/dist/chunk-account-hck7mhf8.js +0 -1
  142. package/dist/chunk-action-menu-beqh40k6.js +0 -1
  143. package/dist/chunk-agent-znnth24t.js +0 -1
  144. package/dist/chunk-arranged-rooms-wfakrddk.js +0 -1
  145. package/dist/chunk-bulk-actions-c4tkvk9g.js +0 -1
  146. package/dist/chunk-character-creator-qwcsdytw.js +0 -1
  147. package/dist/chunk-confirm-z95j9jt3.js +0 -1
  148. package/dist/chunk-entry-hrt97qed.js +0 -1
  149. package/dist/chunk-folder-list-nemtqbnc.js +0 -1
  150. package/dist/chunk-folds-xpg9qcwf.js +0 -1
  151. package/dist/chunk-group-scene-g24kxz6f.js +0 -1
  152. package/dist/chunk-group-table-851jm8ef.js +0 -1
  153. package/dist/chunk-host-icons-23zhqpmc.js +0 -1
  154. package/dist/chunk-host-picture-8tnh2wam.js +0 -1
  155. package/dist/chunk-host-state-j41sp065.js +0 -1
  156. package/dist/chunk-host-ui-cje7a9t9.js +0 -1
  157. package/dist/chunk-index-3k7sdph2.js +0 -1
  158. package/dist/chunk-index-4jf4jvfd.css +0 -1
  159. package/dist/chunk-index-4s1qj9we.js +0 -2
  160. package/dist/chunk-index-5fz5e1ct.js +0 -2
  161. package/dist/chunk-index-azrnzgev.js +0 -2
  162. package/dist/chunk-index-c2ag3qw2.js +0 -2
  163. package/dist/chunk-index-efgm0066.js +0 -2
  164. package/dist/chunk-index-fe0m5mht.js +0 -2
  165. package/dist/chunk-index-hrtyanda.js +0 -2
  166. package/dist/chunk-index-j479p62w.js +0 -2
  167. package/dist/chunk-index-kankja6p.js +0 -50
  168. package/dist/chunk-index-kb44jp50.js +0 -2
  169. package/dist/chunk-index-mnwdbb4n.js +0 -2
  170. package/dist/chunk-index-n6zrc05a.js +0 -2
  171. package/dist/chunk-index-n93wqszt.js +0 -8
  172. package/dist/chunk-index-nrexxkar.js +0 -2
  173. package/dist/chunk-index-pgxgq61x.js +0 -2
  174. package/dist/chunk-index-q5vzjqr5.js +0 -2
  175. package/dist/chunk-index-qqwk157d.js +0 -2
  176. package/dist/chunk-index-r3tqhew8.js +0 -2
  177. package/dist/chunk-index-rg9vh59e.js +0 -1
  178. package/dist/chunk-index-sxq69p1f.js +0 -2
  179. package/dist/chunk-index-taq2psr6.js +0 -2
  180. package/dist/chunk-index-wc83vb0a.js +0 -2
  181. package/dist/chunk-index-xbs8q4kn.js +0 -2
  182. package/dist/chunk-index-xxbveevc.js +0 -2
  183. package/dist/chunk-index-zx6yka30.js +0 -2
  184. package/dist/chunk-lang-css-yrc25qk9.js +0 -1
  185. package/dist/chunk-lang-html-rwe8epvf.js +0 -1
  186. package/dist/chunk-lang-javascript-d6x6qjtg.js +0 -1
  187. package/dist/chunk-lang-typescript-1rv9vdcz.js +0 -1
  188. package/dist/chunk-layout-actions-6assr93n.js +0 -1
  189. package/dist/chunk-menu-items-9szcza00.js +0 -2
  190. package/dist/chunk-mode-toggle-bzbq7ycq.js +0 -1
  191. package/dist/chunk-note-row-g20h11pm.js +0 -75
  192. package/dist/chunk-notes-gc8bssxn.js +0 -1
  193. package/dist/chunk-onboarding-mdtc2mb7.js +0 -1
  194. package/dist/chunk-placement-items-2eect825.js +0 -1
  195. package/dist/chunk-prompts-052mb05y.js +0 -1
  196. package/dist/chunk-room-confirms-asvmjh5s.js +0 -1
  197. package/dist/chunk-room-menu-dm2r2hk6.js +0 -1
  198. package/dist/chunk-rooms-menu-button-32hemzxc.js +0 -1
  199. package/dist/chunk-sheet-hosts-jaqx490x.js +0 -1
  200. package/dist/chunk-skill-editor-z3dx2895.js +0 -8
  201. package/dist/chunk-skills-4jfcv39n.js +0 -1
  202. package/dist/chunk-switcher-list-xysjd4tw.js +0 -1
  203. package/dist/chunk-table-0v4q4dx3.js +0 -1
  204. package/dist/chunk-table-seats-f683hx8k.js +0 -1
  205. package/dist/chunk-table2d-1a6atjhj.js +0 -1
  206. package/dist/chunk-table3d-k0ffeffj.js +0 -4220
  207. package/dist/chunk-thread-actions-4rpfg4fq.js +0 -1
  208. package/dist/chunk-thread-list-1pcygpka.js +0 -1
  209. package/dist/chunk-where-phjwqggy.js +0 -1
  210. package/dist/chunk-zh-tw-qf18hcxc.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{s,N,M,r,t,m,e,n,D,d,f,g,Xe}from"./chunk-index-2e4am3hw.js";import"./chunk-index-64rsz6pf.js";import"./chunk-index-2t30xwed.js";import"./chunk-index-18pgxxw3.js";import"./chunk-index-kbrg32sx.js";import{ti}from"./chunk-index-kb3w11mn.js";import{Ut}from"./chunk-index-xq84gg8w.js";import{L}from"./chunk-index-8d81qy69.js";import{Kt,Dn,qr,xi,ns,is,rs,os,ss}from"./chunk-index-dnjftvtq.js";import{ee,Te}from"./chunk-index-cdctnw71.js";function Q(i){let{view:a}=i;return e("li",{children:n("button",{type:"button",className:"menu-item council-row","aria-current":i.current||void 0,onClick:i.onPick,children:[e(Xe,{view:a,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:a.displayName}),e("span",{className:"meta",children:t("{count} knights",{count:a.members?.length??0})})]})]})})}function W(i){let{council:a}=i,w=xi(),u=ti(),[v,A]=r([]),[y,O]=r(),[H,S]=r(""),[G,I]=r(!1),[P,j]=r(""),[p,C]=r(!1),[z,x]=r(),E=N(),R=a?.name,T=a?.members?.join(`
2
+ `);s(()=>{if(!i.open)return;if(x(void 0),I(a===void 0),j(""),C(!1),O(void 0),S(""),A(a?[...a.members??[]]:ns(u)),!R)return;let o=!0;return ee.group(R).then((l)=>{if(!o)return;O(l),S(l.host)},()=>{return}),()=>{o=!1}},[i.open,R,T]);let U=M(()=>new Set(u.map((o)=>o.name)),[u]),_=u.find((o)=>o.home)?.name,c=rs(v,(o)=>U.has(o)),b=os(c,H||void 0,_),X=(o)=>u.find((l)=>l.name===o)?.displayName??o,F=c.length>=Kt,k=c.length>=Dn,q=a===void 0||c.join(",")!==(a.members??[]).join(",")||y!==void 0&&b!==y.host,B=async(o)=>{C(!0),x(void 0);try{await o(),await Te()}catch(l){return x(d(l)),C(!1),!1}return C(!1),!0},J=async()=>{if(!a)return;if(!await B(async()=>{await ee.updateGroup(a.name,{...c.join(",")!==(a.members??[]).join(",")?{members:c}:{},...y&&b!==y.host?{host:b}:{}})}))return;f(t("Saved.")),i.onClose()},K=async()=>{let o=P.trim();if(o==="")return;let l=new Set([...u.map((V)=>V.name),...w.map((V)=>V.name)]),h;if(!await B(async()=>{h=await ee.createGroup({name:ss(o,l),displayName:o,members:c,host:b})})||!h)return;qr(h.room),D("table",h.name,{replace:!0}),f(t("Made {name}.",{name:h.displayName})),i.onClose()};return n("div",{className:"stack council-sheet",children:[w.length>0?n("section",{className:"stack","aria-label":t("Councils"),children:[e("h3",{children:t("Councils")}),e("ul",{className:"menu",children:w.map((o)=>e(Q,{view:o,current:o.key===a?.key,onPick:()=>{qr(o.key),D("table",o.name,{replace:!0}),i.onClose()}},o.key))})]}):null,n("fieldset",{className:"field council-pick",children:[e("legend",{children:a?t("Edit this council"):t("Pick who sits")}),n("span",{className:"meta council-count","aria-live":"polite",children:[t("{count} of {max} picked",{count:c.length,max:Kt}),F?` · ${t("At most {max} knights",{max:Kt})}`:""]}),e("ul",{className:"menu",children:u.map((o)=>{let l=v.includes(o.name);return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",children:[e("input",{type:"checkbox",checked:l,disabled:!l&&F,onChange:()=>A(is(v,o.name,Kt))}),e(Xe,{view:o,size:32}),e("span",{className:"menu-text",children:e("strong",{children:o.displayName})})]})},o.key)})})]}),k?e(Ut,{label:t("Host"),value:b,onChange:S,options:c.map((o)=>({value:o,label:X(o)}))}):e("span",{className:"meta",children:t("A council needs at least {min} knights.",{min:Dn})}),G?n("label",{htmlFor:E,children:[t("Council name"),e("input",{id:E,value:P,autoComplete:"off",onChange:(o)=>j(o.target.value)})]}):null,z?e(g,{message:z}):null,e("div",{className:"actions",children:a&&!G?n(m,{children:[e("button",{type:"button",className:"secondary",disabled:!k||p,onClick:()=>I(!0),children:t("Save as a new council")}),e("button",{type:"button",disabled:!k||!q||p,onClick:J,children:p?t("Saving…"):t("Done")})]}):e("button",{type:"button",disabled:!k||P.trim()===""||p,onClick:K,children:p?t("Saving…"):a?t("Save as a new council"):t("Make council")})})]})}function de(i){return e(L,{open:i.open,title:t("Council"),onClose:i.onClose,size:"default",children:e(W,{open:i.open,council:i.council,onClose:i.onClose})})}export{de as CouncilSheet};
@@ -1 +1 @@
1
- import{xr}from"./chunk-index-kankja6p.js";import{cr}from"./chunk-index-azrnzgev.js";import{Ho,Ko,Lr,Xr,Jo,es}from"./chunk-index-4s1qj9we.js";var ne=xr,re=(a)=>{for(let n=a;n;n=n.parentElement){let{overflowY:l}=getComputedStyle(n);if((l==="auto"||l==="scroll")&&n.scrollHeight>n.clientHeight)return n}return document.scrollingElement??document.documentElement};function se(a){let{item:n,root:l,key:u,mode:C}=a,c=re(l),O=c===document.scrollingElement||c===document.documentElement,k=()=>O?0:c.getBoundingClientRect().top,X=()=>O?window.innerHeight:c.clientHeight,x=(e)=>e-k()+c.scrollTop,p=(e)=>{let t=e.getBoundingClientRect();return{top:x(t.top),height:t.height}},y=document.createElement("div");y.className="drop-line",y.setAttribute("aria-hidden","true");let z=[],P=[],g=[],h=[],R=[],B={top:0,bottom:0},D=()=>{let e=[...l.querySelectorAll("[data-drop-item], [data-folder-block]")].map((t)=>[t,t.style.transform]);for(let[t]of e)t.style.removeProperty("transform");try{j()}finally{for(let[t,r]of e)if(r)t.style.transform=r}},j=()=>{if(C==="room"){P=[...l.querySelectorAll("[data-drop-zone]")],z=P.map((t)=>{let{top:r,height:H}=p(t);return{id:t.dataset.zoneId??"",kind:t.dataset.dropZone,...t.dataset.folder?{folder:t.dataset.folder}:{},top:r,bottom:r+H,items:t.dataset.collapsed===void 0?[...t.querySelectorAll("[data-drop-item]")].map((o)=>({key:o.dataset.key??"",...p(o)})):[]}});return}g=[...l.querySelectorAll(":scope > [data-folder-block]")],h=g.map((t)=>({key:t.dataset.key??"",...p(t)})),R=g.map((t)=>({key:t.dataset.key??"",...p(t.querySelector("[data-folder-head]")??t)}));let e=p(l);B={top:e.top,bottom:e.top+e.height}};cr(!0);let G=n.getBoundingClientRect().top;n.setAttribute("data-lifted",""),l.setAttribute("data-reordering","");let F=n.getBoundingClientRect().top-G;if(F)c.scrollTop+=F;D();let J=x(a.y),I={x:0,y:a.y},Z=!1,f=0,w,d,q={type:"cancel"};try{n.setPointerCapture(a.pointerId)}catch{}let _=()=>{f=0;let e=x(I.y),t=e-J;if(Math.abs(t)>ne)Z=!0;n.style.transform=`translate3d(0, ${t}px, 0)`;let r;if(C==="room"){let o=Ho(z,u,e);q=o?{type:"room",drop:o}:{type:"cancel"};let M=o?z.indexOf(o.zone):-1;r=P[M];let E=r?.contains(n)??!1,s=o?o.zone.items:[],m=E?[...r.querySelectorAll("[data-drop-item]")]:[],v=s.findIndex((i)=>i.key===u),W=o?Xr(s.map((i)=>i.key),u,o.before):0,ee=s.length>1?Math.max(0,(s[1]?.top??0)-(s[0]?.top??0)-(s[0]?.height??0)):0,U=E&&v>=0?Lr(s,v,W,ee):[];for(let i of document.querySelectorAll("[data-drop-item]:not([data-lifted])"))i.style.removeProperty("transform");if(m.forEach((i,A)=>{if(U[A])i.style.transform=`translate3d(0, ${U[A]}px, 0)`}),r&&o&&!E){let i=o.before===null?void 0:o.zone.items.find((oe)=>oe.key===o.before),A=p(r).top,te=i?i.top-A:o.zone.items.length?p(r).height:0;y.style.top=`${te}px`,r.append(y)}else y.remove();if(o?.zone.kind==="folder"&&o.zone.items.length===0&&r?.dataset.collapsed!==void 0){if(d?.zone!==o.zone.id){if(d)clearTimeout(d.timer);let i=o.zone.folder??"";d={zone:o.zone.id,timer:setTimeout(()=>{a.open(i),requestAnimationFrame(()=>requestAnimationFrame(()=>{D(),L()}))},es)}}}else if(d)clearTimeout(d.timer),d=void 0}else{let o=Ko(R,B,u,e);q=o?{type:"folder",before:o.before}:{type:"cancel"};let M=h.findIndex((m)=>m.key===u),E=o?Xr(h.map((m)=>m.key),u,o.before):M,s=Lr(h,M,E,12);g.forEach((m,v)=>{if(m!==n)m.style.transform=s[v]?`translate3d(0, ${s[v]}px, 0)`:""})}if(r!==w)w?.removeAttribute("data-drop-target"),r?.setAttribute("data-drop-target",""),w=r;let H=Jo(I.y,k(),k()+X());if(H)c.scrollTop+=H,L()},L=()=>{if(!f)f=requestAnimationFrame(_)},b=(e)=>{Q(),a.done(e)},S=(e)=>e.pointerId===a.pointerId,K=(e)=>{if(!S(e))return;e.stopPropagation(),e.preventDefault(),I={x:e.clientX,y:e.clientY},L()},N=(e)=>{if(!S(e))return;if(e.stopPropagation(),f)cancelAnimationFrame(f),_();b(Z?q:{type:"tap"})},V=(e)=>{if(S(e))b({type:"cancel"})},Y=(e)=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation(),b({type:"cancel"})},T=(e)=>e.preventDefault();function Q(){if(cr(!1),window.removeEventListener("pointermove",K,!0),window.removeEventListener("pointerup",N,!0),window.removeEventListener("pointercancel",V,!0),window.removeEventListener("keydown",Y,!0),window.removeEventListener("touchmove",T,!0),window.removeEventListener("contextmenu",T,!0),f)cancelAnimationFrame(f);if(d)clearTimeout(d.timer);w?.removeAttribute("data-drop-target"),y.remove(),n.removeAttribute("data-lifted"),n.style.removeProperty("transform"),l.removeAttribute("data-reordering");for(let e of l.querySelectorAll("[data-drop-item], [data-folder-block]"))e.style.removeProperty("transform");try{n.releasePointerCapture(a.pointerId)}catch{}}return window.addEventListener("pointermove",K,!0),window.addEventListener("pointerup",N,!0),window.addEventListener("pointercancel",V,!0),window.addEventListener("keydown",Y,!0),window.addEventListener("touchmove",T,{capture:!0,passive:!1}),window.addEventListener("contextmenu",T,!0),L(),()=>b({type:"cancel"})}export{se as lift};
1
+ import{Tr}from"./chunk-index-2e4am3hw.js";import{Or}from"./chunk-index-02vfshtt.js";import{Yo,jo,Ur,Vr,Ko,Jo}from"./chunk-index-qfgkfq86.js";var ne=Tr,re=(a)=>{for(let n=a;n;n=n.parentElement){let{overflowY:l}=getComputedStyle(n);if((l==="auto"||l==="scroll")&&n.scrollHeight>n.clientHeight)return n}return document.scrollingElement??document.documentElement};function se(a){let{item:n,root:l,key:u,mode:C}=a,c=re(l),O=c===document.scrollingElement||c===document.documentElement,k=()=>O?0:c.getBoundingClientRect().top,X=()=>O?window.innerHeight:c.clientHeight,x=(e)=>e-k()+c.scrollTop,p=(e)=>{let t=e.getBoundingClientRect();return{top:x(t.top),height:t.height}},y=document.createElement("div");y.className="drop-line",y.setAttribute("aria-hidden","true");let z=[],P=[],g=[],h=[],R=[],B={top:0,bottom:0},D=()=>{let e=[...l.querySelectorAll("[data-drop-item], [data-folder-block]")].map((t)=>[t,t.style.transform]);for(let[t]of e)t.style.removeProperty("transform");try{j()}finally{for(let[t,r]of e)if(r)t.style.transform=r}},j=()=>{if(C==="room"){P=[...l.querySelectorAll("[data-drop-zone]")],z=P.map((t)=>{let{top:r,height:H}=p(t);return{id:t.dataset.zoneId??"",kind:t.dataset.dropZone,...t.dataset.folder?{folder:t.dataset.folder}:{},top:r,bottom:r+H,items:t.dataset.collapsed===void 0?[...t.querySelectorAll("[data-drop-item]")].map((o)=>({key:o.dataset.key??"",...p(o)})):[]}});return}g=[...l.querySelectorAll(":scope > [data-folder-block]")],h=g.map((t)=>({key:t.dataset.key??"",...p(t)})),R=g.map((t)=>({key:t.dataset.key??"",...p(t.querySelector("[data-folder-head]")??t)}));let e=p(l);B={top:e.top,bottom:e.top+e.height}};Or(!0);let G=n.getBoundingClientRect().top;n.setAttribute("data-lifted",""),l.setAttribute("data-reordering","");let F=n.getBoundingClientRect().top-G;if(F)c.scrollTop+=F;D();let J=x(a.y),I={x:0,y:a.y},Z=!1,f=0,w,d,q={type:"cancel"};try{n.setPointerCapture(a.pointerId)}catch{}let _=()=>{f=0;let e=x(I.y),t=e-J;if(Math.abs(t)>ne)Z=!0;n.style.transform=`translate3d(0, ${t}px, 0)`;let r;if(C==="room"){let o=Yo(z,u,e);q=o?{type:"room",drop:o}:{type:"cancel"};let M=o?z.indexOf(o.zone):-1;r=P[M];let E=r?.contains(n)??!1,s=o?o.zone.items:[],m=E?[...r.querySelectorAll("[data-drop-item]")]:[],v=s.findIndex((i)=>i.key===u),W=o?Vr(s.map((i)=>i.key),u,o.before):0,ee=s.length>1?Math.max(0,(s[1]?.top??0)-(s[0]?.top??0)-(s[0]?.height??0)):0,U=E&&v>=0?Ur(s,v,W,ee):[];for(let i of document.querySelectorAll("[data-drop-item]:not([data-lifted])"))i.style.removeProperty("transform");if(m.forEach((i,A)=>{if(U[A])i.style.transform=`translate3d(0, ${U[A]}px, 0)`}),r&&o&&!E){let i=o.before===null?void 0:o.zone.items.find((oe)=>oe.key===o.before),A=p(r).top,te=i?i.top-A:o.zone.items.length?p(r).height:0;y.style.top=`${te}px`,r.append(y)}else y.remove();if(o?.zone.kind==="folder"&&o.zone.items.length===0&&r?.dataset.collapsed!==void 0){if(d?.zone!==o.zone.id){if(d)clearTimeout(d.timer);let i=o.zone.folder??"";d={zone:o.zone.id,timer:setTimeout(()=>{a.open(i),requestAnimationFrame(()=>requestAnimationFrame(()=>{D(),L()}))},Jo)}}}else if(d)clearTimeout(d.timer),d=void 0}else{let o=jo(R,B,u,e);q=o?{type:"folder",before:o.before}:{type:"cancel"};let M=h.findIndex((m)=>m.key===u),E=o?Vr(h.map((m)=>m.key),u,o.before):M,s=Ur(h,M,E,12);g.forEach((m,v)=>{if(m!==n)m.style.transform=s[v]?`translate3d(0, ${s[v]}px, 0)`:""})}if(r!==w)w?.removeAttribute("data-drop-target"),r?.setAttribute("data-drop-target",""),w=r;let H=Ko(I.y,k(),k()+X());if(H)c.scrollTop+=H,L()},L=()=>{if(!f)f=requestAnimationFrame(_)},b=(e)=>{Q(),a.done(e)},S=(e)=>e.pointerId===a.pointerId,K=(e)=>{if(!S(e))return;e.stopPropagation(),e.preventDefault(),I={x:e.clientX,y:e.clientY},L()},N=(e)=>{if(!S(e))return;if(e.stopPropagation(),f)cancelAnimationFrame(f),_();b(Z?q:{type:"tap"})},V=(e)=>{if(S(e))b({type:"cancel"})},Y=(e)=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation(),b({type:"cancel"})},T=(e)=>e.preventDefault();function Q(){if(Or(!1),window.removeEventListener("pointermove",K,!0),window.removeEventListener("pointerup",N,!0),window.removeEventListener("pointercancel",V,!0),window.removeEventListener("keydown",Y,!0),window.removeEventListener("touchmove",T,!0),window.removeEventListener("contextmenu",T,!0),f)cancelAnimationFrame(f);if(d)clearTimeout(d.timer);w?.removeAttribute("data-drop-target"),y.remove(),n.removeAttribute("data-lifted"),n.style.removeProperty("transform"),l.removeAttribute("data-reordering");for(let e of l.querySelectorAll("[data-drop-item], [data-folder-block]"))e.style.removeProperty("transform");try{n.releasePointerCapture(a.pointerId)}catch{}}return window.addEventListener("pointermove",K,!0),window.addEventListener("pointerup",N,!0),window.addEventListener("pointercancel",V,!0),window.addEventListener("keydown",Y,!0),window.addEventListener("touchmove",T,{capture:!0,passive:!1}),window.addEventListener("contextmenu",T,!0),L(),()=>b({type:"cancel"})}export{se as lift};
@@ -0,0 +1 @@
1
+ import{Mt,Ft}from"./chunk-index-0a81da8z.js";import{h}from"./chunk-index-2e4am3hw.js";function H(){try{let r=document.createElement("canvas");return!!(r.getContext("webgl2")||r.getContext("webgl"))}catch{return!1}}function x(r,n){return[r,n.includes("?")?n.slice(n.indexOf("?")):""].some((c)=>{let d=new URLSearchParams(c).get("nogl");return d!==null&&d!=="0"&&d!=="false"})}async function I(r,n,S){let c=n.variant==="compact",d=n.labels??Ft,l=new Map,E=(e)=>{l.clear();for(let t of e)l.set(t.id,{...t})};E(n.seats);let m={t:n.theme,s:n.scheme},a=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=c?"compact":"full";let f=document.createElement("div");f.className="rt-table-stage",o.appendChild(f);let i=null,y=!1,A=()=>!c&&(Boolean(n.listBelow)||y);r.appendChild(o);let u=new Map,g=()=>{if(!A()){i?.remove(),i=null,u.clear(),delete o.dataset.list;return}if(!i)i=document.createElement("ul"),i.className="rt-table-list",i.setAttribute("aria-label",d.table),o.appendChild(i),o.dataset.list="";for(let e of[...u.keys()])if(!l.has(e))u.delete(e);for(let e of l.values()){let t=u.get(e.id);if(!t){t=document.createElement("button"),t.type="button",t.dataset.seat=e.id;let s=e.id;t.addEventListener("click",(p)=>{let b=l.get(s);if(b)n.onSeatClick({id:b.id,name:b.name,at:Mt(p,p.currentTarget)})}),u.set(e.id,t)}t.textContent=d.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}i.replaceChildren(...[...l.values()].map((e)=>{let t=document.createElement("li"),s=u.get(e.id);if(s)t.appendChild(s);return t}))};g();let w=(e)=>{y=!e,g(),n.onNames?.(e)},T=async()=>{let{createTable2D:e}=await (h("g57vr6h0"),import("./chunk-table2d-g57vr6h0.js"));a=e(f,{...n,theme:m.t,scheme:m.s,seats:[...l.values()]}),w(!0)},C=async()=>{let{createTable3D:e}=await (h("rp0w6kt4"),import("./chunk-table3d-rp0w6kt4.js"));a=e(f,{...n,theme:m.t,scheme:m.s,seats:[...l.values()],onNames:w},()=>{a?.dispose(),T()})};if(c||S==="svg"||S!=="webgl"&&(x(location.search,location.hash)||!H()))await T();else try{await C()}catch{await T()}let M,L=n.onSeatMenu;if(L&&!c){let{attachSeatMenu:e}=await (h("r0k0eawr"),import("./chunk-seat-menu-r0k0eawr.js"));M=e(o,(t,s,p)=>{let b=t instanceof Element?t.closest("[data-seat]")?.dataset.seat:void 0,v=l.get(b??a?.seatAt?.(s,p)??"");return v?{id:v.id,name:v.name}:void 0},L)}return{get kind(){return a.kind},setTheme(e,t){m={t:e,s:t},a.setTheme(e,t)},setSeats(e){E(e),g(),a.setSeats(e)},setState(e,t){let s=l.get(e);if(s)s.state=t;g(),a.setState(e,t)},setMark:(e,t)=>a.setMark(e,t),setAvatar(e,t){let s=l.get(e);if(s)s.avatarSvg=t;return a.setAvatar(e,t)},setReducedMotion:(e)=>a.setReducedMotion(e),resetCamera:()=>a.resetCamera(),focus:(e,t)=>a.focus(e,t),focused:()=>a.focused(),seatAt:(e,t)=>a.seatAt?.(e,t)??null,getStats:()=>a.getStats(),dispose(){M?.(),a?.dispose(),o.remove()}}}export{I as mountRoundTable};
@@ -0,0 +1 @@
1
+ import{h,s,N,t,te,m,e,n,o,gt,u,pe,Xe,In,vn}from"./chunk-index-2e4am3hw.js";import{dr,hr,pr,mr}from"./chunk-index-g3wrs02w.js";import"./chunk-index-e2dqjde8.js";import{Bt}from"./chunk-index-12zyshae.js";import{Ti}from"./chunk-index-g1awv7rk.js";var F=()=>(h("y73mpsh1"),import("./chunk-layout-actions-y73mpsh1.js")),y=(a)=>(h("me598wsb"),import("./chunk-placement-items-me598wsb.js")).then((r)=>r.folderMenu(a)),R=(a)=>({mode:"folder",key:a,item:(r)=>r.closest("[data-folder-block]"),root:(r)=>r.closest("[data-folder-block]")?.parentElement??null,onDrop:(r)=>{if(r.type==="folder")F().then((i)=>i.placeFolderBefore(a,r.before))},open:pr});function k(a){let{id:r,name:i}=a,d=dr().has(r),l=a.holdsActive||!d,c=N(),b=Bt(()=>y(r),R(r)),v=(f)=>{y(r).then((g)=>{if(!g)return;let p=f.getBoundingClientRect();pe({...g,at:{x:p.left,y:p.bottom},via:"key",source:f})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":l?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...b,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":l,"aria-controls":c,"aria-label":l?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>hr(r),children:[e(o,{name:"chevron",size:16,className:"folder-chevron","data-open":l||void 0}),e("strong",{children:i}),e("span",{className:"meta",children:te(a.count,"{count} room","{count} rooms")}),l?null:a.stack]}),a.muted==="none"?null:e(o,{name:"bell-off",size:14,className:"muted-mark","data-partial":a.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":a.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),l?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(f)=>v(f.currentTarget),children:e(o,{name:"more",size:18})})]}),e("div",{id:c,className:"folder-body",hidden:!l,children:l?a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.children:null})]})}var S=4;function M(a){let r=a.rooms.slice(0,S),i=u((l)=>r.map((c)=>l.rooms[c]?.view),r.join(",")),d=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[i.map((l)=>l?e("span",{className:"folder-stack-item",children:e(Xe,{view:l,size:28})},l.key):null),d>0?n("span",{className:"folder-stack-more",children:["+",d]}):null]})}function w(a){let r=u((i)=>({waiting:a.rooms.reduce((d,l)=>d+gt(i,l),0),typing:a.rooms.some((d)=>i.rooms[d]?.typing)}),a.rooms.join(","));return n(m,{children:[r.typing?e(In,{}):null,r.waiting?e(vn,{count:r.waiting}):null]})}function C(a){return u((r)=>Ti(a,(i)=>r.rooms[i]?.view?.muted===!0),a.join(","))}function Q(a){let r=a.folders.map((i)=>i.id).join(",");return s(()=>{if(a.listed)mr(r?r.split(","):[])},[a.listed,r]),e(m,{children:a.folders.map((i)=>e(B,{folder:i,...a},i.id))})}function B(a){let{folder:r}=a,i=C(r.rooms);return e(k,{id:r.id,name:r.name,count:r.rooms.length,holdsActive:a.active!==void 0&&r.rooms.includes(a.active),muted:i,summary:e(w,{rooms:r.rooms}),stack:e(M,{rooms:r.rooms}),children:a.rooms(r.rooms)})}export{Q as FolderList};
@@ -0,0 +1 @@
1
+ import{dr,fr,hr,pr,mr}from"./chunk-index-g3wrs02w.js";export{fr as collapsedNow,pr as expandFolder,mr as pruneCollapsed,hr as toggleCollapsed,dr as useCollapsed};
@@ -1 +1 @@
1
- import{t,e,n,o,v}from"./chunk-index-kankja6p.js";import{Pn,nn}from"./chunk-index-8eexybcx.js";function l({steps:s}){return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),e("p",{className:"meta",children:t("These steps come first. The rest of the app opens when they are done.")}),e("ul",{className:"menu",children:s.map((a)=>e("li",{children:n("a",{className:"menu-item menu-link",href:v(a.open.page),children:[n("span",{className:"menu-text",children:[e("strong",{children:Pn(a)}),nn(a)?e("span",{className:"meta",children:nn(a)}):null]}),e(o,{name:"chevron",size:16})]})},a.id))})]})}export{l as GatePage};
1
+ import{t,e,n,o,v}from"./chunk-index-2e4am3hw.js";import{En,sn}from"./chunk-index-0w4bfjb5.js";function l({steps:s}){return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),e("p",{className:"meta",children:t("These steps come first. The rest of the app opens when they are done.")}),e("ul",{className:"menu",children:s.map((a)=>e("li",{children:n("a",{className:"menu-item menu-link",href:v(a.open.page),children:[n("span",{className:"menu-text",children:[e("strong",{children:En(a)}),sn(a)?e("span",{className:"meta",children:sn(a)}):null]}),e(o,{name:"chevron",size:16})]})},a.id))})]})}export{l as GatePage};
@@ -0,0 +1 @@
1
+ import{Ei,Ci,As}from"./chunk-index-t998yg8y.js";import"./chunk-index-kb3w11mn.js";import"./chunk-index-18pgxxw3.js";import"./chunk-index-2t30xwed.js";import"./chunk-index-8d81qy69.js";import"./chunk-index-64rsz6pf.js";import"./chunk-index-kbrg32sx.js";export{As as GroupScene,Ci as GroupStage,Ei as useGroupFocus};
@@ -0,0 +1 @@
1
+ import{Sr,t,m,e,n,o,u,it}from"./chunk-index-2e4am3hw.js";import"./chunk-index-2t30xwed.js";import"./chunk-index-18pgxxw3.js";import"./chunk-index-kbrg32sx.js";import{Vt}from"./chunk-index-kb3w11mn.js";import"./chunk-index-64rsz6pf.js";var s=(a,r)=>r?Sr(a,r):a;function T(a){let r=u((i)=>i.rooms[a.roomKey]?.view),l=it();if(!r||r.kind!=="group")return null;let c=r.members??[];return n(m,{children:[n("button",{type:"button",className:"icon-button group-table-button","aria-label":t("Table"),"aria-pressed":a.scene,onClick:()=>a.onScene(!a.scene),children:[e(o,{name:"table"}),e("span",{className:"group-table-label",children:t("Table")})]}),l==="camelot"&&!a.scene?s(e("div",{className:"group-strip",children:e(Vt,{members:c,groupRoom:a.roomKey,variant:"compact"})}),a.slot):null]})}export{T as GroupTable};
@@ -0,0 +1 @@
1
+ import"./chunk-index-zyvwhxga.js";
@@ -0,0 +1 @@
1
+ import{at}from"./chunk-index-q7g62sgm.js";export{at as HostPicture};
@@ -0,0 +1 @@
1
+ import{Hr,Ae,jr,Kr,Jr,eo,to,nn,nr,no,zs}from"./chunk-index-kbrg32sx.js";export{no as keepCards,nr as keepReads,to as noCards,eo as noReads,zs as onFrame,nn as seedUnread,Hr as subscribeHost,Kr as totalUnread,Jr as unreadCounts,jr as unreadOf,Ae as useHost};
@@ -0,0 +1 @@
1
+ import{J,X,s,N,Qe,M,a,r,t,te,m,e,n,o,v,hi,y,u,ce,d,f,w,g,_,P,Gt,$n,Rt,k,kr,_e,Zt,Vi,hn,pn,Ct,ne,bn,He,Pr,Ee}from"./chunk-index-2e4am3hw.js";import{Rn}from"./chunk-index-2t30xwed.js";import{Ni,To,Be,Li}from"./chunk-index-18pgxxw3.js";import{K}from"./chunk-index-jgzygbt8.js";import{Ae,eo,to,nn,nr,no}from"./chunk-index-kbrg32sx.js";import{st,at}from"./chunk-index-q7g62sgm.js";import{ur}from"./chunk-index-ffbrm6tr.js";import"./chunk-index-zyvwhxga.js";import{qe}from"./chunk-index-31x6krbs.js";import{he}from"./chunk-index-v6smgw77.js";import"./chunk-index-8d81qy69.js";function Je(l){let i={};for(let c of l)if(c.type==="multiselect")i[c.name]=[...xe(c.initial)];else i[c.name]=xe(c.initial)[0]??"";return i}var xe=(l)=>l===void 0?[]:typeof l==="string"?[l]:[...l];function je(l,i){let c={};for(let p of l){let H=i[p.name];if(H===void 0||H===""||H.length===0)continue;c[p.name]=H}return c}function Ke(l){let{field:i,value:c}=l,[p,H]=r(""),A=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(p.trim().toLowerCase())):i.options,E=i.search?e("input",{type:"search",value:p,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:i.label}),onChange:(h)=>H(h.target.value)}):null;if(i.type==="select")return n(m,{children:[E,n(qe,{id:l.id,value:String(c),required:i.required===!0,"aria-describedby":l.described,...i.search?{size:6}:{},onChange:(h)=>l.onChange(h.target.value),children:[i.required?null:e("option",{value:"",children:t("None")}),A.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let b=new Set(Array.isArray(c)?c:[]);return n(m,{children:[E,e("fieldset",{"aria-describedby":l.described,children:A.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:b.has(h.value),onChange:(C)=>{let R=new Set(b);if(C.target.checked)R.add(h.value);else R.delete(h.value);l.onChange(i.options.filter((I)=>R.has(I.value)).map((I)=>I.value))}}),h.label]},h.value))})]})}function et(l){let{field:i,value:c}=l,p=N(),H="hint"in i?i.hint:void 0,A=l.error||H?`${p}-note`:void 0,E;if("options"in i)E=e(Ke,{field:i,id:p,value:c,described:A,onChange:l.onChange});else if(i.type==="textarea")E=e("textarea",{id:p,rows:5,value:String(c),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":A,onChange:(b)=>l.onChange(b.target.value)});else E=e("input",{id:p,type:i.type==="url"?"url":"text",value:String(c),maxLength:i.max??500,required:i.required===!0,"aria-describedby":A,onChange:(b)=>l.onChange(b.target.value)});return n("div",{className:"host-field",children:[i.type==="multiselect"?e("span",{className:"field-label",children:i.label}):e("label",{htmlFor:p,children:i.label}),E,l.error||H?e("span",{id:`${p}-note`,className:l.error?"field-error":"hint",role:l.error?"alert":void 0,children:l.error??H}):null]})}function ue(l){let{spec:i}=l,[c,p]=r(()=>Je(i.fields)),[H,A]=r(!1),[E,b]=r();return n("form",{className:"host-form",onSubmit:async(C)=>{if(C.preventDefault(),H)return;A(!0),b(void 0);try{b(await l.onSubmit(je(i.fields,c)))}catch(R){b({error:d(R)})}finally{A(!1)}},children:[i.fields.map((C)=>e(et,{field:C,value:c[C.name]??"",error:E?.field===C.name?E.error:void 0,onChange:(R)=>p((I)=>({...I,[C.name]:R}))},C.name)),E&&!i.fields.some((C)=>C.name===E.field)?e(g,{message:E.error}):null,n("div",{className:"actions",children:[l.onCancel?e("button",{type:"button",className:"secondary",disabled:H,onClick:l.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:H,children:i.submit})]})]})}function tt(l){if(!l.ok)return{error:Ni(l.error),...l.field?{field:l.field}:{}};if(l.notice)f(l.notice);if(l.open)Li(l.open);return}function re(l){let[i,c]=r(),[p,H]=r(!1),A=async(b,h)=>tt(await l.run(b,h)),E=async(b)=>{if(b.form||b.confirm){c(b);return}H(!0);try{let h=await A(b,{});if(h)f(h.error,"danger")}catch(h){f(d(h),"danger")}finally{H(!1)}};if(l.actions.length===0)return null;return n("div",{className:l.className??"host-actions",children:[l.actions.map((b)=>e("button",{type:"button",className:b.style==="danger"?"danger":b.style==="secondary"?"secondary":"",disabled:p,onClick:()=>E(b),children:b.label},b.id)),i?.form?e(he,{open:!0,title:i.form.title,onClose:()=>c(void 0),children:e(ue,{spec:i.form,onCancel:()=>c(void 0),onSubmit:async(b)=>{let h=await A(i,b);if(!h)c(void 0);return h}})}):i?e(K,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let b=await A(i,{});if(b)throw Error(b.error)},onClose:()=>c(void 0),children:e("p",{children:i.confirm})}):null]})}var Ie=/^file:([A-Za-z0-9_-]{1,64})$/;function Ve(l){let i=URL.parse(l,document.baseURI);return i!==null&&i.origin===window.location.origin}function nt({id:l,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(l)}`,alt:i,loading:"lazy",decoding:"async",onError:(c)=>{let p=document.createElement("span");p.textContent=i||t("Image"),c.currentTarget.replaceWith(p)}})}var ee=J(function({source:i}){return e("div",{className:"prose",children:e(Gt,{remarkPlugins:[Rt],urlTransform:(c)=>Ie.test(c)?c:$n(c),components:{a:({href:c,children:p})=>c&&/^https?:\/\//.test(c)&&!Ve(c)?e("a",{href:c,target:"_blank",rel:"noreferrer noopener",children:p}):c&&Ve(c)?e("a",{href:c,children:p}):e("span",{children:p}),img:({src:c,alt:p})=>{let H=typeof c==="string"?Ie.exec(c):null;return H?.[1]?e(nt,{id:H[1],alt:p??""}):e("span",{children:p})},pre:kr,table:({children:c})=>e("div",{className:"table-wrap",children:e("table",{children:c})})},children:i})})});function rt(l){switch(l??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var we=(l)=>(l.state??"open")==="open";function ie(l){let{card:i}=l,c=rt(i.state);return n("article",{className:"host-card","data-tone":i.tone??"note","data-state":i.state??"open",children:[n("header",{children:[e("h3",{children:i.title}),c?e(P,{tone:i.state==="working"?"busy":"plain",children:c}):null]}),i.body?e(ee,{source:i.body}):null,i.links?.length?e("div",{className:"host-card-links",children:i.links.map((p)=>e("a",{href:p.url,...p.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.label},`${p.url}`))}):null,we(i)&&i.buttons?.length?e(re,{actions:i.buttons,run:l.run}):null]})}st();function ot(){let[l,i]=r(()=>Rn().toString());return s(()=>{let c=()=>i(Rn().toString());return window.addEventListener("popstate",c),window.addEventListener("hashchange",c),()=>{window.removeEventListener("popstate",c),window.removeEventListener("hashchange",c)}},[]),l}function it(l){if(!l.ok)return{error:Ni(l.error),...l.field?{field:l.field}:{}};if(l.notice)f(l.notice);if(l.open)Li(l.open);return}function lt(l){let{section:i}=l;switch(i.kind){case"markdown":return e(ee,{source:i.text});case"card":return e(ie,{card:i.card,run:l.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.form.title}),e(ue,{spec:i.form,onSubmit:(c)=>l.submit(i.action,c)})]});case"list":return n("section",{className:"stack",children:[i.title?e("h2",{className:"section-title",children:i.title}):null,i.rows.length===0?e(_,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:dt(i.rows).map(([c,p])=>n("li",{children:[p.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[p.open?e("a",{href:p.open,...p.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.title}):e("strong",{children:p.title}),p.subtitle?e("span",{children:p.subtitle}):null]}),p.actions?.length?e(re,{actions:p.actions,run:l.run}):null]},c))})]})}}function ct({routeKey:l}){let i=l??"",c=ot(),p=Ae((R)=>R.pages[i]??0),[H,A]=r(0),[E,b]=r({});s(()=>{let R=!0;return Be.page(i,Object.fromEntries(new URLSearchParams(c))).then((I)=>R&&b({page:I}),(I)=>{if(!R)return;let V=I instanceof ce&&I.status===404;b((O)=>({...V||!O.page?{}:{page:O.page},error:d(I),gone:V}))}),()=>{R=!1}},[i,c,p,H]);let h=async(R,I)=>{let V=await Be.pageAct(i,{action:R,input:I}),O=it(V);if(!O)A((x)=>x+1);return O},C=async(R,I)=>{let V=await Be.pageAct(i,{action:R.id,input:I});if(V.ok)A((O)=>O+1);return V};if(E.gone)return e("div",{className:"page",children:e(_,{children:t("This page is not available.")})});if(!E.page)return e("div",{className:"page",children:E.error?e(g,{message:E.error}):e(w,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:E.page.title})}),E.error?e(g,{message:E.error}):null,E.page.sections.map((R,I)=>e(lt,{section:R,run:C,submit:h},I))]})}function dt(l){let i=new Map;return l.map((c)=>{let p=i.get(c.title)??0;return i.set(c.title,p+1),[`${c.title}:${p}`,c]})}var ut=/https?:\/\/[^\s<>"']+/g,mt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function ft(l){let i=l.replace(mt,""),c=URL.parse(i);return c&&(c.protocol==="https:"||c.protocol==="http:")?i:""}function Oe({text:l}){let i=[],c=0;for(let p of l.matchAll(ut)){let H=ft(p[0]);if(H==="")continue;let A=p.index;if(A>c)i.push(l.slice(c,A));i.push(e("a",{href:H,target:"_blank",rel:"noreferrer noopener",children:H},`${A}`)),c=A+H.length}if(c<l.length)i.push(l.slice(c));return e("span",{className:"plain",children:i})}var Pe=J(function(i){let{message:c}=i,p=c.authorKind??"external";if(p==="notice")return n("li",{className:"host-notice","data-mid":c.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(o,{name:"bell",size:14}),e(ee,{source:c.text}),e("time",{dateTime:c.at,children:Zt(c.at,i.timeZone)})]});let H=p==="member"&&c.principalId!==void 0&&c.principalId===i.me;return n("li",{className:"message","data-mid":c.id,"data-author":p,"data-mine":H||void 0,"data-header":i.header||void 0,"data-enter":i.enter||void 0,"data-unread":i.unread||void 0,"data-highlight":i.highlighted||void 0,children:[H?null:e("span",{className:"message-avatar",children:i.header?e(at,{picture:c.picture,name:c.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:c.author}),c.authorLabel?e("span",{className:"label-chip",children:c.authorLabel}):null,e("time",{dateTime:c.at,children:Zt(c.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[c.text?p==="assistant"?e(ee,{source:c.text}):e(Oe,{text:c.text}):null,e(Ct,{files:c.files}),c.expiredFiles?e("p",{className:"message-expired",children:te(c.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),c.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});var pt=1500,gt=96,me=new Set,ke=new Map;function ht(l){if(document.visibilityState!=="visible")return!1;return!l||l.scrollHeight-l.scrollTop-l.clientHeight<gt}function ze(l){if(!(l instanceof Element))return;let i=l.closest("[data-unread][data-mid]");return i?Number(i.dataset.mid):void 0}function De(l){let{room:i,scroller:c,messages:p,began:H,enterAfter:A,me:E,shared:b}=l,h=a({seen:void 0,watched:new Set}),[,C]=r(0),R=ke.get(i)??me;if(A!==void 0&&p){let T=h.current;T.seen??=A;let F=ht(c.current),U=T.seen;for(let L of p){if(L.id<=T.seen)continue;if(F)T.watched.add(L.id);U=Math.max(U,L.id)}T.seen=U}let I=M(()=>{if(H===void 0||A===void 0||!p)return me;let T=new Set;for(let F of p){if(F.id===0||F.id<=H)continue;if(F.kind==="system"||F.note)continue;if(F.authorKind==="notice")continue;if(F.principalId===void 0?F.kind==="owner"&&!b:F.principalId===E)continue;if(h.current.watched.has(F.id)||R.has(F.id))continue;T.add(F.id)}return T.size===0?me:T},[p,H,A,E,b,R]),V=X((T)=>{let F=ke.get(i)??me;if(F.has(T))return;ke.set(i,new Set(F).add(T)),C((U)=>U+1)},[i]),O=I.size>0;s(()=>{let T=c.current;if(!T||!O)return;let F=(L)=>{if(L.pointerType==="touch")return;let D=ze(L.target);if(D!==void 0)V(D)},U=(L)=>{let D=ze(L.target);if(D!==void 0)V(D)};return T.addEventListener("pointerover",F,{passive:!0}),T.addEventListener("focusin",U,{passive:!0}),T.addEventListener("click",U,{passive:!0}),()=>{T.removeEventListener("pointerover",F),T.removeEventListener("focusin",U),T.removeEventListener("click",U)}},[c,V,O]);let x=a(new Map),z=[...I].join(",");return s(()=>{let T=c.current,F=x.current;for(let[B,G]of F)if(!I.has(B))clearTimeout(G),F.delete(B);if(!T||!O||typeof IntersectionObserver!=="function"||!matchMedia("(pointer: coarse)").matches)return;let U=(B)=>{let G=F.get(B);if(G===void 0)return;clearTimeout(G),F.delete(B)},L=new IntersectionObserver((B)=>{for(let G of B){let j=Number(G.target.dataset.mid),ae=G.rootBounds;if(!(G.isIntersecting&&(G.intersectionRatio>=0.5||ae!==null&&G.intersectionRect.height>=ae.height*0.5))){U(j);continue}if(F.has(j))continue;F.set(j,setTimeout(()=>{if(F.delete(j),document.visibilityState==="visible")V(j)},pt))}},{root:T,threshold:[0,0.25,0.5,0.75,1]}),D=[...T.querySelectorAll("[data-unread][data-mid]")];for(let B of D)L.observe(B);let Q=()=>{if(document.visibilityState!=="visible")return;for(let B of D)L.unobserve(B),L.observe(B)};return document.addEventListener("visibilitychange",Q),()=>{document.removeEventListener("visibilitychange",Q),L.disconnect()}},[c,V,O,z]),s(()=>{let T=x.current;return()=>{for(let F of T.values())clearTimeout(F);T.clear()}},[]),I}st();var bt=3;function yt({marks:l}){let[i,c]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>c((p)=>!p),children:[l.slice(0,bt).map((p)=>e(at,{picture:{principal:p.principal},name:p.name,size:16},p.principal)),e("span",{children:t("Seen by {count}",{count:l.length})})]}),i?e("span",{className:"seen-names",children:l.map((p)=>p.name).join(t(", "))}):null]})}function vt(l,i){let c=Ee(),p=u((H)=>H.connects);s(()=>{let H=i.current;if(!H)return;let A=0,E=0,b,h,C=()=>{if(h=void 0,document.visibilityState!=="visible")return;let V=H.getBoundingClientRect(),O=0;for(let z of H.querySelectorAll("[data-mid]")){let T=z.getBoundingClientRect();if(T.bottom>V.top&&T.top<V.bottom-4)O=Math.max(O,Number(z.dataset.mid))}if(O<=A)return;let x=E+1000-Date.now();if(x>0){clearTimeout(b),b=setTimeout(R,x);return}if(c.send({type:"read",room:l,upTo:O}))A=O,E=Date.now()},R=()=>{if(h===void 0)h=requestAnimationFrame(C)};H.addEventListener("scroll",R,{passive:!0}),document.addEventListener("visibilitychange",R),window.addEventListener("resize",R);let I=new MutationObserver(R);return I.observe(H,{childList:!0,subtree:!0}),R(),()=>{if(H.removeEventListener("scroll",R),document.removeEventListener("visibilitychange",R),window.removeEventListener("resize",R),I.disconnect(),clearTimeout(b),h!==void 0)cancelAnimationFrame(h)}},[c,l,i,p])}function fe(l){let{roomKey:i}=l;vt(i,l.scroller);let c=u((R)=>R.principal?.id),p=u((R)=>R.rooms[i]?.messages),H=Ae((R)=>R.reads[i]??eo),A=Ae((R)=>R.cursor[i]),E=a(void 0);if(E.current===void 0&&A!==void 0)E.current=A;let b=u((R)=>R.rooms[i]?.view?.notes===!0),h=De({room:i,scroller:l.scroller,messages:p,began:E.current,enterAfter:l.enterAfter,me:c,shared:l.host===!0||b}),C=M(()=>{let I=(p??[]).filter((x)=>x.kind!=="system"),V=E.current===void 0?void 0:I.find((x)=>x.id>(E.current??0)&&(x.principalId===void 0||x.principalId!==c))?.id,O=new Map;for(let x of H){if(x.principal===c)continue;let z=I.findLast((T)=>T.id<=x.upTo);if(z)O.set(z.id,[...O.get(z.id)??[],x])}return{before:(x)=>x.id===V?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(x)=>{let z=O.get(x.id);return z?e(yt,{marks:z}):null},unread:(x)=>h.has(x.id),...l.host?{message:(x,z)=>x.kind==="system"&&x.authorKind===void 0?void 0:e(Pe,{message:x,header:z.header,enter:z.enter,unread:z.unread,timeZone:z.timeZone,me:c,highlighted:l.highlight===x.id})}:{}}},[p,H,c,l.host,l.highlight,h]);return e(bn,{roomKey:i,enterAfter:l.enterAfter,quotable:l.quotable,decor:C})}st();var wt=20,kt=2600,Ue;function Nt(l,i,c){let p=u((b)=>b.connects),H=Ae((b)=>b.rooms[l]??0),[A,E]=r({view:void 0,error:void 0,gone:!1});return s(()=>{let b=!0;return Be.open(i,c).then((h)=>{if(!b)return;y.dispatch({type:"history_loaded",room:l,messages:h.messages,more:h.more,older:!1}),nr(l,h.reads,h.cursor),no(l,h.cards),E({view:h,error:void 0,gone:!1})},(h)=>{if(!b)return;let C=h instanceof ce&&h.status===404;E((R)=>({view:C?void 0:R.view,error:d(h),gone:C}))}),()=>{b=!1}},[l,i,c,p,H]),A}function Ht(l){let{header:i}=l;return n(m,{children:[i.banner?e("p",{className:"host-banner","data-tone":i.banner.tone,role:"status",children:i.banner.text}):null,i.fields.length?e("dl",{className:"host-head-fields",children:i.fields.map((c)=>n("div",{children:[e("dt",{children:c.label}),e("dd",{children:c.link?e("a",{href:c.link,...c.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:c.value}):c.value})]},`${c.label}:${c.value}`))}):null,e(re,{className:"host-actions bar",actions:i.actions,run:l.run})]})}function At(l){let i=Ae((C)=>C.cards[l.room]??to),c=He("(min-width: 720px) and (min-height: 760px)"),[p,H]=r();if(i.length===0)return null;let A=i.filter((C)=>we(C)||C.state==="working"),E=i.filter((C)=>!A.includes(C)),b=p??(c&&A.length>0),h=A[0];return n("div",{className:"host-cards","data-open":b||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":b,onClick:()=>H(!b),children:[e(o,{name:"chevron",size:14}),h?n("span",{children:[e("strong",{children:te(A.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:E.length})})]}),b?n("div",{className:"host-cards-body",children:[A.map((C)=>e(ie,{card:C,run:l.run(C.id)},C.id)),E.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:E.length})}),E.map((C)=>e(ie,{card:C,run:l.run(C.id)},C.id))]}):null]}):null]})}function Et({roomKey:l}){let i=Ee(),c=To(l),p=c?.kind??"",H=c?.id??"",{view:A,error:E,gone:b}=Nt(l,p,H),h=u((S)=>S.rooms[l]),C=u((S)=>S.limits),R=u((S)=>S.connects),I=u((S)=>S.connection==="open"),V=a(null),O=a(null),{away:x,onScroll:z,onGrow:T,toEnd:F}=Pr(V),[U,L]=r(!1),[D,Q]=r(),[B,G]=r(Ue),[j,ae]=r(!1),[Re,Se]=r(),ge=a(void 0),oe=a(void 0),W=A!==void 0;if(s(()=>{if(!c||b||!W)return;return i.send({type:"subscribe",room:l}),i.focus(l),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:l})}},[i,l,R,b,W]),W&&ge.current===void 0)ge.current=h?.messages.at(-1)?.id??0;Qe(()=>{if(W)F(!1)},[W]),Qe(()=>{let S=V.current;if(S&&oe.current!==void 0)S.scrollTop+=S.scrollHeight-oe.current,oe.current=void 0},[h?.messages[0]?.id]),s(()=>{let S=O.current;if(!S||typeof ResizeObserver>"u")return;let q=new ResizeObserver(T);return q.observe(S),()=>q.disconnect()},[T]);let be=X(async()=>{let S=y.getState().rooms[l]?.messages[0];if(!S)return!1;let q=await Be.older(p,H,S.id,hi);return y.dispatch({type:"history_loaded",room:l,messages:q.messages,more:q.more,older:!0}),nr(l,q.reads,void 0),q.more},[l,p,H]),le=a(void 0);s(()=>{let S=()=>{let q=Number(Rn().get("message"));le.current=Number.isSafeInteger(q)&&q>0?q:void 0};return S(),window.addEventListener("popstate",S),()=>window.removeEventListener("popstate",S)},[]);let ye=h?.messages[0]?.id,Le=h?.more===!0;s(()=>{let S=le.current,q=V.current;if(!W||S===void 0||!q)return;let Z=q.querySelector(`[data-mid="${S}"]`);if(Z){le.current=void 0,Z.scrollIntoView({block:"center"}),Se(S),requestAnimationFrame(()=>q.dispatchEvent(new Event("scroll"))),setTimeout(()=>Se(void 0),kt);return}if(ye!==void 0&&S<ye&&Le){let se=0;(async()=>{if(se+=1,!await be().catch(()=>!1)||se>=wt)le.current=void 0})()}},[W,ye,Le,h?.messages.length,be]);let Ce=(S,q={},Z)=>Be.act(p,H,{action:S.id,...Z===void 0?{}:{card:Z},input:q}),We=(S,q)=>Ce(S,q),Ze=(S)=>(q,Z)=>Ce(q,Z,S);if(b||!W&&!E&&!c)return e("section",{className:"room",children:n("div",{className:"page",children:[e(_,{children:t("This room is not available.")}),e("a",{className:"back",href:v("rooms"),children:t("Back to rooms")})]})});let Y=A?.access.send??[],ve=Y.length>1,Te=ve&&j,Me=B&&Y.includes(B)?B:Y.includes("turn")?"turn":Y[0],Fe=Te||Me==="turn",Ye=Fe?A?.wording?.turn?.placeholder??t("Ask AI…"):A?.wording?.note?.placeholder??t("Write an internal note…"),de=A?.header.title??l,Xe=h?.messages??[];return n("section",{className:"room",onDragOver:(S)=>{if(Y.length&&S.dataTransfer.types.includes("Files"))S.preventDefault()},onDrop:(S)=>{if(!Y.length||!S.dataTransfer.files.length)return;S.preventDefault(),Q([...S.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:v("rooms"),"aria-label":t("Back to rooms"),children:e(o,{name:"back"})}),e(at,{name:de,size:40}),n("div",{className:"room-title",children:[e("h1",{children:de}),e("span",{className:"room-status","data-working":h?.typing||void 0,children:h?.typing?t("Working…"):t("Host room")})]})]}),!I?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,A?e(Ht,{header:A.header,run:We}):null,e("div",{className:"room-scroll",ref:V,onScroll:z,children:n("div",{className:"room-content",ref:O,children:[E?e(g,{message:E}):null,!W&&!E?e(w,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:U,onClick:async()=>{L(!0),oe.current=V.current?.scrollHeight;try{await be()}catch(S){oe.current=void 0,f(d(S),"danger")}finally{L(!1)}},children:U?t("Loading…"):t("Load earlier messages")}):null,W&&Xe.length===0?e(_,{children:t("No messages yet.")}):null,e(fe,{roomKey:l,enterAfter:ge.current,quotable:!1,scroller:V,host:!0,highlight:Re}),h?.typing?e(pn,{name:de,progress:h.progress}):null]})}),x?n("button",{type:"button",className:"to-end",onClick:()=>F(!0),children:[e(o,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,A?e(At,{room:l,run:Ze}):null,A&&Y.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,A&&Y.length>0?e(m,{children:e(hn,{draftKey:l,name:de,placeholder:Ye,onAddressed:ae,...ve?{above:e(ur,{on:Fe,label:A?.wording?.turn?.label??t("@AI"),...Te?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(S)=>{let q=S?"turn":"note";Ue=q,G(q)}})}:{},limits:C,stoppable:Boolean(h?.stoppable),onSend:(S,q,Z)=>{if(ve&&Z){let se=Vi(S);i.say(l,se===""&&q.length===0?S:se,q,"turn")}else i.say(l,S,q,Me);F(!0)},onStop:()=>i.send({type:"stop",room:l}),...D?{incoming:D,onIncomingTaken:()=>Q(void 0)}:{}},l)}):null]})}st();function pe({room:l}){let i=Ae((c)=>c.unread[l]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":te(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}st();var St=6,Lt=250;function Ne(l){let{kind:i}=l,{timeZone:c}=k(),{now:p}=ne(),H=u((L)=>L.connects),A=Ae((L)=>L.lists[i]??0),[E,b]=r(""),[h,C]=r(""),[R,I]=r(),[V,O]=r(),[x,z]=r(),[T,F]=r(!1);s(()=>{let L=setTimeout(()=>C(E.trim()),Lt);return()=>clearTimeout(L)},[E]),s(()=>{let L=!0;return Be.list(i,h||void 0).then((D)=>{if(!L)return;nn(Object.fromEntries(D.rooms.map((Q)=>[Q.key,Q.unread??0]))),I(D.rooms),O(D.cursor),z(void 0)},(D)=>L&&z(d(D))),()=>{L=!1}},[i,h,H,A]);let U=async()=>{if(!V||T)return;F(!0);try{let L=await Be.list(i,h||void 0,V);nn(Object.fromEntries(L.rooms.map((D)=>[D.key,D.unread??0]))),I((D)=>[...D??[],...L.rooms]),O(L.cursor)}catch(L){z(d(L))}finally{F(!1)}};return n("section",{className:"stack",children:[n("h2",{className:"section-title",children:[l.icon?e(o,{name:l.icon,size:14,className:"section-icon"}):null,l.label]}),R&&(R.length>=St||h||E)?e("input",{type:"search",className:"kind-filter",value:E,placeholder:t("Search {name}",{name:l.label}),"aria-label":t("Search {name}",{name:l.label}),onChange:(L)=>b(L.target.value)}):null,x?e(g,{message:x}):null,!R&&!x?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,R&&R.length===0?e(_,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,R&&R.length>0?e("ul",{className:"room-list",children:R.map((L)=>e("li",{children:n("a",{className:"room-row",href:v("room",L.key),"aria-current":L.key===l.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(at,{picture:L.picture,name:L.title,size:44}),L.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:L.title}),e(pe,{room:L.key}),e("span",{className:"room-row-time",children:L.lastAt?_e(L.lastAt,p,c):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:L.subtitle??""})})]}),e(o,{name:"chevron",size:16,className:"room-row-chevron"})]})},L.key))}):null,V?e("button",{type:"button",className:"secondary",disabled:T,onClick:U,children:T?t("Loading…"):t("Show more")}):null]})}function $e(l){return l.kinds.map((i)=>e(Ne,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:l.active},i.kind))}function Ge(){let l=(k().pages??[]).filter((i)=>i.place==="settings");if(l.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),l.map((i)=>n("a",{className:"menu-item menu-link",href:v("p",i.id),children:[e("span",{className:"menu-text",children:e("strong",{children:i.label})}),e(o,{name:"chevron",size:16})]},i.id))]})}export{$e as HostKinds,ct as HostPage,Et as HostRoomPage,Ge as HostSettingsPages,fe as ReadLog,pe as UnreadMark};
@@ -0,0 +1,2 @@
1
+ import{V}from"./chunk-index-2e4am3hw.js";var o=!1,{emit:e,use:i}=V(),si=()=>i(()=>o);function Or(t){if(o===t)return;o=t,e()}
2
+ export{si,Or};
@@ -0,0 +1,2 @@
1
+ function Mt(e,n){if(e.detail!==0&&(e.clientX!==0||e.clientY!==0))return{x:e.clientX,y:e.clientY};let t=n.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}var Ft={table:"Round table",seat:(e,n)=>`${e} (${n})`};
2
+ export{Mt,Ft};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-index-kankja6p.js";function Pn(e){if(e.builtin==="link")return t("Link your {name} account",{name:e.label});if(e.builtin==="push")return t("Turn on notifications");return e.label}function nn(e){if(e.help)return e.help;if(e.builtin==="link")return t("Prove which account is yours, so the app knows who you are there.");if(e.builtin==="push")return t("So that you hear when something needs you, even when the app is closed.");return""}
2
- export{Pn,nn};
1
+ import{t}from"./chunk-index-2e4am3hw.js";function En(e){if(e.builtin==="link")return t("Link your {name} account",{name:e.label});if(e.builtin==="push")return t("Turn on notifications");return e.label}function sn(e){if(e.help)return e.help;if(e.builtin==="link")return t("Prove which account is yours, so the app knows who you are there.");if(e.builtin==="push")return t("So that you hear when something needs you, even when the app is closed.");return""}
2
+ export{En,sn};
@@ -1,2 +1,2 @@
1
- import{h,s,a,fe,Ni,$n}from"./chunk-index-kankja6p.js";var D=6,P=()=>(h("0mefcvp3"),import("./chunk-drag-0mefcvp3.js"));var g=()=>{return},L=0;function lr(){if(L++===0)window.addEventListener("touchmove",g,{passive:!1});return()=>{if(--L===0)window.removeEventListener("touchmove",g)}}function qt(T,m){let d=a(m);d.current=m;let l=m!==void 0;s(()=>l?lr():void 0,[l]);let t=a(void 0),p=a(void 0),c=a(!1),v=(e,n,r)=>T(e).then((i)=>{if(i)fe({...i,at:n,via:r,source:e})},()=>{return}),E=(e,n,r,i)=>{let u=d.current,y=u?.item(e),M=u?.root(e);if(!u||!y||!M)return!1;return p.current??=P(),p.current.then(({lift:x})=>{if(t.current?.id!==n)return i();x({mode:u.mode,key:u.key,item:y,root:M,pointerId:n,y:r(),open:u.open,done:(f)=>{if(f.type==="tap")i();else if(f.type!=="cancel")u.onDrop(f)}})},i),!0},o=Ni((e)=>{let n=()=>v(e.source,e.at,e.via),r=t.current;if(!(e.via==="hold"||e.via==="contextmenu"&&r?.touch)||!r)return void n();if(!E(e.source,r.id,()=>r.y,n))return void n();if(e.via==="contextmenu")c.current=!0});return{...o,onPointerDown(e){if(c.current=!1,t.current={id:e.pointerId,x:e.clientX,y:e.clientY,touch:e.pointerType!=="mouse"},e.pointerType!=="mouse"&&$n(e.clientX,window.innerWidth))t.current=void 0;else if(d.current)p.current??=P();o.onPointerDown(e)},onPointerMove(e){let n=t.current;if(n?.id===e.pointerId){if(e.pointerType==="mouse"&&e.buttons===1&&!c.current&&d.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)>D)c.current=E(e.currentTarget,e.pointerId,()=>e.clientY,()=>{return});n.y=e.clientY}o.onPointerMove(e)},onPointerUp(e){if(t.current?.id===e.pointerId)t.current=void 0;o.onPointerUp(e)},onPointerCancel(e){if(t.current?.id===e.pointerId)t.current=void 0;o.onPointerCancel(e)},onContextMenu:o.onContextMenu,onKeyDown:o.onKeyDown,onClickCapture(e){if(c.current){c.current=!1,e.preventDefault(),e.stopPropagation();return}o.onClickCapture(e)},onDragStart(e){e.preventDefault()}}}
2
- export{lr,qt};
1
+ import{h,s,a,pe,qi,Xn}from"./chunk-index-2e4am3hw.js";var D=6,P=()=>(h("45e8222r"),import("./chunk-drag-45e8222r.js"));var g=()=>{return},L=0;function gr(){if(L++===0)window.addEventListener("touchmove",g,{passive:!1});return()=>{if(--L===0)window.removeEventListener("touchmove",g)}}function Bt(T,m){let d=a(m);d.current=m;let l=m!==void 0;s(()=>l?gr():void 0,[l]);let t=a(void 0),p=a(void 0),c=a(!1),v=(e,n,r)=>T(e).then((i)=>{if(i)pe({...i,at:n,via:r,source:e})},()=>{return}),E=(e,n,r,i)=>{let u=d.current,y=u?.item(e),M=u?.root(e);if(!u||!y||!M)return!1;return p.current??=P(),p.current.then(({lift:x})=>{if(t.current?.id!==n)return i();x({mode:u.mode,key:u.key,item:y,root:M,pointerId:n,y:r(),open:u.open,done:(f)=>{if(f.type==="tap")i();else if(f.type!=="cancel")u.onDrop(f)}})},i),!0},o=qi((e)=>{let n=()=>v(e.source,e.at,e.via),r=t.current;if(!(e.via==="hold"||e.via==="contextmenu"&&r?.touch)||!r)return void n();if(!E(e.source,r.id,()=>r.y,n))return void n();if(e.via==="contextmenu")c.current=!0});return{...o,onPointerDown(e){if(c.current=!1,t.current={id:e.pointerId,x:e.clientX,y:e.clientY,touch:e.pointerType!=="mouse"},e.pointerType!=="mouse"&&Xn(e.clientX,window.innerWidth))t.current=void 0;else if(d.current)p.current??=P();o.onPointerDown(e)},onPointerMove(e){let n=t.current;if(n?.id===e.pointerId){if(e.pointerType==="mouse"&&e.buttons===1&&!c.current&&d.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)>D)c.current=E(e.currentTarget,e.pointerId,()=>e.clientY,()=>{return});n.y=e.clientY}o.onPointerMove(e)},onPointerUp(e){if(t.current?.id===e.pointerId)t.current=void 0;o.onPointerUp(e)},onPointerCancel(e){if(t.current?.id===e.pointerId)t.current=void 0;o.onPointerCancel(e)},onContextMenu:o.onContextMenu,onKeyDown:o.onKeyDown,onClickCapture(e){if(c.current){c.current=!1,e.preventDefault(),e.stopPropagation();return}o.onClickCapture(e)},onDragStart(e){e.preventDefault()}}}
2
+ export{gr,Bt};
@@ -0,0 +1,2 @@
1
+ import{t,c,v,p}from"./chunk-index-2e4am3hw.js";import{cr}from"./chunk-index-2t30xwed.js";var n=encodeURIComponent,a=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.")]),Ni=(e)=>a.has(e)?t(e):e;function To(e){let s=e.indexOf(":"),o=e.lastIndexOf(".");if(s<0||o<s+2||o===e.length-1)return;return{kind:e.slice(s+1,o),id:e.slice(o+1)}}var Be={list:(e,s,o)=>{let i=new URLSearchParams;if(s)i.set("filter",s);if(o)i.set("cursor",o);let r=i.toString();return p(`host/${n(e)}${r?`?${r}`:""}`)},open:(e,s)=>p(`host/${n(e)}/${n(s)}`),older:(e,s,o,i)=>p(`host/${n(e)}/${n(s)}/messages?before=${o}&limit=${i}`),act:(e,s,o)=>p(`host/${n(e)}/${n(s)}/act`,{method:"POST",body:JSON.stringify(o)}),page:(e,s)=>{let o=new URLSearchParams(s).toString();return p(`pages/${n(e)}${o?`?${o}`:""}`)},pageAct:(e,s)=>p(`pages/${n(e)}/act`,{method:"POST",body:JSON.stringify(s)})};function g(e){if("room"in e){let o=e.message===void 0?"":`?message=${e.message}`;return`${v("room",e.room)}${o}`}let s=new URLSearchParams(e.query??{}).toString();return`${v("p",e.page)}${s?`?${s}`:""}`}function Li(e){cr(new URL(g(e),document.baseURI))}
2
+ export{Ni,To,Be,Li};