@bigmistqke/whiteboard 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -12
- package/bin/whiteboard.ts +74 -17
- package/dist/bin/whiteboard.js +93 -22
- package/dist/client/runtime.js +164 -11
- package/dist/plugins/chat/README.md +2 -1
- package/dist/plugins/chat/client.js +2 -2
- package/dist/plugins/chat/index.js +1 -0
- package/dist/plugins/chat/style.css +7 -0
- package/dist/plugins/code/diff.js +1 -0
- package/dist/plugins/comments/client.js +6 -6
- package/dist/plugins/comments/index.js +4 -1
- package/dist/plugins/comments/style.css +8 -0
- package/dist/plugins/forge/README.md +12 -0
- package/dist/plugins/forge/index.js +83 -0
- package/dist/plugins/gallery/client.js +1 -1
- package/dist/plugins/iframe/README.md +18 -0
- package/dist/plugins/iframe/client.js +1 -0
- package/dist/plugins/iframe/index.js +40 -0
- package/dist/plugins/iframe/style.css +29 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/mermaid/index.js +1 -0
- package/dist/solid/index.js +2 -1
- package/dist/src/client/page/base.css +33 -12
- package/dist/src/client/page/main.js +250 -26
- package/dist/src/events.js +24 -3
- package/dist/src/icons.js +6 -0
- package/dist/src/loader.js +12 -6
- package/dist/src/pages/blocks.js +1 -0
- package/dist/src/pages/index.js +3 -2
- package/dist/src/pages/markdown.js +107 -4
- package/dist/src/pages/render.js +63 -9
- package/dist/src/server.js +37 -12
- package/dist/src/status.js +38 -10
- package/package.json +1 -1
- package/plugins/chat/README.md +2 -1
- package/plugins/chat/client.tsx +15 -3
- package/plugins/chat/index.ts +1 -1
- package/plugins/chat/style.css +7 -0
- package/plugins/code/diff.ts +7 -1
- package/plugins/comments/client.ts +50 -6
- package/plugins/comments/index.ts +4 -2
- package/plugins/comments/style.css +8 -0
- package/plugins/forge/README.md +12 -0
- package/plugins/forge/index.ts +71 -0
- package/plugins/iframe/README.md +18 -0
- package/plugins/iframe/client.ts +46 -0
- package/plugins/iframe/index.ts +54 -0
- package/plugins/iframe/style.css +29 -0
- package/plugins/index.ts +3 -1
- package/plugins/mermaid/index.ts +1 -0
- package/skills/whiteboard/SKILL.md +17 -7
- package/solid/index.tsx +3 -0
- package/src/client/forms.ts +5 -6
- package/src/client/markdown.ts +36 -0
- package/src/client/page/base.css +33 -12
- package/src/client/page/elsewhere.ts +70 -0
- package/src/client/page/live.ts +30 -0
- package/src/client/page/main.ts +31 -6
- package/src/client/page/sort.ts +38 -0
- package/src/client/page/waiting.ts +102 -29
- package/src/client/read.ts +73 -0
- package/src/client/runtime.ts +13 -0
- package/src/client/toast.ts +25 -0
- package/src/define.ts +79 -13
- package/src/events.ts +27 -3
- package/src/icons.ts +8 -0
- package/src/loader.ts +7 -4
- package/src/pages/blocks.ts +3 -0
- package/src/pages/index.ts +8 -2
- package/src/pages/markdown.ts +92 -4
- package/src/pages/render.ts +49 -12
- package/src/server.ts +35 -12
- package/src/status.ts +64 -20
|
@@ -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={},l={},u=Symbol(`refresh`),d=Set;function f(e){let t=e.pe;for(;t;)t.R|=32,f(t),t=t.Ge}let p;function m(e){try{e()}catch(e){p||=[e],M()}}function h(e){let t=p;if(p=void 0,t&&!e)throw t[0]}function g(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||g(e,!1,!0),e.R=r|64,e.X&&(ct(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),$e(e),i.Me=i,g(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(v(e,n),t&&e.ze){let t=e.ze;e.ze=void 0,m(t)}}function _(e,t){let n=e.pe;t.Me=null,t.Ge=n,n!==null&&(n.Me=t),e.pe=t}function v(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--)m(n[e]);else m(n)}}function y(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return ee(n.id,t?n.be++:n.be);throw Error()}function b(e){return y(e,!0)}function x(e,t,n){return e?.id??(t?n?.id:n?.id==null?void 0:b(n))}function ee(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):``)+n}function S(){return W}function te(e,t=W){return t&&(t.ke?Array.isArray(t.ke)?t.ke.push(e):t.ke=[t.ke,e]:t.ke=e),e}function ne(e=!0){g(this,e),p&&!I.Y&&h()}function C(e){let t=W,n=e?.transparent??!1,r={id:x(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||l,be:0,T:null,_parent:t,dispose:ne};return t&&_(t,r),r}function re(e,t){let n=C(t);return J(n,()=>e(ne.bind(n,!0)))}const w=[];function ie(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||w.push(n),n}let ae=null,T=null,E=null;function oe(e,t){if(I.Y&&!t||T!==null)return k(e);E===null?E=O(e):ce(O(e),E),M()}function D(e){return e.T.Re=O(e.T.Re)}function se(e){return e=O(e),w.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?ie(!1):O(e):e!==null&&ce(O(e),t),I.Y||M()}function ce(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),w.splice(w.indexOf(e),1))}function le(e){let t=ue;ue??=e;let n=e.tt!==0||fe(e.ln,e)||!1;return ue=t,n}let ue=null;function de(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 fe(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&&!de(i,t))){if(i.i===1){if(pe(i,ue??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)&&pe(n,ue??t))return!0}}}return!1}function pe(e,t){return!(e.R&32&&me(e,t))&&!0}function me(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 he=[];function ge(e){he.push(e)}const _e=[];function ve(e){R(e,A),e.R&=-4,_e.push(e)}function ye(e,t){e.l|=256,be(e,t)}function be(e,t){let n=K(e);n.Re!==t&&(n.Re=t,t.ln.push(e))}function xe(e,t){for(let n=e.pe;n!==null;n=n.Ge)n.T?.Re?.P||(n.X!==void 0&&(n.l&256||ye(n,t),n.l|=1048576),xe(n,t))}const A={et:Array(2e3).fill(void 0),p:!1,Fe:0,Et:0};let j=0,Se=!1,Ce=!1,we=!1,Te=0;function M(){Ce?ke():Se||(Se=!0,!Te&&!I.Y&&queueMicrotask(He))}const Ee=Symbol.for(`solid-js/root-error-hook`),De=`[REACTIVITY_HALTED]`;function Oe(e){if(Ce)return;Ce=!0,h(!0);let t=De,n=e!==void 0&&globalThis.reportError;n||e===void 0?console.error(t):console.error(t,e),n&&n(e)}function ke(){we||(we=!0,console.error(De))}var N=class e{rn=[[],[]];Y=!1;flush(){if(!this.Y){this.Y=!0,Jt(),ae=null,E=null;try{it(),Ye(A,e._e),this.settle(),j++,Se=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===c&&e.m&4&&e.i!==1)continue;if(e.ue!==c&&!(e.m&5)&&e.T?.me==null&&e.T?.Le==null&&tn(e,e.le,e.ue)){e.ue=c,e.l&=-129;continue}ye(e,t)}e.l&128&&xe(e,t)}F.length=0,_e.splice(0)}else{Ve();for(let e=0;e<he.length;e++){let t=he[e];t.T?.U==null&&!t.Ae&&z(t)}}he.length&&=0;let n=this.rn;this.rn=[[],[]];for(let e=w.length-1;e>=0;e--){let t=w[e];le(t)||(w.splice(e,1),je(t),e=w.length)}let r=t&&se(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(_e.length!==0){let e=_e.splice(0).sort((e,t)=>e.he-t.he);for(let t=0;t<e.length;t++)e[t].R&64||G(e[t])}}run(e){let t=this.rn[e-1];t.length&&(this.rn[e-1]=[],Ue(t,e))}enqueue(e,t,n=ae){e&&(n?.P?n:this).rn[e-1].push(t),M()}notify(e,t,n,r){return t&1?(n&1&&ae===null&&k(null),!0):!1}};function Ae(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 je(e){let t=Ae(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,Be(n))}T===e&&(T=null),t?I.rn[1].push(()=>Me(e)):Me(e)}function Me(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 Ne(e,t){e.R&2048||(e.R|=2048,t.fn.push(e))}function Pe(e){F.push(e),I.Y||Ut()}let Fe=0;function Ie(){Fe++}function Le(e){e.we=Fe;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 Re(e){e.Ae=!0,I.enqueue(e.i,e.W??=N.q.bind(null,e))}function ze(e){return e.ue!==c&&(e.le=e.ue,e.ue=c)}function Be(e){let t=e;if(!t.X){e.l&=-385,ze(e);return}let n=e.ue===c&&!!(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=c,e.ie=j+1,H(t,2,n)}else ze(e)&&(t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=c),e.i&&e.i!==3&&Re(e));t.Ie=!1,t.R&=-1025,t.T?.U??z(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 Ve(){for(let e=0;e<F.length;e++){let t=F[e];t.l&2304||Be(t)}F.length=0}const I=new N;function He(e){if(e){Te++;try{return e()}finally{try{He()}finally{Te--}}}if(!I.Y&&!Ce){for(;Se;)I.flush();h()}}function Ue(e,t){for(let n=0;n<e.length;n++)e[n](t)}function L(e){A.Fe>e.he&&(A.Fe=e.he),Ge(e,A)}function We(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 Ge(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|10:(e.R=n|8,t.p&&Je(e)),n&16||We(e,t))}function Ke(e,t){let n=e.R;n&28||(e.R=n|16,We(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 qe(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&&Je(n)}}function Je(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)Je(t.u,1)}}function Ye(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):Xe(n,e),n=e.et[e.Fe]}e.Et=0}function Xe(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)Ke(n.u,t)}}let Ze;function Qe(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?Ze(t):t.T?.Ye&&m(t.T.Ye);let e=t;e.X&&e.l&32&&!(e.R&32)&&!(e.m&1)&&(et?et.push(e):nt(e))}return n}function z(e){let t=e._,n=t===null?e.C:t.G;if(n!==null){do n=Qe(n);while(n!==null);t===null?e.C=null:t.G=null}}function $e(e){e.C&&(e._=null,z(e))}let et=null;const tt=e=>et=e;function nt(e){R(e,A),$e(e),g(e,!0)}const rt=new d;function it(){if(rt.size!==0){for(let e of rt)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&nt(e);rt.clear()}}function at(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,Ie()}function ot(e,t){return!e.T?.se?.has(t)&&((K(e).se??=new d).add(t),!0)}function st(e,t){let n=e.T?.se;return n?.delete(t)?(n.size||(e.T.se=void 0),!0):!1}function ct(e){e.T!==null&&(e.T.Ee=null)}function lt(e){e.T!==null&&(e.T.se=void 0)}function ut(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 dt(e,t){K(e).fe=!0,t.source&&ot(e,t.source),e.m&2||B(e,t.source,t)}function B(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;K(t).U=i instanceof e&&i.source===n?i:new e(n)}function ft(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function pt(e,t){let n=new d,r=e=>{let i=n.has(e);t(e,i)!==!1&&!i&&(n.add(e),ft(e,r))};ft(e,r)}function mt(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&(e.R&8?e.R|=o:nt(e))}function ht(e){let t;if(pt(e,(e,n)=>{!n&&!e.o&&e.l&32&&(t??=[]).push(e)}),t)for(let e of t)mt(e)}function gt(e,n,r){return!(e.l&256||r&&e.R&16384&&I.Y&&!e.rr)||ae?!1:(lt(e),e.T&&(e.T.fe=!1),(e.m&=6)&2||B(e),e.ue=n instanceof t?n:new t(e,n),e.l|=2097280,V(e),M(),!0)}function _t(e,t){let n=!1;pt(e,(e,r)=>{!r&&e.T?.U===t&&(L(e),n=!0)}),n&&M()}function V(e,t=e){st(e,t);let n=!1,r;if(pt(e,(i,a)=>{if(a||t!==e&&ut(i,t)||!st(i,t))return!1;i.ie=j;let o=i.T?.se?.values().next().value,s=i.m&2;o?s||B(i,o):(i.m&=-2,s||B(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)mt(e);n&&M()}function vt(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function yt(e){let t=e.T?.Se;t!=null&&(e.T.Se=null,t())}function bt(t,n,r,i){let a=!1,o=!1;if(typeof n==`object`&&n&&zt(()=>{a=n[Symbol.asyncIterator],o=!a&&vt(n)}),!o&&!a)return t.T!==null&&(t.T.Ee=null),t.Ie=!1,n;K(t).Ee=n,t.T.ce=2147483647,t.T.se=void 0;let s,l=r=>{if(t.T?.Ee!==n)return;let a=r instanceof e;a&&t.Ie?(ct(t),dt(t,r),t.ie=j):((a||!gt(t,r))&&(H(t,a?1:2,r),a||g(t,!1,!0)),a&&V(t),t.ie=j,a||ht(t),i?.(r,a))},u=(e,i)=>{if(t.T?.Ee!==n||t.R&2)return;let a=t.m&4;if(St(t),r){try{r(e)}catch(e){l(e);return}t.l&256||(t.T.Te=null,t.l&=-1025),a&&St(t,!0)}else q(t,()=>e);t.ue===c&&(t.Ie=!1,z(t)),V(t),M(),He(),i?.()},d=()=>t.l&32&&!t.o&&!(t.m&1)?(nt(t),!0):!1,f=(e,r)=>{let i=e[Symbol.asyncIterator](),a=!1,o=!1,c=!r,f=()=>{if(!o){o=!0;try{let e=i.return?.();vt(e)&&e.then(void 0,()=>{})}catch{}}};te(f,r),K(t).Se=f;let p=()=>{try{d()||m()}catch(e){l(e)}},m=()=>{let e,r,f=!1,h=!1,g=!0,_=i.next();if((vt(_)?_:{then:e=>void e(_)}).then(r=>{if(g&&c)e=r,f=!0,r.done&&(o=!0);else if(t.T?.Ee!==n)return;else r.done?(o=!0,a?(M(),He()):u(void 0),d()):(a=!0,u(r.value,p))},e=>{g&&c?(r=e,h=!0):t.T?.Ee===n&&(o=!0,l(e),d())}),g=!1,h){if(o=!0,l(r),c)throw r;return!0}return f&&!e.done?(s=e.value,a=!0,m()):f&&e.done},h=m();return c=!1,a||h},p=null,m=(e,t)=>{let n=!1;if(typeof e==`object`&&e&&zt(()=>{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;u(r)}catch(e){l(e)}d()}},e=>{a?(i=e,r=!0):(l(e),d())}),a=!1,r)throw l(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(W)}t.Ie=!1}return s}function xt(e,t=!1){e.T?.se&<(e),e.T?.fe&&(e.T.fe=!1),e.m=t?0:e.m&4,e.T?.U&&B(e);let n=Pt(e);n&&n.call(e)}function St(e,t=!1){let n=e.T?.se;n&&(n.delete(e),n.size)?(e.T.fe=!1,t&&(e.m=1),B(e,n.values().next().value)):xt(e,t)}function H(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),ot(n,a)):lt(n),n.m=r|(r===2?n.m&12?8:0:r===1&&n.m&8?4:n.m&4),a?B(n,a,i):K(n).U=i;let o=Pt(n);o?o.call(n):Ct(n,r,i)}function Ct(t,n,r){let i=n===1&&r instanceof e&&r.source;ft(t,(e,a)=>{e.ie=j,e.l&16384||n===1&&a.Ne!==e.de?(n!==1&&st(e,t),L(e),M()):i&&e.T?.se?.has(i)?ae===null&&(e.l&2304)==256&&I.Y&&k(D(e)):(i||n!==1&&(e.T?.U!==r||e.T?.se))&&(Pe(e),n===1&&(e.l&2304)==256&&!e.i&&k(D(e)),H(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)?ve(e):G(e)},N.Ce=g;let U=!1,W=null;function G(t,n=!1){Ie();let r=t.i,i,l=t.l&s;if(!n){if(R(t,A),t.T!==null&&(t.T.Ee=null,yt(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!==c&&Le(t),t.ue=c,t.l&=-257):oe(e,void 0))}if(r===3||t.l&128){let e=et;tt(i=[]),g(t),tt(e)}else(t.pe!==null||t.ke!==null)&&At(t);t.l&2097152&&(t.ue=c,t.l^=s)}let u=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),_=W;W=t,t._=null,t.de++;let v=t.R&o;t.R=4|t.R&8224,t.ie=j;let y=t.ue===c?t.l&2048&&t.T.P!==c?t.T.P:t.le:t.ue,b=t.he,x=!1,ee=!1,S=U;U=!0;try{if(t.l&64)y=t.X(y),t.T!==null&&(t.T.Ee=null),t.Ie=!1;else{let e=t.T?.Ee,n=t.X(y),r=typeof n==`object`&&!!n,i=t.T?.Ee!==e;y=i||!r?n:bt(t,n),!i&&!r&&(t.T!==null&&(t.T.Ee=null),t.Ie=!1)}(t.m!==0||t.T!==null)&&xt(t,n)}catch(n){let r=n instanceof e;if(r&&t.Ie)dt(t,n);else if((r||!(m=gt(t,n,!0)))&&(r&&(K(t).fe=!0),H(t,r?1:2,n),r&&p&&!t.T?.Ee&&V(t)),(r||m)&&f)for(let e of f)e!==t&&!(t.T?.se?.has(e)&&(e.m&1||ut(t,e)))&&V(t,e)}finally{if(U=S,x=!!(t.R&a),ee=!!(t.R&128),t.R=t.R&936032|(n?t.R&256:0),W=_,i)for(let e of i)mt(e);t.T!==null&&(t.T.Ve=h&&!!(t.m&1))}if(t.R&64){$e(t),ct(t);return}let te=!!t.T?.U||m;if(!te){let e=t.ue===c,i=e?t.l&2048&&t.T.P!==c?t.T.P:t.le:t.ue,a=e&&u&&!r||!!t.T?.Te||!!l||!tn(t,i,y);if(r&&a&&!(t.R&262144&&!t.Ae&&Object.is(t.ge,y))&&e&&(t.Ae=!t.T?.U,n||I.enqueue(r,t.W??=N.q.bind(null,t),null)),!te){if(a)(n?!((T!==null||E!==null)&&(ee||kt(_)?.R&128)):r&&t.ue===c)?t.le=y:(t.ue=y,d&&(t.T.Te=d),n&&(ye(t,T??E),t.m|=4)),t.o!==null&&Le(t);else if(t.he!=b)for(let e=t.o;e!==null;e=e.t)Ke(e.u,A)}if(!a&&!t.T?.U&&(d&&_t(t,d),f))for(let e of f)e!==t&&V(t,e);p&&!(t.m&5)&&V(t)}if(n&&ee&&t.m&1){let e=T??E;e&&!e.P&&ye(t,e)}!t.T?.U&&t.ue===c&&!(r&&t.Ae)&&(n||r===3?z(t):ge(t)),(t.ue!==c||t.T!==null&&(t.T.me!==null||t.T.Le!==null)||t.m&5&&(!n||t.m&1))&&(t.l|=128,Pe(t)),x&&(L(t),M()),v&&mt(t)}function wt(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&&wt(n),e.R&2)break}(e.R&2||e.T?.U&&e.ie<j&&!e.T?.Ee)&&G(e),e.R&=937336}}function Tt(e,t){let n=t?.transparent??!1,r=typeof t==`object`&&!!t&&`loadingValue`in t,i={id:x(t,n,W),l:(n?4:0)|!!t?.ownedWrite|(!W||t?.lazy?32:0)|(t?.sync?64:0)|(t?.ae?2:0)|(t?.xe??0),ye:t?.equals??Rt,ke:null,A:W?.A??l,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:W,Ge:null,Me:null,pe:null,R:t?.lazy?512:0,m:r?0:4,ie:j,ue:c,we:-1,Ie:r,T:null};return t?.unobserved&&(K(i).Ye=t.unobserved),It(i,t),i}function K(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:c,Be:-1,ce:0,P:c,I:0,Te:null}}function Et(e,t){e.R|=128,(t.m&4||e.i!==1)&&oe(D(t),!e.i&&e.m&4||void 0)}function Dt(e,t){if(!(!(e.l&1<<23)||t.l&1024)){let n=D(t);if(!(n===T||Ot(e,n)))return Ne(e,n),!0}return Et(e,t),!1}function Ot(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&D(e)===t}function kt(e){return e!==null&&e.Qe?e.Ke:e}function At(e){f(e);let t=K(e);t.Le=e.ke,t.me=e.pe,e.ke=null,e.pe=null,e.be=0}function jt(e,t,n,r,i){let a=i?.transparent??!1,o={id:x(i,a,W),l:r<<23|(a?4:0)|!!i?.ownedWrite|(i?.sync?64:0)|(i?.xe??0),ye:!1,ke:null,A:W?.A??l,be:0,X:e,le:void 0,he:0,ve:void 0,We:null,C:null,_:null,de:0,o:null,Ze:null,_parent:W,Ge:null,Me:null,pe:null,R:512,m:4,ie:j,ue:c,we:-1,Ie:!1,Ae:!1,ge:void 0,qe:t,Je:n,ze:void 0,i:r,T:null};return i?.unobserved&&(K(o).Ye=i.unobserved),It(o,Ft),o}let Mt=null;function Nt(e){Mt=e}function Pt(e){return e.i?Mt:null}const Ft={lazy:!0};function It(e,t){e.We=e;let n=W?.Qe?W.Ke:W;W&&_(W,e),n&&(e.he=n.he+1),!t?.lazy&&G(e,!0)}function Lt(e,t){let n={ye:t?.equals??Rt,l:+!!t?.ownedWrite|(t?.ae?2:0),le:e,o:null,Ze:null,ie:j,ue:c,we:-1,T:null};return t?.unobserved&&(K(n).Ye=t.unobserved),n}function Rt(e,t){return e===t}function zt(e,t){let n=U;U=!1;try{return e()}finally{U=n}}function Bt(e,t){if(e.R&512)e.R&=-513,G(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||_(t,e)}G(e,!0)}}function Vt(e,t){return!t||e.ue===c||t.l&16}let Ht=!1;function Ut(){Ht=!0}function Wt(e){return I.Y||e.ue===c||e.l&4194304?c:e.l&256?e.T.Be===j?e.T.je:c:e.le}function Gt(e){let t=e.T;t.Be!==j&&(t.je=e.ue,t.Be=j,Ht=!0)}const Kt=[];function qt(e){return e.R|=a,!0}function Jt(){if(Ht=!1,Kt.length!==0){for(let e of Kt)e.l&=-4194305;Kt.length=0}}function Yt(e,t){e.he>=A.Fe?(Je(t),qe(A),wt(e)):t.l&65536&&wt(e);let n=e.he;n>=t.he&&e._parent!==t&&(t.he=n+1)}function Xt(e){let t=W;t?.Qe&&(t=t.Ke);let n=e,r=e;if(typeof n.X==`function`&&Bt(e),!n.X&&e.T?.De===void 0&&(!Ht||e.ue===c)&&!(e.l&2048))return t&&(U&&at(e,t),e.l&256&&!(t.l&16)&&Dt(t,e))||!t||e.ue===c||t.l&16||e.ue===e.le&&Object.is(e.ue,e.le)?e.le:($t(t),e.ue);let i=!1;if(t&&(U&&(at(e,t),r.X&&Yt(r,t)),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4?Et(t,e):i=Dt(t,e))),r.m&1&&!i){if(t){if(!(t.l&16)||r.m&4)throw!U&&e!==t&&at(e,t),r.T?.U}else if(r.m&4)throw r.T?.U}if(r.X&&r.m&2){if(U&&r.ie<j)return G(r),Xt(e);throw!i&&e.l&2097152&&Qt(e,t),r.T?.U}(i||!t)&&Zt(e);let a=Qt(e,i?null:t);return!t&&typeof n.X==`function`&&e.l&32&&!(r.m&1)&&!e.o&&(rt.add(e),M()),a}function Zt(e){if(e.T?.Te)throw e.T.Te}function Qt(t,n){if(t.ue!==c&&t.m&4&&(!n||n.l&16))throw new e(null);let r=n&&Ht?Wt(t):c;if(r!==c)return qt(n),r;if(Vt(t,n))return t.le;if($t(n,t),t.l&2097152)throw t.ue;return t.ue}function $t(e,t){t?.m&4||(e.R|=16384)}function en(e){I.Y||e.l&4194304||(e.l|=4194304,Kt.push(e))}function tn(t,n,r){if(t.ye===Rt)return n===r;try{return t.ye&&t.ye(n,r)}catch(n){if(!(n instanceof e))return H(t,2,n),!0}}function q(e,t){let n=e.ue===c?e.le:e.ue;if(typeof t==`function`&&(t=t(n)),e.l&256&&k(D(e)),!(e.m&4||e.T?.Te||!tn(e,n,t)))return t;let r=e.ue!==c;return r?e.l&256&&!I.Y&&Gt(e):Pe(e),e.ue=t,W!==null&&en(e),e.X!==void 0&&(e.ie=j),r&&e.we===Fe||(Le(e),M()),t}function nn(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,H(e,0)),t=q(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,Ge(e,A),M()):e.ue!==c&&(e.R|=1024),t}function J(e,t){let n=W,r=U;W=e,U=!1;try{return t()}finally{W=n,U=r}}function rn(e,t=!0){try{return e()}finally{}}function an(e,t=S()){let n;if(t&&(n=t.A[e.id]),n===void 0&&(n=e.defaultValue),n===void 0)throw new i;return n}function on(e,t,n=S()){if(!n)throw new r;n.A={...n.A,[e.id]:t===void 0?e.defaultValue:t}}function sn(e,t,n,r){let i=jt(e,t,n,r?.user?2:1,r);G(i,!0),r?.defer?ze(i):i.ue===c&&(i.T?.Re?.P||i.i===2||r?.schedule?I.enqueue(i.i,un.bind(null,i),i.T?.Re):un(i,0))}function cn(){let e=this.m,t=this.T?.U;if(e&2){if(I.notify(this,1,0),this.i===2){this.m&2&&Re(this);return}ln(this,n(t))}else this.i===1&&I.notify(this,3,e,t)}function ln(e,t,n){if(!I.notify(e,2,2))throw Oe(t),t}function un(e,r){if(!e.Ae||e.R&64)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){ln(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){K(e).U=new t(e,n),e.m|=2,ln(e,n)}finally{e.ge=e.le,e.Ae=!1,i&&z(e)}}N.q=un;function dn(e,t){let n=!1,r,i=()=>{if(!a.Ae||a.R&64)return;let e=Fe;n=!1;try{a.Ae=!1,G(a)}finally{}for(let t=a.C;t!==null;t=t.G){let o=t.S;if(o.ue!==c&&!(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=Tt(()=>{let t=a.ze;a.ze=void 0,t?.();let n=rn(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()}Nt(cn);const fn=Symbol(0);function Y(e){let t=Xt.bind(null,e);return t[u]=e,t}function pn(e,t){if(typeof e==`function`){let n=Tt(e,t);return n.l&=-33,[Y(n),nn.bind(null,n)]}let n=Lt(e,t);return[Y(n),q.bind(null,n)]}function mn(e,t){return Y(Tt(e,t))}function hn(e,t,n){sn(e,t,void 0,n)}function gn(e){let t=S();t&&!(t.l&16)?dn(()=>zt(e),void 0):I.enqueue(2,function t(){if(A.Et>=A.Fe)return I.enqueue(2,t);e()})}function _n(e,t,n){let r=typeof n?.keyed==`function`?n.keyed:void 0,i=t.length>1,a=t,o={H:C(),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=Tt(wn.bind(o),void 0);return s.l&=-33,Y(s)}const vn={ownedWrite:!0};function yn(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 bn(e,t,n,o,s,c)}function bn(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 xn(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 Sn(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&&Cn(u[h]=s[h-r],t[h]),d&&q(d[h]=c[h-r],h);for(h=a+1;h<n;h++)u&&Cn(u[h],t[h]),d&&p!==0&&q(d[h],h)}const Cn=(e,t)=>e.le===t&&e.ue===c||q(e,t);function wn(){this.H.Ke=S();let e=this.st()||[];e[fn],e=e;let t=e.length;return J(this.H,()=>{let n,r,i,a,o,s=this.ct?this.ut?()=>(a[i]=Lt(e[r],vn),this.ft(Y(a[i]),r)):()=>(a[i]=Lt(e[r],vn),o&&(o[i]=Lt(r,vn)),this.ft(Y(a[i]),o?Y(o[i]):void 0)):this.lt?()=>{let t=e[r];return o[i]=Lt(r,vn),this.ft(t,Y(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]=J(this.ln[0]=C(),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]=J(l[r]=C(),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&&Tn(this.Xe,this.ot[c],e[c]));c++)this.ct&&Cn(this.ct[c],e[c]);for(l=this.it-1,u=t-1;l>=c&&u>=c&&(this.ot[l]===e[u]||this.ct&&Tn(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&&yn(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 x=_<0?xn(this,e,c,l,u,y,b,a,o):null;if(x!==null)x.length!==0&&(h=x);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]=C()),i=r-c,y[r]=J(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(Sn(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 Tn(e,t,n){return!e||e(t)===e(n)}function En(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 Dn(e,n,t)?()=>{let e=[];return Dn(n,e,{...t,doNotUnwrap:!1}),e}:n}return e}}function Dn(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=Dn(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}function On(e,t){let n=Symbol(t&&t.name||``);function r(e){return re(()=>(on(r,e.value),An(()=>e.children)))}return r.id=n,r.defaultValue=e,r}function kn(e){return an(e)}function An(e){let t=mn(e,{lazy:!0}),n=mn(()=>En(t()),{lazy:!0,sync:!0});return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}const jn={hydrating:!1,registry:void 0,done:!1},Mn=(...e)=>mn(...e),Nn=(...e)=>pn(...e),Pn=(...e)=>re(...e),Fn=(...e)=>hn(...e);function In(e,t,n,r){return zt(()=>e(t||{}))}function Ln(e){let t=`fallback`in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=S(),r,i=()=>J(n,()=>_n(()=>e.each,e.children,t));return jn.hydrating&&(r=i()),()=>(r??=i())()}const Rn=jn,X=/*#__PURE__*/ Symbol(`slot`),zn=/*#__PURE__*/ Symbol(`host`),Bn={transparent:!0,sync:!0};function Z(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:Bn;Fn(e,t,r)}function Vn(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[X])&&(t[X]=a)};if(!t.length){for(let e of n)o(e,r);return}let s=t=>{if(!t)return!1;let n=t[X];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[X])||_===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[X])&&(s[X]=a)}}else d++}else t[d++].remove()}}}const Hn=`_$SOLID_EVENT_OWNER`,Un={},Wn=/* @__PURE__ */ new Set,Q=/* @__PURE__ */ new Map;function Gn(e,t,n,r={}){let i;Yn(t);try{Pn(a=>{i=a,r.onError&&(S()[Ee]=r.onError);let o=e();t===document?Z(()=>En(o),()=>{}):or(t,()=>o,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})},{id:r.renderId}),He()}catch(e){throw i&&i(),Xn(t),e}return()=>{i(),Xn(t),t.textContent=``}}function Kn(e,t,n){let r=document.createElement(`template`);r.innerHTML=e;let i=r.content.firstChild;return n===2?i.firstChild:i}function qn(e,t){let n;return t===1?r=>document.importNode(n||=Kn(e,r,t),!0):r=>(n||=Kn(e,r,t)).cloneNode(!0)}function Jn(e){for(let t of e)Wn.has(t)||(Wn.add(t),Q.forEach((e,n)=>$n(t,n,e)))}function Yn(e){let t=Zn(e,e);t&&(t.roots=(t.roots||0)+1)}function Xn(e){let t=Q.get(e);t&&(t.roots>1?t.roots--:delete t.roots),Qn(e,e)}function Zn(e,t=e){if(!e||!t)return;let n=Q.get(e);return n||Q.set(e,n={owners:/* @__PURE__ */ new Map,handlers:/* @__PURE__ */ new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),Wn.forEach(t=>$n(t,e,n)),n}function Qn(e,t=e){let n=Q.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)),Q.delete(e))}function $n(e,t,n){if(n.handlers.has(e))return;let r=e=>lr(e,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}const er=e=>e._$host||e.parentNode||e.host;function tr(e,t){let n=e,r=0;for(;n;){if(t.owners.has(n))return{owner:n,distance:r};r++,n=er(n)}}function nr(e,t,n){if(sr(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 rr(e,t){Array.isArray(e)?e.flat(1/0).forEach(e=>e&&e(t)):e(t)}function ir(e,t){let n=zt(e);J(null,()=>rr(n,t))}const ar={scope:!0};function or(e,t,n,r,i){let a=n!==void 0,o=i&&i.host;if(a&&!r&&(r=[]),typeof t!=`function`&&(t=dr(t,r,a,!0),typeof t!=`function`)){ur(e,t,r,n),o&&fr(t,o);return}if(a&&r.length===0){let t=document.createTextNode(``);e.insertBefore(t,n),r=[t]}let s=r,c=!1;Z(()=>{let r=dr(t(),s,a,!0),l=c;return c=!0,typeof r==`function`?(Z(()=>dr(r,s,a),t=>{s=ur(e,t,s,n),o&&fr(s,o)},l&&!(i&&i.schedule)?{...i,schedule:!0}:i),Un):r},t=>{t!==Un&&(s=ur(e,t,s,n),o&&fr(s,o))},t.$s?i?{...i,scope:!0}:ar:i)}function sr(e){return!Rn.hydrating||Rn.isClaiming&&!Rn.isClaiming()?!1:!e||e.isConnected?!0:cr!==null&&cr.claimed(e)}let cr=null;function lr(e,t,n){let r=e[Hn],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:tr(e.target,n)?.owner;if(!a||a===i)return;e[Hn]=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=er(o)};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return o||a}}),i)i===e.target&&(o=er(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 ur(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:pr(e,n)?e.textContent=t:(mr(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)hr(e,n,r);else if(t.nodeType)Array.isArray(n)?hr(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[X])&&(t[X]=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?hr(e,n,r):i?Vn(e,n,t,r):(n!=null&&hr(e,n),Vn(e,[],t))}return t}function dr(e,t,n,r){return e=En(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e==`function`||n&&!Array.isArray(e)&&(e=[e??``]),e}function fr(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)fr(e[n],t);else e&&e.nodeType&&e[zn]!==t&&(e[zn]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function pr(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 mr(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 hr(e,t,n,r){if(n===void 0)return pr(e,t)?e.textContent=``:mr(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[X],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[X])&&(r[X]=n||e)}const gr=On(),_r=()=>kn(gr);function vr(e){return(t,n,r)=>Gn(()=>{let[t,i]=Nn(r.events()),[a,o]=Nn(r.theme());gn(()=>{let e=r.onEvents(e=>i(()=>e)),t=r.onTheme(o);return()=>{e(),t()}});let s={page:r.page,events:t,last:e=>t().findLast(t=>t.type===e),append:r.append,theme:a};return In(gr,{value:s,get children(){return In(e,n)}})},t)}const yr=[`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`],br={"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 xr(e){let t=getComputedStyle(e),n={};for(let e of yr)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 Sr(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(br))$.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 Cr(e={}){let t,n=0,r=()=>{if(!t)return;let r=xr(t);if(!r)return;let i=Sr(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 gn(()=>{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 wr=/* @__PURE__ */ qn(`<div class=wb-chat><div class=wb-chat-new><textarea rows=1></textarea><button type=button>`),Tr=/* @__PURE__ */ qn(`<div class=wb-chat-message><span class=wb-chat-who></span><div class=wb-chat-bubble>`);const Er=`chat:message`;function Dr(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,i]=_r(r.events()),[a,o]=_r(r.theme());Nn(()=>{let e=r.onEvents(e=>i(()=>e)),t=r.onTheme(o);return()=>{e(),t()}});let s={page:r.page,events:t,last:e=>t().findLast(t=>t.type===e),append:r.append,theme:a,markdown:r.markdown};return xr(ii,{value:s,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
|
|
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};
|
|
@@ -38,6 +38,7 @@ function chatPlugin() {
|
|
|
38
38
|
},
|
|
39
39
|
events: { "chat:message": {
|
|
40
40
|
handOut: true,
|
|
41
|
+
forReader: true,
|
|
41
42
|
description: "a message in a chat: `{ chat, text }`, and `replaces` or `replyTo` (see below)"
|
|
42
43
|
} },
|
|
43
44
|
docs: () => fs.readFileSync(new URL("./README.md", import.meta.url), "utf8")
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
.wb-chat-who { font: 600 .68rem/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
|
|
8
8
|
.wb-chat-message[data-from=agent] .wb-chat-who { color: var(--accent); }
|
|
9
9
|
.wb-chat-bubble { white-space: pre-wrap; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--tint); border: 1px solid var(--border); }
|
|
10
|
+
/* rendered from markdown: its paragraphs and code carry the spacing */
|
|
11
|
+
.wb-chat-bubble[data-md] { white-space: normal; overflow-wrap: anywhere; }
|
|
12
|
+
.wb-chat-bubble[data-md] > :first-child { margin-top: 0; }
|
|
13
|
+
.wb-chat-bubble[data-md] > :last-child { margin-bottom: 0; }
|
|
14
|
+
.wb-chat-bubble[data-md] :is(p, ul, ol, pre, blockquote) { margin: 0 0 .5em; }
|
|
15
|
+
.wb-chat-bubble[data-md] pre { font-size: .8rem; padding: 8px 10px; border-radius: 6px; overflow-x: auto; max-width: 100%; }
|
|
16
|
+
.wb-chat-message[data-from=you] .wb-chat-bubble[data-md] a { color: inherit; }
|
|
10
17
|
.wb-chat-message[data-from=you] .wb-chat-bubble { border-radius: 14px 14px 4px 14px; background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
|
|
11
18
|
.wb-chat-new { display: flex; gap: 8px; align-items: flex-start; }
|
|
12
19
|
.wb-chat-new textarea { flex: 1; resize: none; font: inherit; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// plugins/code/diff.ts
|
|
2
2
|
const unprefix = (p) => p.replace(/\t.*$/, "").replace(/^"|"$/g, "").replace(/^[ab]\//, "");
|
|
3
3
|
function diffLines(text) {
|
|
4
|
+
if (!/^(@@ -\d|diff --git )/m.test(text)) return text.split("\n").map((line) => ({ kind: line[0] === "+" ? "add" : line[0] === "-" ? "del" : "context" }));
|
|
4
5
|
let file = "", oldFile = "", oldN = 0, newN = 0, inHunk = false;
|
|
5
6
|
let status = "", renamedFrom = "";
|
|
6
7
|
return text.split("\n").map((line) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var e=class{value;constructor(e){this.value=e}toString(){return this.value}};const t={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},n=e=>String(e).replace(/[&<>"']/g,e=>t[e]);function
|
|
1
|
+
var e=class{value;constructor(e){this.value=e}toString(){return this.value}};const t={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},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&&D()}function w(){l&&(d=l.querySelector(`main`)??l,f=x(),p&&!f.some(e=>e.id===p)?k():p&&E(),C())}const T=/* @__PURE__ */ new Map;function E(){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=T.get(n);return a`<div class="wb-thread-message" data-from="${t(e)}" data-wb-message="${e.id}"><span class="wb-thread-who">${t(e)}</span><div class="wb-thread-text"${i==null?``:r(` data-md`)}>${i==null?n:r(i)}</div></div>`},i=g.querySelector(`textarea`)?.value??``;g.innerHTML=String(a`
|
|
2
2
|
<blockquote class="wb-thread-quote">${e.comment.data.quote??``}</blockquote>
|
|
3
|
-
${e.comment.data.at&&
|
|
4
|
-
${!e.range&&
|
|
3
|
+
${e.comment.data.at&&a`<p class="wb-thread-at">${e.comment.data.at}</p>`}
|
|
4
|
+
${!e.range&&a`<p class="wb-thread-detached">This passage is no longer on the page.</p>`}
|
|
5
5
|
${[e.comment,...e.replies].map(n)}
|
|
6
6
|
<form class="wb-thread-reply">
|
|
7
|
-
<textarea rows="2" placeholder="Reply"></textarea>
|
|
7
|
+
<textarea rows="2" placeholder="Reply (Shift+Enter for a new line)"></textarea>
|
|
8
8
|
<div class="wb-thread-actions"><button type="submit" class="wb-comment-button wb-comment-primary">Reply</button><button type="button" class="wb-comment-button" data-close>Close thread</button></div>
|
|
9
|
-
</form>`),
|
|
10
|
-
<div class="wb-thread-actions"><button type="submit" class="wb-comment-button wb-comment-primary">Comment</button><button type="button" class="wb-comment-button" data-cancel>Cancel</button></div>`);function
|
|
9
|
+
</form>`),g.querySelector(`textarea`).value=i;for(let t of[e.comment,...e.replies]){let e=String(t.data.text??``);T.has(e)||u.markdown(e).then(n=>{T.set(e,n);let r=g.querySelector(`[data-wb-message="${CSS.escape(t.id)}"] .wb-thread-text`);r&&!r.hasAttribute(`data-md`)&&(r.innerHTML=n,r.setAttribute(`data-md`,``))},e=>console.error(`comments:`,e))}}function D(){let e=m.querySelector(`[data-thread="${p}"]`);if(!e)return;let t=parseFloat(e.style.top)+28,n=Math.min(360,document.documentElement.clientWidth-32),r=Math.max(16+scrollX,Math.min(parseFloat(e.style.left)+28-n,document.documentElement.clientWidth-n-16+scrollX));g.style.top=`${t}px`,g.style.left=`${r}px`,g.style.width=`${n}px`}function O(e){p=e,g.hidden=!1,g.querySelector(`textarea`)?.replaceWith(document.createElement(`textarea`)),E(),C(),g.querySelector(`textarea`)?.focus({preventScroll:!0})}function k(){p=null,g.hidden=!0,C()}let A=null;function j(){d=l.querySelector(`main`)??l;let e=getSelection();if(!e||e.isCollapsed||!e.rangeCount){h.matches(`:focus`)||(h.hidden=!0);return}let t=e.getRangeAt(0),n=e=>d.contains(e)&&!(e instanceof Element?e:e.parentElement)?.closest(`form, input, textarea, select, button`);!n(t.startContainer)||!n(t.endContainer)?h.hidden=!0:h.hidden=!M(t)}function M(e){let t=e.toString().trim();if(!t)return!1;let n=_(),r=y(n,e);if(!r)return!1;let i=n.text.indexOf(t,r.start),a=i>=0&&i<=r.end?i:r.start,o=e.startContainer instanceof Element?e.startContainer:e.startContainer.parentElement;for(;o&&o.parentElement!==d;)o=o.parentElement;A={quote:t,before:n.text.slice(Math.max(0,a-32),a),after:n.text.slice(a+t.length,a+t.length+32),block:o?[...d.children].indexOf(o):-1};let s=[...d.querySelectorAll(`[data-wb-at]`)].filter(t=>e.intersectsNode(t)&&t.textContent).map(e=>e.dataset.wbAt);s.length&&(A.at=s.length>1&&s.at(-1)!==s[0]?`${s[0]} – ${s.at(-1)}`:s[0]);let c=e.getClientRects(),l=c[c.length-1]??e.getBoundingClientRect();return h.style.top=`${l.bottom+scrollY+6}px`,h.style.left=`${Math.min(l.right+scrollX-40,document.documentElement.clientWidth-110+scrollX)}px`,!0}const N=document.createElement(`button`);N.type=`button`,N.className=`wb-line-comment`,N.textContent=`+`,N.title=`Comment on this line (drag for several)`,N.hidden=!0;let P=null,F=null;const I=e=>{let t=e instanceof Element?e.closest(`pre .line`):null;return t&&d.contains(t)&&!t.closest(`form`)?t:null};function L(e,t){let[n,r]=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?[t,e]:[e,t],i=document.createRange();return i.setStart(n,0),i.setEnd(r,r.childNodes.length),i}function R(e){P=e;let t=e.getBoundingClientRect(),n=e.closest(`pre`).getBoundingClientRect();N.style.top=`${t.top+scrollY+t.height/2-10}px`,N.style.left=`${Math.max(scrollX+2,n.left+scrollX-24)}px`,N.hidden=!1}function z(e){if(F){let t=F.pre.getBoundingClientRect(),n=F.from.getBoundingClientRect().left+4,r=I(document.elementFromPoint(n,Math.min(Math.max(e.clientY,t.top+1),t.bottom-1)));if(r&&F.pre.contains(r)&&r!==F.to){F.to=r;let e=CSS.highlights,t=window.Highlight;e&&t&&e.set(`wb-comment-active`,new t(L(F.from,F.to)))}return}if(e.target===N)return;let t=I(e.target);if(t)return R(t);if(N.hidden||!P)return;let n=P.closest(`pre`),r=n.getBoundingClientRect(),i=N.getBoundingClientRect(),a=e.clientX>=i.left-4&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom,o=a?I(document.elementFromPoint(P.getBoundingClientRect().left+4,e.clientY)):null;o&&n.contains(o)?R(o):a&&e.clientY>=i.top-4&&e.clientY<=i.bottom+4||(N.hidden=!0,P=null)}const B=document.createElement(`form`);B.className=`wb-thread wb-comment-new`,B.hidden=!0,B.innerHTML=String(a`<blockquote class="wb-thread-quote"></blockquote><textarea rows="3" placeholder="Your comment (Shift+Enter for a new line)"></textarea>
|
|
10
|
+
<div class="wb-thread-actions"><button type="submit" class="wb-comment-button wb-comment-primary">Comment</button><button type="button" class="wb-comment-button" data-cancel>Cancel</button></div>`);function V(){if(!A)return;B.querySelector(`blockquote`).textContent=A.at?`${A.at}\n${A.quote}`:A.quote,B.style.top=h.style.top;let e=Math.min(360,document.documentElement.clientWidth-32);B.style.width=`${e}px`,B.style.left=`${Math.max(16+scrollX,Math.min(parseFloat(h.style.left),document.documentElement.clientWidth-e-16+scrollX))}px`,B.hidden=!1,h.hidden=!0,B.querySelector(`textarea`).focus({preventScroll:!0})}const H=(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,N,g,B),document.addEventListener(`mousemove`,z),document.documentElement.addEventListener(`mouseleave`,()=>{F||(N.hidden=!0,P=null)}),N.addEventListener(`mousedown`,e=>{if(!P||e.button!==0)return;e.preventDefault();let t=CSS.highlights,n=window.Highlight;t&&n&&t.set(`wb-comment-active`,new n(L(P,P))),F={pre:P.closest(`pre`),from:P,to:P}}),document.addEventListener(`mouseup`,()=>{if(!F)return;let{from:e,to:t}=F;F=null,N.hidden=!0,M(L(e,t))?V():C()});let r=0;document.addEventListener(`selectionchange`,()=>{clearTimeout(r),r=window.setTimeout(j,150)}),h.addEventListener(`mousedown`,e=>e.preventDefault()),h.addEventListener(`click`,V);for(let e of[B,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())});B.addEventListener(`submit`,async e=>{e.preventDefault();let t=B.querySelector(`textarea`).value.trim();if(!t||!A)return;let n=await u.append(o,{...A,text:t});B.querySelector(`textarea`).value=``,B.hidden=!0,A=null,getSelection()?.removeAllRanges(),w(),O(n.id)}),B.querySelector(`[data-cancel]`).addEventListener(`click`,()=>{B.hidden=!0,A=null}),m.addEventListener(`click`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&(p===t?k():O(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=``,w())}),g.addEventListener(`click`,async e=>{if(!e.target.closest(`[data-close]`)||!p)return;let t=p;k(),u.markRead(f.find(e=>e.id===t)?.replies.map(e=>e.id)??[]),await u.append(c,{replyTo:t}),w()}),m.addEventListener(`wb-reveal`,e=>{let t=e.target.closest(`[data-thread]`)?.dataset.thread;t&&p!==t&&O(t)}),document.addEventListener(`dblclick`,e=>{let t=e.target;!p||g.contains(t)||m.contains(t)||k()}),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&(B.hidden?p&&k():(B.hidden=!0,A=null))}),u.onEvents(w),u.onRendered(w),new ResizeObserver(()=>C()).observe(l),addEventListener(`resize`,()=>C()),w()};export{H as default};
|
|
@@ -28,7 +28,9 @@ page until the reader closes it. Answer a comment the way it asks:
|
|
|
28
28
|
\`whiteboard append --page <file> --type comments:reply --data '{"replyTo":"<comment id>","text":"…"}'\`
|
|
29
29
|
|
|
30
30
|
Your replies show as the agent's, and \`wait\` and \`watch\` skip what you
|
|
31
|
-
append, so you don't hear your own replies
|
|
31
|
+
append, so you don't hear your own replies. Comments and replies are
|
|
32
|
+
markdown: code in backticks or fences, lists, links, \`#12\`; raw HTML and
|
|
33
|
+
blocks (\`:::…\`, \`:button\`) show as written.`;
|
|
32
34
|
function comments() {
|
|
33
35
|
return {
|
|
34
36
|
name: "comments",
|
|
@@ -40,6 +42,7 @@ function comments() {
|
|
|
40
42
|
},
|
|
41
43
|
"comments:reply": {
|
|
42
44
|
handOut: true,
|
|
45
|
+
forReader: true,
|
|
43
46
|
description: "a reply in a thread: `{ replyTo, text }`"
|
|
44
47
|
},
|
|
45
48
|
"comments:resolve": { description: "the reader closed a thread: `{ replyTo }`" }
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
.wb-comment-badge { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px 12px 12px 3px; font-size: .72rem; font-weight: 600; background: var(--bg, Canvas); color: var(--accent, #1d5bbf); border: 1px solid color-mix(in srgb, var(--accent, #1d5bbf) 50%, transparent); }
|
|
12
12
|
.wb-comment-badge[data-agent] { background: var(--accent, #1d5bbf); color: var(--accent-text, #fff); }
|
|
13
13
|
.wb-comment-badge[data-detached] { border-style: dashed; }
|
|
14
|
+
/* a reply the reader hasn't read: a dot on the badge until its thread is open and it is in view */
|
|
15
|
+
.wb-comment-badge[data-unread]::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad, #c4352b); border: 2px solid var(--bg, Canvas); }
|
|
14
16
|
.wb-thread { background: var(--bg, Canvas); border: 1px solid var(--border, #e3e5e9); border-radius: 8px; padding: 12px 14px; box-shadow: 0 8px 28px rgb(0 0 0 / .16); display: grid; gap: 10px; font-size: .9rem; }
|
|
15
17
|
.wb-thread-quote { margin: 0; padding-left: 10px; border-left: 3px solid color-mix(in srgb, var(--accent, #1d5bbf) 50%, transparent); color: var(--muted, #696e76); font-size: .85rem; max-height: 6.5em; overflow: auto; white-space: pre-wrap; }
|
|
16
18
|
.wb-thread-detached { margin: 0; color: var(--muted, #696e76); font-size: .8rem; }
|
|
@@ -18,6 +20,12 @@
|
|
|
18
20
|
.wb-thread-who { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #696e76); }
|
|
19
21
|
.wb-thread-message[data-from=agent] .wb-thread-who { color: var(--accent, #1d5bbf); }
|
|
20
22
|
.wb-thread-text { white-space: pre-wrap; line-height: 1.45; }
|
|
23
|
+
/* rendered from markdown: its paragraphs and code carry the spacing */
|
|
24
|
+
.wb-thread-text[data-md] { white-space: normal; overflow-wrap: anywhere; }
|
|
25
|
+
.wb-thread-text[data-md] > :first-child { margin-top: 0; }
|
|
26
|
+
.wb-thread-text[data-md] > :last-child { margin-bottom: 0; }
|
|
27
|
+
.wb-thread-text[data-md] :is(p, ul, ol, pre, blockquote) { margin: 0 0 .5em; }
|
|
28
|
+
.wb-thread-text[data-md] pre { font-size: .8rem; padding: 8px 10px; border-radius: 6px; overflow-x: auto; max-width: 100%; }
|
|
21
29
|
.wb-thread textarea { width: 100%; resize: vertical; font: inherit; }
|
|
22
30
|
.wb-thread-reply { display: grid; gap: 8px; margin: 0; }
|
|
23
31
|
.wb-thread-actions { display: flex; gap: 8px; }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Issues and pull/merge requests of the project's GitHub or GitLab repository
|
|
2
|
+
link themselves: write `#12` for issue 12 and `!34` for pull or merge request
|
|
3
|
+
34, as plain text. `owner/repo#12` and `group/project!34` point into another
|
|
4
|
+
repository on the same host. Inside code (`` `#12` ``) they stay text.
|
|
5
|
+
|
|
6
|
+
The repository is read from the project's `origin` remote, so a self-hosted
|
|
7
|
+
GitLab works too. Without such a remote they stay text; a config can say
|
|
8
|
+
which: `forge({ repo: 'group/project', host: 'gitlab.example.com', kind: 'gitlab' })`.
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
Fixed in !34, which closes #12 (see also bigmistqke/other#3).
|
|
12
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { definePlugin } from "@bigmistqke/whiteboard";
|
|
4
|
+
// plugins/forge/index.ts
|
|
5
|
+
/** A git remote's URL → its host and repository path: https, ssh (`git@host:path`), ssh://. */
|
|
6
|
+
function parseRemote(url) {
|
|
7
|
+
const u = url.trim();
|
|
8
|
+
const scp = /^[\w.-]+@([^:/]+):(.+?)(?:\.git)?\/?$/.exec(u);
|
|
9
|
+
if (scp) return {
|
|
10
|
+
host: scp[1],
|
|
11
|
+
repo: scp[2]
|
|
12
|
+
};
|
|
13
|
+
const full = /^(?:https?|ssh|git):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+?)(?:\.git)?\/?$/.exec(u);
|
|
14
|
+
if (full) return {
|
|
15
|
+
host: full[1],
|
|
16
|
+
repo: full[2]
|
|
17
|
+
};
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
/** GitHub or GitLab, by the host's name; null for any other. */
|
|
21
|
+
const kindOf = (host) => /(^|\.)github\./.test(host) ? "github" : /(^|\.)gitlab\./.test(host) || /^gitlab/.test(host) ? "gitlab" : null;
|
|
22
|
+
/** The links for one forge: issues (`#n`) and pull or merge requests (`!n`), here or in `owner/repo`. */
|
|
23
|
+
function forgeLinks({ kind, host, repo }) {
|
|
24
|
+
const base = (path) => `https://${host}/${path ?? repo}`;
|
|
25
|
+
const ref = (sign) => new RegExp(`(?<![\\w/.#!-])(?:([\\w.-]+(?:/[\\w.-]+)+))?${sign}(\\d+)(?![\\w-])`, "g");
|
|
26
|
+
const issue = kind === "github" ? "issues" : "-/issues";
|
|
27
|
+
const change = kind === "github" ? "pull" : "-/merge_requests";
|
|
28
|
+
const what = kind === "github" ? "pull request" : "merge request";
|
|
29
|
+
return [{
|
|
30
|
+
pattern: ref("#"),
|
|
31
|
+
href: (m) => `${base(m[1])}/${issue}/${m[2]}`,
|
|
32
|
+
title: (m) => `issue ${m[1] ?? repo}#${m[2]}`
|
|
33
|
+
}, {
|
|
34
|
+
pattern: ref("!"),
|
|
35
|
+
href: (m) => `${base(m[1])}/${change}/${m[2]}`,
|
|
36
|
+
title: (m) => `${what} ${m[1] ?? repo}!${m[2]}`
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
/** The project's forge, from its `origin` remote; null without one it knows. */
|
|
40
|
+
function detect(dir) {
|
|
41
|
+
let url;
|
|
42
|
+
try {
|
|
43
|
+
url = execFileSync("git", [
|
|
44
|
+
"remote",
|
|
45
|
+
"get-url",
|
|
46
|
+
"origin"
|
|
47
|
+
], {
|
|
48
|
+
cwd: dir,
|
|
49
|
+
encoding: "utf8",
|
|
50
|
+
stdio: [
|
|
51
|
+
"ignore",
|
|
52
|
+
"pipe",
|
|
53
|
+
"ignore"
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
} catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const remote = parseRemote(url);
|
|
60
|
+
const kind = remote && kindOf(remote.host);
|
|
61
|
+
return remote && kind ? {
|
|
62
|
+
kind,
|
|
63
|
+
...remote
|
|
64
|
+
} : null;
|
|
65
|
+
}
|
|
66
|
+
function forge(options = {}) {
|
|
67
|
+
return definePlugin({
|
|
68
|
+
name: "forge",
|
|
69
|
+
links({ dir }) {
|
|
70
|
+
const found = detect(dir);
|
|
71
|
+
const host = options.host ?? found?.host;
|
|
72
|
+
const repo = options.repo ?? found?.repo;
|
|
73
|
+
const kind = options.kind ?? (options.host ? kindOf(options.host) : null) ?? found?.kind;
|
|
74
|
+
return host && repo && kind ? forgeLinks({
|
|
75
|
+
kind,
|
|
76
|
+
host,
|
|
77
|
+
repo
|
|
78
|
+
}) : [];
|
|
79
|
+
},
|
|
80
|
+
docs: () => fs.readFileSync(new URL("./README.md", import.meta.url), "utf8")
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export { forge as default, detect, forgeLinks, kindOf, parseRemote };
|