@bigmistqke/whiteboard 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +13 -7
  2. package/dist/bin/whiteboard.js +0 -0
  3. package/dist/client/runtime.js +235 -58
  4. package/dist/plugins/badge/README.md +3 -1
  5. package/dist/plugins/badge/public/style.css +17 -0
  6. package/dist/plugins/chat/public/client.js +2 -2
  7. package/dist/plugins/chat/public/style.css +9 -0
  8. package/dist/plugins/comments/public/client.js +7 -2
  9. package/dist/plugins/comments/public/style.css +4 -0
  10. package/dist/plugins/grid/public/style.css +0 -5
  11. package/dist/plugins/index.js +5 -1
  12. package/dist/plugins/timeline/README.md +40 -0
  13. package/dist/plugins/timeline/index.js +82 -0
  14. package/dist/plugins/timeline/public/style.css +118 -0
  15. package/dist/plugins/toc/README.md +13 -13
  16. package/dist/plugins/toc/index.js +5 -3
  17. package/dist/plugins/toc/public/client.js +1 -1
  18. package/dist/plugins/toc/public/style.css +19 -2
  19. package/dist/solid/index.js +2 -1
  20. package/dist/src/auth.js +7 -3
  21. package/dist/src/client/page/base.css +74 -35
  22. package/dist/src/client/page/main.js +15 -4
  23. package/dist/src/entries.js +9 -3
  24. package/dist/src/events.js +4 -2
  25. package/dist/src/hub.js +43 -18
  26. package/dist/src/serve.js +2 -0
  27. package/dist/src/server.js +49 -11
  28. package/dist/src/ws.js +128 -0
  29. package/package.json +1 -1
  30. package/plugins/badge/README.md +3 -1
  31. package/plugins/badge/public/style.css +17 -0
  32. package/plugins/chat/client.tsx +34 -6
  33. package/plugins/chat/public/style.css +9 -0
  34. package/plugins/comments/client.ts +48 -5
  35. package/plugins/comments/public/style.css +4 -0
  36. package/plugins/grid/public/style.css +0 -5
  37. package/plugins/index.ts +6 -1
  38. package/plugins/timeline/README.md +40 -0
  39. package/plugins/timeline/index.ts +92 -0
  40. package/plugins/timeline/public/style.css +118 -0
  41. package/plugins/toc/README.md +13 -13
  42. package/plugins/toc/client.ts +49 -30
  43. package/plugins/toc/index.ts +12 -12
  44. package/plugins/toc/public/style.css +19 -2
  45. package/skills/whiteboard/SKILL.md +1 -2
  46. package/solid/index.tsx +3 -0
  47. package/src/auth.ts +7 -2
  48. package/src/client/forms.ts +102 -5
  49. package/src/client/page/base.css +74 -35
  50. package/src/client/page/elsewhere.ts +12 -3
  51. package/src/client/page/waiting.ts +10 -5
  52. package/src/client/read.ts +16 -3
  53. package/src/client/runtime.ts +134 -45
  54. package/src/client/toast.ts +35 -5
  55. package/src/define.ts +10 -0
  56. package/src/entries.ts +14 -3
  57. package/src/events.ts +7 -1
  58. package/src/hub.ts +54 -22
  59. package/src/serve.ts +2 -0
  60. package/src/server.ts +73 -17
  61. package/src/ws.ts +155 -0
@@ -1,3 +1,3 @@
1
- var e=class extends Error{constructor(e){let t=Error,n=t.stackTraceLimit;n!==void 0&&(t.stackTraceLimit=0),super(),n!==void 0&&(t.stackTraceLimit=n),this.source=e}},t=class extends Error{constructor(e,t){try{var n=String(t instanceof Error?t.message:t)}catch{}super(n,{cause:t}),this.source=e}};function n(e){return e instanceof t?e.cause:e}var r=class extends Error{constructor(){super(``)}},i=class extends Error{constructor(){super(``)}};const a=4096,o=1<<22,s=1<<21,c=16384,l=1<<23,u={},d={},f=Symbol(`refresh`),p=Set;function m(e){let t=e.pe;for(;t;)t.R|=32,m(t),t=t.Ge}function h(e){e.l&=-33,ht(e)}let g;function _(e){try{e()}catch(e){g||=[e],M()}}function v(e){let t=g;if(g=void 0,t&&!e)throw t[0]}function y(e,t=!1,n){let r=e.R;if(r&64)return;t&&(n||e.T===null||e.T.me===null&&e.T.Le===null||y(e,!1,!0),e.R=r|64,e.X&&(xt(e),(e.m&1&&e.T?.Re!=null||r&2048||F.length)&&M()));let i=n?e.T.me:e.pe;for(n?e.T.me=null:e.pe=null;i;){let e=i;e.l&=-33,R(e,A),ft(e),i.Me=i,y(i,!0),i=i.Ge}if(n||(e.be=0),t&&!n&&!(r&32)&&e._parent!==null&&!(e._parent.R&64)){let t=e.Me,n=e.Ge;t===null?e._parent.pe=n:t.Ge=n,n!==null&&(n.Me=t),e.Me=null}if(ee(e,n),t&&e.ze){let t=e.ze;e.ze=void 0,_(t)}}function b(e,t){let n=e.pe;t.Me=null,t.Ge=n,n!==null&&(n.Me=t),e.pe=t}function ee(e,t){let n=t?e.T.Le:e.ke;if(n){if(t?e.T.Le=null:e.ke=null,Array.isArray(n))for(let e=n.length-1;e>=0;e--)_(n[e]);else _(n)}}function te(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return ie(n.id,t?n.be++:n.be);throw Error()}function ne(e){return te(e,!0)}function re(e,t,n){return e?.id??(t?n?.id:n?.id==null?void 0:ne(n))}function ie(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):``)+n}function x(){return H}function ae(e,t=H){return t&&(t.ke?Array.isArray(t.ke)?t.ke.push(e):t.ke=[t.ke,e]:t.ke=e),e}function oe(e=!0){y(this,e),g&&!I.Y&&v()}function se(e){let t=H,n=e?.transparent??!1,r={id:re(e,n,t),l:n?4:0,R:0,Qe:!0,Ke:t?.Qe?t.Ke:t,pe:null,Ge:null,Me:null,ke:null,A:t?.A||d,be:0,T:null,_parent:t,dispose:oe};return t&&b(t,r),r}function ce(e,t){let n=se(t);return q(n,()=>e(oe.bind(n,!0)))}let le=null,S=null,ue=null,de=null,fe=null;function pe(e,t,n,r,i){le=e,S=t,ue=n,de=r,fe=i}const C=[];function me(e,t=null){let n={ln:[],rn:[[],[]],fn:[],eo:null,_parent:t,P:e,Pe:null,tt:0,nt:!1,nn:null,Ue:!1,un:!1,I:null};return e||C.push(n),n}let w=null;function he(e){w=e}let T=null,E=null;function ge(e,t){if(I.Y&&!t||T!==null)return k(e);E===null?E=O(e):ve(O(e),E),M()}function D(e){return e.T.Re=O(e.T.Re)}function _e(e){return e=O(e),C.indexOf(e)===-1?null:e}function O(e){for(;e.eo!==null;)e=e.eo;return e}function k(e){let t=T;t===null?T=e===null?me(!1):O(e):e!==null&&ve(O(e),t),I.Y||M()}function ve(e,t){e=O(e),t=O(t),e===t||e.P||t.P||(e.eo=t,t.tt+=e.tt,t.nt||=e.nt,P(t.ln,e.ln),P(t.rn[0],e.rn[0]),P(t.rn[1],e.rn[1]),P(t.fn,e.fn),e.I!==null&&P(t.I??=[],e.I),C.splice(C.indexOf(e),1))}function ye(e){let t=be;be??=e;let n=e.tt!==0||Se(e.ln,e)||!1;return be=t,n}let be=null;function xe(e,t){let n=e.T?.se;if(n===void 0)return!0;for(let e of n){let n=e.T?.Re;if(n==null||O(n)===t)return!0}return!1}function Se(e,t,n=!1){for(let r=0;r<e.length;r++){let i=e[r];if(!(!(i.m&1)||i.R&64||i.l&8192||i.T.Re!==null&&D(i)!==t||n&&!xe(i,t))){if(i.i===1){if(Ce(i,be??t))return!0}else for(let e=i.o;e!==null;e=e.t){let n=e.u;if((n.i===1&&n.m&1||n.R&2048||n.l&16384&&n.m===1)&&(e.Ne===n.de||n.T?.U!=null)&&!(n.R&64)&&Ce(n,be??t))return!0}}}return!1}function Ce(e,t){return!(e.R&32&&we(e,t))&&!ue?.(e)}function we(e,t){let n=e;for(;n?.R&32;)n=n._parent;return n?.l&256&&n.T?.Re!=null&&D(n)===O(t)}const Te=[];function Ee(e){Te.push(e)}const De=[];function Oe(e){R(e,A),e.R&=-4,De.push(e)}function ke(e,t){e.l|=256,Ae(e,t)}function Ae(e,t){let n=G(e);n.Re!==t&&(n.Re=t,t.ln.push(e))}function je(e,t){for(let n=e.pe;n!==null;n=n.Ge)n.T?.Re?.P||(n.X!==void 0&&(n.l&256||ke(n,t),n.l|=1048576),je(n,t))}function Me(e,t,n){for(let r=e.pe;r!==null;r=r.Ge)(r.l&2304)==256&&D(r)!==t&&n(r),Me(r,t,n)}function Ne(e){e.T.Re=null,e.l&=-257}const A={et:Array(2e3).fill(void 0),p:!1,Fe:0,Et:0};let j=0,Pe=!1,Fe=!1,Ie=!1,Le=0;function M(){Fe?Ve():Pe||(Pe=!0,!Le&&!I.Y&&queueMicrotask(et))}const Re=Symbol.for(`solid-js/root-error-hook`),ze=`[REACTIVITY_HALTED]`;function Be(e){if(Fe)return;Fe=!0,v(!0);let t=ze,n=e!==void 0&&globalThis.reportError;n||e===void 0?console.error(t):console.error(t,e),n&&n(e)}function Ve(){Ie||(Ie=!0,console.error(ze))}var N=class e{rn=[[],[]];Y=!1;flush(){if(!this.Y){this.Y=!0,cn(),w=null,E=null;try{_t(),st(A,e._e),this.settle(),j++,Pe=A.Et>=A.Fe||F.length!==0,this.run(1),this.run(2)}finally{this.Y=!1,E=null}}}settle(){let e=T;T=null;let t=e!==null&&!e.P?O(e):null;if(t!==null){let e=F.length;for(let n=0;n<e;n++){let e=F[n];if(!(e.l&2304)&&(e.T===null||e.T.Re===null||!e.T.Re.P)){if(e.ue===u&&e.m&4&&e.i!==1)continue;if(e.ue!==u&&!(e.m&5)&&e.T?.me==null&&e.T?.Le==null&&hn(e,e.le,e.ue)){e.ue=u,e.l&=-129;continue}ke(e,t)}e.l&128&&je(e,t)}F.length=0,De.splice(0)}else{$e();for(let e=0;e<Te.length;e++){let t=Te[e];t.T?.U==null&&!t.Ae&&dt(t)}}Te.length&&=0;let n=this.rn;this.rn=[[],[]];for(let e=C.length-1;e>=0;e--){let t=C[e];ye(t)||(C.splice(e,1),Ue(t),e=C.length)}let r=t&&_e(t),i=r!==null;for(let e=0;e<2;e++)i&&P(r.rn[e],n[e]),this.rn[e]=i||this.rn[e].length?[].concat(i?[]:n[e],this.rn[e]):n[e];if(De.length!==0){let e=De.splice(0).sort((e,t)=>e.he-t.he);for(let t=0;t<e.length;t++)e[t].R&64||U(e[t])}de?.()}run(e){let t=this.rn[e-1];t.length&&(this.rn[e-1]=[],tt(t,e))}enqueue(e,t,n=w){e&&(n?.P?n:this).rn[e-1].push(t),M()}notify(e,t,n,r){return le?.(e,n&t,r)?!0:t&1?(n&1&&w===null&&k(null),!0):!1}};function He(e){let t;for(let n=0;n<e.fn.length;n++){let r=e.fn[n],i=r.T?.U?.source;if(!(r.R&64||r.m&2&&(r.i||!(r.l&8388608))&&i!==r&&(i?.m??2)&2)&&r.R&2048){t||=r.i||i===r||r.l&256,e.P||(r.R&=-2049),r.Ae=!1;for(let e=r.pe;e!==null;e=e.Ge)e.i&&(e.Ae=!1);L(r)}}return e.fn.length=0,t}function Ue(e){let t=He(e);for(let t=0;t<e.ln.length;t++){let n=e.ln[t];n.T.Re!==null&&D(n)===e&&(n.T.Re=null,Qe(n))}T===e&&(T=null),t?I.rn[1].push(()=>We(e)):We(e)}function We(e){for(let t=0;t<2;t++)P(I.rn[t],e.rn[t]),e.rn[t]=[]}function P(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}const F=[];function Ge(e,t){e.R&2048||(e.R|=2048,t.fn.push(e))}function Ke(e){F.push(e),I.Y||nn()}let qe=0;function Je(){qe++}function Ye(e){e.we=qe;let t=!!(e.l&512)&&e.T?.De!==void 0;for(let n=e.o;n!==null;n=n.t){let e=n.u;e.R&4&&n.Ne===e.de&&n!==e._&&(e.R|=a),t&&e.l&8?e.R|=256:L(e)}}function Xe(e){e.Ae=!0,I.enqueue(e.i,e.W??=N.q.bind(null,e))}function Ze(e){return e.ue!==u&&(e.le=e.ue,e.ue=u)}function Qe(e){let t=e;if(!t.X){e.l&=-385,Ze(e);return}let n=e.ue===u&&!!(t.m&1),r=e.l&s;if(!n&&t.T&&(t.T.Te=null),e.l=n?e.l&-1048833|1024:e.l&-3147137,r){let n=e.ue;e.ue=u,e.ie=j+1,It(t,2,n)}else Ze(e)&&(t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=u),e.i&&e.i!==3&&Xe(e));t.Ie=!1,t.R&=-1025,t.T?.U??dt(t),t.m&1||(t.m&=-5),n||t.T==null||t.T.me===null&&t.T.Le===null||N.Ce(t,!1,!0)}function $e(){for(let e=0;e<F.length;e++){let t=F[e];t.l&2304||Qe(t)}F.length=0}const I=new N;function et(e){if(e){Le++;try{return e()}finally{try{et()}finally{Le--}}}if(!I.Y&&!Fe){for(;Pe;)I.flush();v()}}function tt(e,t){for(let n=0;n<e.length;n++)e[n](t)}function L(e){A.Fe>e.he&&(A.Fe=e.he),rt(e,A)}function nt(e,t){let n=(e._parent?.Qe?e._parent.Ke?.he:e._parent?.he)??-1;n>=e.he&&(e.he=n+1);let r=e.he,i=t.et[r];if(i===void 0)t.et[r]=e;else{let t=i.We;t.ve=e,e.We=t,i.We=e}r>t.Et&&(t.Et=r)}function rt(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|10:(e.R=n|8,t.p&&ot(e)),n&16||nt(e,t))}function it(e,t){let n=e.R;n&28||(e.R=n|16,nt(e,t))}function R(e,t){let n=e.R;if(!(n&24))return;e.R=n&-25;let r=e.he;if(e.We===e)t.et[r]=void 0;else{let n=e.ve,i=t.et[r],a=n??i;e===i?t.et[r]=n:e.We.ve=n,a.We=e.We}e.We=e,e.ve=void 0}function at(e){if(!e.p){e.p=!0;for(let t=0;t<=e.Et;t++)for(let n=e.et[t];n!==void 0;n=n.ve)n.R&8&&ot(n)}}function ot(e,t=2){let n=e.R;if(!((n&3)>=t)){e.R=n&-4|t;for(let t=e.o;t!==null;t=t.t)ot(t.u,1)}}function st(e,t){for(e.p=!1,e.Fe=0;e.Fe<=e.Et;e.Fe++){let n=e.et[e.Fe];for(;n!==void 0;)n.R&8?t(n):ct(n,e),n=e.et[e.Fe]}e.Et=0}function ct(e,t){R(e,t);let n=e.he;for(let t=e.C;t;t=t.G){let e=t.S;e.X&&e.he>=n&&(n=e.he+1)}if(e.he!==n){e.he=n;for(let n=e.o;n!==null;n=n.t)it(n.u,t)}}let lt;function ut(e){let t=e.S,n=e.G,r=e.t,i=e.en;if(r===null?t.Ze=i:r.en=i,i!==null)i.t=r;else if(t.o=r,r===null){t.l&4096?lt(t):t.T?.Ye&&_(t.T.Ye);let e=t;e.X&&e.l&32&&!(e.R&32)&&!(e.m&1)&&(pt?pt.push(e):ht(e))}return n}function dt(e){let t=e._,n=t===null?e.C:t.G;if(n!==null){do n=ut(n);while(n!==null);t===null?e.C=null:t.G=null}}function ft(e){e.C&&(e._=null,dt(e))}let pt=null;const mt=e=>pt=e;function ht(e){R(e,A),ft(e),y(e,!0)}const gt=new p;function _t(){if(gt.size!==0){for(let e of gt)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&ht(e);gt.clear()}}function vt(e,t){let n=t._;if(n!==null&&n.S===e)return;let r=null,i=t.R&4;if(i&&(r=n===null?t.C:n.G,r!==null&&r.S===e)){r.Ne=t.de,t._=r;return}let a=e.Ze;if(a!==null&&a.u===t&&(!i||a.Ne===t.de))return;let o=t._=e.Ze={S:e,u:t,G:r,en:a,t:null,Ne:t.de};n===null?t.C=o:n.G=o,a===null?e.o=o:a.t=o,Je()}function yt(e,t){return!e.T?.se?.has(t)&&((G(e).se??=new p).add(t),!0)}function bt(e,t){let n=e.T?.se;return n?.delete(t)?(n.size||(e.T.se=void 0),!0):!1}function xt(e){e.T!==null&&(e.T.Ee=null)}function St(e){e.T!==null&&(e.T.se=void 0)}function Ct(e,t){for(let n=e.C;n;n=n.G){let e=n.S;if(e===t||e.T?.se?.has(t))return!0}return!1}function wt(e,t){G(e).fe=!0,t.source&&yt(e,t.source),e.m&2||z(e,t.source,t)}function z(t,n,r){if(!n){t.T!==null&&(t.T.U=null);return}let i=r instanceof e&&r.source===n?r:t.T?.U;G(t).U=i instanceof e&&i.source===n?i:new e(n)}function Tt(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function Et(e,t){let n=new p,r=e=>{let i=n.has(e);t(e,i)!==!1&&!i&&(n.add(e),Tt(e,r))};Tt(e,r)}function Dt(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&(e.R&8?e.R|=o:ht(e))}function Ot(e){let t;if(Et(e,(e,n)=>{!n&&!e.o&&e.l&32&&(t??=[]).push(e)}),t)for(let e of t)Dt(e)}function kt(e,n,r){return!(e.l&256||r&&e.R&16384&&I.Y&&!e.rr)||w?!1:(St(e),e.T&&(e.T.fe=!1),(e.m&=6)&2||z(e),e.ue=n instanceof t?n:new t(e,n),e.l|=2097280,B(e),M(),!0)}function At(e,t){let n=!1;Et(e,(e,r)=>{!r&&e.T?.U===t&&(L(e),n=!0)}),n&&M()}function B(e,t=e){bt(e,t);let n=!1,r;if(Et(e,(i,a)=>{if(a||t!==e&&Ct(i,t)||!bt(i,t))return!1;i.ie=j;let o=i.T?.se?.values().next().value,s=i.m&2;o?s||z(i,o):(i.m&=-2,s||z(i),i.l&256&&k(D(i)),i.T?.fe&&(L(i),n=!0),i.T!==null&&(i.T.fe=!1),!i.o&&i.l&32&&(r??=[]).push(i))}),r)for(let e of r)Dt(e);n&&M()}function jt(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function Mt(e){let t=e.T?.Se;t!=null&&(e.T.Se=null,t())}function Nt(t,n,r,i){let a=!1,o=!1;if(typeof n==`object`&&n&&Qt(()=>{a=n[Symbol.asyncIterator],o=!a&&jt(n)}),!o&&!a)return t.T!==null&&(t.T.Ee=null),t.Ie=!1,n;G(t).Ee=n,t.T.ce=2147483647,t.T.se=void 0;let s,c=r=>{if(t.T?.Ee!==n)return;let a=r instanceof e;a&&t.Ie?(xt(t),wt(t,r),t.ie=j):((a||!kt(t,r))&&(It(t,a?1:2,r),a||y(t,!1,!0)),a&&B(t),t.ie=j,a||Ot(t),i?.(r,a))},l=(e,i)=>{if(t.T?.Ee!==n||t.R&2)return;let a=t.m&4;if(Ft(t),r){try{r(e)}catch(e){c(e);return}t.l&256||(t.T.Te=null,t.l&=-1025),a&&Ft(t,!0)}else K(t,()=>e);t.ue===u&&(t.Ie=!1,dt(t)),B(t),M(),et(),i?.()},d=()=>t.l&32&&!t.o&&!(t.m&1)?(ht(t),!0):!1,f=(e,r)=>{let i=e[Symbol.asyncIterator](),a=!1,o=!1,u=!r,f=()=>{if(!o){o=!0;try{let e=i.return?.();jt(e)&&e.then(void 0,()=>{})}catch{}}};ae(f,r),G(t).Se=f;let p=()=>{try{d()||m()}catch(e){c(e)}},m=()=>{let e,r,f=!1,h=!1,g=!0,_=i.next();if((jt(_)?_:{then:e=>void e(_)}).then(r=>{if(g&&u)e=r,f=!0,r.done&&(o=!0);else if(t.T?.Ee!==n)return;else r.done?(o=!0,a?(M(),et()):l(void 0),d()):(a=!0,l(r.value,p))},e=>{g&&u?(r=e,h=!0):t.T?.Ee===n&&(o=!0,c(e),d())}),g=!1,h){if(o=!0,c(r),u)throw r;return!0}return f&&!e.done?(s=e.value,a=!0,m()):f&&e.done},h=m();return u=!1,a||h},p=null,m=(e,t)=>{let n=!1;if(typeof e==`object`&&e&&Qt(()=>{n=e[Symbol.asyncIterator]}),!n)return!1;s=void 0;let r=f(e,t);return t||(p=r),!0};if(o){let e=!1,r=!1,i,a=!0;if(n.then(r=>{if(a)s=r,e=!0;else{try{if(t.T?.Ee===n&&!(t.R&64)&&m(r,t))return;l(r)}catch(e){c(e)}d()}},e=>{a?(i=e,r=!0):(c(e),d())}),a=!1,r)throw c(i),i;e?m(s)||(t.Ie=!1):p=!1}if(a&&m(n),p!==null){if(!p){if(t.Ie)return t.le;throw new e(H)}t.Ie=!1}return s}function Pt(e,t=!1){e.T?.se&&St(e),e.T?.fe&&(e.T.fe=!1),e.m=t?0:e.m&4,e.T?.U&&z(e);let n=qt(e);n&&n.call(e)}function Ft(e,t=!1){let n=e.T?.se;n&&(n.delete(e),n.size)?(e.T.fe=!1,t&&(e.m=1),z(e,n.values().next().value)):Pt(e,t)}function It(n,r,i){r===2&&!(i instanceof t)&&!(i instanceof e)&&(i=new t(n,i));let a=r===1&&i instanceof e&&i.source;a?(n.m&2&&(n.T.Te=n.T.U),yt(n,a)):St(n),n.m=r|(r===2?n.m&12?8:0:r===1&&n.m&8?4:n.m&4),a?z(n,a,i):G(n).U=i;let o=qt(n);o?o.call(n):Lt(n,r,i)}function Lt(t,n,r){let i=n===1&&r instanceof e&&r.source;Tt(t,(e,a)=>{e.ie=j,e.l&16384||n===1&&a.Ne!==e.de?(n!==1&&bt(e,t),L(e),M()):i&&e.T?.se?.has(i)?w===null&&(e.l&2304)==256&&I.Y&&!S?.(e,i.ie===j)&&k(D(e)):(i||n!==1&&(e.T?.U!==r||e.T?.se))&&(Ke(e),n===1&&(e.l&2304)==256&&!e.i&&k(D(e)),It(e,n,r),e.rr?.st(n,r))})}N._e=e=>{e.i===3?(R(e,A),e.Ae=!0,I.enqueue(2,e.Z)):e.R&32&&!(e.R&65536)?Oe(e):U(e)},N.Ce=y;let V=!1,H=null;function U(t,n=!1){Je();let r=t.i,i,c=t.l&s;if(!n){if(R(t,A),t.T!==null&&(t.T.Ee=null,Mt(t)),t.l&256){let e=D(t);e.P||t.l&524288||(t.l&8421376?e!==T&&!(t.m&4||t.l&1048576)&&(t.ue!==u&&Ye(t),t.ue=u,t.l&=-257):ge(e,S?.(t,t.m&4)))}if(r===3||t.l&128){let e=pt;mt(i=[]),y(t),mt(e)}else(t.pe!==null||t.ke!==null)&&Ut(t);t.l&2097152&&(t.ue=u,t.l^=s)}let l=t.m&4,d=t.m&2&&t.T?.U,f=!!(t.m&1)&&t.T?.se,p=t.T?.se?.has(t),m=!1,h=!!(t.R&8192)&&!(t.m&1&&t.T!==null&&!t.T.Ve),g=H;H=t,t._=null,t.de++;let _=t.R&o;t.R=4|t.R&8224,t.ie=j;let v=t.ue===u?t.l&2048&&t.T.P!==u?t.T.P:t.le:t.ue,b=t.he,ee=!1,te=!1,ne=V;V=!0;try{if(t.l&64)v=t.X(v),t.T!==null&&(t.T.Ee=null),t.Ie=!1;else{let e=t.T?.Ee,n=t.X(v),r=typeof n==`object`&&!!n,i=t.T?.Ee!==e;v=i||!r?n:Nt(t,n),!i&&!r&&(t.T!==null&&(t.T.Ee=null),t.Ie=!1)}(t.m!==0||t.T!==null)&&Pt(t,n)}catch(n){let r=n instanceof e;if(r&&t.Ie)wt(t,n);else if((r||!(m=kt(t,n,!0)))&&(r&&(G(t).fe=!0),It(t,r?1:2,n),r&&p&&!t.T?.Ee&&B(t)),(r||m)&&f)for(let e of f)e!==t&&!(t.T?.se?.has(e)&&(e.m&1||Ct(t,e)))&&B(t,e)}finally{if(V=ne,ee=!!(t.R&a),te=!!(t.R&128),t.R=t.R&936032|(n?t.R&256:0),H=g,i)for(let e of i)Dt(e);t.T!==null&&(t.T.Ve=h&&!!(t.m&1))}if(t.R&64){ft(t),xt(t);return}let re=!!t.T?.U||m;if(!re){let e=t.ue===u,i=e?t.l&2048&&t.T.P!==u?t.T.P:t.le:t.ue,a=e&&l&&!r||!!t.T?.Te||!!c||!hn(t,i,v);if(r&&a&&!(t.R&262144&&!t.Ae&&Object.is(t.ge,v))&&e&&(t.Ae=!t.T?.U,n||I.enqueue(r,t.W??=N.q.bind(null,t),null)),!re){if(a)(n?!((T!==null||E!==null)&&(te||Ht(g)?.R&128)):r&&t.ue===u)?t.le=v:(t.ue=v,d&&(t.T.Te=d),n&&(ke(t,T??E),t.m|=4,S?.(t,T))),t.o!==null&&Ye(t);else if(t.he!=b)for(let e=t.o;e!==null;e=e.t)it(e.u,A)}if(!a&&!t.T?.U&&(d&&At(t,d),f))for(let e of f)e!==t&&B(t,e);p&&!(t.m&5)&&B(t)}if(n&&te&&t.m&1){let e=T??E;e&&!e.P&&(r&&S?.(t)===2||ke(t,e))}!t.T?.U&&t.ue===u&&!(r&&t.Ae)&&(n||r===3?dt(t):Ee(t)),(t.ue!==u||t.T!==null&&(t.T.me!==null||t.T.Le!==null)||t.m&5&&(!n||t.m&1))&&(t.l|=128,Ke(t)),ee&&(L(t),M()),_&&Dt(t)}function Rt(e){if(!(e.R&68)){if(e.R&1)for(let t=e.C;t;t=t.G){let n=t.S;if(n.X&&Rt(n),e.R&2)break}(e.R&2||e.T?.U&&e.ie<j&&!e.T?.Ee)&&U(e),e.R&=937336}}function W(e,t){let n=t?.transparent??!1,r=typeof t==`object`&&!!t&&`loadingValue`in t,i={id:re(t,n,H),l:(n?4:0)|!!t?.ownedWrite|(!H||t?.lazy?32:0)|(t?.sync?64:0)|(t?.ae?2:0)|(t?.xe??0),ye:t?.equals??Zt,ke:null,A:H?.A??d,be:0,X:e,le:r?t.loadingValue:void 0,he:0,ve:void 0,We:null,C:null,_:null,de:0,o:null,Ze:null,_parent:H,Ge:null,Me:null,pe:null,R:t?.lazy?512:0,m:r?0:4,ie:j,ue:u,we:-1,Ie:r,T:null};return t?.unobserved&&(G(i).Ye=t.unobserved),Yt(i,t),i}function G(e){return e.T??={Ee:null,Se:null,U:void 0,fe:void 0,se:void 0,Ye:void 0,De:void 0,me:null,Le:null,Re:null,Ve:!1,je:u,Be:-1,ce:0,P:u,I:0,Te:null}}function zt(e,t){e.R|=128,(t.m&4||e.i!==1)&&ge(D(t),!e.i&&e.m&4||S?.(e))}function Bt(e,t){if(!(!(e.l&1<<23)||t.l&1024)){let n=D(t);if(!(n===T||Vt(e,n)))return Ge(e,n),!0}return zt(e,t),!1}function Vt(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&D(e)===t}function Ht(e){return e!==null&&e.Qe?e.Ke:e}function Ut(e){m(e);let t=G(e);t.Le=e.ke,t.me=e.pe,e.ke=null,e.pe=null,e.be=0}function Wt(e,t,n,r,i){let a=i?.transparent??!1,o={id:re(i,a,H),l:r<<23|(a?4:0)|!!i?.ownedWrite|(i?.sync?64:0)|(i?.xe??0),ye:!1,ke:null,A:H?.A??d,be:0,X:e,le:void 0,he:0,ve:void 0,We:null,C:null,_:null,de:0,o:null,Ze:null,_parent:H,Ge:null,Me:null,pe:null,R:512,m:4,ie:j,ue:u,we:-1,Ie:!1,Ae:!1,ge:void 0,qe:t,Je:n,ze:void 0,i:r,T:null};return i?.unobserved&&(G(o).Ye=i.unobserved),Yt(o,Jt),o}let Gt=null;function Kt(e){Gt=e}function qt(e){return e.i?Gt:null}const Jt={lazy:!0};function Yt(e,t){e.We=e;let n=H?.Qe?H.Ke:H;H&&b(H,e),n&&(e.he=n.he+1),!t?.lazy&&U(e,!0)}function Xt(e,t){let n={ye:t?.equals??Zt,l:+!!t?.ownedWrite|(t?.ae?2:0),le:e,o:null,Ze:null,ie:j,ue:u,we:-1,T:null};return t?.unobserved&&(G(n).Ye=t.unobserved),n}function Zt(e,t){return e===t}function Qt(e,t){let n=V;V=!1;try{return e()}finally{V=n}}function $t(e,t){if(e.R&512)e.R&=-513,U(e,!0);else if(e.R&64&&e.l&32){let t=e._parent;if(t!==null){if(t.R&64){e.l&=-33;return}e.R&32||b(t,e)}U(e,!0)}}function en(e,t){return!t||e.ue===u||t.l&16}let tn=!1;function nn(){tn=!0}function rn(e){return I.Y||e.ue===u||e.l&4194304?u:e.l&256?e.T.Be===j?e.T.je:u:e.le}function an(e){let t=e.T;t.Be!==j&&(t.je=e.ue,t.Be=j,tn=!0)}const on=[];function sn(e){return e.R|=a,!0}function cn(){if(tn=!1,on.length!==0){for(let e of on)e.l&=-4194305;on.length=0}}function ln(e,t){e.he>=A.Fe?(ot(t),at(A),Rt(e)):t.l&65536&&Rt(e);let n=e.he;n>=t.he&&e._parent!==t&&(t.he=n+1)}function un(e){let t=H;t?.Qe&&(t=t.Ke);let n=e,r=e;if(typeof n.X==`function`&&$t(e),!n.X&&e.T?.De===void 0&&(!tn||e.ue===u)&&!(e.l&2048))return t&&(V&&vt(e,t),e.l&256&&!(t.l&16)&&Bt(t,e))||!t||e.ue===u||t.l&16||e.ue===e.le&&Object.is(e.ue,e.le)?e.le:(pn(t),e.ue);let i=!1;if(t&&(V&&(vt(e,t),r.X&&ln(r,t)),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4?zt(t,e):i=Bt(t,e))),r.m&1&&!i){if(t){if(!(t.l&16)||r.m&4)throw!V&&e!==t&&vt(e,t),r.T?.U}else if(r.m&4)throw r.T?.U}if(r.X&&r.m&2){if(V&&r.ie<j)return U(r),un(e);throw!i&&e.l&2097152&&fn(e,t),r.T?.U}(i||!t)&&dn(e);let a=fn(e,i?null:t);return!t&&typeof n.X==`function`&&e.l&32&&!(r.m&1)&&!e.o&&(gt.add(e),M()),a}function dn(e){if(e.T?.Te)throw e.T.Te}function fn(t,n){if(t.ue!==u&&t.m&4&&(!n||n.l&16))throw new e(null);let r=n&&tn?rn(t):u;if(r!==u)return sn(n),r;if(en(t,n))return t.le;if(pn(n,t),t.l&2097152)throw t.ue;return t.ue}function pn(e,t){t?.m&4||(e.R|=16384)}function mn(e){I.Y||e.l&4194304||(e.l|=4194304,on.push(e))}function hn(t,n,r){if(t.ye===Zt)return n===r;try{return t.ye&&t.ye(n,r)}catch(n){if(!(n instanceof e))return It(t,2,n),!0}}function K(e,t){let n=e.ue===u?e.le:e.ue;if(typeof t==`function`&&(t=t(n)),e.l&256&&k(D(e)),!(e.m&4||e.T?.Te||!hn(e,n,t)))return t;let r=e.ue!==u;return r?e.l&256&&!I.Y&&an(e):Ke(e),e.ue=t,H!==null&&mn(e),e.X!==void 0&&(e.ie=j),r&&e.we===qe||(Ye(e),M()),t}function gn(e,t){let n=e.l&256&&!(e.R&1024)&&D(e)!==T;if(n&&typeof t==`function`){let n=t(e.le);t=()=>n}return e.m&2&&(e.T.Te=e.T.U,It(e,0)),t=K(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,rt(e,A),M()):e.ue!==u&&(e.R|=1024),t}function q(e,t){let n=H,r=V;H=e,V=!1;try{return t()}finally{H=n,V=r}}function _n(e,t=!0){try{return e()}finally{}}function vn(e,t=x()){let n;if(t&&(n=t.A[e.id]),n===void 0&&(n=e.defaultValue),n===void 0)throw new i;return n}function yn(e,t,n=x()){if(!n)throw new r;n.A={...n.A,[e.id]:t===void 0?e.defaultValue:t}}function bn(e,t,n,r){let i=Wt(e,t,n,r?.user?2:1,r);U(i,!0),r?.defer?Ze(i):i.ue===u&&(i.T?.Re?.P||i.i===2||r?.schedule?I.enqueue(i.i,Cn.bind(null,i),i.T?.Re):Cn(i,0))}function xn(){let e=this.m,t=this.T?.U;if(e&2){if(I.notify(this,1,0),this.i===2){this.m&2&&Xe(this);return}Sn(this,n(t))}else this.i===1&&I.notify(this,3,e,t)}function Sn(e,t,n){if(!I.notify(e,2,2))throw Be(t),t}function Cn(e,r){if(!e.Ae||e.R&64||r&&fe?.(e))return;if(e.m&2&&e.i===2){let t=n(e.T?.U);e.ge=e.le,e.Ae=!1;try{e.Je?e.Je(t,()=>{let t=e.ze;e.ze=void 0,t?.()}):console.error(t)}catch(t){Sn(e,t)}return}let i=e.T?.U==null,a=e.ze;e.ze=void 0;try{a?.(),e.ze=e.qe(e.le,e.ge)}catch(n){G(e).U=new t(e,n),e.m|=2,Sn(e,n)}finally{e.ge=e.le,e.Ae=!1,i&&dt(e)}}N.q=Cn;function wn(e,t){let n=!1,r,i=()=>{if(!a.Ae||a.R&64||fe?.(a))return;let e=qe;n=!1;try{a.Ae=!1,U(a)}finally{}for(let t=a.C;t!==null;t=t.G){let o=t.S;if(o.ue!==u&&!(o.l&2048)&&(o.ue!==o.le||!Object.is(o.ue,o.le))){if(o.l&256)n||(n=!0,D(o).rn[1].push(r||=()=>{n&&(a.Ae=!0,i())}));else if(o.we<=e||o.X){L(a),M();break}}}},a=W(()=>{let t=a.ze;a.ze=void 0,t?.();let n=_n(e);a.ze=n},{...t,lazy:!0});a.ze=void 0,a.l=a.l&-33|16,a.Ae=!0,a.i=3,a.Z=i,L(a),M()}Kt(xn);const Tn=/* @__PURE__ */ new WeakSet;function En(e){for(let t=e;t;t=t._parent){let e=t[Re];if(e!==void 0)return e}}function Dn(e){let t=[];for(let n=e;n;n=n._parent){let e=n._name;typeof e==`string`&&e.length&&t.push(e)}return t.length?t.reverse():void 0}function On(e,t,n){if(e!==null&&(typeof e==`object`||typeof e==`function`)){if(Tn.has(e))return;Tn.add(e)}let r=En(t);if(r===void 0)return;let i={},a=Dn(t),o=Dn(n)??a;o!==void 0&&(i.ownerPath=o),a!==void 0&&(i.boundaryPath=a);try{r(e,i)}catch(e){console.error(e)}}const kn=Symbol(0);function J(e){let t=un.bind(null,e);return t[f]=e,t}function An(e,t){if(typeof e==`function`){let n=W(e,t);return n.l&=-33,[J(n),gn.bind(null,n)]}let n=Xt(e,t);return[J(n),K.bind(null,n)]}function jn(e,t){return J(W(e,t))}function Mn(e,t,n){bn(e,t,void 0,n)}function Nn(e){let t=x();t&&!(t.l&16)?wn(()=>Qt(e),void 0):I.enqueue(2,function t(){if(A.Et>=A.Fe)return I.enqueue(2,t);e()})}function Pn(e,t,n){let r=typeof n?.keyed==`function`?n.keyed:void 0,i=t.length>1,a=t,o={H:se(),it:0,st:e,ot:[],ft:a,ht:[],ln:[],Xe:r,ct:r||n?.keyed===!1?[]:void 0,lt:i&&n?.keyed!==!1?[]:void 0,ut:n?.keyed===!1,L:n?.fallback},s=W(Vn.bind(o),void 0);return s.l&=-33,J(s)}const Fn={ownedWrite:!0};function In(e,t,n,r){let i=e.ot,a=e.it-1,o=[],s=[],c=[],l=256,u=r,d=r,f=!1;for(;u<=a&&d<=n-1;){let e=i[u],r=t[d];if(e===r){f||=(c.push(u,d,0),!0),c[c.length-1]++,u++,d++;continue}f=!1;let p=-1,m=Math.min(32-o.length,a-u,l);for(let e=1;e<=m;e++)if(i[u+e]===r){p=e;break}l-=p===-1?m:p;let h=-1;m=Math.min(32-s.length,n-1-d,l);for(let n=1;n<=m;n++)if(t[d+n]===e){h=n;break}if(l-=h===-1?m:h,p!==-1&&(h===-1||p<=h))for(;p-->0;)o.push(u++);else if(h!==-1)for(;h-->0;)s.push(d++);else{if(l<=0||o.length===32||s.length===32)return!1;o.push(u++),s.push(d++)}}for(;u<=a;u++){if(o.length===32)return!1;o.push(u)}for(;d<=n-1;d++){if(s.length===32)return!1;s.push(d)}return Ln(e,t,n,o,s,c)}function Ln(e,t,n,r,i,a){let o=e.ot,s,c,l;if(i.length!==0)for(l=Array(r.length),c=0;c<i.length;c++){let e=-1;for(s=0;s<r.length;s++)if(!l[s]&&o[r[s]]===t[i[c]]){e=s;break}if(e===-1)return!1;l[e]=!0,i[c]=i[c]<<6|e}if(r.length!==0||i.length!==0){let e=/* @__PURE__ */ new Set;for(s=0;s<r.length;s++)e.add(o[r[s]]);for(c=0;c<i.length;c++)e.add(t[i[c]>>6]);for(let t=0;t<a.length;t+=3){let n=a[t];for(let r=0,i=a[t+2];r<i;r++)if(e.has(o[n+r]))return!1}}let u=e.ht,d=e.ln,f=u.slice(0,n),p=d.slice(0,n);for(let e=0;e<a.length;e+=3){let t=a[e],n=a[e+1];if(t!==n)for(let r=0;r<a[e+2];r++)f[n+r]=u[t+r],p[n+r]=d[t+r]}for(c=0;c<i.length;c++){let e=i[c]>>6,t=r[i[c]&63];f[e]=u[t],p[e]=d[t]}for(e.ht=f,e.ln=p,e.it=n,e.ot=t.slice(0),s=0;s<r.length;s++)l!==void 0&&l[s]||d[r[s]].dispose();return!0}function Rn(e,t,n,r,i,a,o,s,c){let l=e.Xe,u=e.ot,d=e.ln,f=[],p=n;for(let m=n;m<=i;p++,m++){let i=l?l(t[m]):t[m];for(;p<=r&&(l?l(u[p]):u[p])!==i;)f.push(d[p++]);if(p>r)return o.fill(void 0),null;a[m]=e.ht[p],o[m-n]=d[p],s&&(s[m-n]=e.ct[p]),c&&(c[m-n]=e.lt[p])}for(;p<=r;p++)f.push(d[p]);return f}function zn(e,t,n,r,i,a,o,s,c){let l=e.ln,u=e.ct,d=e.lt,f=e.it,p=n-f,m,h;if(p>0)for(l.length=n,u&&(u.length=n),d&&(d.length=n),m=f-1,h=n-1;m>i;m--,h--)l[h]=l[m],u&&(u[h]=u[m]),d&&(d[h]=d[m]);else if(p<0){for(m=i+1,h=a+1;m<f;m++,h++)l[h]=l[m],u&&(u[h]=u[m]),d&&(d[h]=d[m]);l.length=n,u&&(u.length=n),d&&(d.length=n)}for(h=r;h<=a;h++)l[h]=o[h-r],u&&Bn(u[h]=s[h-r],t[h]),d&&K(d[h]=c[h-r],h);for(h=a+1;h<n;h++)u&&Bn(u[h],t[h]),d&&p!==0&&K(d[h],h)}const Bn=(e,t)=>e.le===t&&e.ue===u||K(e,t);function Vn(){this.H.Ke=x();let e=this.st()||[];e[kn],e=e;let t=e.length;return q(this.H,()=>{let n,r,i,a,o,s=this.ct?this.ut?()=>(a[i]=Xt(e[r],Fn),this.ft(J(a[i]),r)):()=>(a[i]=Xt(e[r],Fn),o&&(o[i]=Xt(r,Fn)),this.ft(J(a[i]),o?J(o[i]):void 0)):this.lt?()=>{let t=e[r];return o[i]=Xt(r,Fn),this.ft(t,J(o[i]))}:()=>{let t=e[r];return this.ft(t)};if(t===0)this.it!==0&&(this.H.dispose(!1),this.ln=[],this.ot=[],this.ht=[],this.it=0,this.ct&&=[],this.lt&&=[]),this.L&&!this.ht.length&&(this.ln[0]?.dispose(),this.ht[0]=q(this.ln[0]=se(),this.L));else if(this.it===0){let c=Array(t),l=Array(t);a=this.ct&&Array(t),o=this.lt&&Array(t);try{for(r=0;r<t;r++)i=r,c[r]=q(l[r]=se(),s)}catch(e){for(n=0;n<=r;n++)l[n]?.dispose();throw e}this.ln[0]&&this.ln[0].dispose(),this.ht=c,this.ln=l,a&&(this.ct=a),o&&(this.lt=o),this.ot=e.slice(0),this.it=t}else{let c,l,u,d,f,p,m,h,g;for(c=0,l=Math.min(this.it,t);c<l&&(this.ot[c]===e[c]||this.ct&&Hn(this.Xe,this.ot[c],e[c]));c++)this.ct&&Bn(this.ct[c],e[c]);for(l=this.it-1,u=t-1;l>=c&&u>=c&&(this.ot[l]===e[u]||this.ct&&Hn(this.Xe,this.ot[l],e[u]));l--,u--);if(c===t&&this.it===t){this.ot=e.slice(0);return}if(t<=this.it&&l-c>64&&this.ct===void 0&&this.lt===void 0){let n=c+(u-c>>1),r=e[n],i=Math.min(l,n+32),a=Math.max(c,n-32);for(;a<=i&&this.ot[a]!==r;)a++;if(a<=i&&In(this,e,t,c))return}let _=t-this.it,v=u-c+1,y=Array(t),b=Array(v);a=this.ct?Array(v):void 0,o=this.lt?Array(v):void 0;let ee=_<0?Rn(this,e,c,l,u,y,b,a,o):null;if(ee!==null)ee.length!==0&&(h=ee);else{for(p=/* @__PURE__ */ new Map,m=Array(v),r=u;r>=c;r--)d=e[r],f=this.Xe?this.Xe(d):d,n=p.get(f),m[r-c]=n===void 0?-1:n,p.set(f,r);for(n=c;n<=l;n++)d=this.ot[n],f=this.Xe?this.Xe(d):d,r=p.get(f),r!==void 0&&r!==-1?(y[r]=this.ht[n],b[r-c]=this.ln[n],a&&(a[r-c]=this.ct[n]),o&&(o[r-c]=this.lt[n]),r=m[r-c],p.set(f,r)):(h??=[]).push(this.ln[n]);try{for(r=c;r<=u;r++)b[r-c]===void 0&&((g??=[]).push(b[r-c]=se()),i=r-c,y[r]=q(b[r-c],s))}catch(e){if(g)for(n=0;n<g.length;n++)g[n].dispose();throw e}}for(n=0;n<c;n++)y[n]=this.ht[n];for(r=u+1;r<t;r++)y[r]=this.ht[r-_];if(zn(this,e,t,c,l,u,b,a,o),this.ht=y,this.it=t,this.ot=e.slice(0),h)for(n=0;n<h.length;n++)h[n].dispose()}}),this.ht}function Hn(e,t,n){return!e||e(t)===e(n)}function Un(e,t){if(typeof e==`function`&&!e.length){if(t?.doNotUnwrap)return e;do e=e();while(typeof e==`function`&&!e.length)}if(!t?.skipNonRendered||e!=null&&e!==!0&&e!==!1&&e!==``){if(Array.isArray(e)){let n=[];return Wn(e,n,t)?()=>{let e=[];return Wn(n,e,{...t,doNotUnwrap:!1}),e}:n}return e}}function Wn(t,n=[],r){let i=null,a=!1;for(let o=0;o<t.length;o++)try{let e=t[o];if(typeof e==`function`&&!e.length){if(r?.doNotUnwrap){n.push(e),a=!0;continue}do e=e();while(typeof e==`function`&&!e.length)}Array.isArray(e)?a=Wn(e,n,r)||a:r?.skipNonRendered&&(e==null||e===!0||e===!1||e===``)||n.push(e)}catch(t){if(!(t instanceof e))throw t;i=t}if(i)throw i;return a}const Gn=Symbol(``),Kn=Symbol(``),Y=/* @__PURE__ */ new Set,qn=e=>e.A[Gn],Jn=e=>!!e&&(e.i===2&&e.L||Jn(e._parent)),X=e=>e.i===2||!e.D||e.h||Jn(e._parent);function Z(e,t,n=t){e.F.set(t,n),Y.add(e)}function Yn(e,t,r,i=t){if(e.i===2){r??=t.T?.U,i=r?.source??t,i.R&64&&(i=t);let a=n(r);K(e.U,a),On(a,e.H,i)}else e.D=!1;Z(e,t,i),e.h&&Xn(e),e.L||Zn(e)}function Xn(e){e.D=!1,e.P=e.B;let t=e.j;!e.P&&t.l&256&&D(t)!==T&&Ne(t)}function Zn(e){e.j!==null&&!(e.j.R&96)&&(L(e.j),M())}function Qn(e,t,n){if(t===0){if(Y.size)for(let t=qn(e);t;t=t._parent)!(t.F.get(e)?.m&(t.i|1))&&t.F.delete(e)&&!ar(t,0)&&t.L&&Zn(t);return!1}for(let r=qn(e);r;r=r._parent)if(!(r.i&t))r.L&&r.i>t&&Z(r,e);else{if(X(r))return Yn(r,e,n),!r.h||2;Z(r,e)}return!1}function $n(e){for(let t=qn(e);t;t=t._parent)if(t.i&1&&X(t))return t.h}function er(e,t){for(let t=qn(e);t;t=t._parent)if(t.L)return t;let n,r=e.o;if(t||e.l&16384)for(t||=/* @__PURE__ */ new Set,n=e.i!=1;r&&(n=t.size==t.add(r.u).size||er(r.u,t));)r=r.t;return n}function tr(e){let t=er(e);return t!==void 0&&((t.M??=/* @__PURE__ */ new Set).add(e),!0)}function nr(e){if(e.M!==null){for(let t of e.M){let e=t.i;I.enqueue(e===3?2:e,e===3?t.Z:t.W??=N.q.bind(null,t))}e.M=null}}function rr(e,t,n){if(!(n.m&3||t.m&2)){for(let n=qn(t);n&&n!==e;n=n._parent)if(n.i&1&&X(n))return!(n.j.l&256)}return!1}function ir(e,t,n){for(let r=e.C,i;r;r=r.G)if((i=r.S)===t||(n||=/* @__PURE__ */ new Set).size<n.add(i).size&&ir(i,t,n))return 1}function ar(e,t){let n=e.i|1;for(let[r,i]of e.F){if(!((r.R|i.R)&64)){if((r.m&n||i.m&n&&ir(r,i))&&!(n&2&&rr(e,r,i))||n&2&&i.l&2097152||r.l&32768&&r.R&8){if(t===0)break;continue}if((i!==e.K||e.h)&&(i.l&2304)==256){if(!t||!e.D)continue;k(D(i))}}e.F.delete(r)}return e.F.size}function or(){for(let e of Y){let t=e.j.R;if(t&64){Y.delete(e);continue}if(t&32)continue;if(!e.D){for(let[t]of e.F)for(let n of t.m&1?t.T?.se||[]:[t])if(!(n.l&256))for(let r=n.C;r;r=r.G){let i=r.S;i.l&256&&(n===t||!D(i).tt)&&Z(e,i)}}ar(e);let n=e.j;e.i&1&&!e.D&&n.l&256&&[...e.F].every(([,e])=>!(e.m&1)&&e.l&256&&D(e)===D(n))&&(e.F.clear(),e.D=!0),e.h=!1,e.F.size===0&&(Y.delete(e),e.L&&Zn(e))}}function sr(e){if(!e.D){e.L&&e.P===null&&e.B===null&&w!==null&&(e.B=w,Xn(e),Zn(e));return}e.h=!0,e.j.l&=-8388609;let t=w;t===null&&I.Y&&x().l&32768&&(k(null),t=N.J(T)),e.B=t,Y.add(e);let n=e.F.size;Me(e.H,T,t=>Z(e,t));for(let[t]of e.F)if(e.F.size!==n||t.m&1&&!(t.R&64)){for(let t=e._parent;t!==null;t=t._parent)if(t.i&1)for(let[n]of e.F)t.F.delete(n);Xn(e),Zn(e);return}}function cr(t,n,r,i){let a=se(),o={i:t,_parent:qn(a)??null,H:a,K:null,j:null,F:/* @__PURE__ */ new Map,D:t===2,h:!1,B:null,P:null,L:!1,M:null,v:null,$:!1,ee:!1,U:t===2?Xt(void 0,ur):null,ne:r,re:null};if(t===1&&a.A[Kn],x()&&ae(()=>{Y.delete(o)}),i){let t=!1;q(a,()=>W(()=>{try{i()}catch(t){if(!(t instanceof e)){if(!I.notify(x(),2,2,t))throw Be(t),t;return}}t?sr(o):t=!0})).l|=c}a.A={...a.A,[Gn]:o};let s=q(a,()=>{let e=W(n);return W(()=>Un(un(e)))});o.K=s;let u=W(()=>{let n=x();if(!o.h&&!(n.l&256)&&(n.l|=l),o.$&&(vt(s,n),o.$)){if(o.ee){o.L=!0;return}return lr(o)}let r=s.m&3;if(r!==0){if(vt(s,n),r&t){if(X(o))return Yn(o,s,void 0),lr(o);Z(o,s)}throw s.T.U}if(X(o)&&(o.F.size!==0&&n.m&4&&!(n.l&256)||ar(o,!0)!==0))return lr(o);let i;try{i=un(s)}catch(n){if(n instanceof e?t===1:t===2){if(X(o))return Yn(o,s,n),lr(o);Z(o,s)}throw n}if(X(o)&&o.F.size!==0)return lr(o);o.D=!0,o.L=!1;let a=o.re,c=()=>{!o.L&&o.re===a&&(a.m&2&&M(),h(a),o.re=null)};return a!==null&&(o.j.le===a.le?I.enqueue(1,c):c()),nr(o),i},{ae:!0});return u.l|=c,s.l|=l,o.j=u,J(u)}function lr(e){let t=x();e.P!==null&&(he(e.P),t.R|=131072,e.P=null),e.L=!0,e.re===null&&(e.re=q(t._parent,()=>W(()=>e.ne(e),{id:t.id,lazy:1})));let n=w,r=t.R,i=un(e.re);return he(n),t.R^=(t.R^r)&163840,i}const ur={ownedWrite:!0,ae:!0};function dr(e,t,n){return cr(1,e,()=>t(),n?.on)}pe(Qn,(e,t)=>!t&&(e.m&4?Qn(e,1):$n(e)),er,or,tr);function fr(e,t){let n=Symbol(t&&t.name||``);function r(e){return ce(()=>(yn(r,e.value),mr(()=>e.children)))}return r.id=n,r.defaultValue=e,r}function pr(e){return vn(e)}function mr(e){let t=jn(e,{lazy:!0}),n=jn(()=>Un(t()),{lazy:!0,sync:!0});return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}const hr={hydrating:!1,registry:void 0,done:!1},gr=(...e)=>jn(...e),_r=(...e)=>An(...e),vr=(...e)=>ce(...e),yr=(...e)=>Mn(...e),br=(e,t,n)=>dr(e,t,n);function xr(e,t,n,r){return Qt(()=>e(t||{}))}function Sr(e){let t=`fallback`in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=x(),r,i=()=>q(n,()=>Pn(()=>e.each,e.children,t));return hr.hydrating&&(r=i()),()=>(r??=i())()}function Cr(e){let t=`on`in e?{on:()=>e.on}:void 0;return br(()=>e.children,()=>e.fallback,t)}const wr=hr,Q=/*#__PURE__*/ Symbol(`slot`),Tr=/*#__PURE__*/ Symbol(`host`),Er={transparent:!0,sync:!0};function Dr(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:Er;yr(e,t,r)}function Or(e,t,n,r){let i=e.moveBefore&&e.isConnected&&document.activeElement;i===document.body&&(i=null);let a=r||e,o=(t,n)=>{i&&t.isConnected&&t.contains(i)?e.moveBefore(t,n):e.insertBefore(t,n),(r||t[Q])&&(t[Q]=a)};if(!t.length){for(let e of n)o(e,r);return}let s=t=>{if(!t)return!1;let n=t[Q];return t.parentNode===e&&(!n||n===a)},c=n.length,l=t.length,u=c,d=0,f=0,p=t[l-1],m=s(p)?p.nextSibling:r||null,h=null,g,_;for(;d<l||f<u;)if(t[d]===n[f])d++,f++;else{for(;l>d&&u>f&&t[l-1]===n[u-1];)l--,u--;if(l===d){let e=u;for(;e<c&&!s(n[e]);)e++;let t=e<c?n[e]:m;for(;f<u;)o(n[f++],t)}else if(u===f)for(;d<l;){let e=t[d++];h&&h.has(e)||!s(e)||e.remove()}else if((g=t[d])===n[u-1]&&n[f]===t[l-1]&&g.parentNode===e&&(!(_=g[Q])||_===a))do if(o(t[--l],g),f++,d>=l-1||f>=u)break;while(t[d]===n[u-1]&&n[f]===t[l-1]);else{if(!s(t[d])){d++;continue}if(!h){h=/* @__PURE__ */ new Map;let e=f;for(;e<u;)h.set(n[e],e++)}let c=h.get(t[d]);if(c!=null){if(f<c&&c<u){let s=d,p=1,m;for(;++s<l&&s<u&&(m=h.get(t[s]))!=null&&m===c+p;)p++;if(p>c-f){let e=t[d];for(;f<c;)o(n[f++],e)}else{let s=n[f++],c=t[d++];i&&e.contains(i)?o(s,c):e.replaceChild(s,c),(r||s[Q])&&(s[Q]=a)}}else d++}else t[d++].remove()}}}const kr=`_$SOLID_EVENT_OWNER`,Ar={},jr=/* @__PURE__ */ new Set,Mr=/* @__PURE__ */ new Map;function Nr(e,t,n,r={}){let i;Lr(t);try{vr(a=>{i=a,r.onError&&(x()[Re]=r.onError);let o=e();t===document?Dr(()=>Un(o),()=>{}):Jr(t,()=>o,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})},{id:r.renderId}),et()}catch(e){throw i&&i(),Rr(t),e}return()=>{i(),Rr(t),t.textContent=``}}function Pr(e,t,n){let r=document.createElement(`template`);r.innerHTML=e;let i=r.content.firstChild;return n===2?i.firstChild:i}function Fr(e,t){let n;return t===1?r=>document.importNode(n||=Pr(e,r,t),!0):r=>(n||=Pr(e,r,t)).cloneNode(!0)}function Ir(e){for(let t of e)jr.has(t)||(jr.add(t),Mr.forEach((e,n)=>Vr(t,n,e)))}function Lr(e){let t=zr(e,e);t&&(t.roots=(t.roots||0)+1)}function Rr(e){let t=Mr.get(e);t&&(t.roots>1?t.roots--:delete t.roots),Br(e,e)}function zr(e,t=e){if(!e||!t)return;let n=Mr.get(e);return n||Mr.set(e,n={owners:/* @__PURE__ */ new Map,handlers:/* @__PURE__ */ new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),jr.forEach(t=>Vr(t,e,n)),n}function Br(e,t=e){let n=Mr.get(e);if(!n)return;let r=n.owners.get(t);r>1?n.owners.set(t,r-1):n.owners.delete(t),n.owners.size||(n.handlers.forEach((t,n)=>e.removeEventListener(n,t)),Mr.delete(e))}function Vr(e,t,n){if(n.handlers.has(e))return;let r=e=>Zr(e,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}const Hr=e=>e._$host||e.parentNode||e.host;function Ur(e,t){let n=e,r=0;for(;n;){if(t.owners.has(n))return{owner:n,distance:r};r++,n=Hr(n)}}function Wr(e,t,n){if(Yr(e))return;let r=t===`multiple`&&e.localName===`select`;if(n==null||n===!1)e.removeAttribute(t);else if(e.setAttribute(t,n===!0?``:n),r&&!e._$multiple){let t=e.options;for(let e=0;e<t.length;e++)t[e].defaultSelected&&(t[e].selected=!0)}r&&(e._$multiple=!0)}function Gr(e,t){Array.isArray(e)?e.flat(1/0).forEach(e=>e&&e(t)):e(t)}function Kr(e,t){let n=Qt(e);q(null,()=>Gr(n,t))}const qr={scope:!0};function Jr(e,t,n,r,i){let a=n!==void 0,o=i&&i.host;if(a&&!r&&(r=[]),typeof t!=`function`&&(t=$r(t,r,a,!0),typeof t!=`function`)){Qr(e,t,r,n),o&&ei(t,o);return}if(a&&r.length===0){let t=document.createTextNode(``);e.insertBefore(t,n),r=[t]}let s=r,c=!1;Dr(()=>{let r=$r(t(),s,a,!0),l=c;return c=!0,typeof r==`function`?(Dr(()=>$r(r,s,a),t=>{s=Qr(e,t,s,n),o&&ei(s,o)},l&&!(i&&i.schedule)?{...i,schedule:!0}:i),Ar):r},t=>{t!==Ar&&(s=Qr(e,t,s,n),o&&ei(s,o))},t.$s?i?{...i,scope:!0}:qr:i)}function Yr(e){return!wr.hydrating||wr.isClaiming&&!wr.isClaiming()?!1:!e||e.isConnected?!0:Xr!==null&&Xr.claimed(e)}let Xr=null;function Zr(e,t,n){let r=e[kr],i;if(r){if(r===!0||r===t||!t.contains(r))return;i=r}let a=n.owners.size===1&&n.owners.has(t)?t:Ur(e.target,n)?.owner;if(!a||a===i)return;e[kr]=a;let o=i||e.target,s=`_$$`+e.type,c=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),l=()=>{let t=o[s];if(t&&!o.disabled){let n=o[`${s}Data`];if(n===void 0?typeof t==`function`?t.call(o,e):t.handleEvent(e):t.call(o,n,e),e.cancelBubble)return}return o.host&&typeof o.host!=`string`&&!o.host._$host&&o.contains(e.target)&&c(o.host),!0},u=()=>o===a||o.parentNode===a,d=()=>{for(;o&&l()&&!u();)o=Hr(o)};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return o||a}}),i)i===e.target&&(o=Hr(i)),o&&o!==a&&d();else if(e.composedPath){let t=e.composedPath();if(t.length){c(t[0]);for(let e=0;e<t.length&&(o=t[e],l());e++){if(o._$host){o=o._$host,d();break}if(u())break}}else d()}else d();delete e.target,delete e.currentTarget}function Qr(e,t,n,r){if(t===n)return t;let i=typeof t,a=r!==void 0;if(i===`string`||i===`number`){let r=typeof n;r===`string`||r===`number`?e.firstChild.data=t:ti(e,n)?e.textContent=t:(ni(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)ri(e,n,r);else if(t.nodeType)Array.isArray(n)?ri(e,n,a?r:null,t):n!=null&&n.nodeType?n.parentNode===e?e.replaceChild(t,n):e.appendChild(t):n!=null&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t),(r||t[Q])&&(t[Q]=r||e);else if(Array.isArray(t)){let i=Array.isArray(n);for(let e=0,r=t.length;e<r;e++){let r=t[e],a=typeof r;if(a===`string`||a===`number`){let a=i?n[e]:void 0;a&&a.nodeType===3?(a.data!==``+r&&(a.data=r),t[e]=a):t[e]=document.createTextNode(r)}}t.length===0?ri(e,n,r):i?Or(e,n,t,r):(n!=null&&ri(e,n),Or(e,[],t))}return t}function $r(e,t,n,r){return e=Un(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e==`function`||n&&!Array.isArray(e)&&(e=[e??``]),e}function ei(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)ei(e[n],t);else e&&e.nodeType&&e[Tr]!==t&&(e[Tr]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function ti(e,t){if(t==null)return!0;if(Array.isArray(t))return t.length?e.firstChild===t[0]&&e.lastChild===t[t.length-1]:e.firstChild===null;if(t===``)return e.firstChild===null;if(t.nodeType)return e.firstChild===t&&e.lastChild===t;let n=e.firstChild;return n!==null&&n.nodeType===3&&e.lastChild===n}function ni(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];r.parentNode===e&&r.remove()}else if(t.nodeType)t.parentNode===e&&t.remove();else{let t=e.firstChild;t&&t.nodeType===3&&t.remove()}}function ri(e,t,n,r){if(n===void 0)return ti(e,t)?e.textContent=``:ni(e,t);if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(r!==o){let t=o[Q],s=o.parentNode===e&&(!t||t===(n||e));r&&!i&&!a?s?e.replaceChild(r,o):e.insertBefore(r,n):s&&o.remove()}else i=!0}}else r&&e.insertBefore(r,n);r&&(n||r[Q])&&(r[Q]=n||e)}const ii=fr(),ai=()=>pr(ii);function oi(e){return(t,n,r)=>Nr(()=>{let t=e=>{let[t,n]=_r({v:e()});return Nn(()=>e.on(e=>n({v:e}))),()=>t().v},i=t(r.events),a=t(r.theme),o=t(r.listeners),s=t(r.forms),c=t(r.unread),l={page:r.page,events:i,last:e=>i().findLast(t=>t.type===e),append:r.append,theme:a,listeners:o,forms:s,unread:c,markdown:r.markdown};return xr(ii,{value:l,get children(){return xr(e,n)}})},t)}const si=[`border-bottom-width`,`border-left-width`,`border-right-width`,`border-top-width`,`box-sizing`,`font-family`,`font-size`,`font-style`,`font-weight`,`letter-spacing`,`line-height`,`padding-bottom`,`padding-left`,`padding-right`,`padding-top`,`tab-size`,`text-indent`,`text-rendering`,`text-transform`,`width`,`word-break`],ci={"min-height":`0`,"max-height":`none`,"min-width":`0`,"max-width":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`};function li(e){let t=getComputedStyle(e),n={};for(let e of si)n[e]=t.getPropertyValue(e);return n[`box-sizing`]?{style:n,padding:parseFloat(n[`padding-bottom`])+parseFloat(n[`padding-top`]),border:parseFloat(n[`border-bottom-width`])+parseFloat(n[`border-top-width`])}:null}let $=null;function ui(e,t,n,r){$||($=document.createElement(`textarea`),$.setAttribute(`tabindex`,`-1`),$.setAttribute(`aria-hidden`,`true`)),$.isConnected||document.body.append($);for(let[t,n]of Object.entries(e.style))$.style.setProperty(t,n);for(let[e,t]of Object.entries(ci))$.style.setProperty(e,t,`important`);let i=e.style[`box-sizing`]===`border-box`,a=t=>i?t+e.padding+e.border:t;$.value=t;let o=i?$.scrollHeight+e.border:$.scrollHeight-e.padding;$.value=`x`;let s=$.scrollHeight-e.padding;return Math.min(a(s*r),Math.max(a(s*n),o))}function di(e={}){let t,n=0,r=()=>{if(!t)return;let r=li(t);if(!r)return;let i=ui(r,t.value||t.placeholder||`x`,e.minRows??1,e.maxRows??1/0);i!==n&&(n=i,t.style.setProperty(`height`,`${i}px`,`important`))};return Nn(()=>{let e=t;if(!e)return;r(),e.addEventListener(`input`,r);let n=new ResizeObserver(()=>r());return n.observe(e),()=>{e.removeEventListener(`input`,r),n.disconnect()}}),e=>{t=e}}var fi=/* @__PURE__ */ Fr(`<div class=wb-chat><div class=wb-chat-new><textarea rows=1></textarea><button type=button>`),pi=/* @__PURE__ */ Fr(`<div class=wb-chat-message><span class=wb-chat-who>`),mi=/* @__PURE__ */ Fr(`<div class=wb-chat-bubble data-md>`),hi=/* @__PURE__ */ Fr(`<div class=wb-chat-bubble>`);const gi=`chat:message`;function _i(e,t){let n=new Set(t);return Object.entries(e.data).filter(([e,t])=>!n.has(e)&&typeof t==`string`&&t.trim()).map(([,e])=>String(e).trim()).join(`
1
+ var e=class extends Error{constructor(e){let t=Error,n=t.stackTraceLimit;n!==void 0&&(t.stackTraceLimit=0),super(),n!==void 0&&(t.stackTraceLimit=n),this.source=e}},t=class extends Error{constructor(e,t){try{var n=String(t instanceof Error?t.message:t)}catch{}super(n,{cause:t}),this.source=e}};function n(e){return e instanceof t?e.cause:e}var r=class extends Error{constructor(){super(``)}},i=class extends Error{constructor(){super(``)}};const a=4096,o=1<<22,s=1<<21,c=16384,l=1<<23,u={},d={},f=Symbol(`refresh`),p=Set;function m(e){let t=e.pe;for(;t;)t.R|=32,m(t),t=t.Ge}function h(e){e.l&=-33,ht(e)}let g;function _(e){try{e()}catch(e){g||=[e],M()}}function v(e){let t=g;if(g=void 0,t&&!e)throw t[0]}function y(e,t=!1,n){let r=e.R;if(r&64)return;t&&(n||e.T===null||e.T.me===null&&e.T.Le===null||y(e,!1,!0),e.R=r|64,e.X&&(xt(e),(e.m&1&&e.T?.Re!=null||r&2048||F.length)&&M()));let i=n?e.T.me:e.pe;for(n?e.T.me=null:e.pe=null;i;){let e=i;e.l&=-33,R(e,A),ft(e),i.Me=i,y(i,!0),i=i.Ge}if(n||(e.be=0),t&&!n&&!(r&32)&&e._parent!==null&&!(e._parent.R&64)){let t=e.Me,n=e.Ge;t===null?e._parent.pe=n:t.Ge=n,n!==null&&(n.Me=t),e.Me=null}if(ee(e,n),t&&e.ze){let t=e.ze;e.ze=void 0,_(t)}}function b(e,t){let n=e.pe;t.Me=null,t.Ge=n,n!==null&&(n.Me=t),e.pe=t}function ee(e,t){let n=t?e.T.Le:e.ke;if(n){if(t?e.T.Le=null:e.ke=null,Array.isArray(n))for(let e=n.length-1;e>=0;e--)_(n[e]);else _(n)}}function te(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return ie(n.id,t?n.be++:n.be);throw Error()}function ne(e){return te(e,!0)}function re(e,t,n){return e?.id??(t?n?.id:n?.id==null?void 0:ne(n))}function ie(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):``)+n}function x(){return H}function ae(e,t=H){return t&&(t.ke?Array.isArray(t.ke)?t.ke.push(e):t.ke=[t.ke,e]:t.ke=e),e}function oe(e=!0){y(this,e),g&&!I.Y&&v()}function se(e){let t=H,n=e?.transparent??!1,r={id:re(e,n,t),l:n?4:0,R:0,Qe:!0,Ke:t?.Qe?t.Ke:t,pe:null,Ge:null,Me:null,ke:null,A:t?.A||d,be:0,T:null,_parent:t,dispose:oe};return t&&b(t,r),r}function ce(e,t){let n=se(t);return q(n,()=>e(oe.bind(n,!0)))}let le=null,S=null,ue=null,de=null,fe=null;function pe(e,t,n,r,i){le=e,S=t,ue=n,de=r,fe=i}const C=[];function me(e,t=null){let n={ln:[],rn:[[],[]],fn:[],eo:null,_parent:t,P:e,Pe:null,tt:0,nt:!1,nn:null,Ue:!1,un:!1,I:null};return e||C.push(n),n}let w=null;function he(e){w=e}let T=null,E=null;function ge(e,t){if(I.Y&&!t||T!==null)return k(e);E===null?E=O(e):ve(O(e),E),M()}function D(e){return e.T.Re=O(e.T.Re)}function _e(e){return e=O(e),C.indexOf(e)===-1?null:e}function O(e){for(;e.eo!==null;)e=e.eo;return e}function k(e){let t=T;t===null?T=e===null?me(!1):O(e):e!==null&&ve(O(e),t),I.Y||M()}function ve(e,t){e=O(e),t=O(t),e===t||e.P||t.P||(e.eo=t,t.tt+=e.tt,t.nt||=e.nt,P(t.ln,e.ln),P(t.rn[0],e.rn[0]),P(t.rn[1],e.rn[1]),P(t.fn,e.fn),e.I!==null&&P(t.I??=[],e.I),C.splice(C.indexOf(e),1))}function ye(e){let t=be;be??=e;let n=e.tt!==0||Se(e.ln,e)||!1;return be=t,n}let be=null;function xe(e,t){let n=e.T?.se;if(n===void 0)return!0;for(let e of n){let n=e.T?.Re;if(n==null||O(n)===t)return!0}return!1}function Se(e,t,n=!1){for(let r=0;r<e.length;r++){let i=e[r];if(!(!(i.m&1)||i.R&64||i.l&8192||i.T.Re!==null&&D(i)!==t||n&&!xe(i,t))){if(i.i===1){if(Ce(i,be??t))return!0}else for(let e=i.o;e!==null;e=e.t){let n=e.u;if((n.i===1&&n.m&1||n.R&2048||n.l&16384&&n.m===1)&&(e.Ne===n.de||n.T?.U!=null)&&!(n.R&64)&&Ce(n,be??t))return!0}}}return!1}function Ce(e,t){return!(e.R&32&&we(e,t))&&!ue?.(e)}function we(e,t){let n=e;for(;n?.R&32;)n=n._parent;return n?.l&256&&n.T?.Re!=null&&D(n)===O(t)}const Te=[];function Ee(e){Te.push(e)}const De=[];function Oe(e){R(e,A),e.R&=-4,De.push(e)}function ke(e,t){e.l|=256,Ae(e,t)}function Ae(e,t){let n=G(e);n.Re!==t&&(n.Re=t,t.ln.push(e))}function je(e,t){for(let n=e.pe;n!==null;n=n.Ge)n.T?.Re?.P||(n.X!==void 0&&(n.l&256||ke(n,t),n.l|=1048576),je(n,t))}function Me(e,t,n){for(let r=e.pe;r!==null;r=r.Ge)(r.l&2304)==256&&D(r)!==t&&n(r),Me(r,t,n)}function Ne(e){e.T.Re=null,e.l&=-257}const A={et:Array(2e3).fill(void 0),p:!1,Fe:0,Et:0};let j=0,Pe=!1,Fe=!1,Ie=!1,Le=0;function M(){Fe?Ve():Pe||(Pe=!0,!Le&&!I.Y&&queueMicrotask(et))}const Re=Symbol.for(`solid-js/root-error-hook`),ze=`[REACTIVITY_HALTED]`;function Be(e){if(Fe)return;Fe=!0,v(!0);let t=ze,n=e!==void 0&&globalThis.reportError;n||e===void 0?console.error(t):console.error(t,e),n&&n(e)}function Ve(){Ie||(Ie=!0,console.error(ze))}var N=class e{rn=[[],[]];Y=!1;flush(){if(!this.Y){this.Y=!0,cn(),w=null,E=null;try{_t(),st(A,e._e),this.settle(),j++,Pe=A.Et>=A.Fe||F.length!==0,this.run(1),this.run(2)}finally{this.Y=!1,E=null}}}settle(){let e=T;T=null;let t=e!==null&&!e.P?O(e):null;if(t!==null){let e=F.length;for(let n=0;n<e;n++){let e=F[n];if(!(e.l&2304)&&(e.T===null||e.T.Re===null||!e.T.Re.P)){if(e.ue===u&&e.m&4&&e.i!==1)continue;if(e.ue!==u&&!(e.m&5)&&e.T?.me==null&&e.T?.Le==null&&hn(e,e.le,e.ue)){e.ue=u,e.l&=-129;continue}ke(e,t)}e.l&128&&je(e,t)}F.length=0,De.splice(0)}else{$e();for(let e=0;e<Te.length;e++){let t=Te[e];t.T?.U==null&&!t.Ae&&dt(t)}}Te.length&&=0;let n=this.rn;this.rn=[[],[]];for(let e=C.length-1;e>=0;e--){let t=C[e];ye(t)||(C.splice(e,1),Ue(t),e=C.length)}let r=t&&_e(t),i=r!==null;for(let e=0;e<2;e++)i&&P(r.rn[e],n[e]),this.rn[e]=i||this.rn[e].length?[].concat(i?[]:n[e],this.rn[e]):n[e];if(De.length!==0){let e=De.splice(0).sort((e,t)=>e.he-t.he);for(let t=0;t<e.length;t++)e[t].R&64||U(e[t])}de?.()}run(e){let t=this.rn[e-1];t.length&&(this.rn[e-1]=[],tt(t,e))}enqueue(e,t,n=w){e&&(n?.P?n:this).rn[e-1].push(t),M()}notify(e,t,n,r){return le?.(e,n&t,r)?!0:t&1?(n&1&&w===null&&k(null),!0):!1}};function He(e){let t;for(let n=0;n<e.fn.length;n++){let r=e.fn[n],i=r.T?.U?.source;if(!(r.R&64||r.m&2&&(r.i||!(r.l&8388608))&&i!==r&&(i?.m??2)&2)&&r.R&2048){t||=r.i||i===r||r.l&256,e.P||(r.R&=-2049),r.Ae=!1;for(let e=r.pe;e!==null;e=e.Ge)e.i&&(e.Ae=!1);L(r)}}return e.fn.length=0,t}function Ue(e){let t=He(e);for(let t=0;t<e.ln.length;t++){let n=e.ln[t];n.T.Re!==null&&D(n)===e&&(n.T.Re=null,Qe(n))}T===e&&(T=null),t?I.rn[1].push(()=>We(e)):We(e)}function We(e){for(let t=0;t<2;t++)P(I.rn[t],e.rn[t]),e.rn[t]=[]}function P(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}const F=[];function Ge(e,t){e.R&2048||(e.R|=2048,t.fn.push(e))}function Ke(e){F.push(e),I.Y||nn()}let qe=0;function Je(){qe++}function Ye(e){e.we=qe;let t=!!(e.l&512)&&e.T?.De!==void 0;for(let n=e.o;n!==null;n=n.t){let e=n.u;e.R&4&&n.Ne===e.de&&n!==e._&&(e.R|=a),t&&e.l&8?e.R|=256:L(e)}}function Xe(e){e.Ae=!0,I.enqueue(e.i,e.W??=N.q.bind(null,e))}function Ze(e){return e.ue!==u&&(e.le=e.ue,e.ue=u)}function Qe(e){let t=e;if(!t.X){e.l&=-385,Ze(e);return}let n=e.ue===u&&!!(t.m&1),r=e.l&s;if(!n&&t.T&&(t.T.Te=null),e.l=n?e.l&-1048833|1024:e.l&-3147137,r){let n=e.ue;e.ue=u,e.ie=j+1,It(t,2,n)}else Ze(e)&&(t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=u),e.i&&e.i!==3&&Xe(e));t.Ie=!1,t.R&=-1025,t.T?.U??dt(t),t.m&1||(t.m&=-5),n||t.T==null||t.T.me===null&&t.T.Le===null||N.Ce(t,!1,!0)}function $e(){for(let e=0;e<F.length;e++){let t=F[e];t.l&2304||Qe(t)}F.length=0}const I=new N;function et(e){if(e){Le++;try{return e()}finally{try{et()}finally{Le--}}}if(!I.Y&&!Fe){for(;Pe;)I.flush();v()}}function tt(e,t){for(let n=0;n<e.length;n++)e[n](t)}function L(e){A.Fe>e.he&&(A.Fe=e.he),rt(e,A)}function nt(e,t){let n=(e._parent?.Qe?e._parent.Ke?.he:e._parent?.he)??-1;n>=e.he&&(e.he=n+1);let r=e.he,i=t.et[r];if(i===void 0)t.et[r]=e;else{let t=i.We;t.ve=e,e.We=t,i.We=e}r>t.Et&&(t.Et=r)}function rt(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|10:(e.R=n|8,t.p&&ot(e)),n&16||nt(e,t))}function it(e,t){let n=e.R;n&28||(e.R=n|16,nt(e,t))}function R(e,t){let n=e.R;if(!(n&24))return;e.R=n&-25;let r=e.he;if(e.We===e)t.et[r]=void 0;else{let n=e.ve,i=t.et[r],a=n??i;e===i?t.et[r]=n:e.We.ve=n,a.We=e.We}e.We=e,e.ve=void 0}function at(e){if(!e.p){e.p=!0;for(let t=0;t<=e.Et;t++)for(let n=e.et[t];n!==void 0;n=n.ve)n.R&8&&ot(n)}}function ot(e,t=2){let n=e.R;if(!((n&3)>=t)){e.R=n&-4|t;for(let t=e.o;t!==null;t=t.t)ot(t.u,1)}}function st(e,t){for(e.p=!1,e.Fe=0;e.Fe<=e.Et;e.Fe++){let n=e.et[e.Fe];for(;n!==void 0;)n.R&8?t(n):ct(n,e),n=e.et[e.Fe]}e.Et=0}function ct(e,t){R(e,t);let n=e.he;for(let t=e.C;t;t=t.G){let e=t.S;e.X&&e.he>=n&&(n=e.he+1)}if(e.he!==n){e.he=n;for(let n=e.o;n!==null;n=n.t)it(n.u,t)}}let lt;function ut(e){let t=e.S,n=e.G,r=e.t,i=e.en;if(r===null?t.Ze=i:r.en=i,i!==null)i.t=r;else if(t.o=r,r===null){t.l&4096?lt(t):t.T?.Ye&&_(t.T.Ye);let e=t;e.X&&e.l&32&&!(e.R&32)&&!(e.m&1)&&(pt?pt.push(e):ht(e))}return n}function dt(e){let t=e._,n=t===null?e.C:t.G;if(n!==null){do n=ut(n);while(n!==null);t===null?e.C=null:t.G=null}}function ft(e){e.C&&(e._=null,dt(e))}let pt=null;const mt=e=>pt=e;function ht(e){R(e,A),ft(e),y(e,!0)}const gt=new p;function _t(){if(gt.size!==0){for(let e of gt)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&ht(e);gt.clear()}}function vt(e,t){let n=t._;if(n!==null&&n.S===e)return;let r=null,i=t.R&4;if(i&&(r=n===null?t.C:n.G,r!==null&&r.S===e)){r.Ne=t.de,t._=r;return}let a=e.Ze;if(a!==null&&a.u===t&&(!i||a.Ne===t.de))return;let o=t._=e.Ze={S:e,u:t,G:r,en:a,t:null,Ne:t.de};n===null?t.C=o:n.G=o,a===null?e.o=o:a.t=o,Je()}function yt(e,t){return!e.T?.se?.has(t)&&((G(e).se??=new p).add(t),!0)}function bt(e,t){let n=e.T?.se;return n?.delete(t)?(n.size||(e.T.se=void 0),!0):!1}function xt(e){e.T!==null&&(e.T.Ee=null)}function St(e){e.T!==null&&(e.T.se=void 0)}function Ct(e,t){for(let n=e.C;n;n=n.G){let e=n.S;if(e===t||e.T?.se?.has(t))return!0}return!1}function wt(e,t){G(e).fe=!0,t.source&&yt(e,t.source),e.m&2||z(e,t.source,t)}function z(t,n,r){if(!n){t.T!==null&&(t.T.U=null);return}let i=r instanceof e&&r.source===n?r:t.T?.U;G(t).U=i instanceof e&&i.source===n?i:new e(n)}function Tt(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function Et(e,t){let n=new p,r=e=>{let i=n.has(e);t(e,i)!==!1&&!i&&(n.add(e),Tt(e,r))};Tt(e,r)}function Dt(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&(e.R&8?e.R|=o:ht(e))}function Ot(e){let t;if(Et(e,(e,n)=>{!n&&!e.o&&e.l&32&&(t??=[]).push(e)}),t)for(let e of t)Dt(e)}function kt(e,n,r){return!(e.l&256||r&&e.R&16384&&I.Y&&!e.rr)||w?!1:(St(e),e.T&&(e.T.fe=!1),(e.m&=6)&2||z(e),e.ue=n instanceof t?n:new t(e,n),e.l|=2097280,B(e),M(),!0)}function At(e,t){let n=!1;Et(e,(e,r)=>{!r&&e.T?.U===t&&(L(e),n=!0)}),n&&M()}function B(e,t=e){bt(e,t);let n=!1,r;if(Et(e,(i,a)=>{if(a||t!==e&&Ct(i,t)||!bt(i,t))return!1;i.ie=j;let o=i.T?.se?.values().next().value,s=i.m&2;o?s||z(i,o):(i.m&=-2,s||z(i),i.l&256&&k(D(i)),i.T?.fe&&(L(i),n=!0),i.T!==null&&(i.T.fe=!1),!i.o&&i.l&32&&(r??=[]).push(i))}),r)for(let e of r)Dt(e);n&&M()}function jt(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function Mt(e){let t=e.T?.Se;t!=null&&(e.T.Se=null,t())}function Nt(t,n,r,i){let a=!1,o=!1;if(typeof n==`object`&&n&&Qt(()=>{a=n[Symbol.asyncIterator],o=!a&&jt(n)}),!o&&!a)return t.T!==null&&(t.T.Ee=null),t.Ie=!1,n;G(t).Ee=n,t.T.ce=2147483647,t.T.se=void 0;let s,c=r=>{if(t.T?.Ee!==n)return;let a=r instanceof e;a&&t.Ie?(xt(t),wt(t,r),t.ie=j):((a||!kt(t,r))&&(It(t,a?1:2,r),a||y(t,!1,!0)),a&&B(t),t.ie=j,a||Ot(t),i?.(r,a))},l=(e,i)=>{if(t.T?.Ee!==n||t.R&2)return;let a=t.m&4;if(Ft(t),r){try{r(e)}catch(e){c(e);return}t.l&256||(t.T.Te=null,t.l&=-1025),a&&Ft(t,!0)}else K(t,()=>e);t.ue===u&&(t.Ie=!1,dt(t)),B(t),M(),et(),i?.()},d=()=>t.l&32&&!t.o&&!(t.m&1)?(ht(t),!0):!1,f=(e,r)=>{let i=e[Symbol.asyncIterator](),a=!1,o=!1,u=!r,f=()=>{if(!o){o=!0;try{let e=i.return?.();jt(e)&&e.then(void 0,()=>{})}catch{}}};ae(f,r),G(t).Se=f;let p=()=>{try{d()||m()}catch(e){c(e)}},m=()=>{let e,r,f=!1,h=!1,g=!0,_=i.next();if((jt(_)?_:{then:e=>void e(_)}).then(r=>{if(g&&u)e=r,f=!0,r.done&&(o=!0);else if(t.T?.Ee!==n)return;else r.done?(o=!0,a?(M(),et()):l(void 0),d()):(a=!0,l(r.value,p))},e=>{g&&u?(r=e,h=!0):t.T?.Ee===n&&(o=!0,c(e),d())}),g=!1,h){if(o=!0,c(r),u)throw r;return!0}return f&&!e.done?(s=e.value,a=!0,m()):f&&e.done},h=m();return u=!1,a||h},p=null,m=(e,t)=>{let n=!1;if(typeof e==`object`&&e&&Qt(()=>{n=e[Symbol.asyncIterator]}),!n)return!1;s=void 0;let r=f(e,t);return t||(p=r),!0};if(o){let e=!1,r=!1,i,a=!0;if(n.then(r=>{if(a)s=r,e=!0;else{try{if(t.T?.Ee===n&&!(t.R&64)&&m(r,t))return;l(r)}catch(e){c(e)}d()}},e=>{a?(i=e,r=!0):(c(e),d())}),a=!1,r)throw c(i),i;e?m(s)||(t.Ie=!1):p=!1}if(a&&m(n),p!==null){if(!p){if(t.Ie)return t.le;throw new e(H)}t.Ie=!1}return s}function Pt(e,t=!1){e.T?.se&&St(e),e.T?.fe&&(e.T.fe=!1),e.m=t?0:e.m&4,e.T?.U&&z(e);let n=qt(e);n&&n.call(e)}function Ft(e,t=!1){let n=e.T?.se;n&&(n.delete(e),n.size)?(e.T.fe=!1,t&&(e.m=1),z(e,n.values().next().value)):Pt(e,t)}function It(n,r,i){r===2&&!(i instanceof t)&&!(i instanceof e)&&(i=new t(n,i));let a=r===1&&i instanceof e&&i.source;a?(n.m&2&&(n.T.Te=n.T.U),yt(n,a)):St(n),n.m=r|(r===2?n.m&12?8:0:r===1&&n.m&8?4:n.m&4),a?z(n,a,i):G(n).U=i;let o=qt(n);o?o.call(n):Lt(n,r,i)}function Lt(t,n,r){let i=n===1&&r instanceof e&&r.source;Tt(t,(e,a)=>{e.ie=j,e.l&16384||n===1&&a.Ne!==e.de?(n!==1&&bt(e,t),L(e),M()):i&&e.T?.se?.has(i)?w===null&&(e.l&2304)==256&&I.Y&&!S?.(e,i.ie===j)&&k(D(e)):(i||n!==1&&(e.T?.U!==r||e.T?.se))&&(Ke(e),n===1&&(e.l&2304)==256&&!e.i&&k(D(e)),It(e,n,r),e.rr?.st(n,r))})}N._e=e=>{e.i===3?(R(e,A),e.Ae=!0,I.enqueue(2,e.Z)):e.R&32&&!(e.R&65536)?Oe(e):U(e)},N.Ce=y;let V=!1,H=null;function U(t,n=!1){Je();let r=t.i,i,c=t.l&s;if(!n){if(R(t,A),t.T!==null&&(t.T.Ee=null,Mt(t)),t.l&256){let e=D(t);e.P||t.l&524288||(t.l&8421376?e!==T&&!(t.m&4||t.l&1048576)&&(t.ue!==u&&Ye(t),t.ue=u,t.l&=-257):ge(e,S?.(t,t.m&4)))}if(r===3||t.l&128){let e=pt;mt(i=[]),y(t),mt(e)}else(t.pe!==null||t.ke!==null)&&Ut(t);t.l&2097152&&(t.ue=u,t.l^=s)}let l=t.m&4,d=t.m&2&&t.T?.U,f=!!(t.m&1)&&t.T?.se,p=t.T?.se?.has(t),m=!1,h=!!(t.R&8192)&&!(t.m&1&&t.T!==null&&!t.T.Ve),g=H;H=t,t._=null,t.de++;let _=t.R&o;t.R=4|t.R&8224,t.ie=j;let v=t.ue===u?t.l&2048&&t.T.P!==u?t.T.P:t.le:t.ue,b=t.he,ee=!1,te=!1,ne=V;V=!0;try{if(t.l&64)v=t.X(v),t.T!==null&&(t.T.Ee=null),t.Ie=!1;else{let e=t.T?.Ee,n=t.X(v),r=typeof n==`object`&&!!n,i=t.T?.Ee!==e;v=i||!r?n:Nt(t,n),!i&&!r&&(t.T!==null&&(t.T.Ee=null),t.Ie=!1)}(t.m!==0||t.T!==null)&&Pt(t,n)}catch(n){let r=n instanceof e;if(r&&t.Ie)wt(t,n);else if((r||!(m=kt(t,n,!0)))&&(r&&(G(t).fe=!0),It(t,r?1:2,n),r&&p&&!t.T?.Ee&&B(t)),(r||m)&&f)for(let e of f)e!==t&&!(t.T?.se?.has(e)&&(e.m&1||Ct(t,e)))&&B(t,e)}finally{if(V=ne,ee=!!(t.R&a),te=!!(t.R&128),t.R=t.R&936032|(n?t.R&256:0),H=g,i)for(let e of i)Dt(e);t.T!==null&&(t.T.Ve=h&&!!(t.m&1))}if(t.R&64){ft(t),xt(t);return}let re=!!t.T?.U||m;if(!re){let e=t.ue===u,i=e?t.l&2048&&t.T.P!==u?t.T.P:t.le:t.ue,a=e&&l&&!r||!!t.T?.Te||!!c||!hn(t,i,v);if(r&&a&&!(t.R&262144&&!t.Ae&&Object.is(t.ge,v))&&e&&(t.Ae=!t.T?.U,n||I.enqueue(r,t.W??=N.q.bind(null,t),null)),!re){if(a)(n?!((T!==null||E!==null)&&(te||Ht(g)?.R&128)):r&&t.ue===u)?t.le=v:(t.ue=v,d&&(t.T.Te=d),n&&(ke(t,T??E),t.m|=4,S?.(t,T))),t.o!==null&&Ye(t);else if(t.he!=b)for(let e=t.o;e!==null;e=e.t)it(e.u,A)}if(!a&&!t.T?.U&&(d&&At(t,d),f))for(let e of f)e!==t&&B(t,e);p&&!(t.m&5)&&B(t)}if(n&&te&&t.m&1){let e=T??E;e&&!e.P&&(r&&S?.(t)===2||ke(t,e))}!t.T?.U&&t.ue===u&&!(r&&t.Ae)&&(n||r===3?dt(t):Ee(t)),(t.ue!==u||t.T!==null&&(t.T.me!==null||t.T.Le!==null)||t.m&5&&(!n||t.m&1))&&(t.l|=128,Ke(t)),ee&&(L(t),M()),_&&Dt(t)}function Rt(e){if(!(e.R&68)){if(e.R&1)for(let t=e.C;t;t=t.G){let n=t.S;if(n.X&&Rt(n),e.R&2)break}(e.R&2||e.T?.U&&e.ie<j&&!e.T?.Ee)&&U(e),e.R&=937336}}function W(e,t){let n=t?.transparent??!1,r=typeof t==`object`&&!!t&&`loadingValue`in t,i={id:re(t,n,H),l:(n?4:0)|!!t?.ownedWrite|(!H||t?.lazy?32:0)|(t?.sync?64:0)|(t?.ae?2:0)|(t?.xe??0),ye:t?.equals??Zt,ke:null,A:H?.A??d,be:0,X:e,le:r?t.loadingValue:void 0,he:0,ve:void 0,We:null,C:null,_:null,de:0,o:null,Ze:null,_parent:H,Ge:null,Me:null,pe:null,R:t?.lazy?512:0,m:r?0:4,ie:j,ue:u,we:-1,Ie:r,T:null};return t?.unobserved&&(G(i).Ye=t.unobserved),Yt(i,t),i}function G(e){return e.T??={Ee:null,Se:null,U:void 0,fe:void 0,se:void 0,Ye:void 0,De:void 0,me:null,Le:null,Re:null,Ve:!1,je:u,Be:-1,ce:0,P:u,I:0,Te:null}}function zt(e,t){e.R|=128,(t.m&4||e.i!==1)&&ge(D(t),!e.i&&e.m&4||S?.(e))}function Bt(e,t){if(!(!(e.l&1<<23)||t.l&1024)){let n=D(t);if(!(n===T||Vt(e,n)))return Ge(e,n),!0}return zt(e,t),!1}function Vt(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&D(e)===t}function Ht(e){return e!==null&&e.Qe?e.Ke:e}function Ut(e){m(e);let t=G(e);t.Le=e.ke,t.me=e.pe,e.ke=null,e.pe=null,e.be=0}function Wt(e,t,n,r,i){let a=i?.transparent??!1,o={id:re(i,a,H),l:r<<23|(a?4:0)|!!i?.ownedWrite|(i?.sync?64:0)|(i?.xe??0),ye:!1,ke:null,A:H?.A??d,be:0,X:e,le:void 0,he:0,ve:void 0,We:null,C:null,_:null,de:0,o:null,Ze:null,_parent:H,Ge:null,Me:null,pe:null,R:512,m:4,ie:j,ue:u,we:-1,Ie:!1,Ae:!1,ge:void 0,qe:t,Je:n,ze:void 0,i:r,T:null};return i?.unobserved&&(G(o).Ye=i.unobserved),Yt(o,Jt),o}let Gt=null;function Kt(e){Gt=e}function qt(e){return e.i?Gt:null}const Jt={lazy:!0};function Yt(e,t){e.We=e;let n=H?.Qe?H.Ke:H;H&&b(H,e),n&&(e.he=n.he+1),!t?.lazy&&U(e,!0)}function Xt(e,t){let n={ye:t?.equals??Zt,l:+!!t?.ownedWrite|(t?.ae?2:0),le:e,o:null,Ze:null,ie:j,ue:u,we:-1,T:null};return t?.unobserved&&(G(n).Ye=t.unobserved),n}function Zt(e,t){return e===t}function Qt(e,t){let n=V;V=!1;try{return e()}finally{V=n}}function $t(e,t){if(e.R&512)e.R&=-513,U(e,!0);else if(e.R&64&&e.l&32){let t=e._parent;if(t!==null){if(t.R&64){e.l&=-33;return}e.R&32||b(t,e)}U(e,!0)}}function en(e,t){return!t||e.ue===u||t.l&16}let tn=!1;function nn(){tn=!0}function rn(e){return I.Y||e.ue===u||e.l&4194304?u:e.l&256?e.T.Be===j?e.T.je:u:e.le}function an(e){let t=e.T;t.Be!==j&&(t.je=e.ue,t.Be=j,tn=!0)}const on=[];function sn(e){return e.R|=a,!0}function cn(){if(tn=!1,on.length!==0){for(let e of on)e.l&=-4194305;on.length=0}}function ln(e,t){e.he>=A.Fe?(ot(t),at(A),Rt(e)):t.l&65536&&Rt(e);let n=e.he;n>=t.he&&e._parent!==t&&(t.he=n+1)}function un(e){let t=H;t?.Qe&&(t=t.Ke);let n=e,r=e;if(typeof n.X==`function`&&$t(e),!n.X&&e.T?.De===void 0&&(!tn||e.ue===u)&&!(e.l&2048))return t&&(V&&vt(e,t),e.l&256&&!(t.l&16)&&Bt(t,e))||!t||e.ue===u||t.l&16||e.ue===e.le&&Object.is(e.ue,e.le)?e.le:(pn(t),e.ue);let i=!1;if(t&&(V&&(vt(e,t),r.X&&ln(r,t)),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4?zt(t,e):i=Bt(t,e))),r.m&1&&!i){if(t){if(!(t.l&16)||r.m&4)throw!V&&e!==t&&vt(e,t),r.T?.U}else if(r.m&4)throw r.T?.U}if(r.X&&r.m&2){if(V&&r.ie<j)return U(r),un(e);throw!i&&e.l&2097152&&fn(e,t),r.T?.U}(i||!t)&&dn(e);let a=fn(e,i?null:t);return!t&&typeof n.X==`function`&&e.l&32&&!(r.m&1)&&!e.o&&(gt.add(e),M()),a}function dn(e){if(e.T?.Te)throw e.T.Te}function fn(t,n){if(t.ue!==u&&t.m&4&&(!n||n.l&16))throw new e(null);let r=n&&tn?rn(t):u;if(r!==u)return sn(n),r;if(en(t,n))return t.le;if(pn(n,t),t.l&2097152)throw t.ue;return t.ue}function pn(e,t){t?.m&4||(e.R|=16384)}function mn(e){I.Y||e.l&4194304||(e.l|=4194304,on.push(e))}function hn(t,n,r){if(t.ye===Zt)return n===r;try{return t.ye&&t.ye(n,r)}catch(n){if(!(n instanceof e))return It(t,2,n),!0}}function K(e,t){let n=e.ue===u?e.le:e.ue;if(typeof t==`function`&&(t=t(n)),e.l&256&&k(D(e)),!(e.m&4||e.T?.Te||!hn(e,n,t)))return t;let r=e.ue!==u;return r?e.l&256&&!I.Y&&an(e):Ke(e),e.ue=t,H!==null&&mn(e),e.X!==void 0&&(e.ie=j),r&&e.we===qe||(Ye(e),M()),t}function gn(e,t){let n=e.l&256&&!(e.R&1024)&&D(e)!==T;if(n&&typeof t==`function`){let n=t(e.le);t=()=>n}return e.m&2&&(e.T.Te=e.T.U,It(e,0)),t=K(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,rt(e,A),M()):e.ue!==u&&(e.R|=1024),t}function q(e,t){let n=H,r=V;H=e,V=!1;try{return t()}finally{H=n,V=r}}function _n(e,t=!0){try{return e()}finally{}}function vn(e,t=x()){let n;if(t&&(n=t.A[e.id]),n===void 0&&(n=e.defaultValue),n===void 0)throw new i;return n}function yn(e,t,n=x()){if(!n)throw new r;n.A={...n.A,[e.id]:t===void 0?e.defaultValue:t}}function bn(e,t,n,r){let i=Wt(e,t,n,r?.user?2:1,r);U(i,!0),r?.defer?Ze(i):i.ue===u&&(i.T?.Re?.P||i.i===2||r?.schedule?I.enqueue(i.i,Cn.bind(null,i),i.T?.Re):Cn(i,0))}function xn(){let e=this.m,t=this.T?.U;if(e&2){if(I.notify(this,1,0),this.i===2){this.m&2&&Xe(this);return}Sn(this,n(t))}else this.i===1&&I.notify(this,3,e,t)}function Sn(e,t,n){if(!I.notify(e,2,2))throw Be(t),t}function Cn(e,r){if(!e.Ae||e.R&64||r&&fe?.(e))return;if(e.m&2&&e.i===2){let t=n(e.T?.U);e.ge=e.le,e.Ae=!1;try{e.Je?e.Je(t,()=>{let t=e.ze;e.ze=void 0,t?.()}):console.error(t)}catch(t){Sn(e,t)}return}let i=e.T?.U==null,a=e.ze;e.ze=void 0;try{a?.(),e.ze=e.qe(e.le,e.ge)}catch(n){G(e).U=new t(e,n),e.m|=2,Sn(e,n)}finally{e.ge=e.le,e.Ae=!1,i&&dt(e)}}N.q=Cn;function wn(e,t){let n=!1,r,i=()=>{if(!a.Ae||a.R&64||fe?.(a))return;let e=qe;n=!1;try{a.Ae=!1,U(a)}finally{}for(let t=a.C;t!==null;t=t.G){let o=t.S;if(o.ue!==u&&!(o.l&2048)&&(o.ue!==o.le||!Object.is(o.ue,o.le))){if(o.l&256)n||(n=!0,D(o).rn[1].push(r||=()=>{n&&(a.Ae=!0,i())}));else if(o.we<=e||o.X){L(a),M();break}}}},a=W(()=>{let t=a.ze;a.ze=void 0,t?.();let n=_n(e);a.ze=n},{...t,lazy:!0});a.ze=void 0,a.l=a.l&-33|16,a.Ae=!0,a.i=3,a.Z=i,L(a),M()}Kt(xn);const Tn=/* @__PURE__ */ new WeakSet;function En(e){for(let t=e;t;t=t._parent){let e=t[Re];if(e!==void 0)return e}}function Dn(e){let t=[];for(let n=e;n;n=n._parent){let e=n._name;typeof e==`string`&&e.length&&t.push(e)}return t.length?t.reverse():void 0}function On(e,t,n){if(e!==null&&(typeof e==`object`||typeof e==`function`)){if(Tn.has(e))return;Tn.add(e)}let r=En(t);if(r===void 0)return;let i={},a=Dn(t),o=Dn(n)??a;o!==void 0&&(i.ownerPath=o),a!==void 0&&(i.boundaryPath=a);try{r(e,i)}catch(e){console.error(e)}}const kn=Symbol(0);function J(e){let t=un.bind(null,e);return t[f]=e,t}function An(e,t){if(typeof e==`function`){let n=W(e,t);return n.l&=-33,[J(n),gn.bind(null,n)]}let n=Xt(e,t);return[J(n),K.bind(null,n)]}function jn(e,t){return J(W(e,t))}function Mn(e,t,n){bn(e,t,void 0,n)}function Nn(e){let t=x();t&&!(t.l&16)?wn(()=>Qt(e),void 0):I.enqueue(2,function t(){if(A.Et>=A.Fe)return I.enqueue(2,t);e()})}function Pn(e,t,n){let r=typeof n?.keyed==`function`?n.keyed:void 0,i=t.length>1,a=t,o={H:se(),it:0,st:e,ot:[],ft:a,ht:[],ln:[],Xe:r,ct:r||n?.keyed===!1?[]:void 0,lt:i&&n?.keyed!==!1?[]:void 0,ut:n?.keyed===!1,L:n?.fallback},s=W(Vn.bind(o),void 0);return s.l&=-33,J(s)}const Fn={ownedWrite:!0};function In(e,t,n,r){let i=e.ot,a=e.it-1,o=[],s=[],c=[],l=256,u=r,d=r,f=!1;for(;u<=a&&d<=n-1;){let e=i[u],r=t[d];if(e===r){f||=(c.push(u,d,0),!0),c[c.length-1]++,u++,d++;continue}f=!1;let p=-1,m=Math.min(32-o.length,a-u,l);for(let e=1;e<=m;e++)if(i[u+e]===r){p=e;break}l-=p===-1?m:p;let h=-1;m=Math.min(32-s.length,n-1-d,l);for(let n=1;n<=m;n++)if(t[d+n]===e){h=n;break}if(l-=h===-1?m:h,p!==-1&&(h===-1||p<=h))for(;p-->0;)o.push(u++);else if(h!==-1)for(;h-->0;)s.push(d++);else{if(l<=0||o.length===32||s.length===32)return!1;o.push(u++),s.push(d++)}}for(;u<=a;u++){if(o.length===32)return!1;o.push(u)}for(;d<=n-1;d++){if(s.length===32)return!1;s.push(d)}return Ln(e,t,n,o,s,c)}function Ln(e,t,n,r,i,a){let o=e.ot,s,c,l;if(i.length!==0)for(l=Array(r.length),c=0;c<i.length;c++){let e=-1;for(s=0;s<r.length;s++)if(!l[s]&&o[r[s]]===t[i[c]]){e=s;break}if(e===-1)return!1;l[e]=!0,i[c]=i[c]<<6|e}if(r.length!==0||i.length!==0){let e=/* @__PURE__ */ new Set;for(s=0;s<r.length;s++)e.add(o[r[s]]);for(c=0;c<i.length;c++)e.add(t[i[c]>>6]);for(let t=0;t<a.length;t+=3){let n=a[t];for(let r=0,i=a[t+2];r<i;r++)if(e.has(o[n+r]))return!1}}let u=e.ht,d=e.ln,f=u.slice(0,n),p=d.slice(0,n);for(let e=0;e<a.length;e+=3){let t=a[e],n=a[e+1];if(t!==n)for(let r=0;r<a[e+2];r++)f[n+r]=u[t+r],p[n+r]=d[t+r]}for(c=0;c<i.length;c++){let e=i[c]>>6,t=r[i[c]&63];f[e]=u[t],p[e]=d[t]}for(e.ht=f,e.ln=p,e.it=n,e.ot=t.slice(0),s=0;s<r.length;s++)l!==void 0&&l[s]||d[r[s]].dispose();return!0}function Rn(e,t,n,r,i,a,o,s,c){let l=e.Xe,u=e.ot,d=e.ln,f=[],p=n;for(let m=n;m<=i;p++,m++){let i=l?l(t[m]):t[m];for(;p<=r&&(l?l(u[p]):u[p])!==i;)f.push(d[p++]);if(p>r)return o.fill(void 0),null;a[m]=e.ht[p],o[m-n]=d[p],s&&(s[m-n]=e.ct[p]),c&&(c[m-n]=e.lt[p])}for(;p<=r;p++)f.push(d[p]);return f}function zn(e,t,n,r,i,a,o,s,c){let l=e.ln,u=e.ct,d=e.lt,f=e.it,p=n-f,m,h;if(p>0)for(l.length=n,u&&(u.length=n),d&&(d.length=n),m=f-1,h=n-1;m>i;m--,h--)l[h]=l[m],u&&(u[h]=u[m]),d&&(d[h]=d[m]);else if(p<0){for(m=i+1,h=a+1;m<f;m++,h++)l[h]=l[m],u&&(u[h]=u[m]),d&&(d[h]=d[m]);l.length=n,u&&(u.length=n),d&&(d.length=n)}for(h=r;h<=a;h++)l[h]=o[h-r],u&&Bn(u[h]=s[h-r],t[h]),d&&K(d[h]=c[h-r],h);for(h=a+1;h<n;h++)u&&Bn(u[h],t[h]),d&&p!==0&&K(d[h],h)}const Bn=(e,t)=>e.le===t&&e.ue===u||K(e,t);function Vn(){this.H.Ke=x();let e=this.st()||[];e[kn],e=e;let t=e.length;return q(this.H,()=>{let n,r,i,a,o,s=this.ct?this.ut?()=>(a[i]=Xt(e[r],Fn),this.ft(J(a[i]),r)):()=>(a[i]=Xt(e[r],Fn),o&&(o[i]=Xt(r,Fn)),this.ft(J(a[i]),o?J(o[i]):void 0)):this.lt?()=>{let t=e[r];return o[i]=Xt(r,Fn),this.ft(t,J(o[i]))}:()=>{let t=e[r];return this.ft(t)};if(t===0)this.it!==0&&(this.H.dispose(!1),this.ln=[],this.ot=[],this.ht=[],this.it=0,this.ct&&=[],this.lt&&=[]),this.L&&!this.ht.length&&(this.ln[0]?.dispose(),this.ht[0]=q(this.ln[0]=se(),this.L));else if(this.it===0){let c=Array(t),l=Array(t);a=this.ct&&Array(t),o=this.lt&&Array(t);try{for(r=0;r<t;r++)i=r,c[r]=q(l[r]=se(),s)}catch(e){for(n=0;n<=r;n++)l[n]?.dispose();throw e}this.ln[0]&&this.ln[0].dispose(),this.ht=c,this.ln=l,a&&(this.ct=a),o&&(this.lt=o),this.ot=e.slice(0),this.it=t}else{let c,l,u,d,f,p,m,h,g;for(c=0,l=Math.min(this.it,t);c<l&&(this.ot[c]===e[c]||this.ct&&Hn(this.Xe,this.ot[c],e[c]));c++)this.ct&&Bn(this.ct[c],e[c]);for(l=this.it-1,u=t-1;l>=c&&u>=c&&(this.ot[l]===e[u]||this.ct&&Hn(this.Xe,this.ot[l],e[u]));l--,u--);if(c===t&&this.it===t){this.ot=e.slice(0);return}if(t<=this.it&&l-c>64&&this.ct===void 0&&this.lt===void 0){let n=c+(u-c>>1),r=e[n],i=Math.min(l,n+32),a=Math.max(c,n-32);for(;a<=i&&this.ot[a]!==r;)a++;if(a<=i&&In(this,e,t,c))return}let _=t-this.it,v=u-c+1,y=Array(t),b=Array(v);a=this.ct?Array(v):void 0,o=this.lt?Array(v):void 0;let ee=_<0?Rn(this,e,c,l,u,y,b,a,o):null;if(ee!==null)ee.length!==0&&(h=ee);else{for(p=/* @__PURE__ */ new Map,m=Array(v),r=u;r>=c;r--)d=e[r],f=this.Xe?this.Xe(d):d,n=p.get(f),m[r-c]=n===void 0?-1:n,p.set(f,r);for(n=c;n<=l;n++)d=this.ot[n],f=this.Xe?this.Xe(d):d,r=p.get(f),r!==void 0&&r!==-1?(y[r]=this.ht[n],b[r-c]=this.ln[n],a&&(a[r-c]=this.ct[n]),o&&(o[r-c]=this.lt[n]),r=m[r-c],p.set(f,r)):(h??=[]).push(this.ln[n]);try{for(r=c;r<=u;r++)b[r-c]===void 0&&((g??=[]).push(b[r-c]=se()),i=r-c,y[r]=q(b[r-c],s))}catch(e){if(g)for(n=0;n<g.length;n++)g[n].dispose();throw e}}for(n=0;n<c;n++)y[n]=this.ht[n];for(r=u+1;r<t;r++)y[r]=this.ht[r-_];if(zn(this,e,t,c,l,u,b,a,o),this.ht=y,this.it=t,this.ot=e.slice(0),h)for(n=0;n<h.length;n++)h[n].dispose()}}),this.ht}function Hn(e,t,n){return!e||e(t)===e(n)}function Un(e,t){if(typeof e==`function`&&!e.length){if(t?.doNotUnwrap)return e;do e=e();while(typeof e==`function`&&!e.length)}if(!t?.skipNonRendered||e!=null&&e!==!0&&e!==!1&&e!==``){if(Array.isArray(e)){let n=[];return Wn(e,n,t)?()=>{let e=[];return Wn(n,e,{...t,doNotUnwrap:!1}),e}:n}return e}}function Wn(t,n=[],r){let i=null,a=!1;for(let o=0;o<t.length;o++)try{let e=t[o];if(typeof e==`function`&&!e.length){if(r?.doNotUnwrap){n.push(e),a=!0;continue}do e=e();while(typeof e==`function`&&!e.length)}Array.isArray(e)?a=Wn(e,n,r)||a:r?.skipNonRendered&&(e==null||e===!0||e===!1||e===``)||n.push(e)}catch(t){if(!(t instanceof e))throw t;i=t}if(i)throw i;return a}const Gn=Symbol(``),Kn=Symbol(``),Y=/* @__PURE__ */ new Set,qn=e=>e.A[Gn],Jn=e=>!!e&&(e.i===2&&e.L||Jn(e._parent)),X=e=>e.i===2||!e.D||e.h||Jn(e._parent);function Z(e,t,n=t){e.F.set(t,n),Y.add(e)}function Yn(e,t,r,i=t){if(e.i===2){r??=t.T?.U,i=r?.source??t,i.R&64&&(i=t);let a=n(r);K(e.U,a),On(a,e.H,i)}else e.D=!1;Z(e,t,i),e.h&&Xn(e),e.L||Zn(e)}function Xn(e){e.D=!1,e.P=e.B;let t=e.j;!e.P&&t.l&256&&D(t)!==T&&Ne(t)}function Zn(e){e.j!==null&&!(e.j.R&96)&&(L(e.j),M())}function Qn(e,t,n){if(t===0){if(Y.size)for(let t=qn(e);t;t=t._parent)!(t.F.get(e)?.m&(t.i|1))&&t.F.delete(e)&&!ar(t,0)&&t.L&&Zn(t);return!1}for(let r=qn(e);r;r=r._parent)if(!(r.i&t))r.L&&r.i>t&&Z(r,e);else{if(X(r))return Yn(r,e,n),!r.h||2;Z(r,e)}return!1}function $n(e){for(let t=qn(e);t;t=t._parent)if(t.i&1&&X(t))return t.h}function er(e,t){for(let t=qn(e);t;t=t._parent)if(t.L)return t;let n,r=e.o;if(t||e.l&16384)for(t||=/* @__PURE__ */ new Set,n=e.i!=1;r&&(n=t.size==t.add(r.u).size||er(r.u,t));)r=r.t;return n}function tr(e){let t=er(e);return t!==void 0&&((t.M??=/* @__PURE__ */ new Set).add(e),!0)}function nr(e){if(e.M!==null){for(let t of e.M){let e=t.i;I.enqueue(e===3?2:e,e===3?t.Z:t.W??=N.q.bind(null,t))}e.M=null}}function rr(e,t,n){if(!(n.m&3||t.m&2)){for(let n=qn(t);n&&n!==e;n=n._parent)if(n.i&1&&X(n))return!(n.j.l&256)}return!1}function ir(e,t,n){for(let r=e.C,i;r;r=r.G)if((i=r.S)===t||(n||=/* @__PURE__ */ new Set).size<n.add(i).size&&ir(i,t,n))return 1}function ar(e,t){let n=e.i|1;for(let[r,i]of e.F){if(!((r.R|i.R)&64)){if((r.m&n||i.m&n&&ir(r,i))&&!(n&2&&rr(e,r,i))||n&2&&i.l&2097152||r.l&32768&&r.R&8){if(t===0)break;continue}if((i!==e.K||e.h)&&(i.l&2304)==256){if(!t||!e.D)continue;k(D(i))}}e.F.delete(r)}return e.F.size}function or(){for(let e of Y){let t=e.j.R;if(t&64){Y.delete(e);continue}if(t&32)continue;if(!e.D){for(let[t]of e.F)for(let n of t.m&1?t.T?.se||[]:[t])if(!(n.l&256))for(let r=n.C;r;r=r.G){let i=r.S;i.l&256&&(n===t||!D(i).tt)&&Z(e,i)}}ar(e);let n=e.j;e.i&1&&!e.D&&n.l&256&&[...e.F].every(([,e])=>!(e.m&1)&&e.l&256&&D(e)===D(n))&&(e.F.clear(),e.D=!0),e.h=!1,e.F.size===0&&(Y.delete(e),e.L&&Zn(e))}}function sr(e){if(!e.D){e.L&&e.P===null&&e.B===null&&w!==null&&(e.B=w,Xn(e),Zn(e));return}e.h=!0,e.j.l&=-8388609;let t=w;t===null&&I.Y&&x().l&32768&&(k(null),t=N.J(T)),e.B=t,Y.add(e);let n=e.F.size;Me(e.H,T,t=>Z(e,t));for(let[t]of e.F)if(e.F.size!==n||t.m&1&&!(t.R&64)){for(let t=e._parent;t!==null;t=t._parent)if(t.i&1)for(let[n]of e.F)t.F.delete(n);Xn(e),Zn(e);return}}function cr(t,n,r,i){let a=se(),o={i:t,_parent:qn(a)??null,H:a,K:null,j:null,F:/* @__PURE__ */ new Map,D:t===2,h:!1,B:null,P:null,L:!1,M:null,v:null,$:!1,ee:!1,U:t===2?Xt(void 0,ur):null,ne:r,re:null};if(t===1&&a.A[Kn],x()&&ae(()=>{Y.delete(o)}),i){let t=!1;q(a,()=>W(()=>{try{i()}catch(t){if(!(t instanceof e)){if(!I.notify(x(),2,2,t))throw Be(t),t;return}}t?sr(o):t=!0})).l|=c}a.A={...a.A,[Gn]:o};let s=q(a,()=>{let e=W(n);return W(()=>Un(un(e)))});o.K=s;let u=W(()=>{let n=x();if(!o.h&&!(n.l&256)&&(n.l|=l),o.$&&(vt(s,n),o.$)){if(o.ee){o.L=!0;return}return lr(o)}let r=s.m&3;if(r!==0){if(vt(s,n),r&t){if(X(o))return Yn(o,s,void 0),lr(o);Z(o,s)}throw s.T.U}if(X(o)&&(o.F.size!==0&&n.m&4&&!(n.l&256)||ar(o,!0)!==0))return lr(o);let i;try{i=un(s)}catch(n){if(n instanceof e?t===1:t===2){if(X(o))return Yn(o,s,n),lr(o);Z(o,s)}throw n}if(X(o)&&o.F.size!==0)return lr(o);o.D=!0,o.L=!1;let a=o.re,c=()=>{!o.L&&o.re===a&&(a.m&2&&M(),h(a),o.re=null)};return a!==null&&(o.j.le===a.le?I.enqueue(1,c):c()),nr(o),i},{ae:!0});return u.l|=c,s.l|=l,o.j=u,J(u)}function lr(e){let t=x();e.P!==null&&(he(e.P),t.R|=131072,e.P=null),e.L=!0,e.re===null&&(e.re=q(t._parent,()=>W(()=>e.ne(e),{id:t.id,lazy:1})));let n=w,r=t.R,i=un(e.re);return he(n),t.R^=(t.R^r)&163840,i}const ur={ownedWrite:!0,ae:!0};function dr(e,t,n){return cr(1,e,()=>t(),n?.on)}pe(Qn,(e,t)=>!t&&(e.m&4?Qn(e,1):$n(e)),er,or,tr);function fr(e,t){let n=Symbol(t&&t.name||``);function r(e){return ce(()=>(yn(r,e.value),mr(()=>e.children)))}return r.id=n,r.defaultValue=e,r}function pr(e){return vn(e)}function mr(e){let t=jn(e,{lazy:!0}),n=jn(()=>Un(t()),{lazy:!0,sync:!0});return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}const hr={hydrating:!1,registry:void 0,done:!1},gr=(...e)=>jn(...e),_r=(...e)=>An(...e),vr=(...e)=>ce(...e),yr=(...e)=>Mn(...e),br=(e,t,n)=>dr(e,t,n);function xr(e,t,n,r){return Qt(()=>e(t||{}))}function Sr(e){let t=`fallback`in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=x(),r,i=()=>q(n,()=>Pn(()=>e.each,e.children,t));return hr.hydrating&&(r=i()),()=>(r??=i())()}function Cr(e){let t=`on`in e?{on:()=>e.on}:void 0;return br(()=>e.children,()=>e.fallback,t)}const wr=hr,Q=/*#__PURE__*/ Symbol(`slot`),Tr=/*#__PURE__*/ Symbol(`host`),Er={transparent:!0,sync:!0};function Dr(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:Er;yr(e,t,r)}function Or(e,t,n,r){let i=e.moveBefore&&e.isConnected&&document.activeElement;i===document.body&&(i=null);let a=r||e,o=(t,n)=>{i&&t.isConnected&&t.contains(i)?e.moveBefore(t,n):e.insertBefore(t,n),(r||t[Q])&&(t[Q]=a)};if(!t.length){for(let e of n)o(e,r);return}let s=t=>{if(!t)return!1;let n=t[Q];return t.parentNode===e&&(!n||n===a)},c=n.length,l=t.length,u=c,d=0,f=0,p=t[l-1],m=s(p)?p.nextSibling:r||null,h=null,g,_;for(;d<l||f<u;)if(t[d]===n[f])d++,f++;else{for(;l>d&&u>f&&t[l-1]===n[u-1];)l--,u--;if(l===d){let e=u;for(;e<c&&!s(n[e]);)e++;let t=e<c?n[e]:m;for(;f<u;)o(n[f++],t)}else if(u===f)for(;d<l;){let e=t[d++];h&&h.has(e)||!s(e)||e.remove()}else if((g=t[d])===n[u-1]&&n[f]===t[l-1]&&g.parentNode===e&&(!(_=g[Q])||_===a))do if(o(t[--l],g),f++,d>=l-1||f>=u)break;while(t[d]===n[u-1]&&n[f]===t[l-1]);else{if(!s(t[d])){d++;continue}if(!h){h=/* @__PURE__ */ new Map;let e=f;for(;e<u;)h.set(n[e],e++)}let c=h.get(t[d]);if(c!=null){if(f<c&&c<u){let s=d,p=1,m;for(;++s<l&&s<u&&(m=h.get(t[s]))!=null&&m===c+p;)p++;if(p>c-f){let e=t[d];for(;f<c;)o(n[f++],e)}else{let s=n[f++],c=t[d++];i&&e.contains(i)?o(s,c):e.replaceChild(s,c),(r||s[Q])&&(s[Q]=a)}}else d++}else t[d++].remove()}}}const kr=`_$SOLID_EVENT_OWNER`,Ar={},jr=/* @__PURE__ */ new Set,Mr=/* @__PURE__ */ new Map;function Nr(e,t,n,r={}){let i;Lr(t);try{vr(a=>{i=a,r.onError&&(x()[Re]=r.onError);let o=e();t===document?Dr(()=>Un(o),()=>{}):Jr(t,()=>o,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})},{id:r.renderId}),et()}catch(e){throw i&&i(),Rr(t),e}return()=>{i(),Rr(t),t.textContent=``}}function Pr(e,t,n){let r=document.createElement(`template`);r.innerHTML=e;let i=r.content.firstChild;return n===2?i.firstChild:i}function Fr(e,t){let n;return t===1?r=>document.importNode(n||=Pr(e,r,t),!0):r=>(n||=Pr(e,r,t)).cloneNode(!0)}function Ir(e){for(let t of e)jr.has(t)||(jr.add(t),Mr.forEach((e,n)=>Vr(t,n,e)))}function Lr(e){let t=zr(e,e);t&&(t.roots=(t.roots||0)+1)}function Rr(e){let t=Mr.get(e);t&&(t.roots>1?t.roots--:delete t.roots),Br(e,e)}function zr(e,t=e){if(!e||!t)return;let n=Mr.get(e);return n||Mr.set(e,n={owners:/* @__PURE__ */ new Map,handlers:/* @__PURE__ */ new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),jr.forEach(t=>Vr(t,e,n)),n}function Br(e,t=e){let n=Mr.get(e);if(!n)return;let r=n.owners.get(t);r>1?n.owners.set(t,r-1):n.owners.delete(t),n.owners.size||(n.handlers.forEach((t,n)=>e.removeEventListener(n,t)),Mr.delete(e))}function Vr(e,t,n){if(n.handlers.has(e))return;let r=e=>Zr(e,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}const Hr=e=>e._$host||e.parentNode||e.host;function Ur(e,t){let n=e,r=0;for(;n;){if(t.owners.has(n))return{owner:n,distance:r};r++,n=Hr(n)}}function Wr(e,t,n){if(Yr(e))return;let r=t===`multiple`&&e.localName===`select`;if(n==null||n===!1)e.removeAttribute(t);else if(e.setAttribute(t,n===!0?``:n),r&&!e._$multiple){let t=e.options;for(let e=0;e<t.length;e++)t[e].defaultSelected&&(t[e].selected=!0)}r&&(e._$multiple=!0)}function Gr(e,t){Array.isArray(e)?e.flat(1/0).forEach(e=>e&&e(t)):e(t)}function Kr(e,t){let n=Qt(e);q(null,()=>Gr(n,t))}const qr={scope:!0};function Jr(e,t,n,r,i){let a=n!==void 0,o=i&&i.host;if(a&&!r&&(r=[]),typeof t!=`function`&&(t=$r(t,r,a,!0),typeof t!=`function`)){Qr(e,t,r,n),o&&ei(t,o);return}if(a&&r.length===0){let t=document.createTextNode(``);e.insertBefore(t,n),r=[t]}let s=r,c=!1;Dr(()=>{let r=$r(t(),s,a,!0),l=c;return c=!0,typeof r==`function`?(Dr(()=>$r(r,s,a),t=>{s=Qr(e,t,s,n),o&&ei(s,o)},l&&!(i&&i.schedule)?{...i,schedule:!0}:i),Ar):r},t=>{t!==Ar&&(s=Qr(e,t,s,n),o&&ei(s,o))},t.$s?i?{...i,scope:!0}:qr:i)}function Yr(e){return!wr.hydrating||wr.isClaiming&&!wr.isClaiming()?!1:!e||e.isConnected?!0:Xr!==null&&Xr.claimed(e)}let Xr=null;function Zr(e,t,n){let r=e[kr],i;if(r){if(r===!0||r===t||!t.contains(r))return;i=r}let a=n.owners.size===1&&n.owners.has(t)?t:Ur(e.target,n)?.owner;if(!a||a===i)return;e[kr]=a;let o=i||e.target,s=`_$$`+e.type,c=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),l=()=>{let t=o[s];if(t&&!o.disabled){let n=o[`${s}Data`];if(n===void 0?typeof t==`function`?t.call(o,e):t.handleEvent(e):t.call(o,n,e),e.cancelBubble)return}return o.host&&typeof o.host!=`string`&&!o.host._$host&&o.contains(e.target)&&c(o.host),!0},u=()=>o===a||o.parentNode===a,d=()=>{for(;o&&l()&&!u();)o=Hr(o)};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return o||a}}),i)i===e.target&&(o=Hr(i)),o&&o!==a&&d();else if(e.composedPath){let t=e.composedPath();if(t.length){c(t[0]);for(let e=0;e<t.length&&(o=t[e],l());e++){if(o._$host){o=o._$host,d();break}if(u())break}}else d()}else d();delete e.target,delete e.currentTarget}function Qr(e,t,n,r){if(t===n)return t;let i=typeof t,a=r!==void 0;if(i===`string`||i===`number`){let r=typeof n;r===`string`||r===`number`?e.firstChild.data=t:ti(e,n)?e.textContent=t:(ni(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)ri(e,n,r);else if(t.nodeType)Array.isArray(n)?ri(e,n,a?r:null,t):n!=null&&n.nodeType?n.parentNode===e?e.replaceChild(t,n):e.appendChild(t):n!=null&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t),(r||t[Q])&&(t[Q]=r||e);else if(Array.isArray(t)){let i=Array.isArray(n);for(let e=0,r=t.length;e<r;e++){let r=t[e],a=typeof r;if(a===`string`||a===`number`){let a=i?n[e]:void 0;a&&a.nodeType===3?(a.data!==``+r&&(a.data=r),t[e]=a):t[e]=document.createTextNode(r)}}t.length===0?ri(e,n,r):i?Or(e,n,t,r):(n!=null&&ri(e,n),Or(e,[],t))}return t}function $r(e,t,n,r){return e=Un(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e==`function`||n&&!Array.isArray(e)&&(e=[e??``]),e}function ei(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)ei(e[n],t);else e&&e.nodeType&&e[Tr]!==t&&(e[Tr]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function ti(e,t){if(t==null)return!0;if(Array.isArray(t))return t.length?e.firstChild===t[0]&&e.lastChild===t[t.length-1]:e.firstChild===null;if(t===``)return e.firstChild===null;if(t.nodeType)return e.firstChild===t&&e.lastChild===t;let n=e.firstChild;return n!==null&&n.nodeType===3&&e.lastChild===n}function ni(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];r.parentNode===e&&r.remove()}else if(t.nodeType)t.parentNode===e&&t.remove();else{let t=e.firstChild;t&&t.nodeType===3&&t.remove()}}function ri(e,t,n,r){if(n===void 0)return ti(e,t)?e.textContent=``:ni(e,t);if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(r!==o){let t=o[Q],s=o.parentNode===e&&(!t||t===(n||e));r&&!i&&!a?s?e.replaceChild(r,o):e.insertBefore(r,n):s&&o.remove()}else i=!0}}else r&&e.insertBefore(r,n);r&&(n||r[Q])&&(r[Q]=n||e)}const ii=fr(),ai=()=>pr(ii);function oi(e){return(t,n,r)=>Nr(()=>{let t=e=>{let[t,n]=_r({v:e()});return Nn(()=>e.on(e=>n({v:e}))),()=>t().v},i=t(r.events),a=t(r.theme),o=t(r.listeners),s=t(r.forms),c=t(r.unread),l={page:r.page,events:i,last:e=>i().findLast(t=>t.type===e),append:r.append,theme:a,listeners:o,forms:s,unread:c,markdown:r.markdown,toast:r.toast};return xr(ii,{value:l,get children(){return xr(e,n)}})},t)}const si=[`border-bottom-width`,`border-left-width`,`border-right-width`,`border-top-width`,`box-sizing`,`font-family`,`font-size`,`font-style`,`font-weight`,`letter-spacing`,`line-height`,`padding-bottom`,`padding-left`,`padding-right`,`padding-top`,`tab-size`,`text-indent`,`text-rendering`,`text-transform`,`width`,`word-break`],ci={"min-height":`0`,"max-height":`none`,"min-width":`0`,"max-width":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`};function li(e){let t=getComputedStyle(e),n={};for(let e of si)n[e]=t.getPropertyValue(e);return n[`box-sizing`]?{style:n,padding:parseFloat(n[`padding-bottom`])+parseFloat(n[`padding-top`]),border:parseFloat(n[`border-bottom-width`])+parseFloat(n[`border-top-width`])}:null}let $=null;function ui(e,t,n,r){$||($=document.createElement(`textarea`),$.setAttribute(`tabindex`,`-1`),$.setAttribute(`aria-hidden`,`true`)),$.isConnected||document.body.append($);for(let[t,n]of Object.entries(e.style))$.style.setProperty(t,n);for(let[e,t]of Object.entries(ci))$.style.setProperty(e,t,`important`);let i=e.style[`box-sizing`]===`border-box`,a=t=>i?t+e.padding+e.border:t;$.value=t;let o=i?$.scrollHeight+e.border:$.scrollHeight-e.padding;$.value=`x`;let s=$.scrollHeight-e.padding;return Math.min(a(s*r),Math.max(a(s*n),o))}function di(e={}){let t,n=0,r=()=>{if(!t)return;let r=li(t);if(!r)return;let i=ui(r,t.value||t.placeholder||`x`,e.minRows??1,e.maxRows??1/0);i!==n&&(n=i,t.style.setProperty(`height`,`${i}px`,`important`))};return Nn(()=>{let e=t;if(!e)return;r(),e.addEventListener(`input`,r);let n=new ResizeObserver(()=>r());return n.observe(e),()=>{e.removeEventListener(`input`,r),n.disconnect()}}),e=>{t=e}}var fi=/* @__PURE__ */ Fr(`<div class=wb-chat><div class=wb-chat-new><textarea rows=1></textarea><button type=button>`),pi=/* @__PURE__ */ Fr(`<div class=wb-chat-message><span class=wb-chat-who>`),mi=/* @__PURE__ */ Fr(`<div class=wb-chat-bubble data-md>`),hi=/* @__PURE__ */ Fr(`<div class=wb-chat-bubble>`);const gi=`chat:message`;function _i(e,t){let n=new Set(t);return Object.entries(e.data).filter(([e,t])=>!n.has(e)&&typeof t==`string`&&t.trim()).map(([,e])=>String(e).trim()).join(`
2
2
 
3
- `)}function vi(e){let t=ai(),n=gr(()=>{let n=t.events(),r=n.filter(t=>t.type===gi&&t.data.chat===e.chat),i=new Set(r.map(e=>e.data.replaces).filter(Boolean).map(String)),a=[];for(let t of r){if(i.has(t.id))continue;let r=e.form&&t.data.replyTo?n.find(n=>n.id===t.data.replyTo&&n.type===e.form):void 0,o=r?_i(r,e.choices):``;r&&o&&!a.some(e=>e.id===r.id)&&a.push({id:r.id,from:`you`,text:o}),a.push({id:t.id,from:t.from===`cli`?`agent`:`you`,text:String(t.data.text??``)})}return a}),r,i=async()=>{let n=r?.value.trim();n&&(await t.append(gi,{chat:e.chat,text:n}),r.value=``,r.dispatchEvent(new Event(`input`)))};var a=fi(),o=a.firstChild,s=o.firstChild,c=s.nextSibling;return Jr(a,xr(Sr,{get each(){return n()},children:e=>(()=>{var t=pi(),n=t.firstChild;return Jr(n,()=>e.from),Jr(t,xr(yi,{get text(){return e.text}}),null),Dr(()=>({e:e.from,t:e.from===`agent`?e.id:void 0}),({e,t:n},r)=>{e!==r?.e&&Wr(t,`data-from`,e),n!==r?.t&&Wr(t,`data-wb-message`,n)}),t})()}),o),s._$$keydown=e=>{e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),i())},Kr(()=>[e=>r=e,di({maxRows:10})],s),c._$$click=i,Jr(c,()=>e.form?`Ask`:`Send`),Dr(()=>({e:e.form?``:void 0,t:e.form?`Ask about this question (doesn't choose anything)`:`Write a message`}),({e,t},n)=>{e!==n?.e&&Wr(a,`data-under-form`,e),t!==n?.t&&Wr(s,`placeholder`,t)}),a}function yi(e){let t=ai(),n=gr(()=>t.markdown(e.text));return xr(Cr,{get fallback(){var t=hi();return Jr(t,()=>e.text),t},get children(){var e=mi();return Dr(()=>n(),t=>{e.innerHTML=t}),e}})}var bi=oi(vi);Ir([`keydown`,`click`]);export{bi as default};
3
+ `)}function vi(e){let t=ai(),n=gr(()=>{let n=t.events(),r=n.filter(t=>t.type===gi&&t.data.chat===e.chat),i=new Set(r.map(e=>e.data.replaces).filter(Boolean).map(String)),a=[];for(let t of r){if(i.has(t.id))continue;let r=e.form&&t.data.replyTo?n.find(n=>n.id===t.data.replyTo&&n.type===e.form):void 0,o=r?_i(r,e.choices):``;r&&o&&!a.some(e=>e.id===r.id)&&a.push({id:r.id,from:`you`,text:o}),a.push({id:t.id,from:t.from===`cli`?`agent`:`you`,text:String(t.data.text??``),sending:!!t.sending})}return a}),r,i=async()=>{let n=r?.value.trim();if(!n)return;let i=e=>{r.value=e,r.dispatchEvent(new Event(`input`))};i(``);try{await t.append(gi,{chat:e.chat,text:n})}catch(e){console.error(e),r.value.trim()||i(n),t.toast(`Couldn't send the message`,{kind:`alert`,name:`chat-failed`,details:`It's back in the box: send it again.`})}};var a=fi(),o=a.firstChild,s=o.firstChild,c=s.nextSibling;return Jr(a,xr(Sr,{get each(){return n()},children:e=>(()=>{var t=pi(),n=t.firstChild;return Jr(n,()=>e.from),Jr(t,xr(yi,{get text(){return e.text}}),null),Dr(()=>({e:e.from,t:e.sending?``:void 0,a:e.from===`agent`?e.id:void 0}),({e,t:n,a:r},i)=>{e!==i?.e&&Wr(t,`data-from`,e),n!==i?.t&&Wr(t,`data-sending`,n),r!==i?.a&&Wr(t,`data-wb-message`,r)}),t})()}),o),s._$$keydown=e=>{e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),i())},Kr(()=>[e=>r=e,di({maxRows:10})],s),c._$$click=i,Jr(c,()=>e.form?`Ask`:`Send`),Dr(()=>({e:e.form?``:void 0,t:e.form?`Ask about this question (doesn't choose anything)`:`Write a message`}),({e,t},n)=>{e!==n?.e&&Wr(a,`data-under-form`,e),t!==n?.t&&Wr(s,`placeholder`,t)}),a}function yi(e){let t=ai(),n=gr(()=>t.markdown(e.text));return xr(Cr,{get fallback(){var t=hi();return Jr(t,()=>e.text),t},get children(){var e=mi();return Dr(()=>n(),t=>{e.innerHTML=t}),e}})}var bi=oi(vi);Ir([`keydown`,`click`]);export{bi as default};
@@ -23,6 +23,15 @@
23
23
  align-self: flex-end;
24
24
  align-items: flex-end;
25
25
  }
26
+ /* shown at once, grey until the server has it */
27
+ .wb-chat-message[data-from='you'][data-sending] .wb-chat-bubble {
28
+ background: var(--wb-sending, #9a9fa7);
29
+ border-color: var(--wb-sending, #9a9fa7);
30
+ color: var(--bg);
31
+ transition:
32
+ background-color 0.2s,
33
+ border-color 0.2s;
34
+ }
26
35
  .wb-chat-who {
27
36
  font: var(--weight-strong) var(--ui-tiny)/1.3 var(--sans);
28
37
  letter-spacing: var(--caps-spacing);
@@ -1,4 +1,9 @@
1
- var e=class{value;constructor(e){this.value=e}toString(){return this.value}};const t={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},n=e=>String(e).replace(/[&<>"']/g,e=>t[e]),r=t=>new e(String(t??``));function i(t){return t==null||t===!1?``:t instanceof e?t.value:Array.isArray(t)?t.map(i).join(``):n(t)}function a(t,...n){let r=t[0];for(let e=0;e<n.length;e++)r+=i(n[e])+t[e+1];return new e(r)}const o=`comments:new`,s=`comments:reply`,c=`comments:resolve`;let l,u,d,f=[],p=null;const m=document.createElement(`div`);m.className=`wb-comments`;const h=document.createElement(`button`);h.type=`button`,h.className=`wb-comment-start`,h.textContent=`Comment`,h.hidden=!0;const g=document.createElement(`div`);g.className=`wb-thread`,g.hidden=!0;function _(){let e=[],t=``,n=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest(`script, style, textarea`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let r=n.nextNode();r;r=n.nextNode())e.push({node:r,start:t.length}),t+=r.data;return{text:t,nodes:e}}function v(e,t,n){for(let r=0;r<e.nodes.length;r++){let{node:i,start:a}=e.nodes[r],o=a+i.data.length;if(t<o||n&&t===o||r===e.nodes.length-1)return{node:i,offset:Math.min(Math.max(t-a,0),i.data.length)}}return null}function y(e,t){let n=(t,n)=>{if(t.nodeType===Node.TEXT_NODE){let r=e.nodes.find(e=>e.node===t);return r?r.start+n:null}let r=document.createRange();r.setStart(d,0),r.setEnd(t,n);let i=0;for(let{node:t,start:n}of e.nodes)r.intersectsNode(t)&&(i=n+t.data.length);return i},r=n(t.startContainer,t.startOffset),i=n(t.endContainer,t.endOffset);return r==null||i==null?null:{start:r,end:i}}function b(e,t){let n=String(t.quote??``);if(!n)return null;let r=String(t.before??``),i=String(t.after??``),a=-1,o=-1;for(let t=e.text.indexOf(n);t>=0;t=e.text.indexOf(n,t+1)){let s=e.text.slice(Math.max(0,t-r.length),t),c=e.text.slice(t+n.length,t+n.length+i.length),l=0;for(;l<s.length&&s[s.length-1-l]===r[r.length-1-l];)l++;let u=0;for(;u<c.length&&c[u]===i[u];)u++;l+u>o&&(a=t,o=l+u)}if(a<0)return null;let s=v(e,a,!1),c=v(e,a+n.length,!0);if(!s||!c)return null;let l=document.createRange();return l.setStart(s.node,s.offset),l.setEnd(c.node,c.offset),l}function x(){let e=u.events(),t=new Set(e.filter(e=>e.type===c).map(e=>String(e.data.replyTo))),n=_();return e.filter(e=>e.type===o&&!t.has(e.id)).map(t=>({id:t.id,comment:t,replies:e.filter(e=>e.type===s&&e.data.replyTo===t.id),range:b(n,t.data)}))}const S=e=>e.replies.at(-1)?.from===`cli`;function C(){let e=CSS.highlights,t=window.Highlight;if(e&&t){e.set(`wb-comment`,new t(...f.filter(e=>e.range&&e.id!==p).map(e=>e.range)));let n=f.find(e=>e.id===p)?.range;n?e.set(`wb-comment-active`,new t(n)):e.delete(`wb-comment-active`)}let n=d.getBoundingClientRect(),r=new Set(u.unread().map(e=>e.id));m.replaceChildren(...f.map((e,t)=>{let i=document.createElement(`button`);i.type=`button`,i.className=`wb-comment-badge`,i.dataset.thread=e.id,i.toggleAttribute(`data-agent`,S(e)),i.dataset.wbHolds=e.replies.map(e=>e.id).join(` `);let a=e.replies.some(e=>r.has(e.id));i.toggleAttribute(`data-unread`,a),i.title=a?`the agent replied: unread`:S(e)?`the agent replied`:`comment`,i.textContent=String(1+e.replies.length);let o=e.range?.getClientRects()[0],s=o?o.top+scrollY:n.top+scrollY+t*30,c=Math.min(n.right+8+scrollX,document.documentElement.clientWidth-36+scrollX);return i.style.top=`${s}px`,i.style.left=`${c}px`,o||(i.dataset.detached=``),i})),p&&O()}function w(e){let t=g.querySelector(`textarea`),n=!!t&&document.activeElement===t,r=n?t.getBoundingClientRect().top:0;e();let i=g.querySelector(`textarea`);if(!n||!i||document.activeElement!==i)return;let a=i.getBoundingClientRect().top-r;Math.abs(a)>=1&&scrollBy(0,a)}function T(){l&&(d=l.querySelector(`main`)??l,w(()=>{f=x(),p&&!f.some(e=>e.id===p)?A():p&&D(),C()}))}const E=/* @__PURE__ */ new Map;function D(){let e=f.find(e=>e.id===p);if(!e)return;let t=e=>e.from===`cli`?`agent`:`you`,n=e=>{let n=String(e.data.text??``),i=E.get(n);return a`<div class="wb-thread-message" data-from="${t(e)}" data-wb-message="${e.id}">
1
+ var e=class{value;constructor(e){this.value=e}toString(){return this.value}};const t={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},n=e=>String(e).replace(/[&<>"']/g,e=>t[e]),r=t=>new e(String(t??``));function i(t){return t==null||t===!1?``:t instanceof e?t.value:Array.isArray(t)?t.map(i).join(``):n(t)}function a(t,...n){let r=t[0];for(let e=0;e<n.length;e++)r+=i(n[e])+t[e+1];return new e(r)}const o=`comments:new`,s=`comments:reply`,c=`comments:resolve`;let l,u,d,f=[],p=null;const m=document.createElement(`div`);m.className=`wb-comments`;const h=document.createElement(`button`);h.type=`button`,h.className=`wb-comment-start`,h.textContent=`Comment`,h.hidden=!0;const g=document.createElement(`div`);g.className=`wb-thread`,g.hidden=!0;function _(){let e=[],t=``,n=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest(`script, style, textarea`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let r=n.nextNode();r;r=n.nextNode())e.push({node:r,start:t.length}),t+=r.data;return{text:t,nodes:e}}function v(e,t,n){for(let r=0;r<e.nodes.length;r++){let{node:i,start:a}=e.nodes[r],o=a+i.data.length;if(t<o||n&&t===o||r===e.nodes.length-1)return{node:i,offset:Math.min(Math.max(t-a,0),i.data.length)}}return null}function y(e,t){let n=(t,n)=>{if(t.nodeType===Node.TEXT_NODE){let r=e.nodes.find(e=>e.node===t);return r?r.start+n:null}let r=document.createRange();r.setStart(d,0),r.setEnd(t,n);let i=0;for(let{node:t,start:n}of e.nodes)r.intersectsNode(t)&&(i=n+t.data.length);return i},r=n(t.startContainer,t.startOffset),i=n(t.endContainer,t.endOffset);return r==null||i==null?null:{start:r,end:i}}function b(e,t){let n=String(t.quote??``);if(!n)return null;let r=String(t.before??``),i=String(t.after??``),a=-1,o=-1;for(let t=e.text.indexOf(n);t>=0;t=e.text.indexOf(n,t+1)){let s=e.text.slice(Math.max(0,t-r.length),t),c=e.text.slice(t+n.length,t+n.length+i.length),l=0;for(;l<s.length&&s[s.length-1-l]===r[r.length-1-l];)l++;let u=0;for(;u<c.length&&c[u]===i[u];)u++;l+u>o&&(a=t,o=l+u)}if(a<0)return null;let s=v(e,a,!1),c=v(e,a+n.length,!0);if(!s||!c)return null;let l=document.createRange();return l.setStart(s.node,s.offset),l.setEnd(c.node,c.offset),l}function x(){let e=u.events(),t=new Set(e.filter(e=>e.type===c).map(e=>String(e.data.replyTo))),n=_();return e.filter(e=>e.type===o&&!t.has(e.id)).map(t=>({id:t.id,comment:t,replies:e.filter(e=>e.type===s&&e.data.replyTo===t.id),range:b(n,t.data)}))}const S=e=>e.replies.at(-1)?.from===`cli`;function C(){let e=CSS.highlights,t=window.Highlight;if(e&&t){e.set(`wb-comment`,new t(...f.filter(e=>e.range&&e.id!==p).map(e=>e.range)));let n=f.find(e=>e.id===p)?.range;n?e.set(`wb-comment-active`,new t(n)):e.delete(`wb-comment-active`)}let n=d.getBoundingClientRect(),r=new Set(u.unread().map(e=>e.id));m.replaceChildren(...f.map((e,t)=>{let i=document.createElement(`button`);i.type=`button`,i.className=`wb-comment-badge`,i.dataset.thread=e.id,i.toggleAttribute(`data-agent`,S(e)),i.dataset.wbHolds=e.replies.map(e=>e.id).join(` `);let a=e.replies.some(e=>r.has(e.id));i.toggleAttribute(`data-unread`,a),i.title=a?`the agent replied: unread`:S(e)?`the agent replied`:`comment`,i.textContent=String(1+e.replies.length);let o=e.range?.getClientRects()[0],s=o?o.top+scrollY:n.top+scrollY+t*30,c=Math.min(n.right+8+scrollX,document.documentElement.clientWidth-36+scrollX);return i.style.top=`${s}px`,i.style.left=`${c}px`,o||(i.dataset.detached=``),i})),p&&O()}function w(e){let t=g.querySelector(`textarea`),n=!!t&&document.activeElement===t,r=n?t.getBoundingClientRect().top:0;e();let i=g.querySelector(`textarea`);if(!n||!i||document.activeElement!==i)return;let a=i.getBoundingClientRect().top-r;Math.abs(a)>=1&&scrollBy(0,a)}function T(){l&&(d=l.querySelector(`main`)??l,w(()=>{f=x(),p&&!f.some(e=>e.id===p)?A():p&&D(),C()}))}const E=/* @__PURE__ */ new Map;function D(){let e=f.find(e=>e.id===p);if(!e)return;let t=e=>e.from===`cli`?`agent`:`you`,n=e=>{let n=String(e.data.text??``),i=E.get(n);return a`<div
2
+ class="wb-thread-message"
3
+ data-from="${t(e)}"
4
+ data-wb-message="${e.id}"
5
+ ${e.sending?r(` data-sending`):``}
6
+ >
2
7
  <span class="wb-thread-who">${t(e)}</span>
3
8
  <div class="wb-thread-text" ${i==null?``:r(` data-md`)}>${i==null?n:r(i)}</div>
4
9
  </div>`},i=g.querySelector(`textarea`),o=i?.value??``,s=!!i&&document.activeElement===i,c=i?[i.selectionStart,i.selectionEnd]:null;g.innerHTML=String(a` <blockquote class="wb-thread-quote">${e.comment.data.quote??``}</blockquote>
@@ -16,4 +21,4 @@ var e=class{value;constructor(e){this.value=e}toString(){return this.value}};con
16
21
  <div class="wb-thread-actions">
17
22
  <button type="submit" class="wb-comment-button wb-comment-primary">Comment</button
18
23
  ><button type="button" class="wb-comment-button" data-cancel>Cancel</button>
19
- </div>`);function H(){if(!j)return;V.querySelector(`blockquote`).textContent=j.at?`${j.at}\n${j.quote}`:j.quote,V.style.top=h.style.top;let e=Math.min(360,document.documentElement.clientWidth-32);V.style.width=`${e}px`,V.style.left=`${Math.max(16+scrollX,Math.min(parseFloat(h.style.left),document.documentElement.clientWidth-e-16+scrollX))}px`,V.hidden=!1,h.hidden=!0,V.querySelector(`textarea`).focus({preventScroll:!0})}const U=(e,t,n)=>{if(t.kind!==`page`&&t.kind!==`file`)return;l=e,d=l.querySelector(`main`)??l,u=n,document.body.append(m,h,P,g,V),document.addEventListener(`mousemove`,B),document.documentElement.addEventListener(`mouseleave`,()=>{I||(P.hidden=!0,F=null)}),P.addEventListener(`mousedown`,e=>{if(!F||e.button!==0)return;e.preventDefault();let t=CSS.highlights,n=window.Highlight;t&&n&&t.set(`wb-comment-active`,new n(R(F,F))),I={pre:F.closest(`pre`),from:F,to:F}}),document.addEventListener(`mouseup`,()=>{if(!I)return;let{from:e,to:t}=I;I=null,P.hidden=!0,N(R(e,t))?H():C()});let r=0;document.addEventListener(`selectionchange`,()=>{clearTimeout(r),r=window.setTimeout(M,150)}),h.addEventListener(`mousedown`,e=>e.preventDefault()),h.addEventListener(`click`,H);for(let e of[V,g])e.addEventListener(`keydown`,e=>{let t=e.target;t.tagName!==`TEXTAREA`||e.key!==`Enter`||e.shiftKey||e.isComposing||(e.preventDefault(),t.closest(`form`)?.requestSubmit())});V.addEventListener(`submit`,async e=>{e.preventDefault();let t=V.querySelector(`textarea`).value.trim();if(!t||!j)return;let n=await u.append(o,{...j,text:t});V.querySelector(`textarea`).value=``,V.hidden=!0,j=null,getSelection()?.removeAllRanges(),T(),k(n.id)}),V.querySelector(`[data-cancel]`).addEventListener(`click`,()=>{V.hidden=!0,j=null}),m.addEventListener(`click`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&(p===t?A():k(t))}),g.addEventListener(`submit`,async e=>{e.preventDefault();let t=g.querySelector(`textarea`),n=t.value.trim();n&&p&&(await u.append(s,{replyTo:p,text:n}),t.value=``,T())}),g.addEventListener(`click`,async e=>{if(!e.target.closest(`[data-close]`)||!p)return;let t=p;A(),u.markRead(f.find(e=>e.id===t)?.replies.map(e=>e.id)??[]),await u.append(c,{replyTo:t}),T()}),m.addEventListener(`wb-reveal`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&p!==t&&k(t)}),document.addEventListener(`dblclick`,e=>{let t=e.target;!p||g.contains(t)||m.contains(t)||A()}),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&(V.hidden?p&&A():(V.hidden=!0,j=null))}),u.events.on(T),u.onRendered(T),new ResizeObserver(()=>C()).observe(l),addEventListener(`resize`,()=>C()),T()};export{U as default};
24
+ </div>`);function H(){if(!j)return;V.querySelector(`blockquote`).textContent=j.at?`${j.at}\n${j.quote}`:j.quote,V.style.top=h.style.top;let e=Math.min(360,document.documentElement.clientWidth-32);V.style.width=`${e}px`,V.style.left=`${Math.max(16+scrollX,Math.min(parseFloat(h.style.left),document.documentElement.clientWidth-e-16+scrollX))}px`,V.hidden=!1,h.hidden=!0,V.querySelector(`textarea`).focus({preventScroll:!0})}const U=(e,t,n)=>{if(t.kind!==`page`&&t.kind!==`file`)return;l=e,d=l.querySelector(`main`)??l,u=n,document.body.append(m,h,P,g,V),document.addEventListener(`mousemove`,B),document.documentElement.addEventListener(`mouseleave`,()=>{I||(P.hidden=!0,F=null)}),P.addEventListener(`mousedown`,e=>{if(!F||e.button!==0)return;e.preventDefault();let t=CSS.highlights,n=window.Highlight;t&&n&&t.set(`wb-comment-active`,new n(R(F,F))),I={pre:F.closest(`pre`),from:F,to:F}}),document.addEventListener(`mouseup`,()=>{if(!I)return;let{from:e,to:t}=I;I=null,P.hidden=!0,N(R(e,t))?H():C()});let r=0;document.addEventListener(`selectionchange`,()=>{clearTimeout(r),r=window.setTimeout(M,150)}),h.addEventListener(`mousedown`,e=>e.preventDefault()),h.addEventListener(`click`,H);for(let e of[V,g])e.addEventListener(`keydown`,e=>{let t=e.target;t.tagName!==`TEXTAREA`||e.key!==`Enter`||e.shiftKey||e.isComposing||(e.preventDefault(),t.closest(`form`)?.requestSubmit())});V.addEventListener(`submit`,async e=>{e.preventDefault();let t=V.querySelector(`textarea`).value.trim();if(!t||!j)return;let n=j,r=u.append(o,{...n,text:t}),i=u.events().findLast(e=>e.type===o&&e.sending&&e.data.text===t);V.querySelector(`textarea`).value=``,V.hidden=!0,j=null,getSelection()?.removeAllRanges(),T(),i&&k(i.id);try{await r}catch(e){if(console.error(`comments:`,e),!V.hidden)return;j=n,V.querySelector(`textarea`).value=t,V.hidden=!1,u.toast(`Couldn't send the comment`,{kind:`alert`,name:`comment-failed`,details:`It's back in the box: send it again.`})}}),V.querySelector(`[data-cancel]`).addEventListener(`click`,()=>{V.hidden=!0,j=null}),m.addEventListener(`click`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&(p===t?A():k(t))}),g.addEventListener(`submit`,async e=>{e.preventDefault();let t=g.querySelector(`textarea`),n=t.value.trim();if(!n||!p)return;let r=p;t.value=``;let i=u.append(s,{replyTo:r,text:n});T();try{await i}catch(e){console.error(`comments:`,e);let t=g.querySelector(`textarea`);p===r&&t&&!t.value.trim()&&(t.value=n),u.toast(`Couldn't send the reply`,{kind:`alert`,name:`comment-failed`,details:`It's back in the box: send it again.`})}}),g.addEventListener(`click`,async e=>{if(!e.target.closest(`[data-close]`)||!p)return;let t=p;A(),u.markRead(f.find(e=>e.id===t)?.replies.map(e=>e.id)??[]);let n=u.append(c,{replyTo:t});T(),n.catch(e=>{console.error(`comments:`,e),u.toast(`Couldn't close the thread`,{kind:`alert`,name:`comment-failed`,details:`It's open again.`})})}),m.addEventListener(`wb-reveal`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&p!==t&&k(t)}),document.addEventListener(`dblclick`,e=>{let t=e.target;!p||g.contains(t)||m.contains(t)||A()}),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&(V.hidden?p&&A():(V.hidden=!0,j=null))}),u.events.on(T),u.onRendered(T),new ResizeObserver(()=>C()).observe(l),addEventListener(`resize`,()=>C()),T()};export{U as default};
@@ -183,3 +183,7 @@
183
183
  font: var(--ui-small) var(--mono, monospace);
184
184
  color: var(--muted, #696e76);
185
185
  }
186
+ /* shown at once, grey until the server has it */
187
+ .wb-thread-message[data-sending] .wb-thread-text {
188
+ color: var(--wb-sending, #9a9fa7);
189
+ }
@@ -35,8 +35,3 @@
35
35
  margin-bottom: 0;
36
36
  }
37
37
 
38
- /* a badge that ends the heading (`### Parser :badge[done]`) sits at the card's right edge */
39
- .wb-card h3 > .wb-badge:last-child {
40
- float: right;
41
- margin: 0.45em 0 0 var(--space-lg);
42
- }
@@ -15,6 +15,8 @@ import draft from "./draft/index.js";
15
15
  import lightbox from "./lightbox/index.js";
16
16
  import badge from "./badge/index.js";
17
17
  import ansi from "./ansi/index.js";
18
+ import timeline from "./timeline/index.js";
19
+ import toc from "./toc/index.js";
18
20
  // plugins/index.ts
19
21
  function builtins() {
20
22
  return [
@@ -34,7 +36,9 @@ function builtins() {
34
36
  draft(),
35
37
  lightbox(),
36
38
  badge(),
37
- ansi()
39
+ ansi(),
40
+ timeline(),
41
+ toc()
38
42
  ];
39
43
  }
40
44
  export { builtins };
@@ -0,0 +1,40 @@
1
+ Steps in order down a line, a dot per step: what was done and what it showed.
2
+ Each step has room for full sentences, unlike a diagram's boxes.
3
+
4
+ A heading starts a step, titled by it: the shallowest headings in the block are
5
+ its steps, whatever their level. Deeper headings are the step's own and stay
6
+ headings in its body ("What it does", "Result"). A step's body is any markdown,
7
+ blocks too: a takeaway that should stand out can be a `:::callout` (the
8
+ timeline around it then takes four colons, `::::timeline`). A `---` starts an
9
+ untitled step. A badge ending a step's heading sits at its right. A
10
+ `:when[2026-11-21 10:43]` in a step's heading is when it happened: shown above
11
+ the title, as written.
12
+
13
+ **Sub steps.** A timeline inside a step is that step's sub steps: drawn a level
14
+ in, on a thinner line, and a timeline inside one of those again a level
15
+ further, to any depth. The outer timeline then needs more colons than the inner
16
+ one (`::::timeline` around `:::timeline`). That is also how steps are grouped:
17
+ a step for the group, its steps in a timeline inside it.
18
+
19
+ ````markdown
20
+ ::::timeline[Steps so far]
21
+ ### :when[2026-11-21 10:43] Made a minimal repro :badge[done]
22
+ A chain of 6,400 closures overflows the stack: the crash is the chain, not
23
+ Solid.
24
+
25
+ ### Counted the visits
26
+ 5,150 visits for 100 links: each link walks the whole chain again.
27
+
28
+ :::timeline
29
+ ### With the probe off
30
+ #### What it does
31
+ Runs the same chain with the probe switched off.
32
+
33
+ #### Result
34
+ The same 5,150: the probe isn't what walks it.
35
+
36
+ ### With the cache on
37
+ 100 visits: one per link.
38
+ :::
39
+ ::::
40
+ ````
@@ -0,0 +1,82 @@
1
+ import { builtinPublic } from "../../src/package.js";
2
+ import fs from "node:fs";
3
+ import { definePlugin, html, raw } from "@bigmistqke/whiteboard";
4
+ // plugins/timeline/index.ts
5
+ const text = (node) => node.value ?? (node.children ?? []).map(text).join("");
6
+ /** A when's text. Its `:59` in `19:59` parses as a directive named `59`: put it back as written. */
7
+ const whenText = (node) => (node.children ?? []).map((n) => n.type === "textDirective" ? `:${n.name}${n.children?.length ? `[${text(n)}]` : ""}` : text(n)).join("");
8
+ /** Takes a `:when[…]` out of a heading: its text, and the heading without it. */
9
+ function when(title) {
10
+ const found = title.find((n) => n.type === "textDirective" && n.name === "when");
11
+ if (!found) return {
12
+ when: null,
13
+ title
14
+ };
15
+ const rest = title.filter((n) => n !== found);
16
+ const last = rest[rest.length - 1];
17
+ if (last?.type === "text" && last.value) last.value = last.value.trimEnd();
18
+ const first = rest[0];
19
+ if (first?.type === "text" && first.value) first.value = first.value.trimStart();
20
+ return {
21
+ when: whenText(found).trim(),
22
+ title: rest
23
+ };
24
+ }
25
+ /**
26
+ * Splits the block's content into steps: a heading at the shallowest level in it starts one, titled
27
+ * by it, and so does a `---`, untitled. Deeper headings are part of a step's body. Content before
28
+ * the first heading is an untitled step.
29
+ */
30
+ function parse(children) {
31
+ const depth = Math.min(...children.filter((n) => n.type === "heading").map((n) => n.depth));
32
+ const steps = [];
33
+ for (const node of children) if (node.type === "heading" && node.depth === depth) steps.push({
34
+ title: node.children ?? [],
35
+ body: []
36
+ });
37
+ else if (node.type === "thematicBreak") steps.push({
38
+ title: null,
39
+ body: []
40
+ });
41
+ else {
42
+ if (!steps.length) steps.push({
43
+ title: null,
44
+ body: []
45
+ });
46
+ steps[steps.length - 1].body.push(node);
47
+ }
48
+ return steps;
49
+ }
50
+ /** A step: when, title and body; a timeline in its body (its sub steps) renders as its own block. */
51
+ async function renderStep(ctx, step) {
52
+ const split = step.title ? when(step.title) : {
53
+ when: null,
54
+ title: null
55
+ };
56
+ const title = split.title && await ctx.toHtml(split.title);
57
+ const body = await ctx.toHtml(step.body);
58
+ return html`<li class="wb-tl-step">
59
+ ${split.when && html`<time class="wb-tl-when">${split.when}</time>`}
60
+ ${title && html`<div class="wb-tl-title" data-wb-title>${raw(title)}</div>`}
61
+ ${body.trim() && html`<div class="wb-tl-body">${raw(body)}</div>`}
62
+ </li>`;
63
+ }
64
+ async function render(ctx) {
65
+ const steps = await Promise.all(parse(ctx.children).map((step) => renderStep(ctx, step)));
66
+ return html`<div class="wb-timeline">
67
+ ${ctx.label && html`<div class="wb-tl-caption">${raw(ctx.label)}</div>`}
68
+ <ol class="wb-tl-steps">
69
+ ${steps}
70
+ </ol>
71
+ </div>`;
72
+ }
73
+ function timeline() {
74
+ return definePlugin({
75
+ name: "timeline",
76
+ public: builtinPublic("timeline"),
77
+ style: "style.css",
78
+ blocks: { timeline: { html: render } },
79
+ docs: () => fs.readFileSync(new URL("./README.md", import.meta.url), "utf8")
80
+ });
81
+ }
82
+ export { timeline as default, parse, when };
@@ -0,0 +1,118 @@
1
+ .wb-timeline {
2
+ margin: 3em 0;
3
+ text-align: left;
4
+ }
5
+ .wb-tl-caption {
6
+ font-family: var(--sans);
7
+ font-size: var(--ui-small);
8
+ color: var(--muted);
9
+ text-transform: uppercase;
10
+ letter-spacing: 0.06em;
11
+ margin-bottom: var(--space-2xl);
12
+ }
13
+ .wb-tl-steps {
14
+ list-style: none;
15
+ margin: 0;
16
+ padding: 0;
17
+ }
18
+
19
+ /* a line down the left, a dot per step */
20
+ .wb-tl-steps {
21
+ position: relative;
22
+ padding-left: 28px;
23
+ }
24
+ .wb-tl-steps::before {
25
+ content: '';
26
+ position: absolute;
27
+ left: 7px;
28
+ top: 6px;
29
+ bottom: 6px;
30
+ width: 2px;
31
+ background: var(--border);
32
+ }
33
+ .wb-tl-step {
34
+ position: relative;
35
+ padding-bottom: var(--space-2xl);
36
+ }
37
+ .wb-tl-step:last-child {
38
+ padding-bottom: 0;
39
+ }
40
+ /* the dot sits on the title's first line; a step without a title has it at its top */
41
+ .wb-tl-step:has(> .wb-tl-title)::before {
42
+ display: none;
43
+ }
44
+ .wb-tl-title {
45
+ position: relative;
46
+ }
47
+ .wb-tl-step::before,
48
+ .wb-tl-title::before {
49
+ content: '';
50
+ position: absolute;
51
+ left: -27px;
52
+ top: 0.45em;
53
+ width: 12px;
54
+ height: 12px;
55
+ border-radius: 50%;
56
+ background: var(--bg);
57
+ border: 2px solid var(--accent);
58
+ box-sizing: border-box;
59
+ }
60
+ .wb-tl-when {
61
+ display: block;
62
+ font-family: var(--mono);
63
+ font-size: var(--ui-tiny);
64
+ color: var(--muted);
65
+ line-height: 1.4;
66
+ }
67
+ /* centred on the title's first line (line-height 1.4: its middle is 0.7em down) */
68
+ .wb-tl-title::before {
69
+ top: calc(0.7em - 6px);
70
+ }
71
+ .wb-tl-title {
72
+ font-weight: 600;
73
+ line-height: 1.4;
74
+ }
75
+ .wb-tl-body {
76
+ font-size: var(--ui-text);
77
+ line-height: 1.6;
78
+ margin-top: var(--space-xs);
79
+ }
80
+ .wb-timeline .wb-tl-body > * {
81
+ margin-top: var(--space-md);
82
+ margin-bottom: 0;
83
+ }
84
+ .wb-timeline .wb-tl-body > :first-child {
85
+ margin-top: 0;
86
+ }
87
+
88
+ /* a timeline inside a step is its sub steps: a level in, a thinner line and smaller rings, the
89
+ same at every depth */
90
+ .wb-tl-body .wb-timeline {
91
+ margin: var(--space-md) 0 0;
92
+ }
93
+ .wb-tl-body .wb-tl-steps {
94
+ padding-left: 20px;
95
+ }
96
+ .wb-tl-body .wb-tl-steps::before {
97
+ left: 4px;
98
+ width: 1px;
99
+ }
100
+ .wb-tl-body .wb-tl-step {
101
+ padding-bottom: var(--space-md);
102
+ }
103
+ .wb-tl-body .wb-tl-step:last-child {
104
+ padding-bottom: 0;
105
+ }
106
+ .wb-tl-body .wb-tl-step::before,
107
+ .wb-tl-body .wb-tl-title::before {
108
+ left: -20px;
109
+ width: 9px;
110
+ height: 9px;
111
+ border-width: 1.5px;
112
+ }
113
+ .wb-tl-body .wb-tl-title::before {
114
+ top: calc(0.7em - 4.5px);
115
+ }
116
+ .wb-tl-body .wb-tl-title {
117
+ font-size: var(--ui-text);
118
+ }
@@ -1,16 +1,11 @@
1
- A table of contents beside the page, from its `##` and `###` headings,
2
- numbered as the page numbers them. The section being read is marked, a click
1
+ A table of contents beside the page, from its headings (`##` down to
2
+ `######`), numbered as the page numbers them, each section's subsections on a
3
+ line under it. The section being read is marked, a click
3
4
  goes to a section, and a section with an unanswered question or an unread
4
5
  message has a dot. It sits in the margin left of the text when the window has
5
- room; else a button in the header opens it. Opt in, in the config:
6
-
7
- ```ts
8
- import toc from '@bigmistqke/whiteboard/toc'
9
- export default defineConfig({ plugins: [toc()] })
10
- ```
11
-
12
- A page has it when its frontmatter asks, under `plugins:` (where every
13
- plugin's settings for a page go, by the plugin's name):
6
+ room; else a button in the header opens it. It is built in: a page has it
7
+ when its frontmatter asks, under `plugins:` (where every plugin's settings for
8
+ a page go, by the plugin's name):
14
9
 
15
10
  ```markdown
16
11
  ---
@@ -20,8 +15,13 @@ plugins:
20
15
  # A long page
21
16
  ```
22
17
 
23
- To have it on every page, `toc({ always: true })`; a page then goes without
24
- with `toc: false` there.
18
+ To have it on every page, replace the built-in one in the config; a page then
19
+ goes without with `toc: false` there:
20
+
21
+ ```ts
22
+ import toc from '@bigmistqke/whiteboard/toc'
23
+ export default defineConfig({ plugins: [toc({ always: true })] })
24
+ ```
25
25
 
26
26
  The panel fits its items, between a minimum and a maximum width (160px and
27
27
  320px by default). A project sets its own in the options, and a page in its
@@ -3,9 +3,11 @@ import { html } from "../../src/html.js";
3
3
  // plugins/toc/index.ts
4
4
  const DOCS = `## Table of contents
5
5
 
6
- Pages here have a table of contents beside them, made from their \`##\` and
7
- \`###\` headings: give a long page headings, and the reader can find their way
8
- in it. A section with an unanswered question or an unread message has a dot.
6
+ Pages here have a table of contents beside them, made from their headings,
7
+ \`##\` down to \`######\`: give a long page headings, and the reader can find
8
+ their way in it. Each section's subsections hang on a line under it, so the
9
+ nesting shows. A section with an unanswered question or an unread message has
10
+ a dot.
9
11
  `;
10
12
  function toc(options = {}) {
11
13
  return {