pi-roundtable-web 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/chunk-account-83crfbn4.js +1 -0
- package/dist/{chunk-action-menu-zh2n0ahf.js → chunk-action-menu-qw7h03x0.js} +1 -1
- package/dist/{chunk-agent-ynm2tcbx.js → chunk-agent-t1632ktv.js} +1 -1
- package/dist/{chunk-arranged-rooms-qnz8vese.js → chunk-arranged-rooms-sb6tbsxw.js} +1 -1
- package/dist/{chunk-bulk-actions-pr0mw0kc.js → chunk-bulk-actions-v1g2bzk7.js} +1 -1
- package/dist/{chunk-character-creator-caj4pmg4.js → chunk-character-creator-ye69w0kx.js} +1 -1
- package/dist/{chunk-codeeditor-dga6s78p.js → chunk-codeeditor-5j6abj8k.js} +1 -1
- package/dist/chunk-confirm-x8w877bz.js +1 -0
- package/dist/{chunk-connectors-j79ze3j1.js → chunk-connectors-t7qbc6nk.js} +1 -1
- package/dist/{chunk-conversations-2farn72g.js → chunk-conversations-kmt6qzym.js} +1 -1
- package/dist/{chunk-council-sheet-s9sz1bzf.js → chunk-council-sheet-bxvn7vza.js} +1 -1
- package/dist/{chunk-drag-45e8222r.js → chunk-drag-03zgvd66.js} +1 -1
- package/dist/{chunk-entry-q11n47h9.js → chunk-entry-y5vwp5e5.js} +1 -1
- package/dist/{chunk-folder-list-4gcj7g7h.js → chunk-folder-list-h3vnjzpb.js} +1 -1
- package/dist/{chunk-folds-ten4ykfw.js → chunk-folds-a3e22m7x.js} +1 -1
- package/dist/{chunk-gate-kcv1a4t0.js → chunk-gate-qzephvdv.js} +1 -1
- package/dist/chunk-group-scene-w1ycabrm.js +1 -0
- package/dist/{chunk-group-table-t458kdgn.js → chunk-group-table-9nvmja8w.js} +1 -1
- package/dist/chunk-host-icons-fccg3b2d.js +1 -0
- package/dist/chunk-host-picture-jaqz127q.js +1 -0
- package/dist/{chunk-host-state-7mdve7cb.js → chunk-host-state-r01v1ywg.js} +1 -1
- package/dist/{chunk-host-ui-bdgwa6sf.js → chunk-host-ui-n54mh5af.js} +1 -1
- package/dist/{chunk-index-ffbrm6tr.js → chunk-index-0ye10vk3.js} +1 -1
- package/dist/{chunk-index-b8cpvr7y.js → chunk-index-1kwp3spy.js} +1 -1
- package/dist/{chunk-index-kbrg32sx.js → chunk-index-3pnvpppa.js} +1 -1
- package/dist/{chunk-index-f6q0stqx.js → chunk-index-47vq85ye.js} +1 -1
- package/dist/{chunk-index-2t30xwed.js → chunk-index-4z4chg7v.js} +1 -1
- package/dist/{chunk-index-cdctnw71.js → chunk-index-5zmswz4s.js} +1 -1
- package/dist/{chunk-index-6bkcq9ka.js → chunk-index-6vcs0h0m.js} +1 -1
- package/dist/{chunk-index-j4kk1m59.js → chunk-index-6xqz6mg2.js} +1 -1
- package/dist/{chunk-index-02vfshtt.js → chunk-index-83v0c9x6.js} +1 -1
- package/dist/{chunk-index-aamhjg5n.js → chunk-index-8xd6anam.js} +1 -1
- package/dist/{chunk-index-31x6krbs.js → chunk-index-983dmeaa.js} +1 -1
- package/dist/{chunk-index-xxeb2xp0.js → chunk-index-9z13jw6q.js} +2 -2
- package/dist/{chunk-index-q7g62sgm.js → chunk-index-af4ebmkr.js} +1 -1
- package/dist/{chunk-index-8d81qy69.js → chunk-index-afrhnrxj.js} +1 -1
- package/dist/{chunk-index-zyvwhxga.js → chunk-index-ben4gv45.js} +1 -1
- package/dist/{chunk-index-t998yg8y.js → chunk-index-c44p8q87.js} +1 -1
- package/dist/{chunk-index-92zgb7my.js → chunk-index-db8zh8e6.js} +1 -1
- package/dist/{chunk-index-dnjftvtq.js → chunk-index-dvfkb699.js} +1 -1
- package/dist/{chunk-index-g3wrs02w.js → chunk-index-e02ddp46.js} +1 -1
- package/dist/{chunk-index-pefwfm26.js → chunk-index-em7vndrb.js} +1 -1
- package/dist/{chunk-index-tk4se135.js → chunk-index-eq161yvp.js} +1 -1
- package/dist/{chunk-index-xq84gg8w.js → chunk-index-f500nw4w.js} +1 -1
- package/dist/{chunk-index-12zyshae.js → chunk-index-f5x2srr0.js} +1 -1
- package/dist/{chunk-index-2e4am3hw.js → chunk-index-fg42egv9.js} +4 -4
- package/dist/{chunk-index-msqhgvfx.js → chunk-index-h3v1d3nt.js} +1 -1
- package/dist/{chunk-index-2fdns8tn.js → chunk-index-j7pgphx3.js} +1 -1
- package/dist/{chunk-index-ac1ktr56.js → chunk-index-k0z507h3.js} +1 -1
- package/dist/chunk-index-kbgykazq.js +2 -0
- package/dist/{chunk-index-0w4bfjb5.js → chunk-index-n05yw5wd.js} +1 -1
- package/dist/{chunk-index-18pgxxw3.js → chunk-index-n8ghdvxb.js} +1 -1
- package/dist/{chunk-index-rh0x9rzf.js → chunk-index-nsvwbjfe.js} +1 -1
- package/dist/{chunk-index-jgzygbt8.js → chunk-index-p5jcwjx8.js} +1 -1
- package/dist/{chunk-index-kb3w11mn.js → chunk-index-rcwdqn50.js} +2 -2
- package/dist/chunk-index-s72hmse6.js +2 -0
- package/dist/{chunk-index-5bfqek1d.js → chunk-index-xevnf9ew.js} +1 -1
- package/dist/{chunk-index-pyfx77cj.js → chunk-index-xx8jq73q.js} +1 -1
- package/dist/{chunk-index-e2dqjde8.js → chunk-index-y60x5jbh.js} +1 -1
- package/dist/{chunk-index-dj0tbfyb.js → chunk-index-ypkgw7gq.js} +1 -1
- package/dist/{chunk-index-g1awv7rk.js → chunk-index-yrmqcay4.js} +1 -1
- package/dist/chunk-layout-actions-8dzvysym.js +1 -0
- package/dist/{chunk-menu-items-bza16bw6.js → chunk-menu-items-3jhya205.js} +1 -1
- package/dist/chunk-mode-toggle-js49gvpd.js +1 -0
- package/dist/{chunk-note-row-6fmhrdng.js → chunk-note-row-kv061030.js} +2 -2
- package/dist/{chunk-notes-wv0e6ssf.js → chunk-notes-sdkqz5hr.js} +1 -1
- package/dist/{chunk-notice-bell-9z27epd2.js → chunk-notice-bell-r012f2zy.js} +1 -1
- package/dist/{chunk-notices-fte9f196.js → chunk-notices-h4rk1zxc.js} +1 -1
- package/dist/{chunk-onboarding-c5twahc3.js → chunk-onboarding-a18cvkph.js} +1 -1
- package/dist/{chunk-overview-k4ccprax.js → chunk-overview-ynaqn4fp.js} +1 -1
- package/dist/{chunk-palette-9rbp2fab.js → chunk-palette-jm79gb5q.js} +1 -1
- package/dist/chunk-placement-items-mwm9q1zn.js +1 -0
- package/dist/{chunk-profile-s7r7fcvz.js → chunk-profile-ajw6pp4r.js} +1 -1
- package/dist/{chunk-prompt-history-hf296e7v.js → chunk-prompt-history-zcfvr3r8.js} +1 -1
- package/dist/{chunk-prompts-c8s0nhkm.js → chunk-prompts-m5rzdk24.js} +1 -1
- package/dist/chunk-room-confirms-ftsj15ja.js +1 -0
- package/dist/{chunk-room-menu-7h4jym2b.js → chunk-room-menu-b9ktw9pw.js} +1 -1
- package/dist/{chunk-rooms-menu-button-pgtaanb6.js → chunk-rooms-menu-button-qe62t6nx.js} +1 -1
- package/dist/{chunk-schedules-mbnwcxpc.js → chunk-schedules-t8yxnf8q.js} +1 -1
- package/dist/{chunk-seat-menu-r0k0eawr.js → chunk-seat-menu-kwtjnpjj.js} +1 -1
- package/dist/{chunk-sheet-hosts-a5dfevy9.js → chunk-sheet-hosts-yj5wszgj.js} +1 -1
- package/dist/{chunk-shortcut-help-a6pkjcq7.js → chunk-shortcut-help-g5cpqjjj.js} +1 -1
- package/dist/{chunk-shortcuts-cgt87jkz.js → chunk-shortcuts-9ft5sqdw.js} +1 -1
- package/dist/{chunk-skill-editor-67yk4x7t.js → chunk-skill-editor-xdfq2708.js} +1 -1
- package/dist/{chunk-skills-rewemey4.js → chunk-skills-9wa4mwdc.js} +1 -1
- package/dist/{chunk-switcher-list-t8rbay2y.js → chunk-switcher-list-vpg6wvtw.js} +1 -1
- package/dist/{chunk-tab-dot-vr11dfrw.js → chunk-tab-dot-yse6wcfp.js} +1 -1
- package/dist/{chunk-table-52nh0azk.js → chunk-table-1y76m54h.js} +1 -1
- package/dist/{chunk-table3d-rp0w6kt4.js → chunk-table3d-cv6069hy.js} +1 -1
- package/dist/chunk-thread-actions-xjhpdjk7.js +1 -0
- package/dist/{chunk-thread-cards-c2mrp2gj.js → chunk-thread-cards-36rckyg7.js} +1 -1
- package/dist/{chunk-thread-list-0071q455.js → chunk-thread-list-fd6agz77.js} +2 -2
- package/dist/{chunk-transcript-789yqysq.js → chunk-transcript-5nfn3r35.js} +1 -1
- package/dist/chunk-where-ha8pc3cg.js +1 -0
- package/dist/{chunk-workspace-wr1qrtsh.js → chunk-workspace-e85twv32.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-account-1ecx5kt7.js +0 -1
- package/dist/chunk-confirm-g76v5d9r.js +0 -1
- package/dist/chunk-group-scene-12ghcvzd.js +0 -1
- package/dist/chunk-host-icons-h1k9k96a.js +0 -1
- package/dist/chunk-host-picture-3p0wzn3v.js +0 -1
- package/dist/chunk-index-j0m16cj1.js +0 -2
- package/dist/chunk-index-v6smgw77.js +0 -2
- package/dist/chunk-layout-actions-y73mpsh1.js +0 -1
- package/dist/chunk-mode-toggle-nj9gnt3b.js +0 -1
- package/dist/chunk-placement-items-me598wsb.js +0 -1
- package/dist/chunk-room-confirms-ga2sbvhc.js +0 -1
- package/dist/chunk-thread-actions-qcxt1y1g.js +0 -1
- package/dist/chunk-where-hmwmme9e.js +0 -1
|
@@ -1 +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};
|
|
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-fg42egv9.js";import{Rn}from"./chunk-index-4z4chg7v.js";import{Ni,To,Be,Li}from"./chunk-index-n8ghdvxb.js";import{K}from"./chunk-index-p5jcwjx8.js";import{Ae,eo,to,nn,nr,no}from"./chunk-index-3pnvpppa.js";import{st,at}from"./chunk-index-af4ebmkr.js";import{ur}from"./chunk-index-0ye10vk3.js";import"./chunk-index-ben4gv45.js";import{qe}from"./chunk-index-983dmeaa.js";import{he}from"./chunk-index-s72hmse6.js";import"./chunk-index-afrhnrxj.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n}from"./chunk-index-
|
|
1
|
+
import{e,n}from"./chunk-index-fg42egv9.js";var r=!1;function a(){if(r||typeof document>"u")return;if(r=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let o=new CSSStyleSheet;o.replaceSync(`
|
|
2
2
|
/* One choice of how to write, in the composer's column over the bar, wherever the pane is wide. */
|
|
3
3
|
.mode-toggle {
|
|
4
4
|
display: inline-flex;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h,t}from"./chunk-index-
|
|
1
|
+
import{h,t}from"./chunk-index-fg42egv9.js";import{Jr}from"./chunk-index-3pnvpppa.js";import{_i,ys,bs}from"./chunk-index-nsvwbjfe.js";function Wr(e){let n=Jr();if(!e)return n;let r=new Set([...e,...ys(e)]);return Object.fromEntries(Object.entries(n).filter(([s])=>r.has(s)))}var i=()=>(h("v1g2bzk7"),import("./chunk-bulk-actions-v1g2bzk7.js"));function ki(e){let n=[];if(Object.keys(Wr(e)).length>0)n.push({id:"read-all",label:t("Mark all as read"),icon:"check",run:()=>{i().then((r)=>r.markAllRead(e))}});if(_i(e).size>0)n.push({id:"clear-finished",label:t("Clear all finished threads"),icon:"trash",tone:"danger",run:()=>{i().then((r)=>r.clearAllFinished(e))}});return n.push(...Yr(e)),n}function Yr(e){if(bs(e).size===0)return[];return[{id:"clear-helpers",label:t("Clear finished temp knights"),icon:"trash",tone:"danger",run:()=>{i().then((n)=>n.clearFinishedHelpers(e))}}]}
|
|
2
2
|
export{Wr,ki,Yr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y,V}from"./chunk-index-
|
|
1
|
+
import{y,V}from"./chunk-index-fg42egv9.js";var t={unread:{},reads:{},cursor:{},cards:{},rooms:{},lists:{},pages:{}},{emit:R,use:b,subscribe:Hr}=V();function s(e){t={...t,...e},R()}var Ae=(e)=>b(()=>e(t)),jr=(e)=>t.unread[e]??0,Kr=()=>Object.values(t.unread).reduce((e,r)=>e+r,0);function Jr(){return Object.fromEntries(Object.entries(t.unread).filter(([,e])=>e>0))}var d=[],eo=d,to=d;function l(e,r){return e.kind!=="system"&&e.id!==0&&(e.principalId===void 0||e.principalId!==r)}var f=(e)=>y.getState().focus===e&&document.visibilityState==="visible";function nn(e){let r={...t.unread};for(let[o,n]of Object.entries(e))r[o]=n;s({unread:r})}var p=new WeakSet;function g(){let e;for(let[r,o]of Object.entries(y.getState().rooms)){let n=o.view;if(!n||p.has(n))continue;p.add(n),e??={...t.unread},e[r]=n.unread??0}if(e)s({unread:e})}y.subscribe(g);g();function nr(e,r,o){let n={};if(r)n.reads={...t.reads,[e]:r};if(o!==void 0&&o>(t.cursor[e]??0))n.cursor={...t.cursor,[e]:o};if(n.reads||n.cursor)s(n)}function no(e,r){s({cards:{...t.cards,[e]:r}})}var i=(e,r)=>({...e,[r]:(e[r]??0)+1});function zs(e){switch(e.type){case"message":case"host_message":{let r=y.getState().principal?.id;if(!l(e.message,r)||f(e.room))return;s({unread:{...t.unread,[e.room]:(t.unread[e.room]??0)+1}});return}case"read":{let{room:r,principal:o,upTo:n}=e;if(o===y.getState().principal?.id){let a=(y.getState().rooms[r]?.messages??[]).filter((u)=>u.id>n&&l(u,o)).length;s({unread:{...t.unread,[r]:a},cursor:{...t.cursor,[r]:Math.max(n,t.cursor[r]??0)}});return}let m=(t.reads[r]??d).filter((a)=>a.principal!==o),c=t.reads[r]?.find((a)=>a.principal===o);if(c&&c.upTo>=n)return;s({reads:{...t.reads,[r]:[...m,{principal:o,name:e.name,upTo:n,at:e.at}]}});return}case"host_card":{let r=(t.cards[e.room]??d).filter((o)=>o.id!==e.card.id);s({cards:{...t.cards,[e.room]:[...r,e.card].sort((o,n)=>o.at<n.at?-1:o.at>n.at?1:0)}});return}case"room_changed":s({rooms:i(t.rooms,e.room)});return;case"list_changed":s({lists:i(t.lists,e.kind)});return;case"page_changed":s({pages:i(t.pages,e.page)});return;default:return}}
|
|
2
2
|
export{Hr,Ae,jr,Kr,Jr,eo,to,nn,nr,no,zs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h,t,y}from"./chunk-index-
|
|
1
|
+
import{h,t,y}from"./chunk-index-fg42egv9.js";import{Ce}from"./chunk-index-6xqz6mg2.js";import{ki}from"./chunk-index-1kwp3spy.js";import{_n}from"./chunk-index-kbgykazq.js";import{je}from"./chunk-index-x4enmj72.js";import{Nt,Ti}from"./chunk-index-yrmqcay4.js";var s=(e)=>e(),m=()=>(h("8dzvysym"),import("./chunk-layout-actions-8dzvysym.js"));function Br(e,l=s){let o=Nt(_n(),e),d=o.kind==="pinned",i=[{id:"pin",label:d?t("Unpin"):t("Pin"),icon:"pin",run:()=>{m().then((r)=>r.pinRoom(e,!d))}},{id:"move",label:t("Move to folder…"),icon:"folder",run:()=>l(()=>Ce({kind:"move",room:e}))}];if(o.kind==="rest")return i;if(je(o.siblings,e,"up"))i.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((r)=>r.nudgeRoom(e,"up"))}});if(je(o.siblings,e,"down"))i.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((r)=>r.nudgeRoom(e,"down"))}});return i}function Xs(e){let l=y.getState(),o=l.folders.find((n)=>n.id===e);if(!o)return;let d=_n().folders.find((n)=>n.id===e)?.rooms??[],i=Ti(d,(n)=>l.rooms[n]?.view?.muted===!0)==="all",r=l.folders.map((n)=>n.id),u=[{id:"rename",label:t("Rename"),icon:"edit",run:()=>Ce({kind:"rename",id:e,name:o.name})}];if(d.length>0)u.push({id:"mute",label:i?t("Unmute the whole folder"):t("Mute the whole folder"),icon:i?"bell":"bell-off",run:()=>{m().then((n)=>n.muteFolder(e,!i))}});if(u.push(...ki(d)),je(r,e,"up"))u.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((n)=>n.nudgeFolder(e,"up"))}});if(je(r,e,"down"))u.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((n)=>n.nudgeFolder(e,"down"))}});return u.push({id:"delete",label:t("Delete folder"),icon:"trash",tone:"danger",run:()=>Ce({kind:"delete",id:e,name:o.name})}),{title:o.name,items:u}}
|
|
2
2
|
export{Br,Xs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{wr}from"./chunk-index-
|
|
1
|
+
import{wr}from"./chunk-index-fg42egv9.js";function Rn(){if(wr()!==void 0)return new URLSearchParams(window.location.search);let n=window.location.hash,t=n.indexOf("?");return new URLSearchParams(t<0?"":n.slice(t+1))}function cr(n){if(n.origin!==window.location.origin)return!1;let t=wr();if(t){if(n.pathname!==t&&!n.pathname.startsWith(`${t}/`))return!1;return window.history.pushState(null,"",n),window.dispatchEvent(new PopStateEvent("popstate")),!0}if(n.pathname!==window.location.pathname)return!1;return window.location.hash=n.hash,!0}
|
|
2
2
|
export{Rn,cr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y,p,O}from"./chunk-index-
|
|
1
|
+
import{y,p,O}from"./chunk-index-fg42egv9.js";var r=(e,o,i)=>p(e,{method:o,...i===void 0?{}:{body:JSON.stringify(i)}}),t=(e)=>encodeURIComponent(e),ee={createAgent:(e)=>r("agents","POST",e),archiveAgent:(e)=>r(`agents/${t(e)}/archive`,"POST"),restoreAgent:(e)=>r(`agents/${t(e)}/restore`,"POST"),deleteAgent:(e)=>r(`agents/${t(e)}`,"DELETE"),skills:(e)=>p(`agents/${t(e)}/skills`),setSkills:(e,o)=>r(`agents/${t(e)}/skills`,"PUT",o),archive:()=>p("archive"),createGroup:(e)=>r("groups","POST",e),group:(e)=>p(`groups/${t(e)}`),updateGroup:(e,o)=>r(`groups/${t(e)}`,"PATCH",o),archiveGroup:(e)=>r(`groups/${t(e)}/archive`,"POST"),restoreGroup:(e)=>r(`groups/${t(e)}/restore`,"POST"),deleteGroup:(e)=>r(`groups/${t(e)}`,"DELETE")};async function Te(){let e=await O.rooms();y.dispatch({type:"rooms_loaded",rooms:e.rooms})}
|
|
2
2
|
export{ee,Te};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,te,y,p,O,d,f}from"./chunk-index-
|
|
1
|
+
import{t,te,y,p,O,d,f}from"./chunk-index-fg42egv9.js";import{_i}from"./chunk-index-nsvwbjfe.js";var Sn={dismissAllFinished:(e)=>p("rooms/dismiss-finished-threads",{method:"POST",body:JSON.stringify({rooms:e})}),archiveFinishedHelpers:(e)=>p("rooms/archive-finished-helpers",{method:"POST",body:JSON.stringify(e?{rooms:e}:{})}),restoreHelpers:(e)=>p("rooms/restore-helpers",{method:"POST",body:JSON.stringify({names:e})}),readAll:(e)=>p("rooms/read-all",{method:"POST",body:JSON.stringify({rooms:e})}),unreadAll:(e)=>p("rooms/read-all",{method:"POST",body:JSON.stringify({restore:e})})};var a=()=>y.dispatch({type:"changed"});async function h(e){try{await e()}catch(s){f(d(s),"danger")}a()}async function u(e,s,r,n){try{await s()}catch(i){return f(d(i),"danger"),a(),!1}return y.dispatch({type:"threads_dismissed",rooms:[...e]}),f(r,"info",{label:t("Undo"),run:()=>void h(n)}),!0}function Nr(e){let s=y.getState().rooms[e]?.view?.displayName??e;return u([e],()=>O.dismissThread(e),t("Cleared “{name}”",{name:s}),()=>O.undismissThread(e))}function A(e,s){return u(s,()=>e?O.dismissThreads(e):Promise.all(s.map((r)=>O.dismissThread(r))),te(s.length,"Cleared {count} finished thread","Cleared {count} finished threads"),()=>e?O.undismissThreads(e,s):Promise.all(s.map((r)=>O.undismissThread(r))))}var T=(e)=>Promise.all(Object.entries(e).flatMap(([s,r])=>Array.from({length:Math.ceil(r.length/o)},(n,i)=>O.undismissThreads(s,r.slice(i*o,(i+1)*o))))),o=100,c=500;async function P(e){let s={},r=0;try{for(let i=0;i<e.length;i+=c){let l=await Sn.dismissAllFinished(e.slice(i,i+c));r+=l.dismissed;for(let[m,g]of Object.entries(l.threads))s[m]=[...s[m]??[],...g]}}catch(i){f(d(i),"danger")}let n=Object.values(s).flat();if(n.length===0)return a(),r>0;return y.dispatch({type:"threads_dismissed",rooms:n}),f(te(n.length,"Cleared {count} finished thread","Cleared {count} finished threads"),"info",{label:t("Undo"),run:()=>void h(()=>T(s))}),!0}async function Lr(e){let s=_i(e);if(s.size===0)return;await P([...s.keys()])}async function Xr(e,s){if(s.length===0)return;await A(e,s)}
|
|
2
2
|
export{Sn,Nr,Lr,Xr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V}from"./chunk-index-
|
|
1
|
+
import{V}from"./chunk-index-fg42egv9.js";var e,{emit:o,use:n}=V();function Ce(i){e=i,o()}function Si(){if(!e)return;e=void 0,o()}var as=()=>n(()=>e);
|
|
2
2
|
export{Ce,Si,as};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V}from"./chunk-index-
|
|
1
|
+
import{V}from"./chunk-index-fg42egv9.js";var o=!1,{emit:e,use:i}=V(),si=()=>i(()=>o);function Or(t){if(o===t)return;o=t,e()}
|
|
2
2
|
export{si,Or};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,a,r,t,m,e,n,o,ui,D,ke,u,O,f,gn,Do,Uo}from"./chunk-index-
|
|
1
|
+
import{s,a,r,t,m,e,n,o,ui,D,ke,u,O,f,gn,Do,Uo}from"./chunk-index-fg42egv9.js";import{K}from"./chunk-index-p5jcwjx8.js";import{Ce,Si,as}from"./chunk-index-6xqz6mg2.js";import{jt,er,zr,Ir,Dr}from"./chunk-index-xx8jq73q.js";import{he}from"./chunk-index-s72hmse6.js";import{ee,Te}from"./chunk-index-5zmswz4s.js";import{vs,je,ro}from"./chunk-index-x4enmj72.js";import{ot,Nt}from"./chunk-index-yrmqcay4.js";function A(i){let{room:d}=i,l=u((c)=>{let k=ot(c,(h)=>ke(c,h)),v=Nt(k,d),y=v.kind==="rest"?[]:v.siblings;return{name:c.rooms[d]?.view?.displayName??d,folder:v.kind==="folder"?v.folder:"",pinned:v.kind==="pinned",canUp:je(y,d,"up")!==void 0,canDown:je(y,d,"down")!==void 0}},d),p=u((c)=>c.folders),g=(c)=>{i.onClose(),jt(d,c)},C=l.folder===""&&!l.pinned;return n("div",{className:"stack",children:[e("p",{className:"meta",children:l.name}),n("fieldset",{children:[e("legend",{className:"visually-hidden",children:t("Move to folder…")}),n("ul",{className:"menu",children:[e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:C,onChange:()=>g(null)}),e("span",{className:"menu-icon",children:e(o,{name:"rooms",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Ungrouped")})})]})}),p.map((c)=>e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:l.folder===c.id,onChange:()=>g(c.id)}),e("span",{className:"menu-icon",children:e(o,{name:"folder",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:c.name})})]})},c.id)),e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>Ce({kind:"new",room:d}),children:[e("span",{className:"menu-icon",children:e(o,{name:"plus",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("New folder…")})})]})})]})]}),l.canUp||l.canDown?n("ul",{className:"menu",children:[l.canUp?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),er(d,"up")},children:[e("span",{className:"menu-icon",children:e(o,{name:"up",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move up")})})]})}):null,l.canDown?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),er(d,"down")},children:[e("span",{className:"menu-icon",children:e(o,{name:"down",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move down")})})]})}):null]}):null]})}function F(i){return e(he,{open:i.open,title:t("Move to folder…"),onClose:i.onClose,children:e(A,{room:i.room,onClose:i.onClose})})}function x(i){let{ask:d}=i,[l,p]=r(d.kind==="rename"?d.name:""),[g,C]=r(),[c,k]=r(!1),v=a(null);return s(()=>v.current?.focus(),[]),n("form",{className:"stack",onSubmit:async(h)=>{h.preventDefault();let b;try{b=ro(l)}catch{C(t("Give the folder a name of 1 to 40 characters."));return}k(!0),C(void 0);let w;if(d.kind==="rename")w=await Ir(d.id,b,C)!==void 0;else{let N=await zr(b,C);if(w=N!==void 0,N&&d.room)await jt(d.room,N)}if(k(!1),w)i.onClose()},children:[n("div",{className:"field",children:[e("label",{className:"field-label",htmlFor:"folder-name",children:t("Folder name")}),e("input",{id:"folder-name",type:"text",ref:v,value:l,autoComplete:"off",enterKeyHint:"done",maxLength:vs*2,"aria-invalid":g?!0:void 0,onChange:(h)=>p(h.target.value)}),g?e("p",{className:"field-error",role:"alert",children:g}):null]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:c,onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:c,children:d.kind==="rename"?t("Rename"):t("Create")})]})]})}function R(){let i=as(),d=a(void 0);if(i)d.current=i;let l=d.current;if(!l)return null;let p=l.kind==="new"||l.kind==="rename";return n(m,{children:[p?e(he,{open:i?.kind==="new"||i?.kind==="rename",title:l.kind==="rename"?t("Rename folder"):t("Add a folder"),onClose:Si,children:e(x,{ask:l,onClose:Si})}):null,l.kind==="delete"?e(K,{open:i?.kind==="delete",title:t("Delete folder"),confirmLabel:t("Delete folder"),tone:"danger",onClose:Si,onConfirm:async()=>{let g="";if(!await Dr(l.id,(c)=>{g=c}))throw Error(g)},children:e("p",{children:t("Delete the folder {name}? Its rooms move to Ungrouped; no room is deleted.",{name:l.name})})}):null,l.kind==="move"?e(F,{open:i?.kind==="move",room:l.room,onClose:Si}):null]})}function E(i){return n(K,{open:i.open,title:t("Turn on yolo mode?"),confirmLabel:t("Turn on yolo mode"),tone:"yolo",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await O.setMode(i.room,{yolo:!0})},children:[e("p",{children:t("In this room, the knight's held actions are approved for you, without a card, as soon as they come up.")}),e("p",{children:t("Risky classes still ask: running as another user, deleting files, force pushes, disk, service and firewall changes, and anything that names its own approvers. The host can add more.")}),e("p",{children:t("Every approval it makes is written into the conversation, and a banner stays up while yolo mode is on.")})]})}function M(i){return e(K,{open:i.open,title:t("Start over {name}?",{name:i.name}),confirmLabel:t("Start over"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await O.startRoomOver(i.room)},children:e("p",{children:t("The current conversation is archived and the next message begins a new one. Long-term memory is kept. A turn that is running finishes first.")})})}function S(i){return e(K,{open:i.open,title:t("Archive {name}?",{name:i.name}),confirmLabel:t("Archive"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{let d=i.room.indexOf("."),l=i.room.slice(d+1);if(i.room.slice(0,d).endsWith(":group"))await ee.archiveGroup(l);else await ee.archiveAgent(l);if(gn(),await Te(),f(t("Archived {name}.",{name:i.name})),ui().key===i.room)D("rooms")},children:e("p",{children:t("{name} stops answering and its schedules are cancelled. A group loses it as a member. The history is kept, and Archived in the room list restores it.",{name:i.name})})})}function lr(){return n(m,{children:[e(L,{}),e(R,{})]})}function L(){let i=Uo(),d=a(void 0);if(i)d.current=i;let l=d.current;if(!l)return null;let p={room:l.room,name:l.name,restoreFocus:l.restoreFocus,onClose:Do};return n(m,{children:[e(E,{open:i?.kind==="yolo",...p}),e(M,{open:i?.kind==="start-over",...p}),e(S,{open:i?.kind==="archive",...p})]})}
|
|
2
2
|
export{lr};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n,o}from"./chunk-index-
|
|
1
|
+
import{e,n,o}from"./chunk-index-fg42egv9.js";var l=new WeakMap;function on(s,i){if(typeof document>"u")return;let t=l.get(document)??new Set;if(t.has(s))return;if(l.set(document,t.add(s)),typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let c=new CSSStyleSheet;c.replaceSync(i),document.adoptedStyleSheets=[...document.adoptedStyleSheets,c];return}catch{}let r=document.createElement("style");r.textContent=i,document.head.append(r)}var a=`
|
|
2
2
|
/* A drop-down: the inputs' box with the one chevron of the icon set, turned to point down. */
|
|
3
3
|
.select {
|
|
4
4
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h}from"./chunk-index-
|
|
1
|
+
import{h}from"./chunk-index-fg42egv9.js";var r=!1;function ri(){if(r||typeof document>"u")return;if(r=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let e=new CSSStyleSheet;e.replaceSync(`
|
|
2
2
|
.folder-body[hidden] {
|
|
3
3
|
display: none;
|
|
4
4
|
}
|
|
@@ -422,5 +422,5 @@ import{h}from"./chunk-index-2e4am3hw.js";var r=!1;function ri(){if(r||typeof doc
|
|
|
422
422
|
transition: none;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
`,document.head.append(t)}var a=()=>(h("
|
|
425
|
+
`,document.head.append(t)}var a=()=>(h("8dzvysym"),import("./chunk-layout-actions-8dzvysym.js")),oi=(t)=>({mode:"room",key:t,item:(e)=>e.closest("[data-drop-item]"),root:(e)=>e.closest("[data-drop-root]"),onDrop:(e)=>{if(e.type==="room")a().then((o)=>o.dropRoom(t,e.drop))},open:(e)=>void (h("a3e22m7x"),import("./chunk-folds-a3e22m7x.js")).then((o)=>o.expandFolder(e))});
|
|
426
426
|
export{ri,oi};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,e}from"./chunk-index-
|
|
1
|
+
import{r,e}from"./chunk-index-fg42egv9.js";var d=!1;function st(){if(d||typeof document>"u")return;if(d=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let t=new CSSStyleSheet;t.replaceSync(`
|
|
2
2
|
.hpic {
|
|
3
3
|
flex: none;
|
|
4
4
|
display: inline-grid;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{X,s,a,t,e,n,o,Le}from"./chunk-index-
|
|
1
|
+
import{X,s,a,t,e,n,o,Le}from"./chunk-index-fg42egv9.js";var C=96,S=0.6,T=220,N=()=>typeof matchMedia==="function"&&matchMedia("(max-width: 719px)").matches;function L(i){let u=a(null),g=a(void 0),{open:h,onClose:P}=i,E=a(i.restoreFocus);E.current=i.restoreFocus;let m=a(!1),p=a(!1),M=X(()=>{let r=u.current;if(r?.open)r.close();if(E.current?.()?.focus(),m.current=!1,p.current)p.current=!1;else P()},[P]),d=X(()=>{let r=u.current;if(!r||m.current)return;if(m.current=!0,Le()){M();return}r.dataset.state="closing",r.style.removeProperty("transform"),setTimeout(M,T)},[M]);s(()=>{let r=u.current;if(!r)return;if(h&&!r.open)r.dataset.state="opening",r.showModal(),requestAnimationFrame(()=>requestAnimationFrame(()=>{r.dataset.state="open"}));if(!h&&r.open&&!m.current)p.current=!0,d()},[h,d]);let b=(r)=>{if(!N())return;if(r.target instanceof Element&&r.target.closest("button, a"))return;g.current={y:r.clientY,at:r.timeStamp,dy:0},r.currentTarget.setPointerCapture(r.pointerId);let c=u.current;if(c)c.dataset.dragging="true"},v=(r)=>{let c=g.current,l=u.current;if(!c||!l)return;let f=Math.max(0,r.clientY-c.y);c.dy=f,l.style.transform=`translate3d(0, ${f}px, 0)`,l.style.setProperty("--sheet-progress",String(1-Math.min(1,f/400)))},y=(r)=>{let c=g.current,l=u.current;if(g.current=void 0,!c||!l)return;delete l.dataset.dragging;let f=c.dy/Math.max(1,r.timeStamp-c.at);if(c.dy>C||f>S){d();return}l.style.removeProperty("transform"),l.style.removeProperty("--sheet-progress")};return n("dialog",{ref:u,className:i.variant==="palette"?"sheet palette":i.size==="wide"?"sheet wide":i.size==="full"?"sheet full":"sheet","aria-label":i.title,onCancel:(r)=>{if(r.target!==r.currentTarget)return;r.preventDefault(),d()},onClick:(r)=>{if(r.target===r.currentTarget)d()},onClose:(r)=>{if(r.target!==r.currentTarget)return;if(!m.current)P()},children:[e("div",{className:"sheet-grab",onPointerDown:b,onPointerMove:v,onPointerUp:y,onPointerCancel:y,children:e("span",{className:"sheet-handle"})}),i.variant==="palette"?null:n("div",{className:"sheet-head",onPointerDown:b,onPointerMove:v,onPointerUp:y,onPointerCancel:y,children:[e("h2",{title:i.title,children:i.title}),e("button",{type:"button",className:"icon-button","aria-label":t("Close"),onClick:d,children:e(o,{name:"close"})})]}),e("div",{className:"sheet-body",children:h?i.children:null})]})}
|
|
2
2
|
export{L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ci}from"./chunk-index-
|
|
1
|
+
import{ci}from"./chunk-index-fg42egv9.js";var M={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.7A8 8 0 1 1 21 12Z",link:"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3A4 4 0 0 0 11 18.7l1-1",activity:"M3 12h4l3-8 4 16 3-8h4",users:"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7ZM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6.5 6.5 0 0 1 3.5 6",megaphone:"M4 10v4h3l8 4V6L7 10H4ZM18 9a4 4 0 0 1 0 6M7 14l1 6h3l-1-5",qr:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h2v2h-2zM18 14h2v2M14 18h2M18 18h2v2h-2z"};ci(M);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,Qe,li,a,r,t,m,e,n,o,Le,u,k,tt,hn,pn,ue,Ct,We,Ye,Fi,Gi,Zi,bn,Ee}from"./chunk-index-
|
|
1
|
+
import{s,Qe,li,a,r,t,m,e,n,o,Le,u,k,tt,hn,pn,ue,Ct,We,Ye,Fi,Gi,Zi,bn,Ee}from"./chunk-index-fg42egv9.js";import{ko,Ai,_o,Vt}from"./chunk-index-rcwdqn50.js";import{L}from"./chunk-index-afrhnrxj.js";function A(i,l,f,p){if(!i)return;let d=i.pending.at(-1);if(d&&!d.failed)return{id:`p${d.id}`,who:"owner",author:l,text:d.text,files:[],live:!1,pending:!0};if(i.typing&&i.progress.text!==""){let c=i.agent??p;return{id:`s${i.messages.at(-1)?.id??0}`,who:"agent",agent:c,author:f(c),text:i.progress.text,files:[],live:!0,pending:!1}}let g=i.live.at(-1);if(g)return{id:`l${g.live??g.id}`,who:"agent",agent:g.agent,author:g.author,text:g.text,files:g.files,live:!0,pending:!1};for(let c=i.messages.length-1;c>=0;c-=1){let b=i.messages[c];if(!b||b.kind==="system")continue;return{id:`m${b.id}`,who:b.kind==="owner"?"owner":"agent",agent:b.agent,author:b.author,text:b.text,files:b.files,live:!1,pending:!1}}return}function P(i,l,f){return i.cardOrder.map((d)=>({id:d,card:i.cards[d]})).filter((d)=>d.card?.room===l).filter((d)=>d.card.outcome===void 0||f===void 0||d.card.after>=f)}var Q=90;function U(i,l,f,p={}){if(p.instant)return l;let d=i+f/1000*(p.cps??Q);return Math.min(l,Math.max(i,d))}function B(){let i,l="",f=0,p=0;return{get shown(){return Math.floor(p)},get done(){return Math.floor(p)>=f},feed(d,g){if(d!==i){let c=l!==""&&(g.startsWith(l)||l.startsWith(g));if(i=d,!c)p=0}if(l=g,f=Array.from(g).length,p>f)p=f},step(d,g){p=U(p,f,d,{instant:g})},finish(){p=f}}}var q=(i,l)=>Array.from(i).slice(0,l).join("");function D(i,l){if(!i||i.who!=="agent"||i.agent===void 0)return null;return l.includes(i.agent)?i.agent:null}function I(i,l,f){return f&&f.lineId===l?f.member:i}var X=24;function G(i,l,f){let p=a(!0);s(()=>{let d=i.current;if(!d)return;let g=()=>{p.current=d.scrollHeight-d.scrollTop-d.clientHeight<=X};return d.addEventListener("scroll",g,{passive:!0}),()=>d.removeEventListener("scroll",g)},[i]),Qe(()=>{let d=i.current;if(!l){p.current=!0;return}if(d&&p.current)d.scrollTop=d.scrollHeight},[i,l,f])}function ee(i){let l=a(B()),[,f]=li((c)=>c+1,0),p=Le();l.current.feed(i?.id??"",i?.text??"");let d=i?.text??"",g=i?.id;return s(()=>{let c=l.current;if(p||d===""||g===void 0){c.finish(),f();return}let b=performance.now(),v=0,x=()=>{let w=performance.now();if(c.step(w-b,!1),b=w,f(),!c.done)v=requestAnimationFrame(x)};if(!c.done)v=requestAnimationFrame(x);return()=>cancelAnimationFrame(v)},[p,g,d]),{shown:l.current.shown,done:l.current.done,finish(){l.current.finish(),f()}}}function O(i){let l=u((b)=>b.rooms[i]),f=u((b)=>b.principal?.name)??t("You"),p=u((b)=>{let v={};for(let x of Object.values(b.rooms))if(x.view?.kind==="agent")v[x.view.name]=x.view.displayName;return v}),d=l?.view,c=A(l,f,(b)=>(b===void 0?void 0:p[b])??b??d?.displayName??i,d?.kind==="agent"?d.name:void 0);return{room:l,view:d,line:c}}function ne(i){let{loaded:l,error:f}=i,p=u((b)=>b.rooms[i.roomKey]),[d,g]=r(!1),c=a(null);return s(()=>{if(i.open&&l)c.current?.scrollTo({top:c.current.scrollHeight})},[i.open,l]),e(L,{open:i.open,title:`${i.name} · ${t("Log")}`,onClose:i.onClose,children:n("div",{className:"scene-log",ref:c,children:[f?e("p",{className:"failure-text",children:f}):null,p?.more?e("button",{type:"button",className:"secondary older",disabled:d,onClick:async()=>{g(!0),await Zi(i.roomKey),g(!1)},children:d?t("Loading…"):t("Load earlier messages")}):null,e(bn,{roomKey:i.roomKey,enterAfter:void 0,quotable:!0})]})})}function V(i){let{roomKey:l}=i,f=Ee(),p=k(),d=Gi(l),g=i.streams!==!1;s(()=>{if(!g)return;return f.focus(l),()=>f.focus(void 0)},[f,l,g]);let c=u((y)=>y.limits),b=u((y)=>P(y,l,y.rooms[l]?.messages.at(-1)?.id)),v=Ye(),{room:x,view:w,line:h}=O(l),S=w?.kind==="agent"?w:void 0,R=S?S.name:h?.who==="agent"?h.agent:void 0,z=We(R?v[R]:void 0),C=S?S.displayName:h?h.author:w?.displayName??l,{shown:H,done:M,finish:E}=ee(h),F=a(null);G(F,!M,H);let[W,T]=r(!1),[N,Y]=r(!1),Z=h?.who==="owner"&&!S?{["--agent-accent"]:"var(--accent)"}:z,_=Boolean(x?.typing)&&(!h||h.who==="owner"),J=h?q(h.text,H):"";return n("section",{className:"scene-box","data-open":i.open||void 0,"data-collapsed":N||void 0,"data-who":h?.who,style:Z,"aria-label":t("Log"),children:[n("header",{className:"scene-tab",children:[S||h?.who==="agent"?e("span",{className:"scene-chip",children:e(ue,{spec:R?v[R]:void 0,name:R??C,size:34,live:!1})}):null,e("strong",{className:"scene-name",children:C}),n("span",{className:"scene-tools",children:[i.onBack?e("button",{type:"button",className:"icon-button","aria-label":t("Back to the whole table"),onClick:i.onBack,children:e(o,{name:"back"})}):null,i.onMenu?e("button",{type:"button",className:"icon-button scene-more","aria-label":t("More"),"aria-haspopup":"menu",onClick:(y)=>i.onMenu?.(y.currentTarget),children:e(o,{name:"more"})}):null,n("button",{type:"button",className:"icon-button scene-log-button","aria-label":t("Log"),"aria-haspopup":"dialog",onClick:()=>T(!0),children:[e(o,{name:"conversations"}),e("span",{children:t("Log")})]}),e("button",{type:"button",className:"icon-button scene-collapse","aria-label":N?t("Show the message box"):t("Hide the message box"),title:N?t("Show the message box"):t("Hide the message box"),"aria-expanded":!N,onClick:()=>Y((y)=>!y),children:e(o,{name:"chevron",style:{rotate:N?"-90deg":"90deg"}})})]})]}),i.strip,n("div",{className:"scene-body",ref:F,children:[e("div",{className:"scene-line","data-live":h?.live||void 0,"aria-live":"polite",...M?{}:{role:"button",tabIndex:0,title:t("Tap to show the whole message"),onClick:E,onKeyDown:(y)=>{if(y.key==="Enter"||y.key===" ")y.preventDefault(),E()}},children:h?n(m,{children:[S&&h.who==="owner"?e("span",{className:"scene-from",children:h.author}):null,e(tt,{source:J}),M?e(Ct,{files:h.files}):null]}):null}),_&&x?e(pn,{name:C,progress:x.progress}):null,b.map(({id:y,card:K})=>e("div",{className:"scene-card",children:e(Fi,{card:K,timeZone:p.timeZone})},y))]}),w?.readOnly?null:e("div",{className:"scene-composer",children:e(hn,{draftKey:l,name:w?.displayName??l,limits:c,stoppable:Boolean(x?.stoppable),...w?.kind==="group"?{stopLabel:t("Stop the round")}:{},onSend:(y,K)=>f.say(l,y,K),onStop:()=>f.send({type:"stop",room:l})},l)}),e(ne,{roomKey:l,open:W,loaded:d.loaded,error:d.error,name:w?.displayName??l,onClose:()=>T(!1)})]})}function te(i){if(i.ended==="limit")return t("Limit reached");if(i.ended==="stopped")return t("Round stopped");if(i.ended==="done")return t("{count} of {limit} replies",{count:i.replies,limit:i.limit});return t("Reply {n} of {limit}",{n:i.n,limit:i.limit})}function j(i){let l=u((c)=>c.rooms[i.roomKey]?.round),f=u((c)=>{let b={};for(let v of Object.values(c.rooms))if(v.view?.kind==="agent")b[v.view.name]=v.view.displayName;return b}),p=Ye();if(!l)return null;let d=ko(l),g=(c)=>f[c]??c;return n("div",{className:"order-strip","data-state":l.state,children:[e("ol",{className:"order-faces","aria-label":t("Speaking order"),children:d.map((c,b)=>n("li",{className:"order-face","data-place":c.place,title:g(c.name),children:[e(ue,{spec:p[c.name],name:c.name,size:c.place==="current"?36:26,live:!1}),e("span",{className:"order-badge","aria-hidden":"true",children:c.place==="spoken"?"✓":c.place==="next"?c.order:null}),e("span",{className:"visually-hidden",children:`${g(c.name)}, ${c.place==="spoken"?t("has spoken"):c.place==="current"?t("speaking"):t("next")}`})]},`${c.name}:${b}`))}),e("span",{className:"order-chip","aria-live":"polite",children:te({...l,n:_o(l)})}),l.state==="running"&&(l.queued??0)>0?e("span",{className:"order-queued",children:t("Your message waits for the next round")}):null]})}function Ei(i,l){let{line:f}=O(i),p=u((w)=>Ai(w.rooms[i]?.round)),[d,g]=r(),c=`${f?.id??""}|${p??""}`,b=p!==void 0&&l.includes(p)?p:D(f,l);return{focus:I(b,c,d),look:(w)=>g({lineId:c,member:w})}}function Ci(i){let{roomKey:l,members:f}=i;return n("div",{className:"table-frame room-scene","data-focused":"",children:[e(Vt,{members:f,groupRoom:l,variant:"full",focus:i.focus,onFocus:i.onLook,onSeat:i.onLook,...i.onHandle?{onHandle:i.onHandle}:{},...i.onSeatMenu?{onSeatMenu:i.onSeatMenu}:{}}),e(V,{roomKey:l,open:!0,streams:i.streams??!1,strip:e(j,{roomKey:l})})]})}function As(i){let{focus:l,look:f}=Ei(i.roomKey,i.members);return e(Ci,{roomKey:i.roomKey,members:i.members,focus:l,onLook:f})}
|
|
2
2
|
export{Ei,Ci,As};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y,O,d,f}from"./chunk-index-
|
|
1
|
+
import{y,O,d,f}from"./chunk-index-fg42egv9.js";async function Jt(e,r){try{let t=await O.setMute(e,r);return y.dispatch({type:"room_muted",room:e,muted:t.muted}),!0}catch(t){return f(d(t),"danger"),!1}}
|
|
2
2
|
export{Jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fe,u}from"./chunk-index-
|
|
1
|
+
import{Fe,u}from"./chunk-index-fg42egv9.js";import{wn}from"./chunk-index-64rsz6pf.js";var Kt=wn,Dn=2,l="rt-table-council",i,s=!1,f=new Set;function c(){try{return globalThis.localStorage?.getItem(l)??void 0}catch{return}}function g(){if(!s)i=c(),s=!0;return i}function qr(n){i=n,s=!0;try{globalThis.localStorage?.setItem(l,n)}catch{}for(let e of f)e()}var a=(n)=>(f.add(n),()=>f.delete(n)),es=()=>Fe(a,g,()=>{return});function xi(){return u((n)=>n.order.map((e)=>n.rooms[e]?.view).filter((e)=>e!==void 0&&e.kind==="group"),"councils")}function ts(n,e,r){let t=(o)=>o===void 0?void 0:n.find((d)=>d.key===o||d.name===o);return t(r)??t(e)??n[0]}function ns(n){return[...n].filter((e)=>e.muted!==!0&&!e.helper).sort((e,r)=>Number(r.home)-Number(e.home)).slice(0,Kt).map((e)=>e.name)}function is(n,e,r=Kt){if(n.includes(e))return n.filter((t)=>t!==e);return n.length>=r?[...n]:[...n,e]}function rs(n,e){return n.filter(e).slice(0,Kt)}function os(n,e,r){if(e!==void 0&&n.includes(e))return e;if(r!==void 0&&n.includes(r))return r;return n[0]??""}function ss(n,e){let r=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,28)||"council";if(!e.has(r))return r;for(let t=2;;t+=1){let o=`${r}-${t}`;if(!e.has(o))return o}}
|
|
2
2
|
export{Kt,Dn,qr,es,xi,ts,ns,is,rs,os,ss};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V}from"./chunk-index-
|
|
1
|
+
import{V}from"./chunk-index-fg42egv9.js";var a="roundtable-console:folders-collapsed";function i(){try{let e=localStorage.getItem(a),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=V(),n=()=>(l??=i(),l);function s(e){l=e;try{localStorage.setItem(a,JSON.stringify([...e]))}catch{}d()}var dr=()=>c(n),fr=()=>n();function hr(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function pr(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function mr(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{dr,fr,hr,pr,mr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,pe,Zo,yi}from"./chunk-index-
|
|
1
|
+
import{t,pe,Zo,yi}from"./chunk-index-fg42egv9.js";import{Ce}from"./chunk-index-6xqz6mg2.js";import{ki}from"./chunk-index-1kwp3spy.js";function Jn(e){let r=e.getBoundingClientRect(),o=Zo();pe({title:t("Rooms"),items:[...ki(),{id:"new-folder",label:t("Add a folder"),icon:"plus",run:()=>Ce({kind:"new"})},{id:"arrange",label:o?t("Done"):t("Arrange"),icon:o?"check":"list",run:()=>yi(!o)}],at:{x:r.left,y:r.bottom},via:"key",source:e})}
|
|
2
2
|
export{Jn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M,t,e,n,p}from"./chunk-index-
|
|
1
|
+
import{M,t,e,n,p}from"./chunk-index-fg42egv9.js";var u=(i,s,r)=>p(i,{method:s,...r===void 0?{}:{body:JSON.stringify(r)}}),g=(i)=>encodeURIComponent(i),Ne={agentPromptHistory:(i)=>p(`agents/${g(i)}/prompt-history`),prompts:()=>p("prompts"),prompt:(i)=>p(`prompts/${g(i)}`),savePrompt:(i,s)=>u(`prompts/${g(i)}`,"PUT",s),revertPrompt:(i,s)=>u(`prompts/${g(i)}/revert`,"POST",s),promptHistory:(i)=>p(`prompts/${g(i)}/history`),skillDocument:(i)=>p(`skill-docs/${g(i)}`),saveSkillDocument:(i,s)=>u(`skill-docs/${g(i)}`,"PUT",s),createSkillDocument:(i)=>u("skill-docs","POST",i),skillHistory:(i)=>p(`skill-docs/${g(i)}/history`)};function h(i,s){let r=i.split(`
|
|
2
2
|
`),m=s.split(`
|
|
3
3
|
`),o=0;while(o<r.length&&o<m.length&&r[o]===m[o])o++;let d=0;while(d<r.length-o&&d<m.length-o&&r[r.length-1-d]===m[m.length-1-d])d++;let k=r.slice(o,r.length-d),f=m.slice(o,m.length-d),a=r.slice(0,o).map((l)=>({kind:"same",text:l}));return a.push(...v(k,f)),a.push(...r.slice(r.length-d).map((l)=>({kind:"same",text:l}))),a}function v(i,s){let r=(l)=>l.map((c)=>({kind:"del",text:c})),m=(l)=>l.map((c)=>({kind:"add",text:c}));if(i.length===0)return m(s);if(s.length===0)return r(i);if(i.length*s.length>4000000)return[...r(i),...m(s)];let o=s.length+1,d=new Uint32Array((i.length+1)*o);for(let l=i.length-1;l>=0;l--)for(let c=s.length-1;c>=0;c--)d[l*o+c]=i[l]===s[c]?(d[(l+1)*o+c+1]??0)+1:Math.max(d[(l+1)*o+c]??0,d[l*o+c+1]??0);let k=[],f=0,a=0;while(f<i.length&&a<s.length)if(i[f]===s[a])k.push({kind:"same",text:i[f]}),f++,a++;else if((d[(f+1)*o+a]??0)>=(d[f*o+a+1]??0))k.push({kind:"del",text:i[f]}),f++;else k.push({kind:"add",text:s[a]}),a++;return k.push(...r(i.slice(f)),...m(s.slice(a))),k}function D(i){return{added:i.filter((s)=>s.kind==="add").length,removed:i.filter((s)=>s.kind==="del").length}}var y={same:" ",add:"+",del:"−"};function w({lines:i}){return e("pre",{className:"diff",children:i.map((s,r)=>n("span",{className:"diff-line","data-kind":s.kind,children:[e("span",{className:"diff-mark","aria-hidden":"true",children:y[s.kind]}),s.kind==="add"||s.kind==="del"?n("span",{className:"visually-hidden",children:[s.kind==="add"?t("Added"):t("Removed"),":"," "]}):null,s.text||" "]},r))})}function mt(i){let s=M(()=>h(i.before,i.after),[i.before,i.after]),r=D(s);return n("div",{className:"field",children:[n("span",{className:"field-label",children:[i.label," ·"," ",t("Lines: {added} added, {removed} removed",{added:r.added,removed:r.removed})]}),e(w,{lines:s})]})}
|
|
4
4
|
export{Ne,mt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,n}from"./chunk-index-
|
|
1
|
+
import{e,n}from"./chunk-index-fg42egv9.js";function Ut(l){return n("fieldset",{className:"field",children:[e("legend",{children:l.label}),e("div",{className:"option-chips",children:l.options.map((a)=>e("button",{type:"button","aria-pressed":a.value===l.value,className:"option-chip",onClick:()=>l.onChange(a.value),children:a.label},a.value))})]})}
|
|
2
2
|
export{Ut};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h,s,a,pe,qi,Xn}from"./chunk-index-
|
|
1
|
+
import{h,s,a,pe,qi,Xn}from"./chunk-index-fg42egv9.js";var D=6,P=()=>(h("03zgvd66"),import("./chunk-drag-03zgvd66.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
2
|
export{gr,Bt};
|